From rpettit@REDACTED Sat Dec 1 00:33:35 2007 From: rpettit@REDACTED (Rick Pettit) Date: Fri, 30 Nov 2007 17:33:35 -0600 Subject: [erlang-questions] Question about higher order function In-Reply-To: <5C34396B-D566-4528-9F5B-866E87F5CAC9@ketralnis.com> References: <47504EA9.9040508@gmx.de> <47506769.9000909@cs.ntua.gr> <5C34396B-D566-4528-9F5B-866E87F5CAC9@ketralnis.com> Message-ID: <20071130233335.GA9419@vailsys.com> On Fri, Nov 30, 2007 at 12:03:09PM -0800, David King wrote: > >> Can someone tell me if I'm doing something wrong here or if Erlang is > >> really so akward and clumsy why it is this way? > > Not knowing a language and trying to learn it is OK - it's a very good > > thing actually. > > Not knowing a language and characterizing it with adjectives such as > > "awkward", "clumsy" and "terrible" is not particularly constructive > > in my opinion. > > He didn't say it *was*, he asked why this particular construct was, > *if* indeed the way he found was the only one. That's a perfectly > valid question. > > If someone asked why it's so awkward and clumsy to use mnesia to do > something for which you should be using an RDBMS, the answer would be > "because that's not what it's designed for. Here is what it does > well, and here's why it's awkward to do that". I agree with Kostis, the original posting didn't come across as particularly constructive or polite. Perhaps I misunderstood it. That, or it was just clumsily and awkwardly written. -Rick From kenneth.lundin@REDACTED Sat Dec 1 00:47:34 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Sat, 1 Dec 2007 00:47:34 +0100 Subject: [erlang-questions] etop returns garbage In-Reply-To: <032101c8335e$f4930f80$e600000a@users.rbc.ru> References: <032101c8335e$f4930f80$e600000a@users.rbc.ru> Message-ID: Hi, etop uses tracing to collect it's data. If you have activated tracing at the same it will most probably disturb etop. The Erlang VM has powerful built-in tracing facilities intended for troubleshooting and profiling on live systems. Tracing should never be activated or used by an application it self as part of the normal operation. /Kenneth Erlang/OTP team at Ericsson On 11/30/07, George B Hazan wrote: > Hello. > > I tried to use etop to profile my ejabberd, but got nothing but a bunch of > strings like > > ============== 8< ============== >8 ============== > Erlang top got garbage {trace_ts,<4391.27752.0>, > out, > {gen_fsm,loop,7}, > {1196,433374,653419}} > Erlang top got garbage {trace_ts,<4391.21022.4>, > out, > {gen,wait_resp_mon,3}, > {1196,433374,654029}} > Erlang top got garbage {trace_ts,<4391.21038.4>, > out, > {gen,wait_resp_mon,3}, > {1196,433374,654041}} > > ============== 8< ============== >8 ============== > > What am I doing wrong? > > -- > WMBR, George Hazan (ghazan@REDACTED) > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From christophe.romain@REDACTED Sat Dec 1 00:53:08 2007 From: christophe.romain@REDACTED (Christophe Romain) Date: Sat, 1 Dec 2007 00:53:08 +0100 Subject: [erlang-questions] PostgreSQL driver In-Reply-To: <20071130223804.131880@gmx.net> References: <474AB442.4020802@vlayko.tv> <474FE420.5040905@niclux.org> <20071130123631.8920@gmx.net> <60438E7D-519D-48BC-A1EE-77016D83A251@ketralnis.com> <20071130223804.131880@gmx.net> Message-ID: <2A3BE698-A07C-42C3-BFD3-B9A8655760D2@process-one.net> we must not let pgsql driver in that state. does anyone have time to check if all theses version can be merged ? From yinso.chen@REDACTED Sat Dec 1 02:19:53 2007 From: yinso.chen@REDACTED (YC) Date: Fri, 30 Nov 2007 17:19:53 -0800 Subject: [erlang-questions] PostgreSQL driver In-Reply-To: <2A3BE698-A07C-42C3-BFD3-B9A8655760D2@process-one.net> References: <474AB442.4020802@vlayko.tv> <474FE420.5040905@niclux.org> <20071130123631.8920@gmx.net> <60438E7D-519D-48BC-A1EE-77016D83A251@ketralnis.com> <20071130223804.131880@gmx.net> <2A3BE698-A07C-42C3-BFD3-B9A8655760D2@process-one.net> Message-ID: <779bf2730711301719t56f3d35bmb87749d88313a99a@mail.gmail.com> Shouldn't mysql also be considered together? So erlang can get closer toward having a general sql database interface like other languages. Not to pile on scope or anything :) I'll help test :) On Nov 30, 2007 3:53 PM, Christophe Romain < christophe.romain@REDACTED> wrote: > we must not let pgsql driver in that state. > does anyone have time to check if all theses version can be merged ? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.hopwood@REDACTED Sat Dec 1 02:35:10 2007 From: david.hopwood@REDACTED (David Hopwood) Date: Sat, 01 Dec 2007 01:35:10 +0000 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: References: <375691.17118.qm@web81211.mail.mud.yahoo.com> <474E3520.1010903@industrial-designers.co.uk> Message-ID: <4750BA4E.8000603@industrial-designers.co.uk> Brent Fulgham wrote: > On Nov 28, 2007, at 7:42 PM, David Hopwood wrote: > >> The times that take longer than a few seconds don't affect my point >> that there is systematic bias against language implementations with >> significant startup/shutdown times. > > You say this as though significant startup/shutdown times should be > considered acceptable. I think they should. This obviously depends on the intended domain of application of the language (and on whether it supports a way of submitting tasks to be run by an existing VM process). Startup/shutdown time is an aspect of language implementation performance and it's perfectly reasonable to measure it, but this cost should not be attributed to all of the other benchmarks, because that's not realistic for typical uses of those language implementations. > I disagree -- take for example SBCL or SML/NJ, both of which have > sizeable runtimes and yet manage to produce very good times. That's beside the point. It can be more difficult to optimize startup time for one language implementation than another, or the implementation developers may have considered this to be a low priority relative to other considerations. -- David Hopwood From david.hopwood@REDACTED Sat Dec 1 02:49:59 2007 From: david.hopwood@REDACTED (David Hopwood) Date: Sat, 01 Dec 2007 01:49:59 +0000 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <460255.84202.qm@web60525.mail.yahoo.com> References: <460255.84202.qm@web60525.mail.yahoo.com> Message-ID: <4750BDC7.6060407@industrial-designers.co.uk> Isaac Gouy wrote: > --- David Hopwood wrote: > > -snip- >>>> This is an elementary error, sufficiently serious that it's not >>>> enough just for the FAQ to mention it in passing. It >>>> systematically biases the results against language implementations >>>> with a significant startup/shutdown time, or other fixed overheads. >>>> Combined with the fact that most of the benchmarks only run for a few >>>> seconds, the resulting bias is quite large. >>> >>> Specifically how large is the resulting bias? >> >> Probably about 10% in some cases (for JVM-based implementations and >> Smalltalk). > > Sorry, I haven't figured out a way to make sense of that - 10% of what? Of some of the benchmark times. What else? > I'm also a little puzzled that you say "probably about 10% in some > cases", you claimed there was a serious elementary error and the > resulting bias is quite large - is that just speculation? Suppose for the sake of argument that we take the 'startup' benchmark as a rough estimate of startup/shutdown time. (I don't claim that it is a good estimate, but it will do for this argument.) According to the AMD Sempron results, Erlang HiPE takes 0.1992 s for the startup benchmark on that platform (false precision, but never mind that). It takes 0.77 s on the pidigits benchmark on the same platform. So for this benchmark run, around 26% of the time is taken in startup/shutdown. If this time were not included, the Erlang HiPE entry would move from 17th to around 12th place (if we assume that the startup/shutdown times for the entries between those places are not significant, which is likely to be true in this particular case). -- David Hopwood From kosik@REDACTED Sat Dec 1 12:28:26 2007 From: kosik@REDACTED (Matej Kosik) Date: Sat, 01 Dec 2007 12:28:26 +0100 Subject: [erlang-questions] simple question: how to convert integers to string with fixed digits Message-ID: <4751455A.2040307@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, In Squeak there is a method Integer > printing-numerative > printStringLength:padded: It can be used as follows. Evaluation of 2 printStringLength: 2 padded: true yields '02' Evaluation of 12 printStringLength: 2 padded: true yields '12' Is there an analogous function in Erlang? Note that I am not looking for integer_to_list/1 because I need to get strings of "fixed length" padded with zeros on the left. Is there directly something similar or should I write my own such function? NOTE: I would like to print dates and times into my logs. - ----------------------------------------------------------------------------------------------- Similar question. In Squeak there is a method Integer > printing-numerative > printStringBase:length:padded: Evaluation of 11 printStringBase: 16 length: 2 padded: true yields '0B' Evaluation of 255 printStringBase: 16 length: 2 padded: true yields 'FF' Is there analogous function in Erlang? The `format' string already has support for printing hexadecimals but not of "fixed length". Am I right? NOTE: I would like to print MAC addresses in a standard way. Thanks in advance. - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHUUVZL+CaXfJI/hgRAtvPAJ4y0vDG0o4VhDpyU8+ev4+ZVeKtHQCfbmi1 MEuA/gT9N4zljPALq0dsURA= =q+a1 -----END PGP SIGNATURE----- From erlang@REDACTED Sat Dec 1 12:42:44 2007 From: erlang@REDACTED (Joe Armstrong) Date: Sat, 1 Dec 2007 12:42:44 +0100 Subject: [erlang-questions] wow: MD5 broken Message-ID: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> MD5 is really broken - gulp see http://www.win.tue.nl/hashclash/SoftIntCodeSign/ You can download two files from this page -- here's the proof # there are not zero bytes $ wc HelloWorld-colliding.exe GoodbyeWorld-colliding.exe 82 711 41792 HelloWorld-colliding.exe 82 709 41792 GoodbyeWorld-colliding.exe 164 1420 83584 total # the crc32 checksums are different $ crc32 HelloWorld-colliding.exe GoodbyeWorld-colliding.exe 8beb795c HelloWorld-colliding.exe 9ede53db GoodbyeWorld-colliding.exe $ # the mnd5sums are the same $ md5sum HelloWorld-colliding.exe GoodbyeWorld-colliding.exe 18fcc4334f44fed60718e7dacd82dddf HelloWorld-colliding.exe 18fcc4334f44fed60718e7dacd82dddf GoodbyeWorld-colliding.exe I wonder how many millions of programs have now become insecure? /Joe Armstrong From chsu79@REDACTED Sat Dec 1 12:57:41 2007 From: chsu79@REDACTED (Christian S) Date: Sat, 1 Dec 2007 12:57:41 +0100 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> Message-ID: As a consequence the erlang:md5* functions should probably be deprecated asap. 2007/12/1, Joe Armstrong : > MD5 is really broken - gulp see What hashing-functions are still considered secure? From toby@REDACTED Sat Dec 1 13:12:47 2007 From: toby@REDACTED (Toby Thain) Date: Sat, 1 Dec 2007 10:12:47 -0200 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> Message-ID: <4EED01E9-2A4B-47E0-8AAF-E5735EEFFE9A@smartgames.ca> On 1-Dec-07, at 9:42 AM, Joe Armstrong wrote: > MD5 is really broken - gulp see > > http://www.win.tue.nl/hashclash/SoftIntCodeSign/ > > You can download two files from this page -- here's the proof > > # there are not zero bytes > > $ wc HelloWorld-colliding.exe GoodbyeWorld-colliding.exe > 82 711 41792 HelloWorld-colliding.exe > 82 709 41792 GoodbyeWorld-colliding.exe > 164 1420 83584 total > # the crc32 checksums are different > > $ crc32 HelloWorld-colliding.exe GoodbyeWorld-colliding.exe > 8beb795c HelloWorld-colliding.exe > 9ede53db GoodbyeWorld-colliding.exe > > $ # the mnd5sums are the same > $ md5sum HelloWorld-colliding.exe GoodbyeWorld-colliding.exe > 18fcc4334f44fed60718e7dacd82dddf HelloWorld-colliding.exe > 18fcc4334f44fed60718e7dacd82dddf GoodbyeWorld-colliding.exe > > I wonder how many millions of programs have now become insecure? The paper concludes, "MD5 should no longer be used as a hash function for software integrity or code signing purposes." ...but isn't a good workaround just to use more than one hash, e.g. MD5+SHA1? --Toby > > /Joe Armstrong > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From per@REDACTED Sat Dec 1 13:44:36 2007 From: per@REDACTED (Per Hedeland) Date: Sat, 1 Dec 2007 13:44:36 +0100 (CET) Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> Message-ID: <200712011244.lB1Ciaim041788@pluto.hedeland.org> "Joe Armstrong" wrote: > >MD5 is really broken - gulp see > >http://www.win.tue.nl/hashclash/SoftIntCodeSign/ "Broken" is a too strong word - for any value produced by any hashing method, there will obviously be an infinite number of different inputs that produce the same value - the question is how hard it is to find them. Or more precisely, the/a theoretical question (important though it is) which this work addresses, is "how hard is it to find two different inputs that result in the same hash value?" - and the answer is "not anywhere near as hard as we thought". The practical/security question though, is "given an input and a resulting hash value, how hard is it to find a different input that gives the same hash value?" - and the answer remains, as they point out, "impossible". So yeah, the results indicate that you should probably try to migrate away from using md5, since the troublesome answers to the theoretical question imply that the bar to finding an answer to the practical one is lower than we thought - but there's nothing "broken" *yet*. --Per Hedeland From hokan.stenholm@REDACTED Sat Dec 1 13:03:28 2007 From: hokan.stenholm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Stenholm?=) Date: Sat, 01 Dec 2007 13:03:28 +0100 Subject: [erlang-questions] simple question: how to convert integers to string with fixed digits In-Reply-To: <4751455A.2040307@fiit.stuba.sk> References: <4751455A.2040307@fiit.stuba.sk> Message-ID: <47514D90.2080003@bredband.net> Matej Kosik wrote: You can experiment with the io:format(...) (or io_lib:format(...)) string, this works in you case: 6> io:format("~2..0w", [2]). 02 10> io:format("~2.16.0B", [255]). FF > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello, > > In Squeak there is a method > > Integer > printing-numerative > printStringLength:padded: > > It can be used as follows. Evaluation of > > 2 printStringLength: 2 padded: true > > yields > > '02' > > Evaluation of > > 12 printStringLength: 2 padded: true > > yields > > '12' > > Is there an analogous function in Erlang? Note that I am not looking for > > integer_to_list/1 > > because I need to get strings of "fixed length" padded with zeros on the left. Is there directly > something similar or should I write my own such function? > > NOTE: I would like to print dates and times into my logs. > - ----------------------------------------------------------------------------------------------- > Similar question. > > In Squeak there is a method > > Integer > printing-numerative > printStringBase:length:padded: > > Evaluation of > > 11 printStringBase: 16 length: 2 padded: true > > yields > > '0B' > > Evaluation of > > 255 printStringBase: 16 length: 2 padded: true > > yields > > 'FF' > > Is there analogous function in Erlang? The `format' string already has support for printing > hexadecimals but not of "fixed length". Am I right? > > NOTE: I would like to print MAC addresses in a standard way. > > Thanks in advance. > - -- > Matej Kosik > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHUUVZL+CaXfJI/hgRAtvPAJ4y0vDG0o4VhDpyU8+ev4+ZVeKtHQCfbmi1 > MEuA/gT9N4zljPALq0dsURA= > =q+a1 > -----END PGP SIGNATURE----- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > From bjorn@REDACTED Sat Dec 1 14:05:10 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 01 Dec 2007 14:05:10 +0100 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> Message-ID: "Christian S" writes: > As a consequence the erlang:md5* functions should probably be deprecated asap. I have added a note to the documentation saying that MD5 is not considered safe for code-signing or software integrity purposes. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From r.kelsall@REDACTED Sat Dec 1 14:17:19 2007 From: r.kelsall@REDACTED (Richard Kelsall) Date: Sat, 01 Dec 2007 13:17:19 +0000 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <4EED01E9-2A4B-47E0-8AAF-E5735EEFFE9A@smartgames.ca> References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> <4EED01E9-2A4B-47E0-8AAF-E5735EEFFE9A@smartgames.ca> Message-ID: <47515EDF.50605@millstream.com> Toby Thain wrote: > On 1-Dec-07, at 9:42 AM, Joe Armstrong wrote: > >> MD5 is really broken - gulp see ... >> I wonder how many millions of programs have now become insecure? > > The paper concludes, > "MD5 should no longer be used as a hash function for software > integrity or code signing purposes." > ...but isn't a good workaround just to use more than one hash, e.g. > MD5+SHA1? No. Use a better algorithm like SHA-256 or SHA-512. There are plenty of other good hash algorithms. Pick one from the table here that says "No" in the collisions column rather than creating your own http://en.wikipedia.org/wiki/Cryptographic_hash_function Richard. From david_holz@REDACTED Sat Dec 1 14:46:39 2007 From: david_holz@REDACTED (David Holz) Date: Sat, 1 Dec 2007 13:46:39 +0000 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <200712011244.lB1Ciaim041788@pluto.hedeland.org> References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> <200712011244.lB1Ciaim041788@pluto.hedeland.org> Message-ID: From: per@REDACTED > The practical/security question though, is "given an input and a > resulting hash value, how hard is it to find a different input that > gives the same hash value?" - and the answer remains, as they point out, > "impossible". Exactly. For those who haven't read the entire article: The vulnerability is only when doing MD5 checks between two files as a means for equality comparison, *without caring what the MD5 value actually is*, ie not using a "target" MD5 value like handshakes and such do. What it does is *change BOTH files* to make them have the same arbitrary MD5, which is necessarily different from the original MD5 of the source file. If you calculate a MD5 hash for a given byte array, it still CANNOT be practically spoofed, and this scheme only works if you can innocuously append arbitrary bytes to the end of the source data without affecting its semantics which is in many cases impossible, especially in streaming data. Oh, and you'd have to spend about 2 days of number crunching to calculate the appended bytes. But I agree, small cracks have been appearing in MD5 and migration to something else should be effected before some clever device is implemented to fully break it. However, the sky is definitely NOT falling on MD5 because of this discovery. _________________________________________________________________ Connect and share in new ways with Windows Live. http://www.windowslive.com/connect.html?ocid=TXT_TAGLM_Wave2_newways_112007 From r.kelsall@REDACTED Sat Dec 1 16:09:17 2007 From: r.kelsall@REDACTED (Richard Kelsall) Date: Sat, 01 Dec 2007 15:09:17 +0000 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> <200712011244.lB1Ciaim041788@pluto.hedeland.org> Message-ID: <4751791D.7040900@millstream.com> David Holz wrote: > From: per@REDACTED >> The practical/security question though, is "given an input and a >> resulting hash value, how hard is it to find a different input that >> gives the same hash value?" - and the answer remains, as they point out, >> "impossible". > ... > But I agree, small cracks have been appearing in MD5 and migration to something else should be effected before some clever device is implemented to fully break it. However, the sky is definitely NOT falling on MD5 because of this discovery. Migration may need to be completed several years before the 'clever device' is invented (assuming omniscience relating to it's current existence) depending on the use of the hash and the persistence of the data it's protecting. Richard. From michael.regen@REDACTED Sat Dec 1 17:21:41 2007 From: michael.regen@REDACTED (Michael Regen) Date: Sat, 1 Dec 2007 17:21:41 +0100 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <4751791D.7040900@millstream.com> References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> <200712011244.lB1Ciaim041788@pluto.hedeland.org> <4751791D.7040900@millstream.com> Message-ID: <9b59d0270712010821v5b24d827t6cf89c2ad85902a4@mail.gmail.com> Well, whether md5 is broken or not depends on the application. If you need to be sure that the message created by a trustworthy person, who also securely delivered the hash to you, was not altered by a malicious person - nothing is broken. Example: You received the md5 hash of a file you want to download via a secure channel. Now you download the file and compare it to the md5 hash. If it was altered by someone else you will still detect that. Nevertheless it's _widely_ recommended to start migrating to something more secure like sha256. Since at least two years, so you should already be in the process of abandoning md5. Priority probably depends on how long your solutions need to work and how high your security requirements are. But: If you cannot trust the person who created the message and got only a md5 hash, you cannot be sure that the person afterwards sends you the same message from which the hash was calculated. Funny example: http://www.win.tue.nl/hashclash/Nostradamus/ The later attack on md5 exists at least since 2004. See http://web.archive.org/web/20070629090049/http://www.infosec.sdu.edu.cn/paper/md5-attack.pdf. So there is nothing new here. Cheers, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Sat Dec 1 17:41:16 2007 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Sat, 1 Dec 2007 08:41:16 -0800 (PST) Subject: [erlang-questions] idea: DB in Prolog application in Erlang In-Reply-To: <9b08084c0711300145v162a3f67nf3869f0bf2334848@mail.gmail.com> Message-ID: <779405.78224.qm@web38807.mail.mud.yahoo.com> --- Joe Armstrong wrote: > Question: > > A long time ago Erlang started as a extension to > Prolog ... > > Now Prolog is a wonderful language for querying > databases in - > < compared to Prolog queries>> > > So why when we talk about Erlang + an external data > base do we > automatically reach for an SQL data base? > ... > Embedded prolog queries in Erlang would be *very* > nice, just > interpreting erlang variables > as prolog logical variables. > > Comments anybody? Why not talk to Hans "Mnemosyne" Nilsson about it? Best, Thomas ____________________________________________________________________________________ Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ From thomasl_erlang@REDACTED Sat Dec 1 17:37:14 2007 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Sat, 1 Dec 2007 08:37:14 -0800 (PST) Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> Message-ID: <947665.39169.qm@web38801.mail.mud.yahoo.com> --- Joe Armstrong wrote: > MD5 is really broken - gulp see > > http://www.win.tue.nl/hashclash/SoftIntCodeSign/ As I understand it, SHA-1 is creaking at the seams too. Maybe the cryptically inclined among us want to take part in the design of SHA-3? (Not one of my areas of competence, I'm afraid :-) http://csrc.nist.gov/groups/ST/hash/sha-3/index.html Best, Thomas ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs From kosik@REDACTED Sat Dec 1 18:57:11 2007 From: kosik@REDACTED (Matej Kosik) Date: Sat, 01 Dec 2007 18:57:11 +0100 Subject: [erlang-questions] simple question: how to convert integers to string with fixed digits In-Reply-To: <47514D90.2080003@bredband.net> References: <4751455A.2040307@fiit.stuba.sk> <47514D90.2080003@bredband.net> Message-ID: <4751A077.4080408@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 H?kan Stenholm wrote: > Matej Kosik wrote: > > You can experiment with the io:format(...) (or io_lib:format(...)) > string, this works in you case: > > 6> io:format("~2..0w", [2]). > 02 > > 10> io:format("~2.16.0B", [255]). > FF > These procedures work fine. Reading the manual I was not able to recognize such possibilities. They print the term on the terminal in the way I need it. These parameters also kind be used with io_lib:fwrite/2 even though its results, for example in these cases: io_lib:fwrite("~2.16.0B", [12]). is weird [["0","C"]] I would expect: ["0C"] Nonetheless the weird returned object seems to behave as the expected string. Thank you - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHUaB3L+CaXfJI/hgRApwQAKC8UYMBaWMeKdFQhlMr9Fq+O2t4QQCg1CPb cHjy/9B656Xr+FtX935lboE= =NFxh -----END PGP SIGNATURE----- From hokan.stenholm@REDACTED Sat Dec 1 19:46:42 2007 From: hokan.stenholm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Stenholm?=) Date: Sat, 01 Dec 2007 19:46:42 +0100 Subject: [erlang-questions] simple question: how to convert integers to string with fixed digits In-Reply-To: <4751A077.4080408@fiit.stuba.sk> References: <4751455A.2040307@fiit.stuba.sk> <47514D90.2080003@bredband.net> <4751A077.4080408@fiit.stuba.sk> Message-ID: <4751AC12.2040608@bredband.net> Matej Kosik wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > H?kan Stenholm wrote: >> Matej Kosik wrote: >> >> You can experiment with the io:format(...) (or io_lib:format(...)) >> string, this works in you case: >> >> 6> io:format("~2..0w", [2]). >> 02 >> >> 10> io:format("~2.16.0B", [255]). >> FF >> > > These procedures work fine. Reading the manual I was not able to recognize such possibilities. They > print the term on the terminal in the way I need it. > > These parameters also kind be used with > > io_lib:fwrite/2 > > even though its results, for example in these cases: > > io_lib:fwrite("~2.16.0B", [12]). > > is weird > > [["0","C"]] > > I would expect: > > ["0C"] > > Nonetheless the weird returned object seems to behave as the expected string. io_lib.erl has tendency to create strings similar to io_lists (io_list() = [char() | binary() | io_list()]), there are efficiency reason for doing it like this, e.g. appending two strings like ["foo" | "bar"] during pretty printing formating is O(1) rather than O(N) which "foo" ++ "bar" - which could in some circumstances result in O(N^2) issues. You might need to use lists:flatten/1 (O(N log N)) if you need a proper string() - [char()], rather than a nested list of chars and lists. One reason why io_lib doesn't apply lists:flatten/1 on it's output is another efficiency consideration - when sending byte streams over networks or to disk, it is quite simple to traverse the nested (tree) structure in O(N log N) time* thereby minimizing the amount of operations needed to process the strings**, this is useful when the data is mainly intended to be passed on to other processes/servers/users. * functions/modules that accept io_list() will do this as well as a number of other io related functions ** you save a O(N) traversal over the flattend string > > Thank you > - -- > Matej Kosik > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHUaB3L+CaXfJI/hgRApwQAKC8UYMBaWMeKdFQhlMr9Fq+O2t4QQCg1CPb > cHjy/9B656Xr+FtX935lboE= > =NFxh > -----END PGP SIGNATURE----- > From paul-trapexit@REDACTED Sat Dec 1 19:49:31 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Sat, 1 Dec 2007 10:49:31 -0800 (PST) Subject: [erlang-questions] how: mnesia with simultaneous permanent node failure (EC2) Message-ID: hi. i'm thinking about using mnesia on EC2, but i'm having problems figuring out disaster recovery. some background: on EC2, you can start as many machines (instances) as you like. if you lose one, you can start another, but it'll have a different hostname. when you lose an instance, you lose whatever was stored on the drive. i was trying to figure out what i would do with a distributed mnesia database when i lost a node. i came up with a procedure based upon mnesia:del_table_copy/2 of the schema on the lost node which seems to work (attached as test-disaster-one). however when i tried to apply the procedure to simultaneous loss of two nodes, i ran into a problem; calling mnesia:del_table_copy/2 of schema requires all other nodes to be active, and is this scenario i have lost two nodes simultaneously (attached as test-disaster-two). any input from mnesia gurus would be greatly appreciated. thanks, -- p Optimism is an essential ingredient of innovation. How else can the individual favor change over security? -- Robert Noyce -------------- next part -------------- #! /bin/sh # This script is intended to simulate loss and recovery of a single # EC2 node out of a pool of three # # Recovery is achieved by: # 1. calling mnesia:del_table_copy (schema, LostNode) when the node dies # 2. deleting the mnesia directory on the lost node (with EC2, this is # automatic, as there is no persistent disk) # 3. restarting the node # 4. calling mnesia:add_table_copy (TableName, RecoveredNode) to reinstall # tables rm -rf Mnesia*flassy* rm -rf Mnesia*turgy* rm -rf Mnesia*warezy* # first we start three nodes and get them running the same mnesia schema erl -setcookie mega -sname flassy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' & erl -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), Pid = rpc:call (list_to_atom ("flassy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt erl -setcookie mega -sname turgy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), "turgy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' & erl -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), Pid = rpc:call (list_to_atom ("turgy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt erl -setcookie mega -sname warezy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), "warezy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), { atomic, ok } = mnesia:create_table (flass, [ { disc_copies, [ list_to_atom ("flassy@" ++ Host), list_to_atom ("turgy@" ++ Host), list_to_atom ("warezy@" ++ Host) ] } ]), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' & erl -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("warezy@" ++ Host)), Pid = rpc:call (list_to_atom ("warezy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt # now kill flassy and remove it from the schema erl -setcookie mega -sname killah -noshell -noinput -eval ' "killah@" ++ Host = atom_to_list (node ()), rpc:call (list_to_atom ("flassy@" ++ Host), erlang, halt, []), { atomic, ok } = rpc:call (list_to_atom ("warezy@" ++ Host), mnesia, del_table_copy, [ schema, list_to_atom ("flassy@" ++ Host) ]) ' -s erlang halt rm -rf Mnesia*flassy* # now restart flassy erl -setcookie mega -sname flassy -s mnesia -noshell -noinput -eval ' "flassy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), pong = net_adm:ping (list_to_atom ("warezy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), { atomic, ok } = mnesia:add_table_copy (flass, node (), ram_copies), mnesia:system_info () ' -s erlang halt erl -setcookie mega -sname killah -noshell -noinput -eval ' "killah@" ++ Host = atom_to_list (node ()), rpc:call (list_to_atom ("flassy@" ++ Host), erlang, halt, []), rpc:call (list_to_atom ("turgy@" ++ Host), erlang, halt, []), rpc:call (list_to_atom ("warezy@" ++ Host), erlang, halt, []) ' -s erlang halt rm -rf Mnesia*flassy* rm -rf Mnesia*turgy* rm -rf Mnesia*warezy* -------------- next part -------------- #! /bin/sh # This script is intended to simulate loss and recovery of two # EC2 nodes out of a pool of three # # Recovery is attempted by: # 1. calling mnesia:del_table_copy (schema, LostNode) when the node dies # 2. deleting the mnesia directory on the lost node (with EC2, this is # automatic, as there is no persistent disk) # 3. restarting the node # 4. calling mnesia:add_table_copy (TableName, RecoveredNode) to reinstall # tables # # Unfortunately this fails because the simultaneous failure means that # step 1. is not allowed because # "All replicas on diskfull nodes are not active yet" rm -rf Mnesia*flassy* rm -rf Mnesia*turgy* rm -rf Mnesia*warezy* # first we start three nodes and get them running the same mnesia schema erl -setcookie mega -sname flassy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' -s erlang halt & erl -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), Pid = rpc:call (list_to_atom ("flassy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt erl -setcookie mega -sname turgy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), "turgy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' -s erlang halt & erl -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), Pid = rpc:call (list_to_atom ("turgy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt erl -setcookie mega -sname warezy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), "warezy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), { atomic, ok } = mnesia:create_table (flass, [ { disc_copies, [ list_to_atom ("flassy@" ++ Host), list_to_atom ("turgy@" ++ Host), list_to_atom ("warezy@" ++ Host) ] } ]), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' -s erlang halt & erl -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("warezy@" ++ Host)), Pid = rpc:call (list_to_atom ("warezy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt # now kill flassy and turgy and remove them from the schema erl -setcookie mega -sname killah -noshell -noinput -eval ' "killah@" ++ Host = atom_to_list (node ()), rpc:call (list_to_atom ("flassy@" ++ Host), erlang, halt, []), rpc:call (list_to_atom ("turgy@" ++ Host), erlang, halt, []), { atomic, ok } = rpc:call (list_to_atom ("warezy@" ++ Host), mnesia, del_table_copy, [ schema, list_to_atom ("flassy@" ++ Host) ]), { atomic, ok } = rpc:call (list_to_atom ("warezy@" ++ Host), mnesia, del_table_copy, [ schema, list_to_atom ("turgy@" ++ Host) ]) ' -s erlang halt rm -rf Mnesia*flassy* rm -rf Mnesia*turgy* # now restart turgy erl -setcookie mega -sname turgy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), "turgy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' -s erlang halt & erl -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), Pid = rpc:call (list_to_atom ("turgy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt # now restart flassy erl -setcookie mega -sname flassy -s mnesia -noshell -noinput -eval ' "flassy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), pong = net_adm:ping (list_to_atom ("warezy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), { atomic, ok } = mnesia:add_table_copy (flass, node (), ram_copies), mnesia:system_info () ' -s erlang halt erl -setcookie mega -sname killah -noshell -noinput -eval ' "killah@" ++ Host = atom_to_list (node ()), rpc:call (list_to_atom ("flassy@" ++ Host), erlang, halt, []), rpc:call (list_to_atom ("turgy@" ++ Host), erlang, halt, []), rpc:call (list_to_atom ("warezy@" ++ Host), erlang, halt, []) ' -s erlang halt rm -rf Mnesia*flassy* rm -rf Mnesia*turgy* rm -rf Mnesia*warezy* From fritchie@REDACTED Sat Dec 1 21:14:27 2007 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Sat, 01 Dec 2007 14:14:27 -0600 Subject: [erlang-questions] how: mnesia with simultaneous permanent node failure (EC2) In-Reply-To: Message of "Sat, 01 Dec 2007 10:49:31 PST." Message-ID: <200712012014.lB1KEROB022951@snookles.snookles.com> >>>>> "pm" == Paul Mineiro writes: pm> however when i tried to apply the procedure to simultaneous loss pm> of two nodes, i ran into a problem; calling pm> mnesia:del_table_copy/2 of schema requires all other nodes to be pm> active, and is this scenario i have lost two nodes simultaneously pm> (attached as test-disaster-two). Yup, I've also discovered that feature. Heh, some colleagues have run into problems when they've intentionally created such a failure via the "rm -rf" trick. I had to explain that just because node C in a cluster lost it's mind doesn't mean that A & B & others haven't forgotten that C is a member. My solution was to create a backup of each node after a schema change, and use that backup to bootstrap a dead node back to life ... then use mnesia:del_table_copy() if I really wanted to remove that node from the cluster. An interesting experiment that I haven't tried ... Mnesia backups, by default, include all tuples from all tables. Either by using a custom backup module, or by post-processing a backup via mnesia:traverse_backup(), to include only the schema table. I wonder if restoring only the schema table on each formerly-dead node is sufficient? -Scott From oneone@REDACTED Sat Dec 1 21:55:35 2007 From: oneone@REDACTED (Andrew Arrow) Date: Sat, 1 Dec 2007 12:55:35 -0800 Subject: [erlang-questions] sending data down the wire in mysql vs. mnesia Message-ID: I have a PHP + mysql app now that uses a mysql stored procedure to avoid sending lots of data "down the wire." That is, the stored procedure iterates over thousands of rows, determines the value the app needs and sends back just the value. This avoids the thousands of rows coming down the wire to have PHP compute the value. In moving this system to erlang + mnesia do I have to worry about the same issue? It seems I will have to store the thousands of items in a set in a mnesia table, retrieve all the rows, and have erlang compute the value. There's no way to do the iteration inside mnesia like there is in mysql is there? From vlm@REDACTED Sat Dec 1 23:13:14 2007 From: vlm@REDACTED (Lev Walkin) Date: Sat, 01 Dec 2007 14:13:14 -0800 Subject: [erlang-questions] sending data down the wire in mysql vs. mnesia In-Reply-To: References: Message-ID: <4751DC7A.6070204@lionet.info> Andrew Arrow wrote: > I have a PHP + mysql app now that uses a mysql stored procedure to > avoid sending lots of data "down the wire." That is, the stored > procedure iterates over thousands of rows, determines the value the > app needs and sends back just the value. This avoids the thousands of > rows coming down the wire to have PHP compute the value. > > In moving this system to erlang + mnesia do I have to worry about the > same issue? It seems I will have to store the thousands of items in a > set in a mnesia table, retrieve all the rows, and have erlang compute > the value. There's no way to do the iteration inside mnesia like > there is in mysql is there? You do this "stored procedure" thing in MySQL primarily to avoid inter-process communication and serialization/deserialization. In Erlang+Mnesia case, the Mnesia table runs inside Erlang VM, therefore avoiding inter-process communication issues. Also, there is some advantage in not having to perform serialization and deserialization, although with *ts tables (which Mnesia is based upon) there is some copying going on anyway. So, the short answer is no, you don't do it in Mnesia. Primarily because your surrounding Erlang code precisely acts like a "stored procedure" around Mnesia tables, running in the same VM. -- Lev Walkin vlm@REDACTED From hieu.d.hoang@REDACTED Sat Dec 1 23:31:23 2007 From: hieu.d.hoang@REDACTED (=?UTF-8?Q?Hi=E1=BA=BFu_Ho=C3=A0ng?=) Date: Sun, 2 Dec 2007 05:31:23 +0700 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <947665.39169.qm@web38801.mail.mud.yahoo.com> References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> <947665.39169.qm@web38801.mail.mud.yahoo.com> Message-ID: <4f12b0dd0712011431x70851074se3ca0ba5a1beaac2@mail.gmail.com> I read Bruce Schneier that the US NIST is going to choose another algorithm to replace the SHA family , ETA 2011. The post: . Hi?u From paul-trapexit@REDACTED Sat Dec 1 23:34:05 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Sat, 1 Dec 2007 14:34:05 -0800 (PST) Subject: [erlang-questions] sending data down the wire in mysql vs. mnesia In-Reply-To: <4751DC7A.6070204@lionet.info> References: <4751DC7A.6070204@lionet.info> Message-ID: I don't find this answer satisfactory in the case of distributed fragmented mnesia tables. I've actually had to rewrite computations in map-reduce form with servers on each node doing operations on fragments that are local to the node (I still use mnesia for storage for operational benefits) and then collecting results (similar to gen_server:multi_call/4, but using pg2 and a custom hash function known both to the client and mnesia). I was hoping to implement such computations in straight mnesia (less chances for me to screw something up) but noticed it was easy to start seeing 20 mbits of sustained I/O between my boxes even at low query rates for my application. It'd be nice to somehow within mnesia extend the concept of fragmented tables to reduce network I/O for incrementally computable aggregate functions. -- p On Sat, 1 Dec 2007, Lev Walkin wrote: > Andrew Arrow wrote: > > I have a PHP + mysql app now that uses a mysql stored procedure to > > avoid sending lots of data "down the wire." That is, the stored > > procedure iterates over thousands of rows, determines the value the > > app needs and sends back just the value. This avoids the thousands of > > rows coming down the wire to have PHP compute the value. > > > > In moving this system to erlang + mnesia do I have to worry about the > > same issue? It seems I will have to store the thousands of items in a > > set in a mnesia table, retrieve all the rows, and have erlang compute > > the value. There's no way to do the iteration inside mnesia like > > there is in mysql is there? > > > You do this "stored procedure" thing in MySQL primarily to avoid > inter-process communication and serialization/deserialization. > > In Erlang+Mnesia case, the Mnesia table runs inside Erlang VM, > therefore avoiding inter-process communication issues. Also, > there is some advantage in not having to perform serialization > and deserialization, although with *ts tables (which Mnesia > is based upon) there is some copying going on anyway. > > So, the short answer is no, you don't do it in Mnesia. Primarily > because your surrounding Erlang code precisely acts like a "stored > procedure" around Mnesia tables, running in the same VM. > > > -- > Lev Walkin > vlm@REDACTED > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > Optimism is an essential ingredient of innovation. How else can the individual favor change over security? -- Robert Noyce From vlm@REDACTED Sat Dec 1 23:36:29 2007 From: vlm@REDACTED (Lev Walkin) Date: Sat, 01 Dec 2007 14:36:29 -0800 Subject: [erlang-questions] sending data down the wire in mysql vs. mnesia In-Reply-To: References: <4751DC7A.6070204@lionet.info> Message-ID: <4751E1ED.5020804@lionet.info> Paul Mineiro wrote: > I don't find this answer satisfactory in the case of distributed > fragmented mnesia tables. > > I've actually had to rewrite computations in map-reduce form with servers > on each node doing operations on fragments that are local to the node (I > still use mnesia for storage for operational benefits) and then collecting > results (similar to gen_server:multi_call/4, but using pg2 and a custom > hash function known both to the client and mnesia). I was hoping to > implement such computations in straight mnesia (less chances for me to > screw something up) but noticed it was easy to start seeing 20 mbits of > sustained I/O between my boxes even at low query rates for my application. > > It'd be nice to somehow within mnesia extend the concept of fragmented > tables to reduce network I/O for incrementally computable > aggregate functions. How would you do that with fragmented MySQL tables? Stored procedures won't work in this case either. Apples and Oranges? > -- p > > On Sat, 1 Dec 2007, Lev Walkin wrote: > >> Andrew Arrow wrote: >>> I have a PHP + mysql app now that uses a mysql stored procedure to >>> avoid sending lots of data "down the wire." That is, the stored >>> procedure iterates over thousands of rows, determines the value the >>> app needs and sends back just the value. This avoids the thousands of >>> rows coming down the wire to have PHP compute the value. >>> >>> In moving this system to erlang + mnesia do I have to worry about the >>> same issue? It seems I will have to store the thousands of items in a >>> set in a mnesia table, retrieve all the rows, and have erlang compute >>> the value. There's no way to do the iteration inside mnesia like >>> there is in mysql is there? >> >> You do this "stored procedure" thing in MySQL primarily to avoid >> inter-process communication and serialization/deserialization. >> >> In Erlang+Mnesia case, the Mnesia table runs inside Erlang VM, >> therefore avoiding inter-process communication issues. Also, >> there is some advantage in not having to perform serialization >> and deserialization, although with *ts tables (which Mnesia >> is based upon) there is some copying going on anyway. >> >> So, the short answer is no, you don't do it in Mnesia. Primarily >> because your surrounding Erlang code precisely acts like a "stored >> procedure" around Mnesia tables, running in the same VM. >> >> >> -- >> Lev Walkin >> vlm@REDACTED >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > > Optimism is an essential ingredient of innovation. How else can the > individual favor change over security? > > -- Robert Noyce From paul-trapexit@REDACTED Sat Dec 1 23:46:53 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Sat, 1 Dec 2007 14:46:53 -0800 (PST) Subject: [erlang-questions] sending data down the wire in mysql vs. mnesia In-Reply-To: <4751E1ED.5020804@lionet.info> References: <4751DC7A.6070204@lionet.info> <4751E1ED.5020804@lionet.info> Message-ID: With a fragmented MySQL table, I can execute a stored procedure on each MySQL fragment, and the reduce the collection of results in the client. The only thing that travels over the wire is the collection of results, one for each fragment. I'm looking for something similar from Mnesia. Erlang has all the building blocks to put it together (so I have), but I can see an opportunity to come up with something standard within Mnesia which is reasonably general and would return me to a more location-transparent style of programming. -- p On Sat, 1 Dec 2007, Lev Walkin wrote: > Paul Mineiro wrote: > > I don't find this answer satisfactory in the case of distributed > > fragmented mnesia tables. > > > > I've actually had to rewrite computations in map-reduce form with servers > > on each node doing operations on fragments that are local to the node (I > > still use mnesia for storage for operational benefits) and then collecting > > results (similar to gen_server:multi_call/4, but using pg2 and a custom > > hash function known both to the client and mnesia). I was hoping to > > implement such computations in straight mnesia (less chances for me to > > screw something up) but noticed it was easy to start seeing 20 mbits of > > sustained I/O between my boxes even at low query rates for my application. > > > > It'd be nice to somehow within mnesia extend the concept of fragmented > > tables to reduce network I/O for incrementally computable > > aggregate functions. > > > How would you do that with fragmented MySQL tables? Stored procedures > won't work in this case either. Apples and Oranges? > > > > > > -- p > > > > On Sat, 1 Dec 2007, Lev Walkin wrote: > > > >> Andrew Arrow wrote: > >>> I have a PHP + mysql app now that uses a mysql stored procedure to > >>> avoid sending lots of data "down the wire." That is, the stored > >>> procedure iterates over thousands of rows, determines the value the > >>> app needs and sends back just the value. This avoids the thousands of > >>> rows coming down the wire to have PHP compute the value. > >>> > >>> In moving this system to erlang + mnesia do I have to worry about the > >>> same issue? It seems I will have to store the thousands of items in a > >>> set in a mnesia table, retrieve all the rows, and have erlang compute > >>> the value. There's no way to do the iteration inside mnesia like > >>> there is in mysql is there? > >> > >> You do this "stored procedure" thing in MySQL primarily to avoid > >> inter-process communication and serialization/deserialization. > >> > >> In Erlang+Mnesia case, the Mnesia table runs inside Erlang VM, > >> therefore avoiding inter-process communication issues. Also, > >> there is some advantage in not having to perform serialization > >> and deserialization, although with *ts tables (which Mnesia > >> is based upon) there is some copying going on anyway. > >> > >> So, the short answer is no, you don't do it in Mnesia. Primarily > >> because your surrounding Erlang code precisely acts like a "stored > >> procedure" around Mnesia tables, running in the same VM. > >> > >> > >> -- > >> Lev Walkin > >> vlm@REDACTED > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://www.erlang.org/mailman/listinfo/erlang-questions > >> > > > > Optimism is an essential ingredient of innovation. How else can the > > individual favor change over security? > > > > -- Robert Noyce > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > Optimism is an essential ingredient of innovation. How else can the individual favor change over security? -- Robert Noyce From vlm@REDACTED Sat Dec 1 23:56:50 2007 From: vlm@REDACTED (Lev Walkin) Date: Sat, 01 Dec 2007 14:56:50 -0800 Subject: [erlang-questions] sending data down the wire in mysql vs. mnesia In-Reply-To: References: <4751DC7A.6070204@lionet.info> <4751E1ED.5020804@lionet.info> Message-ID: <4751E6B2.2050804@lionet.info> Paul Mineiro wrote: > With a fragmented MySQL table, I can execute a stored procedure > on each MySQL fragment, and the reduce the collection of results in the > client. The only thing that travels over the wire is the collection of > results, one for each fragment. > > I'm looking for something similar from Mnesia. Erlang has all the > building blocks to put it together (so I have), but I can see an > opportunity to come up with something standard within Mnesia which is > reasonably general and would return me to a more location-transparent > style of programming. My point though is that Erlang _is_ the stored procedure around Mnesia. What one does is runs a function mapped across several Mnesia nodes, doing local computations, getting single results back. No difference. > -- p > > On Sat, 1 Dec 2007, Lev Walkin wrote: > >> Paul Mineiro wrote: >>> I don't find this answer satisfactory in the case of distributed >>> fragmented mnesia tables. >>> >>> I've actually had to rewrite computations in map-reduce form with servers >>> on each node doing operations on fragments that are local to the node (I >>> still use mnesia for storage for operational benefits) and then collecting >>> results (similar to gen_server:multi_call/4, but using pg2 and a custom >>> hash function known both to the client and mnesia). I was hoping to >>> implement such computations in straight mnesia (less chances for me to >>> screw something up) but noticed it was easy to start seeing 20 mbits of >>> sustained I/O between my boxes even at low query rates for my application. >>> >>> It'd be nice to somehow within mnesia extend the concept of fragmented >>> tables to reduce network I/O for incrementally computable >>> aggregate functions. >> >> How would you do that with fragmented MySQL tables? Stored procedures >> won't work in this case either. Apples and Oranges? >> >> >> >> >>> -- p >>> >>> On Sat, 1 Dec 2007, Lev Walkin wrote: >>> >>>> Andrew Arrow wrote: >>>>> I have a PHP + mysql app now that uses a mysql stored procedure to >>>>> avoid sending lots of data "down the wire." That is, the stored >>>>> procedure iterates over thousands of rows, determines the value the >>>>> app needs and sends back just the value. This avoids the thousands of >>>>> rows coming down the wire to have PHP compute the value. >>>>> >>>>> In moving this system to erlang + mnesia do I have to worry about the >>>>> same issue? It seems I will have to store the thousands of items in a >>>>> set in a mnesia table, retrieve all the rows, and have erlang compute >>>>> the value. There's no way to do the iteration inside mnesia like >>>>> there is in mysql is there? >>>> You do this "stored procedure" thing in MySQL primarily to avoid >>>> inter-process communication and serialization/deserialization. >>>> >>>> In Erlang+Mnesia case, the Mnesia table runs inside Erlang VM, >>>> therefore avoiding inter-process communication issues. Also, >>>> there is some advantage in not having to perform serialization >>>> and deserialization, although with *ts tables (which Mnesia >>>> is based upon) there is some copying going on anyway. >>>> >>>> So, the short answer is no, you don't do it in Mnesia. Primarily >>>> because your surrounding Erlang code precisely acts like a "stored >>>> procedure" around Mnesia tables, running in the same VM. >>>> >>>> >>>> -- >>>> Lev Walkin >>>> vlm@REDACTED >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>> >>> Optimism is an essential ingredient of innovation. How else can the >>> individual favor change over security? >>> >>> -- Robert Noyce >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > > Optimism is an essential ingredient of innovation. How else can the > individual favor change over security? > > -- Robert Noyce From toby@REDACTED Sun Dec 2 00:55:23 2007 From: toby@REDACTED (Toby Thain) Date: Sat, 1 Dec 2007 21:55:23 -0200 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <47515EDF.50605@millstream.com> References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> <4EED01E9-2A4B-47E0-8AAF-E5735EEFFE9A@smartgames.ca> <47515EDF.50605@millstream.com> Message-ID: <844311CC-9ACB-4B8F-9D60-902DCD693EFE@smartgames.ca> On 1-Dec-07, at 11:17 AM, Richard Kelsall wrote: > Toby Thain wrote: >> On 1-Dec-07, at 9:42 AM, Joe Armstrong wrote: >>> MD5 is really broken - gulp see > ... >>> I wonder how many millions of programs have now become insecure? >> The paper concludes, >> "MD5 should no longer be used as a hash function for software >> integrity or code signing purposes." >> ...but isn't a good workaround just to use more than one hash, >> e.g. MD5+SHA1? > > No. Use a better algorithm like SHA-256 or SHA-512. There are plenty > of other good hash algorithms. My point was that any *single* hash might one day be shown vulnerable to a similar technique, but using two together (as is sometimes already done) should be much more resistant? --Toby > Pick one from the table here that says > "No" in the collisions column rather than creating your own > > http://en.wikipedia.org/wiki/Cryptographic_hash_function > > > Richard. From david_holz@REDACTED Sat Dec 1 05:54:38 2007 From: david_holz@REDACTED (David Holz) Date: Sat, 1 Dec 2007 04:54:38 +0000 Subject: [erlang-questions] 64-bit erlang In-Reply-To: References: <474D2E90.80603@ericsson.com> <474DED25.7060708@ghostgun.com> <9b08084c0711290206k459f9cdbjc6ffcfddeaa890c3@mail.gmail.com> Message-ID: Aren't the pointers inside the VM always 32-bit aligned? Then just right-shift the pointer 2 bits and store the lower 32 bits of that. That will ramp the addressable range from 4GB to 16GB. It is a little fiddly to work with (and you'd have to make sure every pointer load/store does the conversion or else it'll corrupt (hello codegen)), but since it's the same 32-bit memory bandwidth/footprint and the register shifting could happen for free with the right asm output from compiler optimization, there might be no hit at all. You'd also have to check to make sure that all the heap allocations are below 0x0000 0004 0000 0000, but that's also very minimal overhead as well as I presume malloc()s are seldom and in large banks at a time. This would really be a stop-gap solution only for people working with>4GB in-RAM datasets (like me!), but as others have said it's a shame that this is so painful. Back in the 16 -> 32 bit conversion, 16-bit computers were already well above the 16-bit address range with banking and segments and whatnot. Now, 32-bit systems are only approaching or right at their limit so doubling the pointer size really hurts for large apps. Since the AMD64 ISA can run so much faster than IA32, we get 64-bit pointer sizes pushed on us before it's truly necessary and the industry has skipped exposing a segment/banked 32-bit system to developers, which arguably could be more useful for 4-16GB systems. _________________________________________________________________ Put your friends on the big screen with Windows Vista? + Windows Live?. http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_102007 From david.hopwood@REDACTED Sun Dec 2 07:24:26 2007 From: david.hopwood@REDACTED (David Hopwood) Date: Sun, 02 Dec 2007 06:24:26 +0000 Subject: [erlang-questions] 64-bit erlang In-Reply-To: References: <474D2E90.80603@ericsson.com> <474DED25.7060708@ghostgun.com> <9b08084c0711290206k459f9cdbjc6ffcfddeaa890c3@mail.gmail.com> Message-ID: <47524F9A.3070201@industrial-designers.co.uk> David Holz wrote: > Aren't the pointers inside the VM always 32-bit aligned? Then just right-shift > the pointer 2 bits and store the lower 32 bits of that. That will ramp the > addressable range from 4GB to 16GB. Those two bits are already used -- see , in particular figure 6. -- David Hopwood From Jouni.Ryno@REDACTED Sun Dec 2 08:25:55 2007 From: Jouni.Ryno@REDACTED (=?ISO-8859-1?Q?Jouni_Ryn=F6?=) Date: Sun, 2 Dec 2007 09:25:55 +0200 Subject: [erlang-questions] how: ot: real time web pages? In-Reply-To: References: <474D2E90.80603@ericsson.com> <474DED25.7060708@ghostgun.com> <9b08084c0711290206k459f9cdbjc6ffcfddeaa890c3@mail.gmail.com> Message-ID: <367881F2-45D2-4D41-9CE3-C93004157E4C@fmi.fi> I start from what I would like to have: A web page with a real time updated display of numerical values and graphs. Think about typical process displays in industry, temperatures, voltages and some graphs showing parameter history. Maybe some graphical layout of hardware, to show how each parameter is connected to each other. To achieve that, I would need a web page template format, where I can: - define named text fields, which shall be updated - define named graphics, which can be updated - and some code to generate the real page and connection functions for (comet style?) communication with the page and erlang process feeding the data Currently I have all that implemented as Tcl/Tk canvas (thanks to Ola Samuelsson and ewish, which was distributed with Erlang back in 97 or so?) As my understanding of "javascript" is practically zero, I would like get a hint on how to do this. Googling shows a lot of options, most of the systems not quite being there. Should it be simply javascript and svg, changes updated via attributes. Or canvas tag (complicated with text fields?) Or haxe and flash (for which I did not find examples, how the update mechanism would work) Or something else? Is this doable? Some examples existing already? Jouni From erlang@REDACTED Sun Dec 2 11:24:27 2007 From: erlang@REDACTED (Joe Armstrong) Date: Sun, 2 Dec 2007 11:24:27 +0100 Subject: [erlang-questions] how: ot: real time web pages? In-Reply-To: <367881F2-45D2-4D41-9CE3-C93004157E4C@fmi.fi> References: <474D2E90.80603@ericsson.com> <474DED25.7060708@ghostgun.com> <9b08084c0711290206k459f9cdbjc6ffcfddeaa890c3@mail.gmail.com> <367881F2-45D2-4D41-9CE3-C93004157E4C@fmi.fi> Message-ID: <9b08084c0712020224y6e834b3cu504704fbd5c7dffa@mail.gmail.com> It is extremely doable - it takes about 25-50 lines of javascript, and a little erlang http server Here is an outline of the method. 1) Wrap the regions you want to change with unique tags
... 2) To change the content within this tag you need to execute a javascript statement document.getElemenById("12345").innerHTML = "..... some html"" 3) To do this you need some javascript that calls erlang - the erlang should NOT return immediately but return when the next update is required. The erlang return value should return a string which contains the "document.getElementByCommand command" - on getting the return value the javascript just "eval's" the result 4) Every time erlang returns you update the region on the page and immediately call erlang again which suspends until the next update comes. I don't actually have short example of this - I have code for this wrapped up in a lot of other junk that obscure the simplicity of the solution. At this stage I would really recommend that you learn javascript. I started by doing the exercises at http://www.w3schools.com/js/ To do anything nice in a browser you need to learn javascript. You also need to setup some server side stuff ( a little http server - this can be as easy or difficult as you like ...) /Joe On Dec 2, 2007 8:25 AM, Jouni Ryn? wrote: > I start from what I would like to have: > A web page with a real time updated display of numerical values and > graphs. Think about typical process displays in industry, > temperatures, voltages and some graphs showing parameter history. > Maybe some graphical layout of hardware, to show how each parameter > is connected to each other. > > To achieve that, I would need a web page template format, where I can: > - define named text fields, which shall be updated > - define named graphics, which can be updated > - and some code to generate the real page and connection functions > for (comet style?) communication with the page and erlang process > feeding the data > > Currently I have all that implemented as Tcl/Tk canvas (thanks to Ola > Samuelsson and ewish, which was distributed with Erlang back in 97 or > so?) > > As my understanding of "javascript" is practically zero, I would like > get a hint on how to do this. Googling shows a lot of options, most > of the systems not quite being there. Should it be simply javascript > and svg, changes updated via attributes. Or canvas tag (complicated > with text fields?) Or haxe and flash (for which I did not find > examples, how the update mechanism would work) Or something else? > > Is this doable? Some examples existing already? > > Jouni > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From rvirding@REDACTED Sun Dec 2 12:44:41 2007 From: rvirding@REDACTED (Robert Virding) Date: Sun, 2 Dec 2007 12:44:41 +0100 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: <474FA0BF.4030905@industrial-designers.co.uk> References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <474FA0BF.4030905@industrial-designers.co.uk> Message-ID: <3dbc6d1c0712020344u565ecd9k4ce19eec1b089f25@mail.gmail.com> All the good names have been taken. We will either have to ignore that or call it something completely different, Lerlang or Lerl don't sound to good. :-) How about calling it Robert? I'll stay with erlisp for now an we can have a contest for best name if it ever gets that far. :-) Robert On 30/11/2007, David Hopwood wrote: > > Robert Virding wrote: > > Bengt is right Erlisp would probably be better as Elisp is already taken > (by > > Emacs lisp), which I do know being an old Elisp hacker my self. It was > just > > a mild "in joke". > > Erlisp is also taken: > (this project is an Erlang-inspired message passing library for CL, not > a full language implementation). > > -- > David Hopwood > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.regen@REDACTED Sun Dec 2 12:47:00 2007 From: michael.regen@REDACTED (Michael Regen) Date: Sun, 2 Dec 2007 12:47:00 +0100 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <844311CC-9ACB-4B8F-9D60-902DCD693EFE@smartgames.ca> References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> <4EED01E9-2A4B-47E0-8AAF-E5735EEFFE9A@smartgames.ca> <47515EDF.50605@millstream.com> <844311CC-9ACB-4B8F-9D60-902DCD693EFE@smartgames.ca> Message-ID: <9b59d0270712020347i3d454b03m2c9d00f6345087d6@mail.gmail.com> On Dec 2, 2007 12:55 AM, Toby Thain wrote: > My point was that any *single* hash might one day be shown vulnerable > to a similar technique, but using two together (as is sometimes > already done) should be much more resistant? > As A. Joux presents in "Multicollisions in Iterated Hash Functions. Application to Cascaded Constructions" http://www.springerlink.com/content/dwwvmqju0n0a3ugj/ this approach might be far less effective than one might think. Just found this thread which tries to explain it a bit: https://lists.ubuntu.com/archives/bazaar/2007q1/021478.html. If you google you can find more and maybe better links which say that, yes, combining two hashes (md5 + sha1) improves the hash quality but not as much as if you used a good hash (sha256) from the beginning. Besides that, using two hash functions makes everything much more complex. And no, I am neither able to follow the math completely. Some time ago I drew one conclusion for myself: I am no cryptography expert therefore I have to strictly adhere to the paths real cryptography experts have built. I should not draw my own conclusions. And one of the reversal conclusions: Even if I was a cryptography expert I should wait for other crypto experts to validate my new paths before I may follow them. Your mileage may vary. Cheers, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From francesco@REDACTED Sun Dec 2 13:10:00 2007 From: francesco@REDACTED (Francesco Cesarini) Date: Sun, 02 Dec 2007 12:10:00 +0000 Subject: [erlang-questions] Kicking off the London User Group with an Erlang Presentation (Dec 13th) Message-ID: <4752A098.8080901@erlang-consulting.com> Hi, We have just started an Erlang User Group in London. The goal is to have regular meetings (On a monthly basis) and presentations hosted by companies in and around London, all followed by the mandatory Erl Lounges. To sign up and receive future event notifications and local notices, visit http://uk.groups.yahoo.com/group/erlang-london/ We willl be kicking off the user group on December 13th with a generic presentation on Erlang for Five Nines. Looking at the history of Erlang, its features, community research and commercial use. The talk will also go into why Erlang, originally invented to handle the next generation of Telecom products, has been successful in a much wider range of sectors including banking and e-commerce. Attendance is free, but you need to register with the hosts of the presentation, Skills Matter Ltd.. For their address and to register, visit http://skillsmatter.com/erlang-session-concurrent-programming/pcd/1502 The above presentation is the perfect introductory presentation to Erlang, past, present and future. Feel free to pass it on to anyone you might think might be interested in attending. See you there! Francesco -- http://www.erlang-consulting.com From rvirding@REDACTED Sun Dec 2 13:21:21 2007 From: rvirding@REDACTED (Robert Virding) Date: Sun, 2 Dec 2007 13:21:21 +0100 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: <361FB8EB-0C84-480D-93B3-914C8E15C771@local> References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <361FB8EB-0C84-480D-93B3-914C8E15C771@local> Message-ID: <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> On 30/11/2007, Denis wrote: > > > > > Intermodule calls are the biggest problem, not to implement but to > > come up with a good syntax for it. In CL the symbol mod:func means > > the symbol func in the package mod, while in Scheme it is just a > > normal symbol which you can tell the system it refers to the > > function func in the library/module mod. I will try with a > > suggestion, both mine and others, from a different thread: > > > > (remote-call mod func arg1 arg2 ... ) > > > > which is a normal function and have: > > > > (: mod func arg1 arg2 ... ) > > > > for the special case where both mod and func are the actual names > > of e the module and function. This to save having to write: > > > > (remote-call 'mod 'func arg1 ... ) > > > > Sorry for rambling on here, but these are just some ideas I have > > had about it all. Probably should blogg it but I don't want to > > release it to a poor unsuspecting public just yet. :-) I'll be back > > when I have something to show, > > > > Robert > > > > Can't we use (mod:fun args) syntax for the function call ? I don't > know well scheme and CL, and I can't figure which are the differences > internally. > But at a syntaxic level, I find it tedious to write (remote-call > mod ...) each time I want to call a function in another module. The > (: seems also strange to me, even if I understand it's relevance in > the lisp context. > In the same vein, I also prefer to write (defun...) instead of > (define (call...). Of course, it's just a matter of taste, I don't > want to start a war :-) I sort of agree. There are some problems with (mod:fun args): - How do I write the equivalent of Mod:fun( ... )? I can't use (Mod:fun ... ) see below. - How do I parse mod:fun? This is a fundamental question as the relationship between code and data in lisp is 1-to-1. Parsed code *is* just its sexpr, there is no difference. This is one reason why it is so easy to manipulate code, for example by macros. Erlang code is has no such direct coupling to data. This fine if you going to compile the code, but it makes it more difficult to manipulate it. The problem is what do I parse mod:fun to? - In Cl it is the symbol fun in the module mod. - In Scheme it is just the symbol mod:fun which can be interpreted as a call to a function in a library. I mean I have to sensibly be able to handle the case where someone writes (cons a mod:fun). What does this mean? - Seeing this is based on Erlang I can't introduce any new data types. So with the argument above I can't have variables as a separate data type, separate from symbols/atoms. So Mod:fun will mean the same as mod:fun but with a different name. Now that was clear :-) So that is why I have no better suggestion for the moment to the general function (remote-call ... ) and its short hand form the macro (: mod fun ... ) Another problem for Erlisp is that while we have to have separate functions for the case of same function name with different number of arguments (it's Erlang) we don't need this for macros. In fact it might actually be better not to have it so I can define general macros which work on any number of arguments, like : above: (defmacro : (mod fun . args) `(remote-call mod fun ,@REDACTED)) for a slightly bastardised form. Actually Scheme define-syntax does use matching to select case so it might be better. The problem is that it will be difficult to call macros as functions. It can also be interesting to look at paul graham's arc lisp. For > instance, qrc replace setf by =. > He also renamed lambda to fn. Not so far from fun. > http://www.paulgraham.com/arcll1.html Read it. Interesting, but nothing came of it. Although I thoroughly agree with its idea of keeping names short. Perhaps I can replace element and set_element with tget and tset. :-) Again, I'm not a specialist, and that's why I'm not too attached at > keeping a known scheme or CL syntax. > My 2 cents > Denis > Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Sun Dec 2 13:31:26 2007 From: rvirding@REDACTED (Robert Virding) Date: Sun, 2 Dec 2007 13:31:26 +0100 Subject: [erlang-questions] idea: DB in Prolog application in Erlang In-Reply-To: <9b08084c0711300145v162a3f67nf3869f0bf2334848@mail.gmail.com> References: <9b08084c0711300145v162a3f67nf3869f0bf2334848@mail.gmail.com> Message-ID: <3dbc6d1c0712020431h3e1d4d3egb593be23758ce6c@mail.gmail.com> The obvious answer (obvious to me at least) is to use Erlog or a development of it. - You can do nice querying into a database. I did a simple Ets interface to Erlog which takes a pattern (prolog term) and returns successive matches to it over backtracking binding unbound variables. - It is integrated into Erlang concerning data. - You don't define Erlog procedures as Erlang code, but this could be done using parse transforms. Someone "just" has to do an interface to the "right" database. - It would be difficult to just directly call an Erlog procedure, even if it was written in Erlang, as you need a context for it to work in which is not the same as for normal Erlang code. I never went further with Erlog as no-one came back with request/suggestions for how it could be developed. But I am open to suggestion On 30/11/2007, Joe Armstrong wrote: > > Question: > > A long time ago Erlang started as a extension to Prolog ... > > Now Prolog is a wonderful language for querying databases in - > < queries>> > > So why when we talk about Erlang + an external data base do we > automatically reach for an SQL data base? > > I haven't been actively following the Prolog world, so here's my > questions: > > Are there any prolog data bases with ACID properties. > > I'd like something that is > > - open source > - resident (is runs like mySQL as a resident task on my machine) > - can handle large amounts of data (meaning I could store several > giga facts in the DB) > - has ACID properties > > Given the similarity between Erlang and Prolog data structures > integration between the two languages > could be very nice. > > Embedded prolog queries in Erlang would be *very* nice, just > interpreting erlang variables > as prolog logical variables. > > Comments anybody? > > /Joe Armstrong > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From harveyd@REDACTED Sun Dec 2 12:12:28 2007 From: harveyd@REDACTED (Dale Harvey) Date: Sun, 2 Dec 2007 11:12:28 +0000 Subject: [erlang-questions] how: ot: real time web pages? In-Reply-To: <9b08084c0712020224y6e834b3cu504704fbd5c7dffa@mail.gmail.com> References: <474D2E90.80603@ericsson.com> <474DED25.7060708@ghostgun.com> <9b08084c0711290206k459f9cdbjc6ffcfddeaa890c3@mail.gmail.com> <367881F2-45D2-4D41-9CE3-C93004157E4C@fmi.fi> <9b08084c0712020224y6e834b3cu504704fbd5c7dffa@mail.gmail.com> Message-ID: I would also recommend using a javascript library to help with the javascript, things like innerHTML can act differently across browsers and libraries like jquery, yui, scriptalicious help get away from filddling cross browser requirement, the dom selection is usually worth them alone $("#12345").html("..... some html") another possible implementation would be flash, in which you can have a remote socket connection that is used to notify updates to the client that a value has updated. it also has graphing libraries in flex and certainly more powerful for drawing output. canvas tags and svg are quite severely restricted in browser requirements, however drawing line graphs in javascript is quite tricky so you might want to look around for existing code On 02/12/2007, Joe Armstrong wrote: > > It is extremely doable - it takes about 25-50 lines of javascript, and > a little erlang http server > > Here is an outline of the method. > > 1) Wrap the regions you want to change with unique tags >
... > > 2) To change the content within this tag you need to execute a > javascript statement > > document.getElemenById("12345").innerHTML = "..... some html"" > > 3) To do this you need some javascript that calls erlang - the erlang > should NOT return immediately > but return when the next update is required. The erlang return value > should return a string which contains the > "document.getElementByCommand command" - on getting the return value > the javascript just "eval's" the result > > 4) Every time erlang returns you update the region on the page and > immediately call erlang again > which suspends until the next update comes. > > I don't actually have short example of this - I have code for this > wrapped up in a lot of other > junk that obscure the simplicity of the solution. > > At this stage I would really recommend that you learn javascript. I > started by doing the exercises at > > http://www.w3schools.com/js/ > > To do anything nice in a browser you need to learn javascript. > > You also need to setup some server side stuff ( a little http server - > this can be as easy or difficult > as you like ...) > > > /Joe > > > > > On Dec 2, 2007 8:25 AM, Jouni Ryn? wrote: > > I start from what I would like to have: > > A web page with a real time updated display of numerical values and > > graphs. Think about typical process displays in industry, > > temperatures, voltages and some graphs showing parameter history. > > Maybe some graphical layout of hardware, to show how each parameter > > is connected to each other. > > > > To achieve that, I would need a web page template format, where I can: > > - define named text fields, which shall be updated > > - define named graphics, which can be updated > > - and some code to generate the real page and connection functions > > for (comet style?) communication with the page and erlang process > > feeding the data > > > > Currently I have all that implemented as Tcl/Tk canvas (thanks to Ola > > Samuelsson and ewish, which was distributed with Erlang back in 97 or > > so?) > > > > As my understanding of "javascript" is practically zero, I would like > > get a hint on how to do this. Googling shows a lot of options, most > > of the systems not quite being there. Should it be simply javascript > > and svg, changes updated via attributes. Or canvas tag (complicated > > with text fields?) Or haxe and flash (for which I did not find > > examples, how the update mechanism would work) Or something else? > > > > Is this doable? Some examples existing already? > > > > Jouni > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- * http://hypernumbers.com * http://arandomurl.com/ * http://www.flickr.com/photos/daleharvey/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandrashekhar.mullaparthi@REDACTED Sun Dec 2 12:26:18 2007 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Sun, 2 Dec 2007 11:26:18 +0000 Subject: [erlang-questions] how: ot: real time web pages? In-Reply-To: <9b08084c0712020224y6e834b3cu504704fbd5c7dffa@mail.gmail.com> References: <474D2E90.80603@ericsson.com> <474DED25.7060708@ghostgun.com> <9b08084c0711290206k459f9cdbjc6ffcfddeaa890c3@mail.gmail.com> <367881F2-45D2-4D41-9CE3-C93004157E4C@fmi.fi> <9b08084c0712020224y6e834b3cu504704fbd5c7dffa@mail.gmail.com> Message-ID: On 02/12/2007, Joe Armstrong wrote: > It is extremely doable - it takes about 25-50 lines of javascript, and > a little erlang http server > > Here is an outline of the method. > > 1) Wrap the regions you want to change with unique tags >
... > > 2) To change the content within this tag you need to execute a > javascript statement > > document.getElemenById("12345").innerHTML = "..... some html"" > Beware of this. Setting innerHTML works in some cases in some browsers. I went down the Ajax route for one of our OMCs and now I have an OMC where it takes about three different browsers to use all the features :-( I used prototype.js which eased the implementation a lot but didn't fully solve browser compatibility issues. Look at Google webtoolkit GWT. You can write GUI code in Java which gets compiled to Javascript. I haven't tried it but given the success they have had with cross browser compatible web GUIs, it is worth a try. cheers Chandru From ulf@REDACTED Sun Dec 2 14:49:11 2007 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 2 Dec 2007 14:49:11 +0100 Subject: [erlang-questions] sending data down the wire in mysql vs. mnesia In-Reply-To: References: <4751DC7A.6070204@lionet.info> <4751E1ED.5020804@lionet.info> Message-ID: <8209f740712020549n7be69c27wf87bf8cfb4fba977@mail.gmail.com> 2007/12/1, Paul Mineiro : > With a fragmented MySQL table, I can execute a stored procedure > on each MySQL fragment, and the reduce the collection of results in the > client. The only thing that travels over the wire is the collection of > results, one for each fragment. > > I'm looking for something similar from Mnesia. Erlang has all the > building blocks to put it together (so I have), but I can see an > opportunity to come up with something standard within Mnesia which is > reasonably general and would return me to a more location-transparent > style of programming. You can modify mnesia_frag and tell mnesia to use your version instead of the default. How to do this is documented in mnesia. The downside is of course that you'd have to duplicate/maintain a whole bunch of other logic as well, just to make this small change, but in the process of doing this, you may arrive at some suggestion on how to make this parameterizable. BR, Ulf W From vorner@REDACTED Sun Dec 2 13:38:27 2007 From: vorner@REDACTED (Michal 'vorner' Vaner) Date: Sun, 2 Dec 2007 13:38:27 +0100 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <9b59d0270712020347i3d454b03m2c9d00f6345087d6@mail.gmail.com> References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> <4EED01E9-2A4B-47E0-8AAF-E5735EEFFE9A@smartgames.ca> <47515EDF.50605@millstream.com> <844311CC-9ACB-4B8F-9D60-902DCD693EFE@smartgames.ca> <9b59d0270712020347i3d454b03m2c9d00f6345087d6@mail.gmail.com> Message-ID: <20071202123827.GA9893@tarantula.kolej.mff.cuni.cz> Hello On Sun, Dec 02, 2007 at 12:47:00PM +0100, Michael Regen wrote: > On Dec 2, 2007 12:55 AM, Toby Thain wrote: > > > My point was that any *single* hash might one day be shown vulnerable > > to a similar technique, but using two together (as is sometimes > > already done) should be much more resistant? > > > > As A. Joux presents in "Multicollisions in Iterated Hash Functions. > Application to Cascaded Constructions" > http://www.springerlink.com/content/dwwvmqju0n0a3ugj/ this approach might be > far less effective than one might think. > > Just found this thread which tries to explain it a bit: > https://lists.ubuntu.com/archives/bazaar/2007q1/021478.html. If you google > you can find more and maybe better links which say that, yes, combining two > hashes (md5 + sha1) improves the hash quality but not as much as if you used > a good hash (sha256) from the beginning. Besides that, using two hash > functions makes everything much more complex. > And no, I am neither able to follow the math completely. What is more complex, if instead of prowiding: md5: abcd123456 you provide: md5: abcd12456 sda1: bcdef1234 If one of them does not match, then it is not the file. And, of course, you can add sha256, too, if you want. Just any number of different hash functions. If someone cracks md5, you still have the other one to see it and gives you time to replace md5. -- The human mind ordinarily operates at only ten percent of its capacity -- the rest is overhead for the operating system Michal 'vorner' Vaner -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From r.kelsall@REDACTED Sun Dec 2 16:01:49 2007 From: r.kelsall@REDACTED (Richard Kelsall) Date: Sun, 02 Dec 2007 15:01:49 +0000 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <844311CC-9ACB-4B8F-9D60-902DCD693EFE@smartgames.ca> References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> <4EED01E9-2A4B-47E0-8AAF-E5735EEFFE9A@smartgames.ca> <47515EDF.50605@millstream.com> <844311CC-9ACB-4B8F-9D60-902DCD693EFE@smartgames.ca> Message-ID: <4752C8DD.1060704@millstream.com> Toby Thain wrote: ... > My point was that any *single* hash might one day be shown vulnerable to > a similar technique, but using two together (as is sometimes already > done) should be much more resistant? ... Hello Toby, Sorry, I should have explained that a bit. In essence using two weak hashes rather than one strong hash is more work for a less secure result. SHA-256 is perfectly good, but if you're at all worried about it then use SHA-512 which is vastly more secure. If you're worried the NSA has put a back-door in SHA-512 then concoct your scheme by put something on top of it in a way that you know the result will be at least as secure as SHA-512. Do not start with weak components like MD5 and SHA-1. Here's an extended and corrected version of my post on this page that maybe explains some of my reasoning http://www.lightbluetouchpaper.org/2007/11/23/a-cryptographic-hash-function-reading-guide/ A hash may be applied to a very large file that won't fit in memory and normally processes the whole file in one pass. (Or a hash may be applied to data fed through a communications device in which case you may have to do it in one pass.) By using two hashes you have potentially doubled the file access effort. I suppose we could theoretically re-write the two hash functions to interleave as the file data becomes available, but this isn't worth doing because the result, as well as being more work, would also be less secure than one strong hash. A hash needs to be as short as possible because we may store and transfer lots of them and don?t want to waste effort with longer than necessary hashes. Storing two different hashes adds length without fully utilising the extra length. (I think this may be because you have two separate piles of bits that never mix rather than one big pile that is totally mixed. Compare 64! with 32! * 32! and you're probably in the right area.) Since we're not using the extra length it might be better to XOR the hashes onto each other, but either way you risk some sort of unknown interaction between the hashes that may weaken the combination. If you are going to do two passes over the file I think it would be better to do it like this : Hash2( Hash1( message ) + message ) but not like this : Hash2( message + Hash1( message ) ) rather than like this : Hash1( message ) + Hash2( message ) Given diverse algorithms for Hash1 and Hash2 this looks like a good scheme to me. You can extend this recursively to as many different hashes as you want. The strength will of course be limited by the length of the final hash. Michael's post looks correct and maybe explains some of this better. Michal's post however I disagree with for the reasons I give above. Richard. From launoja@REDACTED Sun Dec 2 16:07:31 2007 From: launoja@REDACTED (Jani Launonen) Date: Sun, 2 Dec 2007 17:07:31 +0200 Subject: [erlang-questions] how: ot: real time web pages? In-Reply-To: <367881F2-45D2-4D41-9CE3-C93004157E4C@fmi.fi> References: <474D2E90.80603@ericsson.com> <474DED25.7060708@ghostgun.com> <9b08084c0711290206k459f9cdbjc6ffcfddeaa890c3@mail.gmail.com> <367881F2-45D2-4D41-9CE3-C93004157E4C@fmi.fi> Message-ID: <410CE697-8937-4390-8738-0A4CA4910A05@omanetti.fi> Jouni Ryn? kirjoitti 2.12.2007 kello 9.25: > > I start from what I would like to have: > A web page with a real time updated display of numerical values and > graphs. Think about typical process displays in industry, > temperatures, voltages and some graphs showing parameter history. > Maybe some graphical layout of hardware, to show how each parameter > is connected to each other. > > To achieve that, I would need a web page template format, where I > can: > - define named text fields, which shall be updated > - define named graphics, which can be updated > - and some code to generate the real page and connection functions > for (comet style?) communication with the page and erlang process > feeding the data I did year or two ago a test where I made some SVG components to show some measurements in real-time. The SVG graph was updated by javascript which used httprequest to php enable Apache. The SVG komponents were composed to one web page by running XML configuration file through XSLT transformation, which picked correct SVG fragments from different files. It worked satisfactorily, but I didn't had the time to make any nice way to automatically connect the graphs by lines (like factory conveyer belts) and I don't know if it could have been done automatically (off line) by XSLT transformation or should I've used javascript for that. In fact, I'm thinking again the same system --- this time using Erlang in server end. So if you come up with some nice solution, please report it to the list :) > > Currently I have all that implemented as Tcl/Tk canvas (thanks to Ola > Samuelsson and ewish, which was distributed with Erlang back in 97 or > so?) > > As my understanding of "javascript" is practically zero, I would like > get a hint on how to do this. Googling shows a lot of options, most > of the systems not quite being there. Should it be simply javascript > and svg, changes updated via attributes. Or canvas tag (complicated > with text fields?) Or haxe and flash (for which I did not find > examples, how the update mechanism would work) Or something else? > > Is this doable? Some examples existing already? Perhaps there could some working SVG component libraries in web? I tried to search for such, but could find quite such that I was looking for. Jani > > Jouni > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From joelr1@REDACTED Sun Dec 2 16:37:01 2007 From: joelr1@REDACTED (Joel Reymont) Date: Sun, 2 Dec 2007 15:37:01 +0000 Subject: [erlang-questions] Natural language parsing in Erlang Message-ID: Is there any existing code for this? Has anyone tried? Thanks, Joel -- http://wagerlabs.com From ulf@REDACTED Sun Dec 2 17:15:52 2007 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 2 Dec 2007 17:15:52 +0100 Subject: [erlang-questions] init:restart in a gen_server In-Reply-To: References: Message-ID: <8209f740712020815kb566724t5f81c9446a0267d9@mail.gmail.com> There are times when shutdown doesn't work, or at least there used to be. If a process start function called from a supervisor spawns, but doesn't link to the supervisor, or explicitly unlinks, this could cause the shutdown procedure to hang forever. But as far as I can tell from the source, this problem has been addressed. What can you observe? Does the node seem to shut down correctly? BR, Ulf W 2007/11/30, Joel Reymont : > Folks, > > Are there any conditions under which init:restart/0 would stop working? > > It works fine on a local node when triggered from the Erlang shell. > > I have gen_server code that looks like this > > handle_cast('RESTART', Self) -> > F = fun() -> init:restart() end, > spawn(F), > {noreply, Self}; > > and it doesn't seem to work when 'RESTART' is received. > > What I mean by doesn't seem to work is that the apps are not > restarted, at least according to log files. > > Any suggestions? > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From ulf@REDACTED Sun Dec 2 17:18:16 2007 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 2 Dec 2007 17:18:16 +0100 Subject: [erlang-questions] PostgreSQL driver In-Reply-To: <779bf2730711301719t56f3d35bmb87749d88313a99a@mail.gmail.com> References: <474AB442.4020802@vlayko.tv> <474FE420.5040905@niclux.org> <20071130123631.8920@gmx.net> <60438E7D-519D-48BC-A1EE-77016D83A251@ketralnis.com> <20071130223804.131880@gmx.net> <2A3BE698-A07C-42C3-BFD3-B9A8655760D2@process-one.net> <779bf2730711301719t56f3d35bmb87749d88313a99a@mail.gmail.com> Message-ID: <8209f740712020818q3f7208c1v7e09d5b452612e4b@mail.gmail.com> OTP supports ODBC, which is exactly that: a general sql database interface. Not that I want to argue against having mysql and postgresql drivers. (: It makes sense to have optimized solutions for very commonly used databases. BR, Ulf W 2007/12/1, YC : > Shouldn't mysql also be considered together? So erlang can get closer > toward having a general sql database interface like other languages. Not to > pile on scope or anything :) > > I'll help test :) > > > On Nov 30, 2007 3:53 PM, Christophe Romain > wrote: > > we must not let pgsql driver in that state. > > does anyone have time to check if all theses version can be merged ? > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From michael.regen@REDACTED Sun Dec 2 17:48:14 2007 From: michael.regen@REDACTED (Michael Regen) Date: Sun, 2 Dec 2007 17:48:14 +0100 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <20071202123827.GA9893@tarantula.kolej.mff.cuni.cz> References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> <4EED01E9-2A4B-47E0-8AAF-E5735EEFFE9A@smartgames.ca> <47515EDF.50605@millstream.com> <844311CC-9ACB-4B8F-9D60-902DCD693EFE@smartgames.ca> <9b59d0270712020347i3d454b03m2c9d00f6345087d6@mail.gmail.com> <20071202123827.GA9893@tarantula.kolej.mff.cuni.cz> Message-ID: <9b59d0270712020848r799b93d7lf5046f40289c8a47@mail.gmail.com> On Dec 2, 2007 1:38 PM, Michal 'vorner' Vaner wrote: > What is more complex, if instead of prowiding: > md5: abcd123456 > > you provide: > md5: abcd12456 > sda1: bcdef1234 > > If one of them does not match, then it is not the file. > > And, of course, you can add sha256, too, if you want. Just any number of > different hash functions. If someone cracks md5, you still have the > other one to see it and gives you time to replace md5. > Let me ask the question the other way around: Why do you want to use a hashing schema which is less secure and requires more effort? And of course you could always provide hashes from all known hash functions currently known to be not broken. Does this really maximize security? Theoretically yes. But in practice you would need to check all hashes in order to benefit because one could be broken in the meanwhile. What if your non-crypto-experts choose the simple way and just check one hash? ('... because I already have md5.exe installed on my computer') Your hashing schema would give them a much better chance to step into this trap. How often can the weakest point in cryptography be found in osi layer 8 (human)? Cheers, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay@REDACTED Sun Dec 2 17:52:43 2007 From: jay@REDACTED (Jay Nelson) Date: Sun, 2 Dec 2007 08:52:43 -0800 Subject: [erlang-questions] Kicking off the London User Group with an Erlang Presentation (Dec 13th) Message-ID: <8BF4D6E9-09EA-4BF9-A6AF-61C2F39A5956@duomark.com> Francesco, This may be out of your control, but for those of us whose commute to London is prohibitive to undertake on a monthly basis, it would be nice if there was a London User Group website that kept archives of the monthly presentations. It would also build up another reference site for Google hits to grow interest in the language. jay From francesco@REDACTED Sun Dec 2 20:15:00 2007 From: francesco@REDACTED (Francesco Cesarini) Date: Sun, 02 Dec 2007 19:15:00 +0000 Subject: [erlang-questions] Kicking off the London User Group with an Erlang Presentation (Dec 13th) In-Reply-To: <8BF4D6E9-09EA-4BF9-A6AF-61C2F39A5956@duomark.com> References: <8BF4D6E9-09EA-4BF9-A6AF-61C2F39A5956@duomark.com> Message-ID: <47530434.4050306@erlang-consulting.com> Hi Jay, There are plenty of direct flights between LAX and London.. It would be great if you made it back :-) Jokes aside, I think it sounds like a great idea. I would not limit them to the London group, however, but also the other chapters we are kicking off and other groups which exist elsewhere (Portland / RTP are two I am aware of). Putting them in one place (trapexit?) would give us good volumes. We've always put the ETC presentations online, but not the ones given by external guests. Regards, Francesco -- http://www.erlang-consulting.com Jay Nelson wrote: > Francesco, > > This may be out of your control, but for those of us whose commute to > London is prohibitive to undertake on a monthly basis, it would be > nice if there was a London User Group website that kept archives of > the monthly presentations. It would also build up another reference > site for Google hits to grow interest in the language. > > jay > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > From lestat@REDACTED Sun Dec 2 20:23:48 2007 From: lestat@REDACTED (Tamas Nagy) Date: Sun, 2 Dec 2007 20:23:48 +0100 Subject: [erlang-questions] PostgreSQL driver In-Reply-To: <8209f740712020818q3f7208c1v7e09d5b452612e4b@mail.gmail.com> References: <474AB442.4020802@vlayko.tv> <474FE420.5040905@niclux.org> <20071130123631.8920@gmx.net> <60438E7D-519D-48BC-A1EE-77016D83A251@ketralnis.com> <20071130223804.131880@gmx.net> <2A3BE698-A07C-42C3-BFD3-B9A8655760D2@process-one.net> <779bf2730711301719t56f3d35bmb87749d88313a99a@mail.gmail.com> <8209f740712020818q3f7208c1v7e09d5b452612e4b@mail.gmail.com> Message-ID: <724BED4D-7121-41F7-A7DF-91856E8253D5@elte.hu> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In our project changing from ODBC to a native MySql driver resulted in a factor of two speed up on a Windows machine. On linux using the ODBC was unacceptable. It took ages to do a single query. We did not really investigated it why. Basically the erlang part was waiting for the answers 99% of the time. The cause probably had been the MySql's ODBC driver for linux. Regards, Tamas Nagy On Dec 2, 2007, at 5:18 PM, Ulf Wiger wrote: > OTP supports ODBC, which is exactly that: a general sql database > interface. > > Not that I want to argue against having mysql and postgresql > drivers. (: It makes sense to have optimized solutions for very > commonly used databases. > > BR, > Ulf W > > 2007/12/1, YC : >> Shouldn't mysql also be considered together? So erlang can get >> closer >> toward having a general sql database interface like other >> languages. Not to >> pile on scope or anything :) >> >> I'll help test :) >> >> >> On Nov 30, 2007 3:53 PM, Christophe Romain >> wrote: >>> we must not let pgsql driver in that state. >>> does anyone have time to check if all theses version can be merged ? >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://www.erlang.org/mailman/listinfo/erlang-questions >>> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFHUwZEqD+O75eYzdIRAmMkAJ9g1lN6WCKv3gNHdMFUJFapOLHW9gCguKjO b8fwv2li8VTZjq1AXopjiYQ= =OQSN -----END PGP SIGNATURE----- From yinso.chen@REDACTED Sun Dec 2 22:40:58 2007 From: yinso.chen@REDACTED (YC) Date: Sun, 2 Dec 2007 13:40:58 -0800 Subject: [erlang-questions] PostgreSQL driver In-Reply-To: <8209f740712020818q3f7208c1v7e09d5b452612e4b@mail.gmail.com> References: <474AB442.4020802@vlayko.tv> <474FE420.5040905@niclux.org> <20071130123631.8920@gmx.net> <60438E7D-519D-48BC-A1EE-77016D83A251@ketralnis.com> <20071130223804.131880@gmx.net> <2A3BE698-A07C-42C3-BFD3-B9A8655760D2@process-one.net> <779bf2730711301719t56f3d35bmb87749d88313a99a@mail.gmail.com> <8209f740712020818q3f7208c1v7e09d5b452612e4b@mail.gmail.com> Message-ID: <779bf2730712021340p1b7dae79vcdb125e19408e490@mail.gmail.com> Sure ODBC is general, but it is currently incomplete (not all odbc types are supported for prepared statements). The combo of odbc + psql + linux seem to have issues, and apparently ODBC is low priority due to lack of funding. See http://www.erlang.org/pipermail/erlang-questions/2007-October/029744.html and http://www.erlang.org/pipermail/erlang-questions/2007-October/029787.html. My point of a generic database interface is that there should be an effort to unify the interface (i.e. methods, usages, etc) for the native drivers so the cost of moving between databases is minimized. Not to say there can't be innovations and driver-specific methods, but having a common denominator is imperative from users' perspective. Cheers, yc On Dec 2, 2007 8:18 AM, Ulf Wiger wrote: > OTP supports ODBC, which is exactly that: a general sql database > interface. > > Not that I want to argue against having mysql and postgresql > drivers. (: It makes sense to have optimized solutions for very > commonly used databases. > > BR, > Ulf W > > 2007/12/1, YC : > > Shouldn't mysql also be considered together? So erlang can get closer > > toward having a general sql database interface like other languages. > Not to > > pile on scope or anything :) > > > > I'll help test :) > > > > > > On Nov 30, 2007 3:53 PM, Christophe Romain > > wrote: > > > we must not let pgsql driver in that state. > > > does anyone have time to check if all theses version can be merged ? > > > > > > > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yinso.chen@REDACTED Sun Dec 2 22:46:29 2007 From: yinso.chen@REDACTED (YC) Date: Sun, 2 Dec 2007 13:46:29 -0800 Subject: [erlang-questions] PostgreSQL driver In-Reply-To: <779bf2730712021340p1b7dae79vcdb125e19408e490@mail.gmail.com> References: <474AB442.4020802@vlayko.tv> <20071130123631.8920@gmx.net> <60438E7D-519D-48BC-A1EE-77016D83A251@ketralnis.com> <20071130223804.131880@gmx.net> <2A3BE698-A07C-42C3-BFD3-B9A8655760D2@process-one.net> <779bf2730711301719t56f3d35bmb87749d88313a99a@mail.gmail.com> <8209f740712020818q3f7208c1v7e09d5b452612e4b@mail.gmail.com> <779bf2730712021340p1b7dae79vcdb125e19408e490@mail.gmail.com> Message-ID: <779bf2730712021346l5c6b6661g84d5413d36be42be@mail.gmail.com> Oh and by "it" (in the first paragraph) I am referring to the ODBC driver in erlang - not that the ODBC standard is incomplete. Hopefully I didn't confuse everyone :) On Dec 2, 2007 1:40 PM, YC wrote: > Sure ODBC is general, but it is currently incomplete (not all odbc types > are supported for prepared statements). The combo of odbc + psql + linux > seem to have issues, and apparently ODBC is low priority due to lack of > funding. See http://www.erlang.org/pipermail/erlang-questions/2007-October/029744.html > and > http://www.erlang.org/pipermail/erlang-questions/2007-October/029787.html. > > My point of a generic database interface is that there should be an effort > to unify the interface ( i.e. methods, usages, etc) for the native drivers > so the cost of moving between databases is minimized. Not to say there > can't be innovations and driver-specific methods, but having a common > denominator is imperative from users' perspective. > > Cheers, > yc > > > On Dec 2, 2007 8:18 AM, Ulf Wiger wrote: > > > OTP supports ODBC, which is exactly that: a general sql database > > interface. > > > > Not that I want to argue against having mysql and postgresql > > drivers. (: It makes sense to have optimized solutions for very > > commonly used databases. > > > > BR, > > Ulf W > > > > 2007/12/1, YC : > > > Shouldn't mysql also be considered together? So erlang can get closer > > > > > toward having a general sql database interface like other languages. > > Not to > > > pile on scope or anything :) > > > > > > I'll help test :) > > > > > > > > > On Nov 30, 2007 3:53 PM, Christophe Romain > > > wrote: > > > > we must not let pgsql driver in that state. > > > > does anyone have time to check if all theses version can be merged ? > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > erlang-questions mailing list > > > > erlang-questions@REDACTED > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.fenton@REDACTED Sun Dec 2 22:40:35 2007 From: jay.fenton@REDACTED (Jay Fenton) Date: Sun, 2 Dec 2007 21:40:35 +0000 (UTC) Subject: [erlang-questions] =?utf-8?q?Kicking_off_the_London_User_Group_wi?= =?utf-8?q?th_an=09Erlang_Presentation_=28Dec_13th=29?= References: <8BF4D6E9-09EA-4BF9-A6AF-61C2F39A5956@duomark.com> Message-ID: > We willl be kicking off the user group on December 13th with a generic > presentation on Erlang for Five Nines. Looking at the history of Erlang, > its features, community research and commercial use. The talk will also > go into why Erlang, originally invented to handle the next generation of > Telecom products, has been successful in a much wider range of sectors > including banking and e-commerce. Sounds excellent :) It's great to see a burgeoning Erlang community forming in London. Looking forward to this event (and others like it!). -- Regards, Jay Fenton || Howler Technologies Ltd | http://www.howlertech.com/ Tel: +44 (0)207 099 7095 Registered in England & Wales, Company No. 06285634 From ulf@REDACTED Sun Dec 2 23:01:00 2007 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 2 Dec 2007 23:01:00 +0100 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: References: <375691.17118.qm@web81211.mail.mud.yahoo.com> <474E3520.1010903@industrial-designers.co.uk> Message-ID: <8209f740712021401w5fb9a803w3c81d9c92d28d3f2@mail.gmail.com> 2007/11/29, Brent Fulgham : > > On Nov 28, 2007, at 7:42 PM, David Hopwood wrote: > The times that take longer than a few seconds don't affect my point > that there is systematic bias against language implementations with > significant startup/shutdown times. > > You say this as though significant startup/shutdown times should be > considered acceptable. I disagree -- take for example SBCL or SML/NJ, > both of which have sizeable runtimes and yet manage to produce very > good times. Not that I particularly want to weigh in on the discussion about the benchmarks - I think they are interesting, and since they are even advertised as "flawed", criticism should rather be directed towards those who read too much into them, (: but... Regarding the startup time of the Erlang runtime, even the longest running benchmarks are ridiculously short compared to the running time of the applications for which Erlang was designed. It is by no means unusual for an Erlang-based system to run for years before it is restarted, and from that perspective, a few seconds is indeed insignificant. Not that we don't consider startup/restart times - we do, since it contributes to the overall downtime that needs to be kept under ca 5-6 minutes/year. But that would be system restart time, since the systems are redundant, and that happens very, very seldomly. One of the things Erlang does to make it easier to keep the system running for years on end, is that each module can be reloaded at run-time, without having to restart any processes. During startup, the runtime system loads the modules needed, by searching the code loader path for the right file. For the core modules, loaded from the boot script, the path is set to point directly to the right modules (possibly preceded by directories identified from the command line), so there is not much searching going on, but once the user-level applications start, code loading time will depend on which modules are called for by the program. I have no idea how much this affects the startup time of the benchmarks. Those programs are small and usually don't call on that many modules, so my guess would be that it isn't such an important factor. I'm even leaning towards thinking that it's not such a bad thing for Erlang that the shootout includes startup time, since it is a likely weakness of Erlang, given its focus on non-stop applications. (: BR, Ulf W From timm.turn@REDACTED Sun Dec 2 23:32:04 2007 From: timm.turn@REDACTED (Timmy Turner) Date: Sun, 2 Dec 2007 23:32:04 +0100 Subject: [erlang-questions] SQL Like Language To Crawl Websites Message-ID: Hi everyone out there! I'm still quite new, to erlang, so please try to not be mad, even if I say or suggest something stupid... I thought of creating a sql like language to crawl websites - an example of such a query could be: GET_ME ALL_PAGES FROM en.wikipedia.org WHERE uri LIKE wiki/.*; this would crawl all articles of wikipedia (the like-expression is supposed to be a regular expression) I'm not quite sure of how to approach this... One idea would be with macros: -define("GET_PAGE", "get_pages(\"" ). -define(";", "\")."). such that this query ?GET_ME ALL_PAGES FROM en.wikipedia.org WHERE uri LIKE /wiki/.* ?; would be transformed in get_pages("ALL_PAGES FROM en.wikipedia.org WHERE uri LIKE wiki/.*"); 1. Now, the define syntax isn't perfectly valid - I'm aware of that, so the first question would be, is what I'm thinking of even possible? 2. Does it make sense do to something like this? 3. Are there any better approaches? 4. Is there any general introduction for meta-programming in erlang? 5. Anything else you'd like to tell me? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From rrerlang@REDACTED Sun Dec 2 23:52:25 2007 From: rrerlang@REDACTED (Robert Raschke) Date: Sun, 2 Dec 2007 22:52:25 +0000 Subject: [erlang-questions] how: ot: real time web pages? In-Reply-To: <367881F2-45D2-4D41-9CE3-C93004157E4C@fmi.fi> Message-ID: <219134eb912838a4735b50f9c18ad38c@tombob.com> On and off I've been thinking it would fab to create an H.264 video stream on the fly that would serve your constantly updating view. Anyone know of any tools that would allow the creation of such a stream directly from within code, i.e., drawing instructions get drawn on the "canvas" and they magically appear in the stream? Maybe just something that can read from an SDL canvas and regularly (frame-rate) do its thing? At least for view-only, that would be quite interesting. Interacting would need a bit of thought. Robby From chsu79@REDACTED Mon Dec 3 00:26:24 2007 From: chsu79@REDACTED (Christian S) Date: Mon, 3 Dec 2007 00:26:24 +0100 Subject: [erlang-questions] PostgreSQL driver In-Reply-To: <779bf2730712021340p1b7dae79vcdb125e19408e490@mail.gmail.com> References: <474AB442.4020802@vlayko.tv> <20071130123631.8920@gmx.net> <60438E7D-519D-48BC-A1EE-77016D83A251@ketralnis.com> <20071130223804.131880@gmx.net> <2A3BE698-A07C-42C3-BFD3-B9A8655760D2@process-one.net> <779bf2730711301719t56f3d35bmb87749d88313a99a@mail.gmail.com> <8209f740712020818q3f7208c1v7e09d5b452612e4b@mail.gmail.com> <779bf2730712021340p1b7dae79vcdb125e19408e490@mail.gmail.com> Message-ID: 2007/12/2, YC : > My point of a generic database interface is that there should be an effort > to unify the interface ( i.e. methods, usages, etc) for the native drivers > so the cost of moving between databases is minimized. Not to say there > can't be innovations and driver-specific methods, but having a common > denominator is imperative from users' perspective. You always get heavy dependencies on the db you pick, and you dont want to have an api that is too least-common-denominator. It's more that the basic things should smell the same so you can reuse your knowledge of accessing pgsql the day you implement something that accesses mysql. Anyway, to steer the thread elsewhere. Connection pooling: Has someone implemented something like the following? I want feedback and improvement ideas. http://paste.lisp.org/display/51804 (in case the ascii art below doesnt look good for you) == Summary == When you have something that is expensive to set up you want to re-use it. SQL db connections are typically expensive (slow) to set up. SQL databases tend to have some form of concurrency, so you can gain from having multiple connections to them. So how do you solve the problem of having finite resources scheduled on a first-come-first-use basis? == Resource pool supervisor tree == |------------| | Supervisor | |-----+------| +------------------+ |-----+-------| |-------+---------| | Pool Master | | Pool supervisor | |-------------| |-------+---------| +--------------+ |-------+--| |-----+----| | Worker 1 | ... | Worker N | |----------| |----------| == Example == When you want to do_stuff you stand in line for one of the N workers by calling: gen_pool:transaction(database, fun(Db) -> do_stuff(Db) end). == How it would work == The Pool master populates the pool supervisor (simple one for one) with dynamic workers, and workers register themself with the Pool Master once they're started and ready to take jobs. The pool master monitor workers so it can forget dead workers. Perhaps the pool master should inform a worker about it being checked out, and after it has been returned. From igouy2@REDACTED Mon Dec 3 00:09:52 2007 From: igouy2@REDACTED (Isaac Gouy) Date: Sun, 2 Dec 2007 15:09:52 -0800 (PST) Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <8209f740712021401w5fb9a803w3c81d9c92d28d3f2@mail.gmail.com> Message-ID: <580892.77845.qm@web60516.mail.yahoo.com> --- Ulf Wiger wrote: -snip- > Not that I particularly want to weigh in on the discussion about the > benchmarks - I think they are interesting, and since they are even > advertised as "flawed", criticism should rather be directed towards > those who read too much into them, (: but... > > Regarding the startup time of the Erlang runtime, even the longest > running benchmarks are ridiculously short compared to the running > time of the applications for which Erlang was designed. It is by no > means unusual for an Erlang-based system to run for years before > it is restarted, and from that perspective, a few seconds is indeed > insignificant. Not that we don't consider startup/restart times - we > do, since it contributes to the overall downtime that needs to be > kept under ca 5-6 minutes/year. But that would be system restart > time, since the systems are redundant, and that happens very, > very seldomly. > > One of the things Erlang does to make it easier to keep the system > running for years on end, is that each module can be reloaded at > run-time, without having to restart any processes. During startup, > the runtime system loads the modules needed, by searching the > code loader path for the right file. For the core modules, loaded > from the boot script, the path is set to point directly to the right > modules (possibly preceded by directories identified from the > command line), so there is not much searching going on, but > once the user-level applications start, code loading time will > depend on which modules are called for by the program. > > I have no idea how much this affects the startup time of the > benchmarks. Those programs are small and usually don't > call on that many modules, so my guess would be that it isn't > such an important factor. I'm even leaning towards thinking that > it's not such a bad thing for Erlang that the shootout includes > startup time, since it is a likely weakness of Erlang, given its > focus on non-stop applications. (: At present, the only program with imports is partial-sums -import(math,[pow/2,sin/1,cos/1]). -import(lists,[foreach/2,zipwith/3]). "Different design intentions - domain" http://shootout.alioth.debian.org/gp4/miscfile.php?file=benchmarking&title=Flawed%20Benchmarks#domain I think your better argument is: ? Lesson learned: it?s nearly impossible to predict system performance based on low-level ?micro? benchmarks. ? Failure to manage complexity often kills performance. ____________________________________________________________________________________ Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ From oneone@REDACTED Mon Dec 3 03:27:30 2007 From: oneone@REDACTED (Andrew Arrow) Date: Sun, 2 Dec 2007 18:27:30 -0800 Subject: [erlang-questions] increment an int in mysql vs. mnesia Message-ID: in mysql I can say: update company set sales=sales+1 where company_id=123 and it will safely increment the value of sales by 1. In mnesia I have to first read the value, then write the value+1. [Row] = mnesia:read({company, 123}) %% make Row1 = Row but with sales = sales + 1 mnesia:write(Row1) mnesia:transaction(The_above_fun) But it's possible for two processes at the same time to write back the same value for sales and miss one increment. i.e. processA reads 100 for sales, processB also reads 100, they each write back 101 but it should be 102. Is there a better way to do this? Thanks. From jeffm@REDACTED Mon Dec 3 03:33:16 2007 From: jeffm@REDACTED (jm) Date: Mon, 03 Dec 2007 13:33:16 +1100 Subject: [erlang-questions] how: ot: real time web pages? In-Reply-To: <219134eb912838a4735b50f9c18ad38c@tombob.com> References: <219134eb912838a4735b50f9c18ad38c@tombob.com> Message-ID: <47536AEC.2080700@ghostgun.com> Robert Raschke wrote: > On and off I've been thinking it would fab to create an H.264 video > stream on the fly that would serve your constantly updating view. > Anyone know of any tools that would allow the creation of such a > stream directly from within code, i.e., drawing instructions get drawn > on the "canvas" and they magically appear in the stream? Maybe just > something that can read from an SDL canvas and regularly (frame-rate) > do its thing? > > At least for view-only, that would be quite interesting. Interacting > would need a bit of thought. > I was thinking of something along the same lines the other day, but was thinking of using the same protocol that is used in VNC, http://en.wikipedia.org/wiki/VNC The protocol, http://realvnc.com/docs/rfbproto.pdf A simple counter example, http://www.cl.cam.ac.uk/research/dtg/attarchive/vnc/rfbcounter.html The main reason I was thinking along this path in the first place was a way to get around the Element Manager problem that you see with network equipment needing to run a special client program which is one reason a lot of these companies are reaching for Web Application. This, as you know, introduces a new set of problems to do with supporting different browsers which leads companies to mandate the use of one browser so this is really a false solution. What I'm proposing here is that the client machine run a VNC client, and there's plenty of free ones available, and that the network device/server/etc runs a VNC server. This way it is possible to control the look and feel, etc without the bloated browser stack and its problems. This argument would be valid for most thin client protocols, but I think the VNC is one of the more suitable ones. It also gives interaction which you for see as a problem with your method. Jeff. From vlm@REDACTED Mon Dec 3 04:52:31 2007 From: vlm@REDACTED (Lev Walkin) Date: Sun, 02 Dec 2007 19:52:31 -0800 Subject: [erlang-questions] increment an int in mysql vs. mnesia In-Reply-To: References: Message-ID: <47537D7F.7070700@lionet.info> Andrew Arrow wrote: > in mysql I can say: > > update company set sales=sales+1 where company_id=123 > > and it will safely increment the value of sales by 1. > > In mnesia I have to first read the value, then write the value+1. > > [Row] = mnesia:read({company, 123}) > %% make Row1 = Row but with sales = sales + 1 > mnesia:write(Row1) > mnesia:transaction(The_above_fun) > > But it's possible for two processes at the same time to write back the > same value for sales and miss one increment. > i.e. processA reads 100 for sales, processB also reads 100, they each > write back 101 but it should be 102. > > Is there a better way to do this? Thanks. There's something on transactions in `erl -man mnesia`. I think it makes sense to refer to documentation at this point. -- Lev Walkin vlm@REDACTED From jim.mccoy@REDACTED Mon Dec 3 06:50:08 2007 From: jim.mccoy@REDACTED (Jim McCoy) Date: Sun, 2 Dec 2007 21:50:08 -0800 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <9b59d0270712020848r799b93d7lf5046f40289c8a47@mail.gmail.com> References: <9b08084c0712010342m2c70e352t8f5fcb5de78acd61@mail.gmail.com> <4EED01E9-2A4B-47E0-8AAF-E5735EEFFE9A@smartgames.ca> <47515EDF.50605@millstream.com> <844311CC-9ACB-4B8F-9D60-902DCD693EFE@smartgames.ca> <9b59d0270712020347i3d454b03m2c9d00f6345087d6@mail.gmail.com> <20071202123827.GA9893@tarantula.kolej.mff.cuni.cz> <9b59d0270712020848r799b93d7lf5046f40289c8a47@mail.gmail.com> Message-ID: I guess this hits at one of my sore points regarding Erlang -- the crypto library (based on the rather limited and task-specific OpenSSL crypto toolkit) is "sub-optimal." I have often told myself that I should just get off my butt and replace it with LibTomCrypt. This would offer every symmetric cipher and hash you could want along with other nice goodies like a PRNG that can use available hardware randomness if the platform supports it (no more need to manually seed random on most platforms) and nice perks like elliptic curve public keys. OTOH, this is one of those things that seems at first glance like it would be easier to change in the Erlang distro than to create as a linked-in driver. Maybe because most of the docs for linked-in drivers are scary while swapping C functions in the crypto module using LibTomCrypt's modular API looked to be a bit easier. So, how wedded to the current OpenSSL libcrypto are we? jim From paul-trapexit@REDACTED Mon Dec 3 07:10:36 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Sun, 2 Dec 2007 22:10:36 -0800 (PST) Subject: [erlang-questions] sending data down the wire in mysql vs. mnesia In-Reply-To: <8209f740712020549n7be69c27wf87bf8cfb4fba977@mail.gmail.com> References: <4751DC7A.6070204@lionet.info> <4751E1ED.5020804@lionet.info> <8209f740712020549n7be69c27wf87bf8cfb4fba977@mail.gmail.com> Message-ID: The mnesia access API seems to low level to pull this off, since it intercepts individual reads and writes. What I'd like is something like rpc:pmap/3 for mnesia (fragmented tables); in this case I can't hand roll it because the transaction context does not carry over through an rpc:call (and its not clear how the side effect of doing an rpc call interacts with transaction retry mechanism anyway; seems like mnesia should be aware of this explicitly for it to work out). What I can do right now is use the rpc module to call mnesia:activity for me on the remote nodes, and the reduce the collection of results. This is ok but 1) I have to figure out where the active replicas are for the fragments I care about so location transparency is gone and 2) I can't have a single transaction for all the activity. -- p On Sun, 2 Dec 2007, Ulf Wiger wrote: > 2007/12/1, Paul Mineiro : > > With a fragmented MySQL table, I can execute a stored procedure > > on each MySQL fragment, and the reduce the collection of results in the > > client. The only thing that travels over the wire is the collection of > > results, one for each fragment. > > > > I'm looking for something similar from Mnesia. Erlang has all the > > building blocks to put it together (so I have), but I can see an > > opportunity to come up with something standard within Mnesia which is > > reasonably general and would return me to a more location-transparent > > style of programming. > > You can modify mnesia_frag and tell mnesia to use your version instead > of the default. How to do this is documented in mnesia. The downside is > of course that you'd have to duplicate/maintain a whole bunch of other logic > as well, just to make this small change, but in the process of doing this, > you may arrive at some suggestion on how to make this parameterizable. > > BR, > Ulf W > Optimism is an essential ingredient of innovation. How else can the individual favor change over security? -- Robert Noyce From dgud@REDACTED Mon Dec 3 08:16:25 2007 From: dgud@REDACTED (Dan Gudmundsson) Date: Mon, 03 Dec 2007 08:16:25 +0100 Subject: [erlang-questions] how: mnesia with simultaneous permanent node failure (EC2) In-Reply-To: <200712012014.lB1KEROB022951@snookles.snookles.com> References: <200712012014.lB1KEROB022951@snookles.snookles.com> Message-ID: <4753AD49.30501@erix.ericsson.se> You should be able to start an old node with a clean directory and connect it mnesia:change_config(extra_db_nodes, [OneOfYourNodes]) so it will download the schema and and convert it disc, and the other tables from the other nodes. /Dan Scott Lystig Fritchie wrote: >>>>>> "pm" == Paul Mineiro writes: > > pm> however when i tried to apply the procedure to simultaneous loss > pm> of two nodes, i ran into a problem; calling > pm> mnesia:del_table_copy/2 of schema requires all other nodes to be > pm> active, and is this scenario i have lost two nodes simultaneously > pm> (attached as test-disaster-two). > > Yup, I've also discovered that feature. Heh, some colleagues have run > into problems when they've intentionally created such a failure via > the "rm -rf" trick. I had to explain that just because node C in a > cluster lost it's mind doesn't mean that A & B & others haven't > forgotten that C is a member. > > My solution was to create a backup of each node after a schema change, > and use that backup to bootstrap a dead node back to life ... then use > mnesia:del_table_copy() if I really wanted to remove that node from > the cluster. > > An interesting experiment that I haven't tried ... Mnesia backups, by > default, include all tuples from all tables. Either by using a custom > backup module, or by post-processing a backup via > mnesia:traverse_backup(), to include only the schema table. I wonder > if restoring only the schema table on each formerly-dead node is > sufficient? > > -Scott > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From alceste@REDACTED Mon Dec 3 10:16:22 2007 From: alceste@REDACTED (Alceste Scalas) Date: Mon, 03 Dec 2007 10:16:22 +0100 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <200712011244.lB1Ciaim041788@pluto.hedeland.org> References: <200712011244.lB1Ciaim041788@pluto.hedeland.org> Message-ID: <1196673382.6601.17.camel@gnatziu.crs4.it> Il giorno sab, 01/12/2007 alle 13.44 +0100, Per Hedeland ha scritto: > "Joe Armstrong" wrote: > > > >MD5 is really broken - gulp see > > > >http://www.win.tue.nl/hashclash/SoftIntCodeSign/ > > "Broken" is a too strong word - for any value produced by any hashing > method, there will obviously be an infinite number of different inputs > that produce the same value - the question is how hard it is to find > them. Well, in the case of MD5, the word "broken" is not that strong IMHO. For example, you can create your own md5-colliding executables with this useful (?) tool: http://www.mscs.dal.ca/~selinger/md5collision/ I've seen similar tools for creating md5-colliding PDFs, PSs, etc. Regards, alceste -- Alceste Scalas CRS4 - http://www.crs4.it/ From vychodil.hynek@REDACTED Mon Dec 3 10:23:01 2007 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Mon, 3 Dec 2007 10:23:01 +0100 Subject: [erlang-questions] increment an int in mysql vs. mnesia In-Reply-To: References: Message-ID: <4d08db370712030123k4889a3c2wc93ea6ef0780f57b@mail.gmail.com> see mnesia:dirty_update_counter On 12/3/07, Andrew Arrow wrote: > in mysql I can say: > > update company set sales=sales+1 where company_id=123 > > and it will safely increment the value of sales by 1. > > In mnesia I have to first read the value, then write the value+1. > > [Row] = mnesia:read({company, 123}) > %% make Row1 = Row but with sales = sales + 1 > mnesia:write(Row1) > mnesia:transaction(The_above_fun) > > But it's possible for two processes at the same time to write back the > same value for sales and miss one increment. > i.e. processA reads 100 for sales, processB also reads 100, they each > write back 101 but it should be 102. > > Is there a better way to do this? Thanks. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil From puzza007@REDACTED Mon Dec 3 10:25:39 2007 From: puzza007@REDACTED (Paul Oliver) Date: Mon, 3 Dec 2007 09:25:39 +0000 Subject: [erlang-questions] how: ot: real time web pages? In-Reply-To: <367881F2-45D2-4D41-9CE3-C93004157E4C@fmi.fi> References: <474D2E90.80603@ericsson.com> <474DED25.7060708@ghostgun.com> <9b08084c0711290206k459f9cdbjc6ffcfddeaa890c3@mail.gmail.com> <367881F2-45D2-4D41-9CE3-C93004157E4C@fmi.fi> Message-ID: Hi Jouni, Chris Double a.k.a Blueish Coder has a great blog entry and example code for this here: http://www.bluishcoder.co.nz/2005/11/pushing-events-to-browser-via-ajax.html Cheers, Paul. On Dec 2, 2007 7:25 AM, Jouni Ryn? wrote: > I start from what I would like to have: > A web page with a real time updated display of numerical values and > graphs. Think about typical process displays in industry, > temperatures, voltages and some graphs showing parameter history. > Maybe some graphical layout of hardware, to show how each parameter > is connected to each other. > > To achieve that, I would need a web page template format, where I can: > - define named text fields, which shall be updated > - define named graphics, which can be updated > - and some code to generate the real page and connection functions > for (comet style?) communication with the page and erlang process > feeding the data > > Currently I have all that implemented as Tcl/Tk canvas (thanks to Ola > Samuelsson and ewish, which was distributed with Erlang back in 97 or > so?) > > As my understanding of "javascript" is practically zero, I would like > get a hint on how to do this. Googling shows a lot of options, most > of the systems not quite being there. Should it be simply javascript > and svg, changes updated via attributes. Or canvas tag (complicated > with text fields?) Or haxe and flash (for which I did not find > examples, how the update mechanism would work) Or something else? > > Is this doable? Some examples existing already? > > Jouni > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- http://mosangeles.net From per@REDACTED Mon Dec 3 11:07:34 2007 From: per@REDACTED (Per Hedeland) Date: Mon, 3 Dec 2007 11:07:34 +0100 (CET) Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <1196673382.6601.17.camel@gnatziu.crs4.it> Message-ID: <200712031007.lB3A7Yhm097654@pluto.hedeland.org> Alceste Scalas wrote: > >Il giorno sab, 01/12/2007 alle 13.44 +0100, Per Hedeland ha scritto: >> "Joe Armstrong" wrote: >> > >> >MD5 is really broken - gulp see >> > >> >http://www.win.tue.nl/hashclash/SoftIntCodeSign/ >> >> "Broken" is a too strong word - for any value produced by any hashing >> method, there will obviously be an infinite number of different inputs >> that produce the same value - the question is how hard it is to find >> them. > >Well, in the case of MD5, the word "broken" is not that strong IMHO. >For example, you can create your own md5-colliding executables [snip] Yes, this is basically what the originally referenced paper discusses. The point is, as I described in the part of my message that you snipped, that this is not how you use md5 (or any other hash) for integrity checking. Both you and earlier Michael Regen (about the "funny" application invented by the guys that wrote the paper) use the word "example" - and I have to wonder, example of what? Can either of you point to any real-world application where the possibiliy to modify two inputs such that they produce the same hash actually is a problem *per se*? By the way, this discussion really doesn't have much to do with Erlang, I'm not sure why Joe posted here in the first place - except for one thing that hasn't even been mentioned yet: The Erlang distribution mechanism uses md5 in the authentication process. Of course it isn't "broken" (yet) either, but changing to a "better" hash function is obviously a good idea. Then again, everyone seems to think that the Erlang distribution is inherently unsafe anyway (for reasons that aren't obvious to me at least)... --Per Hedeland From Reddy_P@REDACTED Mon Dec 3 11:21:26 2007 From: Reddy_P@REDACTED (Primanathan Reddy [ MTN - Innovation Centre ]) Date: Mon, 3 Dec 2007 12:21:26 +0200 Subject: [erlang-questions] FW: SMP VM DUMPING CORE Message-ID: <9D5D0FF2FC2E5C47A1A54047C271BE49D727C2@MTNMAIL1.mtn.co.za> Forgot to mention: Erlang Version: R11B5 OS: SOLARIS 10 -----Original Message----- From: Primanathan Reddy [ MTN - Innovation Centre ] Sent: Monday, 03 December 2007 12:03 PM To: erlang-questions@REDACTED Cc: 'v@REDACTED'; 'valentin@REDACTED' Subject: SMP VM DUMPING CORE Hi all, It seems that erts_port_task_abort (invoked by tcp_inet_drv) function is causing infrequent segmentation fault on SOLARIS (Netra T2000). Wouldn't like to jump to a conclusion, but it looks like an access synchronization/scheduling issue -- i.e. abort is trying to free some resources that have been already freed by another thread, or something similar (we're running SMP). Where (or to whom) should we mail the core file for further investigation? Regards Valentin Micic Pharos CONSVLTING (Pty) Ltd +2783 212 9180 NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 From Reddy_P@REDACTED Mon Dec 3 11:02:54 2007 From: Reddy_P@REDACTED (Primanathan Reddy [ MTN - Innovation Centre ]) Date: Mon, 3 Dec 2007 12:02:54 +0200 Subject: [erlang-questions] SMP VM DUMPING CORE In-Reply-To: <1196673382.6601.17.camel@gnatziu.crs4.it> References: <200712011244.lB1Ciaim041788@pluto.hedeland.org> <1196673382.6601.17.camel@gnatziu.crs4.it> Message-ID: <9D5D0FF2FC2E5C47A1A54047C271BE49D7278A@MTNMAIL1.mtn.co.za> Hi all, It seems that erts_port_task_abort (invoked by tcp_inet_drv) function is causing infrequent segmentation fault on SOLARIS (Netra T2000). Wouldn't like to jump to a conclusion, but it looks like an access synchronization/scheduling issue -- i.e. abort is trying to free some resources that have been already freed by another thread, or something similar (we're running SMP). Where (or to whom) should we mail the core file for further investigation? Regards Valentin Micic Pharos CONSVLTING (Pty) Ltd +2783 212 9180 NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 From alceste@REDACTED Mon Dec 3 12:08:08 2007 From: alceste@REDACTED (Alceste Scalas) Date: Mon, 03 Dec 2007 12:08:08 +0100 Subject: [erlang-questions] idea: Erlang FFI: bigendian support In-Reply-To: <1195136120.6436.87.camel@gnatziu.crs4.it> References: <1195136120.6436.87.camel@gnatziu.crs4.it> Message-ID: <1196680088.6601.35.camel@gnatziu.crs4.it> Il giorno gio, 15/11/2007 alle 15.15 +0100, Alceste Scalas ha scritto: > There are a few aspects that should be improved: > > 4. the patches are untested on bigendian platforms (I expect them > to require several fixes --- beta testers needed!) Just a quick note: I've added bigendian support to the FFI patches. Everything is available at the usual place: http://muvara.org/crs4/erlang/ffi The patches have been tested with GNU/Linux on PowerPC and PowerPC64 (i.e. on a Playstation 3 with different GCC switches). Regards, alceste -- Alceste Scalas CRS4 - http://www.crs4.it/ From rjmh@REDACTED Mon Dec 3 12:31:37 2007 From: rjmh@REDACTED (John Hughes) Date: Mon, 3 Dec 2007 12:31:37 +0100 Subject: [erlang-questions] Jobs in Functional Programming event at Chalmers In-Reply-To: <015701c82b6a$35131570$9f394050$@chalmers.se> References: <015701c82b6a$35131570$9f394050$@chalmers.se> Message-ID: <004401c835a0$12d4baf0$387e30d0$@chalmers.se> I'm proud to announce that the first "Jobs in Functional Programming" recruitment evening will be held at Chalmers University on the 14th of December. As far as I am aware, this is the first time such an event has been held anywhere in the world. While we're holding the event at Chalmers because we have many skilled functional programmers among our students, it is of course open to anyone who would like to take part. All the details can be found at www.jobs-in-fp.org. Welcome to what promises to be a very exciting event! John Hughes -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.arnon@REDACTED Mon Dec 3 12:50:22 2007 From: alex.arnon@REDACTED (Alex Arnon) Date: Mon, 3 Dec 2007 13:50:22 +0200 Subject: [erlang-questions] Query: Status of Erlang on AIX. Message-ID: <944da41d0712030350o52f37722t9496a79e1179fa99@mail.gmail.com> Hi All, We are interested in deploying software written in Erlang on AIX platforms (some older than others, others new). I would like to ask, then: - Is AIX supported? The relevant OS versions are both 4.x and 5.x (hopefully AIX 6 will be deployed within the next 6 months). - Are there caveats, such as "ODBC/Java/SSL is not supported"/"compile with toolchain X"? Thanks in advance, Alex. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.regen@REDACTED Mon Dec 3 13:30:01 2007 From: michael.regen@REDACTED (Michael Regen) Date: Mon, 3 Dec 2007 13:30:01 +0100 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <200712031007.lB3A7Yhm097654@pluto.hedeland.org> References: <1196673382.6601.17.camel@gnatziu.crs4.it> <200712031007.lB3A7Yhm097654@pluto.hedeland.org> Message-ID: <9b59d0270712030430s1f32c606tf10d21d5588eb9d1@mail.gmail.com> On Dec 3, 2007 11:07 AM, Per Hedeland wrote: > Yes, this is basically what the originally referenced paper discusses. > The point is, as I described in the part of my message that you snipped, > that this is not how you use md5 (or any other hash) for integrity > checking. Both you and earlier Michael Regen (about the "funny" > application invented by the guys that wrote the paper) use the word > "example" - and I have to wonder, example of what? Can either of you > point to any real-world application where the possibiliy to modify two > inputs such that they produce the same hash actually is a problem *per > se*? > I tried to point out that there are several applications for the use of hashes. For md5 (and others) some are broken (whenever the initial message was created by a source you cannot trust) and some are still fine (initial message was created by a trustworthy source). In the case of md5 in Erlang's distribution mechanism I assume this falls into the second category: Fine and not broken. Regarding your question - if I understood it correctly: Take a look at NIST and their FIPS 140-2 (Security Requirements for Cryptographic Modules) certification process. Now assume I want to get certification for my OpenSSL version. Simplified: I prepare an innocent version of OpenSSL and the security policy (http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp642.pdf) including hashes for my source code files (=initial message). Then NIST reviews and certifies it ( http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140crt/140crt642.pdf). Security is based on the assumption that I cannot create another (evil) version of OpenSSL source code with the same hash codes as provided in the security policy. Later you download my in the meanwhile changed OpenSSL version, check the hashes and assume everything is fine. I am puzzled that they are using HMAC-SHA1 in 2006 and even in 2007. Did I miss anything? However, you get the point. > > By the way, this discussion really doesn't have much to do with Erlang, > I'm not sure why Joe posted here in the first place - except for one > thing that hasn't even been mentioned yet: The Erlang distribution > mechanism uses md5 in the authentication process. Of course it isn't > "broken" (yet) either, but changing to a "better" hash function is > obviously a good idea. I totally agree. > Then again, everyone seems to think that the > Erlang distribution is inherently unsafe anyway (for reasons that aren't > obvious to me at least)... > > --Per Hedeland > I can just talk about myself. And I simply do not know whether it is safe or not. I have not seen any reviews of it, neither bad nor good ones and I assume that its ability to withstand attacks is not tested much because I assume that most Erlang nodes are operated in a safe environment. Remember, even OpenSSH had it's troubles. One of the design goals of OpenSSH was to operate it in the wild. I do not know whether this was also one of the design goals of Erlang distribution. I tend to deny this since I read distribution_handshake.txt ("This is not entirelly safe, as it is vulnerable against takeover attacks, but it is a tradeoff between fair safety and performance."). Erlang SSL distribution is currently broken. You cannot control which IP address epmd binds to... I think in the area of IT security you have to choose the defensive approach. You need a proof or very good hints that something is secure before you can assume it to be secure. Therefore I handle Erlang distribution as if it were unsafe. By the way I am only referring to open source Erlang. I cannot say anything about the commercial version of Erlang. Cheers, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickard.s.green@REDACTED Mon Dec 3 13:28:20 2007 From: rickard.s.green@REDACTED (Rickard Green) Date: Mon, 03 Dec 2007 13:28:20 +0100 Subject: [erlang-questions] FW: SMP VM DUMPING CORE In-Reply-To: <9D5D0FF2FC2E5C47A1A54047C271BE49D727C2@MTNMAIL1.mtn.co.za> References: <9D5D0FF2FC2E5C47A1A54047C271BE49D727C2@MTNMAIL1.mtn.co.za> Message-ID: <4753F664.6050809@ericsson.com> Hi! Can you make the /lib/erlang/erts-5.5.5/bin/beam.smp file and the core file available on a web-server or ftp-server? You can mail me the url directly if you don't want to make it available to the world. BR, Rickard Green, Erlang/OTP, Ericsson AB. Primanathan Reddy [ MTN - Innovation Centre ] wrote: > Forgot to mention: > > Erlang Version: R11B5 > OS: SOLARIS 10 > > -----Original Message----- > From: Primanathan Reddy [ MTN - Innovation Centre ] > Sent: Monday, 03 December 2007 12:03 PM > To: erlang-questions@REDACTED > Cc: 'v@REDACTED'; 'valentin@REDACTED' > Subject: SMP VM DUMPING CORE > > Hi all, > > It seems that erts_port_task_abort (invoked by tcp_inet_drv) function is > causing infrequent segmentation fault on SOLARIS (Netra T2000). Wouldn't > like to jump to a conclusion, but it looks like an access > synchronization/scheduling issue -- i.e. abort is trying to free some > resources that have been already freed by another thread, or something > similar (we're running SMP). > > Where (or to whom) should we mail the core file for further > investigation? > > Regards > > Valentin Micic > Pharos CONSVLTING (Pty) Ltd > +2783 212 9180 > > NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From Reddy_P@REDACTED Mon Dec 3 16:03:58 2007 From: Reddy_P@REDACTED (Primanathan Reddy [ MTN - Innovation Centre ]) Date: Mon, 3 Dec 2007 17:03:58 +0200 Subject: [erlang-questions] FW: SMP VM DUMPING CORE In-Reply-To: <4753F664.6050809@ericsson.com> References: <9D5D0FF2FC2E5C47A1A54047C271BE49D727C2@MTNMAIL1.mtn.co.za> <4753F664.6050809@ericsson.com> Message-ID: <9D5D0FF2FC2E5C47A1A54047C271BE49D72DB1@MTNMAIL1.mtn.co.za> Hi Rickard You can find the files(zipped) here: Beam.smp: Filename: beam.zip Link: http://www.datafilehost.com/download.php?file=24d4edba Core: Filename: core_20071103.zip Link: http://www.datafilehost.com/download.php?file=3c416cb9 Regards Prima -----Original Message----- From: Rickard Green [mailto:rickard.s.green@REDACTED] Sent: Monday, 03 December 2007 02:28 PM To: Primanathan Reddy [ MTN - Innovation Centre ] Cc: erlang-questions@REDACTED; v@REDACTED Subject: Re: [erlang-questions] FW: SMP VM DUMPING CORE Hi! Can you make the /lib/erlang/erts-5.5.5/bin/beam.smp file and the core file available on a web-server or ftp-server? You can mail me the url directly if you don't want to make it available to the world. BR, Rickard Green, Erlang/OTP, Ericsson AB. Primanathan Reddy [ MTN - Innovation Centre ] wrote: > Forgot to mention: > > Erlang Version: R11B5 > OS: SOLARIS 10 > > -----Original Message----- > From: Primanathan Reddy [ MTN - Innovation Centre ] > Sent: Monday, 03 December 2007 12:03 PM > To: erlang-questions@REDACTED > Cc: 'v@REDACTED'; 'valentin@REDACTED' > Subject: SMP VM DUMPING CORE > > Hi all, > > It seems that erts_port_task_abort (invoked by tcp_inet_drv) function is > causing infrequent segmentation fault on SOLARIS (Netra T2000). Wouldn't > like to jump to a conclusion, but it looks like an access > synchronization/scheduling issue -- i.e. abort is trying to free some > resources that have been already freed by another thread, or something > similar (we're running SMP). > > Where (or to whom) should we mail the core file for further > investigation? > > Regards > > Valentin Micic > Pharos CONSVLTING (Pty) Ltd > +2783 212 9180 > > NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 From ingela@REDACTED Mon Dec 3 17:42:51 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Mon, 03 Dec 2007 17:42:51 +0100 Subject: [erlang-questions] PostgreSQL driver (YC) In-Reply-To: References: Message-ID: <4754320B.5020707@erix.ericsson.se> >> The combo of odbc + psql + linux >> seem to have issues, If the drivers on linux for psql are slow is not really an Erlang problem, but of course it can make that option a non interesting one. >> and apparently ODBC is low priority due to lack of >> funding. See http://www.erlang.org/pipermail/erlang-questions/2007-October/029744.html >> True, it is also true that odbc is a quite small application and as Erlang/OTP is open source it should not be too hard for some one really interested in the odbc application to make a patch suggestion where all types are supported, if they do not want to wait for us to find the time make it complete. Of course we think it would be a good idea to make it complete but we can alas not clone our selfs and the stuff someone pays us to do will always get highest priority, that just how it works. Regards Ingela - OTP team From ulf@REDACTED Mon Dec 3 18:22:41 2007 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 3 Dec 2007 18:22:41 +0100 Subject: [erlang-questions] sending data down the wire in mysql vs. mnesia In-Reply-To: References: <4751DC7A.6070204@lionet.info> <4751E1ED.5020804@lionet.info> <8209f740712020549n7be69c27wf87bf8cfb4fba977@mail.gmail.com> Message-ID: <8209f740712030922p515cb2ex9206aa58c45d9170@mail.gmail.com> If you look into the mnesia_frag module, you will see how mnesia does distributed selec (mnesia_frag:do_select()). In order to sustain this level of trickery, one must know exactly how mnesia transactions work, but my suggestion was basically that you make a copy of mnesia_frag and extend this code. BR, Ulf W 2007/12/3, Paul Mineiro : > The mnesia access API seems to low level to pull this off, since it > intercepts individual reads and writes. > > What I'd like is something like rpc:pmap/3 for mnesia (fragmented tables); > in this case I can't hand roll it because the transaction context does not > carry over through an rpc:call (and its not clear how the side effect of > doing an rpc call interacts with transaction retry mechanism anyway; > seems like mnesia should be aware of this explicitly for it to work out). > > What I can do right now is use the rpc module to call mnesia:activity for > me on the remote nodes, and the reduce the collection of results. This is > ok but 1) I have to figure out where the active replicas are for the > fragments I care about so location transparency is gone and 2) I can't > have a single transaction for all the activity. > > -- p > > On Sun, 2 Dec 2007, Ulf Wiger wrote: > > > 2007/12/1, Paul Mineiro : > > > With a fragmented MySQL table, I can execute a stored procedure > > > on each MySQL fragment, and the reduce the collection of results in the > > > client. The only thing that travels over the wire is the collection of > > > results, one for each fragment. > > > > > > I'm looking for something similar from Mnesia. Erlang has all the > > > building blocks to put it together (so I have), but I can see an > > > opportunity to come up with something standard within Mnesia which is > > > reasonably general and would return me to a more location-transparent > > > style of programming. > > > > You can modify mnesia_frag and tell mnesia to use your version instead > > of the default. How to do this is documented in mnesia. The downside is > > of course that you'd have to duplicate/maintain a whole bunch of other logic > > as well, just to make this small change, but in the process of doing this, > > you may arrive at some suggestion on how to make this parameterizable. > > > > BR, > > Ulf W > > > > Optimism is an essential ingredient of innovation. How else can the > individual favor change over security? > > -- Robert Noyce > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From kenneth.lundin@REDACTED Mon Dec 3 18:27:30 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Mon, 3 Dec 2007 18:27:30 +0100 Subject: [erlang-questions] Query: Status of Erlang on AIX. In-Reply-To: <944da41d0712030350o52f37722t9496a79e1179fa99@mail.gmail.com> References: <944da41d0712030350o52f37722t9496a79e1179fa99@mail.gmail.com> Message-ID: Hi, Unfortunately we can't say that AIX is supported. We run regular tests on a multitude of OS:es and CPU architectures but AIX is not one of them. The reasons are: 1) We don't have a machine running AIX. 2) We have not prioritized AIX since we have not picked up many signals from customers beeing interested in AIX. I am not negative towards AIX, but we have no experience regarding that OS. I suggest you build and run on AIX and try to solve the problems or report them on this list. I only foresee minor problems. /Kenneth Erlang/OTP team at Ericsson On 12/3/07, Alex Arnon wrote: > Hi All, > > We are interested in deploying software written in Erlang on AIX platforms > (some older than others, others new). I would like to ask, then: > - Is AIX supported? The relevant OS versions are both 4.x and 5.x (hopefully > AIX 6 will be deployed within the next 6 months). > - Are there caveats, such as "ODBC/Java/SSL is not supported"/"compile with > toolchain X"? > > Thanks in advance, > Alex. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From paul-trapexit@REDACTED Mon Dec 3 19:08:29 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Mon, 3 Dec 2007 10:08:29 -0800 (PST) Subject: [erlang-questions] sending data down the wire in mysql vs. mnesia In-Reply-To: <8209f740712030922p515cb2ex9206aa58c45d9170@mail.gmail.com> References: <4751DC7A.6070204@lionet.info> <4751E1ED.5020804@lionet.info> <8209f740712020549n7be69c27wf87bf8cfb4fba977@mail.gmail.com> <8209f740712030922p515cb2ex9206aa58c45d9170@mail.gmail.com> Message-ID: That do_select () code is very interesting. Attached is the kind of thing I'm trying to do right now. I don't see anything in the mnesia access API which corresponds: I need to reduce the number of results prior to sending across the wire. The mnesia access API seems to be geared towards emulating a table (which is quite reasonable!). I suppose I could overload the concept of mnesia:read () so that reading special keys has the effect of computing an aggregate via map-reduce. Is this what you had in mind? I think I should be able to gussy up the attached code using knowledge gleaned from understanding do_select () to at least get something like a single transactional context for this operation (I only really use it with ets context anyway, but it's fun to think about). Thanks! -- p On Mon, 3 Dec 2007, Ulf Wiger wrote: > If you look into the mnesia_frag module, you will see how > mnesia does distributed selec (mnesia_frag:do_select()). > > In order to sustain this level of trickery, one must know > exactly how mnesia transactions work, but my suggestion > was basically that you make a copy of mnesia_frag and > extend this code. > > BR, > Ulf W > > > 2007/12/3, Paul Mineiro : > > The mnesia access API seems to low level to pull this off, since it > > intercepts individual reads and writes. > > > > What I'd like is something like rpc:pmap/3 for mnesia (fragmented tables); > > in this case I can't hand roll it because the transaction context does not > > carry over through an rpc:call (and its not clear how the side effect of > > doing an rpc call interacts with transaction retry mechanism anyway; > > seems like mnesia should be aware of this explicitly for it to work out). > > > > What I can do right now is use the rpc module to call mnesia:activity for > > me on the remote nodes, and the reduce the collection of results. This is > > ok but 1) I have to figure out where the active replicas are for the > > fragments I care about so location transparency is gone and 2) I can't > > have a single transaction for all the activity. > > > > -- p > > > > On Sun, 2 Dec 2007, Ulf Wiger wrote: > > > > > 2007/12/1, Paul Mineiro : > > > > With a fragmented MySQL table, I can execute a stored procedure > > > > on each MySQL fragment, and the reduce the collection of results in the > > > > client. The only thing that travels over the wire is the collection of > > > > results, one for each fragment. > > > > > > > > I'm looking for something similar from Mnesia. Erlang has all the > > > > building blocks to put it together (so I have), but I can see an > > > > opportunity to come up with something standard within Mnesia which is > > > > reasonably general and would return me to a more location-transparent > > > > style of programming. > > > > > > You can modify mnesia_frag and tell mnesia to use your version instead > > > of the default. How to do this is documented in mnesia. The downside is > > > of course that you'd have to duplicate/maintain a whole bunch of other logic > > > as well, just to make this small change, but in the process of doing this, > > > you may arrive at some suggestion on how to make this parameterizable. > > > > > > BR, > > > Ulf W > > > > > > > Optimism is an essential ingredient of innovation. How else can the > > individual favor change over security? > > > > -- Robert Noyce > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > Optimism is an essential ingredient of innovation. How else can the individual favor change over security? -- Robert Noyce -------------- next part -------------- -module (mapreduce). %-include_lib ("flasscheck/include/quickcheck.hrl"). %-include_lib ("eunit/include/eunit.hrl"). -export ([ mapreduce/6 ]). %-=====================================================================- %- Public - %-=====================================================================- %% @spec mapreduce (context (), atom (), map (), reduce (), Acc, frag_spec ()) -> Acc %% context () = ets | async_dirty | sync_dirty | transaction | sync_transaction %% map () = fun (Table) -> X %% reduce () = fun (X, Acc) -> Acc %% frag_spec () = all | [ integer () ] %% @doc transaction and sync_transaction don't make much sense, since %% transactions would be acquired on fragment-by-fragment basis. mapreduce (Context, BaseTable, Map, Reduce, Acc0, FragSpec) when ((Context =:= ets) or (Context =:= async_dirty) or (Context =:= sync_dirty) or (Context =:= transaction) or (Context =:= sync_transaction)), is_atom (BaseTable), is_function (Map, 1), is_function (Reduce, 2), ((FragSpec =:= all) or is_list (FragSpec)) -> % c.f. gen_server:do_multi_call/4 Ref = make_ref (), Caller = self (), { Receiver, Mref } = erlang:spawn_monitor (fun () -> %% Middleman process. Should be unsensitive to regular %% exit signals. The synchronization is needed in case %% the receiver would exit before the caller started %% the monitor. process_flag (trap_exit, true), Mref = erlang:monitor (process, Caller), receive { Caller, Ref } -> Keys = [ rpc:async_call (Node, mnesia, activity, [ Context, Map, [ F ] ]) || { F, Node } <- select_fragments (BaseTable, FragSpec) ], Result = lists:foldl (Reduce, Acc0, [ rpc:yield (K) || K <- Keys ]), exit ({ self(), Ref, Result }); { 'DOWN', Mref, _, _, _ } -> %% Caller died before sending us the go-ahead. %% Give up silently. exit (normal) end end), Receiver ! { self (), Ref }, receive { 'DOWN', Mref, _, _, { Receiver, Ref, Result } } -> { ok, Result }; { 'DOWN', Mref, _, _, Reason } -> %% The middleman code failed. Or someone did %% exit(_, kill) on the middleman process => Reason==killed { error, Reason } end. %-=====================================================================- %- Private - %-=====================================================================- fragments (BaseTable, all) -> lists:seq (1, num_fragments (BaseTable)); fragments (_, FragSpec) -> FragSpec. frag_table_name (TableName, 1) -> TableName; frag_table_name (TableName, FragNum) when FragNum > 1 -> list_to_atom (atom_to_list (TableName) ++ "_frag" ++ integer_to_list (FragNum)). is_fragmented (Table) -> case mnesia:table_info (Table, frag_properties) of [] -> false; _ -> true end. num_fragments (TableName) -> FragProps = mnesia:table_info (TableName, frag_properties), { value, { n_fragments, NFrags } } = lists:keysearch (n_fragments, 1, FragProps), NFrags. select_fragments (BaseTable, FragSpec) -> Fragments = case is_fragmented (BaseTable) of false -> [ BaseTable ]; true -> [ frag_table_name (BaseTable, F) || F <- fragments (BaseTable, FragSpec) ] end, [ { F, select_node (F) } || F <- Fragments ]. select_node (Table) -> ActiveReplicas = mnesia:table_info (Table, active_replicas), case lists:member (node (), ActiveReplicas) of true -> node (); false -> lists:nth (random:uniform (length (ActiveReplicas)), ActiveReplicas) end. -ifdef (EUNIT). create_table (Name, NodePool, NumFragments) -> { atomic, ok } = mnesia:create_table (Name, [ { frag_properties, [ { n_fragments, NumFragments }, { node_pool, NodePool }, { n_ram_copies, 1 } ] } ]). destroy_table (Name) -> mnesia:delete_table (Name). start_mnesia (Nodes) -> stop_mnesia (Nodes), lists:foreach (fun (N) -> ok = rpc:call (N, mnesia, start, []) end, Nodes), lists:foreach (fun (N) -> { ok, _ } = rpc:call (N, mnesia, change_config, [ extra_db_nodes, Nodes ]) end, Nodes). stop_mnesia (Nodes) -> lists:foreach (fun (N) -> stopped = rpc:call (N, mnesia, stop, []) end, Nodes), os:cmd ("rm -rf Mnesia*"). %-=====================================================================- %- Tests - %-=====================================================================- local_test_ () -> F = fun () -> T = ?FORALL (X, fun (_) -> { random:uniform (7), [ { random:uniform (10000), random:uniform (10000) } || _ <- lists:seq (1, random:uniform (100)) ] } end, (fun ({ Frags, Data }) -> create_table (flass, [ node () ], Frags), ok = mnesia:activity (sync_dirty, fun () -> lists:foreach (fun ({ K, V }) -> mnesia:write ({ flass, K, V }) end, Data) end, [], mnesia_frag), { ok, Sum } = mapreduce (ets, flass, fun (Tab) -> mnesia:foldl (fun ({ _, _, Y }, Acc) -> Y + Acc end, 0, Tab) end, fun (Y, Acc) -> Y + Acc end, 0, all), OldSchoolSum = mnesia:activity (async_dirty, fun () -> mnesia:foldl (fun ({ _, _, Y }, Acc) -> Y + Acc end, 0, flass) end, [], mnesia_frag), ?assert (Sum =:= OldSchoolSum), destroy_table (flass), true end) (X)), ok = fc:flasscheck (1000, 10, T) end, { setup, fun () -> start_mnesia ([ node () ]) end, fun (_) -> stop_mnesia ([ node () ]) end, F }. -endif. From yinso.chen@REDACTED Mon Dec 3 23:21:49 2007 From: yinso.chen@REDACTED (YC) Date: Mon, 3 Dec 2007 14:21:49 -0800 Subject: [erlang-questions] PostgreSQL driver (YC) In-Reply-To: <4754320B.5020707@erix.ericsson.se> References: <4754320B.5020707@erix.ericsson.se> Message-ID: <779bf2730712031421q58b9954fucedb9345abc780a@mail.gmail.com> On Dec 3, 2007 8:42 AM, Ingela Anderton Andin wrote: > > > If the drivers on linux for psql are slow is not really an Erlang > > problem, but of course it > > can make that option a non interesting one. > Is that what the error port_exit means in http://www.erlang.org/pipermail/erlang-questions/2007-October/029787.htmland http://www.erlang.org/pipermail/erlang-questions/2007-November/030813.html? The port appears to close quickly so I can't tell whether it's a speed issue. > > True, it is also true that odbc is a quite small application and as > > Erlang/OTP is open source it should > > not be too hard for some one really interested in the odbc application > > to make a patch suggestion where > > all types are supported, if they do not want to wait for us to find the > > time make it complete. Of course > > we think it would be a good idea to make it complete but we can alas not > > clone our selfs and the stuff > > someone pays us to do will always get highest priority, that just how > > it works. I understand prioritization well (and thanks for putting out such an excellent product) and I am by no means suggesting anything other than the fact that OTP odbc is not complete as it stands today. If my erlang and driver skills are better I would have gone ahead and help with patching, but at this time I can only wait for either others with deeper skills to take interest in this effort, or when my own becomes better ;) BR, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Tue Dec 4 00:17:19 2007 From: erlang@REDACTED (Dominic Williams) Date: Mon, 3 Dec 2007 18:17:19 -0500 (EST) Subject: [erlang-questions] ErlLounge Paris, Dec 6th, 2008 Message-ID: <19056.82.67.147.243.1196723839.squirrel@www.geekisp.com> Hi, The Paris ErlLounge's location is www.carrsparis.com. And it's this thursday, not next year ;-) Anytime starting from 7.30pm. I look forward to meeting lots of other parisian erlangers! Maybe drop Francesco or myself an email if you plan to attend. Cheers, Dominic Williams http://www.dominicwilliams.net ---- From joelr1@REDACTED Tue Dec 4 00:40:12 2007 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 3 Dec 2007 23:40:12 +0000 Subject: [erlang-questions] Parsing Multiple Context-Free Grammars Message-ID: <06EBE1E1-253A-4BE4-8D09-1809BC03D975@gmail.com> Does anyone have code for parsing Multiple Context-Free Grammars? I found Prolog code that does exactly what I need [1] but thought I would ask before attempting a translation. Thanks, Joel [1] http://www.ling.gu.se/~peb/index.cgi/Software -- http://wagerlabs.com From vlm@REDACTED Tue Dec 4 01:03:31 2007 From: vlm@REDACTED (Lev Walkin) Date: Mon, 03 Dec 2007 16:03:31 -0800 Subject: [erlang-questions] Parsing Multiple Context-Free Grammars In-Reply-To: <06EBE1E1-253A-4BE4-8D09-1809BC03D975@gmail.com> References: <06EBE1E1-253A-4BE4-8D09-1809BC03D975@gmail.com> Message-ID: <47549953.7090807@lionet.info> yecc can generate context-free grammar parsers. Joel Reymont wrote: > Does anyone have code for parsing Multiple Context-Free Grammars? > > I found Prolog code that does exactly what I need [1] but thought I > would ask before attempting a translation. > > Thanks, Joel > > [1] http://www.ling.gu.se/~peb/index.cgi/Software > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From dloutrein.lists@REDACTED Tue Dec 4 01:17:33 2007 From: dloutrein.lists@REDACTED (denis) Date: Mon, 3 Dec 2007 19:17:33 -0500 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <361FB8EB-0C84-480D-93B3-914C8E15C771@local> <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> Message-ID: <349ebab60712031617q94c9539ve39f3f88b5152ded@mail.gmail.com> > - How do I write the equivalent of Mod:fun( ... )? I can't use (Mod:fun ... ) see below. you can't use (Mod:fun ...) but you can use (remote-call...) for instance, or (apply ...) or whatever name for this case. I find the name remote-call disturbing because I immediatly think of a remote call on another node. Maybe (module-call...) would be less confusing ? > - How do I parse mod:fun? This is a fundamental question as the relationship between code and data in lisp is 1-to-1. Parsed code *is* just its sexpr, there is no difference. This is one reason why it is so easy to manipulate code, for example by macros. Erlang code is has no such direct coupling to data. This fine if you going to compile the code, but it makes it more difficult to manipulate it. The problem is what do I parse mod:fun to? What I would do is keep it as a symbol, I mean 'mod:fun'. This is just a symbol like another, and when the evaluator (or the compiler) found it in the first parameter of the form (so it's should be a function call), it detect the ':' and knows that it have to do a remote call. Ok, it sounds a little bit crap :-) Another possibity is to let the reader expand (mod:fun...) into (remote-call mod fun) or (: mod fun) or manage it with a reader macro. But we loose the possibility of having an internal representation in the form (mod:fun..). At least to my understanding of the lisp reader. On another side, do you have an idea of how you'll represent a tuple, and do pattern matching for functions ? I'm interested by you project, please keep-up informed ;-) I had started something similar, but my background in the subject is quite light :-) Thanks Denis From joelr1@REDACTED Tue Dec 4 02:05:06 2007 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 4 Dec 2007 01:05:06 +0000 Subject: [erlang-questions] Translating from Prolog to Erlang Message-ID: <2FFF3929-BA41-462C-ACBA-FAE26544B0A0@gmail.com> Folks, Any takers to translate the following bit of Prolog into Erlang? I suspect that it's something simple but I don't know enough Prolog. Thanks in advance, Joel -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% simple English grammar %% s -> np(Num) vp(Num) english: rule(s, s, c(np_sg, vp_sg), [p1 = [arg(np_sg,1,p1), arg(vp_sg,2,p1)]]). english: rule(s, s, c(np_pl, vp_pl), [p1 = [arg(np_pl,1,p1), arg(vp_pl,2,p1)]]). %% np(Num) -> d(Num) n(Num) english: rule(np2, np_sg, c(d_sg, n_sg), [p1 = [arg(d_sg,1,p1), arg(n_sg,2,p1)]]). english: rule(np2, np_pl, c(d_pl, n_pl), [p1 = [arg(d_pl,1,p1), arg(n_pl,2,p1)]]). %% np(pl) -> n(pl) english: rule(np1, np_pl, c(n_pl), [p1 = [arg(n_pl,1,p1)]]). %% vp(Num) -> v(Num) np(_) english: rule(vp, vp_sg, c(v_sg, np_sg), [p1 = [arg(v_sg,1,p1), arg(np_sg,2,p1)]]). english: rule(vp, vp_sg, c(v_sg, np_pl), [p1 = [arg(v_sg,1,p1), arg(np_pl,2,p1)]]). english: rule(vp, vp_pl, c(v_pl, np_sg), [p1 = [arg(v_pl,1,p1), arg(np_sg,2,p1)]]). english: rule(vp, vp_pl, c(v_pl, np_pl), [p1 = [arg(v_pl,1,p1), arg(np_pl,2,p1)]]). %% d(sg) -> "a" english: rule(d_one, d_sg, c, [p1 = [tok(a)]]). %% d(pl) -> "many" english: rule(d_many, d_pl, c, [p1 = [tok(many)]]). %% n(sg) -> "lion" %% n(pl) -> "lions" english: rule(n_lion, n_sg, c, [p1 = [tok(lion)]]). english: rule(n_lion, n_pl, c, [p1 = [tok(lions)]]). %% n(_) -> "fish" english: rule(n_fish, n_sg, c, [p1 = [tok(fish)]]). english: rule(n_fish, n_pl, c, [p1 = [tok(fish)]]). %% v(sg) -> "eats" %% v(pl) -> "eat" english: rule(v_eat, v_sg, c, [p1 = [tok(eats)]]). english: rule(v_eat, v_pl, c, [p1 = [tok(eat)]]). %% v(sg) -> "hunts" %% v(pl) -> "hunt" english: rule(v_hunt, v_sg, c, [p1 = [tok(hunts)]]). english: rule(v_hunt, v_pl, c, [p1 = [tok(hunt)]]). -- http://wagerlabs.com From yinso.chen@REDACTED Tue Dec 4 03:51:43 2007 From: yinso.chen@REDACTED (YC) Date: Mon, 3 Dec 2007 18:51:43 -0800 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <361FB8EB-0C84-480D-93B3-914C8E15C771@local> <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> Message-ID: <779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> On Dec 2, 2007 4:21 AM, Robert Virding wrote: > > > I mean I have to sensibly be able to handle the case where someone > writes (cons a mod:fun). What does this mean? > > > - Seeing this is based on Erlang I can't introduce any new data types. > So with the argument above I can't have variables as a separate > data type, > separate from symbols/atoms. So Mod:fun will mean the same as mod:fun but > with a different name. Now that was clear :-) > > > So that is why I have no better suggestion for the moment to the general > function (remote-call ... ) and its short hand > form the macro > (: mod fun ... ) > IMHO, the issues above arise from the goal being unclear: is it a lispy syntax for erlang or is it a lisp in erlang? If it's a lispy syntax, IMO a prefix<->infix transformer can handle a lot of cases (below uses vector for tuples): %% Erlang => ErlangInLisp A + 1, => (+ A 1) A = 5. => (= A 5). [foo | bar] => (| foo bar) Pid ! Data => (! Pid Data) A = {foo, bar}. => (= A #(foo bar)) %% or (= A {foo bar}) (either works fine, but vector version appears more uniform and in spirit of lisp) fun(A) -> A + 1. => (lambda (A) (+ A 1)) %% I think fun is fine. case A of foo -> {foo}; bar -> {foo, bar} end. => (case A ((foo) bar) ((bar) #(foo bar))) foo(1) -> 2; foo(abc) -> {foo, bar}. => (defun foo ((1) 2) ((abc) #(foo bar))) mod:fun(foo) => (mod:fun foo) or ((: mod fun) foo) Mod:fun(foo) => (Mod:fun foo) or ((: Mod fun) foo) %% the second style is more uniform for both mod & Mod. {ok, B} = mod:fun(). => (= #(ok B) (mod:fun)) or (= {ok B} ((: mod fun))) (I think "let" is something that'll be handy and can be introduced, as commas make the code more spaghetti-ish) And keep the rest of the erlang syntax such as Camel casing for variable, pattern matching built-in default, bare words as atoms unless at the the head of a list (or unless in special syntax such as case), etc. If the goal is to write a lisp compiler, then either CL or Scheme has already offered their definitions (of course you can invent your own too). In CL mod:fun means calling the function fun in module mod, and in scheme it simply is a symbol binding that can mean anything. By default lisp doesn't have pattern matching, but if you are introducing macro then you can of course gain it back. The issue with (remote-call) is that it's tedious. Think of having to write that for all function calls that don't live in the current module namespace. And it also takes on meaning of apply/3. If mod:fun(Args) is writtten as (remote-call mod fun Args), then how to write apply/3? Should we write apply(mod, fun, Args) as (apply (remote-call mod fun Args))?? Then it's apply/1. Probably better to have remote-call take on the meaning of apply/3. I don't think all function calls should go through apply. Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.hillqvist@REDACTED Tue Dec 4 09:26:41 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Tue, 4 Dec 2007 09:26:41 +0100 Subject: [erlang-questions] Query: Status of Erlang on AIX. In-Reply-To: References: <944da41d0712030350o52f37722t9496a79e1179fa99@mail.gmail.com> Message-ID: <8268eea30712040026k2580cdf1s371c8dbaa83e9cb8@mail.gmail.com> Would it be a possibility to simulate hardware using some sort of full system simulation platform, like Virtutech Simics? Why not use "virtual hardware" for all platform tests. Wouldn't this make life simpler for you? Kind regards Andreas Hillqvist 2007/12/3, Kenneth Lundin : > Hi, > > Unfortunately we can't say that AIX is supported. > We run regular tests on a multitude of OS:es and CPU architectures but > AIX is not one of them. > The reasons are: > 1) We don't have a machine running AIX. > 2) We have not prioritized AIX since we have not picked up many > signals from customers beeing interested in AIX. > > I am not negative towards AIX, but we have no experience regarding that OS. > I suggest you build and run on AIX and try to solve the problems or report them > on this list. I only foresee minor problems. > > /Kenneth Erlang/OTP team at Ericsson > > > On 12/3/07, Alex Arnon wrote: > > Hi All, > > > > We are interested in deploying software written in Erlang on AIX platforms > > (some older than others, others new). I would like to ask, then: > > - Is AIX supported? The relevant OS versions are both 4.x and 5.x (hopefully > > AIX 6 will be deployed within the next 6 months). > > - Are there caveats, such as "ODBC/Java/SSL is not supported"/"compile with > > toolchain X"? > > > > Thanks in advance, > > Alex. > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From ttmrichter@REDACTED Tue Dec 4 09:42:23 2007 From: ttmrichter@REDACTED (Michael T. Richter) Date: Tue, 04 Dec 2007 16:42:23 +0800 Subject: [erlang-questions] Erlang on the N800? Message-ID: <1196757743.4838.1.camel@isolde> What are the odds of getting Erlang ported over to a Nokia N800? (For those who don't know what I'm talking about, the N800 is an "Internet Tablet" -- handheld computer running Linux on an ARM processor with some TI DSP enhancements.) Is it something worth trying or are there known problems that render it something I wouldn't bother with out of the box? From alex.arnon@REDACTED Tue Dec 4 08:55:55 2007 From: alex.arnon@REDACTED (Alex Arnon) Date: Tue, 4 Dec 2007 09:55:55 +0200 Subject: [erlang-questions] Query: Status of Erlang on AIX. In-Reply-To: References: <944da41d0712030350o52f37722t9496a79e1179fa99@mail.gmail.com> Message-ID: <944da41d0712032355h3db91584v8bd618088052828d@mail.gmail.com> Okay, I shall. Should SMP work, BTW? considering that AIX supports POSIX threads and synchronization mechanisms. On Dec 3, 2007 7:27 PM, Kenneth Lundin wrote: > Hi, > > Unfortunately we can't say that AIX is supported. > We run regular tests on a multitude of OS:es and CPU architectures but > AIX is not one of them. > The reasons are: > 1) We don't have a machine running AIX. > 2) We have not prioritized AIX since we have not picked up many > signals from customers beeing interested in AIX. > > I am not negative towards AIX, but we have no experience regarding that > OS. > I suggest you build and run on AIX and try to solve the problems or report > them > on this list. I only foresee minor problems. > > /Kenneth Erlang/OTP team at Ericsson > > > On 12/3/07, Alex Arnon wrote: > > Hi All, > > > > We are interested in deploying software written in Erlang on AIX > platforms > > (some older than others, others new). I would like to ask, then: > > - Is AIX supported? The relevant OS versions are both 4.x and 5.x(hopefully > > AIX 6 will be deployed within the next 6 months). > > - Are there caveats, such as "ODBC/Java/SSL is not supported"/"compile > with > > toolchain X"? > > > > Thanks in advance, > > Alex. > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemenkov@REDACTED Tue Dec 4 10:03:06 2007 From: lemenkov@REDACTED (Peter Lemenkov) Date: Tue, 4 Dec 2007 12:03:06 +0300 Subject: [erlang-questions] Erlang on the N800? In-Reply-To: <1196757743.4838.1.camel@isolde> References: <1196757743.4838.1.camel@isolde> Message-ID: 2007/12/4, Michael T. Richter : > What are the odds of getting Erlang ported over to a Nokia N800? (For > those who don't know what I'm talking about, the N800 is an "Internet > Tablet" -- handheld computer running Linux on an ARM processor with some > TI DSP enhancements.) Is it something worth trying or are there known > problems that render it something I wouldn't bother with out of the box? Just FYI - take a look at Igor's message and following discussion also: http://thread.gmane.org/gmane.network.jabber.ejabberd/3139 -- With best regards! From kenneth.lundin@REDACTED Tue Dec 4 10:16:00 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Tue, 4 Dec 2007 10:16:00 +0100 Subject: [erlang-questions] Query: Status of Erlang on AIX. In-Reply-To: <8268eea30712040026k2580cdf1s371c8dbaa83e9cb8@mail.gmail.com> References: <944da41d0712030350o52f37722t9496a79e1179fa99@mail.gmail.com> <8268eea30712040026k2580cdf1s371c8dbaa83e9cb8@mail.gmail.com> Message-ID: On 12/4/07, Andreas Hillqvist wrote: > Would it be a possibility to simulate hardware using some sort of full > system simulation platform, like Virtutech Simics? Possible yes, probably. Slower execution for sure a factor of at least 10 or more slower. We want our test to be completed during the night which they are now but not with a big marginal on certain platforms. A slower execution will make this impossible. > Why not use "virtual hardware" for all platform tests. Wouldn't this > make life simpler for you? It is the time it takes to maintain all platforms and the setup of tests and build on these that is cruical together with the follow up on test results. I don't think the use of virtual HW will make life simpler for us. Virtutech Simics is not for free AFAIK so we would not save much or anything compared with real HW. /Kenneth > > > Kind regards > Andreas Hillqvist > > 2007/12/3, Kenneth Lundin : > > Hi, > > > > Unfortunately we can't say that AIX is supported. > > We run regular tests on a multitude of OS:es and CPU architectures but > > AIX is not one of them. > > The reasons are: > > 1) We don't have a machine running AIX. > > 2) We have not prioritized AIX since we have not picked up many > > signals from customers beeing interested in AIX. > > > > I am not negative towards AIX, but we have no experience regarding that OS. > > I suggest you build and run on AIX and try to solve the problems or report them > > on this list. I only foresee minor problems. > > > > /Kenneth Erlang/OTP team at Ericsson > > > > > > On 12/3/07, Alex Arnon wrote: > > > Hi All, > > > > > > We are interested in deploying software written in Erlang on AIX platforms > > > (some older than others, others new). I would like to ask, then: > > > - Is AIX supported? The relevant OS versions are both 4.x and 5.x (hopefully > > > AIX 6 will be deployed within the next 6 months). > > > - Are there caveats, such as "ODBC/Java/SSL is not supported"/"compile with > > > toolchain X"? > > > > > > Thanks in advance, > > > Alex. > > > > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > From mikpe@REDACTED Tue Dec 4 10:35:01 2007 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 4 Dec 2007 10:35:01 +0100 (MET) Subject: [erlang-questions] Erlang on the N800? Message-ID: <200712040935.lB49Z1Gm020939@harpo.it.uu.se> On Tue, 04 Dec 2007 16:42:23 +0800, Michael T. Richter wrote: > What are the odds of getting Erlang ported over to a Nokia N800? (For > those who don't know what I'm talking about, the N800 is an "Internet > Tablet" -- handheld computer running Linux on an ARM processor with some > TI DSP enhancements.) Is it something worth trying or are there known > problems that render it something I wouldn't bother with out of the box? Erlang/OTP already works just fine on ARM/Linux boxes in general. There's even HiPE (native code) support for it, though currently only for big-endian (little-endian should appear in R12B-1 or -2). The main issue is whether the system utilities, libraries, and C toolchain for the specific box are up to the task. That's system dependent, we can't do anything about that. (Cross-compilation is a different story. Others have posted cross-compilation instructions to this mailing list before (do a search).) Also, depending on what you intend to do with Erlang you may need some swap space if the box has very little RAM. From matthias@REDACTED Tue Dec 4 10:02:36 2007 From: matthias@REDACTED (Matthias Lang) Date: Tue, 4 Dec 2007 10:02:36 +0100 Subject: [erlang-questions] Erlang on the N800? In-Reply-To: <1196757743.4838.1.camel@isolde> References: <1196757743.4838.1.camel@isolde> Message-ID: <18261.6060.144462.141684@antilipe.corelatus.se> Michael T. Richter writes: > What are the odds of getting Erlang ported over to a Nokia N800? (For > those who don't know what I'm talking about, the N800 is an "Internet > Tablet" -- handheld computer running Linux on an ARM processor with some > TI DSP enhancements.) Is it something worth trying or are there known > problems that render it something I wouldn't bother with out of the box? I just scanned the wikipedia N800 page and at first glance it looks like you can cross compile Erlang for the N800 fairly easily. (it runs a modern linux, no mention of a funny C library, heaps of RAM and flash). Assuming you already have a toolchain and know how to use it, take a look at http://www.trapexit.org/Cross_compiling Matthias From ignatios@REDACTED Tue Dec 4 10:55:47 2007 From: ignatios@REDACTED (Ignatios Souvatzis) Date: Tue, 4 Dec 2007 10:55:47 +0100 Subject: [erlang-questions] porting to NetBSD/amd64 Message-ID: <20071204095547.GC22514@cs.uni-bonn.de> Hello, I've been pointed to a problem compiling the pkgsrc Meta-Package for Erlang to NetBSD/amd64. (The package works fine here on NetBSD/arm32, NetBSD/i386 (== all 32bit Intel) and Solaris/sparc). Apparently, a part of the configure script compiles some OS+CPU-specific code, with a couple of variants available, to check for "reliable FPU exceptions". The default code makes the build process hang cheweing up all CPU cycles. (Hm, uncleared FPU exception, or non-incremented PC...) Are there instructions available somewhere to what this code is expected to do exactly, so that I can write some code that matches them? Regards, Ignatios Souvatzis From ulf.wiger@REDACTED Tue Dec 4 11:42:04 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 04 Dec 2007 11:42:04 +0100 Subject: [erlang-questions] FMC and Erlang Message-ID: <47552EFC.8090405@ericsson.com> FMC = Fundamental Modeling Concepts http://www.fmc-modeling.org/ Does anyone have experience with this, and specifically, has anyone applied it together with Erlang programming? From a cursory look, this looks to be a pretty good fit for Erlang. It also seems to be pretty coherent and sound. BR, Ulf W From joelr1@REDACTED Tue Dec 4 11:30:48 2007 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 4 Dec 2007 10:30:48 +0000 Subject: [erlang-questions] Translating from Prolog to Erlang In-Reply-To: References: Message-ID: On Dec 4, 2007, at 9:14 AM, Robert Raschke wrote: > Hmm, that doesn't look like straightforward Prolog. Is this maybe > meant to be the input to the Multiple Context-Free Grammar Parser you > mentioned earlier, i.e., the grammar description? It is indeed the grammar description. Can it still be translated into Erlang data structures? Thanks, Joel -- http://wagerlabs.com From vychodil.hynek@REDACTED Tue Dec 4 13:21:43 2007 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 4 Dec 2007 13:21:43 +0100 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: <779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <361FB8EB-0C84-480D-93B3-914C8E15C771@local> <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> <779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> Message-ID: <4d08db370712040421p3a0d45fn7251d81bd3695ec0@mail.gmail.com> On 12/4/07, YC wrote: > > On Dec 2, 2007 4:21 AM, Robert Virding wrote: > > > > > > > > > I mean I have to sensibly be able to handle the case where someone > writes (cons a mod:fun). What does this mean? > > > > > > > > - Seeing this is based on Erlang I can't introduce any new data types. > So with the argument above I can't have variables as a separate > data type, > separate from symbols/atoms. So Mod:fun will mean the same as mod:fun but > with a different name. Now that was clear :-) > > > > > > > > So that is why I have no better suggestion for the moment to the general > function (remote-call ... ) and its short hand > form the macro > (: mod fun ... ) > > > > IMHO, the issues above arise from the goal being unclear: is it a lispy > syntax for erlang or is it a lisp in erlang? > > If it's a lispy syntax, IMO a prefix<->infix transformer can handle a lot of > cases (below uses vector for tuples): > > %% Erlang => ErlangInLisp > A + 1, => (+ A 1) > A = 5. => (= A 5). > [foo | bar] => (| foo bar) > Pid ! Data => (! Pid Data) > A = {foo, bar}. => (= A #(foo bar)) %% or (= A {foo bar}) (either works > fine, but vector version appears more uniform and in spirit of lisp) > fun(A) -> A + 1. => (lambda (A) (+ A 1)) %% I think fun is fine. > case A of foo -> {foo}; bar -> {foo, bar} end. => (case A ((foo) bar) > ((bar) #(foo bar))) You mean case A of foo -> {foo}; bar -> {foo, bar} end. => (case A ((foo) #(foo)) ((bar) #(foo bar))) don't you? > foo(1) -> 2; foo(abc) -> {foo, bar}. => (defun foo ((1) 2) ((abc) #(foo > bar))) > mod:fun(foo) => (mod:fun foo) or ((: mod fun) foo) > Mod:fun(foo) => (Mod:fun foo) or ((: Mod fun) foo) %% the second style is > more uniform for both mod & Mod. > {ok, B} = mod:fun(). => (= #(ok B) (mod:fun)) or (= {ok B} ((: mod fun))) > > > (I think "let" is something that'll be handy and can be introduced, as > commas make the code more spaghetti-ish) > > And keep the rest of the erlang syntax such as Camel casing for variable, > pattern matching built-in default, bare words as atoms unless at the the > head of a list (or unless in special syntax such as case), etc. > > If the goal is to write a lisp compiler, then either CL or Scheme has > already offered their definitions (of course you can invent your own too). > In CL mod:fun means calling the function fun in module mod, and in scheme it > simply is a symbol binding that can mean anything. By default lisp doesn't > have pattern matching, but if you are introducing macro then you can of > course gain it back. > > The issue with (remote-call) is that it's tedious. Think of having to write > that for all function calls that don't live in the current module namespace. > And it also takes on meaning of apply/3. > > If mod:fun(Args) is writtten as (remote-call mod fun Args), then how to > write apply/3? > > Should we write apply(mod, fun, Args) as (apply (remote-call mod fun > Args))?? Then it's apply/1. > > Probably better to have remote-call take on the meaning of apply/3. I don't > think all function calls should go through apply. > > Cheers, > yc > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil From zerthurd@REDACTED Tue Dec 4 13:27:29 2007 From: zerthurd@REDACTED (Maxim Treskin) Date: Tue, 4 Dec 2007 18:27:29 +0600 Subject: [erlang-questions] Erlang on blackfin Message-ID: Hello Is it possible to compile Erlang OTP on blackfin processor under linux? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpe@REDACTED Tue Dec 4 13:40:52 2007 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 4 Dec 2007 13:40:52 +0100 (MET) Subject: [erlang-questions] porting to NetBSD/amd64 Message-ID: <200712041240.lB4Ceq9q023419@harpo.it.uu.se> On Tue, 4 Dec 2007 10:55:47 +0100, Ignatios Souvatzis wrote: > I've been pointed to a problem compiling the pkgsrc Meta-Package for > Erlang to NetBSD/amd64. (The package works fine here on NetBSD/arm32, > NetBSD/i386 (== all 32bit Intel) and Solaris/sparc). > > Apparently, a part of the configure script compiles some OS+CPU-specific > code, with a couple of variants available, to check for "reliable FPU > exceptions". The default code makes the build process hang cheweing up > all CPU cycles. (Hm, uncleared FPU exception, or non-incremented PC...) Yep, x86-64 requires some specific handling due to FP execption differences between x87 and SSE2. Failure to do this results in an infinite loop, as you've observed. > Are there instructions available somewhere to what this code is expected > to do exactly, so that I can write some code that matches them? Embedded in erts/configure.in is a file fpe-test.c. It enables FP exceptions, sets up a handler, and then forces an FP overflow. If successful this enables faster FP handling in the BEAM virtual machine. It's also a requirement for HiPE (native code) on all processors except ARM. The proper solution is to port fpe-test.c to NetBSD/amd64. It's already ported to FreeBSD/amd64 and OpenBSD/amd64, so this shouldn't be too difficult. Once fpe-test.c is ported similar changes must be done in erts/emulator/sys/unix/sys_float.c. I wrote most of the FP exception code, so I can do this port if someone gives me a temporary NetBSD/amd64 account. /Mikael From vlm@REDACTED Tue Dec 4 14:13:14 2007 From: vlm@REDACTED (Lev Walkin) Date: Tue, 04 Dec 2007 05:13:14 -0800 Subject: [erlang-questions] kqueue support In-Reply-To: <000201c82ab8$34b55ff0$e600000a@users.rbc.ru> References: <000201c82ab8$34b55ff0$e600000a@users.rbc.ru> Message-ID: <4755526A.5030508@lionet.info> We've been using this patch in a loaded production 6.1 system for a couple of weeks already. I think this validates its stability. George B Hazan wrote: > Hello. > > Is it possible to enable the kqueue support in erlang under FreeBSD > 6.2-STABLE #13? Note says that 5.2 & 5.3 have some problems with kqueue, but > maybe new versions are more stable? At least a lot of software uses it under > FreeBSD without problems... The problem is that ejabberd uses 60% of cpu > under 1000 http-bind connections, and kqueue is known to be a great CPU > saver. > > Right now I got the following error: > ============== 8< ============== >8 ============== > checking for working poll()... ok > checking whether kqueue() is known to be broken... yes; FreeBSD > implementation > checking whether kernel poll support should be enabled... configure: error: > no; kernel poll support requested but not found > configure: error: /bin/sh > '/usr/local/ports/work/usr/ports/lang/erlang/work/otp_src_R11B-5/erts/configure' > failed for erts > ============== 8< ============== >8 ============== > From rickard.s.green@REDACTED Tue Dec 4 14:27:15 2007 From: rickard.s.green@REDACTED (Rickard Green) Date: Tue, 04 Dec 2007 14:27:15 +0100 Subject: [erlang-questions] FW: SMP VM DUMPING CORE In-Reply-To: <9D5D0FF2FC2E5C47A1A54047C271BE49D72DB1@MTNMAIL1.mtn.co.za> References: <9D5D0FF2FC2E5C47A1A54047C271BE49D727C2@MTNMAIL1.mtn.co.za> <4753F664.6050809@ericsson.com> <9D5D0FF2FC2E5C47A1A54047C271BE49D72DB1@MTNMAIL1.mtn.co.za> Message-ID: <475555B3.5080905@ericsson.com> The 64-bit compiled smp emulator on sparc erroneously used the 32-bit implementation of atomic variables which caused it to crash. We didn't notice this since we currently aren't running any automated tests on 64-bit sparc. Unfortunately a fix for this issue will not make it into the R12B release. I will however post a source patch for R12B fixing this issue later. BR, Rickard Green, Erlang/OTP, Ericsson AB. Primanathan Reddy [ MTN - Innovation Centre ] wrote: > Hi Rickard > > You can find the files(zipped) here: > > Beam.smp: > Filename: beam.zip > Link: > http://www.datafilehost.com/download.php?file=24d4edba > > Core: > Filename: core_20071103.zip > Link: > http://www.datafilehost.com/download.php?file=3c416cb9 > > > Regards > Prima > > -----Original Message----- > From: Rickard Green [mailto:rickard.s.green@REDACTED] > Sent: Monday, 03 December 2007 02:28 PM > To: Primanathan Reddy [ MTN - Innovation Centre ] > Cc: erlang-questions@REDACTED; v@REDACTED > Subject: Re: [erlang-questions] FW: SMP VM DUMPING CORE > > Hi! > > Can you make the /lib/erlang/erts-5.5.5/bin/beam.smp file > and the core file available on a web-server or ftp-server? You can mail > me the url directly if you don't want to make it available to the world. > > BR, > Rickard Green, Erlang/OTP, Ericsson AB. > > Primanathan Reddy [ MTN - Innovation Centre ] wrote: >> Forgot to mention: >> >> Erlang Version: R11B5 >> OS: SOLARIS 10 >> >> -----Original Message----- >> From: Primanathan Reddy [ MTN - Innovation Centre ] >> Sent: Monday, 03 December 2007 12:03 PM >> To: erlang-questions@REDACTED >> Cc: 'v@REDACTED'; 'valentin@REDACTED' >> Subject: SMP VM DUMPING CORE >> >> Hi all, >> >> It seems that erts_port_task_abort (invoked by tcp_inet_drv) function > is >> causing infrequent segmentation fault on SOLARIS (Netra T2000). > Wouldn't >> like to jump to a conclusion, but it looks like an access >> synchronization/scheduling issue -- i.e. abort is trying to free some >> resources that have been already freed by another thread, or something >> similar (we're running SMP). >> >> Where (or to whom) should we mail the core file for further >> investigation? >> >> Regards >> >> Valentin Micic >> Pharos CONSVLTING (Pty) Ltd >> +2783 212 9180 >> >> NOTE: This e-mail message is subject to the MTN Group disclaimer see > http://www.mtn.co.za/default.aspx?pid=34411 >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 > From zubac@REDACTED Tue Dec 4 14:34:26 2007 From: zubac@REDACTED (Dragan Zubac) Date: Tue, 04 Dec 2007 14:34:26 +0100 Subject: [erlang-questions] Ets and Postgres Message-ID: <47555762.9090102@vlayko.tv> Hello Postgres table for example: article user price where_to_ship ----------------------------------------------------- ball petar 4 London shoe petar 5 New York ball jane 4 New York shoe jane 5 Paris . . . Table guarantee that article+user is unique. The idea is to split this table and insert data into ets for price and where_to_ship lookup. What about to split data in the following way: key = article_user,value = price_where_to_ship and insert that data combination into ets table ? So if user Petar wants to buy ball for example,we'll make lookup for key='ball_petar',will get back value='4_London',parse the value to get price='4' and where_to_ship='London' ? Or to make some additional ets tables and make some kind of relations between them to achieve uniqueness ? Anybody had some similar experiences ? Sincerely Dragan From andreas.hillqvist@REDACTED Tue Dec 4 14:58:53 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Tue, 4 Dec 2007 14:58:53 +0100 Subject: [erlang-questions] Query: Status of Erlang on AIX. In-Reply-To: References: <944da41d0712030350o52f37722t9496a79e1179fa99@mail.gmail.com> <8268eea30712040026k2580cdf1s371c8dbaa83e9cb8@mail.gmail.com> Message-ID: <8268eea30712040558g5701cc50x155b31bd51e5ff52@mail.gmail.com> Thank for your answer. Maybe the question should be more general: How would it be possible to extend the test to more platforms? I do not want to increase your workload. So maybe the Erlang community could contribute. Running adapting and running test cases on other platforms. The process might even be automated, monitoring a repository, when source or test cases are updated, the tests are run again and the result is reported back. Maybe not as often as nightly, but maybe once a week, month or release. Are the "regular tests" accessible somewhere? If not, shouldn't they at least be accessible for an open source project? Maybe some crazy ideas from someone who don't know what he is talking about. ;-) Kind regards Andreas Hillqvist 2007/12/4, Kenneth Lundin : > On 12/4/07, Andreas Hillqvist wrote: > > Would it be a possibility to simulate hardware using some sort of full > > system simulation platform, like Virtutech Simics? > Possible yes, probably. > Slower execution for sure a factor of at least 10 or more slower. > We want our test to be completed during the night which they are now > but not with a big marginal on certain platforms. > A slower execution will make this impossible. > > Why not use "virtual hardware" for all platform tests. Wouldn't this > > make life simpler for you? > It is the time it takes to maintain all platforms and the setup of > tests and build > on these that is cruical together with the follow up on test results. > I don't think the use of virtual HW will make life simpler for us. > Virtutech Simics is not for free AFAIK so we would not save much or > anything compared with real HW. > > /Kenneth > > > > > > > Kind regards > > Andreas Hillqvist > > > > 2007/12/3, Kenneth Lundin : > > > Hi, > > > > > > Unfortunately we can't say that AIX is supported. > > > We run regular tests on a multitude of OS:es and CPU architectures but > > > AIX is not one of them. > > > The reasons are: > > > 1) We don't have a machine running AIX. > > > 2) We have not prioritized AIX since we have not picked up many > > > signals from customers beeing interested in AIX. > > > > > > I am not negative towards AIX, but we have no experience regarding that OS. > > > I suggest you build and run on AIX and try to solve the problems or report them > > > on this list. I only foresee minor problems. > > > > > > /Kenneth Erlang/OTP team at Ericsson > > > > > > > > > On 12/3/07, Alex Arnon wrote: > > > > Hi All, > > > > > > > > We are interested in deploying software written in Erlang on AIX platforms > > > > (some older than others, others new). I would like to ask, then: > > > > - Is AIX supported? The relevant OS versions are both 4.x and 5.x (hopefully > > > > AIX 6 will be deployed within the next 6 months). > > > > - Are there caveats, such as "ODBC/Java/SSL is not supported"/"compile with > > > > toolchain X"? > > > > > > > > Thanks in advance, > > > > Alex. > > > > > > > > > > > > _______________________________________________ > > > > erlang-questions mailing list > > > > erlang-questions@REDACTED > > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > From bengt.kleberg@REDACTED Tue Dec 4 15:53:23 2007 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 04 Dec 2007 15:53:23 +0100 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <291234.64387.qm@web60519.mail.yahoo.com> References: <291234.64387.qm@web60519.mail.yahoo.com> Message-ID: <475569E3.1080000@ericsson.com> greetings, so, you think that the 3 quotes from "Timing Trials" does not recommend a certain method to show additional insights, instead they describe a certain method to show additional insights. that is ok with me. i can change from recomend to describe, without losing track of the target. moreover, i will assume that you mention "C runtimes appears absolutely horizontal" [for this test], as one example when "Timing Trials" write "anomalous behavior that deserves further attention." that is no problem with me. (if you mean that this is the one and only thing ever to deserve more investigation, i would like an explanation on how you have managed to arrive at that idea.) anyway then, we seem to agree on the following: "Timing Trials" observes that it is a good idea to have sufficiently many measuring points during benchmarking to be able to spot anomalous behaviour. i think the shootout does not do this and that it would be a good thing if it did. you do not want the shootout do this, for reasons never explained. bengt Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." On 11/30/07 21:17, Isaac Gouy wrote: > --- Bengt Kleberg wrote: > -snip- >> quotes from "Timing Trials, or, the Trials of Timing" as per request: >> "* Memory-related issues and the effects of memory hierarchies are >> pervasive: how memory is managed, from hardware caches to garbage >> collection, can change runtimes dramatically. Yet users have no >> direct >> control over most aspects of memory management. " >> >> "We started to construct a table with three dimensions: task, >> programming language, and machine. Eventually we added the size of >> the >> problem solved by the program as a fourth dimension, and we changed >> the >> presentation from tables to graphs. Varying the problem size helped >> us >> to detect unusual runtime effects, while a graphical presentation >> highlights patterns and trends in runtime instead of individual >> performance scores." >> >> "We designed tests whose runtime should grow linearly with the size >> of >> the problem: runtime = m??size + b. Thus, if we choose size to be >> large >> enough to justify ignoring the fixed overhead (b), the log-log plot >> should show a straight line of unit slope. Exceptions indicate >> anomalous >> behavior that deserves further attention." > > > (Incidentally what they meant by anomalous behaviour is something like > this: "the line connecting C runtimes appears absolutely horizontal. > ... This happens because the optimizer eliminates the entire loop, > replacing it by sum = n.") > > > Let me suggest to you that the paragraphs you quote are descriptions > not recommendations. > > Here's a recommendation: "... we advise all who want to know which > version of a program will run faster to construct test programs and > find out the truth for their language processor and machine." > > Here's another: "It does seem wise to take all such experiments > ?including these ?with a large grain of salt." > > >> Now it is your turn. could you quote the exact words where they say >> that 4 inputs and a spread of x10 is good enough? > > There is no such statement, nor have I claimed that there is: I have > described the spread shown in the tests - "we can see that they varied > the problem size by < ~10x" > > > > ____________________________________________________________________________________ > Be a better sports nut! Let your teams follow you > with Yahoo Mobile. Try it now. http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From dmercer@REDACTED Tue Dec 4 16:32:29 2007 From: dmercer@REDACTED (David Mercer) Date: Tue, 4 Dec 2007 09:32:29 -0600 Subject: [erlang-questions] sending data down the wire in mysql vs.mnesia In-Reply-To: <4751E6B2.2050804@lionet.info> References: <4751DC7A.6070204@lionet.info> <4751E1ED.5020804@lionet.info> <4751E6B2.2050804@lionet.info> Message-ID: <00d401c8368a$e1e72db0$891ea8c0@SSI.CORP> By the way, this was a helpful exchange. Thank-you for including the list on your replies. DBM -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Lev Walkin Sent: Saturday, December 01, 2007 16:57 To: Paul Mineiro Cc: erlang-questions; Andrew Arrow Subject: Re: [erlang-questions] sending data down the wire in mysql vs.mnesia Paul Mineiro wrote: > With a fragmented MySQL table, I can execute a stored procedure > on each MySQL fragment, and the reduce the collection of results in the > client. The only thing that travels over the wire is the collection of > results, one for each fragment. > > I'm looking for something similar from Mnesia. Erlang has all the > building blocks to put it together (so I have), but I can see an > opportunity to come up with something standard within Mnesia which is > reasonably general and would return me to a more location-transparent > style of programming. My point though is that Erlang _is_ the stored procedure around Mnesia. What one does is runs a function mapped across several Mnesia nodes, doing local computations, getting single results back. No difference. > -- p > > On Sat, 1 Dec 2007, Lev Walkin wrote: > >> Paul Mineiro wrote: >>> I don't find this answer satisfactory in the case of distributed >>> fragmented mnesia tables. >>> >>> I've actually had to rewrite computations in map-reduce form with servers >>> on each node doing operations on fragments that are local to the node (I >>> still use mnesia for storage for operational benefits) and then collecting >>> results (similar to gen_server:multi_call/4, but using pg2 and a custom >>> hash function known both to the client and mnesia). I was hoping to >>> implement such computations in straight mnesia (less chances for me to >>> screw something up) but noticed it was easy to start seeing 20 mbits of >>> sustained I/O between my boxes even at low query rates for my application. >>> >>> It'd be nice to somehow within mnesia extend the concept of fragmented >>> tables to reduce network I/O for incrementally computable >>> aggregate functions. >> >> How would you do that with fragmented MySQL tables? Stored procedures >> won't work in this case either. Apples and Oranges? >> >> >> >> >>> -- p >>> >>> On Sat, 1 Dec 2007, Lev Walkin wrote: >>> >>>> Andrew Arrow wrote: >>>>> I have a PHP + mysql app now that uses a mysql stored procedure to >>>>> avoid sending lots of data "down the wire." That is, the stored >>>>> procedure iterates over thousands of rows, determines the value the >>>>> app needs and sends back just the value. This avoids the thousands of >>>>> rows coming down the wire to have PHP compute the value. >>>>> >>>>> In moving this system to erlang + mnesia do I have to worry about the >>>>> same issue? It seems I will have to store the thousands of items in a >>>>> set in a mnesia table, retrieve all the rows, and have erlang compute >>>>> the value. There's no way to do the iteration inside mnesia like >>>>> there is in mysql is there? >>>> You do this "stored procedure" thing in MySQL primarily to avoid >>>> inter-process communication and serialization/deserialization. >>>> >>>> In Erlang+Mnesia case, the Mnesia table runs inside Erlang VM, >>>> therefore avoiding inter-process communication issues. Also, >>>> there is some advantage in not having to perform serialization >>>> and deserialization, although with *ts tables (which Mnesia >>>> is based upon) there is some copying going on anyway. >>>> >>>> So, the short answer is no, you don't do it in Mnesia. Primarily >>>> because your surrounding Erlang code precisely acts like a "stored >>>> procedure" around Mnesia tables, running in the same VM. >>>> >>>> >>>> -- >>>> Lev Walkin >>>> vlm@REDACTED >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>> >>> Optimism is an essential ingredient of innovation. How else can the >>> individual favor change over security? >>> >>> -- Robert Noyce >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > > Optimism is an essential ingredient of innovation. How else can the > individual favor change over security? > > -- Robert Noyce _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From olopierpa@REDACTED Tue Dec 4 16:36:32 2007 From: olopierpa@REDACTED (Pierpaolo Bernardi) Date: Tue, 4 Dec 2007 16:36:32 +0100 Subject: [erlang-questions] Ets and Postgres In-Reply-To: <47555762.9090102@vlayko.tv> References: <47555762.9090102@vlayko.tv> Message-ID: <7352e43a0712040736v45b2519ekf621c4382c182e3d@mail.gmail.com> On Dec 4, 2007 2:34 PM, Dragan Zubac wrote: > What > about to split data in the following way: > > key = article_user,value = price_where_to_ship > > and insert that data combination into ets table ? So if user Petar wants > to buy ball for example,we'll make lookup for key='ball_petar',will get > back value='4_London',parse the value to get price='4' and > where_to_ship='London' ? Keys are not restricted to atoms. You can use a tuple as key. P. From dmercer@REDACTED Tue Dec 4 16:43:36 2007 From: dmercer@REDACTED (David Mercer) Date: Tue, 4 Dec 2007 09:43:36 -0600 Subject: [erlang-questions] "Mnesia" Pronunciation Message-ID: <00d601c8368c$6f8ad530$891ea8c0@SSI.CORP> How is "Mnesia" pronounced? I was pronouncing it em-NEE-zha (similar to "amnesia") but I saw in the Mnesia manual the use of the indefinite article "a" with it (as in "a Mnesia table"), making me think the initial sound must be a consonant. Thought maybe the correct pronunciation then is either me-NEE-zha or NEE-zha ("m" is silent as in "mnemonic"). Please advise. Thank-you. DBM -------------- next part -------------- An HTML attachment was scrubbed... URL: From bekesa@REDACTED Tue Dec 4 16:53:32 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Tue, 04 Dec 2007 16:53:32 +0100 Subject: [erlang-questions] emacs+job control In-Reply-To: <944da41d0711300003g742ea70g461eac5de5a66ff7@mail.gmail.com> References: <200711291231.17267.bekesa@sch.bme.hu> <944da41d0711300003g742ea70g461eac5de5a66ff7@mail.gmail.com> Message-ID: <200712041653.32248.bekesa@sch.bme.hu> > > I find the job control menu of the Erlang shell (where you get > > after pressing Ctrl+g) very useful, but Ctrl+g does not work for an > > Erlang shell inside Emacs. > I thing CTRL-Q should quote the following character, so maybe CTRL-Q > CTRL-G? Just for the archive: It works! :-) You have to press an ENTER after C-q C-g, but works. Thanks, Georgy From bekesa@REDACTED Tue Dec 4 17:10:31 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Tue, 04 Dec 2007 17:10:31 +0100 Subject: [erlang-questions] Ets and Postgres In-Reply-To: <7352e43a0712040736v45b2519ekf621c4382c182e3d@mail.gmail.com> References: <47555762.9090102@vlayko.tv> <7352e43a0712040736v45b2519ekf621c4382c182e3d@mail.gmail.com> Message-ID: <200712041710.31612.bekesa@sch.bme.hu> > > and insert that data combination into ets table ? So if user Petar > > wants to buy ball for example,we'll make lookup for > > key='ball_petar',will get back value='4_London',parse the value to > > get price='4' and where_to_ship='London' ? > Keys are not restricted to atoms. You can use a tuple as key. And you generally don't want to create atoms on the fly. It is a very very bad idea (atoms are not GCd). Georgy From vychodil.hynek@REDACTED Tue Dec 4 17:17:45 2007 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 4 Dec 2007 17:17:45 +0100 Subject: [erlang-questions] "Mnesia" Pronunciation In-Reply-To: <00d601c8368c$6f8ad530$891ea8c0@SSI.CORP> References: <00d601c8368c$6f8ad530$891ea8c0@SSI.CORP> Message-ID: <4d08db370712040817k1a86e511s32df75e08b33881a@mail.gmail.com> I tough that mnesia is opposite to amnesia, e.g. it is opposite to lost memory, then keep memory. Then I think mensia is pronounced /m?ni??/. So I am not native english speeker, than I can be supprised. On 12/4/07, David Mercer wrote: > > > > > How is "Mnesia" pronounced? > > > > I was pronouncing it em-NEE-zha (similar to "amnesia") but I saw in the > Mnesia manual the use of the indefinite article "a" with it (as in "a Mnesia > table"), making me think the initial sound must be a consonant. Thought > maybe the correct pronunciation then is either me-NEE-zha or NEE-zha ("m" is > silent as in "mnemonic"). Please advise. Thank-you. > > > > DBM > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil From richardc@REDACTED Tue Dec 4 17:24:44 2007 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 04 Dec 2007 17:24:44 +0100 Subject: [erlang-questions] "Mnesia" Pronunciation In-Reply-To: <00d601c8368c$6f8ad530$891ea8c0@SSI.CORP> References: <00d601c8368c$6f8ad530$891ea8c0@SSI.CORP> Message-ID: <47557F4C.4010802@it.uu.se> David Mercer wrote: > How is ?Mnesia? pronounced? Since it was named by a bunch of Swedes who tend to pronounce it /m-NEA-sia/, any damn way you like is probably ok. :-) But i guess that a better answer to your question is that it should not be pronounced with a silent "m", in any case. So both "a Mnesia table" or "an Mnesia table" are probably ok to write. /Richard From igouy2@REDACTED Tue Dec 4 17:57:18 2007 From: igouy2@REDACTED (Isaac Gouy) Date: Tue, 4 Dec 2007 08:57:18 -0800 (PST) Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <475569E3.1080000@ericsson.com> Message-ID: <601563.67157.qm@web60518.mail.yahoo.com> --- Bengt Kleberg wrote: > greetings, > > so, you think that the 3 quotes from "Timing Trials" does not > recommend > a certain method to show additional insights, instead they describe a > > certain method to show additional insights. that is ok with me. i can > > change from recomend to describe, without losing track of the target. > > moreover, i will assume that you mention "C runtimes appears > absolutely > horizontal" [for this test], as one example when "Timing Trials" > write > "anomalous behavior that deserves further attention." that is no > problem > with me. (if you mean that this is the one and only thing ever to > deserve more investigation, i would like an explanation on how you > have > managed to arrive at that idea.) > > > anyway then, we seem to agree on the following: "Timing Trials" > observes > that it is a good idea to have sufficiently many measuring points > during > benchmarking to be able to spot anomalous behaviour. i think the > shootout does not do this and that it would be a good thing if it > did. > you do not want the shootout do this, for reasons never explained. Do you agree that the benchmarks game has a range of input values ~10x to ~100x, in comparison to mostly < 10x in "Timing Trials"? Do you agree that the benchmarks game range of input values /has/ been used to spot anomalous behaviour - binary-trees memory usage not increasing for some programs? ____________________________________________________________________________________ Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ From bekesa@REDACTED Tue Dec 4 18:24:40 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Tue, 04 Dec 2007 18:24:40 +0100 Subject: [erlang-questions] pattern match test operator In-Reply-To: <95be1d3b0711191302g61250fdbk2bedacbf9107e2b4@mail.gmail.com> References: <200711162107.06534.bekesa@sch.bme.hu> <200711191445.47538.bekesa@sch.bme.hu> <95be1d3b0711191302g61250fdbk2bedacbf9107e2b4@mail.gmail.com> Message-ID: <200712041824.41256.bekesa@sch.bme.hu> Hi, Almost every or every second day I bump into a situation when my proposed pattern-match-test-operator would be useful. > What I feel is that such a notation isn't bringing enough to the > language so that it's worth it. OK, I'm trying to generalise the idea, to bring more. Most of the time I'd use a pattern-match-test-operator, I'm about to do a disjunctive pattern matching. Something that could be solved by "fall-through ? la C switch/case" like in the example written by somebody a few days ago: days_in(jan, _); days_in(mar, _); days_in(may, _); days_in(jul, _); days_in(aug, _); days_in(oct, _) -> 31; days_in(dec, _); days_in(apr, _); days_in(jun, _); days_in(sep, _); days_in(nov, _) -> 30; days_in(feb, common) -> 28; days_in(feb, leap) -> 29. We probably don't like the idea of fall-through, that's for imperative languages :-) Let's follow a more scientific approach: Pattern matching basically tests whether a term is a member of a subset of terms. So a pattern describes a subset of terms. Basically guards do the same, they describe a subset of terms. With the use of guards, we can narrow the subsets that we describe by a pattern, we intersect the subsets. Now with guards you can do something that you cannot do with patterns: you can do all the set-operations (union, intersection, subtraction) with the use of ',', ';' and all the boolean operators). Now let's try to extend patterns with the set operations. - Intersecting the sets of patterns is trivial, for example, the intersecion of the patterns {a,_,_} and {_,b,_} gives the pattern {a,_,_}={_,b,_} - Union: I think there is no '|' operator in Erlang, so: {a,_,_} UNION {_,b,_} could be written: {a,_,_}|{_,b,_} Now this was easy, let's do something tricky: {a,X,_} when is_integer(X) | {X,b,_} when X>3 This would match if either of the patterns match. The binding rule for variables is well-defined, we already can have variables bound to different values in different branches of an 'if', 'case', or 'receive' expression. - Subtraction: it could be done by the pattern match test operator! For example: ({a,X,Y} when is_integer(X) | {X,b,Y} when X>3) when not(Y~={_,undefined}) Probably there is a better sintax for all of this. About the semantics: all this is possible with some parse transformations. For example a pattern match with the above pattern: ({a,X,Y} when is_integer(X) | {X,b,Y} when X>3) when not(Y~={_,undefined}) = VALUE is (logically) equivalent to begin case VALUE of {a,X,Y} when is_integer(X) -> ok; {X,b,Y} when X>3 -> ok; _ -> erlang:error({badmatch,VALUE}) end, case Y of {_,undefined}-> erlang:error({badmatch,VALUE}); _-> VALUE end end Now writing this parse transform is not impossible, but it could not use an elegant syntax and would be slower than a compiled implementation. But the real disadvantage: You cannot use it in 'real' patterns (function heads, case and receive expressions...) only in pattern-match expressions. Is this bringing enough to the language so that it's worth (considering) it? Georgy From bekesa@REDACTED Tue Dec 4 18:31:28 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Tue, 04 Dec 2007 18:31:28 +0100 Subject: [erlang-questions] "Mnesia" Pronunciation In-Reply-To: <47557F4C.4010802@it.uu.se> References: <00d601c8368c$6f8ad530$891ea8c0@SSI.CORP> <47557F4C.4010802@it.uu.se> Message-ID: <200712041831.28291.bekesa@sch.bme.hu> > Since it was named by a bunch of Swedes who tend to pronounce > it /m-NEA-sia/, any damn way you like is probably ok. :-) According to wikipedia, amnesia in greek is ???????, so mnesia must be ??????. I think we should ask the question: How did the ancient greek pronounce ??????? :-) Georgy From william.c.robertson@REDACTED Tue Dec 4 15:10:45 2007 From: william.c.robertson@REDACTED (william.c.robertson@REDACTED) Date: Tue, 4 Dec 2007 09:10:45 -0500 Subject: [erlang-questions] help In-Reply-To: Message-ID: Bill Robertson Enhanced ATM 614 213-8532 ----------------------------------------- This transmission may contain information that is privileged, confidential, legally privileged, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. Although this transmission and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by JPMorgan Chase & Co., its subsidiaries and affiliates, as applicable, for any loss or damage arising in any way from its use. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mogorman@REDACTED Tue Dec 4 19:02:47 2007 From: mogorman@REDACTED (mog) Date: Tue, 04 Dec 2007 12:02:47 -0600 Subject: [erlang-questions] Erlang on blackfin In-Reply-To: References: Message-ID: <1196791367.18562.9.camel@metalman.lan> > Is it possible to compile Erlang OTP on blackfin processor under > linux? there is a good port of gcc and the standard linux tools so i think it would not be that hard to port if it doesnt work out of the box, Im not really familiar with the erlang build process so I cant confirm it would work just out of the box, but if it has no proccessor specific gcc magic it should Mog -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From bob@REDACTED Tue Dec 4 19:42:37 2007 From: bob@REDACTED (Bob Ippolito) Date: Tue, 4 Dec 2007 10:42:37 -0800 Subject: [erlang-questions] pattern match test operator In-Reply-To: <200712041824.41256.bekesa@sch.bme.hu> References: <200711162107.06534.bekesa@sch.bme.hu> <200711191445.47538.bekesa@sch.bme.hu> <95be1d3b0711191302g61250fdbk2bedacbf9107e2b4@mail.gmail.com> <200712041824.41256.bekesa@sch.bme.hu> Message-ID: <6a36e7290712041042n4be44e9ejfd2613f7936c8707@mail.gmail.com> On 12/4/07, Andras Georgy Bekes wrote: > Hi, > > Almost every or every second day I bump into a situation when my > proposed pattern-match-test-operator would be useful. > > > What I feel is that such a notation isn't bringing enough to the > > language so that it's worth it. > OK, I'm trying to generalise the idea, to bring more. > > Most of the time I'd use a pattern-match-test-operator, I'm about to do > a disjunctive pattern matching. Something that could be solved > by "fall-through ? la C switch/case" like in the example written by > somebody a few days ago: > > days_in(jan, _); > days_in(mar, _); > days_in(may, _); > days_in(jul, _); > days_in(aug, _); > days_in(oct, _) -> 31; > days_in(dec, _); > days_in(apr, _); > days_in(jun, _); > days_in(sep, _); > days_in(nov, _) -> 30; > days_in(feb, common) -> 28; > days_in(feb, leap) -> 29. > > We probably don't like the idea of fall-through, that's for imperative > languages :-) > > Let's follow a more scientific approach: Pattern matching basically > tests whether a term is a member of a subset of terms. So a pattern > describes a subset of terms. Basically guards do the same, they > describe a subset of terms. With the use of guards, we can narrow the > subsets that we describe by a pattern, we intersect the subsets. Now > with guards you can do something that you cannot do with patterns: you > can do all the set-operations (union, intersection, subtraction) with > the use of ',', ';' and all the boolean operators). > > Now let's try to extend patterns with the set operations. > > - Intersecting the sets of patterns is trivial, for example, the > intersecion of the patterns {a,_,_} and {_,b,_} gives the pattern > {a,_,_}={_,b,_} > > - Union: I think there is no '|' operator in Erlang, so: > {a,_,_} UNION {_,b,_} could be written: {a,_,_}|{_,b,_} > Now this was easy, let's do something tricky: > > {a,X,_} when is_integer(X) | {X,b,_} when X>3 > > This would match if either of the patterns match. The binding rule for > variables is well-defined, we already can have variables bound to > different values in different branches of an 'if', 'case', or 'receive' > expression. > > - Subtraction: it could be done by the pattern match test operator! > For example: > ({a,X,Y} when is_integer(X) | {X,b,Y} when X>3) when > not(Y~={_,undefined}) > > Probably there is a better sintax for all of this. > > About the semantics: all this is possible with some parse > transformations. For example a pattern match with the above pattern: > ({a,X,Y} when is_integer(X) | > {X,b,Y} when X>3) when not(Y~={_,undefined}) = VALUE > > is (logically) equivalent to > > begin > case VALUE of > {a,X,Y} when is_integer(X) -> > ok; > {X,b,Y} when X>3 -> > ok; > _ -> > erlang:error({badmatch,VALUE}) > end, > case Y of > {_,undefined}-> > erlang:error({badmatch,VALUE}); > _-> > VALUE > end > end > > Now writing this parse transform is not impossible, but it could not use > an elegant syntax and would be slower than a compiled implementation. > But the real disadvantage: You cannot use it in 'real' patterns > (function heads, case and receive expressions...) only in pattern-match > expressions. > > Is this bringing enough to the language so that it's worth (considering) > it? Parse transforms happen at compilation time. What is your reasoning behind "slower than a compiled implementation"? Compiling a module that uses a parse transform might be insignificantly slower, but you don't do that very often. -bob From yinso.chen@REDACTED Tue Dec 4 20:13:06 2007 From: yinso.chen@REDACTED (YC) Date: Tue, 4 Dec 2007 11:13:06 -0800 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: <4d08db370712040421p3a0d45fn7251d81bd3695ec0@mail.gmail.com> References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <361FB8EB-0C84-480D-93B3-914C8E15C771@local> <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> <779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> <4d08db370712040421p3a0d45fn7251d81bd3695ec0@mail.gmail.com> Message-ID: <779bf2730712041113g4df01a9al85e45d05318388d@mail.gmail.com> On Dec 4, 2007 4:21 AM, Hynek Vychodil wrote: > > > case A of foo -> {foo}; bar -> {foo, bar} end. => (case A ((foo) bar) > > > ((bar) #(foo bar))) > > You mean > > case A of foo -> {foo}; bar -> {foo, bar} end. => (case A ((foo) #(foo)) > > ((bar) #(foo bar))) > > don't you? Yes, correct - thanks for catching it ;) Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: From bekesa@REDACTED Tue Dec 4 21:24:08 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Tue, 04 Dec 2007 21:24:08 +0100 Subject: [erlang-questions] pattern match test operator In-Reply-To: <6a36e7290712041042n4be44e9ejfd2613f7936c8707@mail.gmail.com> References: <200711162107.06534.bekesa@sch.bme.hu> <200712041824.41256.bekesa@sch.bme.hu> <6a36e7290712041042n4be44e9ejfd2613f7936c8707@mail.gmail.com> Message-ID: <200712042124.08821.bekesa@sch.bme.hu> > Parse transforms happen at compilation time. What is your reasoning > behind "slower than a compiled implementation"? I just think the compiler might generate more efficient code if it _knows_ that it is doing only a pattern match and nothing else. The code I've written also contains calls to erlang:error/1. OK it is a BIF, but still, I think a match failure is just faster than calling erlang:error (and building up its argument). But, the point is not this. The point is that a parse-transform implementation of the stuff is almost useless, because it cannot be used in function heads and case and receive expressions. Georgy From kosik@REDACTED Tue Dec 4 21:36:11 2007 From: kosik@REDACTED (Matej Kosik) Date: Tue, 04 Dec 2007 21:36:11 +0100 Subject: [erlang-questions] clarify: how to express this elegantly Message-ID: <4755BA3B.4070004@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Friends, I wander, how can I express this: case Value of "state" -> ?D, circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ); "rx_bit_rate" -> ?D, circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ); "tx_bit_rate" -> ?D, circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ); "ebno" -> ?D, circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ); "packetloss" -> ?D, node_pinger:plot_node_value(NodePingerPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ); "rtt" -> ?D, node_pinger:plot_node_value(NodePingerPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ) end more elegantly. Via some kind of "variant patterns" such as: case Value of "state" | "rx_bit_rate" | "tx_bit_rate" | "ebno" -> ?D, circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ); "packet_loss" | "round_trip_time" -> ?D, node_pinger:plot_node_value(NodePingerPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ) end but these do not exist :( These "variant patterns" could be introduced without any problems in special cases when neither variant contains unbound variable. - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHVbo7L+CaXfJI/hgRArySAJ47+Iin/aGeIBP04uNcJ/I5VlS2PwCePi27 QEDkkwClpMEL9WuA/3LICAo= =Y9ul -----END PGP SIGNATURE----- From bekesa@REDACTED Tue Dec 4 22:07:34 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Tue, 04 Dec 2007 22:07:34 +0100 Subject: [erlang-questions] clarify: how to express this elegantly In-Reply-To: <4755BA3B.4070004@fiit.stuba.sk> References: <4755BA3B.4070004@fiit.stuba.sk> Message-ID: <200712042207.35072.bekesa@sch.bme.hu> > more elegantly. Via some kind of "variant patterns" such as: > > case Value of > "state" | "rx_bit_rate" | "tx_bit_rate" | "ebno" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, > Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, > Height, Value ); > "packet_loss" | "round_trip_time" -> > ?D, > node_pinger:plot_node_value(NodePingerPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, > Width, Height, Value ) > end This can be written as (legal Erlang code): if Value== "state" ; Value=="rx_bit_rate" ; Value=="tx_bit_rate" ; Value=="ebno" -> this; Value=="packet_loss" ; Value=="round_trip_time" -> that; end > These "variant patterns" could be introduced without any problems in > special cases when neither variant contains unbound variable. The interesting case is when the patterns do contain unbound variables. Georgy From launoja@REDACTED Tue Dec 4 22:16:10 2007 From: launoja@REDACTED (Jani Launonen) Date: Tue, 4 Dec 2007 23:16:10 +0200 Subject: [erlang-questions] clarify: how to express this elegantly In-Reply-To: <4755BA3B.4070004@fiit.stuba.sk> References: <4755BA3B.4070004@fiit.stuba.sk> Message-ID: I don't know if it is a real improvement, but how about using if? if Value = "state" ; Value = "rx_bit_rate" ; Value = "tx_bit_rate" ; Value = "ebno" -> ?D, circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value); Value = "packetloss" ; Value = "rtt" -> ?D, node_pinger:plot_node_value(NodePingerPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value) end Jani. Matej Kosik kirjoitti 4.12.2007 kello 22.36: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Friends, > > I wander, how can I express this: > > case Value of > "state" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, > Width, Height, Value > ); > "rx_bit_rate" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, > Width, Height, Value > ); > "tx_bit_rate" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, > Width, Height, Value > ); > "ebno" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, > Width, Height, Value > ); > "packetloss" -> > ?D, > node_pinger:plot_node_value(NodePingerPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, > Width, Height, Value > ); > "rtt" -> > ?D, > node_pinger:plot_node_value(NodePingerPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, > Width, Height, Value > ) > end > > more elegantly. Via some kind of "variant patterns" such as: > > case Value of > "state" | "rx_bit_rate" | "tx_bit_rate" | "ebno" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, > Width, Height, Value > ); > "packet_loss" | "round_trip_time" -> > ?D, > node_pinger:plot_node_value(NodePingerPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, > Width, Height, Value > ) > end > > but these do not exist :( > These "variant patterns" could be introduced without any problems > in special cases when neither > variant contains unbound variable. > - -- > Matej Kosik > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHVbo7L+CaXfJI/hgRArySAJ47+Iin/aGeIBP04uNcJ/I5VlS2PwCePi27 > QEDkkwClpMEL9WuA/3LICAo= > =Y9ul > -----END PGP SIGNATURE----- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From richardc@REDACTED Tue Dec 4 22:17:57 2007 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 04 Dec 2007 22:17:57 +0100 Subject: [erlang-questions] clarify: how to express this elegantly In-Reply-To: <4755BA3B.4070004@fiit.stuba.sk> References: <4755BA3B.4070004@fiit.stuba.sk> Message-ID: <4755C405.1070304@it.uu.se> There are (at least) two variants. Version 1: case is_plottable(Value) of true -> ?D, circuit_monitor:plot_node_value(..., Value); false -> throw(unplottable_value) end ... is_plottable("state") -> true; is_plottable("rx_bit_rate") -> true; ... is_plottable("rtt") -> true; is_plottable(_) -> false. Version 2: Plot = fun () -> ?D, circuit_monitor:plot_node_value(..., Value) end, case Value of "state" -> Plot(); "rx_bit_rate" -> Plot(); ... "rtt" -> Plot() end Also, it's probably better if you can transform the strings to atoms when you read them, because a switch over atoms is much more efficient than a switch over strings. /Richard Matej Kosik wrote: > Friends, > > I wander, how can I express this: > > case Value of > "state" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value > ); > "rx_bit_rate" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value > ); > "tx_bit_rate" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value > ); > "ebno" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value > ); > "packetloss" -> > ?D, > node_pinger:plot_node_value(NodePingerPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value > ); > "rtt" -> > ?D, > node_pinger:plot_node_value(NodePingerPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value > ) > end > > more elegantly. Via some kind of "variant patterns" such as: > > case Value of > "state" | "rx_bit_rate" | "tx_bit_rate" | "ebno" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value > ); > "packet_loss" | "round_trip_time" -> > ?D, > node_pinger:plot_node_value(NodePingerPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value > ) > end > > but these do not exist :( > These "variant patterns" could be introduced without any problems in special cases when neither > variant contains unbound variable. _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From dmercer@REDACTED Tue Dec 4 22:23:40 2007 From: dmercer@REDACTED (David Mercer) Date: Tue, 4 Dec 2007 15:23:40 -0600 Subject: [erlang-questions] clarify: how to express this elegantly In-Reply-To: <4755BA3B.4070004@fiit.stuba.sk> References: <4755BA3B.4070004@fiit.stuba.sk> Message-ID: <00fd01c836bb$f1726750$891ea8c0@SSI.CORP> How about: Mod = (case Value of "state" -> circuit_monitor; "rx_bit_rate" -> circuit_monitor; "tx_bit_rate" -> circuit_monitor; "ebno" -> circuit_monitor; "packetloss" -> node_pinger; "rtt" -> node_pinger end), Pid = (if Mod = circuit_monitor -> CircuitMonitorPid; true -> NodePingerPid), Mod:plot_node_value(Pid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ) I'm not sure if that's any prettier, though... DBM -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Matej Kosik Sent: Tuesday, December 04, 2007 14:36 To: erlang-questions@REDACTED Subject: [erlang-questions] clarify: how to express this elegantly -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Friends, I wander, how can I express this: case Value of "state" -> ?D, circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ); "rx_bit_rate" -> ?D, circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ); "tx_bit_rate" -> ?D, circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ); "ebno" -> ?D, circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ); "packetloss" -> ?D, node_pinger:plot_node_value(NodePingerPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ); "rtt" -> ?D, node_pinger:plot_node_value(NodePingerPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ) end more elegantly. Via some kind of "variant patterns" such as: case Value of "state" | "rx_bit_rate" | "tx_bit_rate" | "ebno" -> ?D, circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ); "packet_loss" | "round_trip_time" -> ?D, node_pinger:plot_node_value(NodePingerPid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value ) end but these do not exist :( These "variant patterns" could be introduced without any problems in special cases when neither variant contains unbound variable. - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHVbo7L+CaXfJI/hgRArySAJ47+Iin/aGeIBP04uNcJ/I5VlS2PwCePi27 QEDkkwClpMEL9WuA/3LICAo= =Y9ul -----END PGP SIGNATURE----- _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From kostis@REDACTED Tue Dec 4 22:52:56 2007 From: kostis@REDACTED (Kostis Sagonas) Date: Tue, 04 Dec 2007 23:52:56 +0200 Subject: [erlang-questions] "Mnesia" Pronunciation In-Reply-To: <200712041831.28291.bekesa@sch.bme.hu> References: <00d601c8368c$6f8ad530$891ea8c0@SSI.CORP> <47557F4C.4010802@it.uu.se> <200712041831.28291.bekesa@sch.bme.hu> Message-ID: <4755CC38.2010506@cs.ntua.gr> Andras Georgy Bekes wrote: >> Since it was named by a bunch of Swedes who tend to pronounce >> it /m-NEA-sia/, any damn way you like is probably ok. :-) > > According to wikipedia, amnesia in greek is ???????, so mnesia must be > ??????. I think we should ask the question: How did the ancient greek > pronounce ??????? AFAIK, ?????? does not exist as a word -- which I personally find strange since ??????? (*) does exist (in modern Greek too) where the initial '?' indeed means "negation of". I did find a reference to a guy named ???????, who apparently was the father of a famous(?) Ancient Greek Mathematician, I'd frankly never heard of. But I doubt that he had anything to do with Erlang/OTP :-) The base word was and still is: ????? (means: memory). Also, the word "mnemosyne" does exist in Greek -- in contrast to its OTP counterpart which is obsolescent. Anyway, if you really want to pretend it's derived from a Greek word alright, "mnesia" should definitely be pronounced with an "m" (the Swedes are correct in its pronunciation, while American/British people are not). If you want to be exact, the intonation should be on the "i". Since the above explanation is probably extremely confusing to most, let me also suggest that it is pronounced as Richard wrote: any damn way you like ;-) Cheers, ?????? (*) Note: not exactly what Andras wrote, which is definitely incorrect. In Greek, an ' in some vowel just denotes the place in the word where the intonation is supposed to be (Greek is wonderful in this respect) and there can only be one such place in each word. From bekesa@REDACTED Tue Dec 4 23:58:39 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Tue, 04 Dec 2007 23:58:39 +0100 Subject: [erlang-questions] "Mnesia" Pronunciation In-Reply-To: <4755CC38.2010506@cs.ntua.gr> References: <00d601c8368c$6f8ad530$891ea8c0@SSI.CORP> <200712041831.28291.bekesa@sch.bme.hu> <4755CC38.2010506@cs.ntua.gr> Message-ID: <200712042358.39724.bekesa@sch.bme.hu> > > According to wikipedia, amnesia in greek is ???????, so mnesia must > strange since ??????? (*) does exist (in modern Greek too) where > (*) Note: not exactly what Andras wrote, which is definitely > incorrect. In Greek, an ' in some vowel just denotes the place in the > word where the intonation is supposed to be (Greek is wonderful in > this respect) and there can only be one such place in each word. I've just copy-pasted from http://en.wikipedia.org/wiki/Amnesia, so complain there :-) Georgy From rvirding@REDACTED Wed Dec 5 03:33:55 2007 From: rvirding@REDACTED (Robert Virding) Date: Wed, 5 Dec 2007 03:33:55 +0100 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: <779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <361FB8EB-0C84-480D-93B3-914C8E15C771@local> <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> <779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> Message-ID: <3dbc6d1c0712041833ofd3447ckb73ffef560d2e494@mail.gmail.com> On 04/12/2007, YC wrote: > > > IMHO, the issues above arise from the goal being unclear: is it a lispy > syntax for erlang or is it a lisp in erlang? > I have tried to be clear, but obviously not succeeded. I am going to do a lisp syntax for Erlang, not implement CL or Scheme which, by the way, is *very* difficult on the BEAM today. That is the main problem as I have to invent lisp constructions which match into Erlang. If it's a lispy syntax, IMO a prefix<->infix transformer can handle a lot of > cases (below uses vector for tuples): > What I want is something which *is* lisp even though it a lisp which has been designed to work seamlessly together with *normal* Erlang. So it is more than just wrapping ( ... ) around expressions after converting them into prefix form. So, for example, there are no syntactic variables, you quote things which you don't want to evaluate. So to comment some of you examples: %% Erlang => ErlangInLisp > A + 1, => (+ A 1) > A = 5. => (= A 5). > This will become a (let ((a 5)) ... ). Let will be extended to match [foo | bar] => (| foo bar) > (cons 'foo 'bar) Pid ! Data => (! Pid Data) > (send pid data) ;Using symbols can sometimes be harder to read A = {foo, bar}. => (= A #(foo bar)) %% or (= A {foo bar}) (either works > fine, but vector version appears more uniform and in spirit of lisp) > (let ((a #('foo 'bar))) ... ) ;or '#(foo bar) here fun(A) -> A + 1. => (lambda (A) (+ A 1)) %% I think fun is fine. > Agree case A of foo -> {foo}; bar -> {foo, bar} end. => (case A ((foo) bar) ((bar) > #(foo bar))) > As yours but quoted: (case a ('foo #('bar)) ('bar #('foo 'bar))) foo(1) -> 2; foo(abc) -> {foo, bar}. => (defun foo ((1) 2) ((abc) #(foo > bar))) > I was more into: (defun foo (arg) (case arg (1 2) (abc '#(foo bar)))) {ok, B} = mod:fun(). => (= #(ok B) (mod:fun)) or (= {ok B} ((: mod fun))) > (let ((#('ok b) (: mod fun))) ... ) ;see below And keep the rest of the erlang syntax such as Camel casing for variable, > pattern matching built-in default, bare words as atoms unless at the the > head of a list (or unless in special syntax such as case), etc. > One feature of lisp we must keep is that code has he same form as data, *is* data. That means that if we keep the Camel casing for variables then they have to parse to something other than symbols. If they don't then we will forever be parsing symbol names to discern what they are. That is why I would prefer to use the lisp convention of evaluating everything *except* that which is quoted. That means even using quotes in patterns. The issue with (remote-call) is that it's tedious. Think of having to write > that for all function calls that don't live in the current module > namespace. And it also takes on meaning of apply/3. > > If mod:fun(Args) is writtten as (remote-call mod fun Args), then how to > write apply/3? > > Should we write apply(mod, fun, Args) as (apply (remote-call mod fun > Args))?? Then it's apply/1. > > Probably better to have remote-call take on the meaning of apply/3. I > don't think all function calls should go through apply. > My current working model is: mod:fun(, , ) ==> (module-call 'mod 'fun ) Mod:fun(, , ) ==> (module-call mod 'fun ) Mod:Fun(, , ) ==> (module-call mod fun ) with (: mod fun ) as a macro for the 1st most common case. It smiles at you because it feels good to be so helpful. You will still need apply: apply(Fun, ArgList) ==> (apply fun arglist) apply(Mod, Fun, ArgList) ==> (apply mod fun arglist) Apply and module-call are proper functions which evaluate their arguments, : is a macro which doesn't evaluate its first two arguments, the module name and function name, but does evaluate the function arguments. We'll see where it all ends up, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.rafkind@REDACTED Wed Dec 5 04:08:20 2007 From: dave.rafkind@REDACTED (Dave Rafkind) Date: Tue, 4 Dec 2007 22:08:20 -0500 Subject: [erlang-questions] timestamp for pgsql Message-ID: <2ae2b2da0712041908g2e8b213o2923e136cdbd22e9@mail.gmail.com> In the current postgresql driver for erlang (I'm using the ejabberd-module one because that's the one I got to work), how does one specify TIMESTAMP values? ie if I do pgsql:prepare(Db, my_insert, "insert into foo_table (timestamp_column) values ($1)"). what should I put in the subsequent call to pgsql:execute(Db, my_insert, [?????]) P.S. I think the Junglerl pgsql driver is broken for prepared statements. Thanks! Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From jao@REDACTED Wed Dec 5 05:47:06 2007 From: jao@REDACTED (Jack Orenstein) Date: Tue, 4 Dec 2007 23:47:06 -0500 Subject: [erlang-questions] Order of message processing by a gen_server Message-ID: Suppose I have a gen_server process whose queue contains {a} and {b}. Does the order of the handle_call function clauses determine which message is processed first? I.e., if the function clauses are handle_call({a}, From, State) -> ... handle_call({b}, From, State) -> ... is it guaranteed that {a} will be processed first? Jack Orenstein From vlm@REDACTED Wed Dec 5 06:40:54 2007 From: vlm@REDACTED (Lev Walkin) Date: Tue, 04 Dec 2007 21:40:54 -0800 Subject: [erlang-questions] Order of message processing by a gen_server In-Reply-To: References: Message-ID: <475639E6.2060307@lionet.info> Jack Orenstein wrote: > Suppose I have a gen_server process whose queue contains {a} and {b}. > Does the order of the handle_call function clauses determine which > message is processed first? I.e., if the function clauses are > > handle_call({a}, From, State) -> ... > handle_call({b}, From, State) -> ... > > is it guaranteed that {a} will be processed first? Yes, but this is implementation detail and is not guaranteed by the standard. -- Lev Walkin vlm@REDACTED From jao@REDACTED Wed Dec 5 07:22:52 2007 From: jao@REDACTED (Jack Orenstein) Date: Wed, 5 Dec 2007 01:22:52 -0500 Subject: [erlang-questions] Order of message processing by a gen_server In-Reply-To: <475639E6.2060307@lionet.info> References: <475639E6.2060307@lionet.info> Message-ID: <70B8175D-8A32-439F-9F89-57F4A5C52DDF@geophile.com> On Dec 5, 2007, at 12:40 AM, Lev Walkin wrote: > Jack Orenstein wrote: >> Suppose I have a gen_server process whose queue contains {a} and >> {b}. Does the order of the handle_call function clauses determine >> which message is processed first? I.e., if the function clauses are >> handle_call({a}, From, State) -> ... >> handle_call({b}, From, State) -> ... >> is it guaranteed that {a} will be processed first? > > Yes, but this is implementation detail and is not guaranteed > by the standard. What I am trying to do is to write a server that will process a series of requests, always the same requests (phase1, phase2, phase3) in the same order. But I want to be able to cancel the sequence of requests at any point, resetting the process state to be ready for phase1 again. If I write my own function with a receive, I can do this: loop(State) -> receive cancel -> ... phase1 -> ... phase2 -> ... phase3 -> ... end. Normally this server will receive messages phase1, phase2, phase3 in order. But if a cancel message shows up, e.g. after phase2, it takes priority (if I understand receive correctly). I'd like to use a gen_server, but it sounds like I can't do anything that is guaranteed by the language (not the implementation) to handle the cancel message with higher priority than any of the other messages. I.e., handle_call({cancel}, From, State) -> ... handle_call({phase1}, From, State) -> ... handle_call({phase2}, From, State) -> ... handle_call({phase3}, From, State) -> ... isn't guaranteed to work similarly to the loop function above. Any advice on how to proceed? Jack Orenstein From vlm@REDACTED Wed Dec 5 07:41:45 2007 From: vlm@REDACTED (Lev Walkin) Date: Tue, 04 Dec 2007 22:41:45 -0800 Subject: [erlang-questions] Order of message processing by a gen_server In-Reply-To: <70B8175D-8A32-439F-9F89-57F4A5C52DDF@geophile.com> References: <475639E6.2060307@lionet.info> <70B8175D-8A32-439F-9F89-57F4A5C52DDF@geophile.com> Message-ID: <47564829.3000805@lionet.info> Jack Orenstein wrote: > On Dec 5, 2007, at 12:40 AM, Lev Walkin wrote: > >> Jack Orenstein wrote: >>> Suppose I have a gen_server process whose queue contains {a} and >>> {b}. Does the order of the handle_call function clauses determine >>> which message is processed first? I.e., if the function clauses are >>> handle_call({a}, From, State) -> ... >>> handle_call({b}, From, State) -> ... >>> is it guaranteed that {a} will be processed first? >> >> Yes, but this is implementation detail and is not guaranteed >> by the standard. > > What I am trying to do is to write a server that will process a series > of requests, always the same requests (phase1, phase2, phase3) in the > same order. But I want to be able to cancel the sequence of requests at > any point, resetting the process state to be ready for phase1 again. If > I write my own function with a receive, I can do this: > > loop(State) -> > receive > cancel -> ... > phase1 -> ... > phase2 -> ... > phase3 -> ... > end. > > Normally this server will receive messages phase1, phase2, phase3 in > order. But if a cancel message shows up, e.g. after phase2, it takes > priority (if I understand receive correctly). > > I'd like to use a gen_server, but it sounds like I can't do anything > that is guaranteed by the language (not the implementation) to handle > the cancel message with higher priority than any of the other messages. > I.e., > > handle_call({cancel}, From, State) -> ... > handle_call({phase1}, From, State) -> ... > handle_call({phase2}, From, State) -> ... > handle_call({phase3}, From, State) -> ... > > isn't guaranteed to work similarly to the loop function above. > > Any advice on how to proceed? I was under impression that even your original approach (with barebones receive) is not formally guaranteed to work the way you described. However, out of practicality I'd advise you to rely on handle_call being similar to receive in its ability to receive out-of-bound messages. Don't worry about it unless you're writing Space Shuttle Mission Critical System with 20-years expected code lifetime. -- Lev Walkin vlm@REDACTED From matthew@REDACTED Wed Dec 5 08:08:27 2007 From: matthew@REDACTED (Matthew Dempsky) Date: Tue, 4 Dec 2007 23:08:27 -0800 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: <3dbc6d1c0712041833ofd3447ckb73ffef560d2e494@mail.gmail.com> References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <361FB8EB-0C84-480D-93B3-914C8E15C771@local> <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> <779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> <3dbc6d1c0712041833ofd3447ckb73ffef560d2e494@mail.gmail.com> Message-ID: I'm not terribly interested in this thread, but on the topic of syntax for calling functions in other modules, have any of you looked at Scheme 48's module system? It already allows you to reload modules at run-time without putting any sort of REMOTE-CALL burden on the code. From matthew@REDACTED Wed Dec 5 08:19:26 2007 From: matthew@REDACTED (Matthew Dempsky) Date: Tue, 4 Dec 2007 23:19:26 -0800 Subject: [erlang-questions] Order of message processing by a gen_server In-Reply-To: <70B8175D-8A32-439F-9F89-57F4A5C52DDF@geophile.com> References: <475639E6.2060307@lionet.info> <70B8175D-8A32-439F-9F89-57F4A5C52DDF@geophile.com> Message-ID: On 12/4/07, Jack Orenstein wrote: > Normally this server will receive messages phase1, phase2, phase3 in > order. But if a cancel message shows up, e.g. after phase2, it takes > priority (if I understand receive correctly). No, message ordering takes priority over pattern ordering. See section 6.10 of the Erlang Reference Manual for where this is defined, and see the example module below as a test case. Eshell V5.5.5 (abort with ^G) 1> c(jao). {ok,jao} 2> jao:test(). phase1 phase2 phase3 cancel ok 3> -module(jao). -export([test/0]). test() -> self() ! phase1, self() ! phase2, self() ! phase3, self() ! cancel, loop(). loop() -> receive cancel -> io:format("cancel~n"), loop(); phase1 -> io:format("phase1~n"), loop(); phase2 -> io:format("phase2~n"), loop(); phase3 -> io:format("phase3~n"), loop() after 0 -> ok end. From raimo+erlang-questions@REDACTED Wed Dec 5 08:49:11 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 5 Dec 2007 08:49:11 +0100 Subject: [erlang-questions] : Order of message processing by a gen_server In-Reply-To: <475639E6.2060307@lionet.info> References: <475639E6.2060307@lionet.info> Message-ID: <20071205074911.GB3081@erix.ericsson.se> On Tue, Dec 04, 2007 at 09:40:54PM -0800, Lev Walkin wrote: > Jack Orenstein wrote: > > Suppose I have a gen_server process whose queue contains {a} and {b}. > > Does the order of the handle_call function clauses determine which > > message is processed first? I.e., if the function clauses are > > > > handle_call({a}, From, State) -> ... > > handle_call({b}, From, State) -> ... > > > > is it guaranteed that {a} will be processed first? > > Yes, but this is implementation detail and is not guaranteed > by the standard. > No, that was incorrect! The generic gen_server code will receive using a catchall: Msg -> Result = Module:handle_call(Msg, From, State) so messages are received in arrival order. And that is not an implementation detail (at least it will not change). The handle_call(_, _, _) clauses then match the patterns in order (for the currently received message) and the first matching clause is taken, and that is not an implementation detail. In fact all messages are received like this (read the code): Msg = receive Input -> Input after Time -> timeout end, Even System messages does not take precedence. That may be an implementation detail. (There are system messages used by 'sys' for debugging) To write a gen_server'ish process with a hand carved receive statement; use 'proc_lib' and 'sys'. See the man pages and also OTP's Design Principles in the documentation. Esp. chapter 6.2.1 Example in section 6 Sys and Proc_Lib. > -- > Lev Walkin > vlm@REDACTED > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From adam@REDACTED Wed Dec 5 08:59:14 2007 From: adam@REDACTED (Adam Lindberg) Date: Wed, 5 Dec 2007 08:59:14 +0100 Subject: [erlang-questions] clarify: how to express this elegantly In-Reply-To: <00fd01c836bb$f1726750$891ea8c0@SSI.CORP> References: <4755BA3B.4070004@fiit.stuba.sk> <00fd01c836bb$f1726750$891ea8c0@SSI.CORP> Message-ID: <6344005f0712042359n54b7989ek779b2959cc2d2e2c@mail.gmail.com> My take: {Mod, Pid} = if Value == "state"; Value == "rx_bit_rate"; Value == "tx_bit_rate"; Value == "ebno" -> {circuit_monitor, CircuitMonitorPid}; Value == "packet_loss"; Value == "round_trip_time" -> {node_pinger, NodePingerPid} end, ?D, Mod:plot_node_value(Pid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value). On Dec 4, 2007 10:23 PM, David Mercer wrote: > How about: > > Mod = (case Value of > "state" -> circuit_monitor; > "rx_bit_rate" -> circuit_monitor; > "tx_bit_rate" -> circuit_monitor; > "ebno" -> circuit_monitor; > "packetloss" -> node_pinger; > "rtt" -> node_pinger > end), > Pid = (if Mod = circuit_monitor -> CircuitMonitorPid; true -> > NodePingerPid), > Mod:plot_node_value(Pid, Socket, > RequestId, CircuitId, FromDateTime, > ToDateTime, Width, Height, Value > ) > > I'm not sure if that's any prettier, though... > > DBM > > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Matej Kosik > Sent: Tuesday, December 04, 2007 14:36 > To: erlang-questions@REDACTED > Subject: [erlang-questions] clarify: how to express this elegantly > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Friends, > > I wander, how can I express this: > > case Value of > "state" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > Height, Value > ); > "rx_bit_rate" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > Height, Value > ); > "tx_bit_rate" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > Height, Value > ); > "ebno" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > Height, Value > ); > "packetloss" -> > ?D, > node_pinger:plot_node_value(NodePingerPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > Height, Value > ); > "rtt" -> > ?D, > node_pinger:plot_node_value(NodePingerPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > Height, Value > ) > end > > more elegantly. Via some kind of "variant patterns" such as: > > case Value of > "state" | "rx_bit_rate" | "tx_bit_rate" | "ebno" -> > ?D, > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > Height, Value > ); > "packet_loss" | "round_trip_time" -> > ?D, > node_pinger:plot_node_value(NodePingerPid, Socket, > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > Height, Value > ) > end > > but these do not exist :( > These "variant patterns" could be introduced without any problems in > special > cases when neither > variant contains unbound variable. > - -- > Matej Kosik > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHVbo7L+CaXfJI/hgRArySAJ47+Iin/aGeIBP04uNcJ/I5VlS2PwCePi27 > QEDkkwClpMEL9WuA/3LICAo= > =Y9ul > -----END PGP SIGNATURE----- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.hillqvist@REDACTED Wed Dec 5 09:20:22 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Wed, 5 Dec 2007 09:20:22 +0100 Subject: [erlang-questions] Order of message processing by a gen_server In-Reply-To: <70B8175D-8A32-439F-9F89-57F4A5C52DDF@geophile.com> References: <475639E6.2060307@lionet.info> <70B8175D-8A32-439F-9F89-57F4A5C52DDF@geophile.com> Message-ID: <8268eea30712050020t60dc9e7bi84739840fd70d7c@mail.gmail.com> It looks like you want to modle a finitive state machine(fsm). You could use gen_fsm for this: -module(my_fsm). -define(NAME, ?MODULE). -behaviour(gen_fsm). %% External exports -export([start_link/0, cancel/0, phase1/0, phase2/0, phase3/0, get_state/0]). %% gen_fsm exports -export([init/1, idle/2, idle/3, phase1/2, phase1/3, phase2/2, phase2/3, phase3/2, phase3/3, handle_event/3, handle_sync_event/4, handle_info/3, terminate/3, code_change/4]). -record(state, {}). %% External functions start_link() -> Args = [], Options = [], {ok, Pid} = gen_fsm:start_link({local, ?NAME}, ?MODULE, Args, Options). cancel() -> gen_fsm:send_all_state_event(?NAME, cancel). phase1() -> gen_fsm:send_event(?NAME, phase1). phase2() -> gen_fsm:send_event(?NAME, phase2). phase3() -> gen_fsm:send_event(?NAME, phase3). get_state() -> gen_fsm:sync_send_all_state_event(?NAME, get_state). %% gen_fsm callbacks init([]) -> {ok, idle, #state{}}. idle(phase1, StateData) -> io:format("We have recived phase1 in idle!\n" "We now transits to phase1\n"), {next_state, phase1, StateData}; idle(_, StateData) -> {next_state, idle, StateData}. idle(_, From, StateData) -> Reply = ok, {reply, Reply, idle, StateData}. phase1(phase2, StateData) -> io:format("We have recived phase2 in phase1!\n" "We now transits to phase2\n"), {next_state, phase2, StateData}; phase1(_, StateData) -> {next_state, phase1, StateData}. phase1(_, From, StateData) -> Reply = ok, {reply, Reply, phase1, StateData}. phase2(phase3, StateData) -> io:format("We have recived phase3 in phase2!\n" "We now transits to phase3\n"), {next_state, phase3, StateData}; phase2(_, StateData) -> {next_state, phase2, StateData}. phase2(_, From, StateData) -> Reply = ok, {reply, Reply, phase2, StateData}. phase3(_, StateData) -> {next_state, phase3, StateData}. phase3(_, From, StateData) -> Reply = ok, {reply, Reply, phase3, StateData}. handle_event(cancel, StateName, StateData) -> io:format("We have recived cancel in ~p!\n" "We now transits to idle\n", [StateName]), {next_state, idle, StateData}. handle_sync_event(get_state, _From, StateName, StateData) -> Reply = StateName, {reply, Reply, StateName, StateData}; handle_sync_event(Event, From, StateName, StateData) -> Reply = ok, {reply, Reply, StateName, StateData}. handle_info(Info, StateName, StateData) -> {next_state, StateName, StateData}. terminate(Reason, StateName, StatData) -> ok. code_change(OldVsn, StateName, StateData, Extra) -> {ok, StateName, StateData}. Here is a test suit that illustrates when it transits: -module(test_my_fsm). -export([start/0]). start() -> {ok, Pid} = my_fsm:start_link(), idle = my_fsm:get_state(), my_fsm:cancel(), idle = my_fsm:get_state(), my_fsm:phase1(), phase1 = my_fsm:get_state(), my_fsm:cancel(), idle = my_fsm:get_state(), my_fsm:phase2(), idle = my_fsm:get_state(), my_fsm:phase1(), my_fsm:phase2(), phase2 = my_fsm:get_state(), my_fsm:cancel(), idle = my_fsm:get_state(), my_fsm:phase3(), idle = my_fsm:get_state(), my_fsm:phase1(), my_fsm:phase3(), phase1 = my_fsm:get_state(), my_fsm:phase2(), my_fsm:phase3(), phase3 = my_fsm:get_state(), my_fsm:cancel(), idle = my_fsm:get_state(), success. There may problem, if the processing of state take some time. Example: 1. phase1 is sent to my_fms 2. my_fms receives phase1 3. my_fms starts processing phase1 4. phase2 is sent to my_fms 5. phase3 is sent to my_fms 6. cancel is sent to my_fms 7. my_fms finish processing phase1 8. my_fms receives phase2 9. my_fms starts processing phase2 10. my_fms finish processing phase2 11. my_fms receives phase3 12. my_fms starts processing phase3 13. my_fms finish processing phase3 14. my_fms receives cancel As I intrepid it, you want step 8 to receive cancel event and ignore the transitions to phase2 and phase3? If this is the case your loop would have to look like: loop(State) -> receive cancel -> ... after 0 receive phase1 -> ... phase2 -> ... phase3 -> ... cancel -> ... end end. If you receive an cancel you should also empty the message box. It may also be useful to use a reference to unice identify if the transitions are valid or old. Kind regards Andreas Hillqvist 2007/12/5, Jack Orenstein : > On Dec 5, 2007, at 12:40 AM, Lev Walkin wrote: > > > Jack Orenstein wrote: > >> Suppose I have a gen_server process whose queue contains {a} and > >> {b}. Does the order of the handle_call function clauses determine > >> which message is processed first? I.e., if the function clauses are > >> handle_call({a}, From, State) -> ... > >> handle_call({b}, From, State) -> ... > >> is it guaranteed that {a} will be processed first? > > > > Yes, but this is implementation detail and is not guaranteed > > by the standard. > > What I am trying to do is to write a server that will process a > series of requests, always the same requests (phase1, phase2, phase3) > in the same order. But I want to be able to cancel the sequence of > requests at any point, resetting the process state to be ready for > phase1 again. If I write my own function with a receive, I can do this: > > loop(State) -> > receive > cancel -> ... > phase1 -> ... > phase2 -> ... > phase3 -> ... > end. > > Normally this server will receive messages phase1, phase2, phase3 in > order. But if a cancel message shows up, e.g. after phase2, it takes > priority (if I understand receive correctly). > > I'd like to use a gen_server, but it sounds like I can't do anything > that is guaranteed by the language (not the implementation) to handle > the cancel message with higher priority than any of the other > messages. I.e., > > handle_call({cancel}, From, State) -> ... > handle_call({phase1}, From, State) -> ... > handle_call({phase2}, From, State) -> ... > handle_call({phase3}, From, State) -> ... > > isn't guaranteed to work similarly to the loop function above. > > Any advice on how to proceed? > > Jack Orenstein > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bjorn@REDACTED Wed Dec 5 09:33:02 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 05 Dec 2007 09:33:02 +0100 Subject: [erlang-questions] Erlang/OTP R12B-0 has been released Message-ID: Major relese : otp_src_R12B-0 Build date : 2007-12-04 R12B-0 is a major new release of Erlang/OTP. You can download the full source distribution from http://www.erlang.org/download/otp_src_R12B-0.tar.gz http://www.erlang.org/download/otp_src_R12B-0.readme Note: To unpack the TAR archive you need a GNU TAR compatible program. 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_R12B-0.exe On-line documentation can be found at http://www.erlang.org/doc/. You can also download the complete HTML documentation or the Unix manual files http://www.erlang.org/download/otp_doc_html_R12B-0.tar.gz http://www.erlang.org/download/otp_doc_man_R12B-0.tar.gz We also want to thank those that sent us patches, suggestions and bug reports, The OTP Team -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From joelr1@REDACTED Wed Dec 5 10:10:27 2007 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 5 Dec 2007 09:10:27 +0000 Subject: [erlang-questions] Interfacing Prolog and Erlang Message-ID: Has anyone interfaced Prolog with Erlang? Thanks, Joel -- http://wagerlabs.com From vychodil.hynek@REDACTED Wed Dec 5 10:20:36 2007 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Wed, 5 Dec 2007 10:20:36 +0100 Subject: [erlang-questions] clarify: how to express this elegantly In-Reply-To: <6344005f0712042359n54b7989ek779b2959cc2d2e2c@mail.gmail.com> References: <4755BA3B.4070004@fiit.stuba.sk> <00fd01c836bb$f1726750$891ea8c0@SSI.CORP> <6344005f0712042359n54b7989ek779b2959cc2d2e2c@mail.gmail.com> Message-ID: <4d08db370712050120j251b9b06w3f052a9fa836df2f@mail.gmail.com> Yet another implementation of same: {Mod, Pid} = ( fun ("state") ->{circuit_monitor, CircuitMonitorPid}; ("rx_bit_rate") ->{circuit_monitor, CircuitMonitorPid}; ("tx_bit_rate") ->{circuit_monitor, CircuitMonitorPid}; ("ebno") ->{circuit_monitor, CircuitMonitorPid}; ("packet_loss") ->{node_pinger, NodePingerPid}; ("round_trip_time") ->{node_pinger, NodePingerPid} end)(Value), ?D, Mod:plot_node_value(Pid, Socket, RequestId, CircuitId, FromDateTime, ToDateTime, Width, Height, Value). There are many implementations of this thing. On 12/5/07, Adam Lindberg wrote: > My take: > > > {Mod, Pid} = if > Value == "state"; > Value == "rx_bit_rate"; > Value == "tx_bit_rate"; > Value == "ebno" -> > {circuit_monitor, CircuitMonitorPid}; > Value == "packet_loss"; > Value == "round_trip_time" -> > {node_pinger, NodePingerPid} > end, > ?D, > Mod:plot_node_value(Pid, Socket, RequestId, CircuitId, FromDateTime, > ToDateTime, Width, Height, Value). > > > > On Dec 4, 2007 10:23 PM, David Mercer wrote: > > How about: > > > > Mod = (case Value of > > "state" -> circuit_monitor; > > "rx_bit_rate" -> circuit_monitor; > > "tx_bit_rate" -> circuit_monitor; > > "ebno" -> circuit_monitor; > > "packetloss" -> node_pinger; > > "rtt" -> node_pinger > > end), > > Pid = (if Mod = circuit_monitor -> CircuitMonitorPid; true -> > > NodePingerPid), > > Mod:plot_node_value(Pid, Socket, > > > > RequestId, CircuitId, FromDateTime, > > ToDateTime, Width, Height, Value > > ) > > > > I'm not sure if that's any prettier, though... > > > > DBM > > > > > > > > > > -----Original Message----- > > From: erlang-questions-bounces@REDACTED > > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of > Matej Kosik > > Sent: Tuesday, December 04, 2007 14:36 > > To: erlang-questions@REDACTED > > Subject: [erlang-questions] clarify: how to express this elegantly > > > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > Friends, > > > > I wander, how can I express this: > > > > case Value of > > "state" -> > > ?D, > > > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > > Height, Value > > ); > > "rx_bit_rate" -> > > ?D, > > > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > > Height, Value > > ); > > "tx_bit_rate" -> > > ?D, > > > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > > Height, Value > > ); > > "ebno" -> > > ?D, > > > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > > Height, Value > > ); > > "packetloss" -> > > ?D, > > node_pinger:plot_node_value(NodePingerPid, > Socket, > > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > > Height, Value > > ); > > "rtt" -> > > ?D, > > node_pinger:plot_node_value(NodePingerPid, > Socket, > > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > > Height, Value > > ) > > end > > > > more elegantly. Via some kind of "variant patterns" such as: > > > > case Value of > > "state" | "rx_bit_rate" | "tx_bit_rate" | "ebno" -> > > ?D, > > > circuit_monitor:plot_node_value(CircuitMonitorPid, Socket, > > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > > Height, Value > > ); > > "packet_loss" | "round_trip_time" -> > > ?D, > > node_pinger:plot_node_value(NodePingerPid, > Socket, > > RequestId, CircuitId, FromDateTime, ToDateTime, Width, > > Height, Value > > ) > > end > > > > but these do not exist :( > > These "variant patterns" could be introduced without any problems in > special > > cases when neither > > variant contains unbound variable. > > - -- > > Matej Kosik > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.4.6 (GNU/Linux) > > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > > > > iD8DBQFHVbo7L+CaXfJI/hgRArySAJ47+Iin/aGeIBP04uNcJ/I5VlS2PwCePi27 > > QEDkkwClpMEL9WuA/3LICAo= > > =Y9ul > > -----END PGP SIGNATURE----- > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil From richardc@REDACTED Wed Dec 5 10:36:18 2007 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 05 Dec 2007 10:36:18 +0100 Subject: [erlang-questions] clarify: how to express this elegantly In-Reply-To: <4755C405.1070304@it.uu.se> References: <4755BA3B.4070004@fiit.stuba.sk> <4755C405.1070304@it.uu.se> Message-ID: <47567112.4010706@it.uu.se> I missed that the last two clauses were slightly different, but it does not really change anything. Of the variants suggested by others in this thread, I still prefer those I suggested, because they are more generally applicable. So, with a small modification: Version 1: case kind(Value) of circuit -> ?D, circuit_monitor:plot_node_value(..., Value); node -> ?D, node_pinger:plot_node_value(..., Value); end ... % a table tends to be more readable than a ;-separated guard kind("state") -> circuit; kind("rx_bit_rate") -> circuit; ... kind("packetloss") -> node. kind("rtt") -> node. (where it often turns out that the "kind" function can be reused by other parts of your code; you should give it a better name though.) Note: You should probably _not_ use the module names 'circuit_monitor' and 'node_pinger' as the value returned by the kind/1 function, even if it might be tempting, unless you are _sure_ that you want such a tight coupling between those concepts. Someone also asked how to do this elegantly if you want to take one or more variables from the pattern. Using a fun, this is easy. Here is an extended variant of version 2 that demonstrates it: Version 2: Plot = fun (M, X) -> ?D, M:plot_node_value(...,Value, X) end, case Value of {"state", X} -> Plot(circuit_monitor, X); {"rx_bit_rate", X} -> Plot(circuit_monitor, X); ... {"packetloss", X} -> Plot(node_pinger, X); {"rtt", X} -> Plot(node_pinger, X) end /Richard From ignatios@REDACTED Wed Dec 5 10:46:29 2007 From: ignatios@REDACTED (Ignatios Souvatzis) Date: Wed, 5 Dec 2007 10:46:29 +0100 Subject: [erlang-questions] Interfacing Prolog and Erlang In-Reply-To: References: Message-ID: <20071205094629.GA12869@cs.uni-bonn.de> On Wed, Dec 05, 2007 at 09:10:27AM +0000, Joel Reymont wrote: > Has anyone interfaced Prolog with Erlang? Rumours are they even made a video of it. I think the first implementation was on top of Prolog. -is From joelr1@REDACTED Wed Dec 5 10:57:34 2007 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 5 Dec 2007 09:57:34 +0000 Subject: [erlang-questions] Interfacing Prolog and Erlang In-Reply-To: <20071205094629.GA12869@cs.uni-bonn.de> References: <20071205094629.GA12869@cs.uni-bonn.de> Message-ID: <4B76D324-669F-47F3-B489-0C7BEBBE45F6@gmail.com> On Dec 5, 2007, at 9:46 AM, Ignatios Souvatzis wrote: > Rumours are they even made a video of it. > > I think the first implementation was on top of Prolog. I must be dumb. I meant interfacing current Erlang with current Prolog such as SWI or SICStus. Thanks, Joel -- http://wagerlabs.com From luna@REDACTED Wed Dec 5 11:04:40 2007 From: luna@REDACTED (Daniel Luna) Date: Wed, 5 Dec 2007 11:04:40 +0100 (CET) Subject: [erlang-questions] Erlang/OTP R12B-0 has been released In-Reply-To: References: Message-ID: On Wed, 5 Dec 2007, Bjorn Gustavsson wrote: > R12B-0 is a major new release of Erlang/OTP. > You can download the full source distribution from > > http://www.erlang.org/download/otp_src_R12B-0.tar.gz > http://www.erlang.org/download/otp_src_R12B-0.readme How about the version _without_ prebuilt beam-files and prebuilt dialyzer-plt? Will that one also be available for download? Please. /Luna -- Daniel Luna | Top reasons that I have a beard: luna@REDACTED | a) Laziness. http://www.update.uu.se/~luna/ | b) I can. Don't look at my homepage (it stinks).| c) I can get away with it. From me@REDACTED Wed Dec 5 11:33:29 2007 From: me@REDACTED (KatolaZ) Date: Wed, 5 Dec 2007 11:33:29 +0100 Subject: [erlang-questions] Erlang/OTP R12B-0 has been released In-Reply-To: References: Message-ID: <20071205103329.GA11705@katolaz.homeunix.net> On Wed, Dec 05, 2007 at 11:04:40AM +0100, Daniel Luna wrote: > On Wed, 5 Dec 2007, Bjorn Gustavsson wrote: > > R12B-0 is a major new release of Erlang/OTP. > > You can download the full source distribution from > > > > http://www.erlang.org/download/otp_src_R12B-0.tar.gz > > http://www.erlang.org/download/otp_src_R12B-0.readme > > How about the version _without_ prebuilt beam-files and prebuilt > dialyzer-plt? Will that one also be available for download? > > Please. I think that sources should be make available anyway, if the licence of Erlang has not changed..... HND Enzo -- [ Enzo Nicosia aka KatolaZ --- GLUG Catania -- Freaknet Medialab ] [ me [at] katolaz.homeunix.net -- http://katolaz.homeunix.net -- ] [ GNU/Linux User:#325780/ICQ UIN: #258332181/GPG key ID 0B5F062F ] [ Fingerprint: 8E59 D6AA 445E FDB4 A153 3D5A 5F20 B3AE 0B5F 062F ] From bjorn@REDACTED Wed Dec 5 11:37:03 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 05 Dec 2007 11:37:03 +0100 Subject: [erlang-questions] Erlang/OTP R12B-0 has been released In-Reply-To: <20071205103329.GA11705@katolaz.homeunix.net> References: <20071205103329.GA11705@katolaz.homeunix.net> Message-ID: KatolaZ writes: > I think that sources should be make available anyway, if the licence > of Erlang has not changed..... The sources ARE included. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From ignatios@REDACTED Wed Dec 5 11:44:02 2007 From: ignatios@REDACTED (Ignatios Souvatzis) Date: Wed, 5 Dec 2007 11:44:02 +0100 Subject: [erlang-questions] Interfacing Prolog and Erlang In-Reply-To: <4B76D324-669F-47F3-B489-0C7BEBBE45F6@gmail.com> References: <20071205094629.GA12869@cs.uni-bonn.de> <4B76D324-669F-47F3-B489-0C7BEBBE45F6@gmail.com> Message-ID: <20071205104402.GB12869@cs.uni-bonn.de> On Wed, Dec 05, 2007 at 09:57:34AM +0000, Joel Reymont wrote: > > On Dec 5, 2007, at 9:46 AM, Ignatios Souvatzis wrote: > > >Rumours are they even made a video of it. > > > >I think the first implementation was on top of Prolog. > > > I must be dumb. I meant interfacing current Erlang with current Prolog > such as SWI or SICStus. No, no, not at all, I understood you very well. Please pardon me. Not knowing a helpful answer, I at least wanted to make this joke. -is From cd5@REDACTED Wed Dec 5 11:46:28 2007 From: cd5@REDACTED (Christoph Dornheim) Date: Wed, 5 Dec 2007 10:46:28 +0000 (UTC) Subject: [erlang-questions] Erlang HTTP-tunnel Message-ID: Hello, I started a small project hosted at Google Code: an HTTP tunnel for tunneling TCP connections over HTTP. The project is called ErlTunnel (in the absence of a better name ;-) and can be found at http://code.google.com/p/erltunnel/ It is tested in particular to pass the Squid proxy. In the project's wiki I've described briefly how to test ErlTunnel in combination with Squid. Any comments and suggestions are welcome. Christoph From andreas.hillqvist@REDACTED Wed Dec 5 11:51:29 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Wed, 5 Dec 2007 11:51:29 +0100 Subject: [erlang-questions] Order of message processing by a gen_server In-Reply-To: <8268eea30712050020t60dc9e7bi84739840fd70d7c@mail.gmail.com> References: <475639E6.2060307@lionet.info> <70B8175D-8A32-439F-9F89-57F4A5C52DDF@geophile.com> <8268eea30712050020t60dc9e7bi84739840fd70d7c@mail.gmail.com> Message-ID: <8268eea30712050251q51540d03oaa362513c3cea93f@mail.gmail.com> You could solve the problem using a priority queue in a separate process: loop(?EMPTY) -> receive {push, NewPriority, NewMessage} = Msg -> NewQueue = [{NewPriority, NewMessage}], loop(NewQueue); end; loop([{Priority, _} | _] = Queue) -> receive {push, NewPriority, NewMessage} = Msg when NewPriority > Priority -> NewQueue = [{NewPriority, NewMessage} | Queue], loop(NewQueue); {pull, From, Ref} = Msg -> [{_, Message} | NewQueue] = Queue, Reply = {Ref, Message}, From ! Reply, loop(NewQueue); end. I have created and attached a example priority queue that applies the OTP principles. I remember that the question of priority queue has been up before. Is this something that would be useful as a part of Erlang/OTP? Maybe using some other principle. Kind regards, Andreas Hillqvist 2007/12/5, Andreas Hillqvist : > It looks like you want to modle a finitive state machine(fsm). You > could use gen_fsm for this: > -module(my_fsm). > > -define(NAME, ?MODULE). > > -behaviour(gen_fsm). > > %% External exports > -export([start_link/0, > cancel/0, > phase1/0, > phase2/0, > phase3/0, > get_state/0]). > > %% gen_fsm exports > -export([init/1, > idle/2, > idle/3, > phase1/2, > phase1/3, > phase2/2, > phase2/3, > phase3/2, > phase3/3, > handle_event/3, > handle_sync_event/4, > handle_info/3, > terminate/3, > code_change/4]). > > -record(state, {}). > > %% External functions > start_link() -> > Args = [], > Options = [], > {ok, Pid} = gen_fsm:start_link({local, ?NAME}, ?MODULE, Args, Options). > > cancel() -> > gen_fsm:send_all_state_event(?NAME, cancel). > > phase1() -> > gen_fsm:send_event(?NAME, phase1). > > phase2() -> > gen_fsm:send_event(?NAME, phase2). > > phase3() -> > gen_fsm:send_event(?NAME, phase3). > > get_state() -> > gen_fsm:sync_send_all_state_event(?NAME, get_state). > > %% gen_fsm callbacks > init([]) -> > {ok, idle, #state{}}. > > > idle(phase1, StateData) -> > io:format("We have recived phase1 in idle!\n" > "We now transits to phase1\n"), > {next_state, phase1, StateData}; > idle(_, StateData) -> > {next_state, idle, StateData}. > > idle(_, From, StateData) -> > Reply = ok, > {reply, Reply, idle, StateData}. > > > > phase1(phase2, StateData) -> > io:format("We have recived phase2 in phase1!\n" > "We now transits to phase2\n"), > {next_state, phase2, StateData}; > phase1(_, StateData) -> > {next_state, phase1, StateData}. > > phase1(_, From, StateData) -> > Reply = ok, > {reply, Reply, phase1, StateData}. > > > phase2(phase3, StateData) -> > io:format("We have recived phase3 in phase2!\n" > "We now transits to phase3\n"), > {next_state, phase3, StateData}; > phase2(_, StateData) -> > {next_state, phase2, StateData}. > > phase2(_, From, StateData) -> > Reply = ok, > {reply, Reply, phase2, StateData}. > > > phase3(_, StateData) -> > {next_state, phase3, StateData}. > > phase3(_, From, StateData) -> > Reply = ok, > {reply, Reply, phase3, StateData}. > > > handle_event(cancel, StateName, StateData) -> > io:format("We have recived cancel in ~p!\n" > "We now transits to idle\n", [StateName]), > {next_state, idle, StateData}. > > > > handle_sync_event(get_state, _From, StateName, StateData) -> > Reply = StateName, > {reply, Reply, StateName, StateData}; > handle_sync_event(Event, From, StateName, StateData) -> > Reply = ok, > {reply, Reply, StateName, StateData}. > > > handle_info(Info, StateName, StateData) -> > {next_state, StateName, StateData}. > > > terminate(Reason, StateName, StatData) -> > ok. > > > code_change(OldVsn, StateName, StateData, Extra) -> > {ok, StateName, StateData}. > > > > Here is a test suit that illustrates when it transits: > -module(test_my_fsm). > > -export([start/0]). > > start() -> > {ok, Pid} = my_fsm:start_link(), > idle = my_fsm:get_state(), > > my_fsm:cancel(), > idle = my_fsm:get_state(), > > my_fsm:phase1(), > phase1 = my_fsm:get_state(), > > my_fsm:cancel(), > idle = my_fsm:get_state(), > > > my_fsm:phase2(), > idle = my_fsm:get_state(), > > my_fsm:phase1(), > my_fsm:phase2(), > phase2 = my_fsm:get_state(), > > my_fsm:cancel(), > idle = my_fsm:get_state(), > > > my_fsm:phase3(), > idle = my_fsm:get_state(), > > my_fsm:phase1(), > my_fsm:phase3(), > phase1 = my_fsm:get_state(), > > my_fsm:phase2(), > my_fsm:phase3(), > phase3 = my_fsm:get_state(), > > my_fsm:cancel(), > idle = my_fsm:get_state(), > > success. > > > There may problem, if the processing of state take some time. > > Example: > 1. phase1 is sent to my_fms > 2. my_fms receives phase1 > 3. my_fms starts processing phase1 > 4. phase2 is sent to my_fms > 5. phase3 is sent to my_fms > 6. cancel is sent to my_fms > 7. my_fms finish processing phase1 > 8. my_fms receives phase2 > 9. my_fms starts processing phase2 > 10. my_fms finish processing phase2 > 11. my_fms receives phase3 > 12. my_fms starts processing phase3 > 13. my_fms finish processing phase3 > 14. my_fms receives cancel > > As I intrepid it, you want step 8 to receive cancel event and ignore > the transitions to phase2 and phase3? > > If this is the case your loop would have to look like: > > loop(State) -> > receive > cancel -> ... > after 0 > receive > phase1 -> ... > phase2 -> ... > phase3 -> ... > cancel -> ... > end > end. > > If you receive an cancel you should also empty the message box. > It may also be useful to use a reference to unice identify if the > transitions are valid or old. > > > Kind regards > Andreas Hillqvist > > 2007/12/5, Jack Orenstein : > > On Dec 5, 2007, at 12:40 AM, Lev Walkin wrote: > > > > > Jack Orenstein wrote: > > >> Suppose I have a gen_server process whose queue contains {a} and > > >> {b}. Does the order of the handle_call function clauses determine > > >> which message is processed first? I.e., if the function clauses are > > >> handle_call({a}, From, State) -> ... > > >> handle_call({b}, From, State) -> ... > > >> is it guaranteed that {a} will be processed first? > > > > > > Yes, but this is implementation detail and is not guaranteed > > > by the standard. > > > > What I am trying to do is to write a server that will process a > > series of requests, always the same requests (phase1, phase2, phase3) > > in the same order. But I want to be able to cancel the sequence of > > requests at any point, resetting the process state to be ready for > > phase1 again. If I write my own function with a receive, I can do this: > > > > loop(State) -> > > receive > > cancel -> ... > > phase1 -> ... > > phase2 -> ... > > phase3 -> ... > > end. > > > > Normally this server will receive messages phase1, phase2, phase3 in > > order. But if a cancel message shows up, e.g. after phase2, it takes > > priority (if I understand receive correctly). > > > > I'd like to use a gen_server, but it sounds like I can't do anything > > that is guaranteed by the language (not the implementation) to handle > > the cancel message with higher priority than any of the other > > messages. I.e., > > > > handle_call({cancel}, From, State) -> ... > > handle_call({phase1}, From, State) -> ... > > handle_call({phase2}, From, State) -> ... > > handle_call({phase3}, From, State) -> ... > > > > isn't guaranteed to work similarly to the loop function above. > > > > Any advice on how to proceed? > > > > Jack Orenstein > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: priority_queue.erl Type: application/octet-stream Size: 2587 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test_priority_queue.erl Type: application/octet-stream Size: 917 bytes Desc: not available URL: From kosik@REDACTED Wed Dec 5 12:01:12 2007 From: kosik@REDACTED (Matej Kosik) Date: Wed, 05 Dec 2007 12:01:12 +0100 Subject: [erlang-questions] clarify: how to express this elegantly In-Reply-To: <200712042207.35072.bekesa@sch.bme.hu> References: <4755BA3B.4070004@fiit.stuba.sk> <200712042207.35072.bekesa@sch.bme.hu> Message-ID: <475684F8.1030704@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andras Georgy Bekes wrote: > This can be written as (legal Erlang code): > > if > Value== "state" ; Value=="rx_bit_rate" ; Value=="tx_bit_rate" ; Value=="ebno" -> > this; > Value=="packet_loss" ; Value=="round_trip_time" -> > that; > end Great. Thank you everyone. > The interesting case is when the patterns do contain unbound variables. - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHVoT4L+CaXfJI/hgRAsdRAKCSYv/66ZbaZqiTFc9tyT8Fl3WJUwCgjL3z YlTlke9OM1uGguyAPAEQ6Vk= =0k7T -----END PGP SIGNATURE----- From chandrashekhar.mullaparthi@REDACTED Wed Dec 5 12:33:55 2007 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Wed, 5 Dec 2007 11:33:55 +0000 Subject: [erlang-questions] FW: SMP VM DUMPING CORE In-Reply-To: <475555B3.5080905@ericsson.com> References: <9D5D0FF2FC2E5C47A1A54047C271BE49D727C2@MTNMAIL1.mtn.co.za> <4753F664.6050809@ericsson.com> <9D5D0FF2FC2E5C47A1A54047C271BE49D72DB1@MTNMAIL1.mtn.co.za> <475555B3.5080905@ericsson.com> Message-ID: Hi Rickard, On 04/12/2007, Rickard Green wrote: > The 64-bit compiled smp emulator on sparc erroneously used the 32-bit > implementation of atomic variables which caused it to crash. We didn't > notice this since we currently aren't running any automated tests on > 64-bit sparc. > > Unfortunately a fix for this issue will not make it into the R12B > release. I will however post a source patch for R12B fixing this issue > later. Is this fault likely to affect R11B-5 smp emulator running on Solaris 10 on x86 hardware? regards, Chandru From andreas.hillqvist@REDACTED Wed Dec 5 12:45:05 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Wed, 5 Dec 2007 12:45:05 +0100 Subject: [erlang-questions] Erlang/OTP R12B-0 has been released In-Reply-To: References: Message-ID: <8268eea30712050345t9c9254bn9293c9b68ccb1860@mail.gmail.com> Why not provide torrents for Erlang/OTP releases. Wouldn't that speed up downloads, decrease load and increase availability? Regards, Andreas Hillqvist 05 Dec 2007 09:33:02 +0100, Bjorn Gustavsson : > Major relese : otp_src_R12B-0 > Build date : 2007-12-04 > > R12B-0 is a major new release of Erlang/OTP. > You can download the full source distribution from > > http://www.erlang.org/download/otp_src_R12B-0.tar.gz > http://www.erlang.org/download/otp_src_R12B-0.readme > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > > 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_R12B-0.exe > > > On-line documentation can be found at http://www.erlang.org/doc/. > You can also download the complete HTML documentation or the Unix manual files > > http://www.erlang.org/download/otp_doc_html_R12B-0.tar.gz > http://www.erlang.org/download/otp_doc_man_R12B-0.tar.gz > > We also want to thank those that sent us patches, suggestions and bug > reports, > > The OTP Team > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From jao@REDACTED Wed Dec 5 07:22:52 2007 From: jao@REDACTED (Jack Orenstein) Date: Wed, 5 Dec 2007 01:22:52 -0500 Subject: [erlang-questions] Order of message processing by a gen_server In-Reply-To: <475639E6.2060307@lionet.info> References: <475639E6.2060307@lionet.info> Message-ID: <70B8175D-8A32-439F-9F89-57F4A5C52DDF@geophile.com> On Dec 5, 2007, at 12:40 AM, Lev Walkin wrote: > Jack Orenstein wrote: >> Suppose I have a gen_server process whose queue contains {a} and >> {b}. Does the order of the handle_call function clauses determine >> which message is processed first? I.e., if the function clauses are >> handle_call({a}, From, State) -> ... >> handle_call({b}, From, State) -> ... >> is it guaranteed that {a} will be processed first? > > Yes, but this is implementation detail and is not guaranteed > by the standard. What I am trying to do is to write a server that will process a series of requests, always the same requests (phase1, phase2, phase3) in the same order. But I want to be able to cancel the sequence of requests at any point, resetting the process state to be ready for phase1 again. If I write my own function with a receive, I can do this: loop(State) -> receive cancel -> ... phase1 -> ... phase2 -> ... phase3 -> ... end. Normally this server will receive messages phase1, phase2, phase3 in order. But if a cancel message shows up, e.g. after phase2, it takes priority (if I understand receive correctly). I'd like to use a gen_server, but it sounds like I can't do anything that is guaranteed by the language (not the implementation) to handle the cancel message with higher priority than any of the other messages. I.e., handle_call({cancel}, From, State) -> ... handle_call({phase1}, From, State) -> ... handle_call({phase2}, From, State) -> ... handle_call({phase3}, From, State) -> ... isn't guaranteed to work similarly to the loop function above. Any advice on how to proceed? Jack Orenstein From dnm@REDACTED Wed Dec 5 13:17:38 2007 From: dnm@REDACTED (Dan Moniz) Date: Wed, 05 Dec 2007 07:17:38 -0500 Subject: [erlang-questions] Erlang for GPUs References: <200711211858.lALIwuMG018748@morgoth.cslab.ericsson.net> <1195672232.4764.4.camel@metalman.lan> Message-ID: On Wed, 21 Nov 2007 13:10:31 -0600, mog wrote: >On Wed, 2007-11-21 at 19:58 +0100, dfeustel@REDACTED wrote: >> Are there any Erlang Compilers that generate code for >> upcoming GPUs from Nvidia and ATI? >No. > >however there was ecomp, http://www.erlang.se/euc/00/processor.ppt , >which was a erlang vm for an fpga, however, it was never released to the >public :(, i think we should continue to poll ericcson and erlang team >to release it. Please!!! Interesting find Mog! Thanks for the link to the PowerPoint presentation. I had recently been thinking about Erlang and hardware designs, so this is a welcome discovery. Kenneth, Bjorn, Joe, or Robert: Are either of the authors of the presentation (Peter Lundell and Robert Tjarnstrom) still at Ericsson? Does anyone know what became of this work, and if, as Mog suggests, there's any chance of having it see the light of day? I'm particularly interested in the VHDL implementation and testbench mentioned in the PowerPoint presentation, but documentation, attendant Erlang prototype code, notes, etc. would also be very welcome. -- Dan Moniz [http://pobox.com/~dnm/] From dnm@REDACTED Wed Dec 5 13:25:50 2007 From: dnm@REDACTED (Dan Moniz) Date: Wed, 05 Dec 2007 07:25:50 -0500 Subject: [erlang-questions] Erlang/OTP R12B-0 has been released References: Message-ID: On 05 Dec 2007 09:33:02 +0100, Bjorn Gustavsson wrote: >Major relese : otp_src_R12B-0 >Build date : 2007-12-04 > >R12B-0 is a major new release of Erlang/OTP. >You can download the full source distribution from > > http://www.erlang.org/download/otp_src_R12B-0.tar.gz > http://www.erlang.org/download/otp_src_R12B-0.readme Thanks to the Erlang/OTP team at Ericsson, and all external contributors for this release. Your hard work is appreciated. I'm particularly excited about the expanded functionality in the bit syntax. Thanks also to the HiPE team for their work! -- Dan Moniz [http://pobox.com/~dnm/] From mikpe@REDACTED Wed Dec 5 13:45:19 2007 From: mikpe@REDACTED (Mikael Pettersson) Date: Wed, 5 Dec 2007 13:45:19 +0100 (MET) Subject: [erlang-questions] FW: SMP VM DUMPING CORE Message-ID: <200712051245.lB5CjJSU012910@harpo.it.uu.se> On Wed, 5 Dec 2007 11:33:55 +0000, Rickard Green wrote: > Hi Rickard, > > On 04/12/2007, Rickard Green wrote: > > The 64-bit compiled smp emulator on sparc erroneously used the 32-bit > > implementation of atomic variables which caused it to crash. We didn't > > notice this since we currently aren't running any automated tests on > > 64-bit sparc. > > > > Unfortunately a fix for this issue will not make it into the R12B > > release. I will however post a source patch for R12B fixing this issue > > later. > > Is this fault likely to affect R11B-5 smp emulator running on Solaris > 10 on x86 hardware? No. The issue is primarily related to the CPU architecture, not the OS. Solaris/{x86,amd64} should be fine. From rvirding@REDACTED Wed Dec 5 13:53:49 2007 From: rvirding@REDACTED (Robert Virding) Date: Wed, 5 Dec 2007 13:53:49 +0100 Subject: [erlang-questions] Interfacing Prolog and Erlang In-Reply-To: References: Message-ID: <3dbc6d1c0712050453y6ca9bb7asfaacea73f0ed2534@mail.gmail.com> Seriously :-), how do you mean "interface"? Robert On 05/12/2007, Joel Reymont wrote: > > Has anyone interfaced Prolog with Erlang? > > Thanks, Joel > > -- > http://wagerlabs.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Wed Dec 5 13:56:55 2007 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 5 Dec 2007 12:56:55 +0000 Subject: [erlang-questions] Interfacing Prolog and Erlang In-Reply-To: <3dbc6d1c0712050453y6ca9bb7asfaacea73f0ed2534@mail.gmail.com> References: <3dbc6d1c0712050453y6ca9bb7asfaacea73f0ed2534@mail.gmail.com> Message-ID: <329D9913-5E13-4D0E-A601-DEFFB7E532BA@gmail.com> As in examples of code or approaches. ei in Prolog, sockets, etc. On Dec 5, 2007, at 12:53 PM, Robert Virding wrote: > Seriously :-), how do you mean "interface"? -- http://wagerlabs.com From rvirding@REDACTED Wed Dec 5 14:37:26 2007 From: rvirding@REDACTED (Robert Virding) Date: Wed, 5 Dec 2007 14:37:26 +0100 Subject: [erlang-questions] Interfacing Prolog and Erlang In-Reply-To: <329D9913-5E13-4D0E-A601-DEFFB7E532BA@gmail.com> References: <3dbc6d1c0712050453y6ca9bb7asfaacea73f0ed2534@mail.gmail.com> <329D9913-5E13-4D0E-A601-DEFFB7E532BA@gmail.com> Message-ID: <3dbc6d1c0712050537j7d570071x88a64a9d7691ddad@mail.gmail.com> I meant more what do you want to do with a Prolog interfaced to Erlang? I don't think that there is any real problem in getting Erlang to talk to Prolog, or vice-versa, but why? Apart from the fun of doing it. Is there a specific application or use you have in mind? Robert On 05/12/2007, Joel Reymont wrote: > > As in examples of code or approaches. ei in Prolog, sockets, etc. > > On Dec 5, 2007, at 12:53 PM, Robert Virding wrote: > > > Seriously :-), how do you mean "interface"? > > -- > http://wagerlabs.com > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.caune@REDACTED Wed Dec 5 14:41:28 2007 From: daniel.caune@REDACTED (Daniel Caune) Date: Wed, 5 Dec 2007 08:41:28 -0500 Subject: [erlang-questions] timestamp for pgsql In-Reply-To: <2ae2b2da0712041908g2e8b213o2923e136cdbd22e9@mail.gmail.com> Message-ID: <1E293D3FF63A3740B10AD5AAD88535D20693739B@UBIMAIL1.ubisoft.org> >In the current postgresql driver for erlang (I'm using the ejabberd-module >one because that's the one I got to work), how does one specify TIMESTAMP >values? > >ie if I do > >pgsql:prepare(Db, my_insert, "insert into foo_table (timestamp_column) >values ($1)"). > >what should I put in the subsequent call to > >pgsql:execute(Db, my_insert, [?????]) > You should be able to write something like this: pgsql:prepare(Db, my_insert, "insert into foo_table (timestamp_column) values ($1::timestamp)"). pgsql:execute(Db, my_insert, ["YYYY-MM-DD HH24:MN:SS"]). I'm not sure that "::timestamp" is very useful as I suppose PostgreSQL to do the conversion by its own. >P.S. I think the Junglerl pgsql driver is broken for prepared statements. Did you try pgsql:pquery? It works fine. -- Daniel From joelr1@REDACTED Wed Dec 5 14:42:40 2007 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 5 Dec 2007 13:42:40 +0000 Subject: [erlang-questions] Interfacing Prolog and Erlang In-Reply-To: <3dbc6d1c0712050537j7d570071x88a64a9d7691ddad@mail.gmail.com> References: <3dbc6d1c0712050453y6ca9bb7asfaacea73f0ed2534@mail.gmail.com> <329D9913-5E13-4D0E-A601-DEFFB7E532BA@gmail.com> <3dbc6d1c0712050537j7d570071x88a64a9d7691ddad@mail.gmail.com> Message-ID: <5086AE61-09E3-4F28-9FD6-A765206D6548@gmail.com> On Dec 5, 2007, at 1:37 PM, Robert Virding wrote: > Is there a specific application or use you have in mind? Dialog systems based on natural language. There's GoDIS [1] and its underlying TrindiKit. These use SICStus Prolog and I thought of hooking these up to Erlang. On a second thought, I don't have an extra 4K EUR for two SICStus licenses. I'll try to implement the dialog management engine in Erlang, using ERESYE [2] and lots of elbow grease. Joel [1] http://www.ling.gu.se/grupper/dialoglab/godis/ [2] http://sourceforge.net/projects/eresye -- http://wagerlabs.com From daniel.caune@REDACTED Wed Dec 5 15:01:11 2007 From: daniel.caune@REDACTED (Daniel Caune) Date: Wed, 5 Dec 2007 09:01:11 -0500 Subject: [erlang-questions] PostgreSQL driver In-Reply-To: <779bf2730711301719t56f3d35bmb87749d88313a99a@mail.gmail.com> Message-ID: <1E293D3FF63A3740B10AD5AAD88535D2069373D3@UBIMAIL1.ubisoft.org> >Shouldn't mysql also be considered together?? So erlang can get closer >toward having a general sql database interface like other languages.? Not >to pile on scope or anything :) That sounds like a good idea! When we started our project in my company, we didn't really know which RDBMS and which database driver we would have to use in production (PostgreSQL or MySQL, ODBC ANSI vs. ODBC Unicode vs. pgsql vs. etc.). We wrote a really (too) simple driver abstraction that we called EDBC for Erlang DataBase Connectivity and we were able to plug PostgreSQL ODBC OTP layer and pgsql driver. Now, if Erlang experienced people want to take the lead on implementing a serious database connectivity version, I will follow and help. -- Daniel From daniel.caune@REDACTED Wed Dec 5 15:06:15 2007 From: daniel.caune@REDACTED (Daniel Caune) Date: Wed, 5 Dec 2007 09:06:15 -0500 Subject: [erlang-questions] PostgreSQL driver In-Reply-To: <8209f740712020818q3f7208c1v7e09d5b452612e4b@mail.gmail.com> Message-ID: <1E293D3FF63A3740B10AD5AAD88535D2069373E2@UBIMAIL1.ubisoft.org> > -----Message d'origine----- > De?: erlang-questions-bounces@REDACTED [mailto:erlang-questions- > bounces@REDACTED] De la part de Ulf Wiger > Envoy??: dimanche, d?cembre 02, 2007 11:18 > ??: YC > Cc?: erlang-questions@REDACTED > Objet?: Re: [erlang-questions] PostgreSQL driver > > OTP supports ODBC, which is exactly that: a general sql database > interface. > {PostgreSQL ODBC driver, OTP} has a couple of issues. PostgreSQL ANSI ODBC driver doesn't support Unicode (that makes sense! :)). The PostgreSQL SQL Unicode works fine, but then {PostgreSQL ODBC driver, OTP} does not support some proprietary data types such as "timestamp with time zone". From joelr1@REDACTED Wed Dec 5 15:03:02 2007 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 5 Dec 2007 14:03:02 +0000 Subject: [erlang-questions] Using linked-in drivers to represent objects outside of Erlang Message-ID: Suppose I want to use a linked-in driver to talk to objects outside of Erlang. Am I correct that a driver instance would map to an object instance? Would this be efficient enough? I don't need to keep a list of objects inside the driver and have my Erlang code refer to them using some sort of a handle, do I? Thanks, Joel -- http://wagerlabs.com From mickael.remond@REDACTED Wed Dec 5 15:51:51 2007 From: mickael.remond@REDACTED (Mickael Remond) Date: Wed, 05 Dec 2007 15:51:51 +0100 Subject: [erlang-questions] PostgreSQL driver In-Reply-To: <1E293D3FF63A3740B10AD5AAD88535D2069373D3@UBIMAIL1.ubisoft.org> Message-ID: <20071205145232.80A4116720@heartbeat2.messagingengine.com> Hello Daniel, we have been toying with such a development as part of our work on ejabberd and can take the lead and maintenance if you would like to share the development. Christophe has already work on this kind of development and it take part of our work on maintening a reference pgsql and hopefully mysql driver implementation. Contact me privately if you need to share some thoughts or details. -- Mickael R?mond http://www.process-one.net/ ------- Message original ------- De: Daniel Caune Envoy?: 5.12.'07, 15:01 > >Shouldn't mysql also be considered together?? So erlang can get closer >toward having a general sql database interface like other languages.? Not > >to pile on scope or anything :) > > That sounds like a good idea! When we started our project in my company, we didn't really know which RDBMS and which database driver we would have to use in production (PostgreSQL or MySQL, ODBC ANSI vs. ODBC Unicode vs. pgsql vs. etc.). We wrote a really (too) simple driver abstraction that we called EDBC for Erlang DataBase Connectivity and we were able to plug PostgreSQL ODBC OTP layer and pgsql driver. > > Now, if Erlang experienced people want to take the lead on implementing a serious database connectivity version, I will follow and help. > > -- > Daniel > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From ft@REDACTED Wed Dec 5 15:56:07 2007 From: ft@REDACTED (Fredrik Thulin) Date: Wed, 05 Dec 2007 15:56:07 +0100 Subject: [erlang-questions] bug: R12B-0 can't compile YXA 1.0 Message-ID: <4756BC07.7010502@it.su.se> Hi Thanks for R12B-0. I found this problem though : $ tar xzf yxa-1.0.tar.gz $ cd yxa-1.0/src/ $ /pkg/erlang/R12B-0/bin/erlc -I include sipdialog.erl Function: test/0 ./sipdialog.erl:none: internal error in v3_codegen; crash reason: {{case_clause,{'EXIT',{{case_clause,[]}, [{v3_codegen,cg_binary_size_1,3}, {v3_codegen,cg_binary_size,5}, {v3_codegen,cg_binary,6}, {v3_codegen,set_cg,6}, {v3_codegen,'-cg_list/5-anonymous-0-',3}, {v3_codegen,flatmapfoldl,3}, {v3_codegen,cg_list,5}, {v3_codegen,cg_block,5}]}}}, [{compile,'-select_passes/2-anonymous-2-',2}, {compile,'-internal_comp/4-anonymous-1-',2}, {compile,fold_comp,3}, {compile,internal_comp,4}, {compile,internal,3}]} $ This is sipdialog.erl from YXA 1.0 (http://www.stacken.kth.se/project/yxa/download/yxa-1.0.tar.gz). /Fredrik From ft@REDACTED Wed Dec 5 16:36:16 2007 From: ft@REDACTED (Fredrik Thulin) Date: Wed, 05 Dec 2007 16:36:16 +0100 Subject: [erlang-questions] httpd_util:to_lower/1 in R12B-0 Message-ID: <4756C570.2080908@it.su.se> Hi The R12B-0 says that httpd_util:to_lower/1 is deprecated and will be removed in a future release, but it is apparently already removed. Note the D in httpd_util. There is a http_util:to_lower/1. I don't object to the new string:to_lower/1 and I have no problem at all in making this change to my code, and I may have made an extra sucky choice in using httpd_util:to_lower/1 instead of http_util:to_lower/1 (I blame someone else ;) ), but I would like to point out that the deprecation warning doesn't match reality. /Fredrik From rsaccon@REDACTED Wed Dec 5 17:55:35 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Wed, 5 Dec 2007 14:55:35 -0200 Subject: [erlang-questions] clarify: R12B-0 on mac: which libgd for installing percept ? Message-ID: on mac osx 10.5.1 when doing ./configure, I get: percept : libgd not found I installed libgd via macports: sudo port install gd2 and I still get the same error message. anyone knows how to solve this? -- Roberto Saccon http://rsaccon.com From anders.nygren@REDACTED Wed Dec 5 18:05:47 2007 From: anders.nygren@REDACTED (Anders Nygren) Date: Wed, 5 Dec 2007 11:05:47 -0600 Subject: [erlang-questions] clarify: R12B-0 on mac: which libgd for installing percept ? In-Reply-To: References: Message-ID: On Dec 5, 2007 10:55 AM, Roberto Saccon wrote: > on mac osx 10.5.1 when doing ./configure, I get: > > percept : libgd not found > > I installed libgd via macports: > > sudo port install gd2 > > and I still get the same error message. > > anyone knows how to solve this? > Is there a separate devel package that contains header files? In that case You need to install that also, and not just the binary package. /Anders From vinoski@REDACTED Wed Dec 5 17:45:00 2007 From: vinoski@REDACTED (Steve Vinoski) Date: Wed, 5 Dec 2007 11:45:00 -0500 Subject: [erlang-questions] configure errors with R12B-0 on OS X Leopard Message-ID: <65b2728e0712050845r8b922a0m95929e64bb6e7b2c@mail.gmail.com> On OS X Leopard, configure runs but issues a number of messages like this: rm: conftest.dSYM: is a directory This is apparently due to an autoconf issue on Leopard that's described here: I tried to manually apply the patches described there to the files under /usr/share/autoconf/autoconf and then running autoreconf at the top of the R12B-0 tree, but that caused the following warning messages: $ autoreconf --force configure.in:35: warning: AC_CONFIG_SUBDIRS: you should use literals /var/tmp/autoconf/autoconf-14~76/SRC/autoconf/lib/autoconf/status.m4:929: AC_CONFIG_SUBDIRS is expanded from... configure.in:35: the top level configure.in:35: warning: AC_CONFIG_SUBDIRS: you should use literals /var/tmp/autoconf/autoconf-14~76/SRC/autoconf/lib/autoconf/status.m4:929: AC_CONFIG_SUBDIRS is expanded from... configure.in:35: the top level configure.in:35: warning: AC_CONFIG_SUBDIRS: you should use literals /var/tmp/autoconf/autoconf-14~76/SRC/autoconf/lib/autoconf/status.m4:929: AC_CONFIG_SUBDIRS is expanded from... configure.in:35: the top level autoreconf: cannot create ${srcdir}/erts/autoconf: No such file or directory I still saw some of the "rm: conftest.dSYM: is a directory" messages even after patching and running autoreconf, maybe due to the above warnings. The patch discussion in the URL above also refers to a "fixed libtool" but I haven't found that yet -- maybe that's needed as well. These issues don't seem to prevent things from building correctly, though. With or without the patches, the resulting erl executable at least seems to start up and do simple things correctly. Has anyone else seen similar problems? Is this worth worrying about, and if so, what's the correct solution? --steve From rsaccon@REDACTED Wed Dec 5 18:27:20 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Wed, 5 Dec 2007 15:27:20 -0200 Subject: [erlang-questions] clarify: R12B-0 on mac: which libgd for installing percept ? In-Reply-To: References: Message-ID: On Dec 5, 2007 3:05 PM, Anders Nygren wrote: > On Dec 5, 2007 10:55 AM, Roberto Saccon wrote: > > on mac osx 10.5.1 when doing ./configure, I get: > > > > percept : libgd not found > > > > I installed libgd via macports: > > > > sudo port install gd2 > > > > and I still get the same error message. > > > > anyone knows how to solve this? > > > > Is there a separate devel package that contains header files? no, header file gets automatically installed with gd2 lib > In that case You need to install that also, and not just the > binary package. > > /Anders > -- Roberto Saccon http://rsaccon.com From dave.rafkind@REDACTED Wed Dec 5 18:37:16 2007 From: dave.rafkind@REDACTED (Dave Rafkind) Date: Wed, 5 Dec 2007 12:37:16 -0500 Subject: [erlang-questions] timestamp for pgsql In-Reply-To: <1E293D3FF63A3740B10AD5AAD88535D20693739B@UBIMAIL1.ubisoft.org> References: <2ae2b2da0712041908g2e8b213o2923e136cdbd22e9@mail.gmail.com> <1E293D3FF63A3740B10AD5AAD88535D20693739B@UBIMAIL1.ubisoft.org> Message-ID: <2ae2b2da0712050937y110ef79ex63e5f4526eb5712e@mail.gmail.com> I was hoping there was a way to give a timestamp from erlang using the output of erlang:now() but thanks for the information about strings. Also I'm using prepare/execute because I assume it is faster than pquery and because pquery hangs/timeouts for the queries I like to do. I'll put this info in the jungerl bug tracker on sourceforge also: For pgsql from jungerl (checked out Dec 3 2007), using PostGres 8.0.13/PostGis 1.1.4 psql> create table my_table (timestamp_column timestamp); psql> create table test_gps (message_id BIGSERIAL, occurrence TIMESTAMP, device_id VARCHAR, location GEOMETRY, speed REAL, heading REAL, info VARCHAR); Then in erlang using jungerl's pgsql: Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) 1> {ok, Db} = pgsql:connect("localhost", "tracker", "dave", ""). Params: [{secret,{5521,1197959615}}, {{parameter,"TimeZone"},"US/Eastern"}, {{parameter,"session_authorization"},"dave"}, {{parameter,"server_version"},"8.0.13"}, {{parameter,"server_encoding"},"SQL_ASCII"}, {{parameter,"is_superuser"},"off"}, {{parameter,"integer_datetimes"},"off"}, {{parameter,"DateStyle"},"ISO, MDY"}, {{parameter,"client_encoding"},"SQL_ASCII"}] {ok,<0.33.0>} 2> pgsql:prepare(Db, insert_point, "insert into test_gps (device_id, speed, heading, info, location) values ($1,$2,$3,$4,GeomFromText($5,-1))"). =ERROR REPORT==== 5-Dec-2007::12:09:08 === Error in process <0.33.0> with exit value: {{badrecord,dict},[{dict,get_slot,2},{dict,fetch,2},{lists,map,2},{pgsql_proto,idle,2}]} ** exited: {{badrecord,dict}, [{dict,get_slot,2}, {dict,fetch,2}, {lists,map,2}, {pgsql_proto,idle,2}]} ** 3> pgsql:prepare(Db, insert_point, "insert into my_table (timestamp_column) values ($1)"). timeout 4> pgsql:pquery(Db, "insert into my_table (timestamp_column) values ($1)", ["2000-01-01 12:43:23"]). timeout 5> pgsql:pquery(Db, "insert into test_gps (device_id, speed, heading) values ($1,$2,$3)", ["abc", 45, 54]). timeout NOTE: The pgsql:prepare and a subsequent pgsql:execute works in the pgsql from ejabberd-modules. The pgsql:pquery calls always time out. pgsql:squery calls usually work though. On Dec 5, 2007 8:41 AM, Daniel Caune wrote: > >In the current postgresql driver for erlang (I'm using the > ejabberd-module >one because that's the one I got to work), how does one > specify TIMESTAMP >values? > > > >ie if I do > > > >pgsql:prepare(Db, my_insert, "insert into foo_table (timestamp_column) > >values ($1)"). > > > >what should I put in the subsequent call to > > > >pgsql:execute(Db, my_insert, [?????]) > > > > You should be able to write something like this: > > pgsql:prepare(Db, my_insert, "insert into foo_table (timestamp_column) > values ($1::timestamp)"). > pgsql:execute(Db, my_insert, ["YYYY-MM-DD HH24:MN:SS"]). > > I'm not sure that "::timestamp" is very useful as I suppose PostgreSQL > to do the conversion by its own. > > >P.S. I think the Junglerl pgsql driver is broken for prepared > statements. > > Did you try pgsql:pquery? It works fine. > > -- > Daniel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmercer@REDACTED Wed Dec 5 18:37:25 2007 From: dmercer@REDACTED (David Mercer) Date: Wed, 5 Dec 2007 11:37:25 -0600 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: <3dbc6d1c0712041833ofd3447ckb73ffef560d2e494@mail.gmail.com> References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com><3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com><361FB8EB-0C84-480D-93B3-914C8E15C771@local><3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com><779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> <3dbc6d1c0712041833ofd3447ckb73ffef560d2e494@mail.gmail.com> Message-ID: <012b01c83765$809879c0$891ea8c0@SSI.CORP> On Tuesday, December 04, 2007, Robert Virding wrote: What I want is something which *is* lisp even though it a lisp which has been designed to work seamlessly together with *normal* Erlang. So it is more than just wrapping ( ... ) around expressions after converting them into prefix form. So, for example, there are no syntactic variables, you quote things which you don't want to evaluate. So to comment some of you examples: I like your idea. Is your idea to compile Lersp to Erlang or straight to the virtual machine (BEAM files?)? Cheers, David _____ From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Robert Virding Sent: Tuesday, December 04, 2007 20:34 To: YC Cc: Denis; Erlang-Questions (E-mail) Subject: Re: [erlang-questions] Lisp syntax for Erlang On 04/12/2007, YC wrote: IMHO, the issues above arise from the goal being unclear: is it a lispy syntax for erlang or is it a lisp in erlang? I have tried to be clear, but obviously not succeeded. I am going to do a lisp syntax for Erlang, not implement CL or Scheme which, by the way, is *very* difficult on the BEAM today. That is the main problem as I have to invent lisp constructions which match into Erlang. If it's a lispy syntax, IMO a prefix<->infix transformer can handle a lot of cases (below uses vector for tuples): What I want is something which *is* lisp even though it a lisp which has been designed to work seamlessly together with *normal* Erlang. So it is more than just wrapping ( ... ) around expressions after converting them into prefix form. So, for example, there are no syntactic variables, you quote things which you don't want to evaluate. So to comment some of you examples: %% Erlang => ErlangInLisp A + 1, => (+ A 1) A = 5. => (= A 5). This will become a (let ((a 5)) ... ). Let will be extended to match [foo | bar] => (| foo bar) (cons 'foo 'bar) Pid ! Data => (! Pid Data) (send pid data) ;Using symbols can sometimes be harder to read A = {foo, bar}. => (= A #(foo bar)) %% or (= A {foo bar}) (either works fine, but vector version appears more uniform and in spirit of lisp) (let ((a #('foo 'bar))) ... ) ;or '#(foo bar) here fun(A) -> A + 1. => (lambda (A) (+ A 1)) %% I think fun is fine. Agree case A of foo -> {foo}; bar -> {foo, bar} end. => (case A ((foo) bar) ((bar) #(foo bar))) As yours but quoted: (case a ('foo #('bar)) ('bar #('foo 'bar))) foo(1) -> 2; foo(abc) -> {foo, bar}. => (defun foo ((1) 2) ((abc) #(foo bar))) I was more into: (defun foo (arg) (case arg (1 2) (abc '#(foo bar)))) {ok, B} = mod:fun(). => (= #(ok B) (mod:fun)) or (= {ok B} ((: mod fun))) (let ((#('ok b) (: mod fun))) ... ) ;see below And keep the rest of the erlang syntax such as Camel casing for variable, pattern matching built-in default, bare words as atoms unless at the the head of a list (or unless in special syntax such as case), etc. One feature of lisp we must keep is that code has he same form as data, *is* data. That means that if we keep the Camel casing for variables then they have to parse to something other than symbols. If they don't then we will forever be parsing symbol names to discern what they are. That is why I would prefer to use the lisp convention of evaluating everything *except* that which is quoted. That means even using quotes in patterns. The issue with (remote-call) is that it's tedious. Think of having to write that for all function calls that don't live in the current module namespace. And it also takes on meaning of apply/3. If mod:fun(Args) is writtten as (remote-call mod fun Args), then how to write apply/3? Should we write apply(mod, fun, Args) as (apply (remote-call mod fun Args))?? Then it's apply/1. Probably better to have remote-call take on the meaning of apply/3. I don't think all function calls should go through apply. My current working model is: mod:fun(, , ) ==> (module-call 'mod 'fun ) Mod:fun(, , ) ==> (module-call mod 'fun ) Mod:Fun(, , ) ==> (module-call mod fun ) with (: mod fun ) as a macro for the 1st most common case. It smiles at you because it feels good to be so helpful. You will still need apply: apply(Fun, ArgList) ==> (apply fun arglist) apply(Mod, Fun, ArgList) ==> (apply mod fun arglist) Apply and module-call are proper functions which evaluate their arguments, : is a macro which doesn't evaluate its first two arguments, the module name and function name, but does evaluate the function arguments. We'll see where it all ends up, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From wglozer@REDACTED Wed Dec 5 19:11:17 2007 From: wglozer@REDACTED (Will) Date: Wed, 5 Dec 2007 10:11:17 -0800 Subject: [erlang-questions] Erlang/OTP R12B-0 has been released In-Reply-To: References: Message-ID: On 05 Dec 2007 09:33:02 +0100, Bjorn Gustavsson wrote: > Major relese : otp_src_R12B-0 > Build date : 2007-12-04 > > R12B-0 is a major new release of Erlang/OTP. > You can download the full source distribution from Thanks OTP team! This is a *really* exciting release, particularly the rewrite of SSL, new binary syntax, and portable threading in drivers! And SMP on Windows too, wow, amazing job =) -Will From ellisonbg.net@REDACTED Wed Dec 5 19:24:57 2007 From: ellisonbg.net@REDACTED (Brian Granger) Date: Wed, 5 Dec 2007 11:24:57 -0700 Subject: [erlang-questions] Erlang for GPUs In-Reply-To: References: <200711211858.lALIwuMG018748@morgoth.cslab.ericsson.net> <1195672232.4764.4.camel@metalman.lan> Message-ID: <6ce0ac130712051024i5be3aba5g36050da654c4a60@mail.gmail.com> We are working on GPU libraries for a number of other languages and Erlang might be another interesting target. But, does Erlang have array/vector/matrix classes that 1) are represented by continguous memory blocks 2) have elements that correspond the standard C datatypes int, float, etc. This would be needed to interface with a GPU. Brian On Dec 5, 2007 5:17 AM, Dan Moniz wrote: > > On Wed, 21 Nov 2007 13:10:31 -0600, mog wrote: > > >On Wed, 2007-11-21 at 19:58 +0100, dfeustel@REDACTED wrote: > >> Are there any Erlang Compilers that generate code for > >> upcoming GPUs from Nvidia and ATI? > >No. > > > >however there was ecomp, http://www.erlang.se/euc/00/processor.ppt , > >which was a erlang vm for an fpga, however, it was never released to the > >public :(, i think we should continue to poll ericcson and erlang team > >to release it. Please!!! > > Interesting find Mog! Thanks for the link to the PowerPoint > presentation. I had recently been thinking about Erlang and hardware > designs, so this is a welcome discovery. > > Kenneth, Bjorn, Joe, or Robert: > > Are either of the authors of the presentation (Peter Lundell and Robert > Tjarnstrom) still at Ericsson? Does anyone know what became of this > work, and if, as Mog suggests, there's any chance of having it see the > light of day? I'm particularly interested in the VHDL implementation and > testbench mentioned in the PowerPoint presentation, but documentation, > attendant Erlang prototype code, notes, etc. would also be very welcome. > > > -- > Dan Moniz [http://pobox.com/~dnm/] > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From kip.macy@REDACTED Wed Dec 5 20:51:26 2007 From: kip.macy@REDACTED (Kip Macy) Date: Wed, 5 Dec 2007 11:51:26 -0800 Subject: [erlang-questions] kqueue support In-Reply-To: <4755526A.5030508@lionet.info> References: <000201c82ab8$34b55ff0$e600000a@users.rbc.ru> <4755526A.5030508@lionet.info> Message-ID: On Dec 4, 2007 5:13 AM, Lev Walkin wrote: > > We've been using this patch in a loaded production 6.1 > system for a couple of weeks already. I think this > validates its stability. The pipe fix was applied to RELENG_7, RELENG_6, and RELENG_6_3 10 days ago. Thus erlang should work on FreeBSD from any of those branches after that date, -Kip > > George B Hazan wrote: > > Hello. > > > > Is it possible to enable the kqueue support in erlang under FreeBSD > > 6.2-STABLE #13? Note says that 5.2 & 5.3 have some problems with kqueue, but > > maybe new versions are more stable? At least a lot of software uses it under > > FreeBSD without problems... The problem is that ejabberd uses 60% of cpu > > under 1000 http-bind connections, and kqueue is known to be a great CPU > > saver. > > > > Right now I got the following error: > > ============== 8< ============== >8 ============== > > checking for working poll()... ok > > checking whether kqueue() is known to be broken... yes; FreeBSD > > implementation > > checking whether kernel poll support should be enabled... configure: error: > > no; kernel poll support requested but not found > > configure: error: /bin/sh > > '/usr/local/ports/work/usr/ports/lang/erlang/work/otp_src_R11B-5/erts/configure' > > failed for erts > > ============== 8< ============== >8 ============== > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From yinso.chen@REDACTED Wed Dec 5 21:03:16 2007 From: yinso.chen@REDACTED (YC) Date: Wed, 5 Dec 2007 12:03:16 -0800 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: <3dbc6d1c0712041833ofd3447ckb73ffef560d2e494@mail.gmail.com> References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <361FB8EB-0C84-480D-93B3-914C8E15C771@local> <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> <779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> <3dbc6d1c0712041833ofd3447ckb73ffef560d2e494@mail.gmail.com> Message-ID: <779bf2730712051203jf842dcdhab154cf573250972@mail.gmail.com> On Dec 4, 2007 6:33 PM, Robert Virding wrote: > I have tried to be clear, but obviously not succeeded. I am going to do a > lisp syntax for Erlang, not implement CL or Scheme which, by the way, is > *very* difficult on the BEAM today. That is the main problem as I have to > invent lisp constructions which match into Erlang. > > What I want is something which *is* lisp even though it a lisp which has > been designed to work seamlessly together with *normal* Erlang. So it is > more than just wrapping ( ... ) around expressions after converting them > into prefix form. So, for example, there are no syntactic variables, you > quote things which you don't want to evaluate. So to comment some of you > examples: > Sorry - my turn of being unclear - to me a lispy syntax for erlang is *not necessarily* a lisp, and hence why I made the distinction. I know you are not implementing CL or Scheme, hence I raise the point of either following erlang's design or leverage their (CL or scheme's) designs (which you mostly have done except a few places). But fair enough - you want a lisp that compiles to erlang. %% Erlang => ErlangInLisp > > A + 1, => (+ A 1) > > A = 5. => (= A 5). > > > > This will become a (let ((a 5)) ... ). Let will be extended to match > I like the (let ...) form as well. I did find I write assignment code because the order is important, so (let* ...) form might be necessary as well - but that could be just me. > [foo | bar] => (| foo bar) > > > > (cons 'foo 'bar) > > Pid ! Data => (! Pid Data) > > > > (send pid data) ;Using symbols can sometimes be harder to read > If you offer macro it's fine either way - I think termite uses ! for send. I do like erlang/haskell here for their terse syntax - cons gets unwieldy if there are many of them - .e.g (cons 'a (cons 'b (cons 'c 'd))) vs [a,b,c | d]. As yours but quoted: > (case a > ('foo #('bar)) > ('bar #('foo 'bar))) > The one I wrote was scheme's version. It can match multiple bindings with one clause, but that can make it harder to transform into erlang. > > foo(1) -> 2; foo(abc) -> {foo, bar}. => (defun foo ((1) 2) ((abc) #(foo > > bar))) > > > > I was more into: > > (defun foo (arg) > (case arg > (1 2) > (abc '#(foo bar)))) > To me this is where the basic lisp language doesn't offer as much as erlang. Ability to match on the function head is a very nice syntactic sugar - it *just* look better than case statements, especially with recursions. In scheme with pattern matching lib (below is PLT scheme) one can write (require (lib "match.ss")) (define foo (match-lambda ;; or match-lambda* that can have different arities (1 2) ('abc #(foo bar)))) So with macros you can get pattern matching back, but why hide it in the first place? > One feature of lisp we must keep is that code has he same form as data, > *is* data. That means that if we keep the Camel casing for variables then > they have to parse to something other than symbols. If they don't then we > will forever be parsing symbol names to discern what they are. That is why I > would prefer to use the lisp convention of evaluating everything *except* > that which is quoted. That means even using quotes in patterns. > Given you want a lisp instead of just lispy syntax - it makes sense. I do think it's about symbol lookup rather than parsing. Erlang uses upper/lower case to distinguish between which symbol table you need to lookup - that's a shorthand, I guess. You can certainly have only one symbol table for the most current bindings without distinguish between cases or keywords - that's closer to a lisp/1 :) My current working model is: > > mod:fun(, , ) ==> (module-call 'mod 'fun > ) > Mod:fun(, , ) ==> (module-call mod 'fun > ) > Mod:Fun(, , ) ==> (module-call mod fun > ) > > with (: mod fun ) as a macro for the 1st most common > case. It smiles at you because it feels good to be so helpful. > This is where I think the module-call style overlaps with apply/3. Consider the following calls Direct local call: fun1(A1, A2, A3). Direct module call: mod:fun1(A1, A2, A3). Indirect (Fun) local call: F1 = fun fun1/3, F1(A1, A2, A3). Indirect module call: F1 = fun mod:fun1/3, F1(A1, A2, A3). Apply/2 local: apply(fun fun1/3, [A1, A2, A3]). Apply/3 module: apply(mod, fun1, [A1, A2, A3]). In all but one case (apply/3), we are working with the function object directly (either with a direct syntax or creating a Fun reference). I.e., the only place we lookup the function via atoms and evaluate it at the same time is in apply/3. The (module-call ...) is basically equivalent to apply/3 - you pass in atom for mod & fun and with that it looks up the function object AND evaluate the function at the same time. That's why I said it's tedious to do so for all module calls as it basically means we are writing apply for all module calls. To map against erlang - your lisp can "lookup and return" the function object for use, say: (fun 'fun1) ;; returns local # (: fun1) ;;; shorthand - the same as fun1, so this form is unnecessary (fun 'mod 'fun1) ;;; returns # (: mod fun1) ;; for short hand as you say ;;; honestly - mod:fun1 isn't that bad if you allow : to be a package separator as in CL. I generally end up faking it in scheme anyways. Then the above becomes: (fun a1 a2 a3) ;;; same for indirect call ((: mod fun1) a1 a2 a3) ;; same for indirect call (apply (: mod fun1) (list a1 a2 a3)) ;;; apply/2 (apply 'mod 'fun1 (list a1 a2 a3)) ;;; apply/3 It looks similar but has a different semantic and IMHO more closely correspond to erlang. Lastly - I think your idea is interesting and the above are my 2 cents of input to your goal, hopefully it helps more than it hurts :) p.s. did you see Mark Feely's scheme to erlang? It might provide some inspirations. http://www.erlang.org/pipermail/erlang-questions/2007-June/027057.html Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: From rsaccon@REDACTED Wed Dec 5 21:07:09 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Wed, 5 Dec 2007 18:07:09 -0200 Subject: [erlang-questions] Clarify: does R12B ssl listener accept existing socket ? In-Reply-To: References: Message-ID: nobody answered, but now that R12B has been released, just asking again ... On Nov 28, 2007 1:01 PM, Roberto Saccon wrote: > I took a look at the sources, saw that ssl has been completely > rewritten, but did not manage to understand, whether and how it is > possible to pas an existing file descriptor (e.g.: provided by > fd_server) of an open socket to the ssl listener. > > regards > -- > Roberto Saccon > http://rsaccon.com > -- Roberto Saccon http://rsaccon.com From rsaccon@REDACTED Wed Dec 5 21:12:23 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Wed, 5 Dec 2007 18:12:23 -0200 Subject: [erlang-questions] clarify: R12B-0 on mac: which libgd for installing percept ? In-Reply-To: References: <3a344bc70712050939x464c4bf6k75346ec3f7ba9cd1@mail.gmail.com> Message-ID: bringing the discussion back to the list (it happens that people just to reply to the sender): Of course I also tried with --prefix=/opt/local, unfortunately it still doesn't find that libgd On Dec 5, 2007 4:18 PM, Roberto Saccon wrote: > I tried with --prefix=/opt/local, unfortunately it still didn't find that libgd > > > > On Dec 5, 2007 3:39 PM, Johan Liseborn wrote: > > On Dec 5, 2007 5:55 PM, Roberto Saccon wrote: > > > on mac osx 10.5.1 when doing ./configure, I get: > > > > > > percept : libgd not found > > > > > > I installed libgd via macports: > > > > > > sudo port install gd2 > > > > > > and I still get the same error message. > > > > > > anyone knows how to solve this? > > > > Maybe you need to, somehow, tell the configuration procedure where to > > find libgd (and its headers), e.g. using -I and -L flags at > > appropriate places (as, I believe, MacPorts installs things in > > "non-standard places", e.g. /opt/local)? > > > > > > Cheers, > > > > johan > > > > -- > > Johan Liseborn > > > > > > > -- > Roberto Saccon > http://rsaccon.com > -- Roberto Saccon http://rsaccon.com From michael.regen@REDACTED Wed Dec 5 21:20:36 2007 From: michael.regen@REDACTED (Michael Regen) Date: Wed, 5 Dec 2007 21:20:36 +0100 Subject: [erlang-questions] wow: MD5 broken In-Reply-To: <9b59d0270712030430s1f32c606tf10d21d5588eb9d1@mail.gmail.com> References: <1196673382.6601.17.camel@gnatziu.crs4.it> <200712031007.lB3A7Yhm097654@pluto.hedeland.org> <9b59d0270712030430s1f32c606tf10d21d5588eb9d1@mail.gmail.com> Message-ID: <9b59d0270712051220m64afbf2fofcf7ee2b46152c1c@mail.gmail.com> On Dec 3, 2007 1:30 PM, Michael Regen wrote: > On Dec 3, 2007 11:07 AM, Per Hedeland wrote: > > > Then again, everyone seems to think that the > > Erlang distribution is inherently unsafe anyway (for reasons that aren't > > > > obvious to me at least)... > > > > --Per Hedeland > > > > I can just talk about myself. And I simply do not know whether it is safe > or not. I have not seen any reviews of it, neither bad nor good ones and I > assume that its ability to withstand attacks is not tested much because I > assume that most Erlang nodes are operated in a safe environment. Remember, > even OpenSSH had it's troubles. One of the design goals of OpenSSH was to > operate it in the wild. I do not know whether this was also one of the > design goals of Erlang distribution. I tend to deny this since I read > distribution_handshake.txt ("This is not entirelly safe, as it is vulnerable > against takeover attacks, but it is a tradeoff between fair safety and > performance."). > Erlang SSL distribution is currently broken. You cannot control which IP > address epmd binds to... > > I think in the area of IT security you have to choose the defensive > approach. You need a proof or very good hints that something is secure > before you can assume it to be secure. Therefore I handle Erlang > distribution as if it were unsafe. > > By the way I am only referring to open source Erlang. I cannot say > anything about the commercial version of Erlang. > > Cheers, > Michael > > Maybe already a bit off topic, however: The most simple form of a denial of service attack consists of sending the bytes 0x00, 0x01, 0x6B to your epmd port causing epmd to shut down, rendering all nodes on this system unavailable for subsequent connection attempts of new distributed nodes. Established connections are not affected, I think. Heart does not help here. Also restarting epmd does not help except you find a way to re-register your running nodes to epmd (which is possible I guess). Cheers, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From james.hague@REDACTED Wed Dec 5 21:27:05 2007 From: james.hague@REDACTED (James Hague) Date: Wed, 5 Dec 2007 14:27:05 -0600 Subject: [erlang-questions] werl.exe and window placement Message-ID: Back in 2004 I got annoyed at werl.exe (the GUI console for Erlang under Windows) not remembering window size/position and the state of the toolbar, so I wrote a patch for it. Unfortunately, I made a classic Windows programming error: the function I used to get the window data returned invalid values if the window was minimized. If you exited werl when the window was open, everything was fine. But if you exited werl when the window was *minimized*, then the next time you ran werl you got a taskbar button but no window. As a result, part of the patch was pulled in the next release, but the toolbar state saving lives on in R12B. I'm now using OS X for most programming, so I'm not in a position to redo this the right way, but *surely* someone else out there can? All you need is to use a different call to get window data, one I can never remember the name of :) This usability issue has gone on for far too long! James From michael.regen@REDACTED Wed Dec 5 21:29:08 2007 From: michael.regen@REDACTED (Michael Regen) Date: Wed, 5 Dec 2007 21:29:08 +0100 Subject: [erlang-questions] clarify: R12B-0 SSL documentation gone. Status of SSL? Message-ID: <9b59d0270712051229t327e5b9cqc5ff12af8a638470@mail.gmail.com> Hi, First of all, let me express that I really appreciate what the whole Erlang and OTP team is doing! Great work! Just a small bug or I missed something: The SSL documentation is gone. Can we get it back? What are the changes? Or does that mean that SSL is currently undocumented and we should not use it currently? Thank you! Cheers, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth.lundin@REDACTED Wed Dec 5 21:40:28 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Wed, 5 Dec 2007 21:40:28 +0100 Subject: [erlang-questions] clarify: R12B-0 SSL documentation gone. Status of SSL? In-Reply-To: <9b59d0270712051229t327e5b9cqc5ff12af8a638470@mail.gmail.com> References: <9b59d0270712051229t327e5b9cqc5ff12af8a638470@mail.gmail.com> Message-ID: Hi, We just discovered that the SSL documentation is missing by mistake. We will make it available as soon as possible. /Regards Kenneth Erlang/OTP team at Ericsson On Dec 5, 2007 9:29 PM, Michael Regen wrote: > Hi, > > First of all, let me express that I really appreciate what the whole Erlang > and OTP team is doing! Great work! > > Just a small bug or I missed something: The SSL documentation is gone. Can > we get it back? What are the changes? Or does that mean that SSL is > currently undocumented and we should not use it currently? > > Thank you! > > Cheers, > Michael > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From michael.regen@REDACTED Wed Dec 5 21:44:48 2007 From: michael.regen@REDACTED (Michael Regen) Date: Wed, 5 Dec 2007 21:44:48 +0100 Subject: [erlang-questions] clarify: R12B-0 on windows: percept missing? Message-ID: <9b59d0270712051244jc925ebcg61a1d1bce747bbb1@mail.gmail.com> Hi, Did I miss something or are percept and edg missing in the windows binaries? Probably not a big deal to build them from the sources. Thank you! Cheers, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn@REDACTED Wed Dec 5 21:51:10 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 05 Dec 2007 21:51:10 +0100 Subject: [erlang-questions] clarify: R12B-0 SSL documentation gone. Status of SSL? In-Reply-To: <9b59d0270712051229t327e5b9cqc5ff12af8a638470@mail.gmail.com> References: <9b59d0270712051229t327e5b9cqc5ff12af8a638470@mail.gmail.com> Message-ID: "Michael Regen" writes: > Hi, > > First of all, let me express that I really appreciate what the whole Erlang > and OTP team is doing! Great work! > > Just a small bug or I missed something: The SSL documentation is gone. Can > we get it back? What are the changes? Or does that mean that SSL is > currently undocumented and we should not use it currently? It was a build problem (the ssl and crypto applications were skipped because no suitable openSSL lib was found, even though it was not actually needed to build the documentation). Unfortunately we didn't notice the problem in time. We hope to have the documentation for ssl and crypto back on-line tomorrow. We will also update the documentation tar file. Sorry for the inconvenience. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From mateuszb@REDACTED Wed Dec 5 22:33:29 2007 From: mateuszb@REDACTED (Mateusz Berezecki) Date: Wed, 5 Dec 2007 22:33:29 +0100 Subject: [erlang-questions] bug: R12B-0 fix (MacOS X Leopard specific) Message-ID: <868BA2AA-04C8-4907-8625-31A1F26E52FA@gmail.com> Hello list There is a bug in R12B-0 compilation process with --enable-hipe flag The file erts/emulator/hipe/hipe_x86_signal.c contains a structure sigaltstack which is obsolete. Replace line 259 in that file to contain stack_t ss; regards, Mateusz Berezecki From igwan@REDACTED Wed Dec 5 18:25:23 2007 From: igwan@REDACTED (igwan) Date: Wed, 05 Dec 2007 18:25:23 +0100 Subject: [erlang-questions] doc: error in the example for bit string comprehension Message-ID: <4756DF03.9040101@free.fr> Hi The example given in 6.23 of the Erlang Reference Manual in R12B-0 reads : 1> *<< << X*2 >> || <> <= << 1,2,3 >> >>.* <<2,4,6>> But it gives the error : * 1: syntax error before: '*' It seems that the parenthesis around X*2 were ommited 1> << << (X*2) >> || <> <= << 1,2,3 >> >>. <<2,4,6>> works as expected. Many thanx to the OTP team for this new release! -- igwan From erlang@REDACTED Thu Dec 6 00:18:56 2007 From: erlang@REDACTED (Dominic Williams) Date: Thu, 06 Dec 2007 00:18:56 +0100 Subject: [erlang-questions] clarify: why is Mnesia not fit for large databases Message-ID: <475731E0.3090104@dominicwilliams.net> Hello, In the recent discussion about BDB, several prominent members of the community were of the opinion that Mnesia is not fit for large databases. Is this still the case with fragmented tables? It was also suggested that for large volumes of stored, rarely consulted data, something like mysql is better, and Mnesia should be kept for realtime session data. What about when the realtime session tables are getting huge? Any reason not to use Mnesia in that case? Can someone clarify in what precisely makes Mnesia unfit for large databases? Is it scalability? Bugs? Maintenance hell? Thanks, Dominic Williams http://dominicwilliams.net ---- From roger.larsson@REDACTED Thu Dec 6 02:38:13 2007 From: roger.larsson@REDACTED (Roger Larsson) Date: Thu, 6 Dec 2007 02:38:13 +0100 Subject: [erlang-questions] R12B-0 HiPE option no_remove_comments Message-ID: <200712060238.13619.roger.larsson@norran.net> I have a script that can be used to look at hipe steps. ---- #!/bin/sh erlc +native +\{hipe,\[no_remove_comments,pp_all\]\} $1 ---- fac.erl -module(fac). -export([fac/2]). fac(A,0)->A; fac(A,N)->fac(A*N,N-1). ---- This does not work in R12B, it is the no_remove_comments fault. bash> ./get_icode.sh fac.erl label 1: {func_info,{atom,fac},{atom,fac},2} label 2: {test,is_eq_exact,{f,3},[{x,1},{integer,0}]} return label 3: {gc_bif,'*',{f,0},2,[{x,0},{x,1}],{x,0}} {gc_bif,'-',{f,0},2,[{x,1},{integer,1}],{x,1}} {call_only,2,{fac,fac,2}} fac:fac/2(v0, v5) -> %% Info:['Not a closure','Leaf function'] 1: _ := redtest() (primop) if is_{integer,0}(v5) then 3 (0.50) else 6 3: return(v0) 6: v0 := '*'(v0, v5) (primop) v8 := 1 v5 := '-'(v5, v8) (primop) % self_tail_recursive goto 1 %% Data: EXITED with reason {{case_clause, {comment,self_tail_recursive}},[{hipe_icode_range,analyse_insn,3}, {hipe_icode_range,analyse_BB,5},{hipe_icode_range,analyse_block,4}, {hipe_icode_range,analyse_blocks,3},{hipe_icode_range,analyse,2}, {hipe_icode_range,do_analysis,3},{hipe_icode_range,concurrent_cfg,4}, {hipe_main,icode_range_analysis,3}]} @hipe:907 =ERROR REPORT==== 6-Dec-2007::02:31:49 === Error: [hipe:906]: ERROR: {{case_clause, {comment,self_tail_recursive}}, [{hipe_icode_range,analyse_insn,3}, {hipe_icode_range,analyse_BB,5}, {hipe_icode_range,analyse_block, 4}, {hipe_icode_range, analyse_blocks,3}, {hipe_icode_range,analyse,2}, {hipe_icode_range,do_analysis,3}, {hipe_icode_range, concurrent_cfg,4}, {hipe_main,icode_range_analysis, 3}]} =ERROR REPORT==== 6-Dec-2007::02:31:49 === Error in process <0.27.0> with exit value: {{hipe,907,{{case_clause, {comment,self_tail_recursive}},[{hipe_icode_range,analyse_insn,3}, {hipe_icode_range,analyse_BB,5},{hipe_icode_range,analyse_block,4}, {hipe_icode_range,analyse_blocks,3},{hipe_icode_range,analyse... ./fac.erl:none: internal error in native_compile; crash reason: {{hipe,907, {{case_clause,{comment,self_tail_recursive}}, [{hipe_icode_range,analyse_insn,3}, {hipe_icode_range,analyse_BB,5}, {hipe_icode_range,analyse_block,4}, {hipe_icode_range,analyse_blocks,3}, {hipe_icode_range,analyse,2}, {hipe_icode_range,do_analysis,3}, {hipe_icode_range,concurrent_cfg,4}, {hipe_main,icode_range_analysis,3}]}}, [{hipe,finalize_fun_sequential,2}, {hipe,'-finalize_fun_concurrent/2-fun-3-',3}]} But there is a remove_comments option! erl> hipe:help_options(). HiPE Compiler Options Boolean-valued options generally have corresponding aliases `no_...', - - - o2 = {'O',2} = [rtl_lcm,icode_range,icode_ssa_const_prop, icode_ssa_copy_prop,icode_ssa_struct_reuse,icode_type, icode_inline_bifs,rtl_ssa,rtl_ssa_const_prop, spillmin_color,use_indexing,remove_comments, concurrent_comp] ++ o1, /RogerL From rsaccon@REDACTED Thu Dec 6 05:05:54 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Thu, 6 Dec 2007 02:05:54 -0200 Subject: [erlang-questions] clarify: R12B-0 on mac: which libgd for installing percept ? In-Reply-To: <8EB58E93-4F00-45AD-8225-C51356269D80@sbcglobal.net> References: <3a344bc70712050939x464c4bf6k75346ec3f7ba9cd1@mail.gmail.com> <8EB58E93-4F00-45AD-8225-C51356269D80@sbcglobal.net> Message-ID: On Dec 6, 2007 1:55 AM, Greg Wuller wrote: > > On Dec 5, 2007, at 12:12 PM, Roberto Saccon wrote: > > > bringing the discussion back to the list (it happens that people just > > to reply to the sender): > > > > Of course I also tried with --prefix=/opt/local, unfortunately it > > still doesn't find that libgd > > > Is gdlib-config in your path? yes > > I just downloaded, built, and installed (into /usr/local) libgd from > source; after that percept built without problem. (Mac OS X 10.5.1 on > PPC with erlang installing into /opt/erlang/R12B-0) thanks, will go that route, if I really can't get it working with macport's libgd > > -greg > > > -- Roberto Saccon http://rsaccon.com From dave.rafkind@REDACTED Thu Dec 6 05:39:59 2007 From: dave.rafkind@REDACTED (Dave Rafkind) Date: Wed, 5 Dec 2007 23:39:59 -0500 Subject: [erlang-questions] clarify: why is Mnesia not fit for large databases In-Reply-To: <475731E0.3090104@dominicwilliams.net> References: <475731E0.3090104@dominicwilliams.net> Message-ID: <2ae2b2da0712052039h114dbc99r7bb1e493e3f89d4a@mail.gmail.com> AFAIK mnesia has a hardcoded 2GB limit somewhere due to using 32-bit values in some important place. On Dec 5, 2007 6:18 PM, Dominic Williams wrote: > Hello, > > In the recent discussion about BDB, several prominent > members of the community were of the opinion that Mnesia is > not fit for large databases. > > Is this still the case with fragmented tables? > > It was also suggested that for large volumes of stored, > rarely consulted data, something like mysql is better, and > Mnesia should be kept for realtime session data. > > What about when the realtime session tables are getting > huge? Any reason not to use Mnesia in that case? > > Can someone clarify in what precisely makes Mnesia unfit for > large databases? Is it scalability? Bugs? Maintenance hell? > > > Thanks, > > Dominic Williams > http://dominicwilliams.net > > ---- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ngwese-list@REDACTED Thu Dec 6 04:55:34 2007 From: ngwese-list@REDACTED (Greg Wuller) Date: Wed, 5 Dec 2007 19:55:34 -0800 Subject: [erlang-questions] clarify: R12B-0 on mac: which libgd for installing percept ? In-Reply-To: References: <3a344bc70712050939x464c4bf6k75346ec3f7ba9cd1@mail.gmail.com> Message-ID: <8EB58E93-4F00-45AD-8225-C51356269D80@sbcglobal.net> On Dec 5, 2007, at 12:12 PM, Roberto Saccon wrote: > bringing the discussion back to the list (it happens that people just > to reply to the sender): > > Of course I also tried with --prefix=/opt/local, unfortunately it > still doesn't find that libgd Is gdlib-config in your path? I just downloaded, built, and installed (into /usr/local) libgd from source; after that percept built without problem. (Mac OS X 10.5.1 on PPC with erlang installing into /opt/erlang/R12B-0) -greg From pwa@REDACTED Thu Dec 6 05:57:57 2007 From: pwa@REDACTED (Peter Wang) Date: Thu, 6 Dec 2007 15:57:57 +1100 Subject: [erlang-questions] bug: file:read in R12B-0 Message-ID: <20071206045756.GB29690@missioncriticalit.com> Hi, I'm not sure if it's allowed to explicitly pass group_leader() as the io_device, but R12B-0 behaves differently here: > file:read(group_leader(), 1). [] {ok,"\n"} That is, it prints out "[]" as the prompt, whereas R11B doesn't. Peter From elharaty@REDACTED Thu Dec 6 06:08:01 2007 From: elharaty@REDACTED (Emad El-Haraty) Date: Wed, 5 Dec 2007 21:08:01 -0800 Subject: [erlang-questions] clarify: R12B-0 on mac: which libgd for installing percept ? In-Reply-To: References: <3a344bc70712050939x464c4bf6k75346ec3f7ba9cd1@mail.gmail.com> <8EB58E93-4F00-45AD-8225-C51356269D80@sbcglobal.net> Message-ID: Unfortunately, the things are hard coded to search only particular directories. erts/configure.in has this: for dir in /usr/local/pgm /usr/local /usr you can just modify your erts/configure.in or erts/configure to search the right directory by just adding it to that list -- Emad From robi123@REDACTED Thu Dec 6 04:41:55 2007 From: robi123@REDACTED (Robin) Date: Wed, 5 Dec 2007 19:41:55 -0800 (PST) Subject: [erlang-questions] basic import for code reuse Message-ID: <5757d1f9-e5a8-475e-b86a-7e739c7bb660@b40g2000prf.googlegroups.com> This is a simple example using -import: -module(lw_template). -compile(export_all). member() -> template. -module(lw_special). -compile(export_all). -import(lw_template, [member/0]). member() -> special. When I import member/0 and then override it, the compiler gives the warning: lw_special.erl: defining imported function member/0 When I call member/0, the runtime bombs with an error: Eshell V5.5.5 (abort with ^G) 1> ls_special:member(). ** exited: {undef,[{ls_special,member,[]}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** Import followed by override does not work above, so how else can you specialize an imported function at compile time? If the runtime bombs from overriding a function, then should the compiler produce an error rather than just a warning? thanks, Robin From robi123@REDACTED Thu Dec 6 06:49:49 2007 From: robi123@REDACTED (Robin) Date: Wed, 5 Dec 2007 21:49:49 -0800 (PST) Subject: [erlang-questions] basic import for code reuse In-Reply-To: <5757d1f9-e5a8-475e-b86a-7e739c7bb660@b40g2000prf.googlegroups.com> References: <5757d1f9-e5a8-475e-b86a-7e739c7bb660@b40g2000prf.googlegroups.com> Message-ID: <8344a1c8-ac75-43c5-b026-03a36e297638@s36g2000prg.googlegroups.com> lw_template.erl: -module(lw_template). -compile(export_all). member() -> template. lw_special.erl: -module(lw_special). -compile(export_all). -import(lw_template, [member/0]). member() -> special. The error output: Eshell V5.5.5 (abort with ^G) 1> lw_special:member(). ** exited: {undef,[{lw_special,member,[]}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** Is there any technical reason that you cannot override an imported function? Thanks, Robin On Dec 5, 7:41 pm, Robin wrote: > This is a simple example using -import: > > -module(lw_template). > -compile(export_all). > member() -> template. > > -module(lw_special). > -compile(export_all). > -import(lw_template, [member/0]). > member() -> special. > > When I import member/0 and then override it, the compiler gives the > warning: > > lw_special.erl: defining imported function member/0 > > When I call member/0, the runtime bombs with an error: > > Eshell V5.5.5 (abort with ^G) > 1> ls_special:member(). > ** exited: {undef,[{ls_special,member,[]}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > Import followed by override does not work above, so how else can you > specialize an imported function at compile time? > > If the runtime bombs from overriding a function, then should the > compiler produce an error rather than just a warning? > > thanks, > > Robin > > _______________________________________________ > erlang-questions mailing list > erlang-questi...@REDACTED://www.erlang.org/mailman/listinfo/erlang-questions From mypascal2000@REDACTED Thu Dec 6 07:02:32 2007 From: mypascal2000@REDACTED (Dino M. B.) Date: Wed, 5 Dec 2007 22:02:32 -0800 Subject: [erlang-questions] HOWTO GENERATE RANDOM NUMBER? Message-ID: Hi Everyone, I am complete erlang beginer, please elaborate. How do I create a function in erlang that will generate a rundom integer number btw say 1 and 10 and return it ? Thanks _________________________________________________________________ Use fowl language with Chicktionary. Click here to start playing! http://puzzles.sympatico.msn.ca/chicktionary/index.html?icid=htmlsig From mypascal2000@REDACTED Thu Dec 6 07:04:34 2007 From: mypascal2000@REDACTED (Dino M. B.) Date: Wed, 5 Dec 2007 22:04:34 -0800 Subject: [erlang-questions] HOWTO GENERATE RANDOM NUMBER? Message-ID: Hi Everyone, I am complete erlang beginer, please elaborate. How do I create a function in erlang that will generate a rundom integer number btw say 1 and 10 and return it ? Thanks _________________________________________________________________ Exercise your brain! Try Flexicon! http://puzzles.sympatico.msn.ca/chicktionary/index.html?icid=htmlsig From olopierpa@REDACTED Thu Dec 6 07:33:27 2007 From: olopierpa@REDACTED (Pierpaolo Bernardi) Date: Thu, 6 Dec 2007 07:33:27 +0100 Subject: [erlang-questions] HOWTO GENERATE RANDOM NUMBER? In-Reply-To: References: Message-ID: <7352e43a0712052233h210a008cjbfbf71542395a9f3@mail.gmail.com> On Dec 6, 2007 7:02 AM, Dino M. B. wrote: > How do I create a function in erlang that will generate a rundom integer number btw say 1 and 10 and return it ? No need to create it, it's already provided by the random module: 3> random:uniform(10). 8 P. From erlangx@REDACTED Thu Dec 6 07:34:10 2007 From: erlangx@REDACTED (Michael McDaniel) Date: Wed, 5 Dec 2007 22:34:10 -0800 Subject: [erlang-questions] HOWTO GENERATE RANDOM NUMBER? In-Reply-To: References: Message-ID: <20071206063410.GH11684@delora.autosys.us> On Wed, Dec 05, 2007 at 10:04:34PM -0800, Dino M. B. wrote: > > Hi Everyone, > > I am complete erlang beginer, please elaborate. > > How do I create a function in erlang that will generate a rundom integer number btw say 1 and 10 and return it ? > > Thanks > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mmcdanie@REDACTED:~/misc/src/erlang$ erl Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) 1> random:uniform(10). 1 2> random:uniform(10). 5 3> random:uniform(10). 8 4> q(). ok 5> mmcdanie@REDACTED:~/misc/src/erlang$ erl -man random ... ~Michael From bjorn@REDACTED Thu Dec 6 08:06:04 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 06 Dec 2007 08:06:04 +0100 Subject: [erlang-questions] bug: R12B-0 can't compile YXA 1.0 In-Reply-To: <4756BC07.7010502@it.su.se> References: <4756BC07.7010502@it.su.se> Message-ID: Fredrik Thulin writes: > Hi > > Thanks for R12B-0. I found this problem though : > Thanks! Here is a minimal patch that solves the problem. (I will probably fix the problem in a different way in R12B-1.) /Bjorn *** lib/compiler/src/v3_codegen.erl@@/OTP_R12B Mon Nov 26 19:57:57 2007 --- lib/compiler/src/v3_codegen.erl Thu Dec 6 07:32:25 2007 *************** *** 1457,1462 **** --- 1457,1464 ---- Sizes = filter(fun({_,{integer,0}}) -> false; (_) -> true end, Sizes0), case Sizes of + [] -> + {bs_init2,[{integer,0}]}; [{1,_}|_] -> {bs_init_bits,cg_binary_bytes_to_bits(Sizes, [])}; [{8,_}|_] -> -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From mypascal2000@REDACTED Thu Dec 6 07:56:15 2007 From: mypascal2000@REDACTED (Dino M. B.) Date: Wed, 5 Dec 2007 22:56:15 -0800 Subject: [erlang-questions] Why can't I reply or post to this list? Message-ID: I have registerd but still I am unable to post or reply to a topic in this list. At the bottom of my screen it says "You can not ...." for any of available actions. I am posting this by sending email to erlang-questions@REDACTED I can see buttons to reply or post but when I click on it it asks me to log in and if I try, it wont let me in even though my user/password are correct ??? _________________________________________________________________ Introducing the City @ Live! Take a tour! http://getyourliveid.ca/?icid=LIVEIDENCA006 From ignatios@REDACTED Thu Dec 6 08:47:16 2007 From: ignatios@REDACTED (Ignatios Souvatzis) Date: Thu, 6 Dec 2007 08:47:16 +0100 Subject: [erlang-questions] Why can't I reply or post to this list? In-Reply-To: References: Message-ID: <20071206074716.GA5336@cs.uni-bonn.de> On Wed, Dec 05, 2007 at 10:56:15PM -0800, Dino M. B. wrote: > > I have registerd but still I am unable to post or reply to a topic in > this list. > > At the bottom of my screen it says "You can not ...." for any of > available actions. What screen? How (with what program, with what input to this program) did you create it? > I am posting this by sending email to erlang-questions@REDACTED Yes, that's the normal method, and as I can read your posting, it works fine. > I can see buttons to reply or post but when I click on it it asks me > to log in and if I try, it wont let me in even though my user/password > are correct ??? What user and password did you give to what program? -is From andreas.hillqvist@REDACTED Thu Dec 6 09:09:05 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Thu, 6 Dec 2007 09:09:05 +0100 Subject: [erlang-questions] Order of message processing by a gen_server In-Reply-To: References: <475639E6.2060307@lionet.info> <70B8175D-8A32-439F-9F89-57F4A5C52DDF@geophile.com> <8268eea30712050020t60dc9e7bi84739840fd70d7c@mail.gmail.com> Message-ID: <8268eea30712060009j1e1f1afpb0df6e00796df1d5@mail.gmail.com> You could model this using an gen_fsm: -module(new_file). -define(NAME, ?MODULE). -behaviour(gen_fsm). %% External exports -export([start_link/0, send_cancel/0]). %% gen_fsm exports -export([init/1, phase1/2, phase1/3, phase2/2, phase2/3, phase3/2, phase3/3, handle_event/3, handle_sync_event/4, handle_info/3, terminate/3, code_change/4]). -record(state, {}). %% External functions start_link() -> Args = [], Options = [], {ok, Pid} = gen_fsm:start_link({local, ?NAME}, ?MODULE, Args, Options). send_cancel() -> gen_fsm:send_all_state_event(?NAME, cancel). send_phase1() -> gen_fsm:send_event(?NAME, phase1). send_phase2() -> gen_fsm:send_event(?NAME, phase2). send_phase3() -> gen_fsm:send_event(?NAME, phase3). %% gen_fsm callbacks init([]) -> send_phase1(), {ok, phase1, #state{}}. phase1(phase1, StateData) -> do_phase_1(), send_phase2(), {next_state, phase2, StateData}; phase1(_, StateData) -> {next_state, phase1, StateData}. phase1(_, From, StateData) -> Reply = ok, {reply, Reply, phase1, StateData}. phase2(phase2, StateData) -> do_phase_2(), send_phase3(), {next_state, phase3, StateData}; phase2(_, StateData) -> {next_state, phase2, StateData}. phase2(_, From, StateData) -> Reply = ok, {reply, Reply, phase2, StateData}. phase3(phase3, StateData) -> do_phase_3(), io:format("Finished, so no I will stop!\n"), Reason = normal, {stop, Reason, StateData}; phase3(_, StateData) -> {next_state, phase3, StateData}. phase3(_, From, StateData) -> Reply = ok, {reply, Reply, phase3, StateData}. handle_event(cancel, StateName, StateData) -> io:format(" - We have recived cancel in ~p -!\n" " - We now stop! -\n", [StateName]), Reason = canceled, {stop, Reason, StateData}; handle_event(_, StateName, StateData) -> {next_state, StateName, StateData}. handle_sync_event(Event, From, StateName, StateData) -> Reply = ok, {reply, Reply, StateName, StateData}. handle_info(Info, StateName, StateData) -> {next_state, StateName, StateData}. terminate(Reason, StateName, StatData) -> ok. code_change(OldVsn, StateName, StateData, Extra) -> {ok, StateName, StateData}. do_phase_1() -> io:format("Begin phase_1\n"), timer:sleep(5000), io:format("End phase_1\n"). do_phase_2() -> io:format("Begin phase_2\n"), timer:sleep(5000), io:format("End phase_2\n"). do_phase_3() -> io:format("Begin phase_3\n"), timer:sleep(5000), io:format("End phase_3\n"). How are job handled? Can more than one job run at once: Is one process/gen_server/gen_fsm created when a job is run and ended when it is finished? Or is there only one a job that can be run at a time: A static process/gen_server/gen_fsm with an ideal state that recives the jobs? Kind regards, Andreas Hillqvist 2007/12/6, Jack Orenstein : > Thanks again for your responses and code samples. > > You asked: > > > Example: > > 1. phase1 is sent to my_fms > > 2. my_fms receives phase1 > > 3. my_fms starts processing phase1 > > 4. phase2 is sent to my_fms > > 5. phase3 is sent to my_fms > > 6. cancel is sent to my_fms > > 7. my_fms finish processing phase1 > > 8. my_fms receives phase2 > > 9. my_fms starts processing phase2 > > 10. my_fms finish processing phase2 > > 11. my_fms receives phase3 > > 12. my_fms starts processing phase3 > > 13. my_fms finish processing phase3 > > 14. my_fms receives cancel > > > > As I intrepid it, you want step 8 to receive cancel event and ignore > > the transitions to phase2 and phase3? > > It depends what you mean by "my_fms receives ...". At a high level, > what I want to do is to process these phases in order, and stop > processing them when a cancel message arrives. If my_fms has a cancel > message in it, then I definitely want that message to be processed > next by the receive. > > I think the problem can be simplified by having each phase trigger the > next one, e.g. > > loop() -> > receive > cancel -> cancelled; > phase1 -> do_phase_1(), self() ! phase2, loop(); > phase2 -> do_phase_2(), self() ! phase3, loop(); > phase3 -> do_phase_3(), ok > end. > > Then I can start the phases: > > P = spawn(fun() -> loop() end), > P ! phase1 > > and cancel anytime: > > P ! cancel > > I think this could be translated into gen_server code, using > handle_cast instead of handle_call. > > By the way, you mentioned that following a cancel, the message queue > should be emptied, which makes sense. How is that done? > > Jack > > From chsu79@REDACTED Thu Dec 6 09:11:45 2007 From: chsu79@REDACTED (Christian S) Date: Thu, 6 Dec 2007 09:11:45 +0100 Subject: [erlang-questions] HOWTO GENERATE RANDOM NUMBER? In-Reply-To: <20071206063410.GH11684@delora.autosys.us> References: <20071206063410.GH11684@delora.autosys.us> Message-ID: Remember that you need to seed the random number generator on a per-process basis. If you do not pass in an explicit seed one will be initialized and stored for you in the process dictionary. 2007/12/6, Michael McDaniel : > > How do I create a function in erlang that will generate a rundom integer number btw say 1 and 10 and return it ? > 1> random:uniform(10). > 1 > 2> random:uniform(10). > 5 > 3> random:uniform(10). > 8 From mickael.remond@REDACTED Thu Dec 6 08:49:31 2007 From: mickael.remond@REDACTED (=?UTF-8?Q?Micka=C3=ABl_R=C3=A9mond?=) Date: Thu, 6 Dec 2007 08:49:31 +0100 Subject: [erlang-questions] Why can't I reply or post to this list? In-Reply-To: References: Message-ID: Hello, Le 6 d?c. 07 ? 07:56, Dino M. B. a ?crit : > I have registerd but still I am unable to post or reply to a topic > in this list. > > At the bottom of my screen it says "You can not ...." for any of > available actions. I am posting this by sending email to erlang-questions@REDACTED > > I can see buttons to reply or post but when I click on it it asks me > to log in and if I try, it wont let me in even though my user/ > password are correct ??? It seem you have trouble configuring your mail: From address: mypascal2000@REDACTED Reply-to: mypascal2000@REDACTED Please check your configuration. -- Micka?l R?mond http://www.process-one.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Thu Dec 6 09:40:00 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 6 Dec 2007 09:40:00 +0100 Subject: [erlang-questions] Using linked-in drivers to represent objects outside of Erlang In-Reply-To: References: Message-ID: <20071206084000.GA6177@erix.ericsson.se> That entirely depends on the number of objects. Mapping a Port (driver instance) <=> Object is the straightforward way. Just as Port <=> Socket. But there is a limited number of ports. A program is supposed to have max a few hundred sockets, there are OS limits for this. The emulator limits the number of ports, I do not remember the limit but it is about ten to a hundred thousand. Port <=> Object also gives a nice and clean abstraction for communication and such. The footprint of a port instance is also probably about a kilobyte. If you need more lightweight objects you need to have one port handle several objects and use object handles. On Wed, Dec 05, 2007 at 02:03:02PM +0000, Joel Reymont wrote: > Suppose I want to use a linked-in driver to talk to objects outside of > Erlang. > > Am I correct that a driver instance would map to an object instance? > > Would this be efficient enough? > > I don't need to keep a list of objects inside the driver and have my > Erlang code refer to them using some sort of a handle, do I? > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From torben.lehoff@REDACTED Thu Dec 6 09:42:03 2007 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Thu, 6 Dec 2007 09:42:03 +0100 Subject: [erlang-questions] Why can't I reply or post to this list? In-Reply-To: References: Message-ID: On Dec 6, 2007 8:49 AM, Micka?l R?mond wrote: > Hello, > Le 6 d?c. 07 ? 07:56, Dino M. B. a ?crit : > > I have registerd but still I am unable to post or reply to a topic in this > list. > > At the bottom of my screen it says "You can not ...." for any of available > actions. I am posting this by sending email to > erlang-questions@REDACTED > > I can see buttons to reply or post but when I click on it it asks me to > log in and if I try, it wont let me in even though my user/password are > correct ??? > > > It seem you have trouble configuring your mail: > From address: mypascal2000@REDACTED > Reply-to: mypascal2000@REDACTED > > Please check your configuration. > I have had problems with GMail as well - if you are using a GMail mail address you should spell it out, ie., @googlemail.com instead of gmail.com - I have not been able to configure GMail to use @gmail.com as the sender. Perhaps a little remark on the registration page would be in order here?!?! Cheers, Torben > > -- > Micka?l R?mond > http://www.process-one.net/ > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Thu Dec 6 09:54:36 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 6 Dec 2007 09:54:36 +0100 Subject: [erlang-questions] : Erlang/OTP R12B-0 has been released In-Reply-To: <8268eea30712050345t9c9254bn9293c9b68ccb1860@mail.gmail.com> References: <8268eea30712050345t9c9254bn9293c9b68ccb1860@mail.gmail.com> Message-ID: <20071206085436.GB6177@erix.ericsson.se> On Wed, Dec 05, 2007 at 12:45:05PM +0100, Andreas Hillqvist wrote: > Why not provide torrents for Erlang/OTP releases. > Wouldn't that speed up downloads, decrease load and increase availability? > We have never heard (or have forgotten) there was any particular problem with download speed and availability, so we did not make the effort. Also, to improve on download speed there has to be many seeders, and since Erlang/OTP is still rather unwidespread, perhaps it would not give that much. We have about 500..2000 downloads per month per Windows and Source release (latest). I do not know if that qualifies for torrent downloads. We would also want our own tracker - does that decrease availability? And convince our security department we need to run a torrent source (and that we swear to not provide anything inappropriate). But if there is a real and genuine interest we probably can do it. > > Regards, > Andreas Hillqvist > > 05 Dec 2007 09:33:02 +0100, Bjorn Gustavsson : > > Major relese : otp_src_R12B-0 > > Build date : 2007-12-04 > > > > R12B-0 is a major new release of Erlang/OTP. > > You can download the full source distribution from > > > > http://www.erlang.org/download/otp_src_R12B-0.tar.gz > > http://www.erlang.org/download/otp_src_R12B-0.readme > > > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > > > > 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_R12B-0.exe > > > > > > On-line documentation can be found at http://www.erlang.org/doc/. > > You can also download the complete HTML documentation or the Unix manual files > > > > http://www.erlang.org/download/otp_doc_html_R12B-0.tar.gz > > http://www.erlang.org/download/otp_doc_man_R12B-0.tar.gz > > > > We also want to thank those that sent us patches, suggestions and bug > > reports, > > > > The OTP Team > > > > -- > > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Thu Dec 6 10:13:00 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 6 Dec 2007 10:13:00 +0100 Subject: [erlang-questions] bug: file:read in R12B-0 In-Reply-To: <20071206045756.GB29690@missioncriticalit.com> References: <20071206045756.GB29690@missioncriticalit.com> Message-ID: <20071206091300.GD6177@erix.ericsson.se> Oops, that would be a bug. If you build from source, try the following patch: *** lib/kernel/src/file.erl Mon Nov 26 13:29:40 2007 --- lib/kernel/src/file.erl-NEW Thu Dec 6 10:10:58 2007 *************** *** 395,401 **** read(File, Sz) when is_pid(File), is_integer(Sz), Sz >= 0 -> ! case io:request(File, {get_chars, "", Sz}) of Data when is_list(Data); is_binary(Data) -> {ok, Data}; Other -> --- 395,401 ---- read(File, Sz) when is_pid(File), is_integer(Sz), Sz >= 0 -> ! case io:request(File, {get_chars, '', Sz}) of Data when is_list(Data); is_binary(Data) -> {ok, Data}; Other -> *************** *** 1004,1010 **** consult_stream(Fd, 1, []). consult_stream(Fd, Line, Acc) -> ! case io:read(Fd, "", Line) of {ok,Term,EndLine} -> consult_stream(Fd, EndLine, [Term|Acc]); {error,Error,_Line} -> --- 1004,1010 ---- consult_stream(Fd, 1, []). consult_stream(Fd, Line, Acc) -> ! case io:read(Fd, '', Line) of {ok,Term,EndLine} -> consult_stream(Fd, EndLine, [Term|Acc]); {error,Error,_Line} -> On Thu, Dec 06, 2007 at 03:57:57PM +1100, Peter Wang wrote: > Hi, > > I'm not sure if it's allowed to explicitly pass group_leader() as the > io_device, but R12B-0 behaves differently here: > > > file:read(group_leader(), 1). > [] > {ok,"\n"} > > That is, it prints out "[]" as the prompt, whereas R11B doesn't. > > Peter > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From mikpe@REDACTED Thu Dec 6 10:23:17 2007 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 6 Dec 2007 10:23:17 +0100 (MET) Subject: [erlang-questions] bug: R12B-0 fix (MacOS X Leopard specific) Message-ID: <200712060923.lB69NHnR021388@harpo.it.uu.se> On Wed, 5 Dec 2007 22:33:29 +0100, Mateusz Berezecki wrote: > There is a bug in R12B-0 compilation process with --enable-hipe flag > The file erts/emulator/hipe/hipe_x86_signal.c contains a structure > sigaltstack > which is obsolete. > > Replace line 259 in that file to contain > > stack_t ss; Hmm, SUSv3 appears to agree with you, as does (reasonably modern versions of) Linux and Solaris. I'll make that change. People building on ancient systems may get problems, but we'll deal with that [tell 'em to upgrade :-)] if/when that happens. Thanks for reporting this issue. /Mikael The HiPE group From andreas.hillqvist@REDACTED Thu Dec 6 10:26:59 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Thu, 6 Dec 2007 10:26:59 +0100 Subject: [erlang-questions] : Erlang/OTP R12B-0 has been released In-Reply-To: <20071206085436.GB6177@erix.ericsson.se> References: <8268eea30712050345t9c9254bn9293c9b68ccb1860@mail.gmail.com> <20071206085436.GB6177@erix.ericsson.se> Message-ID: <8268eea30712060126v379db86em737de2bbbddc2003@mail.gmail.com> Thank you for you answer. I believe you are right, today Erlang is still not widespread as other larger Open Source projects. I see Bittorent as a way for me to contribute with my bandwidth. A way for me to thank you for a excellent product. I have seen it as an alternative download method, i.e. mythbuntu (http://www.mythbuntu.org/downloads) i386 Builds MD5sum Direct Download torrent Where torrents is offered as an alternative to direct downloads. My e-mail to the mailing list was also to inquirer if there is a real and genuine interest in offering Erlang/OTP as a torrent. Except your reply, I have not received any comment. So i guess, not comments implies no interest in offering Erlang/OTP as a torrent. I will continue to contribute by answer questions on this list to my best ability. ;-) Regards, Andreas Hillqvist 2007/12/6, Raimo Niskanen : > On Wed, Dec 05, 2007 at 12:45:05PM +0100, Andreas Hillqvist wrote: > > Why not provide torrents for Erlang/OTP releases. > > Wouldn't that speed up downloads, decrease load and increase availability? > > > > We have never heard (or have forgotten) there was any particular problem > with download speed and availability, so we did not make the effort. > Also, to improve on download speed there has to be many seeders, > and since Erlang/OTP is still rather unwidespread, perhaps it > would not give that much. We have about 500..2000 downloads > per month per Windows and Source release (latest). > I do not know if that qualifies for torrent downloads. > > We would also want our own tracker - does that decrease availability? > And convince our security department we need to run a torrent source > (and that we swear to not provide anything inappropriate). > > But if there is a real and genuine interest we probably can do it. > > > > > > > Regards, > > Andreas Hillqvist > > > > 05 Dec 2007 09:33:02 +0100, Bjorn Gustavsson : > > > Major relese : otp_src_R12B-0 > > > Build date : 2007-12-04 > > > > > > R12B-0 is a major new release of Erlang/OTP. > > > You can download the full source distribution from > > > > > > http://www.erlang.org/download/otp_src_R12B-0.tar.gz > > > http://www.erlang.org/download/otp_src_R12B-0.readme > > > > > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > > > > > > 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_R12B-0.exe > > > > > > > > > On-line documentation can be found at http://www.erlang.org/doc/. > > > You can also download the complete HTML documentation or the Unix manual files > > > > > > http://www.erlang.org/download/otp_doc_html_R12B-0.tar.gz > > > http://www.erlang.org/download/otp_doc_man_R12B-0.tar.gz > > > > > > We also want to thank those that sent us patches, suggestions and bug > > > reports, > > > > > > The OTP Team > > > > > > -- > > > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From mikpe@REDACTED Thu Dec 6 10:31:49 2007 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 6 Dec 2007 10:31:49 +0100 (MET) Subject: [erlang-questions] R12B-0 HiPE option no_remove_comments Message-ID: <200712060931.lB69VnsT021447@harpo.it.uu.se> On Thu, 6 Dec 2007 02:38:13 +0100, Roger Larsson wrote: > I have a script that can be used to look at hipe steps. > > ---- > #!/bin/sh > erlc +native +\{hipe,\[no_remove_comments,pp_all\]\} $1 > ---- fac.erl > -module(fac). > -export([fac/2]). > > fac(A,0)->A; > fac(A,N)->fac(A*N,N-1). > ---- > > This does not work in R12B, it is the no_remove_comments fault. > bash> ./get_icode.sh fac.erl > label 1: > {func_info,{atom,fac},{atom,fac},2} > label 2: > {test,is_eq_exact,{f,3},[{x,1},{integer,0}]} > return > label 3: > {gc_bif,'*',{f,0},2,[{x,0},{x,1}],{x,0}} > {gc_bif,'-',{f,0},2,[{x,1},{integer,1}],{x,1}} > {call_only,2,{fac,fac,2}} > > fac:fac/2(v0, v5) -> > %% Info:['Not a closure','Leaf function'] > 1: > _ := redtest() (primop) > if is_{integer,0}(v5) then 3 (0.50) else 6 > 3: > return(v0) > 6: > v0 := '*'(v0, v5) (primop) > v8 := 1 > v5 := '-'(v5, v8) (primop) > % self_tail_recursive > goto 1 > %% Data: > EXITED with reason {{case_clause, > {comment,self_tail_recursive}},[{hipe_icode_range,analyse_insn,3}, > {hipe_icode_range,analyse_BB,5},{hipe_icode_range,analyse_block,4}, > {hipe_icode_range,analyse_blocks,3},{hipe_icode_range,analyse,2}, > {hipe_icode_range,do_analysis,3},{hipe_icode_range,concurrent_cfg,4}, > {hipe_main,icode_range_analysis,3}]} @hipe:907 We generally don't compile with no_remove_comments, and it's entirely possible that some newer code fails to ignore comments. Thanks for reporting this issue. We'll look into it. /Mikael The HiPE group From bjorn@REDACTED Thu Dec 6 10:37:07 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 06 Dec 2007 10:37:07 +0100 Subject: [erlang-questions] Missing ssl and crypto documentation restored Message-ID: The documentation for the ssl and crypto applications were missing in the R12B-0 release. It has now been restored in the on-line documentation and in the tar files. The documentation included in the pre-built Windows distribution has not been updated; ssl and crypto documentation is still missing. Either use the on-line documenation or download the tar file. Sorry for the inconvenience. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Thu Dec 6 11:07:09 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 6 Dec 2007 11:07:09 +0100 Subject: [erlang-questions] : Why can't I reply or post to this list? In-Reply-To: References: Message-ID: <20071206100709.GE6177@erix.ericsson.se> On Thu, Dec 06, 2007 at 09:42:03AM +0100, Torben Hoffmann wrote: > On Dec 6, 2007 8:49 AM, Micka?l R?mond > wrote: > > > Hello, > > Le 6 d?c. 07 ? 07:56, Dino M. B. a ?crit : > > > > I have registerd but still I am unable to post or reply to a topic in this > > list. > > > > At the bottom of my screen it says "You can not ...." for any of available > > actions. I am posting this by sending email to > > erlang-questions@REDACTED > > > > I can see buttons to reply or post but when I click on it it asks me to > > log in and if I try, it wont let me in even though my user/password are > > correct ??? > > > > > > It seem you have trouble configuring your mail: > > From address: mypascal2000@REDACTED > > Reply-to: mypascal2000@REDACTED > > > > Please check your configuration. > > > > I have had problems with GMail as well - if you are using a GMail mail > address you should spell it out, ie., @googlemail.com instead of gmail.com - > I have not been able to configure GMail to use @gmail.com as the sender. > That is a little odd. We have 504 registered subscribers in gmail.com, and 7 in googlemail.com, and I do not think those 504 are all non-working. > Perhaps a little remark on the registration page would be in order here?!?! > This mail domain mixup is a bit annoying. I will see if I can write something appropriate... > Cheers, > Torben > > > > > > -- > > Micka?l R?mond > > http://www.process-one.net/ > > > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From jiguorui@REDACTED Thu Dec 6 11:07:41 2007 From: jiguorui@REDACTED (Guorui Ji) Date: Thu, 6 Dec 2007 18:07:41 +0800 Subject: [erlang-questions] HOWTO??: link erl , *.beam to exe for Windows. Message-ID: Hi, I need your help. I want to make my Erlang program to a exe file for windows. Well, Do we have a tool as py2exe in Python? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jakob@REDACTED Thu Dec 6 11:17:13 2007 From: jakob@REDACTED (Jakob Cederlund) Date: Thu, 06 Dec 2007 11:17:13 +0100 Subject: [erlang-questions] Clarify: does R12B ssl listener accept existing socket ? In-Reply-To: References: Message-ID: <4757CC29.1010807@erix.ericsson.se> Well, since the new prerelease ssl uses gen_tcp, the option {fd, int()} is available. (I haven't tested it though.) Note that this applies only to the new ssl, you have to supply the option {ssl_imp, new} to ssl:listen and ssl:connect. /Jakob Roberto Saccon wrote: > nobody answered, but now that R12B has been released, just asking again ... > > On Nov 28, 2007 1:01 PM, Roberto Saccon wrote: > >> I took a look at the sources, saw that ssl has been completely >> rewritten, but did not manage to understand, whether and how it is >> possible to pas an existing file descriptor (e.g.: provided by >> fd_server) of an open socket to the ssl listener. >> >> regards >> -- >> Roberto Saccon >> http://rsaccon.com >> >> > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From torben.lehoff@REDACTED Thu Dec 6 11:21:06 2007 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Thu, 6 Dec 2007 11:21:06 +0100 Subject: [erlang-questions] : Why can't I reply or post to this list? In-Reply-To: <20071206100709.GE6177@erix.ericsson.se> References: <20071206100709.GE6177@erix.ericsson.se> Message-ID: On Dec 6, 2007 11:07 AM, Raimo Niskanen < raimo+erlang-questions@REDACTED> wrote: > On Thu, Dec 06, 2007 at 09:42:03AM +0100, Torben Hoffmann wrote: > > On Dec 6, 2007 8:49 AM, Micka?l R?mond > > wrote: > > > > > Hello, > > > Le 6 d?c. 07 ? 07:56, Dino M. B. a ?crit : > > > > > > I have registerd but still I am unable to post or reply to a topic in > this > > > list. > > > > > > At the bottom of my screen it says "You can not ...." for any of > available > > > actions. I am posting this by sending email to > > > erlang-questions@REDACTED > > > > > > I can see buttons to reply or post but when I click on it it asks me > to > > > log in and if I try, it wont let me in even though my user/password > are > > > correct ??? > > > > > > > > > It seem you have trouble configuring your mail: > > > From address: mypascal2000@REDACTED > > > Reply-to: mypascal2000@REDACTED > > > > > > Please check your configuration. > > > > > > > I have had problems with GMail as well - if you are using a GMail mail > > address you should spell it out, ie., @googlemail.com instead of > gmail.com - > > I have not been able to configure GMail to use @gmail.com as the sender. > > > > That is a little odd. We have 504 registered subscribers in gmail.com, > and 7 in googlemail.com, and I do not think those 504 are all non-working. > The question is if the gmail.com subscribers are posting to the ML - I got the mails just fine with gmail.com, but I could not post with gmail.com. > > Perhaps a little remark on the registration page would be in order > here?!?! > > > > This mail domain mixup is a bit annoying. I will see if I can > write something appropriate... Perhaps we could persuade some of the gmail.com subscribers to do a test posting to see if my diagnosis is 100% correct before changing the web page. Cheers, Torben -------------- next part -------------- An HTML attachment was scrubbed... URL: From vychodil.hynek@REDACTED Thu Dec 6 11:28:43 2007 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Thu, 6 Dec 2007 11:28:43 +0100 Subject: [erlang-questions] : Why can't I reply or post to this list? In-Reply-To: References: <20071206100709.GE6177@erix.ericsson.se> Message-ID: <4d08db370712060228q185eff56gda76b4538182ab03@mail.gmail.com> On 12/6/07, Torben Hoffmann wrote: > > > On Dec 6, 2007 11:07 AM, Raimo Niskanen > wrote: > > On Thu, Dec 06, 2007 at 09:42:03AM +0100, Torben Hoffmann wrote: > > > On Dec 6, 2007 8:49 AM, Micka?l R?mond > > > wrote: > > > > > > > Hello, > > > > Le 6 d?c. 07 ? 07:56, Dino M. B. a ?crit : > > > > > > > > I have registerd but still I am unable to post or reply to a topic in > this > > > > list. > > > > > > > > At the bottom of my screen it says "You can not ...." for any of > available > > > > actions. I am posting this by sending email to > > > > erlang-questions@REDACTED > > > > > > > > I can see buttons to reply or post but when I click on it it asks me > to > > > > log in and if I try, it wont let me in even though my user/password > are > > > > correct ??? > > > > > > > > > > > > It seem you have trouble configuring your mail: > > > > From address: mypascal2000@REDACTED > > > > Reply-to: mypascal2000@REDACTED > > > > > > > > Please check your configuration. > > > > > > > > > > I have had problems with GMail as well - if you are using a GMail mail > > > address you should spell it out, ie., @googlemail.com instead of > gmail.com - > > > I have not been able to configure GMail to use @gmail.com as the sender. > > > > > > > That is a little odd. We have 504 registered subscribers in gmail.com, > > and 7 in googlemail.com, and I do not think those 504 are all non-working. > > > > The question is if the gmail.com subscribers are posting to the ML - I got > the mails just fine with gmail.com, but I could not post with gmail.com. May be me? It works fine for me, I'm not noticed any trouble. > > > > > > Perhaps a little remark on the registration page would be in order > here?!?! > > > > > > > This mail domain mixup is a bit annoying. I will see if I can > > write something appropriate... > > Perhaps we could persuade some of the gmail.com subscribers to do a test > posting to see if my diagnosis is 100% correct before changing the web page. > > Cheers, > Torben > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil From michal@REDACTED Thu Dec 6 11:22:37 2007 From: michal@REDACTED (Michal Slaski) Date: Thu, 6 Dec 2007 11:22:37 +0100 Subject: [erlang-questions] =?iso-8859-1?q?ErlLounge_in_Krak=F3w=2C_Poland?= Message-ID: Hi All, We will be meeting with other erlangers in the city center of Krak?w (Poland) on the 18th of December starting at 18.00. The ErlLounge will be held in the Klub Re (http://www.klubre.pl/kontakt.html) Join us! -- Michal Slaski http://www.erlang-consulting.com From olivier.sambourg@REDACTED Thu Dec 6 11:30:02 2007 From: olivier.sambourg@REDACTED (Olivier Sambourg) Date: Thu, 6 Dec 2007 11:30:02 +0100 Subject: [erlang-questions] : Why can't I reply or post to this list? In-Reply-To: References: <20071206100709.GE6177@erix.ericsson.se> Message-ID: Here you are :) -- Olivier On 12/6/07, Torben Hoffmann wrote: > > > > Perhaps we could persuade some of the gmail.com subscribers to do a test > posting to see if my diagnosis is 100% correct before changing the web page. > > > > Cheers, > Torben > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ttmrichter@REDACTED Thu Dec 6 11:29:48 2007 From: ttmrichter@REDACTED (Michael T. Richter) Date: Thu, 06 Dec 2007 18:29:48 +0800 Subject: [erlang-questions] Erlang Quick Reference Message-ID: <1196936988.4838.8.camel@isolde> Is there any beast out there that is a simple quick reference of Erlang syntax and BIFs (something like a fold-up single sheet)? I've Googled and checked the links in the Programming Erlang book and haven't been able to find anything useful. From bob@REDACTED Thu Dec 6 12:23:00 2007 From: bob@REDACTED (Bob Ippolito) Date: Thu, 6 Dec 2007 03:23:00 -0800 Subject: [erlang-questions] HOWTO GENERATE RANDOM NUMBER? In-Reply-To: References: <20071206063410.GH11684@delora.autosys.us> Message-ID: <6a36e7290712060323s3977c4bfw66a7a19de8d6a48@mail.gmail.com> And if you need a random number generator that doesn't need to be seeded per-process then you should use the crypto module. The PRNG used by the crypto module is also far better, if the quality of the random numbers happens to matter. -bob On 12/6/07, Christian S wrote: > Remember that you need to seed the random number generator on a > per-process basis. If you do not pass in an explicit seed one will be > initialized and stored for you in the process dictionary. > > 2007/12/6, Michael McDaniel : > > > How do I create a function in erlang that will generate a rundom integer number btw say 1 and 10 and return it ? > > 1> random:uniform(10). > > 1 > > 2> random:uniform(10). > > 5 > > 3> random:uniform(10). > > 8 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From luna@REDACTED Thu Dec 6 12:43:58 2007 From: luna@REDACTED (Daniel Luna) Date: Thu, 6 Dec 2007 12:43:58 +0100 (CET) Subject: [erlang-questions] Erlang/OTP R12B-0 has been released In-Reply-To: References: Message-ID: On Wed, 5 Dec 2007, Daniel Luna wrote: > On Wed, 5 Dec 2007, Bjorn Gustavsson wrote: >> R12B-0 is a major new release of Erlang/OTP. >> You can download the full source distribution from >> >> http://www.erlang.org/download/otp_src_R12B-0.tar.gz >> http://www.erlang.org/download/otp_src_R12B-0.readme > > How about the version _without_ prebuilt beam-files and prebuilt > dialyzer-plt? Will that one also be available for download? It seems that my request dissapeared because of Enzo's noise. My request has nothing whatsoever to do with source code. Since we are putting the OTP distribution in an svn repository it would actually be nice to have the "slim" release of OTP. I.e. the version _without_ BEAM-files and plt. Like it used to be... (Doing "make clean" didn't really give what I wanted for R11B-5. "make clean" removed too much. (And my guess without testing is that this is also true for R12B-0.)) /Luna -- Daniel Luna | Top reasons that I have a beard: luna@REDACTED | a) Laziness. http://www.update.uu.se/~luna/ | b) I can. Don't look at my homepage (it stinks).| c) I can get away with it. From matthias@REDACTED Thu Dec 6 11:50:15 2007 From: matthias@REDACTED (Matthias Lang) Date: Thu, 6 Dec 2007 11:50:15 +0100 Subject: [erlang-questions] HOWTO??: link erl , *.beam to exe for Windows. In-Reply-To: References: Message-ID: <18263.54247.334088.749989@antilipe.corelatus.se> Guorui Ji writes: > Hi, I need your help. > I want to make my Erlang program to a exe file for windows. > Well, Do we have a tool as py2exe in Python? No, there is no py2exe for Erlang. >From the FAQ: | 5.20. ...distribute the Erlang programs I write to my | friends/colleagues/users? | | Erlang programs only run on the Erlang VM, so every machine which is | going to run an Erlang program needs to have a copy of the Erlang | runtime installed. | | Installing the entire Erlang system from erlang.org (or, perhaps, | indirectly via a packaging system such as Debian's or BSD's) is the | simplest option in many cases. | | A more modular alternative is to install the CEAN runtime. | | A further alternative which has fallen into disuse is SAE: stand-alone | Erlang. SAE allows an Erlang program to be distributed as just two | files, totalling about 500k. SAE no longer works on current Erlang | releases, but for historical interest, there is a page about SAE which | shows you how to build a self-contained system for the (somewhat | outdated) R9B Erlang release. Single exe file versions of Erlang programs have been discussed on the mailing list several times, you can relive at least some of those exciting and productive discussions by asking google "py2exe erlang". Matthias From esbjorn.dominique@REDACTED Thu Dec 6 13:09:53 2007 From: esbjorn.dominique@REDACTED (=?ISO-8859-1?Q?Esbj=F6rn_Dominique?=) Date: Thu, 6 Dec 2007 13:09:53 +0100 Subject: [erlang-questions] : Why can't I reply or post to this list? In-Reply-To: References: <20071206100709.GE6177@erix.ericsson.se> Message-ID: <7348e9970712060409l13db11fey92d5a65da60f91d@mail.gmail.com> test test /esbj?rn On Dec 6, 2007 11:21 AM, Torben Hoffmann wrote: > > > On Dec 6, 2007 11:07 AM, Raimo Niskanen < > raimo+erlang-questions@REDACTED> wrote: > > > On Thu, Dec 06, 2007 at 09:42:03AM +0100, Torben Hoffmann wrote: > > > On Dec 6, 2007 8:49 AM, Micka?l R?mond > > > > > wrote: > > > > > > > Hello, > > > > Le 6 d?c. 07 ? 07:56, Dino M. B. a ?crit : > > > > > > > > I have registerd but still I am unable to post or reply to a topic > > in this > > > > list. > > > > > > > > At the bottom of my screen it says "You can not ...." for any of > > available > > > > actions. I am posting this by sending email to > > > > erlang-questions@REDACTED > > > > > > > > I can see buttons to reply or post but when I click on it it asks me > > to > > > > log in and if I try, it wont let me in even though my user/password > > are > > > > correct ??? > > > > > > > > > > > > It seem you have trouble configuring your mail: > > > > From address: mypascal2000@REDACTED > > > > Reply-to: mypascal2000@REDACTED > > > > > > > > Please check your configuration. > > > > > > > > > > I have had problems with GMail as well - if you are using a GMail mail > > > address you should spell it out, ie., @googlemail.com instead of > > gmail.com - > > > I have not been able to configure GMail to use @gmail.com as the > > sender. > > > > > > > That is a little odd. We have 504 registered subscribers in gmail.com, > > and 7 in googlemail.com, and I do not think those 504 are all > > non-working. > > > > The question is if the gmail.com subscribers are posting to the ML - I got > the mails just fine with gmail.com, but I could not post with gmail.com. > > > > > Perhaps a little remark on the registration page would be in order > > here?!?! > > > > > > > This mail domain mixup is a bit annoying. I will see if I can > > write something appropriate... > > > Perhaps we could persuade some of the gmail.com subscribers to do a test > posting to see if my diagnosis is 100% correct before changing the web page. > > > Cheers, > Torben > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From torben.lehoff@REDACTED Thu Dec 6 13:32:18 2007 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Thu, 6 Dec 2007 13:32:18 +0100 Subject: [erlang-questions] : Why can't I reply or post to this list? In-Reply-To: <7348e9970712060409l13db11fey92d5a65da60f91d@mail.gmail.com> References: <20071206100709.GE6177@erix.ericsson.se> <7348e9970712060409l13db11fey92d5a65da60f91d@mail.gmail.com> Message-ID: Thanks for the testing mails. It seems that since Google has gone Beta with Google Mail all new addresses will be in the googlemail.com domain, but there is an alias with gmail.com. How can you know what your "root mail" address is? Go to Settings -> Account and there you can see under "Send mail as" if you have a googlemail.com or gmail.com address. The tricky part is that you can live happily for a long time handing out gmail.com as you mail address suffix, but the minute you start having fun with mailling lists that checks if you are subscribed before it lets you post you run into the problem. The funny thing is that most people talk about GMail not Google mail so the rebranding Google is trying to get in place is not quite working out as they hoped. Cheers, Torben On Dec 6, 2007 1:09 PM, Esbj?rn Dominique < esbjorn.dominique@REDACTED> wrote: > test test > /esbj?rn > > On Dec 6, 2007 11:21 AM, Torben Hoffmann > wrote: > > > > > > > On Dec 6, 2007 11:07 AM, Raimo Niskanen < > > raimo+erlang-questions@REDACTED> wrote: > > > > > On Thu, Dec 06, 2007 at 09:42:03AM +0100, Torben Hoffmann wrote: > > > > On Dec 6, 2007 8:49 AM, Micka?l R?mond < > > > mickael.remond@REDACTED> > > > > wrote: > > > > > > > > > Hello, > > > > > Le 6 d?c. 07 ? 07:56, Dino M. B. a ?crit : > > > > > > > > > > I have registerd but still I am unable to post or reply to a topic > > > in this > > > > > list. > > > > > > > > > > At the bottom of my screen it says "You can not ...." for any of > > > available > > > > > actions. I am posting this by sending email to > > > > > erlang-questions@REDACTED > > > > > > > > > > I can see buttons to reply or post but when I click on it it asks > > > me to > > > > > log in and if I try, it wont let me in even though my > > > user/password are > > > > > correct ??? > > > > > > > > > > > > > > > It seem you have trouble configuring your mail: > > > > > From address: mypascal2000@REDACTED > > > > > Reply-to: mypascal2000@REDACTED > > > > > > > > > > Please check your configuration. > > > > > > > > > > > > > I have had problems with GMail as well - if you are using a GMail > > > mail > > > > address you should spell it out, ie., @googlemail.com instead of > > > gmail.com - > > > > I have not been able to configure GMail to use @gmail.com as the > > > sender. > > > > > > > > > > That is a little odd. We have 504 registered subscribers in gmail.com, > > > and 7 in googlemail.com, and I do not think those 504 are all > > > non-working. > > > > > > > The question is if the gmail.com subscribers are posting to the ML - I > > got the mails just fine with gmail.com, but I could not post with > > gmail.com. > > > > > > > > Perhaps a little remark on the registration page would be in order > > > here?!?! > > > > > > > > > > This mail domain mixup is a bit annoying. I will see if I can > > > write something appropriate... > > > > > > Perhaps we could persuade some of the gmail.com subscribers to do a test > > posting to see if my diagnosis is 100% correct before changing the web page. > > > > > > Cheers, > > Torben > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.burri@REDACTED Thu Dec 6 13:57:51 2007 From: greg.burri@REDACTED (Greg Burri) Date: Thu, 6 Dec 2007 13:57:51 +0100 Subject: [erlang-questions] Erlang Quick Reference In-Reply-To: <1196936988.4838.8.camel@isolde> References: <1196936988.4838.8.camel@isolde> Message-ID: <60ed8a460712060457h736a78d4s8f1b6614b289f079@mail.gmail.com> Hi, Here there is a handbook : http://www.erlang-consulting.com/aboutus/opensource.html ...doc format :/ /greg On 12/6/07, Michael T. Richter wrote: > Is there any beast out there that is a simple quick reference of Erlang > syntax and BIFs (something like a fold-up single sheet)? I've Googled > and checked the links in the Programming Erlang book and haven't been > able to find anything useful. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From sgolovan@REDACTED Thu Dec 6 14:13:15 2007 From: sgolovan@REDACTED (Sergei Golovan) Date: Thu, 6 Dec 2007 16:13:15 +0300 Subject: [erlang-questions] Erlang/OTP R12B-0 has been released In-Reply-To: References: Message-ID: On 12/6/07, Daniel Luna wrote: > > (Doing "make clean" didn't really give what I wanted for R11B-5. "make > clean" removed too much. (And my guess without testing is that this is > also true for R12B-0.)) Before putting Erlang/OTP R12B-0 sources to Debian repository I did the following: make -f Makefile.in primary_bootstrap_to_bootstrap_root_copy MAKE=make ERL_TOP=`pwd` BOOTSTRAP_SRC_TOP=`pwd` BOOTSTRAP_ROOT=`pwd` for f in `cat prebuilt.files` ; do rm -f $f ; done The first command saves bootstrap files, the second command removes prebuilt files. -- Sergei Golovan From adam@REDACTED Thu Dec 6 14:15:55 2007 From: adam@REDACTED (Adam Lindberg) Date: Thu, 6 Dec 2007 14:15:55 +0100 Subject: [erlang-questions] basic import for code reuse In-Reply-To: <8344a1c8-ac75-43c5-b026-03a36e297638@s36g2000prg.googlegroups.com> References: <5757d1f9-e5a8-475e-b86a-7e739c7bb660@b40g2000prf.googlegroups.com> <8344a1c8-ac75-43c5-b026-03a36e297638@s36g2000prg.googlegroups.com> Message-ID: <6344005f0712060515r22c11cdx24df877cf9dd6e0b@mail.gmail.com> Yes there is a technical reason, if you call the function member/0 in your module, how should the compiler know which module you intented to call? The imported one or the one declared in your module? Overriding is not possible in Erlang at the moment. Although there was a presentation on the subject (and others) and the Erlang User Conference (EUC) this year: http://www.erlang.se/euc/07/papers/1700Carlsson.pdf One simple way to "solve" your problem though is to just not import the member/0 function in the module you want to override it in. This way both module will have the member/0 function anyway. Thus you have to tell the modules that are not to override it to import the template function instead. Cheers, Adam On Dec 6, 2007 6:49 AM, Robin wrote: > lw_template.erl: > -module(lw_template). > -compile(export_all). > member() -> template. > > lw_special.erl: > -module(lw_special). > -compile(export_all). > -import(lw_template, [member/0]). > member() -> special. > > The error output: > Eshell V5.5.5 (abort with ^G) > 1> lw_special:member(). > ** exited: {undef,[{lw_special,member,[]}, > {erl_eval,do_apply,5}, > {shell,exprs,6}, > {shell,eval_loop,3}]} ** > > Is there any technical reason that you cannot override an imported > function? > > Thanks, > > Robin > > > On Dec 5, 7:41 pm, Robin wrote: > > This is a simple example using -import: > > > > -module(lw_template). > > -compile(export_all). > > member() -> template. > > > > -module(lw_special). > > -compile(export_all). > > -import(lw_template, [member/0]). > > member() -> special. > > > > When I import member/0 and then override it, the compiler gives the > > warning: > > > > lw_special.erl: defining imported function member/0 > > > > When I call member/0, the runtime bombs with an error: > > > > Eshell V5.5.5 (abort with ^G) > > 1> ls_special:member(). > > ** exited: {undef,[{ls_special,member,[]}, > > {erl_eval,do_apply,5}, > > {shell,exprs,6}, > > {shell,eval_loop,3}]} ** > > > > Import followed by override does not work above, so how else can you > > specialize an imported function at compile time? > > > > If the runtime bombs from overriding a function, then should the > > compiler produce an error rather than just a warning? > > > > thanks, > > > > Robin > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questi...@REDACTED > .orghttp://www.erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf.wiger@REDACTED Thu Dec 6 14:03:25 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Thu, 06 Dec 2007 14:03:25 +0100 Subject: [erlang-questions] clarify: why is Mnesia not fit for large databases In-Reply-To: <2ae2b2da0712052039h114dbc99r7bb1e493e3f89d4a@mail.gmail.com> References: <475731E0.3090104@dominicwilliams.net> <2ae2b2da0712052039h114dbc99r7bb1e493e3f89d4a@mail.gmail.com> Message-ID: <4757F31D.8060600@ericsson.com> Dave Rafkind skrev: > AFAIK mnesia has a hardcoded 2GB limit somewhere due to using 32-bit > values in some important place. Mnesia doesn't, but dets files are currently limited to 2 GB per file, and mnesia uses dets files for disc_only tables. In a fragmented disc_only table, that would amount to max 2 GB per fragment (which is not something that mnesia will check or enforce, so living close to that limit is inadvisable to say the least). Dets can also suffer fairly long repair times if it can't be sure that the file is consistent (was closed in an orderly fashion). If dets were to be replaced by a version that can handle larger files, so would Mnesia be able to handle correspondingly larger disk-based tables. For really, really big databases, one might desire a more fine-grained table synchronization method between replicas. Right now, everything is copied from the most current copy. Another thing to wish for might be a form of caching for large disk-based tables. It's reasonable to assume that mnesia can safely handle databases of a number of gigabytes, perhaps (tounge in cheek) a hundred or so gigabytes, if one thinks carefully, and the access patterns are favourable. But I don't know of anyone who actually does that, and most people who have databases that large tend to not want to be guinea pigs. (: Terabyte-size databases ought to be out of the question without major design effort in mnesia. It would also require a very clever query planner. To be clear, mnesia was never designed with this in mind. BR, Ulf W From harveyd@REDACTED Thu Dec 6 13:54:05 2007 From: harveyd@REDACTED (Dale Harvey) Date: Thu, 6 Dec 2007 12:54:05 +0000 Subject: [erlang-questions] : Why can't I reply or post to this list? In-Reply-To: References: <20071206100709.GE6177@erix.ericsson.se> <7348e9970712060409l13db11fey92d5a65da60f91d@mail.gmail.com> Message-ID: It isnt a rebranding, they were forced to change thier name for uk and germany users over a trademark dispute. the us and everywhere else are still using gmail http://news.bbc.co.uk/1/hi/business/4354954.stm On 06/12/2007, Torben Hoffmann wrote: > > Thanks for the testing mails. > > It seems that since Google has gone Beta with Google Mail all new > addresses will be in the googlemail.com domain, but there is an alias with > gmail.com. > > How can you know what your "root mail" address is? Go to Settings -> > Account and there you can see under "Send mail as" if you have a googlemail.com > or gmail.com address. > > The tricky part is that you can live happily for a long time handing out > gmail.com as you mail address suffix, but the minute you start having fun > with mailling lists that checks if you are subscribed before it lets you > post you run into the problem. > > The funny thing is that most people talk about GMail not Google mail so > the rebranding Google is trying to get in place is not quite working out as > they hoped. > > Cheers, > Torben > > On Dec 6, 2007 1:09 PM, Esbj?rn Dominique < esbjorn.dominique@REDACTED> > wrote: > > > test test > > /esbj?rn > > > > On Dec 6, 2007 11:21 AM, Torben Hoffmann > > wrote: > > > > > > > > > > > On Dec 6, 2007 11:07 AM, Raimo Niskanen < > > > raimo+erlang-questions@REDACTED> wrote: > > > > > > > On Thu, Dec 06, 2007 at 09:42:03AM +0100, Torben Hoffmann wrote: > > > > > On Dec 6, 2007 8:49 AM, Micka?l R?mond < > > > > mickael.remond@REDACTED> > > > > > wrote: > > > > > > > > > > > Hello, > > > > > > Le 6 d?c. 07 ? 07:56, Dino M. B. a ?crit : > > > > > > > > > > > > I have registerd but still I am unable to post or reply to a > > > > topic in this > > > > > > list. > > > > > > > > > > > > At the bottom of my screen it says "You can not ...." for any of > > > > available > > > > > > actions. I am posting this by sending email to > > > > > > erlang-questions@REDACTED > > > > > > > > > > > > I can see buttons to reply or post but when I click on it it > > > > asks me to > > > > > > log in and if I try, it wont let me in even though my > > > > user/password are > > > > > > correct ??? > > > > > > > > > > > > > > > > > > It seem you have trouble configuring your mail: > > > > > > From address: mypascal2000@REDACTED > > > > > > Reply-to: mypascal2000@REDACTED > > > > > > > > > > > > Please check your configuration. > > > > > > > > > > > > > > > > I have had problems with GMail as well - if you are using a GMail > > > > mail > > > > > address you should spell it out, ie., @googlemail.com instead of > > > > gmail.com - > > > > > I have not been able to configure GMail to use @gmail.com as the > > > > sender. > > > > > > > > > > > > > That is a little odd. We have 504 registered subscribers in > > > > gmail.com, > > > > and 7 in googlemail.com, and I do not think those 504 are all > > > > non-working. > > > > > > > > > > The question is if the gmail.com subscribers are posting to the ML - I > > > got the mails just fine with gmail.com, but I could not post with > > > gmail.com. > > > > > > > > > > > Perhaps a little remark on the registration page would be in order > > > > here?!?! > > > > > > > > > > > > > This mail domain mixup is a bit annoying. I will see if I can > > > > write something appropriate... > > > > > > > > > Perhaps we could persuade some of the gmail.com subscribers to do a > > > test posting to see if my diagnosis is 100% correct before changing the web > > > page. > > > > > > Cheers, > > > Torben > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- * http://hypernumbers.com * http://arandomurl.com/ * http://www.flickr.com/photos/daleharvey/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Thu Dec 6 14:14:53 2007 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 06 Dec 2007 14:14:53 +0100 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <601563.67157.qm@web60518.mail.yahoo.com> References: <601563.67157.qm@web60518.mail.yahoo.com> Message-ID: <4757F5CD.9030708@ericsson.com> greetings, i know that you do not appreciate meta discussions, but i see no way to avoid it. taking your suggested action i ignored (if you did not write ignore, and think that the exact word is really important, let me know which word to use) the 2 asides in the previous email. there was nothing else, so i had nothing to write. perhaps you did not envision this situation when you suggested the action? if this is not enough to make you get back to the subject under discussion, please let me know. bengt Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." On 12/04/07 17:57, Isaac Gouy wrote: > --- Bengt Kleberg wrote: > >> greetings, >> >> so, you think that the 3 quotes from "Timing Trials" does not >> recommend >> a certain method to show additional insights, instead they describe a >> >> certain method to show additional insights. that is ok with me. i can >> >> change from recomend to describe, without losing track of the target. >> >> moreover, i will assume that you mention "C runtimes appears >> absolutely >> horizontal" [for this test], as one example when "Timing Trials" >> write >> "anomalous behavior that deserves further attention." that is no >> problem >> with me. (if you mean that this is the one and only thing ever to >> deserve more investigation, i would like an explanation on how you >> have >> managed to arrive at that idea.) >> >> >> anyway then, we seem to agree on the following: "Timing Trials" >> observes >> that it is a good idea to have sufficiently many measuring points >> during >> benchmarking to be able to spot anomalous behaviour. i think the >> shootout does not do this and that it would be a good thing if it >> did. >> you do not want the shootout do this, for reasons never explained. > > > Do you agree that the benchmarks game has a range of input values ~10x > to ~100x, in comparison to mostly < 10x in "Timing Trials"? > > > Do you agree that the benchmarks game range of input values /has/ been > used to spot anomalous behaviour - binary-trees memory usage not > increasing for some programs? > > > ____________________________________________________________________________________ > Be a better sports nut! Let your teams follow you > with Yahoo Mobile. Try it now. http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From babo.online@REDACTED Thu Dec 6 14:53:16 2007 From: babo.online@REDACTED (Attila Babo) Date: Thu, 6 Dec 2007 15:53:16 +0200 Subject: [erlang-questions] documentation bug in R12B-0: 6.23 Bit String Comprehensions Message-ID: <597c69660712060553v7533a45es4d7a49cbcaee1c1c@mail.gmail.com> Hello, chapter 6.23 Bit String Comprehensions in the latest HTML documentation package has a bug in the example code. Original: 1> << << X*2 >> || <> <= << 1,2,3 >> >>. <<2,4,6>> Correct: 1> << << (X*2) >> || <> <= << 1,2,3 >> >>. <<2,4,6>> Regards: Attila From michael.regen@REDACTED Thu Dec 6 15:56:06 2007 From: michael.regen@REDACTED (Michael Regen) Date: Thu, 6 Dec 2007 15:56:06 +0100 Subject: [erlang-questions] clarify: SSL for distribution still broken in R12B-0? Message-ID: <9b59d0270712060656p1be7064fk20dcb8fcb03269fb@mail.gmail.com> Hi, Can someone confirm that SSL for distribution is still broken in R12B-0? For me it seems it's the old bug... I did not try to figure out how to apply the patches which helped for R11B-5 so far. Do you know, are there any plans to support SSL for distribution or is this topic simply too far down the priority list? Cheers, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn@REDACTED Thu Dec 6 15:55:24 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 06 Dec 2007 15:55:24 +0100 Subject: [erlang-questions] doc: error in the example for bit string comprehension In-Reply-To: <4756DF03.9040101@free.fr> References: <4756DF03.9040101@free.fr> Message-ID: igwan writes: > It seems that the parenthesis around X*2 were ommited > > 1> << << (X*2) >> || <> <= << 1,2,3 >> >>. > <<2,4,6>> > > works as expected. Thanks! We will correct it in R12B-1. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From per.gustafsson@REDACTED Thu Dec 6 16:06:33 2007 From: per.gustafsson@REDACTED (Per Gustafsson) Date: Thu, 06 Dec 2007 16:06:33 +0100 Subject: [erlang-questions] doc: error in the example for bit string comprehension In-Reply-To: <4756DF03.9040101@free.fr> References: <4756DF03.9040101@free.fr> Message-ID: <47580FF9.8020501@it.uu.se> Thank You, this will be corrected. Per igwan wrote: > Hi > > The example given in 6.23 of the Erlang Reference Manual in R12B-0 reads : > > 1> *<< << X*2 >> || > <> <= << 1,2,3 >> >>.* > <<2,4,6>> > > But it gives the error : * 1: syntax error before: '*' > > It seems that the parenthesis around X*2 were ommited > > 1> << << (X*2) >> || <> <= << 1,2,3 >> >>. > <<2,4,6>> > > works as expected. > > Many thanx to the OTP team for this new release! > > -- > igwan > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From igouy2@REDACTED Thu Dec 6 16:35:39 2007 From: igouy2@REDACTED (Isaac Gouy) Date: Thu, 6 Dec 2007 07:35:39 -0800 (PST) Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <4757F5CD.9030708@ericsson.com> Message-ID: <921561.45486.qm@web60511.mail.yahoo.com> --- Bengt Kleberg wrote: > i know that you do not appreciate meta discussions, but i see no way > to avoid it. > > taking your suggested action i ignored (if you did not write ignore, > and think that the exact word is really important, let me know which > word to use) the 2 asides in the previous email. there was nothing > else, so i had nothing to write. > > perhaps you did not envision this situation when you suggested the > action? > > if this is not enough to make you get back to the subject under > discussion, please let me know. I asked two direct questions, if you wish not to answer them that's up to you. You keep claiming that the benchmarks game does not have sufficiently many measuring points during benchmarking to be able to spot anomalous behaviour. Let me explain it to you one more time - /we know/ that the benchmarks game's 3 measuring points /were sufficient/ to spot anomalous behaviour in some binary-trees programs because that is how someone spotted the anomalous behaviour! There's no particular reason you would have known that is how the anomalous behaviour was detected, but now you do know - you now know that the benchmarks game measuring points have been sufficient to spot anomolous behaviour, your claim is untrue. ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs From jbamsterdam@REDACTED Thu Dec 6 17:13:41 2007 From: jbamsterdam@REDACTED (Jonathan Amsterdam) Date: Thu, 6 Dec 2007 11:13:41 -0500 Subject: [erlang-questions] beginner: why are arrays zero-based? Message-ID: <31c6fe8f0712060813g1deaf829o867aa67886ef26e4@mail.gmail.com> I'm an Erlang newbie, and very excited by the language. I have a lot of questions, but let me start with this timely one: why are the new arrays in R12B zero-based? I see in the source that the author says it's a conscious design choice, but I don't see the rationale, since everything else in the language seems to be 1-based. Keep in mind that Erlang is poised for rapid growth. The number of new users of Erlang is about to increase exponentially, and inconsistencies like this will make the language hard to teach and frustrating to learn. Jonathan Amsterdam From bjorn@REDACTED Wed Dec 5 21:38:43 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 05 Dec 2007 21:38:43 +0100 Subject: [erlang-questions] clarify: R12B-0 on mac: which libgd for installing percept ? In-Reply-To: References: <3a344bc70712050939x464c4bf6k75346ec3f7ba9cd1@mail.gmail.com> Message-ID: "Roberto Saccon" writes: > bringing the discussion back to the list (it happens that people just > to reply to the sender): > > Of course I also tried with --prefix=/opt/local, unfortunately it > still doesn't find that libgd --prefix specifies where you want Erlang/OTP installed; it is not used searching for libs. The configure script has an option specifying where gd is located; if gd really is install in /opt/local you could try this option: --with-gd=/opt/local (I have not actually tested it; only looked in erts/configure.) /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From dot@REDACTED Thu Dec 6 18:04:59 2007 From: dot@REDACTED (Tony Finch) Date: Thu, 6 Dec 2007 17:04:59 +0000 Subject: [erlang-questions] beginner: why are arrays zero-based? In-Reply-To: <31c6fe8f0712060813g1deaf829o867aa67886ef26e4@mail.gmail.com> References: <31c6fe8f0712060813g1deaf829o867aa67886ef26e4@mail.gmail.com> Message-ID: On Thu, 6 Dec 2007, Jonathan Amsterdam wrote: > > why are the new arrays in R12B zero-based? http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html The clumsiness of 1-based numbering is much more serious when you are dealing with dynamically determined subsequences a lot, as you are with array indexes. Tuple indexes tend to be more static. Tony. -- f.a.n.finch http://dotat.at/ THAMES DOVER WIGHT PORTLAND PLYMOUTH: SOUTHWESTERLY 6 TO GALE 8, OCCASIONALLY SEVERE GALE 9, PERHAPS STORM 10 LATER. ROUGH OR VERY ROUGH. RAIN OR SQUALLY SHOWERS. MODERATE, OCCASIONALLY POOR. From rsaccon@REDACTED Thu Dec 6 18:44:55 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Thu, 6 Dec 2007 15:44:55 -0200 Subject: [erlang-questions] clarify: R12B-0 on mac: which libgd for installing percept ? In-Reply-To: References: <3a344bc70712050939x464c4bf6k75346ec3f7ba9cd1@mail.gmail.com> Message-ID: that seems to do the trick, thanks very much On 05 Dec 2007 21:38:43 +0100, Bjorn Gustavsson wrote: > "Roberto Saccon" writes: > > > bringing the discussion back to the list (it happens that people just > > to reply to the sender): > > > > Of course I also tried with --prefix=/opt/local, unfortunately it > > still doesn't find that libgd > > --prefix specifies where you want Erlang/OTP installed; it is not > used searching for libs. > > The configure script has an option specifying where gd is located; > if gd really is install in /opt/local you could try this option: > > --with-gd=/opt/local > > (I have not actually tested it; only looked in erts/configure.) > > /Bjorn > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- Roberto Saccon http://rsaccon.com From richardc@REDACTED Thu Dec 6 18:45:52 2007 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 06 Dec 2007 18:45:52 +0100 Subject: [erlang-questions] beginner: why are arrays zero-based? In-Reply-To: <31c6fe8f0712060813g1deaf829o867aa67886ef26e4@mail.gmail.com> References: <31c6fe8f0712060813g1deaf829o867aa67886ef26e4@mail.gmail.com> Message-ID: <47583550.2040401@it.uu.se> Jonathan Amsterdam wrote: > I have a lot of questions, but let me start with this timely one: why > are the new arrays in R12B zero-based? I see in the source that the > author says it's a conscious design choice, but I don't see the > rationale, since everything else in the language seems to be 1-based. The point is that if you want to work a lot with indices (as opposed to doing the odd element(N,T) now and then), 1-based indexing quickly gets painful and is a big source of fencepost errors. I'll much rather take a few confused beginners (and I find it very little to ask of a programmer to remember that arrays begin at 0), than lots of annoyed users down the line when you can't change it. /Richard Carlsson From richardc@REDACTED Thu Dec 6 18:49:22 2007 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 06 Dec 2007 18:49:22 +0100 Subject: [erlang-questions] beginner: why are arrays zero-based? In-Reply-To: <47583550.2040401@it.uu.se> References: <31c6fe8f0712060813g1deaf829o867aa67886ef26e4@mail.gmail.com> <47583550.2040401@it.uu.se> Message-ID: <47583622.6020803@it.uu.se> (Oops, I managed to click on 'send' before I was done.) In case anyone has more questions, here is a piece of text that every programmer should have read and understood - Dijksra's "Why numbering should start at zero" from 1982: http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html /Richard From jbamsterdam@REDACTED Thu Dec 6 19:14:24 2007 From: jbamsterdam@REDACTED (Jonathan Amsterdam) Date: Thu, 6 Dec 2007 13:14:24 -0500 Subject: [erlang-questions] beginner: why are arrays zero-based? In-Reply-To: <47583622.6020803@it.uu.se> References: <31c6fe8f0712060813g1deaf829o867aa67886ef26e4@mail.gmail.com> <47583550.2040401@it.uu.se> <47583622.6020803@it.uu.se> Message-ID: <31c6fe8f0712061014s189136d8rba05fd82f0bd3b3e@mail.gmail.com> Thanks for the explanation. I recommend you add a link to the EWD note to the source and the docs. On Dec 6, 2007 12:49 PM, Richard Carlsson wrote: > (Oops, I managed to click on 'send' before I was done.) > > In case anyone has more questions, here is a piece of text that every > programmer should have read and understood - Dijksra's "Why numbering > should start at zero" from 1982: > > > http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html > > /Richard > From ulf.wiger@REDACTED Thu Dec 6 14:51:19 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Thu, 06 Dec 2007 14:51:19 +0100 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <4757F5CD.9030708@ericsson.com> References: <601563.67157.qm@web60518.mail.yahoo.com> <4757F5CD.9030708@ericsson.com> Message-ID: <4757FE57.3020201@ericsson.com> Bengt Kleberg skrev: > greetings, > > i know that you do not appreciate meta discussions, but i see no way to > avoid it. > > taking your suggested action i ignored (if you did not write ignore, and > think that the exact word is really important, let me know which word to > use) the 2 asides in the previous email. there was nothing else, so i > had nothing to write. > > perhaps you did not envision this situation when you suggested the action? > > if this is not enough to make you get back to the subject under > discussion, please let me know. I'm pretty sure you've lost most of the audience on this list. (: Could you perhaps resolve any remaining (meta-)issues off-line? BR, Ulf W From igouy2@REDACTED Thu Dec 6 20:07:06 2007 From: igouy2@REDACTED (Isaac Gouy) Date: Thu, 6 Dec 2007 11:07:06 -0800 (PST) Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <4757FE57.3020201@ericsson.com> Message-ID: <695283.8423.qm@web60516.mail.yahoo.com> --- "Ulf Wiger (TN/EAB)" wrote: -snip- > I'm pretty sure you've lost most of the audience on this list. (: > Could you perhaps resolve any remaining (meta-)issues off-line? My apologies. FAQ "Ask for help or discuss the benchmarks in the discussion forums." http://shootout.alioth.debian.org/gp4/faq.php#aliothid ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs From michael.campbell@REDACTED Thu Dec 6 20:18:23 2007 From: michael.campbell@REDACTED (Michael Campbell) Date: Thu, 6 Dec 2007 14:18:23 -0500 Subject: [erlang-questions] beginner: why are arrays zero-based? In-Reply-To: <31c6fe8f0712060813g1deaf829o867aa67886ef26e4@mail.gmail.com> References: <31c6fe8f0712060813g1deaf829o867aa67886ef26e4@mail.gmail.com> Message-ID: <811f2f1c0712061118i18942468qe2e5dcddde79f207@mail.gmail.com> On Dec 6, 2007 11:13 AM, Jonathan Amsterdam wrote: > I'm an Erlang newbie, and very excited by the language. > > I have a lot of questions, but let me start with this timely one: why > are the new arrays in R12B zero-based? I see in the source that the > author says it's a conscious design choice, but I don't see the > rationale, since everything else in the language seems to be 1-based. I can't let this go without forwarding a favorite quote... Apologies for the noise. "Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration." -- Stan Kelly-Bootle From jbamsterdam@REDACTED Thu Dec 6 21:28:21 2007 From: jbamsterdam@REDACTED (Jonathan Amsterdam) Date: Thu, 6 Dec 2007 15:28:21 -0500 Subject: [erlang-questions] beginner: other array implementations Message-ID: <31c6fe8f0712061228s2afc6f70ne021e199f02a849b@mail.gmail.com> Here's another question about arrays. There are two other array implementations I can think of, and I'm wondering why they weren't chosen. I am not criticizing the existing array implementation, which I'm sure is great. I'm just trying to understand the Erlang culture better by understanding the design choices you've made. 1. Standard imperative arrays, as in, say, Java. You've already got ets tables, why not add another mutable data structure? In combination with HiPE, this will let Erlang match Java speeds on many algorithms that frequently set and get array elements. 2. A functional array with an imperative implementation, the simplest of which uses the "shallow binding" or "trailers" technique (see, e.g., http://home.pipeline.com/~hbaker1/ShallowArrays.html). The data structure is functional, with constant-time performance in the single-threaded case, but requires an imperative implementation. There are more complex techniques that give better performance when accessing a version that is not the most recent, e.g. http://citeseer.ist.psu.edu/328736.html. From david.hopwood@REDACTED Thu Dec 6 21:48:30 2007 From: david.hopwood@REDACTED (David Hopwood) Date: Thu, 06 Dec 2007 20:48:30 +0000 Subject: [erlang-questions] beginner: why are arrays zero-based? In-Reply-To: <31c6fe8f0712060813g1deaf829o867aa67886ef26e4@mail.gmail.com> References: <31c6fe8f0712060813g1deaf829o867aa67886ef26e4@mail.gmail.com> Message-ID: <4758601E.5050005@industrial-designers.co.uk> Jonathan Amsterdam wrote: > I'm an Erlang newbie, and very excited by the language. > > I have a lot of questions, but let me start with this timely one: why > are the new arrays in R12B zero-based? I see in the source that the > author says it's a conscious design choice, but I don't see the > rationale, since everything else in the language seems to be 1-based. There are objective reasons to prefer 0-based indexing: > Keep in mind that Erlang is poised for rapid growth. The number of new > users of Erlang is about to increase exponentially, and > inconsistencies like this will make the language hard to teach and > frustrating to learn. There's a choice here between consistency with most other languages, and consistency within Erlang. I can see the rationale for making new features consistent with other languages. -- David Hopwood From toby@REDACTED Thu Dec 6 22:12:59 2007 From: toby@REDACTED (Toby Thain) Date: Thu, 6 Dec 2007 19:12:59 -0200 Subject: [erlang-questions] beginner: why are arrays zero-based? In-Reply-To: <811f2f1c0712061118i18942468qe2e5dcddde79f207@mail.gmail.com> References: <31c6fe8f0712060813g1deaf829o867aa67886ef26e4@mail.gmail.com> <811f2f1c0712061118i18942468qe2e5dcddde79f207@mail.gmail.com> Message-ID: <86E21BC2-469B-491A-8C24-E7C79A10DA40@smartgames.ca> On 6-Dec-07, at 5:18 PM, Michael Campbell wrote: > On Dec 6, 2007 11:13 AM, Jonathan Amsterdam > wrote: >> I'm an Erlang newbie, and very excited by the language. >> >> I have a lot of questions, but let me start with this timely one: why >> are the new arrays in R12B zero-based? I see in the source that the >> author says it's a conscious design choice, but I don't see the >> rationale, since everything else in the language seems to be 1-based. > > > I can't let this go without forwarding a favorite quote... Apologies > for the noise. > > "Should array indices start at 0 or 1? My compromise of 0.5 was > rejected without, I thought, proper consideration." -- Stan > Kelly-Bootle Noise generated by the ever-pseudo-random SKB is often appreciated. I refer interested readers to his "Computer Contradictionary" for hours of pleasure (which contains this gem). http://abebooks.com/servlet/SearchResults?sts=t&tn=computer +contradictionary --Toby > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From sgolovan@REDACTED Thu Dec 6 22:49:51 2007 From: sgolovan@REDACTED (Sergei Golovan) Date: Fri, 7 Dec 2007 00:49:51 +0300 Subject: [erlang-questions] HiPE on powerpc In-Reply-To: <200711162215.lAGMF0aE007599@harpo.it.uu.se> References: <200711162215.lAGMF0aE007599@harpo.it.uu.se> Message-ID: On 11/17/07, Mikael Pettersson wrote: > On Fri, 16 Nov 2007 22:03:20 +0300, Sergei Golovan wrote: > > > > Shouldn't HiPE architecture be adjusted in this case? Is the following > > patch correct? > > > > ----------------- > > --- erlang.orig/erts/configure.in > > +++ erlang/erts/configure.in > > @@ -372,6 +372,10 @@ > > AC_MSG_RESULT(yes: adjusting ARCH=sparc64 to ARCH=ultrasparc) > > ARCH=ultrasparc > > ;; > > +ppc64-4) > > + AC_MSG_RESULT(yes: adjusting ARCH=ppc64 to ARCH=ppc) > > + ARCH=ppc > > + ;; > > *) > > AC_MSG_RESULT(no) > > ;; > > ----------------- > > Yes, this change looks correct. > > If you can confirm that it fixes your build failure on ppc64 kernels > with gcc -m32 in userland, then I'll be happy to check it into HiPE CVS. I confirm that this patch allows to build HiPE enabled erlang succesfully (on ppc64 with 32-bit userland). You could see build log at http://experimental.debian.net/fetch.php?&pkg=erlang&ver=1%3A12.b.0-dfsg-1&arch=powerpc&stamp=1196962309&file=log&as=raw -- Sergei Golovan From kostis@REDACTED Thu Dec 6 23:08:12 2007 From: kostis@REDACTED (Kostis Sagonas) Date: Fri, 07 Dec 2007 00:08:12 +0200 Subject: [erlang-questions] HiPE on powerpc In-Reply-To: References: <200711162215.lAGMF0aE007599@harpo.it.uu.se> Message-ID: <475872CC.8030808@cs.ntua.gr> Sergei Golovan wrote: > On 11/17/07, Mikael Pettersson wrote: >> If you can confirm that it fixes your build failure on ppc64 kernels >> with gcc -m32 in userland, then I'll be happy to check it into HiPE CVS. > > I confirm that this patch allows to build HiPE enabled erlang > succesfully (on ppc64 with 32-bit userland). Thanks! The patch is already included in HiPE's CVS repository and it will be included in R12-1. Kostis (for the HiPE group) From rvirding@REDACTED Thu Dec 6 23:43:10 2007 From: rvirding@REDACTED (Robert Virding) Date: Thu, 6 Dec 2007 23:43:10 +0100 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <361FB8EB-0C84-480D-93B3-914C8E15C771@local> <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> <779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> <3dbc6d1c0712041833ofd3447ckb73ffef560d2e494@mail.gmail.com> Message-ID: <3dbc6d1c0712061443l11d18e32y3ad4990bfeabf19@mail.gmail.com> On 05/12/2007, Matthew Dempsky wrote: > > I'm not terribly interested in this thread, but on the topic of syntax > for calling functions in other modules, have any of you looked at > Scheme 48's module system? It already allows you to reload modules at > run-time without putting any sort of REMOTE-CALL burden on the code. I checked this out. It is similar to the module/library system in R6RS, other rather R6RS is similar to it. If I have understood it correctly. If you have a module foo which exports the functions a. b and c then you can reference the functions in foo from another module by doing: - (import foo) Access all the exported functions in foo directly by their name: (a ... ), (b ... ) and (c ...) - (only foo a b) Only access functions a and b in foo directly by name - (only foo (a x) (b y)) Only access functions a and b in foo, but now call them a and y - (except foo b) Access all exported except b - (prefix foo foo/) Access all the exported functions in foo but with their names prefixed by foo/: (foo/a ... ), (foo/b ... ) and (foo/ ...) You know the exports of foo at compile time and no name clashes are allowed. The module name can be more complex include hierarchy info and versions etc. This seems to be more a system for defining libraries then an inclusive module system as in Erlang, the top program is not in a module. I think this is what they mean, correct me if I misunderstood it. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Fri Dec 7 00:01:57 2007 From: rvirding@REDACTED (Robert Virding) Date: Fri, 7 Dec 2007 00:01:57 +0100 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: <779bf2730712051203jf842dcdhab154cf573250972@mail.gmail.com> References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <361FB8EB-0C84-480D-93B3-914C8E15C771@local> <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> <779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> <3dbc6d1c0712041833ofd3447ckb73ffef560d2e494@mail.gmail.com> <779bf2730712051203jf842dcdhab154cf573250972@mail.gmail.com> Message-ID: <3dbc6d1c0712061501n49444dar8c2adb8a4f4b0e91@mail.gmail.com> A lot of stuff deleted, not because it is uninteresting but just because I don't really have a reply to it yet. We'll see when I get there. On 05/12/2007, YC wrote: > > > As yours but quoted: > > (case a > > ('foo #('bar)) > > ('bar #('foo 'bar))) > > > > The one I wrote was scheme's version. It can match multiple bindings with > one clause, but that can make it harder to transform into erlang. > > > > > > foo(1) -> 2; foo(abc) -> {foo, bar}. => (defun foo ((1) 2) ((abc) #(foo > > > bar))) > > > > > > > I was more into: > > > > (defun foo (arg) > > (case arg > > (1 2) > > (abc '#(foo bar)))) > > > > To me this is where the basic lisp language doesn't offer as much as > erlang. Ability to match on the function head is a very nice syntactic > sugar - it *just* look better than case statements, especially with > recursions. > > In scheme with pattern matching lib (below is PLT scheme) one can write > What I didn't explain, or show, properly here is that (case ... ) uses Erlang type matching. So case foo(4) of {ok,Res} when is_integer(Res) -> {integer,Res}; {ok,Res} -> {other,Res}; {error,E} -> boom(E) end becomes (case (foo 4) ((#('ok res) (when (integer? res)) #('integer res)) ((#('ok res) #('other res)) ((#('error e) (boom 3))) Lastly - I think your idea is interesting and the above are my 2 cents of > input to your goal, hopefully it helps more than it hurts :) > No worries, I have no problems in stealing other peoples' good ideas. p.s. did you see Mark Feely's scheme to erlang? It might provide some > inspirations. http://www.erlang.org/pipermail/erlang-questions/2007-June/027057.html > > Yes, I read it, but unfortunately from the point of view of the current discussion he ignores the interesting question of inter-module calls. :-) Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew@REDACTED Fri Dec 7 00:31:50 2007 From: matthew@REDACTED (Matthew Dempsky) Date: Thu, 6 Dec 2007 15:31:50 -0800 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: <3dbc6d1c0712061443l11d18e32y3ad4990bfeabf19@mail.gmail.com> References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <361FB8EB-0C84-480D-93B3-914C8E15C771@local> <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> <779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> <3dbc6d1c0712041833ofd3447ckb73ffef560d2e494@mail.gmail.com> <3dbc6d1c0712061443l11d18e32y3ad4990bfeabf19@mail.gmail.com> Message-ID: On 12/6/07, Robert Virding wrote: > This seems to be more a system for defining libraries then an inclusive > module system as in Erlang, the top program is not in a module. I'm not familiar with the trainwreck-called-R6RS, but that statement is not true for Scheme 48's module system. From rvirding@REDACTED Fri Dec 7 01:57:34 2007 From: rvirding@REDACTED (Robert Virding) Date: Fri, 7 Dec 2007 01:57:34 +0100 Subject: [erlang-questions] Lisp syntax for Erlang In-Reply-To: References: <3dbc6d1c0711251803j552680e5v4ab1f05116bd3938@mail.gmail.com> <3dbc6d1c0711291506u21502d83i2e4a1a09b041c24d@mail.gmail.com> <361FB8EB-0C84-480D-93B3-914C8E15C771@local> <3dbc6d1c0712020421g562957f8xbada703116ee6a0@mail.gmail.com> <779bf2730712031851j1d392bfbn17d6fa4d2294f10d@mail.gmail.com> <3dbc6d1c0712041833ofd3447ckb73ffef560d2e494@mail.gmail.com> <3dbc6d1c0712061443l11d18e32y3ad4990bfeabf19@mail.gmail.com> Message-ID: <3dbc6d1c0712061657r7d021a27ide9d5e8922a227e@mail.gmail.com> On 07/12/2007, Matthew Dempsky wrote: > > On 12/6/07, Robert Virding wrote: > > This seems to be more a system for defining libraries then an inclusive > > module system as in Erlang, the top program is not in a module. > > I'm not familiar with the trainwreck-called-R6RS, but that statement > is not true for Scheme 48's module system. > You don't like the new standard? It has certainly grown. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From ttmrichter@REDACTED Fri Dec 7 05:42:10 2007 From: ttmrichter@REDACTED (Michael T. Richter) Date: Fri, 07 Dec 2007 12:42:10 +0800 Subject: [erlang-questions] Erlang Quick Reference In-Reply-To: <60ed8a460712060457h736a78d4s8f1b6614b289f079@mail.gmail.com> References: <1196936988.4838.8.camel@isolde> <60ed8a460712060457h736a78d4s8f1b6614b289f079@mail.gmail.com> Message-ID: <1197002530.23748.1.camel@isolde> On Thu, 2007-12-06 at 13:57 +0100, Greg Burri wrote: > Here there is a handbook : > http://www.erlang-consulting.com/aboutus/opensource.html > > ...doc format :/ OK, that looks like a good basis upon which to build a quick reference sheet. Is the author of that piece sanguine about people hacking up his work into another form? And if so, is there anybody willing to vet the final copy for accuracy? From vlm@REDACTED Fri Dec 7 07:50:36 2007 From: vlm@REDACTED (Lev Walkin) Date: Thu, 06 Dec 2007 22:50:36 -0800 Subject: [erlang-questions] Escript and hidden nodes Message-ID: <4758ED3C.60807@lionet.info> Hi, erl has an option flag -hidden: Hidden nodes always establish hidden con- nections to all other nodes except for nodes in the same global group. Hidden connections are not published on neither of the connected nodes, i.e. neither of the connected nodes are part of the result from nodes/0 on the other node. I have a maintenance code which is getting run through escript: #!/usr/local/bin/escript main(_) -> net_kernel:start(['code-update', shortnames]), Node = ... rpc:call(Node, code, purge, [...]). Hovewer, this code causes the remote node to be aware of this maintenance script since it is getting reflected in its nodes() output. Moreover, the remote node receiving these maintenance operations attempts to create a back-channel to this maintenance script node, which is undesirable since maintenance script might be running on a private NAT'd network and can't receive backwards connection from a maintained system. My question is how to enable hidden operation of such maintenance scripts, either through a command line option to escript or some magic parameter to net_kernel:start()? -- Lev Walkin vlm@REDACTED From ulf@REDACTED Fri Dec 7 09:11:23 2007 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 7 Dec 2007 09:11:23 +0100 Subject: [erlang-questions] Escript and hidden nodes In-Reply-To: <4758ED3C.60807@lionet.info> References: <4758ED3C.60807@lionet.info> Message-ID: <8209f740712070011y19f56a92k84701c9835add9ea@mail.gmail.com> Not having tried, I would guess you should use net_kernel:hidden_connect(Node) instead of using rpc:call() set up the connection automatically. BR, Ulf W 2007/12/7, Lev Walkin : > > Hi, > > erl has an option flag -hidden: > > Hidden nodes always establish hidden con- > nections to all other nodes except for nodes in the same global > group. Hidden connections are not published on neither of the > connected nodes, i.e. neither of the connected nodes are part of > the result from nodes/0 on the other node. > > I have a maintenance code which is getting run through escript: > > #!/usr/local/bin/escript > main(_) -> > net_kernel:start(['code-update', shortnames]), > Node = ... > rpc:call(Node, code, purge, [...]). > > Hovewer, this code causes the remote node to be aware of this > maintenance script since it is getting reflected in its nodes() > output. Moreover, the remote node receiving these maintenance > operations attempts to create a back-channel to this maintenance > script node, which is undesirable since maintenance script > might be running on a private NAT'd network and can't receive > backwards connection from a maintained system. > > My question is how to enable hidden operation of such maintenance > scripts, either through a command line option to escript or > some magic parameter to net_kernel:start()? > > -- > Lev Walkin > vlm@REDACTED > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From Dmitri.Girenko@REDACTED Fri Dec 7 09:11:28 2007 From: Dmitri.Girenko@REDACTED (Dmitri Girenko) Date: Fri, 7 Dec 2007 10:11:28 +0200 Subject: [erlang-questions] Erlang Quick Reference In-Reply-To: <1197002530.23748.1.camel@isolde> References: <1196936988.4838.8.camel@isolde><60ed8a460712060457h736a78d4s8f1b6614b289f079@mail.gmail.com> <1197002530.23748.1.camel@isolde> Message-ID: <697074A35ED91748882E3850BDCE295EC8EA04@leenu.akumiitti.net> http://gotapi.com/erlang - this is the one I use almost every day :-) > -----Original Message----- > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions- > bounces@REDACTED] On Behalf Of Michael T. Richter > Sent: 7. joulukuuta 2007 6:42 > To: erlang-questions > Subject: Re: [erlang-questions] Erlang Quick Reference > > On Thu, 2007-12-06 at 13:57 +0100, Greg Burri wrote: > > Here there is a handbook : > > http://www.erlang-consulting.com/aboutus/opensource.html > > > > ...doc format :/ > > OK, that looks like a good basis upon which to build a quick reference > sheet. Is the author of that piece sanguine about people hacking up his > work into another form? And if so, is there anybody willing to vet the > final copy for accuracy? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From bekesa@REDACTED Fri Dec 7 09:17:13 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Fri, 07 Dec 2007 09:17:13 +0100 Subject: [erlang-questions] documentation of data structures Message-ID: <200712070917.13979.bekesa@sch.bme.hu> Hi, I've checked the manpage of the new array data structure, and I don't find any info about its runtime (and space) compexity. I think not knowing the implementation details is OK, but the runtime complexity of the most frequently used operations on a data structure is needed in the documentation I think. I've checked (hopefully) every data structure: - ordsets and orddict: The doc states that they are represented as ordered lists. It doesn't mention the complexities of the operations, it is OK because the implementation is rather trivial and an Erlang programmer is expected to know the runtime behaviour of such operations. -sets and dict: The doc states that the representation is not defined. I think the doc shoud give a worst case complexity of the operations that will not change no matter how the implementation changes. - gb_sets and gb_trees: The doc states the implementation. For gb_trees, the complexities are not given. For gb_sets it gives info about the complexity on set operations, however, it might be better to give the complexities of for each of the operations, instead of just separating "set operations" and "lookup (membership testing), insertion and deletion". -queue: The doc doesn't say anything about the implementation, only: "implements FIFO queues in an efficient manner". It states that "all operations has an amortised O(1) running time", except for some, that are "probably O(n)". This is rather vague. - array: The doc doesn't say anything. Not even that the implementation is not defined. The docs should be made complete and consistent ie. should state the same infos in the same style for each of these data structures. Georgy From vlm@REDACTED Fri Dec 7 09:23:55 2007 From: vlm@REDACTED (Lev Walkin) Date: Fri, 07 Dec 2007 00:23:55 -0800 Subject: [erlang-questions] Escript and hidden nodes In-Reply-To: <8209f740712070011y19f56a92k84701c9835add9ea@mail.gmail.com> References: <4758ED3C.60807@lionet.info> <8209f740712070011y19f56a92k84701c9835add9ea@mail.gmail.com> Message-ID: <4759031B.9090609@lionet.info> Ulf, there's no net_kernel:hidden_connect() in the net_kernel manual page. Moreover, the source code lists hidden_connect() and hidden_connect_node() as two possible variants, both exported. Which one do you recommend? Ulf Wiger wrote: > Not having tried, I would guess you should use > net_kernel:hidden_connect(Node) instead of using rpc:call() > set up the connection automatically. > > BR, > Ulf W > > 2007/12/7, Lev Walkin : >> Hi, >> >> erl has an option flag -hidden: >> >> Hidden nodes always establish hidden con- >> nections to all other nodes except for nodes in the same global >> group. Hidden connections are not published on neither of the >> connected nodes, i.e. neither of the connected nodes are part of >> the result from nodes/0 on the other node. >> >> I have a maintenance code which is getting run through escript: >> >> #!/usr/local/bin/escript >> main(_) -> >> net_kernel:start(['code-update', shortnames]), >> Node = ... >> rpc:call(Node, code, purge, [...]). >> >> Hovewer, this code causes the remote node to be aware of this >> maintenance script since it is getting reflected in its nodes() >> output. Moreover, the remote node receiving these maintenance >> operations attempts to create a back-channel to this maintenance >> script node, which is undesirable since maintenance script >> might be running on a private NAT'd network and can't receive >> backwards connection from a maintained system. >> >> My question is how to enable hidden operation of such maintenance >> scripts, either through a command line option to escript or >> some magic parameter to net_kernel:start()? >> >> -- >> Lev Walkin >> vlm@REDACTED >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> From ingela@REDACTED Fri Dec 7 09:38:21 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Fri, 07 Dec 2007 09:38:21 +0100 Subject: [erlang-questions] httpd_util:to_lower/1 in R12B-0 In-Reply-To: References: Message-ID: <4759067D.8030500@erix.ericsson.se> > The R12B-0 says that httpd_util:to_lower/1 is deprecated and will be > removed in a future release, but it is apparently already removed. The following functions httpd_util:to_lower/1, httpd_util:to_upper/1, httpd_util:decode_base64/1, httpd_util:encode_base64/1 where deprecated already in in R11 (not in R11B-0 though) and hence removed in R12. We apologize if the compiler warnings where not updated accordingly. > Note the D in httpd_util. There is a http_util:to_lower/1. > I don't object to the new string:to_lower/1 and > I have no problem at all in making this change to my code, and > I may have made an extra sucky choice in using httpd_util:to_lower/1 > instead of http_util:to_lower/1 (I blame someone else ;) ), You do not need to be ashamed of that, http_util has never been a documented module and we do not want it to be either. It was created in an effort to remove code duplication between the http server and client. httpd_util however is documented, it had quite a few functions that already from the beginning should have been placed in more general places such as string. We have tried to clean that up. In general the httpd_util module should only be used by code implementing new mod_*-modules for the inets HTTP-server. Personally I would rather not have httpd_util as an API module at all, I think there are even more clean ups in the HTTP server that could be desirable, (even though quite a lot has been done for r12), but such changes has to be done gradually and removing httpd_util completely will probably be a too big cost. > but I would like to point out that the deprecation warning doesn't match > reality. > /Fredrik Regards Ingela - OTP team From ulf@REDACTED Fri Dec 7 09:46:44 2007 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 7 Dec 2007 09:46:44 +0100 Subject: [erlang-questions] Escript and hidden nodes In-Reply-To: <4759031B.9090609@lionet.info> References: <4758ED3C.60807@lionet.info> <8209f740712070011y19f56a92k84701c9835add9ea@mail.gmail.com> <4759031B.9090609@lionet.info> Message-ID: <8209f740712070046u1d6ce641sbd538f808bf38448@mail.gmail.com> I don't know how much my recommendation is worth in this regard, as I don't speak for OTP, and haven't tried this, but from looking at the source, I'd definitely use net_kernel:hidden_connect_node(Node), since it corresponds to connect_node(Node), which /is/ documented. hidden_connect/1 is called through BIFs, according to the comments, so I'd stay away from that one, and apologies for firing off my previous mail too quickly. (: BR, Ulf W 2007/12/7, Lev Walkin : > > Ulf, there's no net_kernel:hidden_connect() in the > net_kernel manual page. Moreover, the source code > lists hidden_connect() and hidden_connect_node() > as two possible variants, both exported. Which > one do you recommend? > > Ulf Wiger wrote: > > Not having tried, I would guess you should use > > net_kernel:hidden_connect(Node) instead of using rpc:call() > > set up the connection automatically. > > > > BR, > > Ulf W > > > > 2007/12/7, Lev Walkin : > >> Hi, > >> > >> erl has an option flag -hidden: > >> > >> Hidden nodes always establish hidden con- > >> nections to all other nodes except for nodes in the same global > >> group. Hidden connections are not published on neither of the > >> connected nodes, i.e. neither of the connected nodes are part of > >> the result from nodes/0 on the other node. > >> > >> I have a maintenance code which is getting run through escript: > >> > >> #!/usr/local/bin/escript > >> main(_) -> > >> net_kernel:start(['code-update', shortnames]), > >> Node = ... > >> rpc:call(Node, code, purge, [...]). > >> > >> Hovewer, this code causes the remote node to be aware of this > >> maintenance script since it is getting reflected in its nodes() > >> output. Moreover, the remote node receiving these maintenance > >> operations attempts to create a back-channel to this maintenance > >> script node, which is undesirable since maintenance script > >> might be running on a private NAT'd network and can't receive > >> backwards connection from a maintained system. > >> > >> My question is how to enable hidden operation of such maintenance > >> scripts, either through a command line option to escript or > >> some magic parameter to net_kernel:start()? > >> > >> -- > >> Lev Walkin > >> vlm@REDACTED > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://www.erlang.org/mailman/listinfo/erlang-questions > >> > > From bekesa@REDACTED Fri Dec 7 09:57:25 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Fri, 07 Dec 2007 09:57:25 +0100 Subject: [erlang-questions] documentation of data structures In-Reply-To: <200712070917.13979.bekesa@sch.bme.hu> References: <200712070917.13979.bekesa@sch.bme.hu> Message-ID: <200712070957.25696.bekesa@sch.bme.hu> > I've checked (hopefully) every data structure: Oh, I've forgotten ets: The doc clearly states that "constant access time to the data. (In the case of ordered_set, see below, access time is proportional to the logarithm of the number of objects stored)". I have a few little problems with this: - "see below" in the above sentence. I haven't found anything below that states something about the implementaion or the complexity of operations of ordered_sets, except for one sentence about lookup/2: "time is proportional to the (binary) logarithm of the number of objects." Isn't this the same as the above? - "amortized constant access time" would be more appropriate instead of "constant access time". - The doc does not state anything about the difference in cost between bag and duplicate_bag. I think bags are more costly, as for each insert not only the key has to be matched but the whole structure. But this is not stated anywhere therefore I am not sure in this. - The doc states that set, bag and duplicate_bag work with matching while ordered_set does comparing. This is described in detail 4 times (!) in the man page, with more-or-less the same words. This should be done once somewhere in the beginning of the manpage. I hope I was constructive enough :-) Georgy From vychodil.hynek@REDACTED Fri Dec 7 10:07:59 2007 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Fri, 7 Dec 2007 10:07:59 +0100 Subject: [erlang-questions] bug: R12B documentation html pages doesn't contain cp Message-ID: <4d08db370712070107i3fd4de84yd825795a7fcbef0d@mail.gmail.com> Erlang/OTP documentation pages doesn't contain charset meta. I think it isn't big trouble add iso-8859-1 charset info to this. It would be work better for nonenglish users. (And or configure erlang.org webserver to include coding to http header too.) Thanks! -- --Hynek (Pichi) Vychodil From richardc@REDACTED Fri Dec 7 10:20:16 2007 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 07 Dec 2007 10:20:16 +0100 Subject: [erlang-questions] documentation of data structures In-Reply-To: <200712070917.13979.bekesa@sch.bme.hu> References: <200712070917.13979.bekesa@sch.bme.hu> Message-ID: <47591050.6020900@it.uu.se> Andras Georgy Bekes wrote: > - array: The doc doesn't say anything. Not even that the implementation > is not defined. > > The docs should be made complete and consistent ie. should state the > same infos in the same style for each of these data structures. I agree. We just forgot to mention it. Meanwhile, here is a summary for the array module: - The implementation uses a tree of tuples. - Operations that access or update a single element are O(log n). - Whole-array operations are O(n * log n). - The main reasons why arrays are more efficient than binary trees are that they use wider tuples (log10 instead of log2), and that the computations while traversing a chain of nodes are simpler (integer arithmetic for selecting a subtree, rather than key comparisons). /Richard From kenneth.lundin@REDACTED Fri Dec 7 10:21:50 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 7 Dec 2007 10:21:50 +0100 Subject: [erlang-questions] bug: R12B documentation html pages doesn't contain cp In-Reply-To: <4d08db370712070107i3fd4de84yd825795a7fcbef0d@mail.gmail.com> References: <4d08db370712070107i3fd4de84yd825795a7fcbef0d@mail.gmail.com> Message-ID: Hi, Thanks for pointing this out. I will look into this before the next release of the doc (probably R12B-1). It should be easy since almost all of the html doc is generated. We are in the process of improving the html generate and I also have a plan to use XHTML for all docs. /Regards Kenneth Erlang/OTP team Ericsson AB On 12/7/07, Hynek Vychodil wrote: > Erlang/OTP documentation pages doesn't contain charset meta. I think > it isn't big trouble add iso-8859-1 charset info to this. It would be > work better for nonenglish users. (And or configure erlang.org > webserver to include coding to http header too.) > > Thanks! > > -- > --Hynek (Pichi) Vychodil > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From ingela@REDACTED Fri Dec 7 10:28:42 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Fri, 07 Dec 2007 10:28:42 +0100 Subject: [erlang-questions] PostgreSQL driver (YC) In-Reply-To: <779bf2730712031421q58b9954fucedb9345abc780a@mail.gmail.com> References: <4754320B.5020707@erix.ericsson.se> <779bf2730712031421q58b9954fucedb9345abc780a@mail.gmail.com> Message-ID: <4759124A.2010103@erix.ericsson.se> YC wrote: > > On Dec 3, 2007 8:42 AM, Ingela Anderton Andin > wrote: > > > > If the drivers on linux for psql are slow is not really an Erlang > > problem, but of course it > > can make that option a non interesting one. > > > Is that what the error port_exit means in > http://www.erlang.org/pipermail/erlang-questions/2007-October/029787.html > and > http://www.erlang.org/pipermail/erlang-questions/2007-November/030813.html? > The port appears to close quickly so I can't tell whether it's a speed > issue. This most likely depends on the fact that the odbc-driver you are using is implemented using ODBC-2.X standard and not 3.Y. The Erlang ODBC application is designed using the version 3.0 of the ODBC-standard, however using the option |{scrollable_cursors, off} | for a connection has been known to make it work for at least some 2.X drivers. Did you try that? Regards Ingela - OTP team From alceste@REDACTED Fri Dec 7 10:36:49 2007 From: alceste@REDACTED (Alceste Scalas) Date: Fri, 07 Dec 2007 10:36:49 +0100 Subject: [erlang-questions] Erlang and GPU libraries In-Reply-To: <6ce0ac130712051024i5be3aba5g36050da654c4a60@mail.gmail.com> References: <200711211858.lALIwuMG018748@morgoth.cslab.ericsson.net> <1195672232.4764.4.camel@metalman.lan> <6ce0ac130712051024i5be3aba5g36050da654c4a60@mail.gmail.com> Message-ID: <1197020209.6601.113.camel@gnatziu.crs4.it> Il giorno mer, 05/12/2007 alle 11.24 -0700, Brian Granger ha scritto: > We are working on GPU libraries for a number of other languages and > Erlang might be another interesting target. But, does Erlang have > array/vector/matrix classes that > > 1) are represented by continguous memory blocks > > 2) have elements that correspond the standard C datatypes int, float, etc. > > This would be needed to interface with a GPU. I don't think you need a native Erlang data type in order to store matrices/vectors. Here at CRS4 we just use Erlang binaries to store floating point arrays, and perform operations on them with our BLAS library bindings. In order to perform foreign function calls and handle underlying C types, we rely on the Erlang FFI patches [1] (shameless plug). In theory you could do the same by developing a standard Erlang linked-in driver, but it would require *huge* efforts. Right now we link against ATLAS [2], but if/when we will decide to buy some hardware based on ATI FireStream [3] or nVIDIA Tesla [4], we could link our BLAS bindings against (respectively) ACML [5] or CUDA BLAS [6] --- and the number crunching *should* run on GPUs transparently [7]. Regards, alceste References: [1] Foreign Function Interface for Erlang/OTP http://muvara.org/crs4/erlang/ffi [2] Automatically Tuned Linear Algebra Software http://math-atlas.sourceforge.net/ [3] ATI FireStream 9170 http://ati.amd.com/products/streamprocessor/specs.html [4] nVIDIA Tesla http://www.nvidia.com/object/tesla_computing_solutions.html [5] AMD Core Math Library http://developer.amd.com/acml.jsp [6] nVIDIA Compute Unified Device Architecture http://developer.nvidia.com/object/cuda.html [7] It would work out-of-the-box and maintain the functional style of our BLAS bindings, since matrices/vectors would be garbage collected by the Erlang VM. However, it would also cause a dramatic overhead, since all data would be copied to/from GPU memory before/after each operation. It would be possible to substitute floating point binaries with GPU memory references, but allocations and deallocations would require manual handling, and the functional API style would be lost (unless we find some trick to circumvent the issue --- but we didn't investigate it yet). -- Alceste Scalas CRS4 - http://www.crs4.it/ From mateuszb@REDACTED Fri Dec 7 11:16:51 2007 From: mateuszb@REDACTED (Mateusz Berezecki) Date: Fri, 7 Dec 2007 11:16:51 +0100 Subject: [erlang-questions] configure errors with R12B-0 on OS X Leopard In-Reply-To: <65b2728e0712050845r8b922a0m95929e64bb6e7b2c@mail.gmail.com> References: <65b2728e0712050845r8b922a0m95929e64bb6e7b2c@mail.gmail.com> Message-ID: <9F32D4CC-98F8-45D8-8D4A-07FF741A2787@gmail.com> On Dec 5, 2007, at 5:45 PM, Steve Vinoski wrote: > > Has anyone else seen similar problems? Is this worth worrying about, > and if so, what's the correct solution? I have the similar messages but it is not worth worrying. I've not been experiencing any problems at all with R12 on Leopard and it works just fine. Matt From bengt.kleberg@REDACTED Fri Dec 7 13:48:49 2007 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Fri, 07 Dec 2007 13:48:49 +0100 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <4757FE57.3020201@ericsson.com> References: <601563.67157.qm@web60518.mail.yahoo.com> <4757F5CD.9030708@ericsson.com> <4757FE57.3020201@ericsson.com> Message-ID: <47594131.7000402@ericsson.com> greetings, as for losing audience i hope that my suggestion at the start of this discussion (''do not read this'') was followed by as many as possible. having experienced isaac some 2-3 years ago (that time was much worse since i was unprepared) i expected something like this and thus offered the warning. taking this from the mail list is a good idea in theory. it was my first reaction when things turned ugly all those years ago. unfortunately isaac took the private email i sent him, chopped it into little pieces, removing things like explanations, smilies, etc. he then posted these pieces as straw man arguments on the mail list. using his normal acerbic tone, he proceeded smashing them to dust. i sent another private email explaining that he had hurt me, asking him to stop doing such things, and giving me an apology. his (private) answer was much more brutal than his mail list postings, the point being that his act was not illegal and he would never apologise. finally he wrote that we should never send private email to each other again. so in practice i am not taking this off-line even though it would be a nice thing for this list. bengt Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." On 12/06/07 14:51, Ulf Wiger (TN/EAB) wrote: > Bengt Kleberg skrev: >> greetings, >> >> i know that you do not appreciate meta discussions, but i see no way >> to avoid it. >> >> taking your suggested action i ignored (if you did not write ignore, >> and think that the exact word is really important, let me know which >> word to use) the 2 asides in the previous email. there was nothing >> else, so i had nothing to write. >> >> perhaps you did not envision this situation when you suggested the >> action? >> >> if this is not enough to make you get back to the subject under >> discussion, please let me know. > > I'm pretty sure you've lost most of the audience on this list. (: > Could you perhaps resolve any remaining (meta-)issues off-line? > > BR, > Ulf W From bengt.kleberg@REDACTED Fri Dec 7 14:13:07 2007 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Fri, 07 Dec 2007 14:13:07 +0100 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <921561.45486.qm@web60511.mail.yahoo.com> References: <921561.45486.qm@web60511.mail.yahoo.com> Message-ID: <475946E3.6070504@ericsson.com> greetings, your 2 questions are perfectly fine questions. i will answer them now that you have explained that they are not asides i should ignore. however, first i want to reach a conclusion to the current subject we are discussing. is that ok? bengt Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." On 12/06/07 16:35, Isaac Gouy wrote: > --- Bengt Kleberg wrote: > >> i know that you do not appreciate meta discussions, but i see no way >> to avoid it. >> >> taking your suggested action i ignored (if you did not write ignore, >> and think that the exact word is really important, let me know which >> word to use) the 2 asides in the previous email. there was nothing >> else, so i had nothing to write. >> >> perhaps you did not envision this situation when you suggested the >> action? >> >> if this is not enough to make you get back to the subject under >> discussion, please let me know. > > > I asked two direct questions, if you wish not to answer them that's up > to you. > > You keep claiming that the benchmarks game does not have sufficiently > many measuring points during benchmarking to be able to spot anomalous > behaviour. > > Let me explain it to you one more time - /we know/ that the benchmarks > game's 3 measuring points /were sufficient/ to spot anomalous behaviour > in some binary-trees programs because that is how someone spotted the > anomalous behaviour! > > There's no particular reason you would have known that is how the > anomalous behaviour was detected, but now you do know - you now know > that the benchmarks game measuring points have been sufficient to spot > anomolous behaviour, your claim is untrue. > > > ____________________________________________________________________________________ > Never miss a thing. Make Yahoo your home page. > http://www.yahoo.com/r/hs > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From joelr1@REDACTED Fri Dec 7 14:48:44 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 7 Dec 2007 13:48:44 +0000 Subject: [erlang-questions] EFFI: The 80% solution to Erlang FFI woes Message-ID: <0D97A09F-CFAE-4320-A6EF-F2547C28A07E@gmail.com> I will admit from the start that I'm a staunch hater of the current Erlang Foreign Function Interface (FFI, aka linked-in driver mechanism). If there's something preventing application of Erlang to a wider range of tasks then this must be it! I'm familiar with the FFI in Haskell, Lisp and OCaml. The current linked-in driver mechanism may be no less functional but it beats all others in ugliness and complexity... with a VERY LARGE wooden hammer!!! While the recently mentioned FFI enhancement proposal is being considered, I would like to propose EFFI as the 80% solution. I just started implementing this API and library for a chapter of my upcoming "Hardcore Erlang" book. Please feel free to ask questions as well as poke holes in the code below. The intent is to wrap the POSIX Regex API in /usr/include/ regex.h. Once regex_effi:generate/0 is called you should end up with the files cflags.erl, eflags.erl and reg_error.erl with the enumeration handling code, as well as regex.erl and regex_driver.c with the rest of the wrapper code. The focus is on using Erlang in a declarative fashion instead of typing up lots of XML like EDTK requires. Without further ado... -module(regex_effi). -compile([export_all]). -include("regex.hrl"). generate() -> effi:start(regex), effi:struct(regmatch_t, [int64, int64]), % structure with 2 fields %% regcomp() flags effi:enum(cflags, int, [{reg_basic, 8#0000}, {reg_extended, 8#0001}, {reg_icase, 8#0002}, {reg_nosub, 8#0004}, {reg_newline, 8#0010}, {reg_nospec, 8#0020}, {reg_pend, 8#0040}, {reg_dump, 8#0200}]), %% regexec() flags effi:enum(eflags, int, [{reg_notbol, 8#00001}, {reg_noteol, 8#00002}, {reg_startend, 8#00004}, {reg_trace, 8#00400}, % tracing of execution {reg_large, 8#01000}, % force large representation {reg_backr, 8#02000}]), % force use of backref code %% regerror() flags effi:enum(reg_error, int, [{reg_enosys, -1}, % reserved {reg_nomatch, 1}, {reg_badpat, 2}, {reg_ecollate, 3}, {reg_ectype, 4}, {reg_eescape, 5}, {reg_esubreg, 6}, {reg_ebrack, 7}, {reg_eparen, 8}, {reg_ebrace, 9}, {reg_badbr, 10}, {reg_erange, 11}, {reg_espace, 12}, {reg_badrpt, 13}, {reg_empty, 14}, {reg_assert, 15}, {reg_invarg, 16}, {reg_illseq, 17}]), effi:function("regcomp", regerror, % regerror is the return type [{"preg", out, regex_t}, % output argument {"pattern", ptr, char}, % ptr = pointer {"cflags", cflags}]), effi:function("regexec", regerror, [{"preg", out, regex_t}, {"string", ptr, char}, {"nmatch", int}, {"pmatch", regmatch_t, array}, % array of structs must be given {"eflags", eflags}]), effi:function("regerror", int, [{"errcode", int}, {"preg", ptr, regex_t}, {"errbuf", ptr, char}, {"errbuf_size", int}]), effi:function("regfree", void, [{ptr, regex_t}]), effi:generate(regex), effi:stop(regex). -- http://wagerlabs.com From mikpe@REDACTED Fri Dec 7 15:28:17 2007 From: mikpe@REDACTED (Mikael Pettersson) Date: Fri, 7 Dec 2007 15:28:17 +0100 (MET) Subject: [erlang-questions] [PATCH R12B-0] fix HiPE x86 build on OSX Leopard Message-ID: <200712071428.lB7ESH1e003672@harpo.it.uu.se> Update HiPE x86 to use the officially sanctioned type name for alternate signal stacks. Fixes build error on OSX Leopard. This change has been committed and will appear in R12B-1. --- otp_src_R12B-0/erts/emulator/hipe/hipe_x86_signal.c.~1~ 2007-11-26 19:58:54.000000000 +0100 +++ otp_src_R12B-0/erts/emulator/hipe/hipe_x86_signal.c 2007-12-07 13:12:36.000000000 +0100 @@ -256,7 +256,7 @@ int sigaction(int signum, const struct s */ static void hipe_sigaltstack(void *ss_sp) { - struct sigaltstack ss; + stack_t ss; ss.ss_sp = ss_sp; ss.ss_flags = SS_ONSTACK; From ingela@REDACTED Fri Dec 7 15:17:06 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Fri, 07 Dec 2007 15:17:06 +0100 Subject: [erlang-questions] http:request with delete method (Zvi) In-Reply-To: References: Message-ID: <475955E2.3080509@erix.ericsson.se> Sorry for the somewhat late response I have been a bit preoccupied by R12. > > Anyone know, how to perform HTTP DELETE method with inets? > > Is this is a right way: > > {ok, Response} = http:request(delete, {URL,[]}, [], [{sync,true}]). > > > Yes this looks correct. It is documented in the http-client manual page. http://www.erlang.org/doc/apps/inets/index.html Regards Ingela - OTP team From rickard.s.green@REDACTED Fri Dec 7 15:17:33 2007 From: rickard.s.green@REDACTED (Rickard Green) Date: Fri, 07 Dec 2007 15:17:33 +0100 Subject: [erlang-questions] Source patch for R12B-0 available Message-ID: <475955FD.8@ericsson.com> A patch that fixes the following issues is now available at http://www.erlang.org/download.html . Instructions for applying the patch can be found in the patch README. BR, Rickard Green, Erlang/OTP, Ericsson AB. ------------------------------------------------------------------------ OTP-7006 The SMP emulator on sparc64 erroneously used the sparc32 atomic and the sparc32 spinlock implementations which caused it to crash. OTP-7012 Matching an empty binary in a record and then using the same record again could cause a compiler crash. Example code that triggers the crash: -record(r, {a,b}). t(R) -> #r{a = <<>>} = R, R#r.b. OTP-7013 file:read/2 and file:consult_stream/1,3 did not use an empty prompt on I/O devices. This bug has now been corrected. OTP-7014 configuring --enable-darwin-universal or --enable-darwin-64bit on MacOSX could result in a non optimized emulator. Top level configure script now corrected. OTP-7015 configuring --with-gd did not produce correct include flags for percept. ------------------------------------------------------------------------ From mikpe@REDACTED Fri Dec 7 15:44:53 2007 From: mikpe@REDACTED (Mikael Pettersson) Date: Fri, 7 Dec 2007 15:44:53 +0100 (MET) Subject: [erlang-questions] [PATCH R12B-0] fix HiPE no_remove_comments option regression Message-ID: <200712071444.lB7EirWh003737@harpo.it.uu.se> This patch corrects the HiPE compiler to not crash if the user passes the no_remove_comments option to it. The default is to remove internally generated comment instructions as soon as possible, which is why we didn't catch this error before. This change has been committed and will appear in R12B-1. --- otp_src_R12B-0/lib/hipe/icode/hipe_icode_range.erl.~1~ 2007-11-26 20:01:41.000000000 +0100 +++ otp_src_R12B-0/lib/hipe/icode/hipe_icode_range.erl 2007-12-07 13:12:38.000000000 +0100 @@ -163,7 +163,8 @@ analyse_insn(I, Info, LookupFun) -> #move{} -> analyse_move(NewI); #phi{} -> analyse_phi(NewI); #fmove{} -> analyse_fmove(NewI); - #begin_handler{} -> analyse_begin_handler(NewI) + #begin_handler{} -> analyse_begin_handler(NewI); + #comment{} -> NewI end, {enter_vals(FinalI,Info), FinalI}. From igouy2@REDACTED Fri Dec 7 19:08:32 2007 From: igouy2@REDACTED (Isaac Gouy) Date: Fri, 7 Dec 2007 10:08:32 -0800 (PST) Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <47594131.7000402@ericsson.com> Message-ID: <339019.46701.qm@web60518.mail.yahoo.com> Please consider whether making a personal attack is an appropriate use of this mailing list or of your employers email service. I provided a link to the benchmarks game public discussion forum - please understand that personal attacks will not be welcomed there. There's nothing more for me to say. --- Bengt Kleberg wrote: > greetings, > > as for losing audience i hope that my suggestion at the start of this > > discussion (''do not read this'') was followed by as many as > possible. > having experienced isaac some 2-3 years ago (that time was much worse > > since i was unprepared) i expected something like this and thus > offered > the warning. > > > taking this from the mail list is a good idea in theory. > > it was my first reaction when things turned ugly all those years ago. > > unfortunately isaac took the private email i sent him, chopped it > into > little pieces, removing things like explanations, smilies, etc. he > then > posted these pieces as straw man arguments on the mail list. using > his > normal acerbic tone, he proceeded smashing them to dust. > > i sent another private email explaining that he had hurt me, asking > him > to stop doing such things, and giving me an apology. his (private) > answer was much more brutal than his mail list postings, the point > being > that his act was not illegal and he would never apologise. finally he > > wrote that we should never send private email to each other again. > > so in practice i am not taking this off-line even though it would be > a > nice thing for this list. > > > bengt ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs From ulf.wiger@REDACTED Fri Dec 7 18:13:29 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 07 Dec 2007 18:13:29 +0100 Subject: [erlang-questions] EFFI: The 80% solution to Erlang FFI woes In-Reply-To: <0D97A09F-CFAE-4320-A6EF-F2547C28A07E@gmail.com> References: <0D97A09F-CFAE-4320-A6EF-F2547C28A07E@gmail.com> Message-ID: <47597F39.7040202@ericsson.com> Joel Reymont skrev: > > While the recently mentioned FFI enhancement proposal is being > considered, I would like to propose EFFI as the 80% solution. > I just started implementing this API and library for a chapter > of my upcoming "Hardcore Erlang" book. But now that there is an ambitious FFI proposal submitted as an EEP, why start yet another 80% solution? We've seen lots of 80% Erlang-C bindings. One nice attempt was IG, which can be found at http://www.tornkvist.org/gitweb BR, Ulf W From david.hopwood@REDACTED Fri Dec 7 21:14:19 2007 From: david.hopwood@REDACTED (David Hopwood) Date: Fri, 07 Dec 2007 20:14:19 +0000 Subject: [erlang-questions] EFFI: The 80% solution to Erlang FFI woes In-Reply-To: <47597F39.7040202@ericsson.com> References: <0D97A09F-CFAE-4320-A6EF-F2547C28A07E@gmail.com> <47597F39.7040202@ericsson.com> Message-ID: <4759A99B.1010803@industrial-designers.co.uk> Ulf Wiger (TN/EAB) wrote: > Joel Reymont skrev: >> While the recently mentioned FFI enhancement proposal is being >> considered, I would like to propose EFFI as the 80% solution. > > I just started implementing this API and library for a chapter > > of my upcoming "Hardcore Erlang" book. > > But now that there is an ambitious FFI proposal submitted as an EEP, > why start yet another 80% solution? I agree completely, especially given that the EEP proposal already has a prototype implementation. -- David Hopwood From exta7@REDACTED Fri Dec 7 21:43:22 2007 From: exta7@REDACTED (Zvi) Date: Fri, 7 Dec 2007 12:43:22 -0800 (PST) Subject: [erlang-questions] Binary comprehension (was Re: double to float) In-Reply-To: <4718EE0A.2010109@cs.ntua.gr> References: <6BC569B9-F1D3-48CA-8FEB-BBC69D58245E@kvamme.se> <95be1d3b0710161143t6b470683h87578328ad6db102@mail.gmail.com> <6C8EB2AC-82F5-4841-82D6-4F808CEB7173@kvamme.se> <13286617.post@talk.nabble.com> <13286772.post@talk.nabble.com> <4718EE0A.2010109@cs.ntua.gr> Message-ID: <14220136.post@talk.nabble.com> Is there are something like trhis in R12 ? <>. output should be: <<1,2,3>> Zvi Kostis Sagonas-2 wrote: > > Zvi wrote: >> Found the answer: >> .... SNIP ..... >> >> Still doesn't know, how to run this from shell. >> Also, too bad we can't write something like this: >> >> <>. >> > > Full support for binary comprehensions and other goodies like > the ones you want will be available in the upcoming R12. > > Stay tuned -- it's coming soon in an OTP system near you. > > Kostis > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/double-to-float-tf4635969.html#a14220136 Sent from the Erlang Questions mailing list archive at Nabble.com. From exta7@REDACTED Fri Dec 7 21:43:50 2007 From: exta7@REDACTED (Zvi) Date: Fri, 7 Dec 2007 12:43:50 -0800 (PST) Subject: [erlang-questions] Binary comprehension (was Re: double to float) In-Reply-To: <4718EE0A.2010109@cs.ntua.gr> References: <6BC569B9-F1D3-48CA-8FEB-BBC69D58245E@kvamme.se> <95be1d3b0710161143t6b470683h87578328ad6db102@mail.gmail.com> <6C8EB2AC-82F5-4841-82D6-4F808CEB7173@kvamme.se> <13286617.post@talk.nabble.com> <13286772.post@talk.nabble.com> <4718EE0A.2010109@cs.ntua.gr> Message-ID: <14220136.post@talk.nabble.com> Is there are something like this implemented in R12 ? <>. output should be: <<1,2,3>> Zvi Kostis Sagonas-2 wrote: > > Zvi wrote: >> Found the answer: >> .... SNIP ..... >> >> Still doesn't know, how to run this from shell. >> Also, too bad we can't write something like this: >> >> <>. >> > > Full support for binary comprehensions and other goodies like > the ones you want will be available in the upcoming R12. > > Stay tuned -- it's coming soon in an OTP system near you. > > Kostis > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/double-to-float-tf4635969.html#a14220136 Sent from the Erlang Questions mailing list archive at Nabble.com. From ulf.wiger@REDACTED Fri Dec 7 22:02:45 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 07 Dec 2007 22:02:45 +0100 Subject: [erlang-questions] Binary comprehension (was Re: double to float) In-Reply-To: <14220136.post@talk.nabble.com> References: <6BC569B9-F1D3-48CA-8FEB-BBC69D58245E@kvamme.se> <95be1d3b0710161143t6b470683h87578328ad6db102@mail.gmail.com> <6C8EB2AC-82F5-4841-82D6-4F808CEB7173@kvamme.se> <13286617.post@talk.nabble.com> <13286772.post@talk.nabble.com> <4718EE0A.2010109@cs.ntua.gr> <14220136.post@talk.nabble.com> Message-ID: <4759B4F5.2000709@ericsson.com> Zvi skrev: > Is there are something like trhis in R12 ? > > <>. > > output should be: > > <<1,2,3>> > > Zvi Almost: Eshell V5.6 (abort with ^G) 1> << <> || B <- [1,2,3] >>. <<1,2,3>> BR, Ulf W From joelr1@REDACTED Fri Dec 7 22:14:24 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 7 Dec 2007 21:14:24 +0000 Subject: [erlang-questions] EFFI: The 80% solution to Erlang FFI woes In-Reply-To: <4759A99B.1010803@industrial-designers.co.uk> References: <0D97A09F-CFAE-4320-A6EF-F2547C28A07E@gmail.com> <47597F39.7040202@ericsson.com> <4759A99B.1010803@industrial-designers.co.uk> Message-ID: On Dec 7, 2007, at 8:14 PM, David Hopwood wrote: > I agree completely, especially given that the EEP proposal already has > a prototype implementation. Is there an ETA for the EEP? -- http://wagerlabs.com From m.gomard@REDACTED Sat Dec 8 09:16:30 2007 From: m.gomard@REDACTED (Miguel Gomard) Date: Sat, 8 Dec 2007 09:16:30 +0100 Subject: [erlang-questions] test Message-ID: do not reply -------------- next part -------------- An HTML attachment was scrubbed... URL: From mickael.remond@REDACTED Sat Dec 8 11:45:12 2007 From: mickael.remond@REDACTED (=?UTF-8?Q?Micka=C3=ABl_R=C3=A9mond?=) Date: Sat, 8 Dec 2007 11:45:12 +0100 Subject: [erlang-questions] Erlang automake tool Message-ID: <8C4D0796-B7DC-4AC7-9B23-FC4A1F4338ED@process-one.net> Hello, I have released a small tool that I am using to set up my development environments quickly. The Erlang Automake tool create and maintain Erlang Make's Emakefile for you. It can take multiple projects directory as parameter and compile everything in a single target directory (Which I find handy during development, no more time spend to set up paths and environment for multi projects Erlang development). More details here: http://www.process-one.net/en/blogs/article/erlang_automake_project/ I hope it can be useful to other developers :) Comments, suggestions, patches, are welcome. -- Micka?l R?mond http://www.process-one.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From timm.turn@REDACTED Sat Dec 8 17:17:16 2007 From: timm.turn@REDACTED (Timmy Turner) Date: Sat, 8 Dec 2007 17:17:16 +0100 Subject: [erlang-questions] HTTP Client in Erlang Message-ID: Hi there, I found this page about the Erlang HTTP client: http://www.erlang.org/doc/man/http.html However I'm looking for something like a tutorial or how-to as on how to use the HTTP client - does anyone of you know a page about this, or is kind enough to walk me through the usage of the Erlang HTTP client? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From bobcalco@REDACTED Sat Dec 8 17:01:23 2007 From: bobcalco@REDACTED (Bob Calco) Date: Sat, 8 Dec 2007 11:01:23 -0500 Subject: [erlang-questions] AVG found threat in latest Win32 release Message-ID: <07cf01c839b3$94e3deb0$beab9c10$@rr.com> I've been trying to download and install the latest OTP 12B-0 binary release for Win32 from your download page but AVG blacklists it because it perceives a threat called "Download.QQHelper.ce" in it. As a consequence I can't install it on either my XP or Vista machines where I have AVG installed. I have filed a report with AVG asking them to confirm it's not a false positive, but thought I'd let you know of the issue in case there is a way you can inspect the installer for the "threat". I'll let you know what they came back with. FYI I didn't have this issue with the last 11B release. It downloaded and installed with no issues on both machines. Sincerely, Bob Calco Lithia, FL From doug.mansell@REDACTED Sat Dec 8 17:49:57 2007 From: doug.mansell@REDACTED (doug mansell) Date: Sat, 8 Dec 2007 17:49:57 +0100 Subject: [erlang-questions] HTTP Client in Erlang In-Reply-To: References: Message-ID: Hi Timmy, It can take some getting used to the Erlang documentation. :) Maybe this will help you get started with playing around in the shell... Eshell V5.6 (abort with ^G) 1> application:start(inets). ok 2> http:request("http://www.erlang.org"). {ok,{{"HTTP/1.1",200,"OK"}, On Dec 8, 2007 5:17 PM, Timmy Turner wrote: > Hi there, > > I found this page about the Erlang HTTP client: > > http://www.erlang.org/doc/man/http.html > > However I'm looking for something like a tutorial or how-to as on how to use > the HTTP client - does anyone of you know a page about this, or is kind > enough to walk me through the usage of the Erlang HTTP client? > > Thanks! > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From tuncer.ayaz@REDACTED Sat Dec 8 19:10:13 2007 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sat, 8 Dec 2007 19:10:13 +0100 Subject: [erlang-questions] AVG found threat in latest Win32 release In-Reply-To: <07cf01c839b3$94e3deb0$beab9c10$@rr.com> References: <07cf01c839b3$94e3deb0$beab9c10$@rr.com> Message-ID: <4ac8254d0712081010w57030a28rc340f9cd64ac6960@mail.gmail.com> On Dec 8, 2007 5:01 PM, Bob Calco wrote: > I've been trying to download and install the latest OTP 12B-0 binary release > for Win32 from your download page but AVG blacklists it because it perceives > a threat called "Download.QQHelper.ce" in it. As a consequence I can't > install it on either my XP or Vista machines where I have AVG installed. > > I have filed a report with AVG asking them to confirm it's not a false > positive, but thought I'd let you know of the issue in case there is a way > you can inspect the installer for the "threat". I'll let you know what they > came back with. > > FYI I didn't have this issue with the last 11B release. It downloaded and > installed with no issues on both machines. On Dec 8, 2007 5:01 PM, Bob Calco wrote: > I've been trying to download and install the latest OTP 12B-0 binary release > for Win32 from your download page but AVG blacklists it because it perceives > a threat called "Download.QQHelper.ce" in it. As a consequence I can't > install it on either my XP or Vista machines where I have AVG installed. > > I have filed a report with AVG asking them to confirm it's not a false > positive, but thought I'd let you know of the issue in case there is a way > you can inspect the installer for the "threat". I'll let you know what they > came back with. > > FYI I didn't have this issue with the last 11B release. It downloaded and > installed with no issues on both machines. You're lucky that I was using a Windows laptop with AVG Free and not my main workstation to read mail. You're less lucky as I was not able to reproduce the described behavior by downloading the installer some minutes ago, installing and starting/testing the Erlang Windows GUI console. Strange. AVG Version: 7.5.503 with signature set 269.16.17/1178 from 2007-12-08. Either you're AVG version is something different than the one installed here or I'm lucky :) Sorry. From rvirding@REDACTED Sat Dec 8 22:19:01 2007 From: rvirding@REDACTED (Robert Virding) Date: Sat, 8 Dec 2007 22:19:01 +0100 Subject: [erlang-questions] Interfacing Prolog and Erlang In-Reply-To: <5086AE61-09E3-4F28-9FD6-A765206D6548@gmail.com> References: <3dbc6d1c0712050453y6ca9bb7asfaacea73f0ed2534@mail.gmail.com> <329D9913-5E13-4D0E-A601-DEFFB7E532BA@gmail.com> <3dbc6d1c0712050537j7d570071x88a64a9d7691ddad@mail.gmail.com> <5086AE61-09E3-4F28-9FD6-A765206D6548@gmail.com> Message-ID: <3dbc6d1c0712081319h12e9f8f8y5ee3e69d0c41764e@mail.gmail.com> I remember taking a quick peek at Eresye when it was announced a while back. My first impression was that it implemented a lot of prolog-like features directly in Erlang. Another option would be to code in Erlog which is a prolog. As it is written in Erlang there is no problem in passing data between them, though the interface does need some work. I didn't have an application in mind when I wrote it so I didn't really know the best way to build the interface. Robert On 05/12/2007, Joel Reymont wrote: > > > On Dec 5, 2007, at 1:37 PM, Robert Virding wrote: > > > Is there a specific application or use you have in mind? > > > Dialog systems based on natural language. > > There's GoDIS [1] and its underlying TrindiKit. These use SICStus > Prolog and I thought of hooking these up to Erlang. On a second > thought, I don't have an extra 4K EUR for two SICStus licenses. I'll > try to implement the dialog management engine in Erlang, using ERESYE > [2] and lots of elbow grease. > > Joel > > [1] http://www.ling.gu.se/grupper/dialoglab/godis/ > [2] http://sourceforge.net/projects/eresye > > -- > http://wagerlabs.com > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.hinde@REDACTED Sun Dec 9 00:51:50 2007 From: sean.hinde@REDACTED (Sean Hinde) Date: Sat, 8 Dec 2007 23:51:50 +0000 Subject: [erlang-questions] Source patch for R12B-0 available In-Reply-To: <475955FD.8@ericsson.com> References: <475955FD.8@ericsson.com> Message-ID: <7409CEF5-755B-4EFD-B35E-851B31DC80A7@gmail.com> Hi Rikard, Do you have any plans to release a patch for those using R11B-5 on 64 bit sparc? I'm thinking mainly of the OTP-7006 issue, initially reported on R11B-5. Thanks, Sean On 7 Dec 2007, at 14:17, Rickard Green wrote: > A patch that fixes the following issues is now available at > http://www.erlang.org/download.html . Instructions for applying > the patch can be found in the patch README. > > BR, > Rickard Green, Erlang/OTP, Ericsson AB. > > ------------------------------------------------------------------------ > > OTP-7006 The SMP emulator on sparc64 erroneously used the sparc32 > atomic and the sparc32 spinlock implementations which > caused it to crash. > > OTP-7012 Matching an empty binary in a record and then using the > same record again could cause a compiler crash. > > Example code that triggers the crash: > > -record(r, {a,b}). > t(R) -> > #r{a = <<>>} = R, > R#r.b. > > OTP-7013 file:read/2 and file:consult_stream/1,3 did not use an empty > prompt on I/O devices. This bug has now been corrected. > > OTP-7014 configuring --enable-darwin-universal or --enable- > darwin-64bit > on MacOSX could result in a non optimized emulator. Top > level > configure script now corrected. > > OTP-7015 configuring --with-gd did not produce correct include flags > for percept. > > ------------------------------------------------------------------------ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From timm.turn@REDACTED Sun Dec 9 14:07:29 2007 From: timm.turn@REDACTED (Timmy Turner) Date: Sun, 9 Dec 2007 14:07:29 +0100 Subject: [erlang-questions] Erlang HTTP client is not so fault tollerant... Message-ID: Hi there, a normal HTTP 301 response should look like this: HTTP/1.1 301 Moved Permanently Date: Sun, 09 Dec 2007 10:54:02 GMT Server: Apache/1.3.37 (Unix) PHP/4.4.4 with Suhosin-Patch FrontPage/5.0.2.4803 mod_fastcgi/mod_fastcgi-SNAP-0404142202 mod_ssl/2.8.28 OpenSSL/0.9.6i Location: http://www.spielendverdienen.de/startseite.html However, some servers return HTTP/1.1 301 Date: Sun, 09 Dec 2007 10:52:58 GMT Server: Apache/1.3.37 (Unix) FrontPage/5.0.2.2623 mod_ssl/2.8.28 OpenSSL/0.9.8a Location: http://charmed.qanet.de/en/ (notice the first line, in the second response the reason is missing) When requesting a page from a server that returns the second http-response, erlang crashes: 27> http:request("http://charmed.qanet.de/",foo). {error,{badarg,[{erlang,list_to_integer,["301\r\nDate:"]}, {httpc_response,parse_status_code,4}, {httpc_handler,handle_info,2}, {gen_server,handle_msg,5}, {proc_lib,init_p,5}]}} =ERROR REPORT==== 9-Dec-2007::14:04:08 === ** Generic server <0.106.0> terminating ** Last message in was {tcp,#Port<0.185>, <<"HTTP/1.1 301\r\nDate: Sun, 09 Dec 2007 13:04:18 G MT\r\nServer: Apache/1.3.37 (Unix) FrontPage/5.0.2.2623 mod_ssl/2.8.28 OpenSSL/0 .9.8a\r\nLocation: http://charmed.qanet.de/en/\r\nKeep-Alive: timeout=15, max=10 0\r\nConnection: Keep-Alive\r\nTransfer-Encoding: chunked\r\nContent-Type: text/ html\r\n\r\n">>} ** When Server state == {state, {request,#Ref<0.0.0.444>,<0.62.0>,0,http, {"charmed.qanet.de",80}, "/",[],get, {http_request_h,undefined,"keep-alive", undefined,undefined,undefined,undefined, undefined,undefined,undefined,undefined, undefined,undefined,undefined,undefined, undefined,undefined,"charmed.qanet.de", undefined,undefined,undefined,undefined, undefined,undefined,undefined,undefined, undefined,[],undefined,undefined, undefined,undefined,"0",undefined, undefined,undefined,undefined,undefined, undefined,[]}, {[],[]}, {http_options,infinity,true,[],undefined, false}, "http://charmed.qanet.de/",[],none,[]}, {tcp_session, {{"charmed.qanet.de",80},<0.106.0>}, false,http,#Port<0.185>,1}, undefined,undefined,undefined, {httpc_response,parse,[nolimit]}, {[],[]}, new,[],nolimit,nolimit, {options, {undefined,[]}, 0,2,2,enabled,enabled,false}, {timers,[],undefined}, httpc_manager_foo,undefined} ** Reason for termination == ** {badarg,[{erlang,list_to_integer,["301\r\nDate:"]}, {httpc_response,parse_status_code,4}, {httpc_handler,handle_info,2}, {gen_server,handle_msg,5}, {proc_lib,init_p,5}]} 28> Therefore, I'd like to replace the first line of the incoming server response from "HTTP/1.1 301\r\n" to "HTTP/1.1 301 Moved Permanently\r\n", but I can't seem to find where the appropriate to do so would be... Can you help me with this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From valentin@REDACTED Sun Dec 9 14:20:35 2007 From: valentin@REDACTED (Valentin Micic) Date: Sun, 9 Dec 2007 15:20:35 +0200 Subject: [erlang-questions] Source patch for R12B-0 available References: <475955FD.8@ericsson.com> <7409CEF5-755B-4EFD-B35E-851B31DC80A7@gmail.com> Message-ID: <010801c83a66$4e85b5c0$6401a8c0@moneymaker2> May I second what Sean is asking for? I would really appreciate a fix for R11B-5 -- we have a policy not to run the latest release on production systems, and absence of the patch would force us to do so. Make no mistake, I really like what I saw in R12 so far, but we'd like to migrate on our own pace. Your cooperation will be *highly* appreciated. Valentin Micic Principal Consultant PHAROS CONSVLTING (PTY) LTD. Cell: +27 83 212 9180 ----- Original Message ----- From: "Sean Hinde" To: "Rickard Green" Cc: "Erlang/OTP discussions" Sent: Sunday, December 09, 2007 1:51 AM Subject: Re: [erlang-questions] Source patch for R12B-0 available > Hi Rikard, > > Do you have any plans to release a patch for those using R11B-5 on 64 > bit sparc? I'm thinking mainly of the OTP-7006 issue, initially > reported on R11B-5. > > Thanks, > Sean > > On 7 Dec 2007, at 14:17, Rickard Green wrote: > >> A patch that fixes the following issues is now available at >> http://www.erlang.org/download.html . Instructions for applying >> the patch can be found in the patch README. >> >> BR, >> Rickard Green, Erlang/OTP, Ericsson AB. >> >> ------------------------------------------------------------------------ >> >> OTP-7006 The SMP emulator on sparc64 erroneously used the sparc32 >> atomic and the sparc32 spinlock implementations which >> caused it to crash. >> >> OTP-7012 Matching an empty binary in a record and then using the >> same record again could cause a compiler crash. >> >> Example code that triggers the crash: >> >> -record(r, {a,b}). >> t(R) -> >> #r{a = <<>>} = R, >> R#r.b. >> >> OTP-7013 file:read/2 and file:consult_stream/1,3 did not use an empty >> prompt on I/O devices. This bug has now been corrected. >> >> OTP-7014 configuring --enable-darwin-universal or --enable- >> darwin-64bit >> on MacOSX could result in a non optimized emulator. Top >> level >> configure script now corrected. >> >> OTP-7015 configuring --with-gd did not produce correct include flags >> for percept. >> >> ------------------------------------------------------------------------ >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From exta7@REDACTED Sun Dec 9 17:01:12 2007 From: exta7@REDACTED (Zvi) Date: Sun, 9 Dec 2007 08:01:12 -0800 (PST) Subject: [erlang-questions] Source patch for R12B-0 available In-Reply-To: <475955FD.8@ericsson.com> References: <475955FD.8@ericsson.com> Message-ID: <14239774.post@talk.nabble.com> Can somebody give me the instructions how to apply this patch to the Windows binary installation? Thanks in advance Zvi Rickard Green wrote: > > A patch that fixes the following issues is now available at > http://www.erlang.org/download.html . Instructions for applying > the patch can be found in the patch README. > > BR, > Rickard Green, Erlang/OTP, Ericsson AB. > > ------------------------------------------------------------------------ > > OTP-7006 The SMP emulator on sparc64 erroneously used the sparc32 > atomic and the sparc32 spinlock implementations which > caused it to crash. > > OTP-7012 Matching an empty binary in a record and then using the > same record again could cause a compiler crash. > > Example code that triggers the crash: > > -record(r, {a,b}). > t(R) -> > #r{a = <<>>} = R, > R#r.b. > > OTP-7013 file:read/2 and file:consult_stream/1,3 did not use an empty > prompt on I/O devices. This bug has now been corrected. > > OTP-7014 configuring --enable-darwin-universal or --enable-darwin-64bit > on MacOSX could result in a non optimized emulator. Top level > configure script now corrected. > > OTP-7015 configuring --with-gd did not produce correct include flags > for percept. > > ------------------------------------------------------------------------ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/Source-patch-for-R12B-0-available-tp14213697p14239774.html Sent from the Erlang Questions mailing list archive at Nabble.com. From phiroc@REDACTED Sun Dec 9 16:04:16 2007 From: phiroc@REDACTED (Philippe de Rochambeau) Date: Sun, 9 Dec 2007 16:04:16 +0100 Subject: [erlang-questions] Newbie: escaped characters are not escaped Message-ID: Hello, I can' t get erlang to display iso-latin-1 accented characters on macosx in Erlang (BEAM) emulator version 5.5.4 [source] [async- threads:0] [hipe] [kernel-poll:false]. Here's my test script (saved as an unix file with the iso-latin-1 character set encoding): -module(test). -export([go/0]). go() -> io:format("Les ?l?phants~n"), io:format("Les \351 l \351 phants~n"). Here's the output on a terminal that uses the iso-latin-1 character set encoding: Les \351l\351phants Les \351l\351phants Why doesn't erlang escape \351? Many thanks. Best regards, phiroc From john.hughes@REDACTED Mon Dec 10 01:15:37 2007 From: john.hughes@REDACTED (John Hughes) Date: Mon, 10 Dec 2007 01:15:37 +0100 Subject: [erlang-questions] Last chance to recruit functional programmers via "Jobs in Functional Programming" at Chalmers Message-ID: <003901c83ac1$cbdcbf40$63963dc0$@hughes@quviq.com> I?m happy to report that the ?Jobs in Functional Programming? event to be held at Chalmers this Friday looks like being a big success. We have seven companies involved, and five speakers?and almost 70 people registered BEFORE we put up posters around the campus, including some people who are travelling from other countries just for this event. If you?re recruiting functional programmers, and you HAVEN?T got in touch with me yet, then there is still time?although I can?t accept any more speakers now. But if you would like to send recruitment materials, then I will be only too happy to ensure that participants receive a copy. Just don?t ask me to print your materials for you: there won?t be time for that. If you would like to send such materials, then courier them to me at Department of Computer Science and Engineering Chalmers University of Technology S-41296 G?TEBORG Sweden They need to arrive by Friday morning at the latest. Let me know by email to expect them. It?s delightful to find that there are both job-seekers and employers enough to make this kind of event a success! John Hughes -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay@REDACTED Mon Dec 10 07:20:00 2007 From: jay@REDACTED (Jay Nelson) Date: Sun, 9 Dec 2007 22:20:00 -0800 Subject: [erlang-questions] eep: New gen_stream module Message-ID: <66176D72-6A20-40BC-8CF1-557B2C176875@duomark.com> EEP: XXX Title: gen_stream behaviour Version: $Revision: 14 $ Last-Modified: $Date: 2007-12-10 07:17:01 +0200 (Mon, 10 Dec 2007) $ Author: Jay Nelson Status: Draft Type: Standards Track Content-Type: text/plain Created: 09-Dec-2007 Erlang-Version: R12B-2 Post-History: 09-Dec-2007 Abstract An optimized behaviour module is needed to simplify the handling of large streams of (typically binary) data for application developers. Specification Module name: gen_stream Implementation: A gen_server which delivers "chunks" of the stream in an efficient manner so that line-oriented processing or the handling of streams much bigger than memory (possibly even infinite) may be absorbed by an application. Behaviour callbacks: start, start_link as in gen_server init(Args, Options) -> Same as gen_server plus list of Options: {stream, {file, path_to_file()} | {binary, binary()} | {behaviour, atom(), ExtraArgs}} {chunk_size, integer()} returned sub-binary size, default is ~8K {chunks_per_proc, integer()} num of internal chunks, default is 1 {circular, false | true} whether stream repeats, default is false {num_processes, integer()} num_processes used, default 1 next_chunk(Server::pid()) -> binary() | end_of_stream pct_complete(Server::pid()) -> integer() | atom() stream_size(Server::pid()) -> integer() | atom() stream_pos(Server::pid()) -> integer() stop(Server::pid()) -> ok Usage: Client starts the gen_stream by providing at least a stream option. The stream option indicates whether the source of the stream is a file, a binary or a function. When using a socket, port or other source, the client needs to implement the behavior to feed the buffers on demand. Motivation There are many ways to get binary data into an erlang node, however, historically it has been recommended that the data be converted to a list and processed. There are many situations where leaving the binary data in its original form is preferable for space or conversion efficiency reasons (e.g., when merely filtering data in a relaying router process or when performing statistics on raw stream data). Providing a gen_server idiom makes the default approach to processing a binary stream an abstraction that is closer to an application developer's view of the problem solution. The recent Wide Finder project [1] challenged the erlang community by highlighting the slowness of standard I/O functions, forcing developers to use raw binary handling. This approach seems to be a common need in web service applications, yet it is quite easy to do in a very inefficient manner. Providing a reference implementation that exposes a simpler behaviour interface would increase the class of problems that erlang can solve in the hands of beginning to intermediate developers. It would also push implementers in the direction of an OTP compliant application without sacrificing efficiency. In addition, there has been a call on the email list for a string_stream implementation so that a buffer of data (e.g., an SMTP message, HTTP request, HTML page, multi-record socket protocol packet, raw text database, comma-delimited file, etc.) could be treated as a stream of binary elements rather than a single block of data. Finally, testing systems often need a generative source of data that can be replayed or repeated in a precise manner to trigger a fault or test a patch to same. The circular binary stream allows infinite streams of generative data, and the behaviour stream allows a functionally generated stream of data to be emitted. Rationale There are a few common idioms that are used when efficiently handling a binary data source: 1) "Chunking" the data to smaller sub-binaries 2) Buffering the chunks for efficient I/O 3) Few of the standard idioms are OTP-compliant A gen_server implementation seemed the most straight-forward method for making an OTP-compliant method for chunking a serial stream. A behaviour was created so that streams could be computed and generated rather than requiring a pre-constructed file or binary as a source. Reference Implementation A working version is available at the DuoMark Website [2]. References [1] Tim Bray's weblog http://www.tbray.org/ongoing/ [2] http://www.duomark.com/erlang/proposals/gen_stream.html Copyright This document is released to the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 coding: utf-8 End: From jay@REDACTED Mon Dec 10 07:53:31 2007 From: jay@REDACTED (Jay Nelson) Date: Sun, 9 Dec 2007 22:53:31 -0800 Subject: [erlang-questions] eep: New gen_stream module Message-ID: I just posted a formal eep for a new module. The reference implementation is on my website at http://www.duomark.com/erlang/ proposals/gen_stream.html which contains a description of the module, some sample code to call it, and links for the original eep text and a tar.gz file with the implementation and unit test code. Apparently between my mailer and editor I got the number of columns wrong and/or left in some tabs as it doesn't wrap properly on the mailing list. I will attempt to fix those anomalies with the first revision. As developed and described, the implementation provides a simple method for obtaining a binary serial stream in "chunks". The module is intended to be used when a raw file is too big to fit in memory, or an accumulated binary can be handled more efficiently a piece at a time. I included a technique for generating a serial stream as a behaviour. It can be used to generate non-binary serial streams, but everything is carefully controlled to be a true _serial_ stream, so it is not recommended that you attempt to use the behaviour to create random access streams or other types of streams. The behaviour is limited to a simple API for ease of use and for consistency with the binary and file approaches. In addition there is an option to make fixed-size streams circular so that they can be used for infinite or repeatable test streams. If a stream has an indeterminate size (an arbitrary term rather than an integer), it may not be made circular. The main benefit is that you can write your code to consume a stream in bite-size chunks using 1 process and 1 buffer. Once it is working as you intend, changing the gen_stream:start_link options allows you to measure performance and memory usage with multiple chunking processes, multiple buffers per process, or both. In addition, the chunk_size may also be varied declaratively. This approach allows a running system to change performance characteristics without the delivery of modified code, or to adapt to changing conditions in real time. The restriction that enforces the "serial" nature of the stream must hold consistent regardless of how many processes are used. Changing the options should not change the nature of the stream other than how large each chunk is (and hopefully how responsive the system is to requests for the next_chunk). This is why you must be careful in attempting to bend the results when using a behaviour module. Any and all suggestions, comments, ridicule or abuse are graciously welcomed. Coding tips are especially hoped for as this the very first public airing of the module. Anyone willing to do performance comparisons is encouraged to post them and comment on the behavior observed. I have no information on whether the hoped for performance characteristics have been achieved. jay From gordonguthrie@REDACTED Mon Dec 10 08:17:06 2007 From: gordonguthrie@REDACTED (Gordon Guthrie) Date: Mon, 10 Dec 2007 07:17:06 -0000 (GMT) Subject: [erlang-questions] Xmas Erlounge Scotland Message-ID: <61283.82.41.159.220.1197271026.squirrel@backawinner.gg> Well more of a back home/launch party/Xmas soiree really... Hypernumbers cordially invite all our Erlang friends in Scotland for a mixture of curry, cocktails, convivial conversation and a bit of Erlang at our corporate HQ 3pm Saturday 15th December 135 High St Linlithgow http://www.multimap.com/maps/?hloc=GB|eh49%207ej 2 minutes from Linlithgow Train station - dead handy for Edinburgh/Glasgow Cheers, and ho-ho-ho Gordon -- Gordon Guthrie CEO/CTO Hypernumbers.com (+44) 01506 845952 (+44) 07776 251669 From ingela@REDACTED Mon Dec 10 08:30:35 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Mon, 10 Dec 2007 08:30:35 +0100 Subject: [erlang-questions] HTTP Client in Erlang In-Reply-To: References: Message-ID: <475CEB1B.8010900@erix.ericsson.se> erlang-questions-request@REDACTED wrote: > Hi there, > > I found this page about the Erlang HTTP client: > > http://www.erlang.org/doc/man/http.html > > However I'm looking for something like a tutorial or how-to as on how to use > the HTTP client - does anyone of you know a page about this, or is kind > enough to walk me through the usage of the Erlang HTTP client? > You could try reading the inets user's guide there are some explicit examples there. There is a link to it from the manual page, or try http://www.erlang.org/doc/apps/inets/part_frame.html Regards Ingela OTP - team From tdeckert@REDACTED Mon Dec 10 08:27:10 2007 From: tdeckert@REDACTED (Tom Deckert) Date: Mon, 10 Dec 2007 01:27:10 -0600 Subject: [erlang-questions] megaco_simple_mgc - Examples of Connecting to Media? Message-ID: <5A9CAAC47E2C5542A1D137FD514EB8140135E398@EXVS01.wng.chicago.hostway> Hi, I have been googling and surfing www.erlang.org, and the other Erlang web sites, but without finding what I need. I have found the Erlang megaco package, and the very highly instructive megaco_simple_mgc and megaco_simple_mg programs. From the Megaco/H.248 manual, I've been able to run them and get good connections between them. As I am new to both Erlang and Megaco, though, I hit a bit of a snag when it comes to establishing actual media Contexts/Terminations, etc.... The Megaco manual is excellent in what it covers, but when I read the interfaces for the megaco modules, it isn't readily apparent how to map them into the H.248 commands Add/Modify/Subtract in section 7 of the ITU standard. In other word, it seems (to me) that the Megaco manual shows how to run and connect the MGC and MG, but doesn't actually show how to setup media. Does anyone have tips or a pointer to further documents on actual creation of Contexts and Adding/Modifying/Subtracting Terminations from Contexts using the Megaco Erlang module? Thanks very much, Tom Deckert -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob@REDACTED Mon Dec 10 09:40:18 2007 From: bob@REDACTED (Bob Ippolito) Date: Mon, 10 Dec 2007 00:40:18 -0800 Subject: [erlang-questions] : Bug? Pretty-printing floating point values In-Reply-To: <7352e43a0711220319u27c60514x57d3e00044ab8ea0@mail.gmail.com> References: <200711211659.lALGxJNW050591@pluto.hedeland.org> <20071122080552.GA25535@erix.ericsson.se> <7352e43a0711220319u27c60514x57d3e00044ab8ea0@mail.gmail.com> Message-ID: <6a36e7290712100040j1a1f1ce6v9ff516e6a357c0c5@mail.gmail.com> On 11/22/07, Pierpaolo Bernardi wrote: > On Nov 22, 2007 9:05 AM, Raimo Niskanen > wrote: > > I guess float_to_list/1 produces 20 digits because previously the > > external term format for floats was that kind of printout - > > 20 decimal digits with exponent. Nowdays it is the IEEE format. > > > > And I guess it was chosen so you kind of could guarantee to be able to > > recreated exactly the right number after a roundtrip to external format. > > Therefore significantly more than 16 digits was needed. > > > > I do not know if 20 digits can be proved to be always enough, though... > > The problem of printing and reading floating point numbers with the > minimal number of digits > to guarantee round trip invariance has been investigated and solved. > > See the papers and the public domain code already posted by Doug Currie. > > These algorithms are used in all serious common lisp and scheme implementations. > > It would be very smart for the Erlang implementors to borrow this > public domain code. I spent some time today writing up an Erlang implementation of Bob Burger's "Printing Floating-Point Numbers Quickly and Accurately" algorithm. It's in the mochiweb repository here: http://mochiweb.googlecode.com/svn/trunk/src/mochinum.erl It's probably not as quick as the scheme implementation because it doesn't use a look-up table for powers of 10, but it's probably fast enough for most uses. -bob From ingela@REDACTED Mon Dec 10 09:59:36 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Mon, 10 Dec 2007 09:59:36 +0100 Subject: [erlang-questions] erlang-questions] Erlang HTTP client is not so fault tollerant... In-Reply-To: References: Message-ID: <475CFFF8.2000602@erix.ericsson.se> Hi! The code for parsing HTTP is not written defensively, yes we want the parsing code to crash on bad input. The HTTP-client did not crash it returned an error-message (so it is fault tolerant!) That in this case happens to be the call-stack as it was an unexpected error in some sense. {error,{badarg,[{erlang,list_to_integer,["301\r\nDate:"]}, {httpc_response,parse_status_code,4}, {httpc_handler,handle_info,2}, {gen_server,handle_msg,5}, {proc_lib,init_p,5}]}} In this particular case it could be argued the a more "user-friendly" error-message could be accomplished. It is true that a temporary process spawned by the http client crashed and was reported to have done so. I am considering catching the error in the temporary process and then letting it terminate normaly to avoid confusion. Something like {http_parse_error, HTTPMsg} could be given as reason instead of the call-stack. This particular error is something that we will consider accepting in the relaxed mode of the HTTP-client. Regards Ingela - OTP team > Hi there, > > a normal HTTP 301 response should look like this: > > HTTP/1.1 301 Moved Permanently > Date: Sun, 09 Dec 2007 10:54:02 GMT > Server: Apache/1.3.37 (Unix) PHP/4.4.4 with Suhosin-Patch > FrontPage/5.0.2.4803 mod_fastcgi/mod_fastcgi-SNAP-0404142202 mod_ssl/2.8.28 > OpenSSL/0.9.6i > Location: http://www.spielendverdienen.de/startseite.html > > However, some servers return > > HTTP/1.1 301 > Date: Sun, 09 Dec 2007 10:52:58 GMT > Server: Apache/1.3.37 (Unix) FrontPage/5.0.2.2623 mod_ssl/2.8.28 > OpenSSL/0.9.8a > Location: http://charmed.qanet.de/en/ > > (notice the first line, in the second response the reason is missing) > > When requesting a page from a server that returns the second http-response, > erlang crashes: > > 27> http:request("http://charmed.qanet.de/",foo). > {error,{badarg,[{erlang,list_to_integer,["301\r\nDate:"]}, > {httpc_response,parse_status_code,4}, > {httpc_handler,handle_info,2}, > {gen_server,handle_msg,5}, > {proc_lib,init_p,5}]}} > > =ERROR REPORT==== 9-Dec-2007::14:04:08 === > ** Generic server <0.106.0> terminating > ** Last message in was {tcp,#Port<0.185>, > <<"HTTP/1.1 301\r\nDate: Sun, 09 Dec 2007 > 13:04:18 G > MT\r\nServer: Apache/1.3.37 (Unix) FrontPage/5.0.2.2623 mod_ssl/2.8.28 > OpenSSL/0 > .9.8a\r\nLocation: http://charmed.qanet.de/en/\r\nKeep-Alive: timeout=15, > max=10 > 0\r\nConnection: Keep-Alive\r\nTransfer-Encoding: chunked\r\nContent-Type: > text/ > html\r\n\r\n">>} > ** When Server state == {state, > {request,#Ref<0.0.0.444>,<0.62.0>,0,http, > {"charmed.qanet.de",80}, > "/",[],get, > {http_request_h,undefined,"keep-alive", > undefined,undefined,undefined,undefined, > undefined,undefined,undefined,undefined, > undefined,undefined,undefined,undefined, > undefined,undefined,"charmed.qanet.de", > undefined,undefined,undefined,undefined, > undefined,undefined,undefined,undefined, > undefined,[],undefined,undefined, > undefined,undefined,"0",undefined, > undefined,undefined,undefined,undefined, > undefined,[]}, > {[],[]}, > {http_options,infinity,true,[],undefined, > false}, > "http://charmed.qanet.de/",[],none,[]}, > {tcp_session, > {{"charmed.qanet.de",80},<0.106.0>}, > false,http,#Port<0.185>,1}, > undefined,undefined,undefined, > {httpc_response,parse,[nolimit]}, > {[],[]}, > new,[],nolimit,nolimit, > {options, > {undefined,[]}, > 0,2,2,enabled,enabled,false}, > {timers,[],undefined}, > httpc_manager_foo,undefined} > ** Reason for termination == > ** {badarg,[{erlang,list_to_integer,["301\r\nDate:"]}, > {httpc_response,parse_status_code,4}, > {httpc_handler,handle_info,2}, > {gen_server,handle_msg,5}, > {proc_lib,init_p,5}]} > 28> > > Therefore, I'd like to replace the first line of the incoming server > response from "HTTP/1.1 301\r\n" to "HTTP/1.1 301 Moved Permanently\r\n", > but I can't seem to find where the appropriate to do so would be... > > Can you help me with this? > From joelr1@REDACTED Mon Dec 10 10:19:08 2007 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 10 Dec 2007 09:19:08 +0000 Subject: [erlang-questions] Web framework performance shoot out Message-ID: The comparison between Haskell (HAppS) and Erlang (ErlyWeb) is interesting. "ErlyWeb had a hard time handling 1000 requests coming within an interval of a few seconds, so I had to lower the burst to 500 requests there. It did not have as a severe problem if one bypassed the dispatch and used raw Yaws." I would love to know the reason behind the abouve request handling issue. See the "Performance of HAppS relative other frameworks" thread in the HAppS Google group and http://blog.davber.com/2007/12/10/web-server-performance-shoot-out-simple-pages/ -- http://wagerlabs.com From Bob.Cowdery@REDACTED Mon Dec 10 10:29:58 2007 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Mon, 10 Dec 2007 09:29:58 -0000 Subject: [erlang-questions] Erlide Message-ID: <3A76756EED583B43A4AD704E29CCD07974133D@mail.smartlogic.com> Hi all I've been using Erlide for quite a while and in general it works pretty well. I wonder if any one has figured out how to stop it running away with 100% CPU (on Windows XP). It seems to be doing this more and more frequently, although I'm not sure why. I have to kill the erl process to get my CPU back. Thanks Bob From lovei@REDACTED Mon Dec 10 11:24:50 2007 From: lovei@REDACTED (Lovei Laszlo) Date: Mon, 10 Dec 2007 11:24:50 +0100 Subject: [erlang-questions] clarify: variable as function name Message-ID: <475D13F2.6040908@elte.hu> Hi all! A quote from the reference manual: http://www.erlang.org/doc/reference_manual/expressions.html#6.6 6.6 Function Calls ExprF(Expr1,...,ExprN) ExprM:ExprF(Expr1,...,ExprN) ExprM should evaluate to a module name and ExprF to a function name or a fun. [...] The module name can be omitted, if ExprF evaluates to the name of a local function, an imported function, or an auto-imported BIF. This means that the following code is valid (F evaluates to a local function name): f() -> ok. g() -> F=f, F(). In practice, this aborts with the reason badfun. The question is, which one is considered good: the manual, or the implementation? Thanks! Laszlo From vladdu55@REDACTED Mon Dec 10 11:29:57 2007 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 10 Dec 2007 11:29:57 +0100 Subject: [erlang-questions] Erlide In-Reply-To: <95be1d3b0712100229k951da24pfc1f89e4f52f0c5e@mail.gmail.com> References: <3A76756EED583B43A4AD704E29CCD07974133D@mail.smartlogic.com> <95be1d3b0712100229k951da24pfc1f89e4f52f0c5e@mail.gmail.com> Message-ID: <95be1d3b0712100229r3cf35f73v2d5cd5b787d551b9@mail.gmail.com> Hi! On Dec 10, 2007 10:29 AM, Bob Cowdery wrote: > I've been using Erlide for quite a while and in general it works pretty well. I wonder if any one has figured out how to stop it running away with 100% CPU (on Windows XP). It seems to be doing this more and more frequently, although I'm not sure why. I have to kill the erl process to get my CPU back. I use WinXP and never got this problem. Do you do anything special when it happens? best regards, Vlad From anthony.hw.kong@REDACTED Mon Dec 10 12:21:59 2007 From: anthony.hw.kong@REDACTED (Anthony Kong) Date: Mon, 10 Dec 2007 22:21:59 +1100 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: <475D13F2.6040908@elte.hu> References: <475D13F2.6040908@elte.hu> Message-ID: The proper syntax should be: g() -> F=fun f/0, F(). It is because if you simply put 'f' there, it is considered an atom, not a function. Hence the 'badfun'. Cheers, Anthony On Dec 10, 2007 9:24 PM, Lovei Laszlo wrote: > Hi all! > > A quote from the reference manual: > http://www.erlang.org/doc/reference_manual/expressions.html#6.6 > > 6.6 Function Calls > > ExprF(Expr1,...,ExprN) > ExprM:ExprF(Expr1,...,ExprN) > > ExprM should evaluate to a module name and ExprF to a function name > or a fun. > [...] > The module name can be omitted, if ExprF evaluates to the name of a > local function, an imported function, or an auto-imported BIF. > > This means that the following code is valid (F evaluates to a local > function name): > > f() -> ok. > g() -> F=f, F(). > > In practice, this aborts with the reason badfun. The question is, which > one is considered good: the manual, or the implementation? > > > Thanks! > Laszlo > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- /*--*/ Experience is simply the name we give our mistakes. ---- Oscar Wilde -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsu79@REDACTED Mon Dec 10 12:37:21 2007 From: chsu79@REDACTED (Christian S) Date: Mon, 10 Dec 2007 12:37:21 +0100 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: References: <475D13F2.6040908@elte.hu> Message-ID: On Dec 10, 2007 12:21 PM, Anthony Kong wrote: > It is because if you simply put 'f' there, it is considered an atom, not a > function. Hence the 'badfun'. Thus, it seems like Lovei has found an inconsistency with documentation/implementation. I believe we want to move away from the implicit assumption that an atom is the name of a function. Similarity with the old Call = {M, F}, Call(Args...) which is to be superseeded by Call = fun M:F/Arity, Call(Args...) in all new code (and old code too, if you have time :). From richardc@REDACTED Mon Dec 10 12:40:40 2007 From: richardc@REDACTED (Richard Carlsson) Date: Mon, 10 Dec 2007 12:40:40 +0100 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: <475D13F2.6040908@elte.hu> References: <475D13F2.6040908@elte.hu> Message-ID: <475D25B8.2080901@it.uu.se> Lovei Laszlo wrote: > 6.6 Function Calls > > ExprF(Expr1,...,ExprN) > ExprM:ExprF(Expr1,...,ExprN) > > ExprM should evaluate to a module name and ExprF to a function name > or a fun. > [...] > The module name can be omitted, if ExprF evaluates to the name of a > local function, an imported function, or an auto-imported BIF. > > This means that the following code is valid (F evaluates to a local > function name): > > f() -> ok. > g() -> F=f, F(). > > In practice, this aborts with the reason badfun. The question is, which > one is considered good: the manual, or the implementation? The implementation, most definitely. The reference manual apparently tries to give a very condensed description of function calls, and fails miserably. - The two forms ExprF(Expr1,...,ExprN) and ExprM:ExprF(Expr1,...,ExprN) need to be explained separately; they are too different. - In the case of a call ExprF(Expr1,...,ExprN): * ExprF can be a constant atom (lexically), or otherwise it must be an expression which evaluates to a fun. Nothing else is possible. (In particular, no dynamically computed atoms.) ExprF usually needs parentheses around it if it is not an atom or a variable. * The handling of the constant atom thing is as follows: If the code contains (a1,...,aN), and /N is the name of a function imported (explicitly or automatically) from module M, then the call is rewritten as M:(a1,...,aN). Otherwise, the function /N must be a locally defined function, and the call is equivalent to (fun /N)(a1,...,aN). * This slight syntactic weirdness is due to the fact that lexically, Erlang uses atoms, not variables, to name functions. It's a remnant from Erlang's roots in Prolog. It gets strange sometimes but we can live with it. - In the case of a remote call ExprM:ExprF(Expr1,...,ExprN): * ExprF must evaluate to an atom; it cannot be a fun. * ExprM must evaluate to an atom (or, inofficially, to a value that represents an instance of an abstract module). * It does not matter if ExprM and ExprF are lexically atoms or not. However, the compiler can generate a bit more efficient code if both ExprM and ExprF are known at compile time. /Richard From joelr1@REDACTED Mon Dec 10 12:53:58 2007 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 10 Dec 2007 11:53:58 +0000 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang Message-ID: I need a name for a Cocoa bridge for Erlang. I tried various permutations of cocoa, objc, e, erl, erly but didn't like any. Any suggestions? Thanks, Joel -- http://wagerlabs.com From rrerlang@REDACTED Mon Dec 10 11:55:53 2007 From: rrerlang@REDACTED (Robert Raschke) Date: Mon, 10 Dec 2007 10:55:53 +0000 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: <475D13F2.6040908@elte.hu> Message-ID: <01ed0e1259ed3b134685deef12f67b31@tombob.com> Lovei Laszlo wrote: > f() -> ok. > g() -> F=f, F(). > > In practice, this aborts with the reason badfun. The question is, which > one is considered good: the manual, or the implementation? Try g() -> F=fun f/0, F(). The F=f just assigns the atom 'f' to F, and that's not a function. Robby From ignatios@REDACTED Mon Dec 10 13:14:02 2007 From: ignatios@REDACTED (Ignatios Souvatzis) Date: Mon, 10 Dec 2007 13:14:02 +0100 Subject: [erlang-questions] graphical window system for erlang on top of the X11 protocol Message-ID: <20071210121402.GA28719@cs.uni-bonn.de> Hi all, ISTR having read a paper which described an X11 interface for Erlang that sits on top of the protocol, which was claimed to be much easier than building on top of Xlib... I can't find that paper anymore; where is it? Related question: gs calls tcl/tk, right? Regards, -is From kenneth.lundin@REDACTED Mon Dec 10 13:18:32 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Mon, 10 Dec 2007 13:18:32 +0100 Subject: [erlang-questions] Source patch for R12B-0 available In-Reply-To: <14239774.post@talk.nabble.com> References: <475955FD.8@ericsson.com> <14239774.post@talk.nabble.com> Message-ID: Hi Zvi, First of all only 2 of these 5 patches are relevant for the Windows binary distribution. Secondly do you really need the patches? I am sure that most users don't need these patches since they don't have code that is affected by the errors corrected in these patches. If you then really need the patches you can either: - wait for the R12B-1 to be released - apply the patches to an installed system and rebuild the modules manually (it is only 2 modules to build) - build the windows version from source /Regards Kenneth Erlang/OTP team , Ericsson AB On 12/9/07, Zvi wrote: > > Can somebody give me the instructions how to apply this patch to the Windows > binary installation? > > Thanks in advance > Zvi > > > Rickard Green wrote: > > > > A patch that fixes the following issues is now available at > > http://www.erlang.org/download.html . Instructions for applying > > the patch can be found in the patch README. > > > > BR, > > Rickard Green, Erlang/OTP, Ericsson AB. > > > > ------------------------------------------------------------------------ > > > > OTP-7006 The SMP emulator on sparc64 erroneously used the sparc32 > > atomic and the sparc32 spinlock implementations which > > caused it to crash. > > > > OTP-7012 Matching an empty binary in a record and then using the > > same record again could cause a compiler crash. > > > > Example code that triggers the crash: > > > > -record(r, {a,b}). > > t(R) -> > > #r{a = <<>>} = R, > > R#r.b. > > > > OTP-7013 file:read/2 and file:consult_stream/1,3 did not use an empty > > prompt on I/O devices. This bug has now been corrected. > > > > OTP-7014 configuring --enable-darwin-universal or --enable-darwin-64bit > > on MacOSX could result in a non optimized emulator. Top level > > configure script now corrected. > > > > OTP-7015 configuring --with-gd did not produce correct include flags > > for percept. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > View this message in context: http://www.nabble.com/Source-patch-for-R12B-0-available-tp14213697p14239774.html > Sent from the Erlang Questions mailing list archive at Nabble.com. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From per.gustafsson@REDACTED Mon Dec 10 13:21:05 2007 From: per.gustafsson@REDACTED (Per Gustafsson) Date: Mon, 10 Dec 2007 13:21:05 +0100 Subject: [erlang-questions] eep: New gen_stream module In-Reply-To: <66176D72-6A20-40BC-8CF1-557B2C176875@duomark.com> References: <66176D72-6A20-40BC-8CF1-557B2C176875@duomark.com> Message-ID: <475D2F31.5080301@it.uu.se> This is a very good idea, but there are some additional things that I would like to have and some things which are unclear how it would work. These comments are inline in the eep text Jay Nelson wrote: > EEP: XXX > Title: gen_stream behaviour > Version: $Revision: 14 $ > Last-Modified: $Date: 2007-12-10 07:17:01 +0200 (Mon, 10 Dec 2007) $ > Author: Jay Nelson > Status: Draft > Type: Standards Track > Content-Type: text/plain > Created: 09-Dec-2007 > Erlang-Version: R12B-2 > Post-History: 09-Dec-2007 > > > Abstract > > An optimized behaviour module is needed to simplify the handling of > large streams of (typically binary) data for application > developers. > > > Specification > > Module name: > gen_stream > > Implementation: > A gen_server which delivers "chunks" of the stream in an > efficient > manner so that line-oriented processing or the handling of > streams > much bigger than memory (possibly even infinite) may be > absorbed by > an application. > > Behaviour callbacks: These are not really the behaviour callbacks, but rather the interface to the gen_stream module, I was a little bit confused by this at first, but the code seems to indicate that the actual callbacks for a gen_stream behaviour is: init/3, terminate/1, stream_length/0, stream_length/1, extract_block/3, extract_split_block/4, extract_final_block/3, inc_progress/2 I guess that the eep also needs to define what these functions should do to make it possible to define gen_stream behaviours > start, start_link as in gen_server > > init(Args, Options) -> Same as gen_server plus list of Options: > > {stream, {file, path_to_file()} | > {binary, binary()} | > {behaviour, atom(), ExtraArgs}} I think it would be nice to add a fourth lightweight option: {generator, fun(() -> {binary(), fun()} | end_of_stream)} That is a fun which returns a binary and a new fun which will produce the next chunk or an end_of_stream marker, but this might not fit with the OTP framework > > {chunk_size, integer()} returned sub-binary size, > default is ~8K It would be nice to have a chunk terminator such as newline rather than an explicit size or would this be implemented using a gen_stream behaviour? > {chunks_per_proc, integer()} num of internal chunks, > default is 1 > {circular, false | true} whether stream repeats, default > is false > {num_processes, integer()} num_processes used, default 1 > It is not clear to me what this means. Is this the number of processes which will communicate with the server or the number of processes that the server will spawn? > next_chunk(Server::pid()) -> binary() | end_of_stream > pct_complete(Server::pid()) -> integer() | atom() > stream_size(Server::pid()) -> integer() | atom() can these return any atom or only specific ones e.g. 'infinite' or 'error' > stream_pos(Server::pid()) -> integer() > stop(Server::pid()) -> ok > > Usage: > Client starts the gen_stream by providing at least a stream > option. The stream option indicates whether the source of the > stream is a file, a binary or a function. When using a > socket, port or other source, the client needs to implement > the behavior to feed the buffers on demand. > > Motivation > > There are many ways to get binary data into an erlang node, > however, historically it has been recommended that the data be > converted to a list and processed. There are many situations > where leaving the binary data in its original form is preferable > for space or conversion efficiency reasons (e.g., when merely > filtering data in a relaying router process or when performing > statistics on raw stream data). Providing a gen_server idiom > makes the default approach to processing a binary stream an > abstraction that is closer to an application developer's view of > the problem solution. > > The recent Wide Finder project [1] challenged the erlang > community by > highlighting the slowness of standard I/O functions, forcing > developers to use raw binary handling. This approach seems to be a > common need in web service applications, yet it is quite easy to > do in > a very inefficient manner. Providing a reference implementation > that > exposes a simpler behaviour interface would increase the class of > problems that erlang can solve in the hands of beginning to > intermediate developers. It would also push implementers in the > direction of an OTP compliant application without sacrificing > efficiency. > > In addition, there has been a call on the email list for a > string_stream implementation so that a buffer of data (e.g., an > SMTP > message, HTTP request, HTML page, multi-record socket protocol > packet, > raw text database, comma-delimited file, etc.) could be treated > as a > stream of binary elements rather than a single block of data. > > Finally, testing systems often need a generative source of data > that > can be replayed or repeated in a precise manner to trigger a > fault or > test a patch to same. The circular binary stream allows infinite > streams of generative data, and the behaviour stream allows a > functionally generated stream of data to be emitted. > > > Rationale > > There are a few common idioms that are used when efficiently > handling a binary data source: > > 1) "Chunking" the data to smaller sub-binaries > 2) Buffering the chunks for efficient I/O > 3) Few of the standard idioms are OTP-compliant > > A gen_server implementation seemed the most straight-forward > method for making an OTP-compliant method for chunking a serial > stream. A behaviour was created so that streams could be computed > and generated rather than requiring a pre-constructed file or > binary as a source. > > > Reference Implementation > > A working version is available at the DuoMark Website [2]. > > > References > > [1] Tim Bray's weblog > http://www.tbray.org/ongoing/ > > [2] http://www.duomark.com/erlang/proposals/gen_stream.html > > Copyright > > This document is released to the public domain. > > > > Local Variables: > mode: indented-text > indent-tabs-mode: nil > sentence-end-double-space: t > fill-column: 70 > coding: utf-8 > End: > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From torben.lehoff@REDACTED Mon Dec 10 13:30:22 2007 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Mon, 10 Dec 2007 13:30:22 +0100 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang In-Reply-To: References: Message-ID: On Dec 10, 2007 12:53 PM, Joel Reymont wrote: > I need a name for a Cocoa bridge for Erlang. > > I tried various permutations of cocoa, objc, e, erl, erly but didn't > like any. > > Any suggestions? > Some suggestions that hopefully ignites your imagination: BriCoErl - Bridge Cocoa to Erlang. Erloa - Erl(ang) (Coc)oa. I wouldn't mind having one of those in a bar ;-) ICEr - Interface Cocoa Erlang. CoErla - Cocoa in Erlang. Should be pronounced almost like Koala. MacErl - probably not a good idea. Both Apple and McDonnals would probably sue you. I expect the royalties on the above names to be huge!! Cheers, Torben -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth.lundin@REDACTED Mon Dec 10 13:33:19 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Mon, 10 Dec 2007 13:33:19 +0100 Subject: [erlang-questions] Source patch for R12B-0 available In-Reply-To: <010801c83a66$4e85b5c0$6401a8c0@moneymaker2> References: <475955FD.8@ericsson.com> <7409CEF5-755B-4EFD-B35E-851B31DC80A7@gmail.com> <010801c83a66$4e85b5c0$6401a8c0@moneymaker2> Message-ID: Hi, Since the combination SMP and 64 bit sparc apparently never has worked in R11B you can't have any system in service dependent on this patch do you? So if you are planning on using the SMP emulator for the first time in a product I would really recommend that you put your old policy away and go for R12B. The reasons for that are in my opinion many: - R12B is the most stable version with best performance when it comes to SMP execution. R12B is the version where we will have regular service releases with patches and improvements. R12B is the version where improvements regarding SMP will appear. R12B is the version where we may support more platforms. Bugs found by open source users in R12B AND PREVIOUS releases will be corrected in R12B-1, 2, ..., etc. /Regards Kenneth Erlang/OTP team, Ericsson AB On 12/9/07, Valentin Micic wrote: > May I second what Sean is asking for? > I would really appreciate a fix for R11B-5 -- we have a policy not to run > the latest release on production systems, and absence of the patch would > force us to do so. Make no mistake, I really like what I saw in R12 so far, > but we'd like to migrate on our own pace. > Your cooperation will be *highly* appreciated. > > Valentin Micic > Principal Consultant > PHAROS CONSVLTING (PTY) LTD. > Cell: +27 83 212 9180 > > ----- Original Message ----- > From: "Sean Hinde" > To: "Rickard Green" > Cc: "Erlang/OTP discussions" > Sent: Sunday, December 09, 2007 1:51 AM > Subject: Re: [erlang-questions] Source patch for R12B-0 available > > > > Hi Rikard, > > > > Do you have any plans to release a patch for those using R11B-5 on 64 > > bit sparc? I'm thinking mainly of the OTP-7006 issue, initially > > reported on R11B-5. > > > > Thanks, > > Sean > > > > On 7 Dec 2007, at 14:17, Rickard Green wrote: > > > >> A patch that fixes the following issues is now available at > >> http://www.erlang.org/download.html . Instructions for applying > >> the patch can be found in the patch README. > >> > >> BR, > >> Rickard Green, Erlang/OTP, Ericsson AB. > >> > >> ------------------------------------------------------------------------ > >> > >> OTP-7006 The SMP emulator on sparc64 erroneously used the sparc32 > >> atomic and the sparc32 spinlock implementations which > >> caused it to crash. > >> > >> OTP-7012 Matching an empty binary in a record and then using the > >> same record again could cause a compiler crash. > >> > >> Example code that triggers the crash: > >> > >> -record(r, {a,b}). > >> t(R) -> > >> #r{a = <<>>} = R, > >> R#r.b. > >> > >> OTP-7013 file:read/2 and file:consult_stream/1,3 did not use an empty > >> prompt on I/O devices. This bug has now been corrected. > >> > >> OTP-7014 configuring --enable-darwin-universal or --enable- > >> darwin-64bit > >> on MacOSX could result in a non optimized emulator. Top > >> level > >> configure script now corrected. > >> > >> OTP-7015 configuring --with-gd did not produce correct include flags > >> for percept. > >> > >> ------------------------------------------------------------------------ > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From dmitriid@REDACTED Mon Dec 10 13:48:53 2007 From: dmitriid@REDACTED (Dmitrii 'Mamut' Dimandt) Date: Mon, 10 Dec 2007 14:48:53 +0200 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang In-Reply-To: References: Message-ID: <475D35B5.50004@gmail.com> Joel Reymont wrote: > I need a name for a Cocoa bridge for Erlang. > > I tried various permutations of cocoa, objc, e, erl, erly but didn't > like any. > eco ecoa (rhymes with eco :) ) coke :) From andreas.hillqvist@REDACTED Mon Dec 10 13:47:31 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Mon, 10 Dec 2007 13:47:31 +0100 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: <475D25B8.2080901@it.uu.se> References: <475D13F2.6040908@elte.hu> <475D25B8.2080901@it.uu.se> Message-ID: <8268eea30712100447n76cc316ew30d767cc6f228d70@mail.gmail.com> I am missing the ability to send Variables to "fun [xxx:]yyy/z". Something like: F = fun ExprF/0. And: F = fun ExprM:ExprF/0. Where the look up to a function is performed only once when the fun operation is executed. And where calls to F() should be as fast/slow as the: F = fun yyy/0. Or: F = fun xxx:yyy/0. Another question: Should it be possible to bind BIF's to fun's not specifying module? F = fun time/0. Instead of: F = fun erlang:time/0. I think it is OK like it is. But I take it up for discussion. Kind regards, Andreas Hillqvist 2007/12/10, Richard Carlsson : > Lovei Laszlo wrote: > > 6.6 Function Calls > > > > ExprF(Expr1,...,ExprN) > > ExprM:ExprF(Expr1,...,ExprN) > > > > ExprM should evaluate to a module name and ExprF to a function name > > or a fun. > > [...] > > The module name can be omitted, if ExprF evaluates to the name of a > > local function, an imported function, or an auto-imported BIF. > > > > This means that the following code is valid (F evaluates to a local > > function name): > > > > f() -> ok. > > g() -> F=f, F(). > > > > In practice, this aborts with the reason badfun. The question is, which > > one is considered good: the manual, or the implementation? > > The implementation, most definitely. The reference manual apparently > tries to give a very condensed description of function calls, and fails > miserably. > > - The two forms ExprF(Expr1,...,ExprN) and ExprM:ExprF(Expr1,...,ExprN) > need to be explained separately; they are too different. > > - In the case of a call ExprF(Expr1,...,ExprN): > > * ExprF can be a constant atom (lexically), or otherwise it must > be an expression which evaluates to a fun. Nothing else is > possible. (In particular, no dynamically computed atoms.) > ExprF usually needs parentheses around it if it is not an > atom or a variable. > > * The handling of the constant atom thing is as follows: If the > code contains (a1,...,aN), and /N is the name of a > function imported (explicitly or automatically) from module M, > then the call is rewritten as M:(a1,...,aN). Otherwise, > the function /N must be a locally defined function, and > the call is equivalent to (fun /N)(a1,...,aN). > > * This slight syntactic weirdness is due to the fact that lexically, > Erlang uses atoms, not variables, to name functions. It's a > remnant from Erlang's roots in Prolog. It gets strange sometimes > but we can live with it. > > - In the case of a remote call ExprM:ExprF(Expr1,...,ExprN): > > * ExprF must evaluate to an atom; it cannot be a fun. > > * ExprM must evaluate to an atom (or, inofficially, to a value that > represents an instance of an abstract module). > > * It does not matter if ExprM and ExprF are lexically atoms or not. > However, the compiler can generate a bit more efficient code > if both ExprM and ExprF are known at compile time. > > /Richard > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From vances@REDACTED Mon Dec 10 13:58:23 2007 From: vances@REDACTED (Vance Shipley) Date: Mon, 10 Dec 2007 07:58:23 -0500 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang In-Reply-To: References: Message-ID: <20071210125753.GA220@little-black-book.motivity.ca> On Mon, Dec 10, 2007 at 11:53:58AM +0000, Joel Reymont wrote: } I need a name for a Cocoa bridge for Erlang. AquaErl ObjectiveErl From chsu79@REDACTED Mon Dec 10 14:24:46 2007 From: chsu79@REDACTED (Christian S) Date: Mon, 10 Dec 2007 14:24:46 +0100 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: <8268eea30712100447n76cc316ew30d767cc6f228d70@mail.gmail.com> References: <475D13F2.6040908@elte.hu> <475D25B8.2080901@it.uu.se> <8268eea30712100447n76cc316ew30d767cc6f228d70@mail.gmail.com> Message-ID: On Dec 10, 2007 1:47 PM, Andreas Hillqvist wrote: > I am missing the ability to send Variables to "fun [xxx:]yyy/z". > > Something like: > F = fun ExprF/0. > > And: > F = fun ExprM:ExprF/0. > If you look at the document in the source that describes the external format you will see that this kind of fun (that just reference the fun to call by its name) already exist. If funs are bound to the offset and checksum into a module or if it is just referencing the names exposed by the external api has huge impact for code-switching. It feels like this is the area where you just have to be very experienced to know how and when to use funs without painting youself into a corner about how troublesome code switching will be. From anupam.kapoor@REDACTED Mon Dec 10 14:13:51 2007 From: anupam.kapoor@REDACTED (Anupam Kapoor) Date: Mon, 10 Dec 2007 18:43:51 +0530 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang References: Message-ID: <8763z6lmk0.fsf@virat.homelinux> Joel Reymont wrote: ,---- | > I need a name for a Cocoa bridge for Erlang. `---- cocerl :o) ? anupam From alexander.lamb@REDACTED Mon Dec 10 14:39:38 2007 From: alexander.lamb@REDACTED (Alexander Lamb) Date: Mon, 10 Dec 2007 14:39:38 +0100 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang In-Reply-To: References: Message-ID: <2911F9CF-EE10-4294-957B-E70C2C92C4BD@rodanotech.ch> > > BriCoErl - Bridge Cocoa to Erlang. > Does not sound too good in French... "Bricolage" can be understood as "Lazy hack". As another poster said, I like "ObjectiveErl" -- Alexander Lamb Founding Associate RODANOTECH S?rl 4 ch. de la Tour de Champel 1206 Geneva Switzerland Tel: 022 347 77 37 Fax: 022 347 77 38 http://www.rodanotech.ch From phiroc@REDACTED Mon Dec 10 14:42:32 2007 From: phiroc@REDACTED (phiroc@REDACTED) Date: Mon, 10 Dec 2007 14:42:32 +0100 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang In-Reply-To: <20071210125753.GA220@little-black-book.motivity.ca> References: <20071210125753.GA220@little-black-book.motivity.ca> Message-ID: <1197294152.475d42482f130@imp.free.fr> Cocker ErCoBi (Erlang to Cocoa Bridge) Early Cocoa Bifrost (rainbow bridge to Valhalla) phiroc On Mon, Dec 10, 2007 at 11:53:58AM +0000, Joel Reymont wrote: } I need a name for a Cocoa bridge for Erlang. From joelr1@REDACTED Mon Dec 10 15:44:47 2007 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 10 Dec 2007 14:44:47 +0000 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang In-Reply-To: <1197294152.475d42482f130@imp.free.fr> References: <20071210125753.GA220@little-black-book.motivity.ca> <1197294152.475d42482f130@imp.free.fr> Message-ID: <8DC72BD9-463C-4467-B984-0F09A9725589@gmail.com> On Dec 10, 2007, at 1:42 PM, phiroc@REDACTED wrote: > Bifrost (rainbow bridge to Valhalla) I rather like this one since it's easy to pronounce and a play on bridge. Many thanks to everyone who submitted their versions! Joel -- http://wagerlabs.com From andreas.hillqvist@REDACTED Mon Dec 10 16:13:49 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Mon, 10 Dec 2007 16:13:49 +0100 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: References: <475D13F2.6040908@elte.hu> <475D25B8.2080901@it.uu.se> <8268eea30712100447n76cc316ew30d767cc6f228d70@mail.gmail.com> Message-ID: <8268eea30712100713l6045c448r40f21ddb044c0844@mail.gmail.com> I have read the documentation: The following fun expressions are also allowed: fun Name/Arity fun Module:Name/Arity In Name/Arity, Name is an atom and Arity is an integer. Name/Arity must specify an existing local function. The expression is syntactic sugar for: fun (Arg1,...,ArgN) -> Name(Arg1,...,ArgN) end Which dose not state that Module and/or Name could be variables containing atom. So I guess I am proposing an addition to Erlang and should probably write an EEP. But lets first discuss the topic here. If I write the following module: -module(fun_test1). -export([start/0]). -export([hello/1]). start() -> F = make_fun(?MODULE, hello, 1), F("Andreas"). hello(Name) -> io:format("Hello ~p\n", [Name]). make_fun(Module, Function, Arity) -> fun Module:Function/Arity. I receive the following error message using R12-0: ./fun_test1.erl:14: syntax error before: Module ./fun_test1.erl:7: function make_fun/3 undefined error I have now looked in to "Erlangs External Format and distribution protocol" I think it would be plausible to transform: fun Module:Function/Arity. To a value of tag 113. It is doable with something like: make_fun(Module, Function, Arity) when is_atom(Module), is_atom(Function), Arity >= 0, Arity < 255 -> <<131, BinModule/binary>> = term_to_binary(Module), <<131, BinFunction/binary>> = term_to_binary(Function), <<131, BinArity/binary>> = term_to_binary(Arity), Bin = <<131, 113, BinModule/binary, BinFunction/binary, BinArity/binary>>, binary_to_term(Bin). I guess it is not possible to write a parse-transformer due to the parser error. The same problem applies to internal functions: -module(fun_test4). -export([start/0]). start() -> F = make_fun(hello, 1), F("Andreas"). hello(Name) -> io:format("Hello ~p\n", [Name]). make_fun(Function, Arity) -> fun Function/Arity. Where I receive the following error message using R12-0: ./fun_test4.erl:13: syntax error before: Function ./fun_test4.erl:6: function make_fun/2 undefined ./fun_test4.erl:9: Warning: function hello/1 is unused But i leave to list decide if this also should apply to internal functions exported as funs? Kind regards Andreas Hillqvist 2007/12/10, Christian S : > On Dec 10, 2007 1:47 PM, Andreas Hillqvist wrote: > > I am missing the ability to send Variables to "fun [xxx:]yyy/z". > > > > Something like: > > F = fun ExprF/0. > > > > And: > > F = fun ExprM:ExprF/0. > > > > If you look at the document in the source that describes the external > format you will see that this kind of fun (that just reference the fun to > call by its name) already exist. > > If funs are bound to the offset and checksum into a module or if it is > just referencing > the names exposed by the external api has huge impact for code-switching. > It feels like this is the area where you just have to be very > experienced to know > how and when to use funs without painting youself into a corner about > how troublesome > code switching will be. > From jay@REDACTED Mon Dec 10 16:47:57 2007 From: jay@REDACTED (Jay Nelson) Date: Mon, 10 Dec 2007 07:47:57 -0800 Subject: [erlang-questions] eep: New gen_stream module In-Reply-To: <475D2F31.5080301@it.uu.se> References: <66176D72-6A20-40BC-8CF1-557B2C176875@duomark.com> <475D2F31.5080301@it.uu.se> Message-ID: <570312D3-BEAC-41AC-93A3-4C90327A87E5@duomark.com> As someone else pointed out, I left out gen_stream.hrl in the tarball. The web page has been updated. I excised the main eep text to address Per's questions below. On Dec 10, 2007, at 4:21 AM, Per Gustafsson wrote: > some things which are unclear how it would work. >> Behaviour callbacks: > > These are not really the behaviour callbacks, but rather the > interface to the gen_stream module, Quite right, my bad. Will incorporate a separate section in the eep to explain. Inline below is the description. > I was a little bit confused by this at first, but the code seems to > indicate that the actual callbacks for a gen_stream behaviour is: Declaring a gen_stream behaviour means that each process launched by the gen_stream has to implement the following functions which are used to extract successive chunks of the stream: > > init/3, Creates an initial state for the process. My example opens a dets table and passes it back to the gen_stream server as its instance state. > terminate/1, Called when the chunking process goes down. This can happen normally when gen_stream receives its first end_of_stream result (it sends a stop message to all behaviour processes) or when a failure condition occurs or an external event causes failure. > stream_length/0, > stream_length/1, Before init/3 is called, the gen_stream determines the stream_length so that it can report progress and handle length requests. The argument to the second signature is arbitrary module arguments that are passed in to init as well. They come from the Options proplist of the gen_stream:start_link call. The source option includes {behaviour, Module, ModuleArgs}. The behaviour is free to interpret them as it wishes. stream_length should return an integer for a fixed-sized stream, or an atom typically for another value such as infinite, unknown, or some other meaningful token for the domain. It is possible to use any term, such as {fewer_than, 20000}. A call to stream_length will return the integer, atom or term. A call to pct_complete returns an integer from 0 to 100 in the case of an integer stream_length, the actual atom or term of stream_length in other cases. > extract_block/3, Given a normal request (there are enough elements to fill the chunk) for a full 'next_chunk', this function hands back the desired chunk. > extract_split_block/4, In the case of a circular data stream, this function is called when a chunk will span the end of the stream and the beginning of the stream. > extract_final_block/3, In the case of a fixed-length data stream, this function is called when the rest of the stream is less than one chunk size. > inc_progress/2 Allows the behaviour to define what constitutes a chunk_size when computing pct_complete. The chunk just extracted and returned to gen_stream by one of the extract_xxx_block calls, is handed to inc_progress along with the quantity already seen. The function should do the math to increment the quantity seen. Introducing this allowed the possibility of using a non-binary stream. My example is a dets table that is accessed in sorted order by visiting its numeric keys from 1 to 20. The return value was {Key, Object} where object could be anything. I just count the number of keys returned in each block of results. > > I guess that the eep also needs to define what these functions > should do to make it possible to define gen_stream behaviours I will write this up and add formal arguments with better descriptions. > > >> start, start_link as in gen_server >> init(Args, Options) -> Same as gen_server plus list of >> Options: >> {stream, {file, path_to_file()} | >> {binary, binary()} | >> {behaviour, atom(), ExtraArgs}} > > I think it would be nice to add a fourth lightweight option: > > {generator, fun(() -> {binary(), fun()} | end_of_stream)} > > That is a fun which returns a binary and a new fun which will > produce the next chunk or an end_of_stream marker, but this might > not fit with the OTP framework I was worried about funs and hot code loading. This is very easy to do without resorting to funs: Bin = Binary:GeneratorFun(Args), {ok, P1} = gen_stream:start_link([{binary, Bin}]). > >> {chunk_size, integer()} returned sub-binary size, >> default is ~8K > > It would be nice to have a chunk terminator such as newline rather > than an explicit size or would this be implemented using a > gen_stream behaviour? I knew this would be the first question / request. It gets into a big side debate that I wanted to avoid: just newlines? How about arbitrary constant? How about a regexp? Right now I would like to focus on the concept of a serial stream that cannot fit in memory, doesn't exist physically or is a good abstraction for a data item you have your hands on. I think that is generally useful, but feedback from the community and experience with some example code would provide concrete analysis as to whether it is in practice as useful as I expect. For now, the simple solution is to do the line breaking yourself since it is a serial stream (not all the details are complete below, but to give you an idea of the complexity): next_line(GS, PrevChunk) -> case GetLine(PrevChunk) of none -> Chunk = gen_stream:next_chunk(GS), {NewPrev, Line} = GetLine(PrevChunk, gen_stream:next_chunk(GS)); {NewPrev, Line} = DesiredResult-> DesiredResult end. I don't want to put an arbitrarily long computation inside the gen_stream as a blocking call after a chunk has been retrieved. It is better for the application writer to make decisions about serial blocking. Therefore I need a way to push it down into the gen_stream chunking processes. I have a solution that allows the stream to be consumed in "chunks" or in "segments" (a segment is a further subdivision of a chunk using application logic to extract a conceptual chunk rather than a size determined chunk), but I don't want to confuse the proposal or the performance by introducing segments in the initial implementation. The biggest thing about the design pattern is that the performance characteristics should be tunable declaratively by the addition or removal of processes, buffers or both and that change needs to apply to segments as well as chunks. Right now there is a segmenting solution possible on the single process (application writer's) side of the gen_stream. > >> {chunks_per_proc, integer()} num of internal chunks, >> default is 1 >> {circular, false | true} whether stream repeats, >> default is false >> {num_processes, integer()} num_processes used, default 1 > > It is not clear to me what this means. Is this the number of > processes which will communicate with the server or the number of > processes that the server will spawn? The gen_stream is a single gen_server process and is accessed from your application as such, in a single process or concurrent manner as you choose, but with all requests serialized in the gen_stream's message queue. (Think of it as a center point in a fan-in / fan-out configuration.) The chunk_size parameter defines the blocking factor when returning data and when obtaining it from the stream source. The num_processes determines how many worker processes are spawned by the gen_stream to concurrently load up buffers in anticipation of next_chunk requests. The chunks_per_proc is how many buffers (or chunks) each process should attempt to maintain. These parameters allow you to control how much data to read ahead and how many concurrent processes are contending for a single resource (a raw binary can be accessed in parallel easily, while 10 separate file handles may have contention other than the file position information). Some applications need large blocking factors because of slow sources, others needs lots of buffers because the request rate is high. > >> next_chunk(Server::pid()) -> binary() | end_of_stream This can actually return any term in the case of a behaviour, but binary in the case of file or raw binary source. > > >> pct_complete(Server::pid()) -> integer() | atom() >> stream_size(Server::pid()) -> integer() | atom() > can these return any atom or only specific ones e.g. 'infinite' or > 'error' They both return the stored stream_size datum when the stream_size is not an integer. A behaviour can choose to use its own significant term by returning it to the stream_length call, but raw binary and file stream can only return integer() or is_circular. jay From alex.arnon@REDACTED Mon Dec 10 17:49:00 2007 From: alex.arnon@REDACTED (Alex Arnon) Date: Mon, 10 Dec 2007 18:49:00 +0200 Subject: [erlang-questions] ODE binding. Message-ID: <944da41d0712100849i1867bf9eya1ff2ad208b331d@mail.gmail.com> Hi All, Has anyone built a binding (port driver or otherwise) to ODE (the Open Dynamics engine, http://www.ode.org/)? Inquiring minds want to know :) Thanks, Alex. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsuraan@REDACTED Mon Dec 10 19:10:49 2007 From: tsuraan@REDACTED (tsuraan) Date: Mon, 10 Dec 2007 12:10:49 -0600 Subject: [erlang-questions] ejabberd postgres driver problem Message-ID: <84fb38e30712101010o7cd25b1cl7e44635f00092884@mail.gmail.com> I'm hoping this is an appropriate place to post my problem attempting to use the ejabberd postgres driver in my own code... I have a postgresql table whose format is like this: mydb=# \d attachments Table "public.attachments" Column | Type | Modifiers --------+---------+-------------------------------------------------------------- atchid | bigint | not null default nextval('attachments_atchid_seq'::regclass) msgkey | bigint | not null docid | bigint | not null parent | bigint | name | text | body | boolean | Indexes: "attachments_pkey" PRIMARY KEY, btree (atchid) "attachments_msgkey_key" UNIQUE, btree (msgkey, docid, parent, name) Foreign-key constraints: "attachments_docid_fkey" FOREIGN KEY (docid) REFERENCES documents(docid) ON UPDATE CASCADE ON DELETE CASCADE "attachments_msgkey_fkey" FOREIGN KEY (msgkey) REFERENCES messages(msgkey) ON UPDATE CASCADE ON DELETE CASCADE "attachments_parent_fkey" FOREIGN KEY (parent) REFERENCES attachments(atchid) ON UPDATE CASCADE ON DELETE CASCADE In erlang, I do the following and get the pasted-in error: 7> {ok, Db} = pgsql:connect("localhost", "mydb", "me", ""). Params: [{secret,{7183,274541943}}, {{parameter,"TimeZone"},"CST6CDT"}, {{parameter,"standard_conforming_strings"},"off"}, {{parameter,"session_authorization"},"me"}, {{parameter,"server_version"},"8.1.5"}, {{parameter,"server_encoding"},"UTF8"}, {{parameter,"is_superuser"},"on"}, {{parameter,"integer_datetimes"},"off"}, {{parameter,"DateStyle"},"ISO, MDY"}, {{parameter,"client_encoding"},"UTF8"}] {ok,<0.44.0>} 8> pgsql:squery(Db, "SELECT * FROM Attachments"). =ERROR REPORT==== 10-Dec-2007::11:55:35 === Error in process <0.44.0> with exit value: {badarg,[{erlang,binary_to_list,[null]},{pgsql_proto,'-process_squery_cols/1-fun-0-',1},{lists,map,2},{lists,map,2},{pgsql_proto,process_squery_cols,1},{pgsql_proto,process_squery,1},{pgsql_proto,idle,2}]} ** exited: {badarg,[{erlang,binary_to_list,[null]}, {pgsql_proto,'-process_squery_cols/1-fun-0-',1}, {lists,map,2}, {lists,map,2}, {pgsql_proto,process_squery_cols,1}, {pgsql_proto,process_squery,1}, {pgsql_proto,idle,2}]} ** I really don't understand erlang tracebacks yet, so this error message is pure greek to me. Does anyone have a clue what is causing this, or where I can start to debug this? Other database stuff works, like so: 2> pgsql:squery(Db, "CREATE TEMP TABLE TEST(key bigint primary key)"). {ok,["CREATE TABLE"]} 3> pgsql:squery(Db, "SELECT * FROM TEST"). {ok,[{"SELECT",[{desc,1,"key",20,text,8,-1,121252}],[]}]} 4> pgsql:squery(Db, "INSERT INTO TEST VALUES(1)"). {ok,["INSERT 0 1"]} 5> pgsql:squery(Db, "SELECT * FROM TEST"). {ok,[{"SELECT",[{desc,1,"key",20,text,8,-1,121252}],[["1"]]}]} So it looks like there's something about my table that's making the pg driver die. Can anyone see what's happening? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim.mccoy@REDACTED Mon Dec 10 19:22:00 2007 From: jim.mccoy@REDACTED (Jim McCoy) Date: Mon, 10 Dec 2007 10:22:00 -0800 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang In-Reply-To: <8DC72BD9-463C-4467-B984-0F09A9725589@gmail.com> References: <20071210125753.GA220@little-black-book.motivity.ca> <1197294152.475d42482f130@imp.free.fr> <8DC72BD9-463C-4467-B984-0F09A9725589@gmail.com> Message-ID: marshmallow, because it goes nicely with a hot cup of cocoa :) jim From elharaty@REDACTED Mon Dec 10 19:46:23 2007 From: elharaty@REDACTED (Emad El-Haraty) Date: Mon, 10 Dec 2007 10:46:23 -0800 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: <475D13F2.6040908@elte.hu> References: <475D13F2.6040908@elte.hu> Message-ID: you need to specify the module: f() -> ok. g() -> F=f, ?MODULE:F(). h(X) -> M=erlang, F=is_integer, M:F(X). the function h/1 works just fine since the module is specified, the function g/0 works when a module is specified On Dec 10, 2007 2:24 AM, Lovei Laszlo wrote: > Hi all! > > A quote from the reference manual: > http://www.erlang.org/doc/reference_manual/expressions.html#6.6 > > 6.6 Function Calls > > ExprF(Expr1,...,ExprN) > ExprM:ExprF(Expr1,...,ExprN) > > ExprM should evaluate to a module name and ExprF to a function name > or a fun. > [...] > The module name can be omitted, if ExprF evaluates to the name of a > local function, an imported function, or an auto-imported BIF. > > This means that the following code is valid (F evaluates to a local > function name): > > f() -> ok. > g() -> F=f, F(). > > In practice, this aborts with the reason badfun. The question is, which > one is considered good: the manual, or the implementation? > > > Thanks! > Laszlo > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From exta7@REDACTED Mon Dec 10 19:54:41 2007 From: exta7@REDACTED (Zvi) Date: Mon, 10 Dec 2007 10:54:41 -0800 (PST) Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang In-Reply-To: References: Message-ID: <14259125.post@talk.nabble.com> Aquarel (instead of AquaErl) Joel Reymont wrote: > > I need a name for a Cocoa bridge for Erlang. > > I tried various permutations of cocoa, objc, e, erl, erly but didn't > like any. > > Any suggestions? > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/Good-name-for-a-Cocoa-bridge-for-Erlang-tp14251748p14259125.html Sent from the Erlang Questions mailing list archive at Nabble.com. From david.hopwood@REDACTED Mon Dec 10 19:48:47 2007 From: david.hopwood@REDACTED (David Hopwood) Date: Mon, 10 Dec 2007 18:48:47 +0000 Subject: [erlang-questions] graphical window system for erlang on top of the X11 protocol In-Reply-To: <20071210121402.GA28719@cs.uni-bonn.de> References: <20071210121402.GA28719@cs.uni-bonn.de> Message-ID: <475D8A0F.1090604@industrial-designers.co.uk> Ignatios Souvatzis wrote: > Hi all, > > ISTR having read a paper which described an X11 interface for Erlang that > sits on top of the protocol, which was claimed to be much easier than > building on top of Xlib... I can't find that paper anymore; where is it? EX11 - A GUI in a Concurrent Functional Language. Joe Armstrong. 3rd ACM SIGPLAN Erlang Workshop. Snowbird, Utah, USA, September 22, 2004. Citation: Slides: I couldn't find the paper itself on-line, for non-ACM-subscribers. -- David Hopwood From dking@REDACTED Mon Dec 10 20:30:31 2007 From: dking@REDACTED (David King) Date: Mon, 10 Dec 2007 11:30:31 -0800 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang In-Reply-To: References: Message-ID: <7628C964-94D4-4C13-BC16-6820FA8C8E09@ketralnis.com> > I need a name for a Cocoa bridge for Erlang. > I tried various permutations of cocoa, objc, e, erl, erly but didn't > like any. > Any suggestions? Any chance that you can write it to OpenStep, a large subset of Cocoa, instead of to Cocoa itself? OpenStep is far more portable (having the Cocoa as well as GNUstep implementations) I don't know either, so I don't know what you'd be missing out on. From domi@REDACTED Mon Dec 10 20:42:12 2007 From: domi@REDACTED (Dominique de Waleffe) Date: Mon, 10 Dec 2007 20:42:12 +0100 Subject: [erlang-questions] crypto+ssh ? Message-ID: <475D9694.7010302@dewaleffe.org> Using the recent R12B, I am trying to use the ssh module to connect to a remote server. First, I seem to have a problem starting the crypto application on windows (XP or Vista)... 1> application:start(crypto). {error,{shutdown,{crypto_app,start,[normal,[]]}}} =INFO REPORT==== 10-Dec-2007::20:37:37 === application: crypto exited: {shutdown,{crypto_app,start,[normal,[]]}} type: temporary 2> What can cause this? What should I look at? Second, It is not clear from the manual what I have to do with the ssh stuff to go further than a connexion... I want to programmatically send command to a server I connect to and recover the output (both stderr and stdout). Are there any sample/tutorial on how to do this? Thanks for info. D. From bob@REDACTED Mon Dec 10 21:00:33 2007 From: bob@REDACTED (Bob Ippolito) Date: Mon, 10 Dec 2007 12:00:33 -0800 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang In-Reply-To: <7628C964-94D4-4C13-BC16-6820FA8C8E09@ketralnis.com> References: <7628C964-94D4-4C13-BC16-6820FA8C8E09@ketralnis.com> Message-ID: <6a36e7290712101200n22b43252s6294b6d9ce24c675@mail.gmail.com> On 12/10/07, David King wrote: > > I need a name for a Cocoa bridge for Erlang. > > I tried various permutations of cocoa, objc, e, erl, erly but didn't > > like any. > > Any suggestions? > > Any chance that you can write it to OpenStep, a large subset of Cocoa, > instead of to Cocoa itself? OpenStep is far more portable (having the > Cocoa as well as GNUstep implementations) > > I don't know either, so I don't know what you'd be missing out on. OpenStep/GNUStep is kinda useless really. There isn't a usable Win32 implementation of AppKit and most of the interesting stuff in Cocoa is too recent for it to have trickled down. That said, a proper bridge is just a hook into the Objective-C runtime, you don't really have to much with many of the APIs directly. Especially if you only care about Mac OS X 10.5+ which ships with a lot of infrastructure designed to make writing bridges easier. Caring about alternative OS and runtimes in this case would be a lot of wasted effort, if you need something cross-platform the "least worst" is going to generally be with wxWidgets or just go HTML or Flash. -bob From bob@REDACTED Mon Dec 10 22:40:26 2007 From: bob@REDACTED (Bob Ippolito) Date: Mon, 10 Dec 2007 13:40:26 -0800 Subject: [erlang-questions] pre-EEP: accurate float printing (replacement for io_lib_format:fwrite_g/1) Message-ID: <6a36e7290712101340n610c9f1cud828da66c9929bad@mail.gmail.com> If we submit a patch to io_lib_format:fwrite_g/1 to use an accurate floating point decimal representation, would it be accepted? If not, is there a less intrusive way that we could override this? I find it VERY annoying to have the shell print "~.5g", since that often doesn't have enough precision to see what I need to see in the floats we work with. I also generally prefer to see "0.1" instead of "0.10000". We have a suitable implementation here, which is the same algorithm that several other programming languages use and there's a paper that proves its correctness: http://mochiweb.googlecode.com/svn/trunk/src/mochinum.erl It could probably be made a little faster if necessary by using a pre-calculated set of results for int_pow that covers the range that the algorithm needs, e.g.: int_pow(10, 0) -> 1; int_pow(10, 1) -> 10; ... int_pow(10, 324) -> ... -bob From joelr1@REDACTED Mon Dec 10 22:47:44 2007 From: joelr1@REDACTED (Joel Reymont) Date: Mon, 10 Dec 2007 21:47:44 +0000 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang In-Reply-To: <7628C964-94D4-4C13-BC16-6820FA8C8E09@ketralnis.com> References: <7628C964-94D4-4C13-BC16-6820FA8C8E09@ketralnis.com> Message-ID: On Dec 10, 2007, at 7:30 PM, David King wrote: >> Any chance that you can write it to OpenStep, a large subset of >> Cocoa, instead of to Cocoa itself? Not a single chance :-). I'm not familiar with OpenStep, I have Cocoa and I just need good content to illustrate the "C interface" chapter of my book. -- http://wagerlabs.com From rvirding@REDACTED Mon Dec 10 23:04:31 2007 From: rvirding@REDACTED (Robert Virding) Date: Mon, 10 Dec 2007 23:04:31 +0100 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: <475D13F2.6040908@elte.hu> References: <475D13F2.6040908@elte.hu> Message-ID: <3dbc6d1c0712101404o33a585a4p63b63b7dfd63bcff@mail.gmail.com> I think the main problem is that the documentation is a little unclear as to what should syntactically be an atom, or if not an atom what it can/should evaluate to. Unfortunately it is not consistent. So with ExprF(Exp1, ... , ExprN) ExprF should (syntactically) be an atom, or it should evaluate to a fun. That's it, no other options. With ExprM:ExprF(Expr1,...,ExprN) ExprM and ExprF should (syntactically) be atoms or evaluate to atoms. Again that's it. Originally it was actually a little more consistent as only the atom forms were allowed. So it was only foo(...) and foo:bar(...). For the case where they weren't atoms you had to use apply/2/3. You can view the forms when not atoms as syntactic sugar for apply (which they actually are): ExprF(Expr1 ... ExprN) ==> apply(ExprF, [Expr1 ... ExprN]) ExprM:ExprF(Expr1 ... ExprN) ==> apply(ExprM, ExprF, [Expr1 ... ExprN]) (but optimised so the argument lists are never built) Then it is consistent. Robert P.S. Forget the {ExprM,ExprF} form for apply/2, it was a pseudo fun hack from before funs. On 10/12/2007, Lovei Laszlo wrote: > > Hi all! > > A quote from the reference manual: > http://www.erlang.org/doc/reference_manual/expressions.html#6.6 > > 6.6 Function Calls > > ExprF(Expr1,...,ExprN) > ExprM:ExprF(Expr1,...,ExprN) > > ExprM should evaluate to a module name and ExprF to a function name > or a fun. > [...] > The module name can be omitted, if ExprF evaluates to the name of a > local function, an imported function, or an auto-imported BIF. > > This means that the following code is valid (F evaluates to a local > function name): > > f() -> ok. > g() -> F=f, F(). > > In practice, this aborts with the reason badfun. The question is, which > one is considered good: the manual, or the implementation? > > > Thanks! > Laszlo > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth.lundin@REDACTED Mon Dec 10 23:06:41 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Mon, 10 Dec 2007 23:06:41 +0100 Subject: [erlang-questions] crypto+ssh ? In-Reply-To: <475D9694.7010302@dewaleffe.org> References: <475D9694.7010302@dewaleffe.org> Message-ID: Hi, The crypto application is dependent on OpenSSL which you need to install yourself. You can find pre-built versions of OpenSSL for Windows here: http://www.openssl.org/related/binaries.html /Kenneth Erlang/OTP team, Ericsson AB On Dec 10, 2007 8:42 PM, Dominique de Waleffe wrote: > Using the recent R12B, > I am trying to use the ssh module to connect to a remote server. > > First, I seem to have a problem starting the crypto application on > windows (XP or Vista)... > > 1> application:start(crypto). > {error,{shutdown,{crypto_app,start,[normal,[]]}}} > > =INFO REPORT==== 10-Dec-2007::20:37:37 === > application: crypto > exited: {shutdown,{crypto_app,start,[normal,[]]}} > type: temporary > 2> > > What can cause this? What should I look at? > > Second, It is not clear from the manual what I have to do with the ssh > stuff to go further than a connexion... > I want to programmatically send command to a server I connect to and > recover the output (both stderr and stdout). > Are there any sample/tutorial on how to do this? > > Thanks for info. > > D. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From rvirding@REDACTED Mon Dec 10 23:15:05 2007 From: rvirding@REDACTED (Robert Virding) Date: Mon, 10 Dec 2007 23:15:05 +0100 Subject: [erlang-questions] Message queue reflection (was: My biggest beef with Erlang) In-Reply-To: <474C4AC9.6030304@industrial-designers.co.uk> References: <0c3664ab49a3bbc39d40874f75402cc3@tombob.com> <6605FFC7-BCF9-440E-AB92-9C2FECCA4932@gmail.com> <3dbc6d1c0711261332j5716573el8550d6799366b095@mail.gmail.com> <9b08084c0711270052s7017affaua7bfd59b81747669@mail.gmail.com> <474C4AC9.6030304@industrial-designers.co.uk> Message-ID: <3dbc6d1c0712101415t7647c0a1ua38e765d67dea649@mail.gmail.com> On 27/11/2007, David Hopwood wrote: > > > In the spirit of funs it would be very nice to say: > > > > F = fun(Pattern1) -> Actions1 > > (Pattern2) -> Actions2 > > after Time -> Actions > > end, > > ... > > receive(Fun) > > > > This would make writing an erlang meta interpreter much easier > > and allow all kinds of mischief > > The missing feature that is needed to implement this (and lots of other > useful things) is the ability to reflect on a process' message queue. > That is, to iterate through messages in a process' queue without > removing them, and then to remove a given message (rather than just > the first message that matches a statically determined pattern). This could lead to some really weird behaviour if programmers were allowed to manipulate the message queue directly. Funs would be nice, but then we would actually end up with the same problems as allowing user defined functions in guards. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From kosik@REDACTED Mon Dec 10 23:36:44 2007 From: kosik@REDACTED (Matej Kosik) Date: Mon, 10 Dec 2007 23:36:44 +0100 Subject: [erlang-questions] documentation of data structures In-Reply-To: <200712070917.13979.bekesa@sch.bme.hu> References: <200712070917.13979.bekesa@sch.bme.hu> Message-ID: <475DBF7C.4040504@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andras Georgy Bekes wrote: (snip) > -queue: The doc doesn't say anything about the implementation, > only: "implements FIFO queues in an efficient manner". > It states that "all operations has an amortised O(1) running time", > except for some, that are "probably O(n)". This is rather vague. > Check the implementation. You will reveal that the operations for adding/removing elements from/to the head/tail can have O(1) complexity in some cases but in some cases they will have O(n) complexity. It would be particularly attractive, if someone implemented `queue' (with the same signature and semantics of operations) where those operations would have always O(1) complexity. That is, as I believe, impossible. Of course, queues can be implemented more efficiently, but in a different (non-functional-like) way. (snip) - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXb98L+CaXfJI/hgRAqxKAKCEpla9qGZBtfJW0bKjcoUanopXBACgwmyW x4eZCs+K8PMjQ+PNWDSg9gg= =nxc6 -----END PGP SIGNATURE----- From rvirding@REDACTED Mon Dec 10 23:51:59 2007 From: rvirding@REDACTED (Robert Virding) Date: Mon, 10 Dec 2007 23:51:59 +0100 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: <8268eea30712100713l6045c448r40f21ddb044c0844@mail.gmail.com> References: <475D13F2.6040908@elte.hu> <475D25B8.2080901@it.uu.se> <8268eea30712100447n76cc316ew30d767cc6f228d70@mail.gmail.com> <8268eea30712100713l6045c448r40f21ddb044c0844@mail.gmail.com> Message-ID: <3dbc6d1c0712101451o593d371dh3bf7d6eba170c09c@mail.gmail.com> On 10/12/2007, Andreas Hillqvist wrote: > > > make_fun(Module, Function, Arity) -> > fun Module:Function/Arity. You can actually do it today: make_fun(M, F, 0) -> fun () -> M:F() end; make_fun(M, F, 1) -> fun (A1) -> M:F(A1) end; make_fun(M, F, 2) -> fun (A1, A2) -> M:F(A1, A2) end; ... Not beautiful but it works. The only limitation is that you can only reach exported functions. Which is as it should be. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From raould@REDACTED Mon Dec 10 23:53:10 2007 From: raould@REDACTED (Raoul Duke) Date: Mon, 10 Dec 2007 14:53:10 -0800 Subject: [erlang-questions] Dryad or MapReduce in Erlang? Message-ID: <91a2ba3e0712101453l36120fdat4ff91dc748a90d42@mail.gmail.com> (haven't managed to find this talked about yet, sorry if this is old material.) One interesting thing about Map Reduce and Dryad is that, I think, they can dynamically choose how many machines and processes are involved in servicing the high-level plan. Are there things in the Erlang world with similar abilities of abstraction? So far I've been under the impression that most Erlang applications know ahead of time the intended distribution of things. thanks for any edification, -An ever Erlang newbie. From phiroc@REDACTED Tue Dec 11 00:15:27 2007 From: phiroc@REDACTED (Philippe de Rochambeau) Date: Tue, 11 Dec 2007 00:15:27 +0100 Subject: [erlang-questions] Accents on Macosx 10.4.11 Message-ID: <2E8B5410-10F1-45FC-8566-4AAF5C617FBA@free.fr> Hi, earlier today, I asked on this mailing list how you could make Erlang correctly display strings containing foreign accents in your terminal on macosx. This evening, I found a solution after noticing Joe Armstrong's remark on page 30 of "Programming Erlang": "What has happened to "H?kan" -- where did he go? This actually has nothing to do with Erlang but with the locale and character code settings on your terminal" Since, by default, all locale variables on Macosx are set to "C" (type "locale" on the CLI), I set LANG as follows in my .bashrc file: export LANG=fr_FR.ISO8859-1 Next, I switched my Terminal's character set encoding to Western (iso- latin-1). (In xterm, there no need to switch the character set as it seems to be iso-latin-1 by default.) Last, I type [72,229,107,97,110]. in erlang and, tadah, "H?kan" appeared in all his splendor. phiroc From jeffm@REDACTED Tue Dec 11 00:42:42 2007 From: jeffm@REDACTED (jm) Date: Tue, 11 Dec 2007 10:42:42 +1100 Subject: [erlang-questions] Good name for a Cocoa bridge for Erlang In-Reply-To: References: <20071210125753.GA220@little-black-book.motivity.ca> <1197294152.475d42482f130@imp.free.fr> <8DC72BD9-463C-4467-B984-0F09A9725589@gmail.com> Message-ID: <475DCEF2.40603@ghostgun.com> Jim McCoy wrote: > marshmallow, because it goes nicely with a hot cup of cocoa :) > In the tradition of the plan-9 OS: E. coli because it's totallly unmarketable. Jeff. From vlm@REDACTED Tue Dec 11 01:19:55 2007 From: vlm@REDACTED (Lev Walkin) Date: Mon, 10 Dec 2007 16:19:55 -0800 Subject: [erlang-questions] documentation of data structures In-Reply-To: <475DBF7C.4040504@fiit.stuba.sk> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> Message-ID: <475DD7AB.6080500@lionet.info> Matej Kosik wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Andras Georgy Bekes wrote: > > (snip) > >> -queue: The doc doesn't say anything about the implementation, >> only: "implements FIFO queues in an efficient manner". >> It states that "all operations has an amortised O(1) running time", >> except for some, that are "probably O(n)". This is rather vague. >> > > Check the implementation. You will reveal that the operations for adding/removing elements from/to > the head/tail can have O(1) complexity in some cases but in some cases they will have O(n) complexity. > > It would be particularly attractive, if someone implemented `queue' (with the same signature and > semantics of operations) where those operations would have always O(1) complexity. That is, as I > believe, impossible. Of course, queues can be implemented more efficiently, but in a different > (non-functional-like) way. Okasaki shows a way to have a queue with O(1) worst-case complexity. However the constant factor is rather large. The queue ADT has O(1) amortized complexity. In addition to that, it has a rather small constant factor, so it'll be faster overall. -- Lev Walkin vlm@REDACTED From mark-erlang@REDACTED Tue Dec 11 04:59:03 2007 From: mark-erlang@REDACTED (Mark Aufflick) Date: Tue, 11 Dec 2007 14:59:03 +1100 Subject: [erlang-questions] erlmerge download? Message-ID: <1242f34a0712101959s65395681w4fd9be73cdfab61c@mail.gmail.com> Hi all, The download link on the trapexit erlmerge page (http://www.trapexit.org/Erlmerge_-_The_install_tool) doesn't work. Is erlmerge deprecated or have I just not tried hard enough to find it's download location? Cheers, Mark. -- Mark Aufflick contact info at http://mark.aufflick.com/about/contact From jay@REDACTED Tue Dec 11 07:07:47 2007 From: jay@REDACTED (Jay Nelson) Date: Mon, 10 Dec 2007 22:07:47 -0800 Subject: [erlang-questions] eep: New gen_stream module In-Reply-To: <475D2F31.5080301@it.uu.se> References: <66176D72-6A20-40BC-8CF1-557B2C176875@duomark.com> <475D2F31.5080301@it.uu.se> Message-ID: Per wrote: > I think it would be nice to add a fourth lightweight option: > {generator, fun(() -> {binary(), fun()} | end_of_stream)} > That is a fun which returns a binary and a new fun which will > produce the next chunk or an end_of_stream marker, but this > might not fit with the OTP framework To which I replied: > I was worried about funs and hot code loading. This is very > easy to do without resorting to funs: > Bin = Binary:GeneratorFun(Args), > {ok, P1} = gen_stream:start_link([{binary, Bin}]). My reply was not equivalent to what Per was requesting, especially in the case where the fun is an infinite stream. I chose a partitioning of the problem domain, rather than a continuation-based approach as Per requested, because the latter is a sequential approach. By partitioning the stream, concurrent processes can buffer their assigned chunks ahead of time. With a continuation-based approach, the future funs are not known until the earlier chunks are fully extracted. Another problem with doing a quick fun approach, is that the stream could not be made circular even if it was of fixed size, because there would be no technique for getting the stream length or indicating progress / pct_complete. Not really a problem, but then the continuation approach has some additional restrictions that the other sources don't have. In my (lame, but functional) behaviour example code, I have a module called odd_nums.erl which returns an infinite stream of odd numbers. A given subsequence of the stream can be computed without any state except the starting point and the chunk size. There is another module called sorted_dets.erl which requires the open table reference as state, but again can address to a particular conceptual position and extract a chunk without the previous chunks having been extracted yet. I do not have an example which updates the state, although the gen_server as written supports this approach, partly because I couldn't think of one that would be useful. A function continuation could be a state that is updated when a chunk is returned, but it is very difficult to coordinate properly in the face of concurrency. The worker processes that are spawned by the gen_stream are addressed in round-robin fashion so that successive messages handled by the gen_stream are given to different workers so that each worker will have time to replenish its delivered buffer. Changing the parameter for the number of processes should not affect the resulting stream, so the continutation would need to return the function that gets its next chunk as current_chunk + N where N is the number of spawned processes. It would be difficult to find useful problems where this would be possible and I believe all of those can be transformed into a full-blown behaviour without much effort -- providing the stream_length and pct_complete options, plus circularity if it is a fixed-length functional stream. jay From tobbe@REDACTED Tue Dec 11 07:21:23 2007 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Tue, 11 Dec 2007 07:21:23 +0100 Subject: [erlang-questions] erlmerge download? In-Reply-To: <1242f34a0712101959s65395681w4fd9be73cdfab61c@mail.gmail.com> References: <1242f34a0712101959s65395681w4fd9be73cdfab61c@mail.gmail.com> Message-ID: Mark Aufflick wrote: > Hi all, > > The download link on the trapexit erlmerge page > (http://www.trapexit.org/Erlmerge_-_The_install_tool) doesn't work. Is > erlmerge deprecated or have I just not tried hard enough to find it's > download location? > It is obsolete. Look for faxien/sinan or cean instead. Cheers, Tobbe From dgud@REDACTED Tue Dec 11 08:21:23 2007 From: dgud@REDACTED (Dan Gudmundsson) Date: Tue, 11 Dec 2007 08:21:23 +0100 Subject: [erlang-questions] ODE binding. In-Reply-To: <944da41d0712100849i1867bf9eya1ff2ad208b331d@mail.gmail.com> References: <944da41d0712100849i1867bf9eya1ff2ad208b331d@mail.gmail.com> Message-ID: <475E3A73.4060401@erix.ericsson.se> Hi I have a half done binding (60-70% done but still missing the famous last 10%) I made a couple of years ago. I can send you the code if you're interested and if I can find it :-) it's on one of my computers somewhere... It probably needs to be changed to use todays improved driver api. And it only implements the parts I was interested in, I have forgotten which parts though. I want a copy when you have finished it, I want to play with it a couple of years from now when I have finished the other stuff on my today list, wxwidgets in better form, a new wings3d version :-D /Dan Alex Arnon wrote: > Hi All, > > Has anyone built a binding (port driver or otherwise) to ODE (the Open > Dynamics engine, http://www.ode.org/)? Inquiring minds want to know :) > > Thanks, > Alex. > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From klacke@REDACTED Mon Dec 10 23:59:06 2007 From: klacke@REDACTED (=?ISO-8859-1?Q?Claes_Wikstr=F6m?=) Date: Mon, 10 Dec 2007 23:59:06 +0100 Subject: [erlang-questions] Erlang HTTP client is not so fault tollerant... In-Reply-To: References: Message-ID: <475DC4BA.1040407@hyber.org> Timmy Turner wrote: > Therefore, I'd like to replace the first line of the incoming server > response from "HTTP/1.1 301\r\n" to "HTTP/1.1 301 Moved > Permanently\r\n", but I can't seem to find where the appropriate to do > so would be... > Personably I've found the HTTP client in OTP unusable and I'd never put it in a production environment unless the set of URLs to GET was finite and all GETs were tested. It hangs on bad input instead of returning an error last time I tried it. Not ready for production use. ibrowse in jungerl works much better. I don't think there are any easy ways to get to ibrowse short of checking out the jungerl tree and ripping it out though. /klacke From kosik@REDACTED Tue Dec 11 08:56:45 2007 From: kosik@REDACTED (Matej Kosik) Date: Tue, 11 Dec 2007 08:56:45 +0100 Subject: [erlang-questions] documentation of data structures In-Reply-To: <475DD7AB.6080500@lionet.info> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <475DD7AB.6080500@lionet.info> Message-ID: <475E42BD.6050203@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Lev Walkin wrote: > Matej Kosik wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Andras Georgy Bekes wrote: >> >> (snip) >> >>> -queue: The doc doesn't say anything about the implementation, only: >>> "implements FIFO queues in an efficient manner". >>> It states that "all operations has an amortised O(1) running time", >>> except for some, that are "probably O(n)". This is rather vague. >>> >> >> Check the implementation. You will reveal that the operations for >> adding/removing elements from/to >> the head/tail can have O(1) complexity in some cases but in some cases >> they will have O(n) complexity. >> >> It would be particularly attractive, if someone implemented `queue' >> (with the same signature and >> semantics of operations) where those operations would have always O(1) >> complexity. That is, as I >> believe, impossible. Of course, queues can be implemented more >> efficiently, but in a different >> (non-functional-like) way. > > > Okasaki shows a way to have a queue with O(1) worst-case complexity. > However the constant factor is rather large. The queue ADT has O(1) > amortized complexity. In addition to that, it has a rather small > constant factor, so it'll be faster overall. > In non-functional programming languages (also in Erlang) similar data-structure can be implemented with usual O(1) complexity without ``rather large'' constant factor. A different way of doing similar thing but it has different properties. - - it is more efficient - - it is outside functional programming paradigm (no referential transparency, side effects etc.) Such implementation can be done in Erlang too. I am not sure whether I understand why the above approach was not taken in Erlang. If mutable queues would be local to some process, no problems would arise. However, if one process wanted to pass a queue to another process, then if they tried to use them concurrently, interference could occur. With the original implementation, such interference is excluded. The penalty is that - - it is not the most efficient possible implementation - - equational reasoning cannot be applied (other, more complicated, proof-techniques are necessary) A typical tradeoff. However, if a queue would not be shared among processes than its mutable version would OK. Whouldn't it? - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXkK8L+CaXfJI/hgRAm42AJ41SmlQGrDmSnTE65g9gzeEiWzIfACgzreG 8SEpocgxu2NJHcZm5mQb7H8= =cfBQ -----END PGP SIGNATURE----- From raimo+erlang-questions@REDACTED Tue Dec 11 09:09:06 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 11 Dec 2007 09:09:06 +0100 Subject: [erlang-questions] pre-EEP: accurate float printing (replacement for io_lib_format:fwrite_g/1) In-Reply-To: <6a36e7290712101340n610c9f1cud828da66c9929bad@mail.gmail.com> References: <6a36e7290712101340n610c9f1cud828da66c9929bad@mail.gmail.com> Message-ID: <20071211080906.GA14875@erix.ericsson.se> I suggest you make the EEP for a new io_lib floating point print format. The problem here is to find a good letter since ~e, ~f and ~g are already used. Perhaps it can be done through some unused precision specifier... Changing an existing feature can always cause all kinds of unexpected problems. Then suggest that the shell should use the new format. These sound like nice backwards compatible changes that have a good chance of being accepted. On Mon, Dec 10, 2007 at 01:40:26PM -0800, Bob Ippolito wrote: > If we submit a patch to io_lib_format:fwrite_g/1 to use an accurate > floating point decimal representation, would it be accepted? If not, > is there a less intrusive way that we could override this? > > I find it VERY annoying to have the shell print "~.5g", since that > often doesn't have enough precision to see what I need to see in the > floats we work with. I also generally prefer to see "0.1" instead of > "0.10000". > > We have a suitable implementation here, which is the same algorithm > that several other programming languages use and there's a paper that > proves its correctness: > http://mochiweb.googlecode.com/svn/trunk/src/mochinum.erl > > It could probably be made a little faster if necessary by using a > pre-calculated set of results for int_pow that covers the range that > the algorithm needs, e.g.: > > int_pow(10, 0) -> 1; > int_pow(10, 1) -> 10; > ... > int_pow(10, 324) -> ... > > -bob > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From bob@REDACTED Tue Dec 11 09:43:05 2007 From: bob@REDACTED (Bob Ippolito) Date: Tue, 11 Dec 2007 00:43:05 -0800 Subject: [erlang-questions] pre-EEP: accurate float printing (replacement for io_lib_format:fwrite_g/1) In-Reply-To: <20071211080906.GA14875@erix.ericsson.se> References: <6a36e7290712101340n610c9f1cud828da66c9929bad@mail.gmail.com> <20071211080906.GA14875@erix.ericsson.se> Message-ID: <6a36e7290712110043j696da319n91ed647b310538a4@mail.gmail.com> ~g with no precision specification (io_lib_format:fwrite_g/1) is a perfect target and it hits every use the shell has, ~f and ~e I don't care about. Having yet another float format would be completely stupid and confusing to anyone that doesn't know the back story for why supposed backward compatibility required the need for another format. Other languages have undergone this type of change with no ill effects that I've heard of (e.g. TCL did this in 2003 [1]). The only possible compatibility problems I can imagine would be: 1. Tests that expect particular string outputs (generally a bad idea with floats anyway, and those sorts of tests really should be using ~.17g or float_to_list) 2. Somehow code that expects ~g with no explicit precision to return a string within some certain number of characters. However, if they expect a certain number of characters I'd expect that they'd specify that in the format. The benefits are huge though, we'll have a human-readable float format that actually accurately represents the number. I've been burned MANY times by looking at shell output and seeing several floats that print the same but are actually quite different. [1] http://www.tcl.tk/cgi-bin/tct/tip/132.html On 12/11/07, Raimo Niskanen wrote: > I suggest you make the EEP for a new io_lib floating point print > format. The problem here is to find a good letter since ~e, ~f > and ~g are already used. Perhaps it can be done through some > unused precision specifier... Changing an existing feature can always > cause all kinds of unexpected problems. Then suggest that the shell > should use the new format. > > These sound like nice backwards compatible changes that have a > good chance of being accepted. > > > > On Mon, Dec 10, 2007 at 01:40:26PM -0800, Bob Ippolito wrote: > > If we submit a patch to io_lib_format:fwrite_g/1 to use an accurate > > floating point decimal representation, would it be accepted? If not, > > is there a less intrusive way that we could override this? > > > > I find it VERY annoying to have the shell print "~.5g", since that > > often doesn't have enough precision to see what I need to see in the > > floats we work with. I also generally prefer to see "0.1" instead of > > "0.10000". > > > > We have a suitable implementation here, which is the same algorithm > > that several other programming languages use and there's a paper that > > proves its correctness: > > http://mochiweb.googlecode.com/svn/trunk/src/mochinum.erl > > > > It could probably be made a little faster if necessary by using a > > pre-calculated set of results for int_pow that covers the range that > > the algorithm needs, e.g.: > > > > int_pow(10, 0) -> 1; > > int_pow(10, 1) -> 10; > > ... > > int_pow(10, 324) -> ... > > > > -bob > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > From bjorn@REDACTED Tue Dec 11 10:10:48 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 11 Dec 2007 10:10:48 +0100 Subject: [erlang-questions] pre-EEP: accurate float printing (replacement for io_lib_format:fwrite_g/1) In-Reply-To: <6a36e7290712110043j696da319n91ed647b310538a4@mail.gmail.com> References: <6a36e7290712101340n610c9f1cud828da66c9929bad@mail.gmail.com> <20071211080906.GA14875@erix.ericsson.se> <6a36e7290712110043j696da319n91ed647b310538a4@mail.gmail.com> Message-ID: "Bob Ippolito" writes: > ~g with no precision specification (io_lib_format:fwrite_g/1) is a > perfect target and it hits every use the shell has, ~f and ~e I don't > care about. Having yet another float format would be completely stupid > and confusing to anyone that doesn't know the back story for why > supposed backward compatibility required the need for another format. > Other languages have undergone this type of change with no ill effects > that I've heard of (e.g. TCL did this in 2003 [1]). I agree. If there are no compatibility problems *in practice*, we should simply make the change. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Tue Dec 11 10:47:13 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 11 Dec 2007 10:47:13 +0100 Subject: [erlang-questions] : documentation of data structures In-Reply-To: <475E42BD.6050203@fiit.stuba.sk> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <475DD7AB.6080500@lionet.info> <475E42BD.6050203@fiit.stuba.sk> Message-ID: <20071211094713.GB14875@erix.ericsson.se> On Tue, Dec 11, 2007 at 08:56:45AM +0100, Matej Kosik wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Lev Walkin wrote: > > Matej Kosik wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- > >> Hash: SHA1 > >> > >> Andras Georgy Bekes wrote: > >> > >> (snip) > >> > >>> -queue: The doc doesn't say anything about the implementation, only: > >>> "implements FIFO queues in an efficient manner". > >>> It states that "all operations has an amortised O(1) running time", > >>> except for some, that are "probably O(n)". This is rather vague. Sorry about that :-( I will try to improve it if I get the time... > >>> > >> > >> Check the implementation. You will reveal that the operations for > >> adding/removing elements from/to > >> the head/tail can have O(1) complexity in some cases but in some cases > >> they will have O(n) complexity. > >> Adding and removing elements from head or tail is as concluded above that is amortized O(1). queue:len/1 is O(n), queue:reverse/1 is O(1), queue:join(Q1, Q2) should be O(len(Q1)) by reading the code and queue:split/2 should be O(n) by reading the code. Note that these time complexity estimates do not account for garbage collection effects. Hopefully they are the same O() so that e.g adding an element in the worst case is O(n) since it has to reverse one list in one pass creating O(n) new list cells, but also creating O(n) garbage list cells that later will affect a garbage collection with probably not more than O(n)... > >> It would be particularly attractive, if someone implemented `queue' > >> (with the same signature and > >> semantics of operations) where those operations would have always O(1) > >> complexity. That is, as I > >> believe, impossible. Of course, queues can be implemented more > >> efficiently, but in a different > >> (non-functional-like) way. > > > > > > Okasaki shows a way to have a queue with O(1) worst-case complexity. > > However the constant factor is rather large. The queue ADT has O(1) > > amortized complexity. In addition to that, it has a rather small > > constant factor, so it'll be faster overall. > > The erlang module 'queue' originates from an Okasaki queue implementation that is small, neat, amortized O(1) with low overhead. If he (Okasaki) has shown an O(1) worst-case that must be another creature. > > In non-functional programming languages (also in Erlang) similar data-structure can be implemented > with usual O(1) complexity without ``rather large'' constant factor. A different way of doing > similar thing but it has different properties. > - - it is more efficient > - - it is outside functional programming paradigm > (no referential transparency, side effects etc.) > Such implementation can be done in Erlang too. > > I am not sure whether I understand why the above approach was not taken in Erlang. If mutable queues > would be local to some process, no problems would arise. However, if one process wanted to pass a > queue to another process, then if they tried to use them concurrently, interference could occur. > With the original implementation, such interference is excluded. The penalty is that > - - it is not the most efficient possible implementation > - - equational reasoning cannot be applied > (other, more complicated, proof-techniques are necessary) > A typical tradeoff. > > However, if a queue would not be shared among processes than its mutable version would OK. Whouldn't it? Even a mutable queue will have to appear non-mutable to different function invocations in the same process. To make a non-functional data type in Erlang would have to mean making a new data type in the emulator. But every data type in Erlang must act functional to the programmer, or be a new functional language construct that the compiler hides all non-functional properties from the programmer There has for example been an attemt to make an array-like data type called vector, wich would be destructive internally but have an exception list to look functional from the outside. It did not leave the prototype state due to efficiency problems (and complexity d.o). Something called "write barrier" was missing in the garbage collector to make it a bit better but not much... However, writing a queue from the primitive functional types (lists and tuples) in the language is much simpler. And that is what the module 'queue' is. > - -- > Matej Kosik > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHXkK8L+CaXfJI/hgRAm42AJ41SmlQGrDmSnTE65g9gzeEiWzIfACgzreG > 8SEpocgxu2NJHcZm5mQb7H8= > =cfBQ > -----END PGP SIGNATURE----- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From adam@REDACTED Tue Dec 11 09:49:42 2007 From: adam@REDACTED (Adam Lindberg) Date: Tue, 11 Dec 2007 09:49:42 +0100 Subject: [erlang-questions] Dryad or MapReduce in Erlang? In-Reply-To: <91a2ba3e0712101453l36120fdat4ff91dc748a90d42@mail.gmail.com> References: <91a2ba3e0712101453l36120fdat4ff91dc748a90d42@mail.gmail.com> Message-ID: <6344005f0712110049u28c03675ja3f379fc21055207@mail.gmail.com> Well, the algorithm itself (MapReduce) cannot choose servers dynamically, it is coded somewhere in the framework what server are available, which servers are down at the moment and which are busy. So I would say that even MapReduce (don't know about Dryad) needs to know these things. Of course you can probably just hand it a list of servers and it gets going, but it would be the same for any Erlang application implemented in the same way. Cannot point you to any dynamic load distribution applications in Erlang at the moment, sorry. Should be some out there... There is a implementation of the lists module (containing functions like map and foldl [reduce]) that is paralell on a local Erlang node (i.e. multi core processors), plists: http://code.google.com/p/plists/ Shouldn't be so much work to implement distributed, over several nodes. Cheers! Adam On Dec 10, 2007 11:53 PM, Raoul Duke wrote: > (haven't managed to find this talked about yet, sorry if this is old > material.) One interesting thing about Map Reduce and Dryad is that, I > think, they can dynamically choose how many machines and processes are > involved in servicing the high-level plan. Are there things in the > Erlang world with similar abilities of abstraction? So far I've been > under the impression that most Erlang applications know ahead of time > the intended distribution of things. > > thanks for any edification, > -An ever Erlang newbie. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela@REDACTED Tue Dec 11 11:05:37 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Tue, 11 Dec 2007 11:05:37 +0100 Subject: [erlang-questions] Erlang HTTP client is not so fault tollerant... In-Reply-To: References: Message-ID: <475E60F1.9010608@erix.ericsson.se> > > Therefore, I'd like to replace the first line of the incoming server > > response from "HTTP/1.1 301\r\n" to "HTTP/1.1 301 Moved > > Permanently\r\n", but I can't seem to find where the appropriate to do > > so would be... > > > > Personably I've found the HTTP client in OTP unusable and I'd > never put it in a production environment unless the set of URLs to > GET was finite and all GETs were tested. Once upon a time I would have agreed with you, but things change and I think that unusable is an unfair assessment. The above is not valid HTTP and yes there are some standard deviations that you alas want to support as a client, we have got the relaxed mode for this and the above will be a candidate for that. > It hangs on bad input instead of returning an error last > time I tried it. And when was last time you tried it? To take for instance this particular case it did not hang it returned and error. There was also a process implemented as a gen_server and part of a supervision tree that died due to the error and hence this was reported in the shell. But there was no harm done due to this, it is expected that this process shall terminate, and that is exactly why I think it would be a good idea to use try-catch here so that this process can be terminated normally, so that we do not get a supervision report that people can misunderstand. > ibrowse in jungerl works much better. I don't think there are any > easy ways to get to ibrowse short of checking out the jungerl > tree and ripping it out though. Now this is comparing apples to pears. Sure they are both HTTP-clients but the they have really different approaches. ibrowes is really basic leaving very much up to the user. A minimalistic approach, at least last time I checked, which I admit was some time ago. The inets client has the concept of sessions and profiles, more cookie support, automatically retries pipelines when a previous request fails, supports ipv6, streams result to a file or a process with active-once flow control, supports soft code upgrade etc. Now please I do not want to start a war, I am sure there are users that will find ibrowse is just what fits there needs and other that will think the inets client is just what they want. I think the best is to try for yourself and make up your own mind with consideration for your own needs. Could we please just leave it at that. Reagards Ingela - OTP team From thomasl_erlang@REDACTED Tue Dec 11 10:33:45 2007 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 11 Dec 2007 01:33:45 -0800 (PST) Subject: [erlang-questions] beginner: other array implementations In-Reply-To: <31c6fe8f0712061228s2afc6f70ne021e199f02a849b@mail.gmail.com> Message-ID: <22028.18530.qm@web38810.mail.mud.yahoo.com> --- Jonathan Amsterdam wrote: > 2. A functional array with an imperative > implementation, the simplest > of which uses the "shallow binding" or "trailers" > technique FWIW, we actually implemented a simple version of that in Hipe in the old days (or rather, a version based on a similar technique for Prolog, developed earlier at Uppsala). This worked okay for simple copying GC, but with generational GC, you need to record pointers from the old generation to the new, which that gen GC didn't have (and still doesn't). So at that point, the update operation was crippled and Hipe switched to more conventional data structures. (The gen GC was introduced after my time, though, so I only heard this second-hand.) My experience with functional arrays was mixed even before the gen GC issue. The canonical bad example was if you preinitialize an array before a loop, then use the preinitialized version in each iteration (typically to save some init work). After the first iteration, your 'clean' array will have exception chains, and these will steadily accumulate with each iteration. Thus, if you keep the original data structure around, you may end up dragging around a lot of exception chains with disappointing results (both wrt access times and, importantly, leaking memory). Note that the gotcha was in keeping the old version around; the data structure is optimized for using the latest version. Basically, you ended up watching out for these sort of bad cases and coding around them, which was undesirable. So to get it right, you probably need a much smarter GC and/or runtime, capable of detecting and cleaning up these data structures, which is non-trivial in the GC (because you don't know beforehand which versions are live). In my judgement, because of these problems it's not ready for general use yet, but a careful revisit by, say, a good student to clean up and solve these issues somehow might well be worth doing. (Or move on to something more suitable.) Best, Thomas ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From andreas.hillqvist@REDACTED Tue Dec 11 11:34:23 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Tue, 11 Dec 2007 11:34:23 +0100 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: <3dbc6d1c0712101451o593d371dh3bf7d6eba170c09c@mail.gmail.com> References: <475D13F2.6040908@elte.hu> <475D25B8.2080901@it.uu.se> <8268eea30712100447n76cc316ew30d767cc6f228d70@mail.gmail.com> <8268eea30712100713l6045c448r40f21ddb044c0844@mail.gmail.com> <3dbc6d1c0712101451o593d371dh3bf7d6eba170c09c@mail.gmail.com> Message-ID: <8268eea30712110234g6a4d84d3l77fb24eb24336bb6@mail.gmail.com> Would it be useful to be able to be able to explicitly create a fun of an exported function, EXPORT_EXT (113) . It is an clean way of sending a reference to a exported function. I do not know ho efficent it is to call compared with an: apply(Module, Function, [Args1, ... ArgsN]). or a: Module:Function(Args1, ... ArgsN). I guess that my previous hack is a no, no. But I guess it would be simple for the OTP team to add a "real" make_fun(Module, Function, Arity) function that creates an EXPORT_EXT (113) to a module i.e. the erlang module. Then there is no syntax change as it would be for: F = fun Module:Function/Arity. Regards Andreas Hillqvist 2007/12/10, Robert Virding : > On 10/12/2007, Andreas Hillqvist wrote: > > > > make_fun(Module, Function, Arity) -> > > fun Module:Function/Arity. > > You can actually do it today: > > make_fun(M, F, 0) -> fun () -> M:F() end; > make_fun(M, F, 1) -> fun (A1) -> M:F(A1) end; > make_fun(M, F, 2) -> fun (A1, A2) -> M:F(A1, A2) end; > ... > > Not beautiful but it works. The only limitation is that you can only reach > exported functions. Which is as it should be. > > Robert > > > From vlm@REDACTED Tue Dec 11 11:35:23 2007 From: vlm@REDACTED (Lev Walkin) Date: Tue, 11 Dec 2007 02:35:23 -0800 Subject: [erlang-questions] documentation of data structures In-Reply-To: <475E42BD.6050203@fiit.stuba.sk> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <475DD7AB.6080500@lionet.info> <475E42BD.6050203@fiit.stuba.sk> Message-ID: <475E67EB.4000104@lionet.info> Matej Kosik wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Lev Walkin wrote: >> Matej Kosik wrote: >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> Andras Georgy Bekes wrote: >>> >>> (snip) >>> >>>> -queue: The doc doesn't say anything about the implementation, only: >>>> "implements FIFO queues in an efficient manner". >>>> It states that "all operations has an amortised O(1) running time", >>>> except for some, that are "probably O(n)". This is rather vague. >>>> >>> Check the implementation. You will reveal that the operations for >>> adding/removing elements from/to >>> the head/tail can have O(1) complexity in some cases but in some cases >>> they will have O(n) complexity. >>> >>> It would be particularly attractive, if someone implemented `queue' >>> (with the same signature and >>> semantics of operations) where those operations would have always O(1) >>> complexity. That is, as I >>> believe, impossible. Of course, queues can be implemented more >>> efficiently, but in a different >>> (non-functional-like) way. >> >> Okasaki shows a way to have a queue with O(1) worst-case complexity. >> However the constant factor is rather large. The queue ADT has O(1) >> amortized complexity. In addition to that, it has a rather small >> constant factor, so it'll be faster overall. >> > > In non-functional programming languages (also in Erlang) similar data-structure can be implemented > with usual O(1) complexity without ``rather large'' constant factor. A different way of doing > similar thing but it has different properties. > - - it is more efficient > - - it is outside functional programming paradigm > (no referential transparency, side effects etc.) > Such implementation can be done in Erlang too. > > I am not sure whether I understand why the above approach was not taken in Erlang. If mutable queues > would be local to some process, no problems would arise. However, if one process wanted to pass a > queue to another process, then if they tried to use them concurrently, interference could occur. > With the original implementation, such interference is excluded. The penalty is that > - - it is not the most efficient possible implementation > - - equational reasoning cannot be applied > (other, more complicated, proof-techniques are necessary) > A typical tradeoff. > > However, if a queue would not be shared among processes than its mutable version would OK. Whouldn't it? There's also a problem of persistence, even within a single process. A queue might have different "logical histories" within a single process which would imply quite a lot of copying if implemented as a mutable data structure, or prohibit versioning at all. Think of versioned ets. The present queue implementation does not deal with that as well, though. However, the problem with mutable/BIF approach is that it must be implemented as a "hidden" data structure, akin to ets, with lots of copying to and from the "imperative" data storage. This might actually costs a larger CPU overhead than just using the present erlang native O(1) amortized queues, especially if queues are to store large deep tuples. As it is right now, the cost of extracting a tuple from the queue is an [amortized] constant not dependent on the size of the item in the queue. Accounting for that copying, there's always a data set which is going to be faster with the present implementation of queues. Given that, you never know what is faster on your data until you try. At least present implementation of queues is correct. -- Lev Walkin vlm@REDACTED From chandrashekhar.mullaparthi@REDACTED Tue Dec 11 11:44:01 2007 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Tue, 11 Dec 2007 10:44:01 +0000 Subject: [erlang-questions] Erlang HTTP client is not so fault tollerant... In-Reply-To: <475E60F1.9010608@erix.ericsson.se> References: <475E60F1.9010608@erix.ericsson.se> Message-ID: On 11/12/2007, Ingela Anderton Andin wrote: > > Now this is comparing apples to pears. Sure they are both HTTP-clients but the > they have really different approaches. ibrowes is really basic leaving > very much up to the user. A minimalistic approach, at least last time I checked, which > I admit was some time ago. The inets client has the concept of sessions and profiles, > more cookie support, automatically retries pipelines when a previous request fails, supports ipv6, > streams result to a file or a process with active-once flow control, supports soft code upgrade etc. Just to clarify things, ibrowse also supports * Profiles per destination webserver * Save to file or stream to process Can't really compare quality as I have never used the new-and-improved in built HTTP client. cheers Chandru From vlm@REDACTED Tue Dec 11 11:49:31 2007 From: vlm@REDACTED (Lev Walkin) Date: Tue, 11 Dec 2007 02:49:31 -0800 Subject: [erlang-questions] : documentation of data structures In-Reply-To: <20071211094713.GB14875@erix.ericsson.se> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <475DD7AB.6080500@lionet.info> <475E42BD.6050203@fiit.stuba.sk> <20071211094713.GB14875@erix.ericsson.se> Message-ID: <475E6B3B.4060809@lionet.info> Raimo Niskanen wrote: >>>> Check the implementation. You will reveal that the operations for >>>> adding/removing elements from/to >>>> the head/tail can have O(1) complexity in some cases but in some cases >>>> they will have O(n) complexity. >>>> > > Adding and removing elements from head or tail is as concluded above > that is amortized O(1). queue:len/1 is O(n), queue:reverse/1 is O(1), > queue:join(Q1, Q2) should be O(len(Q1)) by reading the code > and queue:split/2 should be O(n) by reading the code. Actually, it'd be neat if queue:len/1 were O(1), since it is just a simple matter of another element in the tuple. >>> Okasaki shows a way to have a queue with O(1) worst-case complexity. >>> However the constant factor is rather large. The queue ADT has O(1) >>> amortized complexity. In addition to that, it has a rather small >>> constant factor, so it'll be faster overall. >>> > > The erlang module 'queue' originates from an Okasaki queue implementation > that is small, neat, amortized O(1) with low overhead. If he (Okasaki) > has shown an O(1) worst-case that must be another creature. The current implementation in `queue` is O(1) amortized non-persistent and described in Okasaki [1] Chapter 5.2. There's another one, which is O(1) amortized persistent (Ibid Chapter 6.3.2, 6.4.2), and yet another one, O(1) worst-case persistent (Ibid. Chapter 7.2, "Real-Time Queues", also 8.4.2 for real-time deque). I was referring to the latter. [1] Chris Okasaki. Purely Functional Data Structures. -- Lev Walkin vlm@REDACTED From chandrashekhar.mullaparthi@REDACTED Tue Dec 11 11:40:58 2007 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Tue, 11 Dec 2007 10:40:58 +0000 Subject: [erlang-questions] Erlang HTTP client is not so fault tollerant... In-Reply-To: <475DC4BA.1040407@hyber.org> References: <475DC4BA.1040407@hyber.org> Message-ID: On 10/12/2007, Claes Wikstr?m wrote: > ibrowse in jungerl works much better. I don't think there are any > easy ways to get to ibrowse short of checking out the jungerl > tree and ripping it out though. > You can install it using CEAN. If you want just the application, it is available here http://forum.trapexit.org/download.php?id=123 cheers Chandru From bjorn@REDACTED Tue Dec 11 12:11:35 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 11 Dec 2007 12:11:35 +0100 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: <8268eea30712110234g6a4d84d3l77fb24eb24336bb6@mail.gmail.com> References: <475D13F2.6040908@elte.hu> <475D25B8.2080901@it.uu.se> <8268eea30712100447n76cc316ew30d767cc6f228d70@mail.gmail.com> <8268eea30712100713l6045c448r40f21ddb044c0844@mail.gmail.com> <3dbc6d1c0712101451o593d371dh3bf7d6eba170c09c@mail.gmail.com> <8268eea30712110234g6a4d84d3l77fb24eb24336bb6@mail.gmail.com> Message-ID: "Andreas Hillqvist" writes: > But I guess it would be simple for the OTP team to add a "real" > make_fun(Module, Function, Arity) function that creates an EXPORT_EXT > (113) to a module i.e. the erlang module. There already is an erlang:make_fun/3 BIF. Not documented, though. 1> erlang:make_fun(c, i, 0). #Fun 2> /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Tue Dec 11 12:14:45 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 11 Dec 2007 12:14:45 +0100 Subject: [erlang-questions] : : documentation of data structures In-Reply-To: <475E6B3B.4060809@lionet.info> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <475DD7AB.6080500@lionet.info> <475E42BD.6050203@fiit.stuba.sk> <20071211094713.GB14875@erix.ericsson.se> <475E6B3B.4060809@lionet.info> Message-ID: <20071211111445.GD14875@erix.ericsson.se> On Tue, Dec 11, 2007 at 02:49:31AM -0800, Lev Walkin wrote: > Raimo Niskanen wrote: > > >>>> Check the implementation. You will reveal that the operations for > >>>> adding/removing elements from/to > >>>> the head/tail can have O(1) complexity in some cases but in some cases > >>>> they will have O(n) complexity. > >>>> > > > > Adding and removing elements from head or tail is as concluded above > > that is amortized O(1). queue:len/1 is O(n), queue:reverse/1 is O(1), > > queue:join(Q1, Q2) should be O(len(Q1)) by reading the code > > and queue:split/2 should be O(n) by reading the code. > > Actually, it'd be neat if queue:len/1 were O(1), since it is just > a simple matter of another element in the tuple. I did not dare to make that change sometime back in R11 or earlier, because of the backwards compatibility ghost, again. If I have a new node and an old node communicating by sending a message containing a queue I can make the new node understand an old queue (2-tuple), but not make the old node understand a new queue (3-tuple). This assuming that no other has code that assumes queues are 2-tuples. I should have (then, way back) made a change so queues could be 3-tuples ignoring the 3rd field. Then I now could make the change to start using it. *sigh* Then again nodes sending queues is probably far-fetched anyway, but who am I to know... > > >>> Okasaki shows a way to have a queue with O(1) worst-case complexity. > >>> However the constant factor is rather large. The queue ADT has O(1) > >>> amortized complexity. In addition to that, it has a rather small > >>> constant factor, so it'll be faster overall. > >>> > > > > The erlang module 'queue' originates from an Okasaki queue implementation > > that is small, neat, amortized O(1) with low overhead. If he (Okasaki) > > has shown an O(1) worst-case that must be another creature. > > The current implementation in `queue` is O(1) amortized non-persistent > and described in Okasaki [1] Chapter 5.2. There's another one, which > is O(1) amortized persistent (Ibid Chapter 6.3.2, 6.4.2), and yet > another one, O(1) worst-case persistent (Ibid. Chapter 7.2, > "Real-Time Queues", also 8.4.2 for real-time deque). > > I was referring to the latter. > > [1] Chris Okasaki. Purely Functional Data Structures. > Ooo, I really should get that book... > -- > Lev Walkin > vlm@REDACTED > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From joelr1@REDACTED Tue Dec 11 12:27:30 2007 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 11 Dec 2007 11:27:30 +0000 Subject: [erlang-questions] How long for the FFI EEP to go through? Message-ID: <62F3426C-094F-4A61-9E15-496B7AC3E069@gmail.com> Is there an estimate for when the FFI EEP will be part of the Erlang distribution? Thanks, Joel -- http://wagerlabs.com From joelr1@REDACTED Tue Dec 11 12:34:02 2007 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 11 Dec 2007 11:34:02 +0000 Subject: [erlang-questions] What FFI to use for new code Message-ID: I'm struggling to write the "C interface" chapter of my book. I would like to write the Mac Cocoa bridge since it would cover XML processing and maybe even a GUI chapter as well. I specifically want to write a linked-in driver. The main reason why I'm struggling is that I find the current linked- in driver interface ... umm... very difficult to deal with. I don't find the Erlang Driver Toolkit (EDTK) [1] or even Dryverl [2] to be a great alternative. Would it be reasonable to use the EEP for the Erlang FFI given that the book won't come out for a few months? Thanks, Joel [1] http://www.snookles.com/erlang/edtk/ [2] http://dryverl.objectweb.org/ -- http://wagerlabs.com From kosik@REDACTED Tue Dec 11 12:48:41 2007 From: kosik@REDACTED (Matej Kosik) Date: Tue, 11 Dec 2007 12:48:41 +0100 Subject: [erlang-questions] documentation of data structures In-Reply-To: <475E67EB.4000104@lionet.info> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <475DD7AB.6080500@lionet.info> <475E42BD.6050203@fiit.stuba.sk> <475E67EB.4000104@lionet.info> Message-ID: <475E7919.7050109@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Lev Walkin wrote: > Matej Kosik wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Lev Walkin wrote: >>> Matej Kosik wrote: >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> Andras Georgy Bekes wrote: >>>> >>>> (snip) >>>> >>>>> -queue: The doc doesn't say anything about the implementation, only: >>>>> "implements FIFO queues in an efficient manner". >>>>> It states that "all operations has an amortised O(1) running time", >>>>> except for some, that are "probably O(n)". This is rather vague. >>>>> >>>> Check the implementation. You will reveal that the operations for >>>> adding/removing elements from/to >>>> the head/tail can have O(1) complexity in some cases but in some cases >>>> they will have O(n) complexity. >>>> >>>> It would be particularly attractive, if someone implemented `queue' >>>> (with the same signature and >>>> semantics of operations) where those operations would have always O(1) >>>> complexity. That is, as I >>>> believe, impossible. Of course, queues can be implemented more >>>> efficiently, but in a different >>>> (non-functional-like) way. >>> >>> Okasaki shows a way to have a queue with O(1) worst-case complexity. >>> However the constant factor is rather large. The queue ADT has O(1) >>> amortized complexity. In addition to that, it has a rather small >>> constant factor, so it'll be faster overall. >>> >> >> In non-functional programming languages (also in Erlang) similar >> data-structure can be implemented >> with usual O(1) complexity without ``rather large'' constant factor. A >> different way of doing >> similar thing but it has different properties. >> - - it is more efficient >> - - it is outside functional programming paradigm >> (no referential transparency, side effects etc.) >> Such implementation can be done in Erlang too. >> >> I am not sure whether I understand why the above approach was not >> taken in Erlang. If mutable queues >> would be local to some process, no problems would arise. However, if >> one process wanted to pass a >> queue to another process, then if they tried to use them concurrently, >> interference could occur. >> With the original implementation, such interference is excluded. The >> penalty is that >> - - it is not the most efficient possible implementation >> - - equational reasoning cannot be applied >> (other, more complicated, proof-techniques are necessary) >> A typical tradeoff. >> >> However, if a queue would not be shared among processes than its >> mutable version would OK. Whouldn't it? > > > There's also a problem of persistence, even within a single process. A > queue might have different "logical histories" I am not sure what you mean and thus I cannot assess how useful such thing is. > within a single process > which would imply quite a lot of copying if implemented as a mutable > data structure, or prohibit versioning at all. Think of versioned ets. > The present queue implementation does not deal with that as well, > though. > > > However, the problem with mutable/BIF approach What do you mean by BIF approach? Mutable queues can be implemented via already existing Erlang constructs (spawn, send, receive etc). No new primitive data-types or new primitive operations are needed to implement such queues whose operations for adding elements to head and tail have always O(1) complexity. The first step would be implementing a new data type: `cell' with operations such as - - cell:empty/0 (create an empty cell) - - cell:make/1 (create a cell with a given contents) - - cell:get/1 (non-destructively get the contents of a cell. Block (or throw an error or some predefined value if it is empty) - - cell:put/2 (destructively overwrite a cell with a given value) Basically, cell can be represented as a process that responds to proper messages. There can be wrapper procedures - - cell:/isEmpty/1 returns true if a given cell is empty If you have cells, you can implement `queue item' as a triple composed from: - - a cell containing a reference to the previous `queue item' - - a cell containing a reference to the value of the current `queue item' - - a cell containing a reference to the next `queue item'. If you have that, you can represent the whole queue as a couple composed from: - - a cell containing a reference to the head - - a cell containing a reference to the tail I did not implemented it in Erlang (because in Erlang I did not needed queues) but in a different language that had those immutable queues I droped them and reimplemented the queues as described above. I think this is reasonable approach if one do not need share queues among processes. If Erlang is implemented properly, this would be efficient despite the fact that there are many processes. Real measurements would either support or reject such hypothesis. > is that it must be > implemented as a "hidden" data structure, akin to ets, with lots of > copying to and from the "imperative" data storage. This might > actually costs a larger CPU overhead than just using the present > erlang native O(1) amortized queues, especially if queues are to > store large deep tuples. As it is right now, the cost of extracting > a tuple from the queue is an [amortized] constant not dependent > on the size of the item in the queue. Accounting for that copying, > there's always a data set which is going to be faster with the > present implementation of queues. > > Given that, you never know what is faster on your data until you try. > At least present implementation of queues is correct. > Regards - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXnkYL+CaXfJI/hgRAsemAJ91squuD5cHBGrFcu07fl521Xu4lgCgy77g W6U8KnjrHU723tqFBx4YXkY= =ftFi -----END PGP SIGNATURE----- From tonyg@REDACTED Tue Dec 11 13:13:24 2007 From: tonyg@REDACTED (Tony Garnock-Jones) Date: Tue, 11 Dec 2007 12:13:24 +0000 Subject: [erlang-questions] Erlang HTTP client is not so fault tollerant... In-Reply-To: <475E60F1.9010608@erix.ericsson.se> References: <475E60F1.9010608@erix.ericsson.se> Message-ID: <475E7EE4.2090900@lshift.net> Ingela Anderton Andin wrote: > [built-in http vs ibrowse] I found the built-in http client had problems (as of R10B) when interacting with various versions of IIS. I can't remember now if it was the client's or the server's fault, but I do remember wanting to be able to work around the problem by forcing the client to use HTTP v1.0 instead of v1.1. I think the hard-coded HTTP version number in the built-in client was the only reason I switched to ibrowse. Regards, Tony -- [][][] Tony Garnock-Jones | Mob: +44 (0)7905 974 211 [][] LShift Ltd | Tel: +44 (0)20 7729 7060 [] [] http://www.lshift.net/ | Email: tonyg@REDACTED From kenneth.lundin@REDACTED Tue Dec 11 13:33:14 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Tue, 11 Dec 2007 13:33:14 +0100 Subject: [erlang-questions] How long for the FFI EEP to go through? In-Reply-To: <62F3426C-094F-4A61-9E15-496B7AC3E069@gmail.com> References: <62F3426C-094F-4A61-9E15-496B7AC3E069@gmail.com> Message-ID: On 12/11/07, Joel Reymont wrote: > Is there an estimate for when the FFI EEP will be part of the Erlang > distribution? > No, there is no estimate. We will take a serious detailed look at the EEP , probably quite soon but I cannot make any promise on how soon it will make it into the ordinary release. We think it is important to have an easier way to interface external libraries but there are a number of problems to solve before it can be introduced as a supported feature. We have lived with more or less the same driver interface towards external C-code in more than 10 years now so I don't think we have to rush into this. Actually one of the advantages with Erlang is that you can make robust systems. One of the major reasons for the robustness is that there are no or very few linked in drivers written by the application developers. There are several products which don't have any linkedin drivers at all except those included in the standard distribution This makes it very easy for us as maintainers since when we get a core dump we know that the fault is in our code. So the "awkward" interface for linkedin drivers can actually be seen as a stabilizing factor since only those that really knows what they are doing will manage to implement a working driver. But as said we are very interested in improving the FFI it has been in our plans long before this EEP but now I think the time has come to prioritize this. Some things to be aware of : When an Erlang process executes a FFI call which takes a long time before it returns all other Erlang processes will also be blocked until that call returns (in a non SMP system). In an SMP system there are many schedulers so the call will only block one of the schedulers. But if several Erlang processes makes lenghty or blocking FFI calls you can block the whole Erlang VM. This type of problems does not occur in languages where there are no concurrency. Many C-API's have callback functions. It would be nice if that could be handled as well but i am not sure if we can find a generic solution for that. I am sure there will be memory allocation issues as well, for example cleaning up when an Erlang process dies. /Kenneth Erlang/OTP team , Ericsson AB From vlm@REDACTED Tue Dec 11 13:35:38 2007 From: vlm@REDACTED (Lev Walkin) Date: Tue, 11 Dec 2007 04:35:38 -0800 Subject: [erlang-questions] documentation of data structures In-Reply-To: <475E7919.7050109@fiit.stuba.sk> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <475DD7AB.6080500@lionet.info> <475E42BD.6050203@fiit.stuba.sk> <475E67EB.4000104@lionet.info> <475E7919.7050109@fiit.stuba.sk> Message-ID: <475E841A.6080508@lionet.info> Matej Kosik wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Lev Walkin wrote: >> Matej Kosik wrote: >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> Lev Walkin wrote: >>>> Matej Kosik wrote: >>>>> -----BEGIN PGP SIGNED MESSAGE----- >>>>> Hash: SHA1 >>>>> >>>>> Andras Georgy Bekes wrote: >>>>> >>>>> (snip) >>>>> >>>>>> -queue: The doc doesn't say anything about the implementation, only: >>>>>> "implements FIFO queues in an efficient manner". >>>>>> It states that "all operations has an amortised O(1) running time", >>>>>> except for some, that are "probably O(n)". This is rather vague. >>>>>> >>>>> Check the implementation. You will reveal that the operations for >>>>> adding/removing elements from/to >>>>> the head/tail can have O(1) complexity in some cases but in some cases >>>>> they will have O(n) complexity. >>>>> >>>>> It would be particularly attractive, if someone implemented `queue' >>>>> (with the same signature and >>>>> semantics of operations) where those operations would have always O(1) >>>>> complexity. That is, as I >>>>> believe, impossible. Of course, queues can be implemented more >>>>> efficiently, but in a different >>>>> (non-functional-like) way. >>>> Okasaki shows a way to have a queue with O(1) worst-case complexity. >>>> However the constant factor is rather large. The queue ADT has O(1) >>>> amortized complexity. In addition to that, it has a rather small >>>> constant factor, so it'll be faster overall. >>>> >>> In non-functional programming languages (also in Erlang) similar >>> data-structure can be implemented >>> with usual O(1) complexity without ``rather large'' constant factor. A >>> different way of doing >>> similar thing but it has different properties. >>> - - it is more efficient >>> - - it is outside functional programming paradigm >>> (no referential transparency, side effects etc.) >>> Such implementation can be done in Erlang too. >>> >>> I am not sure whether I understand why the above approach was not >>> taken in Erlang. If mutable queues >>> would be local to some process, no problems would arise. However, if >>> one process wanted to pass a >>> queue to another process, then if they tried to use them concurrently, >>> interference could occur. >>> With the original implementation, such interference is excluded. The >>> penalty is that >>> - - it is not the most efficient possible implementation >>> - - equational reasoning cannot be applied >>> (other, more complicated, proof-techniques are necessary) >>> A typical tradeoff. >>> >>> However, if a queue would not be shared among processes than its >>> mutable version would OK. Whouldn't it? >> >> There's also a problem of persistence, even within a single process. A >> queue might have different "logical histories" > > I am not sure what you mean and thus I cannot assess how useful such thing is. > >> within a single process >> which would imply quite a lot of copying if implemented as a mutable >> data structure, or prohibit versioning at all. Think of versioned ets. >> The present queue implementation does not deal with that as well, >> though. >> >> >> However, the problem with mutable/BIF approach > > What do you mean by BIF approach? > > Mutable queues can be implemented via already existing Erlang constructs (spawn, send, receive etc). > No new primitive data-types or new primitive operations are needed to implement such queues whose > operations for adding elements to head and tail have always O(1) complexity. > > The first step would be implementing a new data type: `cell' with operations such as > - - cell:empty/0 (create an empty cell) > - - cell:make/1 (create a cell with a given contents) > - - cell:get/1 (non-destructively get the contents of a cell. Block (or throw an error or some > predefined value if it is empty) > - - cell:put/2 (destructively overwrite a cell with a given value) > Basically, cell can be represented as a process that responds to proper messages. There can be > wrapper procedures > - - cell:/isEmpty/1 returns true if a given cell is empty > > If you have cells, you can implement `queue item' as a triple composed from: > - - a cell containing a reference to the previous `queue item' > - - a cell containing a reference to the value of the current `queue item' > - - a cell containing a reference to the next `queue item'. > > If you have that, you can represent the whole queue as a couple composed from: > - - a cell containing a reference to the head > - - a cell containing a reference to the tail > > I did not implemented it in Erlang (because in Erlang I did not needed queues) but in a different > language that had those immutable queues I droped them and reimplemented the queues as described > above. I think this is reasonable approach if one do not need share queues among processes. > > If Erlang is implemented properly, this would be efficient despite the fact that there are many > processes. Real measurements would either support or reject such hypothesis. This design has the same drawback as ets: lots of copying [between processes]. Consequently, a part of my email still applies: >> Accounting for that copying, >> there's always a data set which is going to be faster with the >> present implementation of queues. >> >> Given that, you never know what is faster on your data until you try. >> At least present implementation of queues is correct. >> > > Regards > - -- > Matej Kosik > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHXnkYL+CaXfJI/hgRAsemAJ91squuD5cHBGrFcu07fl521Xu4lgCgy77g > W6U8KnjrHU723tqFBx4YXkY= > =ftFi > -----END PGP SIGNATURE----- From andreas.hillqvist@REDACTED Tue Dec 11 13:39:31 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Tue, 11 Dec 2007 13:39:31 +0100 Subject: [erlang-questions] clarify: variable as function name In-Reply-To: References: <475D13F2.6040908@elte.hu> <475D25B8.2080901@it.uu.se> <8268eea30712100447n76cc316ew30d767cc6f228d70@mail.gmail.com> <8268eea30712100713l6045c448r40f21ddb044c0844@mail.gmail.com> <3dbc6d1c0712101451o593d371dh3bf7d6eba170c09c@mail.gmail.com> <8268eea30712110234g6a4d84d3l77fb24eb24336bb6@mail.gmail.com> Message-ID: <8268eea30712110439q774b9c6bg44f790c605f79f68@mail.gmail.com> Thank you for the information. I feelt like there should be some sort of function for that. ;-) Is it OK to use it, will it made public/documented part of OTP? Maybe in R12-1? ;-) Kind regards Andreas Hillqvist 11 Dec 2007 12:11:35 +0100, Bjorn Gustavsson : > "Andreas Hillqvist" writes: > > > But I guess it would be simple for the OTP team to add a "real" > > make_fun(Module, Function, Arity) function that creates an EXPORT_EXT > > (113) to a module i.e. the erlang module. > > There already is an erlang:make_fun/3 BIF. Not documented, though. > > 1> erlang:make_fun(c, i, 0). > #Fun > 2> > > /Bjorn > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From kosik@REDACTED Tue Dec 11 13:52:07 2007 From: kosik@REDACTED (Matej Kosik) Date: Tue, 11 Dec 2007 13:52:07 +0100 Subject: [erlang-questions] documentation of data structures In-Reply-To: <475E841A.6080508@lionet.info> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <475DD7AB.6080500@lionet.info> <475E42BD.6050203@fiit.stuba.sk> <475E67EB.4000104@lionet.info> <475E7919.7050109@fiit.stuba.sk> <475E841A.6080508@lionet.info> Message-ID: <475E87F7.5000905@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Lev Walkin wrote: > Matej Kosik wrote: > Lev Walkin wrote: >>>> Matej Kosik wrote: >>>>> -----BEGIN PGP SIGNED MESSAGE----- >>>>> Hash: SHA1 >>>>> >>>>> Lev Walkin wrote: >>>>>> Matej Kosik wrote: >>>>>>> -----BEGIN PGP SIGNED MESSAGE----- >>>>>>> Hash: SHA1 >>>>>>> >>>>>>> Andras Georgy Bekes wrote: >>>>>>> >>>>>>> (snip) >>>>>>> >>>>>>>> -queue: The doc doesn't say anything about the implementation, only: >>>>>>>> "implements FIFO queues in an efficient manner". >>>>>>>> It states that "all operations has an amortised O(1) running time", >>>>>>>> except for some, that are "probably O(n)". This is rather vague. >>>>>>>> >>>>>>> Check the implementation. You will reveal that the operations for >>>>>>> adding/removing elements from/to >>>>>>> the head/tail can have O(1) complexity in some cases but in some >>>>>>> cases >>>>>>> they will have O(n) complexity. >>>>>>> >>>>>>> It would be particularly attractive, if someone implemented `queue' >>>>>>> (with the same signature and >>>>>>> semantics of operations) where those operations would have always >>>>>>> O(1) >>>>>>> complexity. That is, as I >>>>>>> believe, impossible. Of course, queues can be implemented more >>>>>>> efficiently, but in a different >>>>>>> (non-functional-like) way. >>>>>> Okasaki shows a way to have a queue with O(1) worst-case complexity. >>>>>> However the constant factor is rather large. The queue ADT has O(1) >>>>>> amortized complexity. In addition to that, it has a rather small >>>>>> constant factor, so it'll be faster overall. >>>>>> >>>>> In non-functional programming languages (also in Erlang) similar >>>>> data-structure can be implemented >>>>> with usual O(1) complexity without ``rather large'' constant factor. A >>>>> different way of doing >>>>> similar thing but it has different properties. >>>>> - - it is more efficient >>>>> - - it is outside functional programming paradigm >>>>> (no referential transparency, side effects etc.) >>>>> Such implementation can be done in Erlang too. >>>>> >>>>> I am not sure whether I understand why the above approach was not >>>>> taken in Erlang. If mutable queues >>>>> would be local to some process, no problems would arise. However, if >>>>> one process wanted to pass a >>>>> queue to another process, then if they tried to use them concurrently, >>>>> interference could occur. >>>>> With the original implementation, such interference is excluded. The >>>>> penalty is that >>>>> - - it is not the most efficient possible implementation >>>>> - - equational reasoning cannot be applied >>>>> (other, more complicated, proof-techniques are necessary) >>>>> A typical tradeoff. >>>>> >>>>> However, if a queue would not be shared among processes than its >>>>> mutable version would OK. Whouldn't it? >>>> >>>> There's also a problem of persistence, even within a single process. A >>>> queue might have different "logical histories" > > I am not sure what you mean and thus I cannot assess how useful such > thing is. > >>>> within a single process >>>> which would imply quite a lot of copying if implemented as a mutable >>>> data structure, or prohibit versioning at all. Think of versioned ets. >>>> The present queue implementation does not deal with that as well, >>>> though. >>>> >>>> >>>> However, the problem with mutable/BIF approach > > What do you mean by BIF approach? > > Mutable queues can be implemented via already existing Erlang > constructs (spawn, send, receive etc). > No new primitive data-types or new primitive operations are needed to > implement such queues whose > operations for adding elements to head and tail have always O(1) > complexity. > > The first step would be implementing a new data type: `cell' with > operations such as > - cell:empty/0 (create an empty cell) > - cell:make/1 (create a cell with a given contents) > - cell:get/1 (non-destructively get the contents of a cell. Block > (or throw an error or some > predefined value if it is empty) > - cell:put/2 (destructively overwrite a cell with a given value) > Basically, cell can be represented as a process that responds to > proper messages. There can be > wrapper procedures > - cell:/isEmpty/1 returns true if a given cell is empty > > If you have cells, you can implement `queue item' as a triple composed > from: > - a cell containing a reference to the previous `queue item' > - a cell containing a reference to the value of the current `queue > item' > - a cell containing a reference to the next `queue item'. > > If you have that, you can represent the whole queue as a couple > composed from: > - a cell containing a reference to the head > - a cell containing a reference to the tail > > I did not implemented it in Erlang (because in Erlang I did not needed > queues) but in a different > language that had those immutable queues I droped them and > reimplemented the queues as described > above. I think this is reasonable approach if one do not need share > queues among processes. > > If Erlang is implemented properly, this would be efficient despite the > fact that there are many > processes. Real measurements would either support or reject such > hypothesis. > >> This design has the same drawback as ets: lots of copying [between >> processes]. Consequently, a part of my email still applies: Are you sure? When (in which kind of operation) would such copying (of what) be needed. Sure, the cost of explicit copying of a queue instance has O(len(N)) complexity. But we were talking about adding/removing elements at the head/tail of the queue. > >>>> Accounting for that copying, >>>> there's always a data set which is going to be faster with the >>>> present implementation of queues. >>>> >>>> Given that, you never know what is faster on your data until you try. >>>> At least present implementation of queues is correct. >>>> > > Regards - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXof3L+CaXfJI/hgRAqOuAKDTT9xwZ6EQDBYct1OOhvwZCjmeMwCfZikI Ch28AO9ZJXz5wXcRIX2IuX0= =vAu7 -----END PGP SIGNATURE----- From kenneth.lundin@REDACTED Tue Dec 11 13:55:01 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Tue, 11 Dec 2007 13:55:01 +0100 Subject: [erlang-questions] What FFI to use for new code In-Reply-To: References: Message-ID: Hi Joel, I think you should base your book on what available and stable NOW. I think there are for sure enough interesting things to write about already even if one always have wishes for more. If you want to describe the mac Cocoa bridge you are developing please base that development on things that actually are part of the Erlang/OTP distribution or well established other open source packages. For example I know that you don't like XMERL but I think you should use it anyway because it is so much easier for people to try things out if they can get everything they need from as few places as possible. We already use XMERL in products so we know that it works. In most cases there are other bottlenecks than the speed of XML-parsing. We will improve XMERL and XML handling in general so when you have the book finished the situation will probably be different from what it is today. I don't think it would be beneficial for the popularity of Erlang if the book contains a multitude of other solutions for functions that already is available in the Erlang/OTP distribution. It would be better if you gave us feedback so that we can improve the current distribution instead. /Kenneth Erlang/OTP team , Ericsson AB On 12/11/07, Joel Reymont wrote: > I'm struggling to write the "C interface" chapter of my book. I would > like to write the Mac Cocoa bridge since it would cover XML processing > and maybe even a GUI chapter as well. I specifically want to write a > linked-in driver. > > The main reason why I'm struggling is that I find the current linked- > in driver interface ... umm... very difficult to deal with. I don't > find the Erlang Driver Toolkit (EDTK) [1] or even Dryverl [2] to be a > great alternative. > > Would it be reasonable to use the EEP for the Erlang FFI given that > the book won't come out for a few months? > > Thanks, Joel > > [1] http://www.snookles.com/erlang/edtk/ > [2] http://dryverl.objectweb.org/ > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bekesa@REDACTED Tue Dec 11 13:44:25 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Tue, 11 Dec 2007 13:44:25 +0100 Subject: [erlang-questions] queues (previously: documentation of data structures) In-Reply-To: <475E7919.7050109@fiit.stuba.sk> References: <200712070917.13979.bekesa@sch.bme.hu> <475E67EB.4000104@lionet.info> <475E7919.7050109@fiit.stuba.sk> Message-ID: <200712111344.25828.bekesa@sch.bme.hu> > The first step would be implementing a new data type: `cell' with operations such as > - - cell:empty/0 (create an empty cell) > - - cell:make/1 (create a cell with a given contents) > - - cell:get/1 (non-destructively get the contents of a cell. Block (or throw an error or some > predefined value if it is empty) > - - cell:put/2 (destructively overwrite a cell with a given value) > Basically, cell can be represented as a process that responds to proper messages. There can be > wrapper procedures > - - cell:/isEmpty/1 returns true if a given cell is empty > > If you have cells, you can implement `queue item' as a triple composed from: > - - a cell containing a reference to the previous `queue item' > - - a cell containing a reference to the value of the current `queue item' > - - a cell containing a reference to the next `queue item'. > > If you have that, you can represent the whole queue as a couple composed from: > - - a cell containing a reference to the head > - - a cell containing a reference to the tail Why having a process for each queue entry??? Ok, you can change a specific element once you've put on the queue, but you probably don't want that. Why not just use the message queue of Erlang? (see attached module --- very simple) Pros: - one process for each queue - same efficiency as the message queues of the VM (hope you're satisfied with that) - works when several processes use a common queue Cons: - copies each queued element twice (just like your solution) - ??? Georgy -------------- next part -------------- -module(myqueue). -export([start/0,init/0,put/2,get/1,delete/1]). start()-> spawn(?MODULE,init,[]). init()-> loop(). loop()-> receive {getnext,PID} -> receive {element, Data} -> PID ! {element,Data}; stop -> ok end; stop-> ok end, loop(). put(Queue,Data)-> Queue ! {element,Data}, ok. get(Queue)-> Queue ! {getnext,self()}, receive {element,Data}-> Data end. delete(Queue)-> Queue ! stop, ok. From vlm@REDACTED Tue Dec 11 13:59:44 2007 From: vlm@REDACTED (Lev Walkin) Date: Tue, 11 Dec 2007 04:59:44 -0800 Subject: [erlang-questions] documentation of data structures In-Reply-To: <475E87F7.5000905@fiit.stuba.sk> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <475DD7AB.6080500@lionet.info> <475E42BD.6050203@fiit.stuba.sk> <475E67EB.4000104@lionet.info> <475E7919.7050109@fiit.stuba.sk> <475E841A.6080508@lionet.info> <475E87F7.5000905@fiit.stuba.sk> Message-ID: <475E89C0.8000302@lionet.info> Matej Kosik wrote: >> If Erlang is implemented properly, this would be efficient despite the >> fact that there are many >> processes. Real measurements would either support or reject such >> hypothesis. >> >>> This design has the same drawback as ets: lots of copying [between >>> processes]. Consequently, a part of my email still applies: > > Are you sure? When (in which kind of operation) would such copying (of what) be needed. > > Sure, the cost of explicit copying of a queue instance has O(len(N)) complexity. But we were talking > about adding/removing elements at the head/tail of the queue. I suspect implementing a queue as a separate process would have larger constant factor than the current queues implementation for data of pretty much any size. With larger elements the cost of copying between processes only increases (unless they contain larger binaries, of course). So I see no point in implementing queues as an external data structure, since there's going to be no performance benefit, or more properly put, they'll have a negative performance impact. -- Lev Walkin vlm@REDACTED From joelr1@REDACTED Tue Dec 11 14:03:01 2007 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 11 Dec 2007 13:03:01 +0000 Subject: [erlang-questions] What FFI to use for new code In-Reply-To: References: Message-ID: <576BB922-74A7-4ABE-81B6-D2979A02DD33@gmail.com> Kenneth, On Dec 11, 2007, at 12:55 PM, Kenneth Lundin wrote: > For example I know that you don't like XMERL but I think you should > use it > anyway because it is so much easier for people to try things out if > they > can get everything they need from as few places as possible. Yes, I will be using XMERL. > I don't think it would be beneficial for the popularity of Erlang if > the book > contains a multitude of other solutions for functions that already > is available > in the Erlang/OTP distribution. My approach is to try to write a fun app for each chapter. If I can't come up with an app then I'll try to dig deep into something we have already, e.g. DETS or Mnesia. I don't have time to reinvent existing wheels. Thanks, Joel -- http://wagerlabs.com From vlm@REDACTED Tue Dec 11 14:18:57 2007 From: vlm@REDACTED (Lev Walkin) Date: Tue, 11 Dec 2007 05:18:57 -0800 Subject: [erlang-questions] queues (previously: documentation of data structures) In-Reply-To: <200712111344.25828.bekesa@sch.bme.hu> References: <200712070917.13979.bekesa@sch.bme.hu> <475E67EB.4000104@lionet.info> <475E7919.7050109@fiit.stuba.sk> <200712111344.25828.bekesa@sch.bme.hu> Message-ID: <475E8E41.5040603@lionet.info> Andras Georgy Bekes wrote: >> The first step would be implementing a new data type: `cell' with operations such as >> - - cell:empty/0 (create an empty cell) >> - - cell:make/1 (create a cell with a given contents) >> - - cell:get/1 (non-destructively get the contents of a cell. Block (or throw an error or some >> predefined value if it is empty) >> - - cell:put/2 (destructively overwrite a cell with a given value) >> Basically, cell can be represented as a process that responds to proper messages. There can be >> wrapper procedures >> - - cell:/isEmpty/1 returns true if a given cell is empty >> >> If you have cells, you can implement `queue item' as a triple composed from: >> - - a cell containing a reference to the previous `queue item' >> - - a cell containing a reference to the value of the current `queue item' >> - - a cell containing a reference to the next `queue item'. >> >> If you have that, you can represent the whole queue as a couple composed from: >> - - a cell containing a reference to the head >> - - a cell containing a reference to the tail > > Why having a process for each queue entry??? > Ok, you can change a specific element once you've put on the > queue, but you probably don't want that. > > Why not just use the message queue of Erlang? > (see attached module --- very simple) > > Pros: > - one process for each queue > - same efficiency as the message queues of the VM > (hope you're satisfied with that) > - works when several processes use a common queue > > Cons: > - copies each queued element twice (just like your solution) > - ??? The killing Con is that one process may keep a megabyte in the queue making this queue performance excruciatingly slow for all other processes due to repeating message queue scans. -- Lev Walkin vlm@REDACTED From kosik@REDACTED Tue Dec 11 14:25:27 2007 From: kosik@REDACTED (Matej Kosik) Date: Tue, 11 Dec 2007 14:25:27 +0100 Subject: [erlang-questions] documentation of data structures In-Reply-To: <475E89C0.8000302@lionet.info> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <475DD7AB.6080500@lionet.info> <475E42BD.6050203@fiit.stuba.sk> <475E67EB.4000104@lionet.info> <475E7919.7050109@fiit.stuba.sk> <475E841A.6080508@lionet.info> <475E87F7.5000905@fiit.stuba.sk> <475E89C0.8000302@lionet.info> Message-ID: <475E8FC7.6020709@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Lev Walkin wrote: > Matej Kosik wrote: > >>> If Erlang is implemented properly, this would be efficient despite the >>> fact that there are many >>> processes. Real measurements would either support or reject such >>> hypothesis. >>> >>>> This design has the same drawback as ets: lots of copying [between >>>> processes]. Consequently, a part of my email still applies: >> >> Are you sure? When (in which kind of operation) would such copying (of >> what) be needed. >> >> Sure, the cost of explicit copying of a queue instance has O(len(N)) >> complexity. But we were talking >> about adding/removing elements at the head/tail of the queue. > > I suspect implementing a queue as a separate process would have > larger constant factor than the current queues implementation for > data of pretty much any size. In my scheme, queue is not implemented as a process. Particular cells are implemented as processes. Many such cells are employed in representation of such queue. The described operations (empty, make, get, set, isEmpty have O(1)) complexity. Indeed, good question is, whether the `spawn' operation (necessary when creating new cells) is expensive or heap. Isn't this true in Erlang? How much more expensive is spawn than the cost of a function call in Erlang? > With larger elements the cost > of copying between processes only increases (unless they contain > larger binaries, of course). Why would I want to copy the queue when I want to insert/remove elements at the head or tail of the queue? > > So I see no point in implementing queues as an external data > structure, since there's going to be no performance benefit, > or more properly put, they'll have a negative performance impact. > I do not think we understand each other. Neither of us changed their (mutually inconsistent) beliefs. That is a pity of some of us. Here http://altair.sk:60001/mediawiki/upload/2/2b/Backwater.pdf is a series of definitions of various data types in Pict. Section 2.4 contains implementation of Cells. All operations have O(1) complexity and "spawn" as cheap as sending of a message. Section 2.15 contains implementation of Queue as I have described it (and more). Regards - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXo/HL+CaXfJI/hgRAhVbAJ9PX8an3fbWWP+j9SG7hYpo4kvpKwCeJMg7 +LPPM/Ryav5dKYN9iGI6f64= =taUn -----END PGP SIGNATURE----- From kosik@REDACTED Tue Dec 11 14:29:19 2007 From: kosik@REDACTED (Matej Kosik) Date: Tue, 11 Dec 2007 14:29:19 +0100 Subject: [erlang-questions] queues (previously: documentation of data structures) In-Reply-To: <200712111344.25828.bekesa@sch.bme.hu> References: <200712070917.13979.bekesa@sch.bme.hu> <475E67EB.4000104@lionet.info> <475E7919.7050109@fiit.stuba.sk> <200712111344.25828.bekesa@sch.bme.hu> Message-ID: <475E90AF.9010506@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andras Georgy Bekes wrote: >> The first step would be implementing a new data type: `cell' with operations such as >> - - cell:empty/0 (create an empty cell) >> - - cell:make/1 (create a cell with a given contents) >> - - cell:get/1 (non-destructively get the contents of a cell. Block (or throw an error or some >> predefined value if it is empty) >> - - cell:put/2 (destructively overwrite a cell with a given value) >> Basically, cell can be represented as a process that responds to proper messages. There can be >> wrapper procedures >> - - cell:/isEmpty/1 returns true if a given cell is empty >> >> If you have cells, you can implement `queue item' as a triple composed from: >> - - a cell containing a reference to the previous `queue item' >> - - a cell containing a reference to the value of the current `queue item' >> - - a cell containing a reference to the next `queue item'. >> >> If you have that, you can represent the whole queue as a couple composed from: >> - - a cell containing a reference to the head >> - - a cell containing a reference to the tail > > Why having a process for each queue entry??? > Ok, you can change a specific element once you've put on the > queue, but you probably don't want that. > > Why not just use the message queue of Erlang? > (see attached module --- very simple) > > Pros: > - one process for each queue > - same efficiency as the message queues of the VM > (hope you're satisfied with that) > - works when several processes use a common queue > > Cons: > - copies each queued element twice (just like your solution) > - ??? > > Georgy I am looking at your code. I partially see what you tried to say but in your implementation, you cannot perform operations for adding and removing elements from head and from tail in whatever order. In your program, because of nested `receive' operations you first have to remove something from the queue and then you must add something to the queue. You cannot - - add two elements at the end of the queue - - add two elements at the begining of the queue - - remove elements from the end of the queue Can you? > > > ------------------------------------------------------------------------ > > -module(myqueue). > > -export([start/0,init/0,put/2,get/1,delete/1]). > > start()-> > spawn(?MODULE,init,[]). > > init()-> > loop(). > > loop()-> > receive > {getnext,PID} -> > receive > {element, Data} -> > PID ! {element,Data}; > stop -> > ok > end; > stop-> > ok > end, > loop(). > > > put(Queue,Data)-> > Queue ! {element,Data}, > ok. > > get(Queue)-> > Queue ! {getnext,self()}, > receive > {element,Data}-> > Data > end. > > delete(Queue)-> > Queue ! stop, > ok. > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXpCvL+CaXfJI/hgRAlpIAKC6PeZlbqu4s4QPpZkKBIsjVecT0gCgo/c7 W53QNOy4YqyYOuc+NIwdlDI= =J70x -----END PGP SIGNATURE----- From joelr1@REDACTED Tue Dec 11 14:34:43 2007 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 11 Dec 2007 13:34:43 +0000 Subject: [erlang-questions] What should go into the FFI chapter of the book In-Reply-To: <475E8AD0.5000900@gmail.com> References: <475E8AD0.5000900@gmail.com> Message-ID: Serge, I agree with you on everything you wrote below. This is just the kind of feedback I love. I have also been told that there's work on WxWidgets as a linked-in driver. My focus is to both finish the book quickly and to keep it informative. This requires a compromise and I suspect that the book will not look like anything I envisioned in the beginning. It may well be that it's better to either describe the WxWidgets driver than to write a Cocoa bridge for the book. Describing existing code takes far less time than writing significant new code bases. WxWidgets is also cross-platform so Windows and Linux users of Erlang could run it, unlike the Cocoa bridge. In the end it may well suffice for me to just elaborate on what you listed below. There's more than enough content, complexity and value in doing this. I think I'll try to start down this path and see what happens. Thanks, Joel On Dec 11, 2007, at 1:04 PM, Serge Aleynikov wrote: > I think it would be useful to cover link-in drivers from the > following perspective: > > 1. C types: ErlDrvData, ErlDrvBinary, ErlIOVec, etc. and how to > marshal terms to Erlang using these primitives. > 2. Taking advantage of driver queues. > 3. Monitoring health of Pids from C, and performing driver shutdown > or resource cleanup when a Pid dies. > 4. Highlighting differences between output methods (output, output2, > outputv). > 5. Handling events from other sources (driver_select, ready_input, > ready_output and event callbacks) in the driver. > 6. When to use ei and when not to. > > At least there is currently no in-depth illustrated coverage of > these subjects and one has to go through a broad trial-and-error > cycle (at least I know I did :-( ) that keeps the learning curve > pretty steep before he/she learns these concepts and the mysterious > veil of driver complexity dissolves. > > Serge -- http://wagerlabs.com From andreas.hillqvist@REDACTED Tue Dec 11 14:40:36 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Tue, 11 Dec 2007 14:40:36 +0100 Subject: [erlang-questions] queues (previously: documentation of data structures) In-Reply-To: <200712111344.25828.bekesa@sch.bme.hu> References: <200712070917.13979.bekesa@sch.bme.hu> <475E67EB.4000104@lionet.info> <475E7919.7050109@fiit.stuba.sk> <200712111344.25828.bekesa@sch.bme.hu> Message-ID: <8268eea30712110540u4424a7d5p475551ac2a8ff697@mail.gmail.com> I saw a bug in your code: myqueue:delete/1 dose not stop the queue process. Kind regards Andreas Hillqvist 2007/12/11, Andras Georgy Bekes : > Why having a process for each queue entry??? > Ok, you can change a specific element once you've put on the > queue, but you probably don't want that. > > Why not just use the message queue of Erlang? > (see attached module --- very simple) > > Pros: > - one process for each queue > - same efficiency as the message queues of the VM > (hope you're satisfied with that) > - works when several processes use a common queue > > Cons: > - copies each queued element twice (just like your solution) > - ??? > > Georgy > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > From vlm@REDACTED Tue Dec 11 14:45:57 2007 From: vlm@REDACTED (Lev Walkin) Date: Tue, 11 Dec 2007 05:45:57 -0800 Subject: [erlang-questions] documentation of data structures In-Reply-To: <475E8FC7.6020709@fiit.stuba.sk> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <475DD7AB.6080500@lionet.info> <475E42BD.6050203@fiit.stuba.sk> <475E67EB.4000104@lionet.info> <475E7919.7050109@fiit.stuba.sk> <475E841A.6080508@lionet.info> <475E87F7.5000905@fiit.stuba.sk> <475E89C0.8000302@lionet.info> <475E8FC7.6020709@fiit.stuba.sk> Message-ID: <475E9495.8010401@lionet.info> Matej Kosik wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Lev Walkin wrote: >> Matej Kosik wrote: >> >>>> If Erlang is implemented properly, this would be efficient despite the >>>> fact that there are many >>>> processes. Real measurements would either support or reject such >>>> hypothesis. >>>> >>>>> This design has the same drawback as ets: lots of copying [between >>>>> processes]. Consequently, a part of my email still applies: >>> Are you sure? When (in which kind of operation) would such copying (of >>> what) be needed. >>> >>> Sure, the cost of explicit copying of a queue instance has O(len(N)) >>> complexity. But we were talking >>> about adding/removing elements at the head/tail of the queue. >> I suspect implementing a queue as a separate process would have >> larger constant factor than the current queues implementation for >> data of pretty much any size. > > In my scheme, queue is not implemented as a process. Particular cells are implemented as processes. > Many such cells are employed in representation of such queue. > > The described operations (empty, make, get, set, isEmpty have O(1)) complexity. Indeed, good > question is, whether the `spawn' operation (necessary when creating new cells) is expensive or heap. > Isn't this true in Erlang? How much more expensive is spawn than the cost of a function call in Erlang? See below. >> With larger elements the cost >> of copying between processes only increases (unless they contain >> larger binaries, of course). > > Why would I want to copy the queue when I want to insert/remove elements at the head or tail of the > queue? Not queue. Element. See below. >> So I see no point in implementing queues as an external data >> structure, since there's going to be no performance benefit, >> or more properly put, they'll have a negative performance impact. >> > > I do not think we understand each other. Neither of us changed their (mutually inconsistent) > beliefs. That is a pity of some of us. I am not talking about copying the queue. I am talking about extracting an element out of the queue or adding an element into it. The cost of function call is more than order of magnitude cheaper than spawn() in Erlang. Cost of intermodular queue:new() is slightly larger than cost of sending a single atom message, but not importantly so. The problem is that we start growing past simple atom messages or starting to allocate and deallocate cells. spawn() will kill this idea. I understand your point, but I am working within a constraint of a particular language, Erlang, which has such and such timings of most important constructs. Spawn() is a heavy construct (compared to a function call). > Here > http://altair.sk:60001/mediawiki/upload/2/2b/Backwater.pdf > is a series of definitions of various data types in Pict. > > Section 2.4 contains implementation of Cells. All operations have O(1) complexity and "spawn" as > cheap as sending of a message. > > Section 2.15 contains implementation of Queue as I have described it (and more). > > Regards > - -- > Matej Kosik > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHXo/HL+CaXfJI/hgRAhVbAJ9PX8an3fbWWP+j9SG7hYpo4kvpKwCeJMg7 > +LPPM/Ryav5dKYN9iGI6f64= > =taUn > -----END PGP SIGNATURE----- From vlm@REDACTED Tue Dec 11 14:53:01 2007 From: vlm@REDACTED (Lev Walkin) Date: Tue, 11 Dec 2007 05:53:01 -0800 Subject: [erlang-questions] queues (previously: documentation of data structures) In-Reply-To: <475E90AF.9010506@fiit.stuba.sk> References: <200712070917.13979.bekesa@sch.bme.hu> <475E67EB.4000104@lionet.info> <475E7919.7050109@fiit.stuba.sk> <200712111344.25828.bekesa@sch.bme.hu> <475E90AF.9010506@fiit.stuba.sk> Message-ID: <475E963D.3000407@lionet.info> Matej Kosik wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Andras Georgy Bekes wrote: >>> The first step would be implementing a new data type: `cell' with operations such as >>> - - cell:empty/0 (create an empty cell) >>> - - cell:make/1 (create a cell with a given contents) >>> - - cell:get/1 (non-destructively get the contents of a cell. Block (or throw an error or some >>> predefined value if it is empty) >>> - - cell:put/2 (destructively overwrite a cell with a given value) >>> Basically, cell can be represented as a process that responds to proper messages. There can be >>> wrapper procedures >>> - - cell:/isEmpty/1 returns true if a given cell is empty >>> >>> If you have cells, you can implement `queue item' as a triple composed from: >>> - - a cell containing a reference to the previous `queue item' >>> - - a cell containing a reference to the value of the current `queue item' >>> - - a cell containing a reference to the next `queue item'. >>> >>> If you have that, you can represent the whole queue as a couple composed from: >>> - - a cell containing a reference to the head >>> - - a cell containing a reference to the tail >> Why having a process for each queue entry??? >> Ok, you can change a specific element once you've put on the >> queue, but you probably don't want that. >> >> Why not just use the message queue of Erlang? >> (see attached module --- very simple) >> >> Pros: >> - one process for each queue >> - same efficiency as the message queues of the VM >> (hope you're satisfied with that) >> - works when several processes use a common queue >> >> Cons: >> - copies each queued element twice (just like your solution) >> - ??? >> >> Georgy > > I am looking at your code. I partially see what you tried to say but in your implementation, you > cannot perform operations for adding and removing elements from head and from tail in whatever > order. In your program, because of nested `receive' operations you first have to remove something > from the queue and then you must add something to the queue. You cannot > - - add two elements at the end of the queue no problem, just send a couple of messages not waiting for results. messages will be queued there. > - - add two elements at the begining of the queue queue != dequeue. > - - remove elements from the end of the queue queue != dequeue, so this shouldn't necessarily be possible. > Can you? From kosik@REDACTED Tue Dec 11 15:12:29 2007 From: kosik@REDACTED (Matej Kosik) Date: Tue, 11 Dec 2007 15:12:29 +0100 Subject: [erlang-questions] documentation of data structures In-Reply-To: <475E9495.8010401@lionet.info> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <475DD7AB.6080500@lionet.info> <475E42BD.6050203@fiit.stuba.sk> <475E67EB.4000104@lionet.info> <475E7919.7050109@fiit.stuba.sk> <475E841A.6080508@lionet.info> <475E87F7.5000905@fiit.stuba.sk> <475E89C0.8000302@lionet.info> <475E8FC7.6020709@fiit.stuba.sk> <475E9495.8010401@lionet.info> Message-ID: <475E9ACD.1070307@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Lev Walkin wrote: > >> I understand your point, but I am working within a constraint of >> a particular language, Erlang, which has such and such timings >> of most important constructs. Spawn() is a heavy construct >> (compared to a function call). Ok. I do not know how Erlang is implemented internally. I assumed that spawn is similarly cheap as in Pict. This renders my proposal as inpractical. Thank you anyway. - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXprNL+CaXfJI/hgRAtKeAKDWrAif7oJ9ypbLZ2QbWtt6USj9sQCgmQAy ZJPYENG9lAtupOkUz4bpYUM= =+1Od -----END PGP SIGNATURE----- From alceste@REDACTED Tue Dec 11 15:21:45 2007 From: alceste@REDACTED (Alceste Scalas) Date: Tue, 11 Dec 2007 15:21:45 +0100 Subject: [erlang-questions] idea: Erlang FFI: callbacks and memory management In-Reply-To: References: <62F3426C-094F-4A61-9E15-496B7AC3E069@gmail.com> Message-ID: <1197382905.6124.90.camel@gnatziu.crs4.it> Il giorno mar, 11/12/2007 alle 13.33 +0100, Kenneth Lundin ha scritto: > Many C-API's have callback functions. It would be nice if that could > be handled as well but i am not sure if we can find a generic solution > for that. If there is some way to call an Erlang fun() from C (i.e. from a BIF), then the problem should be mostly solved: libffi allows to define "closures", i.e. to dynamically create a native function that wraps a callback written in the host language. I briefly mentioned this possibility some months ago, with examples like using a C numeric library to integrate a differential equation written in Erlang. However, I was not able to find a way to call a fun() from C. Maybe I completely missed it: if it's the case, a pointer to the relevant Erlang/OTP source code would be really helpful... > I am sure there will be memory allocation issues as well, for example > cleaning up when an Erlang process dies. The same problem could arise with linked-in drivers. Memory allocations in C, in general, should be handled by library binding developers, that should ideally provide an Erlang API that makes life easier for final users. One possible approach is: provide an API that automatically spawns a supervisor process that tracks allocations and deallocations, and eventually performs automatic cleanup when the monitored process(es) die. Regards, alceste -- Alceste Scalas CRS4 - http://www.crs4.it/ From Bob.Cowdery@REDACTED Tue Dec 11 15:11:28 2007 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Tue, 11 Dec 2007 14:11:28 -0000 Subject: [erlang-questions] Mnesia queries Message-ID: <3A76756EED583B43A4AD704E29CCD079741343@mail.smartlogic.com> I need a little help with mnesia queries. I want to parameterise the query but can't seem to find any examples of how to do that. The general form seems to be qlc:q([X#rec.bar || X <- mnesia:table(foo), X#rec.bar == baz]) If I now want to select columns at run time is there some way I can construct the left side of the qlc. Thanks Bob From saleyn@REDACTED Tue Dec 11 14:04:16 2007 From: saleyn@REDACTED (Serge Aleynikov) Date: Tue, 11 Dec 2007 08:04:16 -0500 Subject: [erlang-questions] What FFI to use for new code In-Reply-To: References: Message-ID: <475E8AD0.5000900@gmail.com> Joel, If you are planning to write a book targeted for a more advanced audience, I can't possibly see how coverage of linked-in drivers can be avoided. The EPP of the FFI implementation doesn't solve the need of asynchronous non-blocking invocation of C code, which is needed quite frequently in event-driven systems. FFI is very convenient when you need quick access to stand-alone C functions or libraries. Of course one can use FFI to implement queuing, threading, etc. on the C side, but then he/she would likely end up re-implementing features link-in drivers already offer. I think it would be useful to cover link-in drivers from the following perspective: 1. C types: ErlDrvData, ErlDrvBinary, ErlIOVec, etc. and how to marshal terms to Erlang using these primitives. 2. Taking advantage of driver queues. 3. Monitoring health of Pids from C, and performing driver shutdown or resource cleanup when a Pid dies. 4. Highlighting differences between output methods (output, output2, outputv). 5. Handling events from other sources (driver_select, ready_input, ready_output and event callbacks) in the driver. 6. When to use ei and when not to. At least there is currently no in-depth illustrated coverage of these subjects and one has to go through a broad trial-and-error cycle (at least I know I did :-( ) that keeps the learning curve pretty steep before he/she learns these concepts and the mysterious veil of driver complexity dissolves. Serge Joel Reymont wrote: > I'm struggling to write the "C interface" chapter of my book. I would > like to write the Mac Cocoa bridge since it would cover XML processing > and maybe even a GUI chapter as well. I specifically want to write a > linked-in driver. > > The main reason why I'm struggling is that I find the current linked- > in driver interface ... umm... very difficult to deal with. I don't > find the Erlang Driver Toolkit (EDTK) [1] or even Dryverl [2] to be a > great alternative. > > Would it be reasonable to use the EEP for the Erlang FFI given that > the book won't come out for a few months? > > Thanks, Joel > > [1] http://www.snookles.com/erlang/edtk/ > [2] http://dryverl.objectweb.org/ > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From ulf.wiger@REDACTED Tue Dec 11 15:43:41 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 11 Dec 2007 15:43:41 +0100 Subject: [erlang-questions] Mnesia queries In-Reply-To: <3A76756EED583B43A4AD704E29CCD079741343@mail.smartlogic.com> References: <3A76756EED583B43A4AD704E29CCD079741343@mail.smartlogic.com> Message-ID: <475EA21D.9040407@ericsson.com> Bob Cowdery skrev: > I need a little help with mnesia queries. I want to parameterise the query but can't seem to find any examples of how to do that. The general form seems to be > > qlc:q([X#rec.bar || X <- mnesia:table(foo), X#rec.bar == baz]) > > If I now want to select columns at run time is there some way I can construct the left side of the qlc. > > Thanks > Bob Do you mean something like this? qlc:q([{X#rec.bar, X#rec.baz} || X <- mnesia:table(foo), ...]) BR, Ulf W From Bob.Cowdery@REDACTED Tue Dec 11 16:14:29 2007 From: Bob.Cowdery@REDACTED (Bob Cowdery) Date: Tue, 11 Dec 2007 15:14:29 -0000 Subject: [erlang-questions] Mnesia queries Message-ID: <3A76756EED583B43A4AD704E29CCD079741344@mail.smartlogic.com> Bob Cowdery skrev: > I need a little help with mnesia queries. I want to parameterise the query but can't seem to find any examples of how to do that. The general form seems to be > > qlc:q([X#rec.bar || X <- mnesia:table(foo), X#rec.bar == baz]) > > If I now want to select columns at run time is there some way I can construct the left side of the qlc. > > Thanks > Bob >> Do you mean something like this? >> qlc:q([{X#rec.bar, X#rec.baz} || X <- mnesia:table(foo), ...]) I've used that construct when I want to select several columns and know what they are at compile time. If I want to do that at run time by passing in a list like: myquery(List) -> qlc:q([{construct this from 'List'} || X <- mnesia:table(foo), ...]). what is the approach to doing that. Bob _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From ulf.wiger@REDACTED Tue Dec 11 16:37:00 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 11 Dec 2007 16:37:00 +0100 Subject: [erlang-questions] Mnesia queries In-Reply-To: <3A76756EED583B43A4AD704E29CCD079741344@mail.smartlogic.com> References: <3A76756EED583B43A4AD704E29CCD079741344@mail.smartlogic.com> Message-ID: <475EAE9C.50408@ericsson.com> Bob Cowdery skrev: > > Bob Cowdery skrev: >> I need a little help with mnesia queries. I want to parameterise the query but can't seem to find any examples of how to do that. The general form seems to be >> >> qlc:q([X#rec.bar || X <- mnesia:table(foo), X#rec.bar == baz]) >> >> If I now want to select columns at run time is there some way I can construct the left side of the qlc. >> >> Thanks >> Bob > >>> Do you mean something like this? > >>> qlc:q([{X#rec.bar, X#rec.baz} || X <- mnesia:table(foo), ...]) > > > I've used that construct when I want to select several columns and know what they are at compile time. If I want to do that at run time by passing in a list like: > > myquery(List) -> > qlc:q([{construct this from 'List'} || X <- mnesia:table(foo), ...]). > > what is the approach to doing that. You can put any expression on the LHS of a list comprehension, and you can construct something at run-time e.g. using the function mnesia:table_info/2: myquery(Cols, List) -> PosL = cols2pos(Cols), qlc:q([ [element(P,X) || P <- PosL] || X <- mnesia:table(foo), ...]). cols2pos(Cols) -> Attrs = mnesia:table_info(foo, attributes), Arity = length(Attrs) + 1, lists:map( fun(P) when is_integer(P), P > 1, P =< Arity -> P; (C) when is_atom(C) -> pos(C, Attrs) end, Cols). pos(X, L) -> pos(X, L, 2). % record tag is pos 1 pos(H, [H|_], P) -> P; pos(H, [_|T], P) -> pos(H, T, P+1). You can of course also make use of my little exprecs.erl parse transform, which generates accessor functions for records. http://forum.trapexit.org/viewtopic.php?p=21790#21790 BR, Ulf W From bekesa@REDACTED Tue Dec 11 15:16:50 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Tue, 11 Dec 2007 15:16:50 +0100 Subject: [erlang-questions] queues (previously: documentation of data structures) In-Reply-To: <475E8E41.5040603@lionet.info> References: <200712070917.13979.bekesa@sch.bme.hu> <200712111344.25828.bekesa@sch.bme.hu> <475E8E41.5040603@lionet.info> Message-ID: <200712111516.50740.bekesa@sch.bme.hu> > The killing Con is that one process may keep a megabyte > in the queue making this queue performance excruciatingly > slow for all other processes due to repeating message > queue scans. You're right. > I saw a bug in your code: myqueue:delete/1 dose not stop the queue > process. You too. I hacked that module in 2 minutes, so I'm happy with that bug :-) > > - - add two elements at the begining of the queue > queue != dequeue. > > - - remove elements from the end of the queue > queue != dequeue, so this shouldn't necessarily be possible. Everybody is right. The module I've written implements a queue. However, the queue module in OTP implements a deque (only with funny function names). Probably this is the source of confusion. Anyways, queue:lait/1 should be liat/1 shouldn't it? Both in the doc and impl. (It is the opposite of tail. The opposite of cons/2 is snoc/2, the opposite of head/1 is daeh/1 but lists:reverse("tail") /= "lait"). Georgy From andreas.hillqvist@REDACTED Tue Dec 11 17:19:57 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Tue, 11 Dec 2007 17:19:57 +0100 Subject: [erlang-questions] clarify: Ericsson Erlang vision/strategy Message-ID: <8268eea30712110819v1f7a8111j60a52b020d9214d5@mail.gmail.com> As far as I know, currently Ericsson maintain and develops Erlang/OTP. They have employee professional people that get payed to maintain and develops Erlang/OTP. But is there a risk that Erlang/OTP will be drooped in the future? If Ericsson's would drooped Erlang would the Erlang community sustain the quality of maintains and development of Erlang/OTP? The reason why I am asking this is because of Jimmy Nilsson's blog. Jimmy Nilsson's blog - Erlang, take 2 (http://jimmynilsson.com/blog/posts/Erlang.htm) "... since even Ericsson, the company where Erlang was developed, decided to go another route after a while." I have also heard the story/rumor of the management at Ericsson baned the use of Erlang in new products. But dose this apply today? Has not Erlang/OTP been part of Ericsson's success for core network products, outperforming competitors? Telecom is moving towards Long Term Evolution(LTE), where an aimed to is to be an all-IP network. How dose an Erlang/OTP IP switching product stack up against Cisco C++ (or what they are using) product? Is Erlang/OTP the natural/best choice to develop core network products for LTE or will Ericsson have to adapt and move away from Erlang? I believe in Erlang/OTP. I believe that Erlang/OTP has an big advantage now when we are moving towards SMP, because that Erlang is concurrent-oriented. Erlang/OTP is also a mature platform that has proven to survive in the past. But I would appreciate your point of view. Regards Andreas Hillqvist From bengt.kleberg@REDACTED Tue Dec 11 17:21:09 2007 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 11 Dec 2007 17:21:09 +0100 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <339019.46701.qm@web60518.mail.yahoo.com> References: <339019.46701.qm@web60518.mail.yahoo.com> Message-ID: <475EB8F5.6020604@ericsson.com> greetings, it is good that you always think about the legalities involved in email discussions. not many people do. it would be better if you thought about how to communicate in email discussions, too. some things that helps communication: what is the goal you have in mind when you send an email? if the receiver knows where the discussion is heading it will help. try to write clearly, not cleverly. if possible, be nice. avoid rhetorical questions that are thinly veiled threats. bullying people will make them shut up, but not change their mind. give a context to your questions. do not insinuate that your reader is an idiot. that either adds to the confusion or creates bad will. explain a lot since mind reading never works. take your last email as an example. it probably says that you do not like a personal attack, only not directly. but what is it that you do not like? is it to be reminded of a mistake? or that your perfectly legal and very well crafted writing is called brutal? i do not know and if you want me to know, then communication could fix that. if you do not want me to know, then the simplest way is to avoid writing anything at all. bengt Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." On 12/07/07 19:08, Isaac Gouy wrote: > Please consider whether making a personal attack is an appropriate use > of this mailing list or of your employers email service. > > I provided a link to the benchmarks game public discussion forum - > please understand that personal attacks will not be welcomed there. > > There's nothing more for me to say. > > > --- Bengt Kleberg wrote: > >> greetings, >> >> as for losing audience i hope that my suggestion at the start of this >> >> discussion (''do not read this'') was followed by as many as >> possible. >> having experienced isaac some 2-3 years ago (that time was much worse >> >> since i was unprepared) i expected something like this and thus >> offered >> the warning. >> >> >> taking this from the mail list is a good idea in theory. >> >> it was my first reaction when things turned ugly all those years ago. >> >> unfortunately isaac took the private email i sent him, chopped it >> into >> little pieces, removing things like explanations, smilies, etc. he >> then >> posted these pieces as straw man arguments on the mail list. using >> his >> normal acerbic tone, he proceeded smashing them to dust. >> >> i sent another private email explaining that he had hurt me, asking >> him >> to stop doing such things, and giving me an apology. his (private) >> answer was much more brutal than his mail list postings, the point >> being >> that his act was not illegal and he would never apologise. finally he >> >> wrote that we should never send private email to each other again. >> >> so in practice i am not taking this off-line even though it would be >> a >> nice thing for this list. >> >> >> bengt > > > ____________________________________________________________________________________ > Never miss a thing. Make Yahoo your home page. > http://www.yahoo.com/r/hs > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From mogorman@REDACTED Tue Dec 11 17:34:51 2007 From: mogorman@REDACTED (mog) Date: Tue, 11 Dec 2007 10:34:51 -0600 Subject: [erlang-questions] clarify: Ericsson Erlang vision/strategy In-Reply-To: <8268eea30712110819v1f7a8111j60a52b020d9214d5@mail.gmail.com> References: <8268eea30712110819v1f7a8111j60a52b020d9214d5@mail.gmail.com> Message-ID: <1197390891.32254.6.camel@metalman.lan> On Tue, 2007-12-11 at 17:19 +0100, Andreas Hillqvist wrote: > As far as I know, currently Ericsson maintain and develops Erlang/OTP. > They have employee professional people that get payed to maintain and > develops Erlang/OTP. > But is there a risk that Erlang/OTP will be drooped in the future? > If Ericsson's would drooped Erlang would the Erlang community sustain > the quality of maintains and development of Erlang/OTP? This uncertainty exists in all free software projects. The developer or in this case company could lose interest and leave the community holding the bag. However there is a fairly large install base and we could come together and have a public repo and take over, the code appears to be well commented and structured from what little I have read of it, I don't think its worth wasting time worrying over. Not to hijack the thread but it would be really nice and show faith in the community if Ericsson moved to svn or some other version control (git) that could be opened to the public, and hopefully eventually allow for outside committers. Mog -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From sean.hinde@REDACTED Tue Dec 11 17:38:44 2007 From: sean.hinde@REDACTED (Sean Hinde) Date: Tue, 11 Dec 2007 16:38:44 +0000 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <475EB8F5.6020604@ericsson.com> References: <339019.46701.qm@web60518.mail.yahoo.com> <475EB8F5.6020604@ericsson.com> Message-ID: Please, please give it a rest. Enough. Stop. Cease. Desist. This is doing more to damage the reputation of the Erlang community than any benefit that might be gained from whatever it is you are writing about. Go away! Sean On 11 Dec 2007, at 16:21, Bengt Kleberg wrote: > greetings, > > it is good that you always think about the legalities involved in > email > discussions. not many people do. it would be better if you thought > about > how to communicate in email discussions, too. > > some things that helps communication: what is the goal you have in > mind > when you send an email? if the receiver knows where the discussion is > heading it will help. try to write clearly, not cleverly. if possible, > be nice. avoid rhetorical questions that are thinly veiled threats. > bullying people will make them shut up, but not change their mind. > give > a context to your questions. do not insinuate that your reader is an > idiot. that either adds to the confusion or creates bad will. > explain a > lot since mind reading never works. > > take your last email as an example. it probably says that you do not > like a personal attack, only not directly. but what is it that you do > not like? is it to be reminded of a mistake? or that your perfectly > legal and very well crafted writing is called brutal? i do not know > and > if you want me to know, then communication could fix that. > > if you do not want me to know, then the simplest way is to avoid > writing > anything at all. > > > bengt > > Those were the days... > EPO guidelines 1978: "If the contribution to the known art resides > solely in a computer program then the subject matter is not > patentable in whatever manner it may be presented in the claims." > > > On 12/07/07 19:08, Isaac Gouy wrote: >> Please consider whether making a personal attack is an appropriate >> use >> of this mailing list or of your employers email service. >> >> I provided a link to the benchmarks game public discussion forum - >> please understand that personal attacks will not be welcomed there. >> >> There's nothing more for me to say. >> >> >> --- Bengt Kleberg wrote: >> >>> greetings, >>> >>> as for losing audience i hope that my suggestion at the start of >>> this >>> >>> discussion (''do not read this'') was followed by as many as >>> possible. >>> having experienced isaac some 2-3 years ago (that time was much >>> worse >>> >>> since i was unprepared) i expected something like this and thus >>> offered >>> the warning. >>> >>> >>> taking this from the mail list is a good idea in theory. >>> >>> it was my first reaction when things turned ugly all those years >>> ago. >>> >>> unfortunately isaac took the private email i sent him, chopped it >>> into >>> little pieces, removing things like explanations, smilies, etc. he >>> then >>> posted these pieces as straw man arguments on the mail list. using >>> his >>> normal acerbic tone, he proceeded smashing them to dust. >>> >>> i sent another private email explaining that he had hurt me, asking >>> him >>> to stop doing such things, and giving me an apology. his (private) >>> answer was much more brutal than his mail list postings, the point >>> being >>> that his act was not illegal and he would never apologise. finally >>> he >>> >>> wrote that we should never send private email to each other again. >>> >>> so in practice i am not taking this off-line even though it would be >>> a >>> nice thing for this list. >>> >>> >>> bengt >> >> >> >> ____________________________________________________________________________________ >> Never miss a thing. Make Yahoo your home page. >> http://www.yahoo.com/r/hs >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From ingela@REDACTED Tue Dec 11 17:49:01 2007 From: ingela@REDACTED (Ingela Anderton Andin) Date: Tue, 11 Dec 2007 17:49:01 +0100 Subject: [erlang-questions] Erlang HTTP client is not so fault, tollerant... In-Reply-To: References: Message-ID: <475EBF7D.2020406@erix.ericsson.se> > > [built-in http vs ibrowse > > I found the built-in http client had problems (as of R10B) when > > interacting with various versions of IIS. I can't remember now if it was > > the client's or the server's fault, but I do remember wanting to be able > > to work around the problem by forcing the client to use HTTP v1.0 > > instead of v1.1. > > > I think the hard-coded HTTP version number in the built-in client was > > the only reason I switched to ibrowse. > Well the inets client has never claimed to be anything else than a HTTP/1.1 client. But we can add an option for the client to act as lesser version client that that could be a nice feature. Regards Ingela - OTP team From rvirding@REDACTED Tue Dec 11 17:52:49 2007 From: rvirding@REDACTED (Robert Virding) Date: Tue, 11 Dec 2007 17:52:49 +0100 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: References: <339019.46701.qm@web60518.mail.yahoo.com> <475EB8F5.6020604@ericsson.com> Message-ID: <3dbc6d1c0712110852n119cf163v53e111f6c37cf703@mail.gmail.com> Who cab be bothered reading it now anyway? :-) Robert On 11/12/2007, Sean Hinde wrote: > > Please, please give it a rest. Enough. Stop. Cease. Desist. > > This is doing more to damage the reputation of the Erlang community > than any benefit that might be gained from whatever it is you are > writing about. Go away! > > Sean > > On 11 Dec 2007, at 16:21, Bengt Kleberg wrote: > > > greetings, > > > > it is good that you always think about the legalities involved in > > email > > discussions. not many people do. it would be better if you thought > > about > > how to communicate in email discussions, too. > > > > some things that helps communication: what is the goal you have in > > mind > > when you send an email? if the receiver knows where the discussion is > > heading it will help. try to write clearly, not cleverly. if possible, > > be nice. avoid rhetorical questions that are thinly veiled threats. > > bullying people will make them shut up, but not change their mind. > > give > > a context to your questions. do not insinuate that your reader is an > > idiot. that either adds to the confusion or creates bad will. > > explain a > > lot since mind reading never works. > > > > take your last email as an example. it probably says that you do not > > like a personal attack, only not directly. but what is it that you do > > not like? is it to be reminded of a mistake? or that your perfectly > > legal and very well crafted writing is called brutal? i do not know > > and > > if you want me to know, then communication could fix that. > > > > if you do not want me to know, then the simplest way is to avoid > > writing > > anything at all. > > > > > > bengt > > > > Those were the days... > > EPO guidelines 1978: "If the contribution to the known art resides > > solely in a computer program then the subject matter is not > > patentable in whatever manner it may be presented in the claims." > > > > > > On 12/07/07 19:08, Isaac Gouy wrote: > >> Please consider whether making a personal attack is an appropriate > >> use > >> of this mailing list or of your employers email service. > >> > >> I provided a link to the benchmarks game public discussion forum - > >> please understand that personal attacks will not be welcomed there. > >> > >> There's nothing more for me to say. > >> > >> > >> --- Bengt Kleberg wrote: > >> > >>> greetings, > >>> > >>> as for losing audience i hope that my suggestion at the start of > >>> this > >>> > >>> discussion (''do not read this'') was followed by as many as > >>> possible. > >>> having experienced isaac some 2-3 years ago (that time was much > >>> worse > >>> > >>> since i was unprepared) i expected something like this and thus > >>> offered > >>> the warning. > >>> > >>> > >>> taking this from the mail list is a good idea in theory. > >>> > >>> it was my first reaction when things turned ugly all those years > >>> ago. > >>> > >>> unfortunately isaac took the private email i sent him, chopped it > >>> into > >>> little pieces, removing things like explanations, smilies, etc. he > >>> then > >>> posted these pieces as straw man arguments on the mail list. using > >>> his > >>> normal acerbic tone, he proceeded smashing them to dust. > >>> > >>> i sent another private email explaining that he had hurt me, asking > >>> him > >>> to stop doing such things, and giving me an apology. his (private) > >>> answer was much more brutal than his mail list postings, the point > >>> being > >>> that his act was not illegal and he would never apologise. finally > >>> he > >>> > >>> wrote that we should never send private email to each other again. > >>> > >>> so in practice i am not taking this off-line even though it would be > >>> a > >>> nice thing for this list. > >>> > >>> > >>> bengt > >> > >> > >> > >> > ____________________________________________________________________________________ > >> Never miss a thing. Make Yahoo your home page. > >> http://www.yahoo.com/r/hs > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.hinde@REDACTED Tue Dec 11 17:56:40 2007 From: sean.hinde@REDACTED (Sean Hinde) Date: Tue, 11 Dec 2007 16:56:40 +0000 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: <3dbc6d1c0712110852n119cf163v53e111f6c37cf703@mail.gmail.com> References: <339019.46701.qm@web60518.mail.yahoo.com> <475EB8F5.6020604@ericsson.com> <3dbc6d1c0712110852n119cf163v53e111f6c37cf703@mail.gmail.com> Message-ID: <6D200C57-8E59-4714-9A8F-51783A45F272@gmail.com> It affects the tone. Even to glance at the first few words is enough. At least it has provided the inspiration to finally fire up my mail filter and permanently remove such drivel from these folks Sean On 11 Dec 2007, at 16:52, Robert Virding wrote: > Who cab be bothered reading it now anyway? :-) > > Robert > > On 11/12/2007, Sean Hinde wrote:Please, > please give it a rest. Enough. Stop. Cease. Desist. > > This is doing more to damage the reputation of the Erlang community > than any benefit that might be gained from whatever it is you are > writing about. Go away! > > Sean > > On 11 Dec 2007, at 16:21, Bengt Kleberg wrote: > > > greetings, > > > > it is good that you always think about the legalities involved in > > email > > discussions. not many people do. it would be better if you thought > > about > > how to communicate in email discussions, too. > > > > some things that helps communication: what is the goal you have in > > mind > > when you send an email? if the receiver knows where the discussion > is > > heading it will help. try to write clearly, not cleverly. if > possible, > > be nice. avoid rhetorical questions that are thinly veiled threats. > > bullying people will make them shut up, but not change their mind. > > give > > a context to your questions. do not insinuate that your reader is an > > idiot. that either adds to the confusion or creates bad will. > > explain a > > lot since mind reading never works. > > > > take your last email as an example. it probably says that you do not > > like a personal attack, only not directly. but what is it that you > do > > not like? is it to be reminded of a mistake? or that your perfectly > > legal and very well crafted writing is called brutal? i do not know > > and > > if you want me to know, then communication could fix that. > > > > if you do not want me to know, then the simplest way is to avoid > > writing > > anything at all. > > > > > > bengt > > > > Those were the days... > > EPO guidelines 1978: "If the contribution to the known art > resides > > solely in a computer program then the subject matter is not > > patentable in whatever manner it may be presented in the claims." > > > > > > On 12/07/07 19:08, Isaac Gouy wrote: > >> Please consider whether making a personal attack is an appropriate > >> use > >> of this mailing list or of your employers email service. > >> > >> I provided a link to the benchmarks game public discussion forum - > >> please understand that personal attacks will not be welcomed there. > >> > >> There's nothing more for me to say. > >> > >> > >> --- Bengt Kleberg wrote: > >> > >>> greetings, > >>> > >>> as for losing audience i hope that my suggestion at the start of > >>> this > >>> > >>> discussion (''do not read this'') was followed by as many as > >>> possible. > >>> having experienced isaac some 2-3 years ago (that time was much > >>> worse > >>> > >>> since i was unprepared) i expected something like this and thus > >>> offered > >>> the warning. > >>> > >>> > >>> taking this from the mail list is a good idea in theory. > >>> > >>> it was my first reaction when things turned ugly all those years > >>> ago. > >>> > >>> unfortunately isaac took the private email i sent him, chopped it > >>> into > >>> little pieces, removing things like explanations, smilies, etc. he > >>> then > >>> posted these pieces as straw man arguments on the mail list. using > >>> his > >>> normal acerbic tone, he proceeded smashing them to dust. > >>> > >>> i sent another private email explaining that he had hurt me, > asking > >>> him > >>> to stop doing such things, and giving me an apology. his (private) > >>> answer was much more brutal than his mail list postings, the point > >>> being > >>> that his act was not illegal and he would never apologise. finally > >>> he > >>> > >>> wrote that we should never send private email to each other again. > >>> > >>> so in practice i am not taking this off-line even though it > would be > >>> a > >>> nice thing for this list. > >>> > >>> > >>> bengt > >> > >> > >> > >> > ____________________________________________________________________________________ > >> Never miss a thing. Make Yahoo your home page. > >> http://www.yahoo.com/r/hs > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bob@REDACTED Tue Dec 11 18:02:29 2007 From: bob@REDACTED (Bob Ippolito) Date: Tue, 11 Dec 2007 09:02:29 -0800 Subject: [erlang-questions] clarify: Ericsson Erlang vision/strategy In-Reply-To: <1197390891.32254.6.camel@metalman.lan> References: <8268eea30712110819v1f7a8111j60a52b020d9214d5@mail.gmail.com> <1197390891.32254.6.camel@metalman.lan> Message-ID: <6a36e7290712110902l1a68f066r51810beae190de6d@mail.gmail.com> On 12/11/07, mog wrote: > > On Tue, 2007-12-11 at 17:19 +0100, Andreas Hillqvist wrote: > > As far as I know, currently Ericsson maintain and develops Erlang/OTP. > > They have employee professional people that get payed to maintain and > > develops Erlang/OTP. > > But is there a risk that Erlang/OTP will be drooped in the future? > > If Ericsson's would drooped Erlang would the Erlang community sustain > > the quality of maintains and development of Erlang/OTP? > > This uncertainty exists in all free software projects. The developer or > in this case company could lose interest and leave the community holding > the bag. It's not just free software. > However there is a fairly large install base and we could come together > and have a public repo and take over, the code appears to be well > commented and structured from what little I have read of it, I don't > think its worth wasting time worrying over. I agree. If Ericsson was to drop Erlang then I'd hire the Erlang developers myself and continue development :) > Not to hijack the thread but it would be really nice and show faith in > the community if Ericsson moved to svn or some other version control > (git) that could be opened to the public, and hopefully eventually allow > for outside committers. I don't think that's such a big deal. Most Erlang development should really be happening in third party libraries, and the OTP team has been doing a pretty good job accepting patches and fixing bugs that the community provides. -bob From ulf.wiger@REDACTED Tue Dec 11 18:13:04 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Tue, 11 Dec 2007 18:13:04 +0100 Subject: [erlang-questions] clarify: Ericsson Erlang vision/strategy In-Reply-To: <8268eea30712110819v1f7a8111j60a52b020d9214d5@mail.gmail.com> References: <8268eea30712110819v1f7a8111j60a52b020d9214d5@mail.gmail.com> Message-ID: <475EC520.3030205@ericsson.com> Some of your questions can't readily be answered, since it would mean revealing proprietary information. I will try to give you some hints. Andreas Hillqvist skrev: > As far as I know, currently Ericsson maintain and develops > Erlang/OTP. They have employee professional people that get > payed to maintain and develops Erlang/OTP. > But is there a risk that Erlang/OTP will be drooped in the > future? Ericsson has a considerable number of Erlang-based products in commercial operation, and these products have a considerable life span. "Dropping" Erlang (as in suddenly), is pretty much out of the question. You would notice it years in advance as a move of Erlang into "maintenance mode" first. > If Ericsson's would drooped Erlang would the Erlang community > sustain the quality of maintains and development of Erlang/OTP? Considering the above, I'd say it's a hypothetical question. As long as Erlang is going strong, and is evidently one of the hottest technologies for multi-core architectures, it is likely to have a vibrant user community - but this also makes it less likely that Ericsson would "drop it". If the Open Source community stagnates, Ericsson is more likely to move away from Erlang, and the community would then also be ill equipped to maintain it at the current level. > The reason why I am asking this is because of Jimmy Nilsson's blog. > Jimmy Nilsson's blog - Erlang, take 2 > (http://jimmynilsson.com/blog/posts/Erlang.htm) > "... since even Ericsson, the company where Erlang was developed, > decided to go another route after a while." This is not really a correct account. There was never any question of Ericsson moving to replace mainstream tools wholesale with Erlang. Ericsson did start two large development projects using Erlang in the mid 90s. Both products are still being developed and sold, and other products have been developed using Erlang since. Ericsson also advertises the use of Erlang at http://www.ericsson.com/technology/open_source/index.shtml Ericsson also sponsors the ProTEST EU project, which is very much based on Erlang technology. This project will run for about three years. http://www.erlang.se/euc/07/papers/1600Hughes.pdf (John, your slides don't come across very well as PDF.) > I have also heard the story/rumor of the management at Ericsson > baned the use of Erlang in new products. But dose this apply today? It is a documented fact that Erlang was banned for new product development within a part of Ericsson. This was 9 years ago. I know of very few technology choices that are considered relevant 9 years after the fact. > Has not Erlang/OTP been part of Ericsson's success for core > network products, outperforming competitors? I believe so. > Telecom is moving towards Long Term Evolution(LTE), where an aimed to > is to be an all-IP network. > How dose an Erlang/OTP IP switching product stack up against Cisco C++ > (or what they are using) product? I'm sorry, but that question would have to be put through Ericsson's sales channels. I'm sure they would like to tell you how our products compare to Cisco's, if you're a prospective customer. ;-) > Is Erlang/OTP the natural/best choice to develop core network > products for LTE or will Ericsson have to adapt and move away > from Erlang? There are a lot of factors that weigh in on technology choices. One of them is of course existing market share. LTE represents a change in network topology, and any vendor will of course want to look at whether existing products should be adapted to a new standard or replaced with a new product. The word "evolution" is significant here, I believe. Most of the products using Erlang within Ericsson will not be affected by LTE at all. BR, Ulf W From toby@REDACTED Tue Dec 11 18:48:29 2007 From: toby@REDACTED (Toby Thain) Date: Tue, 11 Dec 2007 15:48:29 -0200 Subject: [erlang-questions] Erlang HTTP client is not so fault, tollerant... In-Reply-To: <475EBF7D.2020406@erix.ericsson.se> References: <475EBF7D.2020406@erix.ericsson.se> Message-ID: <3012CFF1-2393-43EE-A872-A484E84B0AF2@smartgames.ca> On 11-Dec-07, at 2:49 PM, Ingela Anderton Andin wrote: >> >> [built-in http vs ibrowse >>> I found the built-in http client had problems (as of R10B) when >>> interacting with various versions of IIS. I can't remember now if >>> it was >>> the client's or the server's fault, but I do remember wanting to >>> be able >>> to work around the problem by forcing the client to use HTTP v1.0 >>> instead of v1.1. >> >>> I think the hard-coded HTTP version number in the built-in client >>> was >>> the only reason I switched to ibrowse. >> > > Well the inets client has never claimed to be anything else than a > HTTP/1.1 client. > But we can add an option for the client to act as lesser version > client > that > that could be a nice feature. Easier than getting MS to fix anything, for sure. --Toby > > Regards Ingela - OTP team > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From domi@REDACTED Tue Dec 11 21:00:44 2007 From: domi@REDACTED (Dominique de Waleffe) Date: Tue, 11 Dec 2007 21:00:44 +0100 Subject: [erlang-questions] crypto+ssh ? In-Reply-To: References: <475D9694.7010302@dewaleffe.org> Message-ID: <475EEC6C.1040906@dewaleffe.org> Kenneth Lundin wrote: > The crypto application is dependent on OpenSSL which you need to > install yourself. > > You can find pre-built versions of OpenSSL for Windows here: > http://www.openssl.org/related/binaries.html > Thanks a lot. That did the trick. I was able to do a simple connection. and start a simple command... But I would still like to find a sample or doc to get me furtehr with the ssh_cm module which is what I think I should be using... that will have to wait till I have time to to dig through the sources... D. From thomasl_erlang@REDACTED Tue Dec 11 21:33:18 2007 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 11 Dec 2007 12:33:18 -0800 (PST) Subject: [erlang-questions] clarify: Ericsson Erlang vision/strategy In-Reply-To: <8268eea30712110819v1f7a8111j60a52b020d9214d5@mail.gmail.com> Message-ID: <106812.61323.qm@web38804.mail.mud.yahoo.com> --- Andreas Hillqvist wrote: > Telecom is moving towards Long Term Evolution(LTE), > where an aimed to > is to be an all-IP network. > How dose an Erlang/OTP IP switching product stack up > against Cisco C++ > (or what they are using) product? Which Erlang/OTP IP switching product are you thinking about? Though it would be kind of interesting to build an xorp-style router with an Erlang routing engine. > Is Erlang/OTP the natural/best choice to develop > core network products > for LTE or will Ericsson have to adapt and move away > from Erlang? > > I believe in Erlang/OTP. I believe that Erlang/OTP > has an big > advantage now when we are moving towards SMP, > because that Erlang is > concurrent-oriented. > Erlang/OTP is also a mature platform that has proven > to survive in the past. > > But I would appreciate your point of view. I'd say Erlang/OTP is almost too mature (overripe?) at this point, and I'm only half joking. (Consider for how long it has already been supported as open source.) When you have read this list for a while, you will begin to appreciate the commitment to backwards compatibility. If Ericsson would decide to stop supporting Erlang (quite unlikely, IMO) then it would be straightforward to put the code in a public repository and carry on. And, who knows, Erlang might even evolve more quickly that way. We might be able to drop some of the three nearly-identical varieties of boolean operators, for instance :-) Best, Thomas ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs From rvirding@REDACTED Tue Dec 11 23:40:54 2007 From: rvirding@REDACTED (Robert Virding) Date: Tue, 11 Dec 2007 23:40:54 +0100 Subject: [erlang-questions] pre-EEP: accurate float printing (replacement for io_lib_format:fwrite_g/1) In-Reply-To: References: <6a36e7290712101340n610c9f1cud828da66c9929bad@mail.gmail.com> <20071211080906.GA14875@erix.ericsson.se> <6a36e7290712110043j696da319n91ed647b310538a4@mail.gmail.com> Message-ID: <3dbc6d1c0712111440q60679e3fla102e89a3075296d@mail.gmail.com> On 11 Dec 2007 10:10:48 +0100, Bjorn Gustavsson wrote: > > "Bob Ippolito" writes: > > > ~g with no precision specification (io_lib_format:fwrite_g/1) is a > > perfect target and it hits every use the shell has, ~f and ~e I don't > > care about. Having yet another float format would be completely stupid > > and confusing to anyone that doesn't know the back story for why > > supposed backward compatibility required the need for another format. > > Other languages have undergone this type of change with no ill effects > > that I've heard of (e.g. TCL did this in 2003 [1]). > > I agree. If there are no compatibility problems *in practice*, we > should simply make the change. I agree, we should change if no real problems are found. What I don't understand is why just have it for ~g with no precision and not for all cases of ~g, ~f and ~e? They are really just shifting the decimal dot and fixing the exponent. Robert (being the one who wrote the original code in all its glory) -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Tue Dec 11 23:45:13 2007 From: erlang@REDACTED (Dominic Williams) Date: Tue, 11 Dec 2007 23:45:13 +0100 Subject: [erlang-questions] clarify: why is Mnesia not fit for large databases In-Reply-To: <4757F31D.8060600@ericsson.com> References: <475731E0.3090104@dominicwilliams.net> <2ae2b2da0712052039h114dbc99r7bb1e493e3f89d4a@mail.gmail.com> <4757F31D.8060600@ericsson.com> Message-ID: <475F12F9.5000903@dominicwilliams.net> Hi, Ulf Wiger wrote : > Mnesia doesn't, but dets files are currently limited to 2 > GB per file, and mnesia uses dets files for disc_only > tables. In a fragmented disc_only table, that would > amount to max 2 GB per fragment (which is not something > that mnesia will check or enforce, so living close to > that limit is inadvisable to say the least). Thanks, that confirms my understanding that the 2GB limit can be overcome with fragmented tables. Would monitoring the size of each fragment and raising an alarm when it approaches the 2GB limit be a simple way to stay out of trouble? A scheme in which additional fragments get automatically created does not seem all that hard to imagine, either... > It's reasonable to assume that mnesia can safely handle > databases of a number of gigabytes, perhaps (tounge in > cheek) a hundred or so gigabytes, if one thinks > carefully, and the access patterns are favourable. But I > don't know of anyone who actually does that, and most > people who have databases that large tend to not want to > be guinea pigs. (: Right. The reason I ask, though, is that we need the nice real-time and distributed characteristics of mnesia, and our current use of MySQL is proving to be a performance bottleneck and a constant source of operational problems. I am just trying to decide whether the time is better spent redesigning our MySQL database and replication scheme, or pushing mnesia's limits (we use mnesia anyway for other, smaller tables, so having a single tool would be nice). Ulf, could you elaborate on what you mean by "favourable access patterns"? Is there actually anyone out there using mnesia in the 100GB range? Regards, Dominic Williams http://dominicwilliams.net ---- From rvirding@REDACTED Tue Dec 11 23:58:21 2007 From: rvirding@REDACTED (Robert Virding) Date: Tue, 11 Dec 2007 23:58:21 +0100 Subject: [erlang-questions] idea: Erlang FFI: callbacks and memory management In-Reply-To: <1197382905.6124.90.camel@gnatziu.crs4.it> References: <62F3426C-094F-4A61-9E15-496B7AC3E069@gmail.com> <1197382905.6124.90.camel@gnatziu.crs4.it> Message-ID: <3dbc6d1c0712111458j637b086cte7ef82b06b6b1d45@mail.gmail.com> On 11/12/2007, Alceste Scalas wrote: > > Il giorno mar, 11/12/2007 alle 13.33 +0100, Kenneth Lundin ha scritto: > > Many C-API's have callback functions. It would be nice if that could > > be handled as well but i am not sure if we can find a generic solution > > for that. > > If there is some way to call an Erlang fun() from C (i.e. from a BIF), > then the problem should be mostly solved: libffi allows to define > "closures", i.e. to dynamically create a native function that wraps a > callback written in the host language. > > I briefly mentioned this possibility some months ago, with examples like > using a C numeric library to integrate a differential equation written > in Erlang. > > However, I was not able to find a way to call a fun() from C. Maybe I > completely missed it: if it's the case, a pointer to the relevant > Erlang/OTP source code would be really helpful... Callbacks! CALLBACKS! Callbacks are the curse of the programming class. They should be avoided at all costs. If you have a callback how do you intend to get data in and out of them? Callbacks can't live without shared data. In which process are they to be evaluated? Everything in Erlang exists within a process. No, the only workable Erlang way is to replace them with messages. Good grief, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From juanjo@REDACTED Tue Dec 11 23:59:36 2007 From: juanjo@REDACTED (Juan Jose Comellas) Date: Tue, 11 Dec 2007 19:59:36 -0300 Subject: [erlang-questions] clarify: why is Mnesia not fit for large databases In-Reply-To: <475F12F9.5000903@dominicwilliams.net> References: <475731E0.3090104@dominicwilliams.net> <2ae2b2da0712052039h114dbc99r7bb1e493e3f89d4a@mail.gmail.com> <4757F31D.8060600@ericsson.com> <475F12F9.5000903@dominicwilliams.net> Message-ID: <1c3be50f0712111459w2fa63889s8301d6de0d529440@mail.gmail.com> This may not be the response you're looking for, but have you tried Postgres? We're using it for a database that's over 100 GB with very good results. On 12/11/07, Dominic Williams wrote: > > Hi, > > Ulf Wiger wrote : > > > Mnesia doesn't, but dets files are currently limited to 2 > > GB per file, and mnesia uses dets files for disc_only > > tables. In a fragmented disc_only table, that would > > amount to max 2 GB per fragment (which is not something > > that mnesia will check or enforce, so living close to > > that limit is inadvisable to say the least). > > Thanks, that confirms my understanding that the 2GB limit > can be overcome with fragmented tables. > > Would monitoring the size of each fragment and raising an > alarm when it approaches the 2GB limit be a simple way to > stay out of trouble? A scheme in which additional fragments > get automatically created does not seem all that hard to > imagine, either... > > > It's reasonable to assume that mnesia can safely handle > > databases of a number of gigabytes, perhaps (tounge in > > cheek) a hundred or so gigabytes, if one thinks > > carefully, and the access patterns are favourable. But I > > don't know of anyone who actually does that, and most > > people who have databases that large tend to not want to > > be guinea pigs. (: > > Right. The reason I ask, though, is that we need the nice > real-time and distributed characteristics of mnesia, and our > current use of MySQL is proving to be a performance > bottleneck and a constant source of operational problems. I > am just trying to decide whether the time is better spent > redesigning our MySQL database and replication scheme, or > pushing mnesia's limits (we use mnesia anyway for other, > smaller tables, so having a single tool would be nice). > > Ulf, could you elaborate on what you mean by "favourable > access patterns"? > > Is there actually anyone out there using mnesia in the 100GB > range? > > Regards, > > Dominic Williams > http://dominicwilliams.net > > ---- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Wed Dec 12 00:15:45 2007 From: erlang@REDACTED (Dominic Williams) Date: Wed, 12 Dec 2007 00:15:45 +0100 Subject: [erlang-questions] clarify: why is Mnesia not fit for large databases In-Reply-To: <1c3be50f0712111459w2fa63889s8301d6de0d529440@mail.gmail.com> References: <475731E0.3090104@dominicwilliams.net> <2ae2b2da0712052039h114dbc99r7bb1e493e3f89d4a@mail.gmail.com> <4757F31D.8060600@ericsson.com> <475F12F9.5000903@dominicwilliams.net> <1c3be50f0712111459w2fa63889s8301d6de0d529440@mail.gmail.com> Message-ID: <475F1A21.1030102@dominicwilliams.net> Hi Juan, > This may not be the response you're looking for, but have > you tried Postgres? We're using it for a database that's > over 100 GB with very good results. Thanks for the feedback. Do you have scalable robust replication? We are going to try Postgres (and others), as well as mnesia. The reason for my post was to accelerate the mnesia exploration, by having hints as to: a) what problems to look out for in mnesia b) how to solve them Regards, Dominic Williams http://dominicwilliams.net ---- From erlang@REDACTED Wed Dec 12 00:31:23 2007 From: erlang@REDACTED (Dominic Williams) Date: Wed, 12 Dec 2007 00:31:23 +0100 Subject: [erlang-questions] clarify: are EEPs also for libraries and also for the OTP team? Message-ID: <475F1DCB.2050105@dominicwilliams.net> Hi, The recent EEP suggestion for a gen_stream made me wonder whether EEP's were intended to be used for the language only or also for libraries. EEP 1 says: "describing a new feature for Erlang or its processes or environment", and "The final implementation must include test code and documentation appropriate for either the Erlang language reference or the standard library reference", but there have not been any previous EEPs for the libraries. I also am under the impression that the OTP team is making many additions and changes to the language and libraries (most of them great, that's besides the point) without going through EEPs. I attended the EUC'06 meeting which initiated EEP's, and seem to remember that the intention was for the OTP team to use the same process, to gather community feedback before introducing changes. Regards, Dominic Williams http://dominicwilliams.net ---- From bob@REDACTED Wed Dec 12 00:58:07 2007 From: bob@REDACTED (Bob Ippolito) Date: Tue, 11 Dec 2007 15:58:07 -0800 Subject: [erlang-questions] pre-EEP: accurate float printing (replacement for io_lib_format:fwrite_g/1) In-Reply-To: <3dbc6d1c0712111440q60679e3fla102e89a3075296d@mail.gmail.com> References: <6a36e7290712101340n610c9f1cud828da66c9929bad@mail.gmail.com> <20071211080906.GA14875@erix.ericsson.se> <6a36e7290712110043j696da319n91ed647b310538a4@mail.gmail.com> <3dbc6d1c0712111440q60679e3fla102e89a3075296d@mail.gmail.com> Message-ID: <6a36e7290712111558l20e8e412id3a1c2f3c2e88a89@mail.gmail.com> On 12/11/07, Robert Virding wrote: > On 11 Dec 2007 10:10:48 +0100, Bjorn Gustavsson > wrote: > > "Bob Ippolito" writes: > > > > > ~g with no precision specification (io_lib_format:fwrite_g/1) is a > > > perfect target and it hits every use the shell has, ~f and ~e I don't > > > care about. Having yet another float format would be completely stupid > > > and confusing to anyone that doesn't know the back story for why > > > supposed backward compatibility required the need for another format. > > > Other languages have undergone this type of change with no ill effects > > > that I've heard of (e.g. TCL did this in 2003 [1]). > > > > I agree. If there are no compatibility problems *in practice*, we > > should simply make the change. > > I agree, we should change if no real problems are found. What I don't > understand is why just have it for ~g with no precision and not for all > cases of ~g, ~f and ~e? They are really just shifting the decimal dot and > fixing the exponent. The current implementation does what ~g does: if there's going to be a lot of zeros, then it switches to ~e, otherwise it's ~f. We only really care about ~g (if it's implemented with this algorithm, with no explicit precision specification) because our use cases are the shell and accurate and compact text serialization (JSON specifically). 1> mochinum:digits(0.1). "0.1" 2> mochinum:digits(0.0000001). "1.0e-7" 3> mochinum:digits(1.0000005). "1.0000005" 4> 0.1. 0.100000 5> 0.0000001. 1.00000e-7 6> 1.0000005. 1.00000 -bob From paul-trapexit@REDACTED Wed Dec 12 01:29:26 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Tue, 11 Dec 2007 16:29:26 -0800 (PST) Subject: [erlang-questions] how: mnesia with simultaneous permanent node failure (EC2) In-Reply-To: References: Message-ID: in order to get my disaster recovery situation managed on EC2, i went ahead and wrote mnesia_schema:del_table_copies/2, which allows one to remove multiple tables in one operation. attached are the patches to mnesia_schema.erl and mnesia_dumper.erl (also, to be pleasant should these concepts be accepted, mnesia.erl should be patched so that mnesia:del_table_copies/2 exists, but the meat is here). also attached are the original script indicating "2 out of 3" node failure where recovery was not possible, and a new script demonstrating the use of the new call. i'm not an mnesia expert so for all i know this is a really bad idea for reasons i'm not seeing at the moment. therefore, any input from mnesia gurus would be greatly appreciated. thanks, -- p On Sat, 1 Dec 2007, Paul Mineiro wrote: > hi. > > i'm thinking about using mnesia on EC2, but i'm having problems figuring > out disaster recovery. > > some background: on EC2, you can start as many machines (instances) as you > like. if you lose one, you can start another, but it'll have a different > hostname. when you lose an instance, you lose whatever was stored on the > drive. > > i was trying to figure out what i would do with a distributed mnesia > database when i lost a node. i came up with a procedure based upon > mnesia:del_table_copy/2 of the schema on the lost node which seems to work > (attached as test-disaster-one). > > however when i tried to apply the procedure to simultaneous loss of two > nodes, i ran into a problem; calling mnesia:del_table_copy/2 of schema > requires all other nodes to be active, and is this scenario i have lost > two nodes simultaneously (attached as test-disaster-two). > > any input from mnesia gurus would be greatly appreciated. > > thanks, > > -- p > > Optimism is an essential ingredient of innovation. How else can the > individual favor change over security? > > -- Robert Noyce Optimism is an essential ingredient of innovation. How else can the individual favor change over security? -- Robert Noyce -------------- next part -------------- #! /bin/sh # This script is intended to simulate loss and recovery of two # EC2 nodes out of a pool of three # # Recovery is attempted by: # 1. calling mnesia_schema:del_table_copies (schema, [LostNodes]) when the node dies # 2. deleting the mnesia directory on the lost node (with EC2, this is # automatic, as there is no persistent disk) # 3. restarting the node # 4. calling mnesia:add_table_copy (TableName, RecoveredNode) to reinstall # tables rm -rf Mnesia*flassy* rm -rf Mnesia*turgy* rm -rf Mnesia*warezy* # first we start three nodes and get them running the same mnesia schema erl -nostick -pa ../src -setcookie mega -sname flassy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' -s erlang halt & erl -nostick -pa ../src -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), Pid = rpc:call (list_to_atom ("flassy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt erl -nostick -pa ../src -setcookie mega -sname turgy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), "turgy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' -s erlang halt & erl -nostick -pa ../src -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), Pid = rpc:call (list_to_atom ("turgy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt erl -nostick -pa ../src -setcookie mega -sname warezy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), "warezy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), { atomic, ok } = mnesia:create_table (flass, [ { disc_copies, [ list_to_atom ("flassy@" ++ Host), list_to_atom ("turgy@" ++ Host), list_to_atom ("warezy@" ++ Host) ] } ]), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' -s erlang halt & erl -nostick -pa ../src -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("warezy@" ++ Host)), Pid = rpc:call (list_to_atom ("warezy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt # now kill flassy and turgy and remove them from the schema erl -nostick -pa ../src -setcookie mega -sname killah -noshell -noinput -eval ' "killah@" ++ Host = atom_to_list (node ()), rpc:call (list_to_atom ("flassy@" ++ Host), erlang, halt, []), rpc:call (list_to_atom ("turgy@" ++ Host), erlang, halt, []), { atomic, ok } = rpc:call (list_to_atom ("warezy@" ++ Host), mnesia_schema, del_table_copies, [ schema, [ list_to_atom ("flassy@" ++ Host), list_to_atom ("turgy@" ++ Host) ] ]) ' -s erlang halt rm -rf Mnesia*flassy* rm -rf Mnesia*turgy* # now restart turgy erl -nostick -pa ../src -setcookie mega -sname turgy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), "turgy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("warezy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), { atomic, ok } = mnesia:add_table_copy (flass, node (), ram_copies), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' -s erlang halt & erl -nostick -pa ../src -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), Pid = rpc:call (list_to_atom ("turgy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt # now restart flassy erl -nostick -pa ../src -setcookie mega -sname flassy -s mnesia -noshell -noinput -eval ' "flassy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), pong = net_adm:ping (list_to_atom ("warezy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), { atomic, ok } = mnesia:add_table_copy (flass, node (), ram_copies), mnesia:system_info () ' -s erlang halt erl -nostick -pa ../src -setcookie mega -sname killah -noshell -noinput -eval ' "killah@" ++ Host = atom_to_list (node ()), rpc:call (list_to_atom ("flassy@" ++ Host), erlang, halt, []), rpc:call (list_to_atom ("turgy@" ++ Host), erlang, halt, []), rpc:call (list_to_atom ("warezy@" ++ Host), erlang, halt, []) ' -s erlang halt rm -rf Mnesia*flassy* rm -rf Mnesia*turgy* rm -rf Mnesia*warezy* -------------- next part -------------- #! /bin/sh # This script is intended to simulate loss and recovery of two # EC2 nodes out of a pool of three # # Recovery is attempted by: # 1. calling mnesia:del_table_copy (schema, LostNode) when the node dies # 2. deleting the mnesia directory on the lost node (with EC2, this is # automatic, as there is no persistent disk) # 3. restarting the node # 4. calling mnesia:add_table_copy (TableName, RecoveredNode) to reinstall # tables # # Unfortunately this fails because the simultaneous failure means that # step 1. is not allowed because # "All replicas on diskfull nodes are not active yet" rm -rf Mnesia*flassy* rm -rf Mnesia*turgy* rm -rf Mnesia*warezy* # first we start three nodes and get them running the same mnesia schema erl -setcookie mega -sname flassy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' -s erlang halt & erl -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), Pid = rpc:call (list_to_atom ("flassy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt erl -setcookie mega -sname turgy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), "turgy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' -s erlang halt & erl -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), Pid = rpc:call (list_to_atom ("turgy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt erl -setcookie mega -sname warezy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), "warezy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), { atomic, ok } = mnesia:create_table (flass, [ { disc_copies, [ list_to_atom ("flassy@" ++ Host), list_to_atom ("turgy@" ++ Host), list_to_atom ("warezy@" ++ Host) ] } ]), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' -s erlang halt & erl -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("warezy@" ++ Host)), Pid = rpc:call (list_to_atom ("warezy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt # now kill flassy and turgy and remove them from the schema erl -setcookie mega -sname killah -noshell -noinput -eval ' "killah@" ++ Host = atom_to_list (node ()), rpc:call (list_to_atom ("flassy@" ++ Host), erlang, halt, []), rpc:call (list_to_atom ("turgy@" ++ Host), erlang, halt, []), { atomic, ok } = rpc:call (list_to_atom ("warezy@" ++ Host), mnesia, del_table_copy, [ schema, list_to_atom ("flassy@" ++ Host) ]), { atomic, ok } = rpc:call (list_to_atom ("warezy@" ++ Host), mnesia, del_table_copy, [ schema, list_to_atom ("turgy@" ++ Host) ]) ' -s erlang halt rm -rf Mnesia*flassy* rm -rf Mnesia*turgy* # now restart turgy erl -setcookie mega -sname turgy -s mnesia -noshell -noinput -eval ' true = register (hello, self ()), "turgy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("flassy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), receive { From, ruthere } -> From ! imok end, receive after infinity -> ok end ' -s erlang halt & erl -setcookie mega -sname wazzup -noshell -noinput -eval ' receive after 1000 -> ok end, "wazzup@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), Pid = rpc:call (list_to_atom ("turgy@" ++ Host), erlang, whereis, [ hello ]), Pid ! { self (), ruthere }, receive imok -> ok end ' -s erlang halt # now restart flassy erl -setcookie mega -sname flassy -s mnesia -noshell -noinput -eval ' "flassy@" ++ Host = atom_to_list (node ()), pong = net_adm:ping (list_to_atom ("turgy@" ++ Host)), pong = net_adm:ping (list_to_atom ("warezy@" ++ Host)), { ok, _ } = mnesia:change_config (extra_db_nodes, erlang:nodes ()), { atomic, ok } = mnesia:change_table_copy_type (schema, node (), disc_copies), { atomic, ok } = mnesia:add_table_copy (flass, node (), ram_copies), mnesia:system_info () ' -s erlang halt erl -setcookie mega -sname killah -noshell -noinput -eval ' "killah@" ++ Host = atom_to_list (node ()), rpc:call (list_to_atom ("flassy@" ++ Host), erlang, halt, []), rpc:call (list_to_atom ("turgy@" ++ Host), erlang, halt, []), rpc:call (list_to_atom ("warezy@" ++ Host), erlang, halt, []) ' -s erlang halt rm -rf Mnesia*flassy* rm -rf Mnesia*turgy* rm -rf Mnesia*warezy* -------------- next part -------------- --- /sw/lib/erlang/lib/mnesia-4.3.5/src/mnesia_dumper.erl 2007-06-11 04:31:23.000000000 -0700 +++ mnesia_dumper.erl 2007-12-11 16:16:26.000000000 -0800 @@ -41,7 +41,7 @@ %% Internal stuff -export([regulator_init/1]). --include("mnesia.hrl"). +-include_lib("mnesia/src/mnesia.hrl"). -include_lib("kernel/include/file.hrl"). -import(mnesia_lib, [fatal/2, dbg_out/2]). @@ -826,6 +826,16 @@ end end; +insert_op(Tid, _, {op, del_table_copies, NStorList, TabDef}, InPlace, InitBy) -> + lists:foreach(fun({Node, Storage}) -> + insert_op(Tid, + void, + {op, del_table_copy, Storage, Node, TabDef}, + InPlace, + InitBy) + end, + NStorList); + insert_op(Tid, _, {op, add_table_copy, _Storage, _Node, TabDef}, InPlace, InitBy) -> %% During prepare commit, the files was created %% and the replica was announced -------------- next part -------------- --- mnesia-4.3.5/src/mnesia_schema.erl.orig 2007-03-27 06:37:32.000000000 -0700 +++ mnesia-4.3.5/src/mnesia_schema.erl 2007-11-19 11:21:04.000000000 -0800 @@ -2462,7 +2462,7 @@ InitR = #r{opaque = Opaque, module = Module}, case catch lists:foldl(fun check_restore_arg/2, InitR, Args) of R when record(R, r) -> - case mnesia_bup:read_schema(Module, Opaque) of + case mnesia_bup:read_schema(R#r.module, Opaque) of {error, Reason} -> {aborted, Reason}; BupSchema -> From paul-trapexit@REDACTED Wed Dec 12 01:31:43 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Tue, 11 Dec 2007 16:31:43 -0800 (PST) Subject: [erlang-questions] how: mnesia with simultaneous permanent node failure (EC2) In-Reply-To: References: Message-ID: sorry, wrong mnesia_schema.patch attached to the last message. correct one here. -- p On Tue, 11 Dec 2007, Paul Mineiro wrote: > in order to get my disaster recovery situation managed on EC2, i went > ahead and wrote mnesia_schema:del_table_copies/2, which allows one to > remove multiple tables in one operation. > > attached are the patches to mnesia_schema.erl and mnesia_dumper.erl (also, > to be pleasant should these concepts be accepted, mnesia.erl should be > patched so that mnesia:del_table_copies/2 exists, but the meat is here). > > also attached are the original script indicating "2 out of 3" node failure > where recovery was not possible, and a new script demonstrating the use of > the new call. > > i'm not an mnesia expert so for all i know this is a really bad idea for > reasons i'm not seeing at the moment. therefore, any input from mnesia > gurus would be greatly appreciated. > > thanks, > > -- p > > On Sat, 1 Dec 2007, Paul Mineiro wrote: > > > hi. > > > > i'm thinking about using mnesia on EC2, but i'm having problems figuring > > out disaster recovery. > > > > some background: on EC2, you can start as many machines (instances) as you > > like. if you lose one, you can start another, but it'll have a different > > hostname. when you lose an instance, you lose whatever was stored on the > > drive. > > > > i was trying to figure out what i would do with a distributed mnesia > > database when i lost a node. i came up with a procedure based upon > > mnesia:del_table_copy/2 of the schema on the lost node which seems to work > > (attached as test-disaster-one). > > > > however when i tried to apply the procedure to simultaneous loss of two > > nodes, i ran into a problem; calling mnesia:del_table_copy/2 of schema > > requires all other nodes to be active, and is this scenario i have lost > > two nodes simultaneously (attached as test-disaster-two). > > > > any input from mnesia gurus would be greatly appreciated. > > > > thanks, > > > > -- p > > > > Optimism is an essential ingredient of innovation. How else can the > > individual favor change over security? > > > > -- Robert Noyce > > Optimism is an essential ingredient of innovation. How else can the > individual favor change over security? > > -- Robert Noyce Optimism is an essential ingredient of innovation. How else can the individual favor change over security? -- Robert Noyce -------------- next part -------------- --- /sw/lib/erlang/lib/mnesia-4.3.5/src/mnesia_schema.erl 2007-03-27 06:37:32.000000000 -0700 +++ mnesia_schema.erl 2007-12-11 16:20:30.000000000 -0800 @@ -40,6 +40,7 @@ cs2list/1, del_snmp/1, del_table_copy/2, + del_table_copies/2, del_table_index/2, delete_cstruct/2, delete_schema/1, @@ -104,7 +105,7 @@ do_delete_table_property/2, do_write_table_property/2]). --include("mnesia.hrl"). +-include_lib("mnesia/src/mnesia.hrl"). -include_lib("kernel/include/file.hrl"). -import(mnesia_lib, [set/2, del/2, verbose/2, dbg_out/2]). @@ -1214,6 +1215,86 @@ end end. +del_table_copies(Tab, Ns) when is_list(Ns), Ns /= [] -> + schema_transaction(fun() -> + do_del_table_copies(Tab, Ns) + end). + +do_del_table_copies(Tab, Ns) -> + TidTs = get_tid_ts_and_lock(schema, write), + insert_schema_ops(TidTs, make_del_table_copies(Tab, Ns)). + +make_del_table_copies(Tab, Ns) -> + ensure_writable(schema), + Cs = incr_version(val({Tab, cstruct})), + NStorList = [{Node, mnesia_lib:schema_cs_to_storage_type(Node, Cs)} + || Node <- Ns ], + Cs2 = lists:foldl(fun({Node, Storage}, Acc) -> + new_cs(Acc, Node, Storage, del) + end, + Cs, + NStorList), + case mnesia_lib:cs_to_nodes(Cs2) of + [] when Tab == schema -> + mnesia:abort({combine_error, Tab, "Last replica"}); + [] -> + ensure_active(Cs), + dbg_out("Last replica deleted in table ~p~n", [Tab]), + make_delete_table(Tab, whole_table); + _ when Tab == schema -> + ensure_active(Cs2), + lists:foreach(fun(Node) -> ensure_not_active(Tab, Node) end, Ns), + verify_cstruct(Cs2), + Ops = remove_nodes_from_tabs(val({schema, tables}), NStorList), + [{op, del_table_copies, [{N,ram_copies} || N<-Ns], cs2list (Cs2)} | Ops]; + _ -> + ensure_active(Cs), + verify_cstruct(Cs2), + [{op, del_table_copies, NStorList, cs2list(Cs2)}] + end. + +remove_nodes_from_tabs([], _NStorList) -> + []; +remove_nodes_from_tabs([schema|Rest], NStorList) -> + remove_nodes_from_tabs(Rest, NStorList); +remove_nodes_from_tabs([Tab|Rest], NStorList) -> + {Cs, IsFragModified} = + lists:foldl(fun({Node, _}, {AccCs, AccIsFragModified}) -> + {NewCs, NewFM} = mnesia_frag:remove_node(Node, + AccCs), + {NewCs, NewFM or AccIsFragModified} + end, + {incr_version(val({Tab, cstruct})), false}, + NStorList), + + case lists:any (fun ({ _, X }) -> X =/= unknown end, NStorList) of + false -> + case IsFragModified of + true -> + [{op, change_table_frag, {del_node, N}, cs2list(Cs)} || + {N, _} <- NStorList] ++ + remove_nodes_from_tabs(Rest, NStorList); + false -> + remove_nodes_from_tabs(Rest, NStorList) + end; + true -> + Cs2 = lists:foldl(fun({_, unknown}, Acc) -> Acc; + ({Node, Storage}, Acc) -> + new_cs(Acc, Node, Storage, del) + end, + Cs, + NStorList), + case mnesia_lib:cs_to_nodes(Cs2) of + [] -> + [{op, delete_table, cs2list(Cs)} | + remove_nodes_from_tabs(Rest, NStorList)]; + _Ns -> + verify_cstruct(Cs2), + [{op, del_table_copies, NStorList, cs2list(Cs2)}| + remove_nodes_from_tabs(Rest, NStorList)] + end + end. + new_cs(Cs, Node, ram_copies, add) -> Cs#cstruct{ram_copies = opt_add(Node, Cs#cstruct.ram_copies)}; new_cs(Cs, Node, disc_copies, add) -> @@ -1226,7 +1307,7 @@ Cs#cstruct{disc_copies = lists:delete(Node , Cs#cstruct.disc_copies)}; new_cs(Cs, Node, disc_only_copies, del) -> Cs#cstruct{disc_only_copies = - lists:delete(Node , Cs#cstruct.disc_only_copies)}; + lists:delete(Node , Cs#cstruct.disc_only_copies)}; new_cs(Cs, _Node, Storage, _Op) -> mnesia:abort({badarg, Cs#cstruct.name, Storage}). @@ -1865,6 +1946,29 @@ {true, optional} end; +prepare_op(Tid, {op, del_table_copies, NStorList, TabDef}, _WaitFor) -> + Cs = list2cs(TabDef), + Tab = Cs#cstruct.name, + + if + %% Schema table lock is always required to run a schema op. + %% No need to look it. + node(Tid#tid.pid) == node(), Tab /= schema -> + Self = self(), + Pid = spawn_link(fun() -> lock_del_table(Tab, [N || {N,_}<-NStorList], Cs, Self) end), + put(mnesia_lock, Pid), + receive + {Pid, updated} -> + {true, optional}; + {Pid, FailReason} -> + mnesia:abort(FailReason); + {'EXIT', Pid, Reason} -> + mnesia:abort(Reason) + end; + true -> + {true, optional} + end; + prepare_op(_Tid, {op, change_table_copy_type, N, FromS, ToS, TabDef}, _WaitFor) when N == node() -> Cs = list2cs(TabDef), @@ -2108,7 +2212,21 @@ unlink(whereis(mnesia_tm)), exit(normal). -set_where_to_read(Tab, Node, Cs) -> +set_where_to_read(Tab, NodeList, Cs) when is_list(NodeList) -> + case lists:member(mnesia_lib:val({Tab, where_to_read}), NodeList) of + true -> + case Cs#cstruct.local_content of + true -> + ok; + false -> + mnesia_lib:set_remote_where_to_read(Tab, NodeList), + ok + end; + _ -> + ok + end; + +set_where_to_read(Tab, Node, Cs) when is_atom(Node) -> case mnesia_lib:val({Tab, where_to_read}) of Node -> case Cs#cstruct.local_content of @@ -2264,6 +2382,16 @@ Tab = Cs#cstruct.name, mnesia_lib:set({Tab, where_to_read}, Node); +undo_prepare_op(_Tid, {op, del_table_copies, NStorList, TabDef}) -> + case lists:member (node (), [N || {N,_} <- NStorList]) of + true -> + Cs = list2cs(TabDef), + Tab = Cs#cstruct.name, + mnesia_lib:set({Tab, where_to_read}, node ()); + false -> + ok + end; + undo_prepare_op(_Tid, {op, change_table_copy_type, N, FromS, ToS, TabDef}) when N == node() -> From masterofquestions@REDACTED Wed Dec 12 02:59:41 2007 From: masterofquestions@REDACTED (Russell King) Date: Tue, 11 Dec 2007 20:59:41 -0500 Subject: [erlang-questions] ETS Multiple Choice Question Message-ID: <1218d6a50712111759o64b15b12je9a39849052a475c@mail.gmail.com> According to docs, "This module provides very limited support for concurrent updates. No locking is available." Does ets do: a) table level lock b) or record level lock c) or neither? What is the answer a,b or c? My undergrad spider sense telling me to always pick C, if you are not sure ;). thank you in advance. Russ -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.hinde@REDACTED Wed Dec 12 03:17:33 2007 From: sean.hinde@REDACTED (Sean Hinde) Date: Wed, 12 Dec 2007 02:17:33 +0000 Subject: [erlang-questions] ETS Multiple Choice Question In-Reply-To: <1218d6a50712111759o64b15b12je9a39849052a475c@mail.gmail.com> References: <1218d6a50712111759o64b15b12je9a39849052a475c@mail.gmail.com> Message-ID: <795DD7B8-8D14-40F9-9148-DB72A0AB1D38@gmail.com> No locking is available in ets. Limited support means that a single read or write will succeed without being corrupted by another concurrent read/write. If you want locking across mutiple read/writes then look at mnesia Sean On 12 Dec 2007, at 01:59, Russell King wrote: > According to docs, "This module provides very limited support for > concurrent updates. No locking is available." > > Does ets do: > > a) table level lock > b) or record level lock > c) or neither? > > What is the answer a,b or c? > > My undergrad spider sense telling me to always pick C, if you are > not sure ;). > thank you in advance. > Russ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From jeffm@REDACTED Wed Dec 12 03:29:42 2007 From: jeffm@REDACTED (jm) Date: Wed, 12 Dec 2007 13:29:42 +1100 Subject: [erlang-questions] clarify: Ericsson Erlang vision/strategy In-Reply-To: <106812.61323.qm@web38804.mail.mud.yahoo.com> References: <106812.61323.qm@web38804.mail.mud.yahoo.com> Message-ID: <475F4796.3060300@ghostgun.com> Thomas Lindgren wrote: > --- Andreas Hillqvist > wrote: > >> Telecom is moving towards Long Term Evolution(LTE), >> where an aimed to >> is to be an all-IP network. >> How dose an Erlang/OTP IP switching product stack up >> against Cisco C++ >> (or what they are using) product? > > Which Erlang/OTP IP switching product are you thinking > about? Though it would be kind of interesting to build > an xorp-style router with an Erlang routing engine. Yes, this sounds interesting to me too. Not being familiar with xorp other than the name and knowing in broad terms what it does though. Jeff. From vlm@REDACTED Wed Dec 12 03:40:20 2007 From: vlm@REDACTED (Lev Walkin) Date: Tue, 11 Dec 2007 18:40:20 -0800 Subject: [erlang-questions] ETS Multiple Choice Question In-Reply-To: <795DD7B8-8D14-40F9-9148-DB72A0AB1D38@gmail.com> References: <1218d6a50712111759o64b15b12je9a39849052a475c@mail.gmail.com> <795DD7B8-8D14-40F9-9148-DB72A0AB1D38@gmail.com> Message-ID: <475F4A14.8000408@lionet.info> Sean Hinde wrote: > No locking is available in ets. > > Limited support means that a single read or write will succeed without > being corrupted by another concurrent read/write. If you want locking > across mutiple read/writes then look at mnesia What about write in the middle of foldr? > Sean > > On 12 Dec 2007, at 01:59, Russell King wrote: > >> According to docs, "This module provides very limited support for >> concurrent updates. No locking is available." >> >> Does ets do: >> >> a) table level lock >> b) or record level lock >> c) or neither? >> >> What is the answer a,b or c? >> >> My undergrad spider sense telling me to always pick C, if you are >> not sure ;). >> thank you in advance. >> Russ >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From bjorn@REDACTED Wed Dec 12 06:51:24 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 12 Dec 2007 06:51:24 +0100 Subject: [erlang-questions] ETS Multiple Choice Question In-Reply-To: <475F4A14.8000408@lionet.info> References: <1218d6a50712111759o64b15b12je9a39849052a475c@mail.gmail.com> <795DD7B8-8D14-40F9-9148-DB72A0AB1D38@gmail.com> <475F4A14.8000408@lionet.info> Message-ID: Lev Walkin writes: > Sean Hinde wrote: > > No locking is available in ets. > > > > Limited support means that a single read or write will succeed without > > being corrupted by another concurrent read/write. If you want locking > > across mutiple read/writes then look at mnesia > > What about write in the middle of foldr? We have updated the documentation in R12B to make that clearer: "If Function inserts objects into the table, or another process inserts objects into the table, those objects *may* (depending on key ordering) be included in the traversal." /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bengt.kleberg@REDACTED Wed Dec 12 08:04:45 2007 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 12 Dec 2007 08:04:45 +0100 Subject: [erlang-questions] benchmarks game harsh criticism In-Reply-To: References: <339019.46701.qm@web60518.mail.yahoo.com> <475EB8F5.6020604@ericsson.com> Message-ID: <475F880D.3030209@ericsson.com> i apologise to the erlang community. had i know a better way to handle the situation i would have used it. bengt Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." On 12/11/07 17:38, Sean Hinde wrote: > Please, please give it a rest. Enough. Stop. Cease. Desist. > > This is doing more to damage the reputation of the Erlang community than > any benefit that might be gained from whatever it is you are writing > about. Go away! > > Sean > > On 11 Dec 2007, at 16:21, Bengt Kleberg wrote: > >> greetings, >> >> it is good that you always think about the legalities involved in email >> discussions. not many people do. it would be better if you thought about >> how to communicate in email discussions, too. >> >> some things that helps communication: what is the goal you have in mind >> when you send an email? if the receiver knows where the discussion is >> heading it will help. try to write clearly, not cleverly. if possible, >> be nice. avoid rhetorical questions that are thinly veiled threats. >> bullying people will make them shut up, but not change their mind. give >> a context to your questions. do not insinuate that your reader is an >> idiot. that either adds to the confusion or creates bad will. explain a >> lot since mind reading never works. >> >> take your last email as an example. it probably says that you do not >> like a personal attack, only not directly. but what is it that you do >> not like? is it to be reminded of a mistake? or that your perfectly >> legal and very well crafted writing is called brutal? i do not know and >> if you want me to know, then communication could fix that. >> >> if you do not want me to know, then the simplest way is to avoid writing >> anything at all. >> >> >> bengt >> >> Those were the days... >> EPO guidelines 1978: "If the contribution to the known art resides >> solely in a computer program then the subject matter is not >> patentable in whatever manner it may be presented in the claims." >> >> >> On 12/07/07 19:08, Isaac Gouy wrote: >>> Please consider whether making a personal attack is an appropriate use >>> of this mailing list or of your employers email service. >>> >>> I provided a link to the benchmarks game public discussion forum - >>> please understand that personal attacks will not be welcomed there. >>> >>> There's nothing more for me to say. >>> >>> >>> --- Bengt Kleberg wrote: >>> >>>> greetings, >>>> >>>> as for losing audience i hope that my suggestion at the start of this >>>> >>>> discussion (''do not read this'') was followed by as many as >>>> possible. >>>> having experienced isaac some 2-3 years ago (that time was much worse >>>> >>>> since i was unprepared) i expected something like this and thus >>>> offered >>>> the warning. >>>> >>>> >>>> taking this from the mail list is a good idea in theory. >>>> >>>> it was my first reaction when things turned ugly all those years ago. >>>> >>>> unfortunately isaac took the private email i sent him, chopped it >>>> into >>>> little pieces, removing things like explanations, smilies, etc. he >>>> then >>>> posted these pieces as straw man arguments on the mail list. using >>>> his >>>> normal acerbic tone, he proceeded smashing them to dust. >>>> >>>> i sent another private email explaining that he had hurt me, asking >>>> him >>>> to stop doing such things, and giving me an apology. his (private) >>>> answer was much more brutal than his mail list postings, the point >>>> being >>>> that his act was not illegal and he would never apologise. finally he >>>> >>>> wrote that we should never send private email to each other again. >>>> >>>> so in practice i am not taking this off-line even though it would be >>>> a >>>> nice thing for this list. >>>> >>>> >>>> bengt >>> >>> >>> >>> ____________________________________________________________________________________ >>> >>> Never miss a thing. Make Yahoo your home page. >>> http://www.yahoo.com/r/hs >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://www.erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > From ulf.wiger@REDACTED Wed Dec 12 08:35:04 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Wed, 12 Dec 2007 08:35:04 +0100 Subject: [erlang-questions] how: mnesia with simultaneous permanent node failure (EC2) In-Reply-To: References: Message-ID: <475F8F28.8010807@ericsson.com> Paul Mineiro skrev: > in order to get my disaster recovery situation managed on EC2, i went > ahead and wrote mnesia_schema:del_table_copies/2, which allows one to > remove multiple tables in one operation. [...] >> >> i'm thinking about using mnesia on EC2, but i'm having problems figuring >> out disaster recovery. >> >> some background: on EC2, you can start as many machines (instances) as you >> like. if you lose one, you can start another, but it'll have a different >> hostname. when you lose an instance, you lose whatever was stored on the >> drive. What if mnesia were equipped with a node name abstraction layer, and you could simply tell it which physical node corresponds to a given abstract node? This would also make it unnecessary to explicitly traverse backups in order to migrate a mnesia database from one machine to another; you'd simply re-map the abstract node name instead. BR, Ulf W From alceste@REDACTED Wed Dec 12 11:13:37 2007 From: alceste@REDACTED (Alceste Scalas) Date: Wed, 12 Dec 2007 11:13:37 +0100 Subject: [erlang-questions] idea: Erlang FFI: callbacks and memory management In-Reply-To: <3dbc6d1c0712111458j637b086cte7ef82b06b6b1d45@mail.gmail.com> References: <62F3426C-094F-4A61-9E15-496B7AC3E069@gmail.com> <1197382905.6124.90.camel@gnatziu.crs4.it> <3dbc6d1c0712111458j637b086cte7ef82b06b6b1d45@mail.gmail.com> Message-ID: <1197454417.6124.157.camel@gnatziu.crs4.it> Il giorno mar, 11/12/2007 alle 23.58 +0100, Robert Virding ha scritto: > On 11/12/2007, Alceste Scalas wrote: > Il giorno mar, 11/12/2007 alle 13.33 +0100, Kenneth Lundin ha > scritto: > > Many C-API's have callback functions. It would be nice if > that > could be handled as well but i am not sure if we can > find a > > generic solution for that. > > If there is some way to call an Erlang fun() from C (i.e. from > a BIF), then the problem should be mostly solved: libffi > allows to define "closures", i.e. to dynamically create a > native function that wraps a callback written in the host > language. [...] > > Callbacks! CALLBACKS! Callbacks are the curse of the programming > class. They should be avoided at all costs. > > If you have a callback how do you intend to get data in and out of > them? Callbacks can't live without shared data. It depends. In the numerical integration example I provided, the callback return value simply depends on its arguments (i.e. the current time and value). If something else is needed, it may be enclosed when the callback fun() itself is defined. > In which process are they to be evaluated? Everything in Erlang > exists within a process. I think it depends on my previous questions: is it possible to execute an Erlang fun() from within a BIF, and get its return term? How? Without an answer, all the callback discussion will remain quite abstract (IMHO). Anyway, I think I could make one reasonable hypothesis: An Erlang callback is evaluated in the same process that performs the FFI call that causes the callback invocation. If a library binding supports callbacks, and adds layers over low-level FFI calls, then its documentation should explain in which processes the callbacks are executed. > No, the only workable Erlang way is to replace them with messages. I don't get how it would work in practice, at least in the FFI scenario. Since callbacks would be executed in "FFI context", i.e. from within a BIF that cannot be preempted by the Erlang VM, they should *never* perform blocking operations (e.g. wait for messages). Final note (just for clarity): linked-in drivers and FFI calls are *not* mutually exclusive at all. You can develop a C library binding that, internally, opens a .so file and uses erlang:port_control/3 when needed, and performs FFI calls when it reduces the amount of glue code. Thus, if messaging and threading are required, the good ol' linked-in driver API would be still available. Regards, alceste -- Alceste Scalas CRS4 - http://www.crs4.it/ From thomasl_erlang@REDACTED Wed Dec 12 09:37:14 2007 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 12 Dec 2007 00:37:14 -0800 (PST) Subject: [erlang-questions] clarify: Ericsson Erlang vision/strategy In-Reply-To: <475F4796.3060300@ghostgun.com> Message-ID: <670038.60778.qm@web38815.mail.mud.yahoo.com> --- jm wrote: > Thomas Lindgren wrote: > > Though it would be kind of interesting to > build > > an xorp-style router with an Erlang routing > engine. > > Yes, this sounds interesting to me too. Not being > familiar with xorp > other than the name and knowing in broad terms what > it does though. As I understand it, xorp at its core is a routing engine that processes BGP and other routing protocols and directs/configures a collection of forwarding engines. So, as I see it, use the same forwarding engines and write the BGP/... and upper-half control stuff in Erlang. Best, Thomas ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping From joelr1@REDACTED Wed Dec 12 11:33:01 2007 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 12 Dec 2007 10:33:01 +0000 Subject: [erlang-questions] idea: Erlang FFI: callbacks and memory management In-Reply-To: <1197454417.6124.157.camel@gnatziu.crs4.it> References: <62F3426C-094F-4A61-9E15-496B7AC3E069@gmail.com> <1197382905.6124.90.camel@gnatziu.crs4.it> <3dbc6d1c0712111458j637b086cte7ef82b06b6b1d45@mail.gmail.com> <1197454417.6124.157.camel@gnatziu.crs4.it> Message-ID: On Dec 12, 2007, at 10:13 AM, Alceste Scalas wrote: > Anyway, I think I could make one reasonable hypothesis: > > An Erlang callback is evaluated in the same process that > performs the FFI call that causes the callback invocation. This won't work in the context of a Cocoa bridge, for example. Your callback could be called at any point in time and it would be strictly a C to Erlang invocation. -- http://wagerlabs.com From hakan@REDACTED Wed Dec 12 11:41:11 2007 From: hakan@REDACTED (Hakan Mattsson) Date: Wed, 12 Dec 2007 11:41:11 +0100 (CET) Subject: [erlang-questions] ETS Multiple Choice Question In-Reply-To: References: <1218d6a50712111759o64b15b12je9a39849052a475c@mail.gmail.com> <795DD7B8-8D14-40F9-9148-DB72A0AB1D38@gmail.com> <475F4A14.8000408@lionet.info> Message-ID: On Wed, 12 Dec 2007, Bjorn Gustavsson wrote: BG> Lev Walkin writes: BG> BG> > Sean Hinde wrote: BG> > > No locking is available in ets. BG> > > BG> > > Limited support means that a single read or write will succeed without BG> > > being corrupted by another concurrent read/write. If you want locking BG> > > across mutiple read/writes then look at mnesia BG> > BG> > What about write in the middle of foldr? BG> BG> We have updated the documentation in R12B to make that clearer: BG> BG> "If Function inserts objects into the table, or BG> another process inserts objects into the table, those BG> objects *may* (depending on key ordering) be included BG> in the traversal." An undocumented feature of ets foldr/foldl is that they are internally using ets:safe_fixtable/2 to temporarily turn off the automatic rehashing. This means that if you are using other means of iterating over an ets table, the level of unpredictability is even greater if the table grows or shrinks during the iteration. /H?kan From chandrashekhar.mullaparthi@REDACTED Wed Dec 12 11:47:28 2007 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Wed, 12 Dec 2007 10:47:28 +0000 Subject: [erlang-questions] how: mnesia with simultaneous permanent node failure (EC2) In-Reply-To: <475F8F28.8010807@ericsson.com> References: <475F8F28.8010807@ericsson.com> Message-ID: On 12/12/2007, Ulf Wiger (TN/EAB) wrote: > Paul Mineiro skrev: > > in order to get my disaster recovery situation managed on EC2, i went > > ahead and wrote mnesia_schema:del_table_copies/2, which allows one to > > remove multiple tables in one operation. > [...] > >> > >> i'm thinking about using mnesia on EC2, but i'm having problems figuring > >> out disaster recovery. > >> > >> some background: on EC2, you can start as many machines (instances) as you > >> like. if you lose one, you can start another, but it'll have a different > >> hostname. when you lose an instance, you lose whatever was stored on the > >> drive. > > What if mnesia were equipped with a node name abstraction layer, and > you could simply tell it which physical node corresponds to a given > abstract node? > > This would also make it unnecessary to explicitly traverse backups > in order to migrate a mnesia database from one machine to another; > you'd simply re-map the abstract node name instead. > That would be incredibly useful! Chandru From erlang@REDACTED Wed Dec 12 11:58:58 2007 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 12 Dec 2007 11:58:58 +0100 Subject: [erlang-questions] What should go into the FFI chapter of the book In-Reply-To: References: <475E8AD0.5000900@gmail.com> Message-ID: <9b08084c0712120258m3c2ae3bag379bd6690e4d8347@mail.gmail.com> Hi Joel, Another fairly good example of interfacing can be found at http://code.google.com/p/erlycairo/ Interfacing a canvas is somewhat easier than a full blown GUI system - so might be useful for illustrate purposes. /Joe On Dec 11, 2007 2:34 PM, Joel Reymont wrote: > Serge, > > I agree with you on everything you wrote below. This is just the kind > of feedback I love. > > I have also been told that there's work on WxWidgets as a linked-in > driver. > > My focus is to both finish the book quickly and to keep it > informative. This requires a compromise and I suspect that the book > will not look like anything I envisioned in the beginning. > > It may well be that it's better to either describe the WxWidgets > driver than to write a Cocoa bridge for the book. Describing existing > code takes far less time than writing significant new code bases. > WxWidgets is also cross-platform so Windows and Linux users of Erlang > could run it, unlike the Cocoa bridge. > > In the end it may well suffice for me to just elaborate on what you > listed below. There's more than enough content, complexity and value > in doing this. I think I'll try to start down this path and see what > happens. > > Thanks, Joel > > On Dec 11, 2007, at 1:04 PM, Serge Aleynikov wrote: > > > I think it would be useful to cover link-in drivers from the > > following perspective: > > > > 1. C types: ErlDrvData, ErlDrvBinary, ErlIOVec, etc. and how to > > marshal terms to Erlang using these primitives. > > 2. Taking advantage of driver queues. > > 3. Monitoring health of Pids from C, and performing driver shutdown > > or resource cleanup when a Pid dies. > > 4. Highlighting differences between output methods (output, output2, > > outputv). > > 5. Handling events from other sources (driver_select, ready_input, > > ready_output and event callbacks) in the driver. > > 6. When to use ei and when not to. > > > > At least there is currently no in-depth illustrated coverage of > > these subjects and one has to go through a broad trial-and-error > > cycle (at least I know I did :-( ) that keeps the learning curve > > pretty steep before he/she learns these concepts and the mysterious > > veil of driver complexity dissolves. > > > > Serge > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bjorn@REDACTED Wed Dec 12 12:19:02 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 12 Dec 2007 12:19:02 +0100 Subject: [erlang-questions] idea: Erlang FFI: callbacks and memory management In-Reply-To: <1197454417.6124.157.camel@gnatziu.crs4.it> References: <62F3426C-094F-4A61-9E15-496B7AC3E069@gmail.com> <1197382905.6124.90.camel@gnatziu.crs4.it> <3dbc6d1c0712111458j637b086cte7ef82b06b6b1d45@mail.gmail.com> <1197454417.6124.157.camel@gnatziu.crs4.it> Message-ID: Alceste Scalas writes: > I think it depends on my previous questions: is it possible to execute > an Erlang fun() from within a BIF, and get its return term? How? It is currently not possible to execute a fun from a BIF and return to the BIF. There is, however, an internal mechanism to make a tail-recursive call to Erlang code from a BIF. The called Erlang code could in turn make a call to another BIF. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From rickard.s.green@REDACTED Wed Dec 12 13:05:27 2007 From: rickard.s.green@REDACTED (Rickard Green) Date: Wed, 12 Dec 2007 13:05:27 +0100 Subject: [erlang-questions] Source patch for R12B-0 available In-Reply-To: <26B04CE34936014297D381585CCE89B042B451@MTNMAIL1.mtn.co.za> References: <26B04CE34936014297D381585CCE89B042B451@MTNMAIL1.mtn.co.za> Message-ID: <475FCE87.7070507@ericsson.com> It builds fine for me on solaris 10. Are you extracting the tar file with gnu tar? If not, you need to. Instead of using CC I put a script called gcc (similar to yours) in the path and also a script called ld (passing -64 as argument to ld) in the path. I use gcc 3.4.4. BR, Rickard Green, Erlang/OTP, Ericsson AB. Ognian Pantov [ MTN - Innovation Centre ] wrote: > Hi, > > We are having a problem making R12B-0 with the patch on Solaris 10. > We can make and run R12B-0 without the patch on the same machine. See below for details of our environment. > > When we are trying to make R12B-0 with the patch, make hangs when is trying to compile hipe_rtl_arch.erl file. > ********************************************************************************************************* > make[2]: Leaving directory `/export/home/smscproj/install/otp_src_R12B-0/lib/parsetools' > make[2]: Entering directory `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' > make[2]: Nothing to be done for `opt'. > make[2]: Leaving directory `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' > make[2]: Entering directory `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe' > Makefile:35: warning: overriding commands for target `docs' > /export/home/smscproj/install/otp_src_R12B-0/make/otp_subdir.mk:28: warning: ignoring old commands for target `docs' > === Entering application hipe > make[3]: Entering directory `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe/rtl' > /export/home/smscproj/install/otp_src_R12B-0/bin/sparc-sun-solaris2.10/hipe_mkliterals -e > hipe_literals.hrl > erlc -W +debug_info +warn_obsolete_guard +inline -o../ebin hipe_rtl_arch.erl > > !!! We stay here till we kill the process! > ******************************************************************************************************** > The command patch doesn't support -Z option on Solaris (it does on Linux) and we use gpatch instead. > We try to patch the source code on Linux and make on Solaris - the result is the same the process hangs during compilation on hipe_rtl_arch.erl. > > We tryed to compile hipe_rtl_arch.erl manually but environment doesn't seem to be ready yet. > > Any ideas what may cuase this problem? > > Best regards > Ognian > > --------------------------Environment-------------------------------------------- > The make for R12B-0 with and without patch is done on the same machine using the same procedure. > We are using Sun Netra-T2000 running Solaris 10 patch level 125100-05. We use GCC 3.4.6. > > To compile 64 bit code we do: > > cat>/tmp/gcc64 > #!/bin/sh > exec gcc -m64 "$@" > ^D > > chmod +x /tmp/gcc64 > > Every time we make we remove the old otp_src_R12B-0 directory and start from scratch. > > tar -xvf otp_src_R12B-0.tar > gpatch -ZNp0 < otp_src_R12B-0-osp1.patch ( only with patch ) > > env CC=/tmp/gcc64 ./configure --enable-smp-support --prefix=/usr/local/erlang/R12B-0 > make > --------------------------------------------------------------------------------------- > > > -----Original Message----- > From: Kenneth Lundin [mailto:kenneth.lundin@REDACTED] > Sent: Monday, 10 December 2007 02:33 > To: Valentin Micic > Cc: Sean Hinde; Rickard Green; Erlang/OTP discussions; Ognian Pantov [ > MTN - Innovation Centre ]; waynes@REDACTED > Subject: Re: [erlang-questions] Source patch for R12B-0 available > > > Hi, > > Since the combination SMP and 64 bit sparc apparently never has worked > in R11B you can't have any system in service dependent on this patch > do you? > > So if you are planning on using the SMP emulator for the first time in a product > I would really recommend that you put your old policy away and go for R12B. > > The reasons for that are in my opinion many: > - R12B is the most stable version with best performance when it comes > to SMP execution. > R12B is the version where we will have regular service releases with patches and > improvements. > R12B is the version where improvements regarding SMP will appear. > R12B is the version where we may support more platforms. > Bugs found by open source users in R12B AND PREVIOUS releases will be > corrected in R12B-1, 2, ..., etc. > > /Regards Kenneth Erlang/OTP team, Ericsson AB > > On 12/9/07, Valentin Micic wrote: >> May I second what Sean is asking for? >> I would really appreciate a fix for R11B-5 -- we have a policy not to run >> the latest release on production systems, and absence of the patch would >> force us to do so. Make no mistake, I really like what I saw in R12 so far, >> but we'd like to migrate on our own pace. >> Your cooperation will be *highly* appreciated. >> >> Valentin Micic >> Principal Consultant >> PHAROS CONSVLTING (PTY) LTD. >> Cell: +27 83 212 9180 >> >> ----- Original Message ----- >> From: "Sean Hinde" >> To: "Rickard Green" >> Cc: "Erlang/OTP discussions" >> Sent: Sunday, December 09, 2007 1:51 AM >> Subject: Re: [erlang-questions] Source patch for R12B-0 available >> >> >>> Hi Rikard, >>> >>> Do you have any plans to release a patch for those using R11B-5 on 64 >>> bit sparc? I'm thinking mainly of the OTP-7006 issue, initially >>> reported on R11B-5. >>> >>> Thanks, >>> Sean >>> >>> On 7 Dec 2007, at 14:17, Rickard Green wrote: >>> >>>> A patch that fixes the following issues is now available at >>>> http://www.erlang.org/download.html . Instructions for applying >>>> the patch can be found in the patch README. >>>> >>>> BR, >>>> Rickard Green, Erlang/OTP, Ericsson AB. >>>> >>>> ------------------------------------------------------------------------ >>>> >>>> OTP-7006 The SMP emulator on sparc64 erroneously used the sparc32 >>>> atomic and the sparc32 spinlock implementations which >>>> caused it to crash. >>>> >>>> OTP-7012 Matching an empty binary in a record and then using the >>>> same record again could cause a compiler crash. >>>> >>>> Example code that triggers the crash: >>>> >>>> -record(r, {a,b}). >>>> t(R) -> >>>> #r{a = <<>>} = R, >>>> R#r.b. >>>> >>>> OTP-7013 file:read/2 and file:consult_stream/1,3 did not use an empty >>>> prompt on I/O devices. This bug has now been corrected. >>>> >>>> OTP-7014 configuring --enable-darwin-universal or --enable- >>>> darwin-64bit >>>> on MacOSX could result in a non optimized emulator. Top >>>> level >>>> configure script now corrected. >>>> >>>> OTP-7015 configuring --with-gd did not produce correct include flags >>>> for percept. >>>> >>>> ------------------------------------------------------------------------ >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://www.erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 > From kenneth.lundin@REDACTED Wed Dec 12 13:42:51 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Wed, 12 Dec 2007 13:42:51 +0100 Subject: [erlang-questions] clarify: are EEPs also for libraries and also for the OTP team? In-Reply-To: <475F1DCB.2050105@dominicwilliams.net> References: <475F1DCB.2050105@dominicwilliams.net> Message-ID: Hi, On 12/12/07, Dominic Williams wrote: > Hi, > > The recent EEP suggestion for a gen_stream made me wonder > whether EEP's were intended to be used for the language only > or also for libraries. EEP 1 says: "describing a new feature > for Erlang or its processes or environment", and "The final > implementation must include test code and documentation > appropriate for either the Erlang language reference or the > standard library reference", but there have not been any > previous EEPs for the libraries. The EEP's should be used for changes and additions to the language, runtime system and basic libraries such as stdlib, kernel and compiler. > > I also am under the impression that the OTP team is making > many additions and changes to the language and libraries > (most of them great, that's besides the point) without going > through EEPs. I attended the EUC'06 meeting which initiated > EEP's, and seem to remember that the intention was for the > OTP team to use the same process, to gather community > feedback before introducing changes. The OTP team is already using EEP's for changes and additions. We are not making many additions and changes without going through EEP's. Of course it is up to us to decide when we need to write an EEP, we can't do it for every minor change but we will do it for every significant change with major impact on language , runtime system or core libraries. There are today 4 accepted EEP's (and more on their way). 3 out of these for are from the OTP team (in close cooperation with the HiPE team at Uppsala University). Also note that the EEP process is still in a very early stage not fully up to speed yet. /Regards Kenneth Erlang/OTP team , Ericsson AB From juanjo@REDACTED Wed Dec 12 00:31:52 2007 From: juanjo@REDACTED (Juan Jose Comellas) Date: Tue, 11 Dec 2007 20:31:52 -0300 Subject: [erlang-questions] clarify: why is Mnesia not fit for large databases In-Reply-To: <475F1A21.1030102@dominicwilliams.net> References: <475731E0.3090104@dominicwilliams.net> <2ae2b2da0712052039h114dbc99r7bb1e493e3f89d4a@mail.gmail.com> <4757F31D.8060600@ericsson.com> <475F12F9.5000903@dominicwilliams.net> <1c3be50f0712111459w2fa63889s8301d6de0d529440@mail.gmail.com> <475F1A21.1030102@dominicwilliams.net> Message-ID: <1c3be50f0712111531j1d4bd6bbxea06f4b61710bcf9@mail.gmail.com> Yes, we are using Slony (http://slony.info/) for PostgreSQL replication, which works very well and is very easy to use. On 12/11/07, Dominic Williams < erlang-dated-1197846981.f17b2c@REDACTED> wrote: > > Hi Juan, > > > This may not be the response you're looking for, but have > > you tried Postgres? We're using it for a database that's > > over 100 GB with very good results. > > Thanks for the feedback. Do you have scalable robust > replication? > > We are going to try Postgres (and others), as well as > mnesia. The reason for my post was to accelerate the mnesia > exploration, by having hints as to: > > a) what problems to look out for in mnesia > b) how to solve them > > Regards, > > Dominic Williams > http://dominicwilliams.net > > ---- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Wed Dec 12 14:07:34 2007 From: matthias@REDACTED (Matthias Lang) Date: Wed, 12 Dec 2007 14:07:34 +0100 Subject: [erlang-questions] idle speculation: Ericsson Erlang vision/strategy In-Reply-To: <8268eea30712110819v1f7a8111j60a52b020d9214d5@mail.gmail.com> References: <8268eea30712110819v1f7a8111j60a52b020d9214d5@mail.gmail.com> Message-ID: <18271.56598.759839.46911@antilipe.corelatus.se> Andreas Hillqvist writes: > Telecom is moving towards Long Term Evolution(LTE), where an aimed to > is to be an all-IP network. In the 90s, "everyone" was sure that ATM was going to take over the world. Operators wrote puffy press releases about their migration to a unified all-ATM network. Will the current press releases about migration to all-IP networks seem just as naive in a few years? Sometimes, new technologies really do win. Ethernet has pretty much obliterated everything else, including ethernet. (When was the last time your ethernet needed to avoid a collision? Got any coax?) Other times, sure hits go mostly nowhere. ISDN 2B+D springs to mind. Often, success is partial. Optical fiber has taken over the backbone but fallen victim to 'impossibly' high data rates over copper beyond. Erlang has a strong track record in the sort of complex control and protocol translation problems that pop up whenever you move to the latest "next big thing" from the previous "next big thing". Matt From bekesa@REDACTED Wed Dec 12 15:36:54 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Wed, 12 Dec 2007 15:36:54 +0100 Subject: [erlang-questions] mnesia tables with few attributes Message-ID: <200712121536.55221.bekesa@sch.bme.hu> Hi, It seems that mnesia has a rather strange restriction: "The table must have at least one extra attribute in addition to the key." Ok, in general mnesia tables hold records, so a record has a name, and a record contains at least two values. If you have only one value, why would you need a record? --- This is logical. But, what if I only want a 'set' --- a set in the mathematical sense, I just want to have elements, insert and remove them, check for membership, etc. And I need persistence and transactions... Do I really need 2 extra fields besides the key (the only value I need)? Is there some real reason why a table with 1 or 2 columns are prohibited, or just because it's use is... illogical? Any idea to (ab)use mnesia to implement a 'set'? Georgy PS: OK, I can make a table with 2 extra fields, it isn't performance or space critical, just ugly :-) From alceste@REDACTED Wed Dec 12 16:24:17 2007 From: alceste@REDACTED (Alceste Scalas) Date: Wed, 12 Dec 2007 16:24:17 +0100 Subject: [erlang-questions] Erlang callbacks, linked-in drivers and threads In-Reply-To: References: <62F3426C-094F-4A61-9E15-496B7AC3E069@gmail.com> <1197382905.6124.90.camel@gnatziu.crs4.it> <3dbc6d1c0712111458j637b086cte7ef82b06b6b1d45@mail.gmail.com> <1197454417.6124.157.camel@gnatziu.crs4.it> Message-ID: <1197473057.6124.267.camel@gnatziu.crs4.it> Il giorno mer, 12/12/2007 alle 10.33 +0000, Joel Reymont ha scritto: > On Dec 12, 2007, at 10:13 AM, Alceste Scalas wrote: > > An Erlang callback is evaluated in the same process that > > performs the FFI call that causes the callback invocation. > > > This won't work in the context of a Cocoa bridge, for example. Your > callback could be called at any point in time and it would be strictly > a C to Erlang invocation. I'm not familiar with Cocoa. But if it works (almost) like GTK+, I suppose that it uses its own execution loop, and you want it to run in its own thread, in parallel with the Erlang VM. Erlang callbacks, thus, may be called anytime from that thread. If this is the case, then it is out of the context of my FFI proposal, since (as I wrote in my previous email) it does not support threading. Also, I don't see how the Erlang VM could handle "unexpected" function calls, i.e. performed outside the Erlang process scheduling. Here are some ideas on how to handle this situation, using the linked-in driver API (that does support threads and messages). When the Cocoa binding is given an Erlang callback, maybe something like the following could happen: 1. the callback fun() is given a key and is added to a dictionary of available Erlang callbacks; 2. Cocoa, instead, receives a callback stub that wraps a proxy callback function (written in C), based on the Erlang driver API. The stub is generated on-the-fly (using libffi closures) and its signature reflects the Erlang callback signature (i.e. the one expected by Cocoa, too). It also carries the key of the associated Erlang callback. 3. when the stub is called, it invokes the proxy, that converts all the stub parameters into Erlang terms and sends them to the port owner process; it also sends the key that identifies the Erlang callback, a buffer address for storing the return value, and an ErlDrvCond reference. Then it sleeps on the ErlDrvCond itself until the return value becomes available; 4. the port owner process uses the key and parameters to invoke the Erlang callback; 5. the Erlang callback return value, the buffer address and the ErlDrvCond reference are sent back to the driver port; 6. the driver stores the return value in the buffer, and signals the ErlDrvCond; 7. the callback proxy wakes up, converts the Erlang return value found inside the buffer into the proper C type, and returns it to the callback stub, and, in turn, to the caller (that was waiting since point 3). It's not exactly straightforward and fast --- but once it has been written down, the "Erlang callbacks from linked-in drivers" code could be generic enough to be reusable by other library bindings as well. Regards, alceste -- Alceste Scalas CRS4 - http://www.crs4.it/ From alceste@REDACTED Wed Dec 12 16:50:35 2007 From: alceste@REDACTED (Alceste Scalas) Date: Wed, 12 Dec 2007 16:50:35 +0100 Subject: [erlang-questions] idea: Erlang FFI: callbacks and memory management In-Reply-To: References: <62F3426C-094F-4A61-9E15-496B7AC3E069@gmail.com> <1197382905.6124.90.camel@gnatziu.crs4.it> <3dbc6d1c0712111458j637b086cte7ef82b06b6b1d45@mail.gmail.com> <1197454417.6124.157.camel@gnatziu.crs4.it> Message-ID: <1197474635.6124.279.camel@gnatziu.crs4.it> Il giorno mer, 12/12/2007 alle 12.19 +0100, Bjorn Gustavsson ha scritto: > Alceste Scalas writes: > > I think it depends on my previous questions: is it possible to execute > > an Erlang fun() from within a BIF, and get its return term? How? > > It is currently not possible to execute a fun from a BIF and return to the BIF. > > There is, however, an internal mechanism to make a tail-recursive call > to Erlang code from a BIF. The called Erlang code could in turn make a call > to another BIF. Thank you for the clarification. I think that it invalidates my hypothesis about "easy" Erlang callbacks through FFI calls --- unless "currently not possible" implies "...but we may think about adding this possibility, sooner or later" :-) The other, slower and more complex approach I've proposed for obtaining Erlang "callbacks" with linked-in drivers should remain valid, though (see [1]). Regards, alceste References: [1] Erlang callbacks, linked-in drivers and threads http://erlang.org/pipermail/erlang-questions/2007-December/031771.html -- Alceste Scalas CRS4 - http://www.crs4.it/ From raimo+erlang-questions@REDACTED Wed Dec 12 17:02:47 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 12 Dec 2007 17:02:47 +0100 Subject: [erlang-questions] : queues (previously: documentation of data structures) In-Reply-To: <200712111516.50740.bekesa@sch.bme.hu> References: <200712070917.13979.bekesa@sch.bme.hu> <200712111344.25828.bekesa@sch.bme.hu> <475E8E41.5040603@lionet.info> <200712111516.50740.bekesa@sch.bme.hu> Message-ID: <20071212160247.GC11510@erix.ericsson.se> On Tue, Dec 11, 2007 at 03:16:50PM +0100, Andras Georgy Bekes wrote: > > The killing Con is that one process may keep a megabyte > > in the queue making this queue performance excruciatingly > > slow for all other processes due to repeating message > > queue scans. > You're right. > > > I saw a bug in your code: myqueue:delete/1 dose not stop the queue > > process. > You too. > I hacked that module in 2 minutes, so I'm happy with that bug :-) > > > > - - add two elements at the begining of the queue > > queue != dequeue. > > > - - remove elements from the end of the queue > > queue != dequeue, so this shouldn't necessarily be possible. > Everybody is right. > > The module I've written implements a queue. However, the queue module in > OTP implements a deque (only with funny function names). Probably this > is the source of confusion. > > Anyways, queue:lait/1 should be liat/1 shouldn't it? Both in the doc and > impl. (It is the opposite of tail. The opposite of cons/2 is snoc/2, > the opposite of head/1 is daeh/1 but lists:reverse("tail") /= "lait"). Oh yes!!! I was tired when I wrote it, then self-blind, and nobody proofread. If I get a reason to touch the module I will add liat/1, forget about lait/1 but keep it around for backwards compatibility... > > Georgy > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From jay@REDACTED Wed Dec 12 17:20:30 2007 From: jay@REDACTED (Jay Nelson) Date: Wed, 12 Dec 2007 08:20:30 -0800 Subject: [erlang-questions] clarify: are EEPs also for libraries and also for the OTP team? Message-ID: <078FDC3C-1B7F-4E5A-A59C-337ACB4A1A1E@duomark.com> Kenneth Lundin wrote: > The EEP's should be used for changes and additions to the language, > runtime system and basic libraries such as stdlib, kernel and compiler. What is the recommended process for considering a new module such as gen_stream? jay From hakan@REDACTED Wed Dec 12 18:11:47 2007 From: hakan@REDACTED (Hakan Mattsson) Date: Wed, 12 Dec 2007 18:11:47 +0100 (CET) Subject: [erlang-questions] mnesia tables with few attributes In-Reply-To: <200712121536.55221.bekesa@sch.bme.hu> References: <200712121536.55221.bekesa@sch.bme.hu> Message-ID: On Wed, 12 Dec 2007, Andras Georgy Bekes wrote: AG> Is there some real reason why a table with 1 or 2 columns are AG> prohibited, or just because it's use is... illogical? Mnesia uses tuples with arity 2 to denote the identity of a record. While tuples with greater arity denotes a complete record including its field values. Of course it would be possible to change this convention if it only was an internal issue, but as the convention also is used in the API it will be left as it is. /H?kan From valentin@REDACTED Wed Dec 12 18:56:48 2007 From: valentin@REDACTED (Valentin Micic) Date: Wed, 12 Dec 2007 19:56:48 +0200 Subject: [erlang-questions] Source patch for R12B-0 available References: <26B04CE34936014297D381585CCE89B042B451@MTNMAIL1.mtn.co.za> <475FCE87.7070507@ericsson.com> Message-ID: <006e01c83ce8$66db33a0$6401a8c0@moneymaker2> Not sure how is gnu tar related to the problem, but we'll try... When we've run "truss" command using 'erlc' and arguments as indicated immediately when build "hangs", the execution fails because it cannot locate 'erl'. Unfortunately, the 'erl' hasn't been build at this point, so I am at loss... it appears to me that 'erlc' is invoked to early, that is to say, before 'erl' has been created. Thus, two questions for your consideration, if you please: 1) Could it be that patch is inserted at a wrong place; 2) Could it be that your build is successful because you do have erl somewhere in your path (I mean erl that you've build before via separate build) -- I've checked it over and over again: erlc will try to invoke erl using any path specified in your $PATH variable. Thanks for your effort so far. Kind Regards, V. ----- Original Message ----- From: "Rickard Green" To: "Ognian Pantov [ MTN - Innovation Centre ]" Cc: "Kenneth Lundin" ; "Sean Hinde" ; "Erlang/OTP discussions" ; ; "Valentin Micic" Sent: Wednesday, December 12, 2007 2:05 PM Subject: Re: [erlang-questions] Source patch for R12B-0 available > It builds fine for me on solaris 10. > > Are you extracting the tar file with gnu tar? If not, you need to. > > Instead of using CC I put a script called gcc (similar to yours) in the > path and also a script called ld (passing -64 as argument to ld) in the > path. > > I use gcc 3.4.4. > > BR, > Rickard Green, Erlang/OTP, Ericsson AB. > > > Ognian Pantov [ MTN - Innovation Centre ] wrote: >> Hi, >> >> We are having a problem making R12B-0 with the patch on Solaris 10. >> We can make and run R12B-0 without the patch on the same machine. See >> below for details of our environment. When we are trying to make R12B-0 >> with the patch, make hangs when is trying to compile hipe_rtl_arch.erl >> file. >> ********************************************************************************************************* >> make[2]: Leaving directory >> `/export/home/smscproj/install/otp_src_R12B-0/lib/parsetools' >> make[2]: Entering directory >> `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' >> make[2]: Nothing to be done for `opt'. >> make[2]: Leaving directory >> `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' >> make[2]: Entering directory >> `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe' >> Makefile:35: warning: overriding commands for target `docs' >> /export/home/smscproj/install/otp_src_R12B-0/make/otp_subdir.mk:28: >> warning: ignoring old commands for target `docs' >> === Entering application hipe >> make[3]: Entering directory >> `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe/rtl' >> /export/home/smscproj/install/otp_src_R12B-0/bin/sparc-sun-solaris2.10/hipe_mkliterals >> -e > hipe_literals.hrl >> erlc -W +debug_info +warn_obsolete_guard +inline -o../ebin >> hipe_rtl_arch.erl >> >> !!! We stay here till we kill the process! >> ******************************************************************************************************** >> The command patch doesn't support -Z option on Solaris (it does on Linux) >> and we use gpatch instead. >> We try to patch the source code on Linux and make on Solaris - the result >> is the same the process hangs during compilation on hipe_rtl_arch.erl. >> >> We tryed to compile hipe_rtl_arch.erl manually but environment doesn't >> seem to be ready yet. >> >> Any ideas what may cuase this problem? >> >> Best regards >> Ognian >> >> --------------------------Environment-------------------------------------------- >> The make for R12B-0 with and without patch is done on the same machine >> using the same procedure. >> We are using Sun Netra-T2000 running Solaris 10 patch level 125100-05. We >> use GCC 3.4.6. >> >> To compile 64 bit code we do: >> >> cat>/tmp/gcc64 >> #!/bin/sh >> exec gcc -m64 "$@" >> ^D >> >> chmod +x /tmp/gcc64 >> >> Every time we make we remove the old otp_src_R12B-0 directory and start >> from scratch. >> >> tar -xvf otp_src_R12B-0.tar >> gpatch -ZNp0 < otp_src_R12B-0-osp1.patch ( only with patch ) >> >> env CC=/tmp/gcc64 >> ./configure --enable-smp-support --prefix=/usr/local/erlang/R12B-0 >> make >> --------------------------------------------------------------------------------------- >> >> >> -----Original Message----- >> From: Kenneth Lundin [mailto:kenneth.lundin@REDACTED] >> Sent: Monday, 10 December 2007 02:33 >> To: Valentin Micic >> Cc: Sean Hinde; Rickard Green; Erlang/OTP discussions; Ognian Pantov [ >> MTN - Innovation Centre ]; waynes@REDACTED >> Subject: Re: [erlang-questions] Source patch for R12B-0 available >> >> >> Hi, >> >> Since the combination SMP and 64 bit sparc apparently never has worked >> in R11B you can't have any system in service dependent on this patch >> do you? >> >> So if you are planning on using the SMP emulator for the first time in a >> product >> I would really recommend that you put your old policy away and go for >> R12B. >> >> The reasons for that are in my opinion many: >> - R12B is the most stable version with best performance when it comes >> to SMP execution. >> R12B is the version where we will have regular service releases with >> patches and >> improvements. >> R12B is the version where improvements regarding SMP will appear. >> R12B is the version where we may support more platforms. >> Bugs found by open source users in R12B AND PREVIOUS releases will be >> corrected in R12B-1, 2, ..., etc. >> >> /Regards Kenneth Erlang/OTP team, Ericsson AB >> >> On 12/9/07, Valentin Micic wrote: >>> May I second what Sean is asking for? >>> I would really appreciate a fix for R11B-5 -- we have a policy not to >>> run >>> the latest release on production systems, and absence of the patch would >>> force us to do so. Make no mistake, I really like what I saw in R12 so >>> far, >>> but we'd like to migrate on our own pace. >>> Your cooperation will be *highly* appreciated. >>> >>> Valentin Micic >>> Principal Consultant >>> PHAROS CONSVLTING (PTY) LTD. >>> Cell: +27 83 212 9180 >>> >>> ----- Original Message ----- >>> From: "Sean Hinde" >>> To: "Rickard Green" >>> Cc: "Erlang/OTP discussions" >>> Sent: Sunday, December 09, 2007 1:51 AM >>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>> >>> >>>> Hi Rikard, >>>> >>>> Do you have any plans to release a patch for those using R11B-5 on 64 >>>> bit sparc? I'm thinking mainly of the OTP-7006 issue, initially >>>> reported on R11B-5. >>>> >>>> Thanks, >>>> Sean >>>> >>>> On 7 Dec 2007, at 14:17, Rickard Green wrote: >>>> >>>>> A patch that fixes the following issues is now available at >>>>> http://www.erlang.org/download.html . Instructions for applying >>>>> the patch can be found in the patch README. >>>>> >>>>> BR, >>>>> Rickard Green, Erlang/OTP, Ericsson AB. >>>>> >>>>> ------------------------------------------------------------------------ >>>>> >>>>> OTP-7006 The SMP emulator on sparc64 erroneously used the sparc32 >>>>> atomic and the sparc32 spinlock implementations which >>>>> caused it to crash. >>>>> >>>>> OTP-7012 Matching an empty binary in a record and then using the >>>>> same record again could cause a compiler crash. >>>>> >>>>> Example code that triggers the crash: >>>>> >>>>> -record(r, {a,b}). >>>>> t(R) -> >>>>> #r{a = <<>>} = R, >>>>> R#r.b. >>>>> >>>>> OTP-7013 file:read/2 and file:consult_stream/1,3 did not use an empty >>>>> prompt on I/O devices. This bug has now been corrected. >>>>> >>>>> OTP-7014 configuring --enable-darwin-universal or --enable- >>>>> darwin-64bit >>>>> on MacOSX could result in a non optimized emulator. Top >>>>> level >>>>> configure script now corrected. >>>>> >>>>> OTP-7015 configuring --with-gd did not produce correct include flags >>>>> for percept. >>>>> >>>>> ------------------------------------------------------------------------ >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://www.erlang.org/mailman/listinfo/erlang-questions >>> >> NOTE: This e-mail message is subject to the MTN Group disclaimer see >> http://www.mtn.co.za/default.aspx?pid=34411 From bekesa@REDACTED Wed Dec 12 19:52:14 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Wed, 12 Dec 2007 19:52:14 +0100 Subject: [erlang-questions] mnesia tables with few attributes In-Reply-To: References: <200712121536.55221.bekesa@sch.bme.hu> Message-ID: <200712121952.14514.bekesa@sch.bme.hu> > Mnesia uses tuples with arity 2 to denote the identity > of a record. While tuples with greater arity denotes a > complete record including its field values. I've read this at least 5 times, but still, I just don't understand it. Could you clarify, please? Georgy From cyberlync@REDACTED Wed Dec 12 20:15:28 2007 From: cyberlync@REDACTED (Eric Merritt) Date: Wed, 12 Dec 2007 11:15:28 -0800 Subject: [erlang-questions] clarify: why does Dialyzer have an implicit dependency on Mnesia? Message-ID: Guys, Dialyzer seems to have an implicit dependency on Mnesia. Mnesia isn't specified as a dependency in dialyzer.app, nor does dialyzer ever actually call any of the Mnesia APIs. However, dialyzer attempts to get information about mnesia in dialyzer_plt. It makes use of a list of default libraries provided by the dialyzer header. Why is this? If there actually is a dependency shouldn't dialyzer have mnesia listed as a dependency in its .app file? If its not a dependency why try to retrieve information about it with the code module? Thanks, Eric From cyberlync@REDACTED Wed Dec 12 20:22:44 2007 From: cyberlync@REDACTED (Eric Merritt) Date: Wed, 12 Dec 2007 11:22:44 -0800 Subject: [erlang-questions] clarify: in Dialyzer why is the Erlang API less complete then the command line api? Message-ID: Guys, Dialyzer seems to have a disparity between what options are able to be passed to the Erlang API and what options are able to be passed on the command line. At the very least there is no way to set output-plt in the api like you can on the command line. There may be others that I haven't run into. Granted there are work arounds to this, but shouldn't you be able to do anything in the api that you are able to do on the command line? Thanks, Eric From paul-trapexit@REDACTED Wed Dec 12 20:37:08 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Wed, 12 Dec 2007 11:37:08 -0800 (PST) Subject: [erlang-questions] how: mnesia with simultaneous permanent node failure (EC2) In-Reply-To: <475F8F28.8010807@ericsson.com> References: <475F8F28.8010807@ericsson.com> Message-ID: That sounds fine to me. Another aspect of EC2 (as we plan to use it) is that the set of nodes in use will change frequently (perhaps multiple times per day, in order to save costs). So it would be nice to allow abstract nodes with no corresponding physical node. Since my immediate problem is solved I have to move on, but I welcome any changes to mnesia that make operating on EC2 easier. Perhaps Amazon could fund some work? -- p On Wed, 12 Dec 2007, Ulf Wiger (TN/EAB) wrote: > Paul Mineiro skrev: > > in order to get my disaster recovery situation managed on EC2, i went > > ahead and wrote mnesia_schema:del_table_copies/2, which allows one to > > remove multiple tables in one operation. > [...] > >> > >> i'm thinking about using mnesia on EC2, but i'm having problems figuring > >> out disaster recovery. > >> > >> some background: on EC2, you can start as many machines (instances) as you > >> like. if you lose one, you can start another, but it'll have a different > >> hostname. when you lose an instance, you lose whatever was stored on the > >> drive. > > What if mnesia were equipped with a node name abstraction layer, and > you could simply tell it which physical node corresponds to a given > abstract node? > > This would also make it unnecessary to explicitly traverse backups > in order to migrate a mnesia database from one machine to another; > you'd simply re-map the abstract node name instead. > > BR, > Ulf W > Optimism is an essential ingredient of innovation. How else can the individual favor change over security? -- Robert Noyce From kostis@REDACTED Wed Dec 12 21:16:53 2007 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 12 Dec 2007 22:16:53 +0200 Subject: [erlang-questions] clarify: why does Dialyzer have an implicit dependency on Mnesia? In-Reply-To: References: Message-ID: <476041B5.7060001@cs.ntua.gr> Eric Merritt wrote: > Guys, > > Dialyzer seems to have an implicit dependency on Mnesia. Mnesia isn't > specified as a dependency in dialyzer.app, nor does dialyzer ever > actually call any of the Mnesia APIs. However, dialyzer attempts to > get information about mnesia in dialyzer_plt. It makes use of a list > of default libraries provided by the dialyzer header. Why is this? If > there actually is a dependency shouldn't dialyzer have mnesia listed > as a dependency in its .app file? If its not a dependency why try to > retrieve information about it with the code module? I am not 100% sure what you are referring to, but most probably you are talking about the fact that by default Dialyzer builds (or these days comes with) an initial PLT (Persistent Lookup Table) of the following applications: [kernel,stdlib,mnesia] This is done so that there is cached type information about functions that an application might be using -- thereby avoiding having to include modules of these applications in each analysis and repeatedly analyzing these modules. However, dialyzer needs to check that the cached type information is still valid (i.e. has not changed since the time when the PLT was built) and thus checks that the .beam files have not changed by comparing their checksums with the current one. Thus, it needs to be able to locate these .beam files. In principle, no application is needed in PLT or more than the above three could be added, so if it bothers you feel free to take mnesia out of the set of applications in the PLT (these are specified in dialyzer's Makefile) and rebuild the PLT. Hope this answers your question. Kostis From kostis@REDACTED Wed Dec 12 21:35:46 2007 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 12 Dec 2007 22:35:46 +0200 Subject: [erlang-questions] clarify: in Dialyzer why is the Erlang API less complete then the command line api? In-Reply-To: References: Message-ID: <47604622.60606@cs.ntua.gr> Eric Merritt wrote: > Guys, > > Dialyzer seems to have a disparity between what options are able to > be passed to the Erlang API and what options are able to be passed on > the command line. At the very least there is no way to set output-plt > in the api like you can on the command line. There may be others that > I haven't run into. Granted there are work arounds to this, but > shouldn't you be able to do anything in the api that you are able to > do on the command line? The Dialyzer developers have a habit of rarely using the API -- for some reason we use the command line version. So it's quite possible that options that were added quite recently to the command-line version were not added to the API version of Dialyzer. Their omission is not intentional. Thanks for telling us about it. We would appreciate even more a patch if indeed you find the API version useful. Kostis From ulf.wiger@REDACTED Thu Dec 13 00:02:32 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Thu, 13 Dec 2007 00:02:32 +0100 Subject: [erlang-questions] mnesia tables with few attributes In-Reply-To: <200712121952.14514.bekesa@sch.bme.hu> References: <200712121536.55221.bekesa@sch.bme.hu> <200712121952.14514.bekesa@sch.bme.hu> Message-ID: <47606888.9080205@ericsson.com> Andras Georgy Bekes skrev: >> Mnesia uses tuples with arity 2 to denote the identity >> of a record. While tuples with greater arity denotes a >> complete record including its field values. > I've read this at least 5 times, but still, I just don't understand it. > Could you clarify, please? > > Georgy I think I understand what H?kan is getting at, but going through the Mnesia API, I can't find a single function that accepts both {Tab,Key} and Record, so that there would be any chance of confusing the two. BR, Ulf W From cyberlync@REDACTED Thu Dec 13 00:37:13 2007 From: cyberlync@REDACTED (Eric Merritt) Date: Wed, 12 Dec 2007 15:37:13 -0800 Subject: [erlang-questions] clarify: why does Dialyzer have an implicit dependency on Mnesia? In-Reply-To: <476041B5.7060001@cs.ntua.gr> References: <476041B5.7060001@cs.ntua.gr> Message-ID: I understand my issue now. It was a combination of two problems. The first is that I was using an undocumented api to generate a plt file from the erlang. This API went away at some point, it was undocumented so thats expected. However, with dialyzer no longer being told to output a plt file and it not having a plt file available it tried to create one. Since it used its defaults for this and mnesia wasn't available it bombed out. It might be worth adding a check in the generation loop just to check and make sure that the required libs are, in fact, available. On Dec 12, 2007 12:16 PM, Kostis Sagonas wrote: > > Eric Merritt wrote: > > Guys, > > > > Dialyzer seems to have an implicit dependency on Mnesia. Mnesia isn't > > specified as a dependency in dialyzer.app, nor does dialyzer ever > > actually call any of the Mnesia APIs. However, dialyzer attempts to > > get information about mnesia in dialyzer_plt. It makes use of a list > > of default libraries provided by the dialyzer header. Why is this? If > > there actually is a dependency shouldn't dialyzer have mnesia listed > > as a dependency in its .app file? If its not a dependency why try to > > retrieve information about it with the code module? > > I am not 100% sure what you are referring to, but most probably you are > talking about the fact that by default Dialyzer builds (or these days > comes with) an initial PLT (Persistent Lookup Table) of the following > applications: [kernel,stdlib,mnesia] > > This is done so that there is cached type information about functions > that an application might be using -- thereby avoiding having to include > modules of these applications in each analysis and repeatedly analyzing > these modules. However, dialyzer needs to check that the cached type > information is still valid (i.e. has not changed since the time when the > PLT was built) and thus checks that the .beam files have not changed by > comparing their checksums with the current one. Thus, it needs to be > able to locate these .beam files. > > In principle, no application is needed in PLT or more than the above > three could be added, so if it bothers you feel free to take mnesia out > of the set of applications in the PLT (these are specified in dialyzer's > Makefile) and rebuild the PLT. > > Hope this answers your question. > > Kostis > From cyberlync@REDACTED Thu Dec 13 00:37:41 2007 From: cyberlync@REDACTED (Eric Merritt) Date: Wed, 12 Dec 2007 15:37:41 -0800 Subject: [erlang-questions] clarify: in Dialyzer why is the Erlang API less complete then the command line api? In-Reply-To: <47604622.60606@cs.ntua.gr> References: <47604622.60606@cs.ntua.gr> Message-ID: I will see if I can't get a patch to you to solve this. On Dec 12, 2007 12:35 PM, Kostis Sagonas wrote: > > Eric Merritt wrote: > > Guys, > > > > Dialyzer seems to have a disparity between what options are able to > > be passed to the Erlang API and what options are able to be passed on > > the command line. At the very least there is no way to set output-plt > > in the api like you can on the command line. There may be others that > > I haven't run into. Granted there are work arounds to this, but > > shouldn't you be able to do anything in the api that you are able to > > do on the command line? > > The Dialyzer developers have a habit of rarely using the API -- for some > reason we use the command line version. So it's quite possible that > options that were added quite recently to the command-line version were > not added to the API version of Dialyzer. Their omission is not > intentional. Thanks for telling us about it. We would appreciate even > more a patch if indeed you find the API version useful. > > Kostis > From david.hopwood@REDACTED Thu Dec 13 06:15:05 2007 From: david.hopwood@REDACTED (David Hopwood) Date: Thu, 13 Dec 2007 05:15:05 +0000 Subject: [erlang-questions] documentation of data structures In-Reply-To: <475DBF7C.4040504@fiit.stuba.sk> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> Message-ID: <4760BFD9.2040307@industrial-designers.co.uk> Matej Kosik wrote: > Andras Georgy Bekes wrote: > >> -queue: The doc doesn't say anything about the implementation, >> only: "implements FIFO queues in an efficient manner". >> It states that "all operations has an amortised O(1) running time", >> except for some, that are "probably O(n)". This is rather vague. > > Check the implementation. You will reveal that the operations for adding/removing elements from/to > the head/tail can have O(1) complexity in some cases but in some cases they will have O(n) complexity. > > It would be particularly attractive, if someone implemented `queue' (with the same signature and > semantics of operations) where those operations would have always O(1) complexity. Persistent FIFO queues with O(1) worst-case complexity of add, remove, and even catenation (surprisingly) are possible. See Chris Okasaki, Simple and Efficient Purely Functional Queues and Deques, Journal of Functional Programming 5(4) pages 583-592, October 1995. and Haim Kaplan, Robert E. Tarjan, Purely Functional, Real-Time Deques with Catenation, Journal of the ACM, 46(5) pages 577-603, 1999. -- David Hopwood From juanjo@REDACTED Thu Dec 13 07:28:23 2007 From: juanjo@REDACTED (Juan Jose Comellas) Date: Thu, 13 Dec 2007 03:28:23 -0300 Subject: [erlang-questions] clarify: How are functions assigned to variables compared in Erlang? Message-ID: <1c3be50f0712122228t692939b4t97f9f5b23f597616@mail.gmail.com> Suppose I assign some functions to variables and compare them like this: 1> F1 = fun(X) -> X + 1 end. #Fun 2> F2 = fun(X) -> X + 1 end. #Fun 3> F3 = fun(X) -> X + 2 end. #Fun 4> F1 =:= F2. true 5> F1 =:= F3. false What is the Erlang VM doing when it executes these comparisons? Does is compare the bytecode of each function or does it compare them using some kind of unique identifier? What I'm trying to determine is the cost of comparing two functions assigned to variables. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn@REDACTED Thu Dec 13 08:24:29 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 13 Dec 2007 08:24:29 +0100 Subject: [erlang-questions] clarify: How are functions assigned to variables compared in Erlang? In-Reply-To: <1c3be50f0712122228t692939b4t97f9f5b23f597616@mail.gmail.com> References: <1c3be50f0712122228t692939b4t97f9f5b23f597616@mail.gmail.com> Message-ID: "Juan Jose Comellas" writes: > Suppose I assign some functions to variables and compare them like this: > > What is the Erlang VM doing when it executes these comparisons? Does is > compare the bytecode of each function or does it compare them using some > kind of unique identifier? What I'm trying to determine is the cost of > comparing two functions assigned to variables. The Erlang VM does not compare the code of the functions; it compares unique identifiers. It also compares the environment of the funs. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From bekesa@REDACTED Thu Dec 13 09:25:14 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Thu, 13 Dec 2007 09:25:14 +0100 Subject: [erlang-questions] mnesia tables with few attributes In-Reply-To: <47606888.9080205@ericsson.com> References: <200712121536.55221.bekesa@sch.bme.hu> <200712121952.14514.bekesa@sch.bme.hu> <47606888.9080205@ericsson.com> Message-ID: <200712130925.14608.bekesa@sch.bme.hu> > I think I understand what H?kan is getting at, but > going through the Mnesia API, I can't find a single > function that accepts both {Tab,Key} and Record, so > that there would be any chance of confusing the two. Ahh, I see now, thanks. But really, I don't find a function that accepts both {Tab,Key} and Record either, so this is probably not the real reason. Anyways, why do we have functions of arity 1 accepting {Tab,Key} instead of functions with arity 2? The functions with arity 1 accepting {Tab,Key} (read, dirty_read, wread, dirty_delete, delete) don't exist with arity 2, (except for dirty_read, which accepts Tab and Key). Georgy From hakan@REDACTED Thu Dec 13 09:51:17 2007 From: hakan@REDACTED (Hakan Mattsson) Date: Thu, 13 Dec 2007 09:51:17 +0100 (CET) Subject: [erlang-questions] mnesia tables with few attributes In-Reply-To: <47606888.9080205@ericsson.com> References: <200712121536.55221.bekesa@sch.bme.hu> <200712121952.14514.bekesa@sch.bme.hu> <47606888.9080205@ericsson.com> Message-ID: On Thu, 13 Dec 2007, Ulf Wiger (TN/EAB) wrote: UW> Andras Georgy Bekes skrev: UW> >> Mnesia uses tuples with arity 2 to denote the identity UW> >> of a record. While tuples with greater arity denotes a UW> >> complete record including its field values. UW> > I've read this at least 5 times, but still, I just don't understand it. UW> > Could you clarify, please? UW> > UW> > Georgy UW> UW> I think I understand what H?kan is getting at, but UW> going through the Mnesia API, I can't find a single UW> function that accepts both {Tab,Key} and Record, so UW> that there would be any chance of confusing the two. You are making me surprised Uffe. I thought that you both have used mnesia:traverse_backup/6 as well as well as mnesia_backup callbacks. /H?kan From ulf.wiger@REDACTED Thu Dec 13 10:19:31 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Thu, 13 Dec 2007 10:19:31 +0100 Subject: [erlang-questions] mnesia tables with few attributes In-Reply-To: References: <200712121536.55221.bekesa@sch.bme.hu> <200712121952.14514.bekesa@sch.bme.hu> <47606888.9080205@ericsson.com> Message-ID: <4760F923.2020003@ericsson.com> Hakan Mattsson skrev: > On Thu, 13 Dec 2007, Ulf Wiger (TN/EAB) wrote: > > UW> I think I understand what H?kan is getting at, but > UW> going through the Mnesia API, I can't find a single > UW> function that accepts both {Tab,Key} and Record, so > UW> that there would be any chance of confusing the two. > > You are making me surprised Uffe. I thought that you > both have used mnesia:traverse_backup/6 as well as well > as mnesia_backup callbacks. Aargh, i forgot those! Yes, I have used them, but not that much. BR, Ulf W From raimo+erlang-questions@REDACTED Thu Dec 13 10:44:04 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 13 Dec 2007 10:44:04 +0100 Subject: [erlang-questions] : documentation of data structures In-Reply-To: <4760BFD9.2040307@industrial-designers.co.uk> References: <200712070917.13979.bekesa@sch.bme.hu> <475DBF7C.4040504@fiit.stuba.sk> <4760BFD9.2040307@industrial-designers.co.uk> Message-ID: <20071213094403.GA11958@erix.ericsson.se> I have skimmed both papers... On Thu, Dec 13, 2007 at 05:15:05AM +0000, David Hopwood wrote: > Matej Kosik wrote: > > Andras Georgy Bekes wrote: > > > >> -queue: The doc doesn't say anything about the implementation, > >> only: "implements FIFO queues in an efficient manner". > >> It states that "all operations has an amortised O(1) running time", > >> except for some, that are "probably O(n)". This is rather vague. > > > > Check the implementation. You will reveal that the operations for adding/removing elements from/to > > the head/tail can have O(1) complexity in some cases but in some cases they will have O(n) complexity. > > > > It would be particularly attractive, if someone implemented `queue' (with the same signature and > > semantics of operations) where those operations would have always O(1) complexity. > > Persistent FIFO queues with O(1) worst-case complexity of add, remove, > and even catenation (surprisingly) are possible. See > > Chris Okasaki, > Simple and Efficient Purely Functional Queues and Deques, > Journal of Functional Programming 5(4) pages 583-592, October 1995. > > He uses lazy lists with memoization. Not easily adapted to Erlang. > and > > Haim Kaplan, Robert E. Tarjan, > Purely Functional, Real-Time Deques with Catenation, > Journal of the ACM, 46(5) pages 577-603, 1999. > > This should be implementable, but their best solution seems reealy complicated. It would require quite some work to understand all their tricks and structures, and it must have quite some overhead. But it would be interesting to give it a shot! > -- > David Hopwood > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From tim@REDACTED Thu Dec 13 11:07:26 2007 From: tim@REDACTED (Tim Bates) Date: Thu, 13 Dec 2007 20:37:26 +1030 Subject: [erlang-questions] clarify: How are functions assigned to variables compared in Erlang? In-Reply-To: References: <1c3be50f0712122228t692939b4t97f9f5b23f597616@mail.gmail.com> Message-ID: <4761045E.7070304@bates.id.au> Juan Jose Comellas wrote: > 1> F1 = fun(X) -> X + 1 end. > #Fun > > 2> F2 = fun(X) -> X + 1 end. > #Fun > > 3> F3 = fun(X) -> X + 2 end. > #Fun > > 4> F1 =:= F2. > true > > 5> F1 =:= F3. > false Bjorn Gustavsson wrote: > The Erlang VM does not compare the code of the functions; it compares > unique identifiers. > > It also compares the environment of the funs. Juan, Note that in your example, since you are building the funs from the shell, and they all have the same arity, the unique identifiers in all three are the same - the actual code is stored in the environment of the fun[1]. This is why F1 and F2 compare equal - in this particular case only, it does actually compare the code. If I were to do the same thing in a module: -module(fun_test). -compile(export_all). fun1() -> fun(X) -> X + 1 end. fun2() -> fun(X) -> X + 1 end. fun3() -> fun(X) -> X + 2 end. compare_funs() -> F1A = fun1(), F1B = fun1(), F2 = fun2(), F3 = fun3(), [F1A =:= F1B, F1A =:= F2, F1A =:= F3]. I get different results: Eshell V5.5.4 (abort with ^G) 1> c(fun_test). {ok,fun_test} 2> fun_test:fun1(). #Fun 3> fun_test:fun2(). #Fun 4> fun_test:fun3(). #Fun 5> fun_test:compare_funs(). [true,false,false] Tim. [1] See erl_eval:expr/5, the section with the comment as follows: %% This is a really ugly hack! -- Tim Bates tim@REDACTED From tobias.lindahl@REDACTED Thu Dec 13 12:03:02 2007 From: tobias.lindahl@REDACTED (Tobias Lindahl) Date: Thu, 13 Dec 2007 12:03:02 +0100 Subject: [erlang-questions] clarify: why does Dialyzer have an implicit dependency on Mnesia? In-Reply-To: References: <476041B5.7060001@cs.ntua.gr> Message-ID: <47611166.9010006@it.uu.se> Eric Merritt wrote: > I understand my issue now. It was a combination of two problems. The > first is that I was using an undocumented api to generate a plt file > from the erlang. This API went away at some point, it was undocumented > so thats expected. The api didn't really go away, but it sure stopped working ;-) Now that I know that someone is actually using it, I can take a look at implementing it properly. > However, with dialyzer no longer being told to > output a plt file and it not having a plt file available it tried to > create one. Since it used its defaults for this and mnesia wasn't > available it bombed out. It might be worth adding a check in the > generation loop just to check and make sure that the required libs > are, in fact, available. Yes, that would be a good idea. Thanks for the report. Tobias From rickard.s.green@REDACTED Thu Dec 13 12:14:44 2007 From: rickard.s.green@REDACTED (Rickard Green) Date: Thu, 13 Dec 2007 12:14:44 +0100 Subject: [erlang-questions] Source patch for R12B-0 available In-Reply-To: <006e01c83ce8$66db33a0$6401a8c0@moneymaker2> References: <26B04CE34936014297D381585CCE89B042B451@MTNMAIL1.mtn.co.za> <475FCE87.7070507@ericsson.com> <006e01c83ce8$66db33a0$6401a8c0@moneymaker2> Message-ID: <47611424.1030702@ericsson.com> Valentin Micic wrote: > Not sure how is gnu tar related to the problem, but we'll try... > As far as I know solaris tar and gnu tar are slightly incompatible, and that you might get silent errors if you extract using solaris tar. I'm no tar expert, though, I might be wrong, but by using gnu tar you will at least remove one possible error source. > When we've run "truss" command using 'erlc' and arguments as indicated > immediately when build "hangs", the execution fails because it cannot > locate 'erl'. Unfortunately, the 'erl' hasn't been build at this point, > so I am at loss... it appears to me that 'erlc' is invoked to early, > that is to say, before 'erl' has been created. Thus, two questions for > your consideration, if you please: > > 1) Could it be that patch is inserted at a wrong place; Perhaps, but I've also used gpatch (version 2.5.4), and it works for me. You could try to apply the patch manually if you want. Modify all files included in the patch manually except for otp_src_R12B-0/configure, and otp_src_R12B-0/erts/configure then cd into otp_src_R12B-0 and run "./otp_build autoconf" (you need to have autoconf 2.59 in your path). If you search for "diff -Naur" in the patch file, you will easily find the beginning of each diff. > 2) Could it be that your build is successful because you do have erl > somewhere in your path (I mean erl that you've build before via separate > build) -- I've checked it over and over again: erlc will try to invoke > erl using any path specified in your $PATH variable. > The top makefile puts the bootstrap/bin directory (where the bootstrap erl and erlc resides) first in your path during the build. I've also successfully built it without any erl and erlc in the path and without ERLC_EMULATOR set, and also using the runtime system with resp. without smp support. You could also try to enable/disable smp support for erlc by putting -smpenable/-smpdisable in the ERL_ZFLAGS environment variable before building and see if it makes any difference. BR, Rickard Green, Erlang/OTP, Ericsson AB. > Thanks for your effort so far. > > Kind Regards, > V. > > > ----- Original Message ----- From: "Rickard Green" > > To: "Ognian Pantov [ MTN - Innovation Centre ]" > Cc: "Kenneth Lundin" ; "Sean Hinde" > ; "Erlang/OTP discussions" > ; ; "Valentin > Micic" > Sent: Wednesday, December 12, 2007 2:05 PM > Subject: Re: [erlang-questions] Source patch for R12B-0 available > > >> It builds fine for me on solaris 10. >> >> Are you extracting the tar file with gnu tar? If not, you need to. >> >> Instead of using CC I put a script called gcc (similar to yours) in >> the path and also a script called ld (passing -64 as argument to ld) >> in the path. >> >> I use gcc 3.4.4. >> >> BR, >> Rickard Green, Erlang/OTP, Ericsson AB. >> >> >> Ognian Pantov [ MTN - Innovation Centre ] wrote: >>> Hi, >>> >>> We are having a problem making R12B-0 with the patch on Solaris 10. >>> We can make and run R12B-0 without the patch on the same machine. See >>> below for details of our environment. When we are trying to make >>> R12B-0 with the patch, make hangs when is trying to compile >>> hipe_rtl_arch.erl file. >>> ********************************************************************************************************* >>> >>> make[2]: Leaving directory >>> `/export/home/smscproj/install/otp_src_R12B-0/lib/parsetools' >>> make[2]: Entering directory >>> `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' >>> make[2]: Nothing to be done for `opt'. >>> make[2]: Leaving directory >>> `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' >>> make[2]: Entering directory >>> `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe' >>> Makefile:35: warning: overriding commands for target `docs' >>> /export/home/smscproj/install/otp_src_R12B-0/make/otp_subdir.mk:28: >>> warning: ignoring old commands for target `docs' >>> === Entering application hipe >>> make[3]: Entering directory >>> `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe/rtl' >>> /export/home/smscproj/install/otp_src_R12B-0/bin/sparc-sun-solaris2.10/hipe_mkliterals >>> -e > hipe_literals.hrl >>> erlc -W +debug_info +warn_obsolete_guard +inline -o../ebin >>> hipe_rtl_arch.erl >>> >>> !!! We stay here till we kill the process! >>> ******************************************************************************************************** >>> >>> The command patch doesn't support -Z option on Solaris (it does on >>> Linux) and we use gpatch instead. >>> We try to patch the source code on Linux and make on Solaris - the >>> result is the same the process hangs during compilation on >>> hipe_rtl_arch.erl. >>> >>> We tryed to compile hipe_rtl_arch.erl manually but environment >>> doesn't seem to be ready yet. >>> >>> Any ideas what may cuase this problem? >>> >>> Best regards >>> Ognian >>> >>> --------------------------Environment-------------------------------------------- >>> >>> The make for R12B-0 with and without patch is done on the same >>> machine using the same procedure. >>> We are using Sun Netra-T2000 running Solaris 10 patch level >>> 125100-05. We use GCC 3.4.6. >>> >>> To compile 64 bit code we do: >>> >>> cat>/tmp/gcc64 >>> #!/bin/sh >>> exec gcc -m64 "$@" >>> ^D >>> >>> chmod +x /tmp/gcc64 >>> >>> Every time we make we remove the old otp_src_R12B-0 directory and >>> start from scratch. >>> >>> tar -xvf otp_src_R12B-0.tar >>> gpatch -ZNp0 < otp_src_R12B-0-osp1.patch ( only with patch ) >>> >>> env CC=/tmp/gcc64 ./configure --enable-smp-support >>> --prefix=/usr/local/erlang/R12B-0 >>> make >>> --------------------------------------------------------------------------------------- >>> >>> >>> >>> -----Original Message----- >>> From: Kenneth Lundin [mailto:kenneth.lundin@REDACTED] >>> Sent: Monday, 10 December 2007 02:33 >>> To: Valentin Micic >>> Cc: Sean Hinde; Rickard Green; Erlang/OTP discussions; Ognian Pantov [ >>> MTN - Innovation Centre ]; waynes@REDACTED >>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>> >>> >>> Hi, >>> >>> Since the combination SMP and 64 bit sparc apparently never has worked >>> in R11B you can't have any system in service dependent on this patch >>> do you? >>> >>> So if you are planning on using the SMP emulator for the first time >>> in a product >>> I would really recommend that you put your old policy away and go for >>> R12B. >>> >>> The reasons for that are in my opinion many: >>> - R12B is the most stable version with best performance when it comes >>> to SMP execution. >>> R12B is the version where we will have regular service releases with >>> patches and >>> improvements. >>> R12B is the version where improvements regarding SMP will appear. >>> R12B is the version where we may support more platforms. >>> Bugs found by open source users in R12B AND PREVIOUS releases will be >>> corrected in R12B-1, 2, ..., etc. >>> >>> /Regards Kenneth Erlang/OTP team, Ericsson AB >>> >>> On 12/9/07, Valentin Micic wrote: >>>> May I second what Sean is asking for? >>>> I would really appreciate a fix for R11B-5 -- we have a policy not >>>> to run >>>> the latest release on production systems, and absence of the patch >>>> would >>>> force us to do so. Make no mistake, I really like what I saw in R12 >>>> so far, >>>> but we'd like to migrate on our own pace. >>>> Your cooperation will be *highly* appreciated. >>>> >>>> Valentin Micic >>>> Principal Consultant >>>> PHAROS CONSVLTING (PTY) LTD. >>>> Cell: +27 83 212 9180 >>>> >>>> ----- Original Message ----- >>>> From: "Sean Hinde" >>>> To: "Rickard Green" >>>> Cc: "Erlang/OTP discussions" >>>> Sent: Sunday, December 09, 2007 1:51 AM >>>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>>> >>>> >>>>> Hi Rikard, >>>>> >>>>> Do you have any plans to release a patch for those using R11B-5 on 64 >>>>> bit sparc? I'm thinking mainly of the OTP-7006 issue, initially >>>>> reported on R11B-5. >>>>> >>>>> Thanks, >>>>> Sean >>>>> >>>>> On 7 Dec 2007, at 14:17, Rickard Green wrote: >>>>> >>>>>> A patch that fixes the following issues is now available at >>>>>> http://www.erlang.org/download.html . Instructions for applying >>>>>> the patch can be found in the patch README. >>>>>> >>>>>> BR, >>>>>> Rickard Green, Erlang/OTP, Ericsson AB. >>>>>> >>>>>> ------------------------------------------------------------------------ >>>>>> >>>>>> >>>>>> OTP-7006 The SMP emulator on sparc64 erroneously used the sparc32 >>>>>> atomic and the sparc32 spinlock implementations which >>>>>> caused it to crash. >>>>>> >>>>>> OTP-7012 Matching an empty binary in a record and then using the >>>>>> same record again could cause a compiler crash. >>>>>> >>>>>> Example code that triggers the crash: >>>>>> >>>>>> -record(r, {a,b}). >>>>>> t(R) -> >>>>>> #r{a = <<>>} = R, >>>>>> R#r.b. >>>>>> >>>>>> OTP-7013 file:read/2 and file:consult_stream/1,3 did not use an >>>>>> empty >>>>>> prompt on I/O devices. This bug has now been corrected. >>>>>> >>>>>> OTP-7014 configuring --enable-darwin-universal or --enable- >>>>>> darwin-64bit >>>>>> on MacOSX could result in a non optimized emulator. Top >>>>>> level >>>>>> configure script now corrected. >>>>>> >>>>>> OTP-7015 configuring --with-gd did not produce correct include flags >>>>>> for percept. >>>>>> >>>>>> ------------------------------------------------------------------------ >>>>>> >>>>>> _______________________________________________ >>>>>> erlang-questions mailing list >>>>>> erlang-questions@REDACTED >>>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>> >>> NOTE: This e-mail message is subject to the MTN Group disclaimer see >>> http://www.mtn.co.za/default.aspx?pid=34411 > > From rickard.s.green@REDACTED Thu Dec 13 16:41:40 2007 From: rickard.s.green@REDACTED (Rickard Green) Date: Thu, 13 Dec 2007 16:41:40 +0100 Subject: [erlang-questions] Source patch for R12B-0 available In-Reply-To: <26B04CE34936014297D381585CCE89B042B457@MTNMAIL1.mtn.co.za> References: <26B04CE34936014297D381585CCE89B042B457@MTNMAIL1.mtn.co.za> Message-ID: <476152B4.3060401@ericsson.com> $ uname -a SunOS xxx 5.10 Generic_125100-10 sun4u sparc SUNW,Ultra-5_10 BR, Rickard Green, Erlang/OTP, Ericsson AB. Ognian Pantov [ MTN - Innovation Centre ] wrote: > Hi, > > We can build R12B-0 without the patch on Netra T2000 (SMP) and Netra 440 (No SMP) using Sun tar or GNU tar, with or without -64 flag passed to ld. There is no other Erlang on the box. > > We can't build R12B-0 with the patch on Netra T2000 and Netra 440 using Sun tar or GNU tar, with or without -64 flag passed to ld. There is no other Erlang on the box. > > What is the hardware you are using to build Solaris 10? > > If do env CC=/tmp/gcc64 ./configure --enable-smp-support --prefix=/usr/local/erlang/R11-1 on Netra 440 using R11B-1 we got: > > checking whether an emulator with smp support should be built... yes; enabled by user > configure: error: cannot build smp enabled emulator since hardware platform (ultrasparc wordsize=8) is not supp > orted > configure: error: /export/home/smscproj/install/otp_src_R11B-1/erts/configure failed for erts > > If we do env CC=/tmp/gcc64 ./configure --enable-smp-support --prefix=/usr/local/erlang/R12B-0 > configure finish successfully! We can build OK without patch and we fail to build with the patch. > > Best regards > Ognian > > -----Original Message----- > From: Rickard Green [mailto:rickard.s.green@REDACTED] > Sent: Thursday, 13 December 2007 01:15 > To: Valentin Micic > Cc: Ognian Pantov [ MTN - Innovation Centre ]; Kenneth Lundin; Sean > Hinde; Erlang/OTP discussions; waynes@REDACTED > Subject: Re: [erlang-questions] Source patch for R12B-0 available > > > Valentin Micic wrote: >> Not sure how is gnu tar related to the problem, but we'll try... >> > > As far as I know solaris tar and gnu tar are slightly incompatible, and > that you might get silent errors if you extract using solaris tar. I'm > no tar expert, though, I might be wrong, but by using gnu tar you will > at least remove one possible error source. > >> When we've run "truss" command using 'erlc' and arguments as indicated >> immediately when build "hangs", the execution fails because it cannot >> locate 'erl'. Unfortunately, the 'erl' hasn't been build at this point, >> so I am at loss... it appears to me that 'erlc' is invoked to early, >> that is to say, before 'erl' has been created. Thus, two questions for >> your consideration, if you please: >> >> 1) Could it be that patch is inserted at a wrong place; > > Perhaps, but I've also used gpatch (version 2.5.4), and it works for me. > You could try to apply the patch manually if you want. Modify all files > included in the patch manually except for otp_src_R12B-0/configure, and > otp_src_R12B-0/erts/configure then cd into otp_src_R12B-0 and run > "./otp_build autoconf" (you need to have autoconf 2.59 in your path). If > you search for "diff -Naur" in the patch file, you will easily find the > beginning of each diff. > >> 2) Could it be that your build is successful because you do have erl >> somewhere in your path (I mean erl that you've build before via separate >> build) -- I've checked it over and over again: erlc will try to invoke >> erl using any path specified in your $PATH variable. >> > > The top makefile puts the bootstrap/bin directory (where the bootstrap > erl and erlc resides) first in your path during the build. I've also > successfully built it without any erl and erlc in the path and without > ERLC_EMULATOR set, and also using the runtime system with resp. without > smp support. > > You could also try to enable/disable smp support for erlc by putting > -smpenable/-smpdisable in the ERL_ZFLAGS environment variable before > building and see if it makes any difference. > > BR, > Rickard Green, Erlang/OTP, Ericsson AB. > >> Thanks for your effort so far. >> >> Kind Regards, >> V. >> >> >> ----- Original Message ----- From: "Rickard Green" >> >> To: "Ognian Pantov [ MTN - Innovation Centre ]" >> Cc: "Kenneth Lundin" ; "Sean Hinde" >> ; "Erlang/OTP discussions" >> ; ; "Valentin >> Micic" >> Sent: Wednesday, December 12, 2007 2:05 PM >> Subject: Re: [erlang-questions] Source patch for R12B-0 available >> >> >>> It builds fine for me on solaris 10. >>> >>> Are you extracting the tar file with gnu tar? If not, you need to. >>> >>> Instead of using CC I put a script called gcc (similar to yours) in >>> the path and also a script called ld (passing -64 as argument to ld) >>> in the path. >>> >>> I use gcc 3.4.4. >>> >>> BR, >>> Rickard Green, Erlang/OTP, Ericsson AB. >>> >>> >>> Ognian Pantov [ MTN - Innovation Centre ] wrote: >>>> Hi, >>>> >>>> We are having a problem making R12B-0 with the patch on Solaris 10. >>>> We can make and run R12B-0 without the patch on the same machine. See >>>> below for details of our environment. When we are trying to make >>>> R12B-0 with the patch, make hangs when is trying to compile >>>> hipe_rtl_arch.erl file. >>>> ********************************************************************************************************* >>>> >>>> make[2]: Leaving directory >>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/parsetools' >>>> make[2]: Entering directory >>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' >>>> make[2]: Nothing to be done for `opt'. >>>> make[2]: Leaving directory >>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' >>>> make[2]: Entering directory >>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe' >>>> Makefile:35: warning: overriding commands for target `docs' >>>> /export/home/smscproj/install/otp_src_R12B-0/make/otp_subdir.mk:28: >>>> warning: ignoring old commands for target `docs' >>>> === Entering application hipe >>>> make[3]: Entering directory >>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe/rtl' >>>> /export/home/smscproj/install/otp_src_R12B-0/bin/sparc-sun-solaris2.10/hipe_mkliterals >>>> -e > hipe_literals.hrl >>>> erlc -W +debug_info +warn_obsolete_guard +inline -o../ebin >>>> hipe_rtl_arch.erl >>>> >>>> !!! We stay here till we kill the process! >>>> ******************************************************************************************************** >>>> >>>> The command patch doesn't support -Z option on Solaris (it does on >>>> Linux) and we use gpatch instead. >>>> We try to patch the source code on Linux and make on Solaris - the >>>> result is the same the process hangs during compilation on >>>> hipe_rtl_arch.erl. >>>> >>>> We tryed to compile hipe_rtl_arch.erl manually but environment >>>> doesn't seem to be ready yet. >>>> >>>> Any ideas what may cuase this problem? >>>> >>>> Best regards >>>> Ognian >>>> >>>> --------------------------Environment-------------------------------------------- >>>> >>>> The make for R12B-0 with and without patch is done on the same >>>> machine using the same procedure. >>>> We are using Sun Netra-T2000 running Solaris 10 patch level >>>> 125100-05. We use GCC 3.4.6. >>>> >>>> To compile 64 bit code we do: >>>> >>>> cat>/tmp/gcc64 >>>> #!/bin/sh >>>> exec gcc -m64 "$@" >>>> ^D >>>> >>>> chmod +x /tmp/gcc64 >>>> >>>> Every time we make we remove the old otp_src_R12B-0 directory and >>>> start from scratch. >>>> >>>> tar -xvf otp_src_R12B-0.tar >>>> gpatch -ZNp0 < otp_src_R12B-0-osp1.patch ( only with patch ) >>>> >>>> env CC=/tmp/gcc64 ./configure --enable-smp-support >>>> --prefix=/usr/local/erlang/R12B-0 >>>> make >>>> --------------------------------------------------------------------------------------- >>>> >>>> >>>> >>>> -----Original Message----- >>>> From: Kenneth Lundin [mailto:kenneth.lundin@REDACTED] >>>> Sent: Monday, 10 December 2007 02:33 >>>> To: Valentin Micic >>>> Cc: Sean Hinde; Rickard Green; Erlang/OTP discussions; Ognian Pantov [ >>>> MTN - Innovation Centre ]; waynes@REDACTED >>>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>>> >>>> >>>> Hi, >>>> >>>> Since the combination SMP and 64 bit sparc apparently never has worked >>>> in R11B you can't have any system in service dependent on this patch >>>> do you? >>>> >>>> So if you are planning on using the SMP emulator for the first time >>>> in a product >>>> I would really recommend that you put your old policy away and go for >>>> R12B. >>>> >>>> The reasons for that are in my opinion many: >>>> - R12B is the most stable version with best performance when it comes >>>> to SMP execution. >>>> R12B is the version where we will have regular service releases with >>>> patches and >>>> improvements. >>>> R12B is the version where improvements regarding SMP will appear. >>>> R12B is the version where we may support more platforms. >>>> Bugs found by open source users in R12B AND PREVIOUS releases will be >>>> corrected in R12B-1, 2, ..., etc. >>>> >>>> /Regards Kenneth Erlang/OTP team, Ericsson AB >>>> >>>> On 12/9/07, Valentin Micic wrote: >>>>> May I second what Sean is asking for? >>>>> I would really appreciate a fix for R11B-5 -- we have a policy not >>>>> to run >>>>> the latest release on production systems, and absence of the patch >>>>> would >>>>> force us to do so. Make no mistake, I really like what I saw in R12 >>>>> so far, >>>>> but we'd like to migrate on our own pace. >>>>> Your cooperation will be *highly* appreciated. >>>>> >>>>> Valentin Micic >>>>> Principal Consultant >>>>> PHAROS CONSVLTING (PTY) LTD. >>>>> Cell: +27 83 212 9180 >>>>> >>>>> ----- Original Message ----- >>>>> From: "Sean Hinde" >>>>> To: "Rickard Green" >>>>> Cc: "Erlang/OTP discussions" >>>>> Sent: Sunday, December 09, 2007 1:51 AM >>>>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>>>> >>>>> >>>>>> Hi Rikard, >>>>>> >>>>>> Do you have any plans to release a patch for those using R11B-5 on 64 >>>>>> bit sparc? I'm thinking mainly of the OTP-7006 issue, initially >>>>>> reported on R11B-5. >>>>>> >>>>>> Thanks, >>>>>> Sean >>>>>> >>>>>> On 7 Dec 2007, at 14:17, Rickard Green wrote: >>>>>> >>>>>>> A patch that fixes the following issues is now available at >>>>>>> http://www.erlang.org/download.html . Instructions for applying >>>>>>> the patch can be found in the patch README. >>>>>>> >>>>>>> BR, >>>>>>> Rickard Green, Erlang/OTP, Ericsson AB. >>>>>>> >>>>>>> ------------------------------------------------------------------------ >>>>>>> >>>>>>> >>>>>>> OTP-7006 The SMP emulator on sparc64 erroneously used the sparc32 >>>>>>> atomic and the sparc32 spinlock implementations which >>>>>>> caused it to crash. >>>>>>> >>>>>>> OTP-7012 Matching an empty binary in a record and then using the >>>>>>> same record again could cause a compiler crash. >>>>>>> >>>>>>> Example code that triggers the crash: >>>>>>> >>>>>>> -record(r, {a,b}). >>>>>>> t(R) -> >>>>>>> #r{a = <<>>} = R, >>>>>>> R#r.b. >>>>>>> >>>>>>> OTP-7013 file:read/2 and file:consult_stream/1,3 did not use an >>>>>>> empty >>>>>>> prompt on I/O devices. This bug has now been corrected. >>>>>>> >>>>>>> OTP-7014 configuring --enable-darwin-universal or --enable- >>>>>>> darwin-64bit >>>>>>> on MacOSX could result in a non optimized emulator. Top >>>>>>> level >>>>>>> configure script now corrected. >>>>>>> >>>>>>> OTP-7015 configuring --with-gd did not produce correct include flags >>>>>>> for percept. >>>>>>> >>>>>>> ------------------------------------------------------------------------ >>>>>>> >>>>>>> _______________________________________________ >>>>>>> erlang-questions mailing list >>>>>>> erlang-questions@REDACTED >>>>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>>> _______________________________________________ >>>>>> erlang-questions mailing list >>>>>> erlang-questions@REDACTED >>>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>> >>>> NOTE: This e-mail message is subject to the MTN Group disclaimer see >>>> http://www.mtn.co.za/default.aspx?pid=34411 >> > NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 > From joelr1@REDACTED Thu Dec 13 19:22:10 2007 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 13 Dec 2007 18:22:10 +0000 Subject: [erlang-questions] Dynamic linked-in drivers Message-ID: <9F224479-C7C7-43E6-8E78-D2249F7E8D3E@gmail.com> The man page for driver_entry states that the finish callback of the driver entry is invoked when the driver is unloaded and that this is used for dynamic drivers only. What are dynamic drivers and in what scenario should they be used? Thanks, Joel -- http://wagerlabs.com From joelr1@REDACTED Thu Dec 13 19:31:06 2007 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 13 Dec 2007 18:31:06 +0000 Subject: [erlang-questions] Linked-in drivers: output and control callbacks Message-ID: <4FE7E749-6A2C-473B-9ED4-45857AA33A57@gmail.com> There are two similar callbacks in the driver entry: output and control. The signatures are virtually identical. My understanding is that Port ! {self(), {command, Data}} triggers output whereas port_command(Port, Data) triggers control. When should control be used? Are there any reasons to use control at all? Are there any reasons to prefer output over control or vise versa? Thanks, Joel -- http://wagerlabs.com From joelr1@REDACTED Thu Dec 13 19:46:15 2007 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 13 Dec 2007 18:46:15 +0000 Subject: [erlang-questions] Linked-in drivers: output and control callbacks In-Reply-To: <4FE7E749-6A2C-473B-9ED4-45857AA33A57@gmail.com> References: <4FE7E749-6A2C-473B-9ED4-45857AA33A57@gmail.com> Message-ID: It seems that the control callback is invoked by port_command/3 but only port_command/2 is documented in the man pages. Does it mean that I should not worry about control at all? I would still like to know its intended use. Thanks, Joel On Dec 13, 2007, at 6:31 PM, Joel Reymont wrote: > There are two similar callbacks in the driver entry: output and > control. The signatures are virtually identical. > > My understanding is that Port ! {self(), {command, Data}} triggers > output whereas port_command(Port, Data) triggers control. > > When should control be used? > > Are there any reasons to use control at all? > > Are there any reasons to prefer output over control or vise versa? > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > -- http://wagerlabs.com From fritchie@REDACTED Thu Dec 13 19:46:26 2007 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Thu, 13 Dec 2007 12:46:26 -0600 Subject: [erlang-questions] idea: Erlang FFI: callbacks and memory management In-Reply-To: Message of "Tue, 11 Dec 2007 23:58:21 +0100." <3dbc6d1c0712111458j637b086cte7ef82b06b6b1d45@mail.gmail.com> Message-ID: <200712131846.lBDIkQwt098377@snookles.snookles.com> >>>>> "rv" == Robert Virding writes: rv> If you have a callback how do you intend to get data in and out of rv> them? Callbacks can't live without shared data. In which process rv> are they to be evaluated? Everything in Erlang exists within a rv> process. rv> No, the only workable Erlang way is to replace them with messages. My memory is quite fuzzy by now, but I think that Tony Rogvall (perhaps?) had managed to do something like what Alceste is asking for. I forget what driver he'd done, perhaps a GUI-related something, but the message passing was clever. On the Erlang side of the driver, if you had this (not actually tested!): Port ! {Pid, {command, DataForCFuncX}}, receive {Port, {data, [?FuncXReply|FuncXDetail]}} -> do_stuff_with_reply(FuncXDetail) end ... is substituted with this (not parameterized to deal with multiple driver functions or multiple callback functions) (not tested!): Port ! {Pid, {command, DataForCFuncX}}, wait_for_reply(Port, Pid). wait_for_reply(Port, Pid) -> receive {Port, {data, [?FuncXReply|FuncXDetail]}} -> do_stuff_with_reply(FuncXDetail) {Port, {data, [?CallbackRequest|CallbackDetail]}} -> CallbackResult = callback_func(CallbackDetail), Port ! {Pid, {command, [?CallbackResponse, CallbackResult]}}, wait_for_reply(Port, Pid) end The Erlang side could deal with a driver that asked for more than 1 callback call before returning its final result. This assumes that the driver call is synchronous, from the Erlang caller's point of view -- the driver then uses the same Erlang process as the context/environment/thingie for executing the callback. If the Erlang side is asynchronous, then this scheme doesn't work as well. :-) -Scott From joelr1@REDACTED Thu Dec 13 20:15:39 2007 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 13 Dec 2007 19:15:39 +0000 Subject: [erlang-questions] Linked-in drivers: output and outputv callbacks Message-ID: <821E0FB4-787D-43EA-98D5-140AE5102F31@gmail.com> I'm studying the source for the efile driver in efile_drv.c as well as the matching Erlang code in prim_file.erl. For the life of me I cannot figure out how FILE_WRITE gets to be handled in file_outputv and FILE_MKDIR in file_output. Both are triggered from port_command/2 on the Erlang side and both callbacks are set in the driver entry structure. How does the runtime figure out whether to call the output callback or the outputv callback when both are supplied? According to erts_write_to_port in erts/emulator/beam/io.c, the output callback will never be called when the output callback is present the function checks for outputv first. Thanks, Joel -- http://wagerlabs.com From vances@REDACTED Thu Dec 13 21:34:44 2007 From: vances@REDACTED (Vance Shipley) Date: Thu, 13 Dec 2007 15:34:44 -0500 Subject: [erlang-questions] Dynamic linked-in drivers In-Reply-To: <9F224479-C7C7-43E6-8E78-D2249F7E8D3E@gmail.com> References: <9F224479-C7C7-43E6-8E78-D2249F7E8D3E@gmail.com> Message-ID: <20071213203444.GD1364@little-black-book.motivity.ca> Joel, Dynamic drivers are dynamically linked during runtime as opposed to those which are statically linked at build time of the emulator. http://erlang.org/doc/man/erl_ddll.html -Vance On Thu, Dec 13, 2007 at 06:22:10PM +0000, Joel Reymont wrote: } What are dynamic drivers and in what scenario should they be used? From tony@REDACTED Thu Dec 13 21:28:24 2007 From: tony@REDACTED (Tony Rogvall) Date: Thu, 13 Dec 2007 21:28:24 +0100 Subject: [erlang-questions] Linked-in drivers: output and outputv callbacks In-Reply-To: <821E0FB4-787D-43EA-98D5-140AE5102F31@gmail.com> References: <821E0FB4-787D-43EA-98D5-140AE5102F31@gmail.com> Message-ID: There is actually quite some descent docs to read here: http://www.erlang.org/doc/apps/erts/index.html void outputv(ErlDrvData drv_data, ErlIOVec *ev) This function is called whenever the port is written to. If it is NULL, the output function is called instead. This function is faster than output, because it takes an ErlIOVec directly, which requires no copying of the data. The port should be in binary mode, see open_port/2. The ErlIOVec contains both a SysIOVec, suitable for writev, and one or more binaries. If these binaries should be retained, when the driver returns from outputv, they can be queued (using driver_enq_bin for instance), or if they are kept in a static or global variable, the reference counter can be incremented. On 13 dec 2007, at 20.15, Joel Reymont wrote: > I'm studying the source for the efile driver in efile_drv.c as well as > the matching Erlang code in prim_file.erl. > > For the life of me I cannot figure out how FILE_WRITE gets to be > handled in file_outputv and FILE_MKDIR in file_output. Both are > triggered from port_command/2 on the Erlang side and both callbacks > are set in the driver entry structure. > > How does the runtime figure out whether to call the output callback or > the outputv callback when both are supplied? > > According to erts_write_to_port in erts/emulator/beam/io.c, the output > callback will never be called when the output callback is present the > function checks for outputv first. > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Thu Dec 13 22:30:34 2007 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 13 Dec 2007 21:30:34 +0000 Subject: [erlang-questions] Linked-in drivers: output and outputv callbacks In-Reply-To: References: <821E0FB4-787D-43EA-98D5-140AE5102F31@gmail.com> Message-ID: <08E720CC-AA5D-4646-8E5A-31C36C717B9E@gmail.com> Tony, You misunderstood my question. It's not _what_ outputv does but how is it possible that efile_drv.c sets up both outputv and output callbacks and both seem to be called somehow. At least I assume that they are both being called since the set of functions that the driver performs is split over the two callbacks. The read/write functions are in outputv and a whole bunch of others like mkdir are in output. Thanks, Joel On Dec 13, 2007, at 8:28 PM, Tony Rogvall wrote: > There is actually quite some descent docs to read here: > > http://www.erlang.org/doc/apps/erts/index.html > > void outputv(ErlDrvData drv_data, ErlIOVec *ev) > > This function is called whenever the port is written to. If it is > NULL, the output function is called instead. This function is faster > than output, because it takes an ErlIOVec directly, which requires > no copying of the data. The port should be in binary mode, see > open_port/2. > > The ErlIOVec contains both a SysIOVec, suitable for writev, and one > or more binaries. If these binaries should be retained, when the > driver returns from outputv, they can be queued (using > driver_enq_bin for instance), or if they are kept in a static or > global variable, the reference counter can be incremented. -- http://wagerlabs.com From joelr1@REDACTED Thu Dec 13 22:33:26 2007 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 13 Dec 2007 21:33:26 +0000 Subject: [erlang-questions] Dynamic linked-in drivers In-Reply-To: <20071213203444.GD1364@little-black-book.motivity.ca> References: <9F224479-C7C7-43E6-8E78-D2249F7E8D3E@gmail.com> <20071213203444.GD1364@little-black-book.motivity.ca> Message-ID: On Dec 13, 2007, at 8:34 PM, Vance Shipley wrote: > Dynamic drivers are dynamically linked during runtime as > opposed to those which are statically linked at build time > of the emulator. Foot in mouth. This portion of the driver_entry man page confused me: void (*finish)(void); /* called before unloading the driver - DYNAMIC DRIVERS ONLY */ I didn't even know that static drivers existed and was taken by the bold warning. Thanks, Joel -- http://wagerlabs.com From vances@REDACTED Thu Dec 13 22:41:44 2007 From: vances@REDACTED (Vance Shipley) Date: Thu, 13 Dec 2007 16:41:44 -0500 Subject: [erlang-questions] Linked-in drivers: output and control callbacks In-Reply-To: <4FE7E749-6A2C-473B-9ED4-45857AA33A57@gmail.com> References: <4FE7E749-6A2C-473B-9ED4-45857AA33A57@gmail.com> Message-ID: <20071213214113.GE1364@little-black-book.motivity.ca> On Thu, Dec 13, 2007 at 06:31:06PM +0000, Joel Reymont wrote: } My understanding is that Port ! {self(), {command, Data}} triggers } output whereas port_command(Port, Data) triggers control. } } When should control be used? Joel, Consider a driver for a communications channel. You will send data down the channel as erlang messages to the port and receive data from the channel as erlang messages from the port. When sending the messages may be enqueued within the driver (see the erl_driver function driver_enq). Received messages are handled through the process mailbox as normal. } Are there any reasons to use control at all? The port_control/3 bif is synchronous, it delivers a response to a question or a result of a control operation directly. You could simulate this by sending a message and waiting on a reply however the process would wait in a receive. The port_control/3 bif returns a value directly. It is more like a driver "ioctl". } Are there any reasons to prefer output over control or vise versa? The port_command/2 bif should be preferred for message passing. The driver_entry ouputv() callback function handles vectorized data so receiving an iolist() or binary() is more effecient. -Vance From gbulmer@REDACTED Thu Dec 13 22:42:41 2007 From: gbulmer@REDACTED (G Bulmer) Date: Thu, 13 Dec 2007 21:42:41 +0000 Subject: [erlang-questions] Project: Adobe release AMF3 specification for Flash/Flex - Joe's SP1 #9 Message-ID: Adobe has released a spec for Action Message Format -- AMF3 http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf To quote: "Action Message Format (AMF) is a compact binary format that is used to serialize ActionScript object graphs. Once serialized an AMF encoded object graph may be used to persist and retrieve the public state of an application across sessions or allow two endpoints to communicate through the exchange of strongly typed data." There is some helpful documents already at http://osflash.org/ documentation too, but it's nice to have the definitive spec. Further, Adobe say they will be releasing BlazeDS, the Java source of the server components early 2008: http://labs.adobe.com/technologies/blazeds/ Hopefully, this will include a nice test suite. So, it is becoming much easier to achieve Joe's SP1 point 9 > 9 ++++ interface to flash using flex 2. Solve the GUI problem once and > for all as follows > > repeat after me: client = flash in the browser, server = erlang. > Intermediate protocol = flash AMF > It's not that I dislike HTTP/HTML. I agree with pretty much all of the benefits, but you can build some lovely client user interfaces in Flex/AIR e.g. http://about.buzzword.com/ and it appears to be quicker to build and test (on a range of relevant platforms) than browser- hosted JavaScript-based apps. I'd be *very* interested in an *Open Source* implementation of an Erlang AMF server. I realise process-one have a commercial product, and I'm not anti- commercial products. I encourage customer's to pay for commercial support for production deployment, but I like low-cost/free development, test, demo and 'bootstrap' environments that run on laptops too. G Bulmer From vances@REDACTED Thu Dec 13 22:55:43 2007 From: vances@REDACTED (Vance Shipley) Date: Thu, 13 Dec 2007 16:55:43 -0500 Subject: [erlang-questions] Linked-in drivers: output and outputv callbacks In-Reply-To: <08E720CC-AA5D-4646-8E5A-31C36C717B9E@gmail.com> References: <821E0FB4-787D-43EA-98D5-140AE5102F31@gmail.com> <08E720CC-AA5D-4646-8E5A-31C36C717B9E@gmail.com> Message-ID: <20071213215543.GF1364@little-black-book.motivity.ca> On Thu, Dec 13, 2007 at 09:30:34PM +0000, Joel Reymont wrote: } You misunderstood my question. It's not _what_ outputv does but how is } it possible that efile_drv.c sets up both outputv and output callbacks } and both seem to be called somehow. Joel, I see that output() is called from outputv(). I'm guessing that the driver has migrated from using output() to outputv() and that the output() function is never called as a callback. -Vance From raimo+erlang-questions@REDACTED Thu Dec 13 23:06:10 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 13 Dec 2007 23:06:10 +0100 Subject: [erlang-questions] : Linked-in drivers: output and outputv callbacks In-Reply-To: <08E720CC-AA5D-4646-8E5A-31C36C717B9E@gmail.com> References: <821E0FB4-787D-43EA-98D5-140AE5102F31@gmail.com> <08E720CC-AA5D-4646-8E5A-31C36C717B9E@gmail.com> Message-ID: <20071213220610.GA20756@erix.ericsson.se> On Thu, Dec 13, 2007 at 09:30:34PM +0000, Joel Reymont wrote: > Tony, > > You misunderstood my question. It's not _what_ outputv does but how is > it possible that efile_drv.c sets up both outputv and output callbacks > and both seem to be called somehow. > output is not called as a callback, but from the outputv callback (that is called by the emulator). I did not have the time to rewrite all operations into the outputv callback when I wrote it (before all operations were in output), so I kept a fallback at the end of outputv to flatten the data and call output as before. The output callback should die and all operations should be moved to outputv. When anyone gets the time. > At least I assume that they are both being called since the set of > functions that the driver performs is split over the two callbacks. > The read/write functions are in outputv and a whole bunch of others > like mkdir are in output. > > Thanks, Joel > > On Dec 13, 2007, at 8:28 PM, Tony Rogvall wrote: > > > There is actually quite some descent docs to read here: > > > > http://www.erlang.org/doc/apps/erts/index.html > > > > void outputv(ErlDrvData drv_data, ErlIOVec *ev) > > > > This function is called whenever the port is written to. If it is > > NULL, the output function is called instead. This function is faster > > than output, because it takes an ErlIOVec directly, which requires > > no copying of the data. The port should be in binary mode, see > > open_port/2. > > > > The ErlIOVec contains both a SysIOVec, suitable for writev, and one > > or more binaries. If these binaries should be retained, when the > > driver returns from outputv, they can be queued (using > > driver_enq_bin for instance), or if they are kept in a static or > > global variable, the reference counter can be incremented. > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From joelr1@REDACTED Thu Dec 13 23:18:59 2007 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 13 Dec 2007 22:18:59 +0000 Subject: [erlang-questions] Linked-in drivers: output and outputv callbacks In-Reply-To: <20071213215543.GF1364@little-black-book.motivity.ca> References: <821E0FB4-787D-43EA-98D5-140AE5102F31@gmail.com> <08E720CC-AA5D-4646-8E5A-31C36C717B9E@gmail.com> <20071213215543.GF1364@little-black-book.motivity.ca> Message-ID: On Dec 13, 2007, at 9:55 PM, Vance Shipley wrote: > I see that output() is called from outputv(). Mea culpa, I missed the call to file_output at the end of file_outputv. Sorry for all the noise! Thanks, Joel -- http://wagerlabs.com From joelr1@REDACTED Thu Dec 13 23:47:45 2007 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 13 Dec 2007 22:47:45 +0000 Subject: [erlang-questions] : Linked-in drivers: output and outputv callbacks In-Reply-To: <20071213220610.GA20756@erix.ericsson.se> References: <821E0FB4-787D-43EA-98D5-140AE5102F31@gmail.com> <08E720CC-AA5D-4646-8E5A-31C36C717B9E@gmail.com> <20071213220610.GA20756@erix.ericsson.se> Message-ID: <75E4C364-D3FC-4CFF-809D-A380BCD6C158@gmail.com> Raimo, On Dec 13, 2007, at 10:06 PM, Raimo Niskanen wrote: > The output callback should die and all operations should be > moved to outputv. When anyone gets the time. Could you elaborate on why you switched? Did you get a measurable increase in performance or decrease in memory use? Thanks, Joel -- http://wagerlabs.com From pfisher@REDACTED Fri Dec 14 00:40:37 2007 From: pfisher@REDACTED (Paul Fisher) Date: Thu, 13 Dec 2007 17:40:37 -0600 Subject: [erlang-questions] spread_drv updates? Message-ID: <1197589237.6052.51.camel@pfisher-laptop> Has anyone done work with, or improved, the spread_drv which was made available at jungerl a few years ago? I did see one note in the archive from "Serge" about fixes in 2005, but that was all that I could find. Any help would be appreciated. -- paul From rsaccon@REDACTED Fri Dec 14 00:53:36 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Thu, 13 Dec 2007 21:53:36 -0200 Subject: [erlang-questions] Project: Adobe release AMF3 specification for Flash/Flex - Joe's SP1 #9 In-Reply-To: References: Message-ID: On Dec 13, 2007 7:42 PM, G Bulmer wrote: > Adobe has released a spec for Action Message Format -- AMF3 > http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf > > To quote: "Action Message Format (AMF) is a compact binary format > that is used to serialize > ActionScript object graphs. Once serialized an AMF encoded object > graph may be used > to persist and retrieve the public state of an application across > sessions or allow two > endpoints to communicate through the exchange of strongly typed data." > > There is some helpful documents already at http://osflash.org/ > documentation too, but it's nice to have the definitive spec. > > Further, Adobe say they will be releasing BlazeDS, the Java source of > the server components early 2008: > http://labs.adobe.com/technologies/blazeds/ > Hopefully, this will include a nice test suite. > > So, it is becoming much easier to achieve Joe's SP1 point 9 > > 9 ++++ interface to flash using flex 2. Solve the GUI problem once and > > for all as follows > > > > repeat after me: client = flash in the browser, server = erlang. > > Intermediate protocol = flash AMF > > I still don't agree, but let's not discuss this here again ... > > > It's not that I dislike HTTP/HTML. I agree with pretty much all of > the benefits, but you can build some lovely client user interfaces in > Flex/AIR e.g. http://about.buzzword.com/ and it appears to be quicker > to build and test (on a range of relevant platforms) than browser- > hosted JavaScript-based apps. > > I'd be *very* interested in an *Open Source* implementation of an > Erlang AMF server. There are actually at least two Erlang open source implementations of AMF encoder / decoders: eswf: http://eswf.googlecode.com Flash RTMP streaming server (not working yet, but has AMF encoder/decoder): http://erlyvideo.googlecode.com both projects allow you easily (technically and license-wise) to extract the AMF encoder/decoder so you can put it into the Erlang web server of your choice ! If you look for a flash remoting protocol which just works out of the box with yaws, and if it has not necessarily to be AMF/AMF3, then you could use also yaws HaxeRemoting: http://yaws.hyber.org/haxe_intro.yaws > > I realise process-one have a commercial product, and I'm not anti- > commercial products. I encourage customer's to pay for commercial > support for production deployment, but I like low-cost/free > development, test, demo and 'bootstrap' environments that run on > laptops too. > > G Bulmer > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- Roberto Saccon http://rsaccon.com From cyberlync@REDACTED Fri Dec 14 01:37:16 2007 From: cyberlync@REDACTED (Eric Merritt) Date: Thu, 13 Dec 2007 16:37:16 -0800 Subject: [erlang-questions] clarify: why does Dialyzer have an implicit dependency on Mnesia? In-Reply-To: <47611166.9010006@it.uu.se> References: <476041B5.7060001@cs.ntua.gr> <47611166.9010006@it.uu.se> Message-ID: > Eric Merritt wrote: > > I understand my issue now. It was a combination of two problems. The > > first is that I was using an undocumented api to generate a plt file > > from the erlang. This API went away at some point, it was undocumented > > so thats expected. > > The api didn't really go away, but it sure stopped working ;-) Now that > I know that someone is actually using it, I can take a look at > implementing it properly. > I use it rather extensively in Sinan. Being able to type sinan analyze and get a useful potential problem report for your project (and just your project not its dependencies) is very, very useful. I am currently in the process of 'simulating' the options i need by calling some of the internal dialyzer modules directly. I always hate doing that. I am really happy you are going to take a look at that. From joelr1@REDACTED Fri Dec 14 02:05:57 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 01:05:57 +0000 Subject: [erlang-questions] Measuring the overhead of various port driver approaches Message-ID: <1122ADD9-66BC-4043-875A-A51317514D58@gmail.com> I would like to measure the overhead of receiving data in the output callback vs. outputv as well as the overhead of various ways of returning data. Would it suffice to send now/0 down to the driver, have the driver send back the timestamp returned by driver_get_now and then grab now/0 once again? Thanks, Joel -- http://wagerlabs.com From gbulmer@REDACTED Fri Dec 14 02:58:14 2007 From: gbulmer@REDACTED (G Bulmer) Date: Fri, 14 Dec 2007 01:58:14 +0000 Subject: [erlang-questions] Project: Adobe release AMF3 specification for Flash/Flex - Joe's SP1 #9 In-Reply-To: References: Message-ID: <73A67005-3DF5-4223-8C26-5B2BCAF1BF81@gmail.com> Thank you for the suggestions Roberto. I should have been clearer; I am more interested in server-push, than client-pull. > On Dec 13, 2007 7:42 PM, G Bulmer wrote: >> Adobe has released a spec for Action Message Format -- AMF3 >> http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf >> >> There is some helpful documents already at http://osflash.org/ >> documentation too, but it's nice to have the definitive spec. >> >> Further, Adobe say they will be releasing BlazeDS, the Java source >> of the server components early 2008: >> http://labs.adobe.com/technologies/blazeds/ >> Hopefully, this will include a nice test suite. >> >> So, it is becoming much easier to achieve Joe's SP1 point 9 >>> 9 ++++ interface to flash using flex 2. Solve the GUI problem >>> once and >>> for all as follows >>> >>> repeat after me: client = flash in the browser, server = >>> erlang. >>> Intermediate protocol = flash AMF >>> > > I still don't agree, but let's not discuss this here again ... > >> >> >> It's not that I dislike HTTP/HTML. I agree with pretty much all of >> the benefits, but you can build some lovely client user interfaces in >> Flex/AIR e.g. http://about.buzzword.com/ and it appears to be quicker >> to build and test (on a range of relevant platforms) than browser- >> hosted JavaScript-based apps. >> >> I'd be *very* interested in an *Open Source* implementation of an >> Erlang AMF server. > > There are actually at least two Erlang open source implementations of > AMF encoder / decoders: > > eswf: > http://eswf.googlecode.com I did look at this, but the page says "Currently, eswf implements a small subset of Flash 8 SWF tags and ActionScript bytecode" Which didn't sound like it had got very far. Are you saying it is well along? > Flash RTMP streaming server (not working yet, but has AMF encoder/ > decoder): > http://erlyvideo.googlecode.com This is new to me. Thank you. My impression from http://osflash.org/ documentation was that RTMP supports server-push to work with Flash AMF. Is that not the case? > both projects allow you easily (technically and license-wise) to > extract the AMF encoder/decoder so you can put it into the Erlang web > server of your choice ! I want to *push* from the server to the client, so I assume a web server isn't the right place to start (unless that is how server-push works for AMF, which is not the impression I got, so you may be telling me something critical that had passed me by). > If you look for a flash remoting protocol which just works out of the > box with yaws, and if it has not necessarily to be AMF/AMF3, then you > could use also yaws HaxeRemoting: > http://yaws.hyber.org/haxe_intro.yaws AFAIK, this is client-pull, not server-push. Is that correct? G Bulmer From vances@REDACTED Fri Dec 14 03:13:51 2007 From: vances@REDACTED (Vance Shipley) Date: Thu, 13 Dec 2007 21:13:51 -0500 Subject: [erlang-questions] Measuring the overhead of various port driver approaches In-Reply-To: <1122ADD9-66BC-4043-875A-A51317514D58@gmail.com> References: <1122ADD9-66BC-4043-875A-A51317514D58@gmail.com> Message-ID: <20071214021351.GG1364@little-black-book.motivity.ca> Joel, Have a look at this thread for someone who's done that: http://erlang.org/pipermail/erlang-questions/2001-June/003340.html That said ... In the case of a communication's channel driver you could have a queue of messages within the driver. The driver could have marked the port busy with the erl_driver set_busy_port() function which will cause the calling process to suspend. In either case you need an out of band method to communicate with the driver directly. The response time to a port_command/2 depends on the current message load. It has to get through to the driver (possibly suspending the process until the driver signals as not busy) and through the driver queue. The response will be sent through the port and added to the calling process mailbox. The size of the driver queue and the process mailbox will be factors in the turn around time. The port_control/3 and port_call/3 bifs make immediate calls to the driver. The emulator executes the driver's callback function and returns the result to the process. -Vance On Fri, Dec 14, 2007 at 01:05:57AM +0000, Joel Reymont wrote: } I would like to measure the overhead of receiving data in the output } callback vs. outputv as well as the overhead of various ways of } returning data. } } Would it suffice to send now/0 down to the driver, have the driver } send back the timestamp returned by driver_get_now and then grab now/0 } once again? From dking@REDACTED Fri Dec 14 03:21:10 2007 From: dking@REDACTED (David King) Date: Thu, 13 Dec 2007 18:21:10 -0800 (PST) Subject: [erlang-questions] PostgreSQL driver In-Reply-To: <20071130223804.131880@gmx.net> References: <474AB442.4020802@vlayko.tv> <474FE420.5040905@niclux.org> <20071130123631.8920@gmx.net> <60438E7D-519D-48BC-A1EE-77016D83A251@ketralnis.com> <20071130223804.131880@gmx.net> Message-ID: <20071213182001.A86467@ketralnis.com> > Ahem, ok, 4. More postgres drivers coming along? > Maybe we should tell the guys in the language shootout thread that > they propose an additional benchmark. > Can't imagine Erlang wouldn't lead the category 'most postgres drivers > to choose from'. Sorry to bring this up again, but does anyone have experience with one or more of these drivers? Can anyone rate them in comparison to one another? From rsaccon@REDACTED Fri Dec 14 03:23:22 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Fri, 14 Dec 2007 00:23:22 -0200 Subject: [erlang-questions] Project: Adobe release AMF3 specification for Flash/Flex - Joe's SP1 #9 In-Reply-To: <73A67005-3DF5-4223-8C26-5B2BCAF1BF81@gmail.com> References: <73A67005-3DF5-4223-8C26-5B2BCAF1BF81@gmail.com> Message-ID: On Dec 13, 2007 11:58 PM, G Bulmer wrote: > Thank you for the suggestions Roberto. I should have been clearer; I > am more interested in server-push, than client-pull. > > > On Dec 13, 2007 7:42 PM, G Bulmer wrote: > >> Adobe has released a spec for Action Message Format -- AMF3 > >> http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf > >> > > >> There is some helpful documents already at http://osflash.org/ > >> documentation too, but it's nice to have the definitive spec. > >> > >> Further, Adobe say they will be releasing BlazeDS, the Java source > >> of the server components early 2008: > >> http://labs.adobe.com/technologies/blazeds/ > >> Hopefully, this will include a nice test suite. > >> > >> So, it is becoming much easier to achieve Joe's SP1 point 9 > >>> 9 ++++ interface to flash using flex 2. Solve the GUI problem > >>> once and > >>> for all as follows > >>> > >>> repeat after me: client = flash in the browser, server = > >>> erlang. > >>> Intermediate protocol = flash AMF > >>> > > > > I still don't agree, but let's not discuss this here again ... > > > >> > >> > >> It's not that I dislike HTTP/HTML. I agree with pretty much all of > >> the benefits, but you can build some lovely client user interfaces in > >> Flex/AIR e.g. http://about.buzzword.com/ and it appears to be quicker > >> to build and test (on a range of relevant platforms) than browser- > >> hosted JavaScript-based apps. > >> > >> I'd be *very* interested in an *Open Source* implementation of an > >> Erlang AMF server. > > > > There are actually at least two Erlang open source implementations of > > AMF encoder / decoders: > > > > eswf: > > http://eswf.googlecode.com > I did look at this, but the page says "Currently, eswf implements a > small subset of Flash 8 SWF tags and ActionScript bytecode" > Which didn't sound like it had got very far. > Are you saying it is well along? I was only referring to the eswf AMF encoder/decoder, which I had the impression, it was in a good shape, many months ago , when I was trying it out. > > > Flash RTMP streaming server (not working yet, but has AMF encoder/ > > decoder): > > http://erlyvideo.googlecode.com > This is new to me. Thank you. My impression from http://osflash.org/ > documentation was that RTMP supports server-push to work with Flash > AMF. Is that not the case? Yes, AMF over RTMP gives you server push, so that project above is the right place you have to wait for, to eventually get what you want > > both projects allow you easily (technically and license-wise) to > > extract the AMF encoder/decoder so you can put it into the Erlang web > > server of your choice ! > I want to *push* from the server to the client, so I assume a web > server isn't the right place to start (unless that is how server-push > works for AMF, which is not the impression I got, so you may be > telling me something critical that had passed me by). > > > If you look for a flash remoting protocol which just works out of the > > box with yaws, and if it has not necessarily to be AMF/AMF3, then you > > could use also yaws HaxeRemoting: > > http://yaws.hyber.org/haxe_intro.yaws > AFAIK, this is client-pull, not server-push. Is that correct? yes, that is client pull as well > G Bulmer > > -- Roberto Saccon http://rsaccon.com From gbulmer@REDACTED Fri Dec 14 03:32:04 2007 From: gbulmer@REDACTED (G Bulmer) Date: Fri, 14 Dec 2007 02:32:04 +0000 Subject: [erlang-questions] link: Comparing AJAX+JSON vs Flex+XML vs Flex+AMF Message-ID: http://www.jamesward.org/wordpress/2007/12/12/blazebench-why-you-want- amf-and-blazeds/ "BlazeBench: Why you want AMF and BlazeDS" It compares a client built with JavaScript/AJAX using JSON for data exchange with two Flex clients, one using XML, and the other AMF. The yummy graphs look like Flash/Flex. Unfortunately, the author can't show all of the equivalent measurements for each test case (missing "Total client memory" for AJAX). While this is a benchmark (and hence likely to mislead some people), it looks interesting, and, it will likely be influential. G Bulmer From gbulmer@REDACTED Fri Dec 14 03:40:13 2007 From: gbulmer@REDACTED (G Bulmer) Date: Fri, 14 Dec 2007 02:40:13 +0000 Subject: [erlang-questions] Project: Adobe release AMF3 specification for Flash/Flex - Joe's SP1 #9 In-Reply-To: References: <73A67005-3DF5-4223-8C26-5B2BCAF1BF81@gmail.com> Message-ID: <93926655-1F2E-418D-BDC9-340A3F39C2BE@gmail.com> Roberto Thank you very much for your help. You have cleared up several questions which were bugging me. So, in summary, for server-push to a 'vanilla' Flex client (i.e. staying within the 'normal' Flex runtime+libraries technology): 1. it would be reasonable to use RTMP+AMF to implement server-push. 2. AMF is only data serialisation (it is supported by the Flex runtime +libraries, so it is convenient, and has reasonable performance). 3. Only RTMP is supported by the Flex runtime+libraries for server-push. G Bulmer > On Dec 13, 2007 11:58 PM, G Bulmer wrote: >> Thank you for the suggestions Roberto. I should have been clearer; I >> am more interested in server-push, than client-pull. >> >>> On Dec 13, 2007 7:42 PM, G Bulmer wrote: >>>> Adobe has released a spec for Action Message Format -- AMF3 >>>> http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf >>>> >> >>>> There is some helpful documents already at http://osflash.org/ >>>> documentation too, but it's nice to have the definitive spec. >>>> >>>> Further, Adobe say they will be releasing BlazeDS, the Java source >>>> of the server components early 2008: >>>> http://labs.adobe.com/technologies/blazeds/ >>>> Hopefully, this will include a nice test suite. >>>> >>>> So, it is becoming much easier to achieve Joe's SP1 point 9 >>>>> 9 ++++ interface to flash using flex 2. Solve the GUI problem >>>>> once and >>>>> for all as follows >>>>> >>>>> repeat after me: client = flash in the browser, server = >>>>> erlang. >>>>> Intermediate protocol = flash AMF >>>>> >>> >>> I still don't agree, but let's not discuss this here again ... >>> >>>> >>>> >>>> It's not that I dislike HTTP/HTML. I agree with pretty much all of >>>> the benefits, but you can build some lovely client user >>>> interfaces in >>>> Flex/AIR e.g. http://about.buzzword.com/ and it appears to be >>>> quicker >>>> to build and test (on a range of relevant platforms) than browser- >>>> hosted JavaScript-based apps. >>>> >>>> I'd be *very* interested in an *Open Source* implementation of an >>>> Erlang AMF server. >>> >>> There are actually at least two Erlang open source >>> implementations of >>> AMF encoder / decoders: >>> >>> eswf: >>> http://eswf.googlecode.com >> I did look at this, but the page says "Currently, eswf implements a >> small subset of Flash 8 SWF tags and ActionScript bytecode" >> Which didn't sound like it had got very far. >> Are you saying it is well along? > > I was only referring to the eswf AMF encoder/decoder, which I had the > impression, it was in a good shape, many months ago , when I was > trying it out. > >> >>> Flash RTMP streaming server (not working yet, but has AMF encoder/ >>> decoder): >>> http://erlyvideo.googlecode.com >> This is new to me. Thank you. My impression from http://osflash.org/ >> documentation was that RTMP supports server-push to work with Flash >> AMF. Is that not the case? > > Yes, AMF over RTMP gives you server push, so that project above is the > right place you have to wait for, to eventually get what you want > >>> both projects allow you easily (technically and license-wise) to >>> extract the AMF encoder/decoder so you can put it into the Erlang >>> web >>> server of your choice ! >> I want to *push* from the server to the client, so I assume a web >> server isn't the right place to start (unless that is how server-push >> works for AMF, which is not the impression I got, so you may be >> telling me something critical that had passed me by). >> >>> If you look for a flash remoting protocol which just works out of >>> the >>> box with yaws, and if it has not necessarily to be AMF/AMF3, then >>> you >>> could use also yaws HaxeRemoting: >>> http://yaws.hyber.org/haxe_intro.yaws >> AFAIK, this is client-pull, not server-push. Is that correct? > > yes, that is client pull as well > >> G Bulmer >> >> > > > > -- > Roberto Saccon > http://rsaccon.com From torben.lehoff@REDACTED Fri Dec 14 08:51:56 2007 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Fri, 14 Dec 2007 08:51:56 +0100 Subject: [erlang-questions] Linked-in drivers: output and control callbacks In-Reply-To: <20071213214113.GE1364@little-black-book.motivity.ca> References: <4FE7E749-6A2C-473B-9ED4-45857AA33A57@gmail.com> <20071213214113.GE1364@little-black-book.motivity.ca> Message-ID: On Dec 13, 2007 10:41 PM, Vance Shipley wrote: > On Thu, Dec 13, 2007 at 06:31:06PM +0000, Joel Reymont wrote: > } My understanding is that Port ! {self(), {command, Data}} triggers > } output whereas port_command(Port, Data) triggers control. > } > } When should control be used? > > Joel, > > Consider a driver for a communications channel. You will > send data down the channel as erlang messages to the port and > receive data from the channel as erlang messages from the port. > When sending the messages may be enqueued within the driver (see > the erl_driver function driver_enq). Received messages are > handled through the process mailbox as normal. > > } Are there any reasons to use control at all? > > The port_control/3 bif is synchronous, it delivers a response to > a question or a result of a control operation directly. You > could simulate this by sending a message and waiting on a reply > however the process would wait in a receive. The port_control/3 > bif returns a value directly. It is more like a driver "ioctl". I take it that you ment that port_control/2 is synchronous and port_control/3 is asynchronous? Since port_control/3 is undocumented I have a question regarding it: will it send a message when it is done or is it a send-message-and-hope-life-is-swell type of call? Joel, you probably know this already but for those yet to encounter the port beast: if the external program takes too long to return when called through port_command/2 you will get a timeout so your code should probably take that into account if you want it to be fault tolerant. Cheers, Torben -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Fri Dec 14 09:33:25 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 08:33:25 +0000 Subject: [erlang-questions] PostgreSQL driver In-Reply-To: <20071213182001.A86467@ketralnis.com> References: <474AB442.4020802@vlayko.tv> <474FE420.5040905@niclux.org> <20071130123631.8920@gmx.net> <60438E7D-519D-48BC-A1EE-77016D83A251@ketralnis.com> <20071130223804.131880@gmx.net> <20071213182001.A86467@ketralnis.com> Message-ID: <5D2E57FC-78B6-46BF-867B-85B9E8AF7D10@gmail.com> And what about the sync/async pg drivers in erts/example? -- http://wagerlabs.com From joelr1@REDACTED Fri Dec 14 10:51:45 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 09:51:45 +0000 Subject: [erlang-questions] Old Mnesia benchmarking results Message-ID: <2B445714-2993-4BED-8ED2-C11D592B7F07@gmail.com> Does this still hold? http://erlang.org/pipermail/erlang-questions/2001-November/003968.html Has anyone benchmarked Mnesia recently? Thanks, Joel -- http://wagerlabs.com From joelr1@REDACTED Fri Dec 14 11:01:00 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 10:01:00 +0000 Subject: [erlang-questions] Proper benchmarking Message-ID: <3FDB7B76-6314-4018-807B-F6DDC155840D@gmail.com> I'm gathering information for an extensive chapter on efficiency optimization. I will also try benchmarking various approaches in other chapters, e.g. straight binary work vs. pickler combinators, different types of interaction with a linked-in driver or gb_trees vs ets. Do you have any tips or suggestions apart from those given in the Efficiency Guide? Thanks, Joel -- http://wagerlabs.com From raimo+erlang-questions@REDACTED Fri Dec 14 11:01:52 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 14 Dec 2007 11:01:52 +0100 Subject: [erlang-questions] : : Linked-in drivers: output and outputv callbacks In-Reply-To: <75E4C364-D3FC-4CFF-809D-A380BCD6C158@gmail.com> References: <821E0FB4-787D-43EA-98D5-140AE5102F31@gmail.com> <08E720CC-AA5D-4646-8E5A-31C36C717B9E@gmail.com> <20071213220610.GA20756@erix.ericsson.se> <75E4C364-D3FC-4CFF-809D-A380BCD6C158@gmail.com> Message-ID: <20071214100152.GA21670@erix.ericsson.se> On Thu, Dec 13, 2007 at 10:47:45PM +0000, Joel Reymont wrote: > Raimo, > > On Dec 13, 2007, at 10:06 PM, Raimo Niskanen wrote: > > >The output callback should die and all operations should be > >moved to outputv. When anyone gets the time. > > > Could you elaborate on why you switched? > It was for the file driver to utilize non-copying writev OS calls when you write many large binaries. > Did you get a measurable increase in performance or decrease in memory > use? I think some application made use of it and was satisfied, but I have no measurement results. > > Thanks, Joel > > -- > http://wagerlabs.com > > > > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From joelr1@REDACTED Fri Dec 14 11:02:30 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 10:02:30 +0000 Subject: [erlang-questions] Percept profiler Message-ID: <3078210B-F5EB-4D06-8AB4-637DC333A509@gmail.com> I see documentation on the Percept profiler API but could someone explain the purpose of this tool? What is a "Concurrency Profiler"? When and where should it be used? Thanks, Joel -- http://wagerlabs.com From andreas.hillqvist@REDACTED Fri Dec 14 11:12:37 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Fri, 14 Dec 2007 11:12:37 +0100 Subject: [erlang-questions] clarify: Ericsson Erlang vision/strategy In-Reply-To: <475EC520.3030205@ericsson.com> References: <8268eea30712110819v1f7a8111j60a52b020d9214d5@mail.gmail.com> <475EC520.3030205@ericsson.com> Message-ID: <8268eea30712140212n18801be2g6029eae77103b463@mail.gmail.com> Thank you for your answer. I like the semantics of Erlang encourages you to develop your system into small concurrent processes/servers/services in a easy and natural way. This small concurrent processes can be easily run simultaneously. I believe this kind of process semantics will eventually replace the thread-library way of doing concurrency. Kind Regards Andreas Hillqvist 2007/12/11, Ulf Wiger (TN/EAB) : > > Some of your questions can't readily be answered, since it > would mean revealing proprietary information. > I will try to give you some hints. > > Andreas Hillqvist skrev: > > As far as I know, currently Ericsson maintain and develops > > Erlang/OTP. They have employee professional people that get > > payed to maintain and develops Erlang/OTP. > > But is there a risk that Erlang/OTP will be drooped in the > > future? > > Ericsson has a considerable number of Erlang-based products > in commercial operation, and these products have a considerable > life span. "Dropping" Erlang (as in suddenly), is pretty much > out of the question. You would notice it years in advance as > a move of Erlang into "maintenance mode" first. > > > > If Ericsson's would drooped Erlang would the Erlang community > > sustain the quality of maintains and development of Erlang/OTP? > > Considering the above, I'd say it's a hypothetical question. > > As long as Erlang is going strong, and is evidently one of the > hottest technologies for multi-core architectures, it is likely > to have a vibrant user community - but this also makes it less > likely that Ericsson would "drop it". If the Open Source > community stagnates, Ericsson is more likely to move away from > Erlang, and the community would then also be ill equipped to > maintain it at the current level. > > > The reason why I am asking this is because of Jimmy Nilsson's blog. > > Jimmy Nilsson's blog - Erlang, take 2 > > (http://jimmynilsson.com/blog/posts/Erlang.htm) > > "... since even Ericsson, the company where Erlang was developed, > > decided to go another route after a while." > > This is not really a correct account. There was never any question > of Ericsson moving to replace mainstream tools wholesale with > Erlang. Ericsson did start two large development projects using > Erlang in the mid 90s. Both products are still being developed and > sold, and other products have been developed using Erlang since. > > Ericsson also advertises the use of Erlang at > http://www.ericsson.com/technology/open_source/index.shtml > > Ericsson also sponsors the ProTEST EU project, which is very > much based on Erlang technology. This project will run for > about three years. > > http://www.erlang.se/euc/07/papers/1600Hughes.pdf > (John, your slides don't come across very well as PDF.) > > > I have also heard the story/rumor of the management at Ericsson > > baned the use of Erlang in new products. But dose this apply today? > > It is a documented fact that Erlang was banned for new product > development within a part of Ericsson. This was 9 years ago. > I know of very few technology choices that are considered > relevant 9 years after the fact. > > > > > Has not Erlang/OTP been part of Ericsson's success for core > > network products, outperforming competitors? > > I believe so. > > > > Telecom is moving towards Long Term Evolution(LTE), where an aimed to > > is to be an all-IP network. > > How dose an Erlang/OTP IP switching product stack up against Cisco C++ > > (or what they are using) product? > > I'm sorry, but that question would have to be put through Ericsson's > sales channels. I'm sure they would like to tell you how our products > compare to Cisco's, if you're a prospective customer. ;-) > > > > Is Erlang/OTP the natural/best choice to develop core network > > products for LTE or will Ericsson have to adapt and move away > > from Erlang? > > There are a lot of factors that weigh in on technology choices. > One of them is of course existing market share. LTE represents > a change in network topology, and any vendor will of course want > to look at whether existing products should be adapted to a new > standard or replaced with a new product. The word "evolution" is > significant here, I believe. Most of the products using Erlang > within Ericsson will not be affected by LTE at all. > > > BR, > Ulf W > From andreas.hillqvist@REDACTED Fri Dec 14 11:57:11 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Fri, 14 Dec 2007 11:57:11 +0100 Subject: [erlang-questions] Percept profiler In-Reply-To: <3078210B-F5EB-4D06-8AB4-637DC333A509@gmail.com> References: <3078210B-F5EB-4D06-8AB4-637DC333A509@gmail.com> Message-ID: <8268eea30712140257q3e9327ew22df0aac9172528c@mail.gmail.com> I got in contact with Bj?rn-Egil Dahlberg, who wrote a thesis on "Profiling applications in Erlang Symmetrical MultiProcessing system". I do not believe the thesis is public available. But you can find an early draft online: http://www.cs.umu.se/~tm99bdg/documents/thesis-v.0.3.pdf I sent an e-mail to, Bj?rn-Egil Dahlberg, he gave my some insights. I have translated his answer from Swedish: -----Original Message----- From: Bj?rn-Egil Dahlberg Sent: 2007-11-13 16:56 Profiling is activated though a special BIF, erlang:system_profile/2. Through it you could specify if you would like to monitor Erlang process, ports or schedule threads. Through monitoring Erlang process you could measure parallelity in your applications and hopfully identify bottlenecks in your system. It dose not state how well erts utilize the CPUs. For that you could use the scheduler. The monitoring is performed by identifying parallel primative (send, receive, spawn, suspend, etc) in the runtime system. When a event is triggered by a matching state transition a message together with a time stamp and MFA is sent to the Pid/Port you have assigned as listener. This is similar to erlang:trace. I(Bj?rn-Egil) have made a rugh simplification and divided the process states into two parallel states: running, runnable, exiting -> active, waiting, suspend -> inactive system_profile(Pid, [scheduler]) monitors the scheduler (Those threads that are actually running Erlang processes on the OS). They are often mapped 1-1 against the number of processors/cores that exist on the system. (But some problems still persist) Evan ports may be monitored, but this is not as interesting. Some callbacks are queued and are considered as runnables (active), when they run (active) and i other case non running (inactive). There will be a new OTP-application , Percept. Percept stands for, Percept - Erlang Concurrency Profiling Tool. The thought behind it was to offer a better overview of the data. Amongst other through graphs parallelity over time. -----End Original Message----- I have not tried Percept, yet. I think this tool will be useful to help you find bottle necks. I.e. Many "worker" process waits for a single server/process to reply. Kind regards Andreas Hillqvist 2007/12/14, Joel Reymont : > I see documentation on the Percept profiler API but could someone > explain the purpose of this tool? > > What is a "Concurrency Profiler"? > > When and where should it be used? > > Thanks, Joel > > -- > http://wagerlabs.com > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From joelr1@REDACTED Fri Dec 14 12:23:13 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 11:23:13 +0000 Subject: [erlang-questions] Measuring how well ERTS utilizes the CPU by using the scheduler Message-ID: <9E73CC3F-D3F0-46E5-9336-BA2AF992BF4D@gmail.com> How do you accomplish this exactly? I understand that you can use the instrumented runtime but what about the scheduler? Thanks, Joel -- http://wagerlabs.com From joelr1@REDACTED Fri Dec 14 12:37:50 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 11:37:50 +0000 Subject: [erlang-questions] Measuring GC pressure and memory efficiency Message-ID: <133DE168-181C-417A-84B1-FCED256C2ABD@gmail.com> I would like to measure the memory efficiency of the following module. I suppose this would tell me how much pressure it puts on the GC, except it may not because it uses binaries. How do I measure the amount of temporary binaries each function generates as well as the total amount of garbage? Thanks, Joel P.S. This is code written by Julian Fondren for this thread: http://erlang.org/pipermail/erlang-questions/2006-December/024591.html --- -module(arrays). -export([new/1, new/2, new/3, get/2, put/3, size/1, elt_width/1]). new(Size) -> new(Size,0,32). new(Size,Init) -> new(Size,Init,32). new(Size,Init,Width) when Size > 0, Width > 8, Width rem 8 == 0 -> new(Size,Init,Width,<<>>). new(0,_,W,B) -> <>; new(N,I,W,B) -> new(N-1,I,W,<>). get(N,<>) when N > 0 -> Before = W * (N - 1), <<_:Before, X:W, _/binary>> = B, X. put(N,X,<>) when N > 0 -> Before = W * (N - 1), <> = B, <>. size(<>) -> erlang:size(B) div (W div 8). elt_width(<>) -> W. -- http://wagerlabs.com From erlq@REDACTED Fri Dec 14 12:47:40 2007 From: erlq@REDACTED (Erlang List) Date: Fri, 14 Dec 2007 03:47:40 -0800 Subject: [erlang-questions] Amazon AWS SimpleDB based on erlang now in beta Message-ID: <47626D5C.7040507@itsbeen.sent.com> I was wondering if anyone has tried this or if now that it is out if any of the team who created can give us some insights (for example how big is "large data sets", etc): From http://www.satine.org/archives/2007/12/13/amazon-simpledb/ : What?s cool about SimpleDB * Really large data sets * Really Fast * Highly Available - It?s Amazon. Running Erlang. Whoa. * On demand scaling - Like S3, EC2, with a sensible data metering pricing model * Schemaless - major cool factor for me here; items are little hash tables containing sets of key, value pairs http://aws.amazon.com/simpledb http://www.amazon.com/gp/browse.html?node=342335011 http://docs.amazonwebservices.com/AmazonSimpleDB/2007-11-07/DeveloperGuide/? From samuelrivas@REDACTED Fri Dec 14 13:10:08 2007 From: samuelrivas@REDACTED (Samuel Rivas) Date: Fri, 14 Dec 2007 13:10:08 +0100 Subject: [erlang-questions] idea: endianess in interoperability tutorials Message-ID: <20071214121008.GA25443@lambdastream.com> Hi, Interoperability tutorials examples use non-portable code to read message length with erl_interface. For example: len = (buf[0] << 8) | buf[1]; works only on little-endian platforms. I suggest a minor patch that make them a bit more portable. It might be good idea to apply it in the documentation, I have found the original code copy-pasted in several places (luckily running on x86 computers). Regards -- Samuel -------------- next part -------------- A non-text attachment was scrubbed... Name: erl_comm.patch Type: text/x-diff Size: 658 bytes Desc: not available URL: From vlm@REDACTED Fri Dec 14 13:36:42 2007 From: vlm@REDACTED (Lev Walkin) Date: Fri, 14 Dec 2007 04:36:42 -0800 Subject: [erlang-questions] idea: endianess in interoperability tutorials In-Reply-To: <20071214121008.GA25443@lambdastream.com> References: <20071214121008.GA25443@lambdastream.com> Message-ID: <476278DA.4010609@lionet.info> Samuel Rivas wrote: > Hi, > > Interoperability tutorials examples use non-portable code to read message length > with erl_interface. For example: > > > len = (buf[0] << 8) | buf[1]; > > works only on little-endian platforms. This is not true. > I suggest a minor patch that make them a bit more portable. It might be good > idea to apply it in the documentation, I have found the original code copy-pasted in > several places (luckily running on x86 computers). There is no problem with endianness in that code. Perhaps you meant something more involving than that? -- Lev Walkin vlm@REDACTED From joelr1@REDACTED Fri Dec 14 13:36:29 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 12:36:29 +0000 Subject: [erlang-questions] Amazon AWS SimpleDB based on erlang now in beta In-Reply-To: <47626D5C.7040507@itsbeen.sent.com> References: <47626D5C.7040507@itsbeen.sent.com> Message-ID: <0067B1A5-1EAE-4C7D-8243-D2A3AFA9E6CE@gmail.com> This has an even better summary, I think: http://www.sriramkrishnan.com/blog/2007/12/amazon-simpledb-technical-overview.html On Dec 14, 2007, at 11:47 AM, Erlang List wrote: > I was wondering if anyone has tried this or if now that it is out if > any of > the team who created can give us some insights (for example how big > is "large > data sets", etc): > > From http://www.satine.org/archives/2007/12/13/amazon-simpledb/ : -- http://wagerlabs.com From adam@REDACTED Fri Dec 14 13:41:29 2007 From: adam@REDACTED (Adam Lindberg) Date: Fri, 14 Dec 2007 13:41:29 +0100 Subject: [erlang-questions] Proper benchmarking In-Reply-To: <3FDB7B76-6314-4018-807B-F6DDC155840D@gmail.com> References: <3FDB7B76-6314-4018-807B-F6DDC155840D@gmail.com> Message-ID: <6344005f0712140441na85eb4at9b0b77a7e94f1aea@mail.gmail.com> Just mention timer:tc(M,F,A) as the ultimate beginners profiling tool, before you venture into anything more advanced. Took a while for me when I was a beginner to find that out. Fprof, cprof, eprof etc are mentioned before this in the efficiency guide which in my opinion is the wrong way around. Cheers, Adam On Dec 14, 2007 11:01 AM, Joel Reymont wrote: > I'm gathering information for an extensive chapter on efficiency > optimization. I will also try benchmarking various approaches in other > chapters, e.g. straight binary work vs. pickler combinators, different > types of interaction with a linked-in driver or gb_trees vs ets. > > Do you have any tips or suggestions apart from those given in the > Efficiency Guide? > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.koch@REDACTED Fri Dec 14 14:46:19 2007 From: david.koch@REDACTED (=?iso-8859-1?Q?david.koch@libertysurf.fr?=) Date: Fri, 14 Dec 2007 14:46:19 +0100 Subject: [erlang-questions] =?iso-8859-1?q?REF=3A_Pocket_PC_incarnation_?= =?iso-8859-1?q?=3F?= Message-ID: It's now some months I tried to get Erlang running on my Pocket PC running under Windows Mobile 5 (aka Windows CE 2005). As things are Cygwin dependant, and that it's not yet converted to Windows CE, I tried to follow another path. From what I read here http://www.bluishcoder.co.nz/2007/02/factor-on-windows-mobile-5.html there is some ways to bypass Cygwin by using another method of compilation, eg CeGcc which can be found here http://cegcc.sourceforge.net/ ! Some helper files might obviously be found here http://mamaich.uni.cc/fr_pocket.htm The latests CeGcc file packages are currently only available under Linux http://sourceforge.net/project/showfiles.php?group_id=173455&package_id=198682 Is there another path to get things compiling under Windows OS (best fit would be eVC4) or just remove/decrease legacy *Nix dependencies ? I think I'm close to completion, yet it's still somewhat frustrating having basic compile error such 'long long not permited'... Then the following task would be to open nodes accross Wi-Fi links on Windows Mobile 5 compatible devices that support such communication model :) Kochise ------------------------ ALICE C'EST ENCORE MIEUX AVEC CANAL+ LE BOUQUET ! --------------- D?couvrez vite l'offre exclusive ALICEBOX et CANAL+ LE BOUQUET, en cliquant ici http://alicebox.fr Soumis ? conditions. From ulf.wiger@REDACTED Fri Dec 14 14:52:35 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 14 Dec 2007 14:52:35 +0100 Subject: [erlang-questions] Percept profiler In-Reply-To: <8268eea30712140257q3e9327ew22df0aac9172528c@mail.gmail.com> References: <3078210B-F5EB-4D06-8AB4-637DC333A509@gmail.com> <8268eea30712140257q3e9327ew22df0aac9172528c@mail.gmail.com> Message-ID: <47628AA3.5050206@ericsson.com> Andreas Hillqvist skrev: > I got in contact with Bj?rn-Egil Dahlberg, who wrote a thesis on > "Profiling applications in Erlang Symmetrical MultiProcessing system". > I do not believe the thesis is public available. But you can find an > early draft online: > http://www.cs.umu.se/~tm99bdg/documents/thesis-v.0.3.pdf A few statements in the early draft could use some polishing (no surprise there, of course...) Especially, perhaps, this, on page 15: "However, with the new runtime technique some performance issues has arisen. Instead of good speedup, no speedup or even slowdown has plauged the tested systems." While I agree that there is definitely room for improvement in SMP Erlang, and not all programs benefit from SMP, this statement doesn't reflect that there have also been significant successes with SMP Erlang. For example, we (Ericsson) have delivered commercial products to customers, where we measured a 1.7x-1.9x speedup when going from single-core to dual-core, depending on traffic case. For a complex, real-life application, I would say that qualifies as good speedup, esp since the work required to adapt and verify the app to multicore was minimal. http://www.sics.se/files/projects/multicore/day2007/UlfW.pdf BR, Ulf W > > I sent an e-mail to, Bj?rn-Egil Dahlberg, he gave my some insights. > > I have translated his answer from Swedish: > -----Original Message----- > From: Bj?rn-Egil Dahlberg > Sent: 2007-11-13 16:56 > > Profiling is activated though a special BIF, erlang:system_profile/2. > Through it you could specify if you would like to monitor Erlang > process, ports or schedule threads. > > Through monitoring Erlang process you could measure parallelity in > your applications and hopfully identify bottlenecks in your system. It > dose not state how well erts utilize the CPUs. For that you could use > the scheduler. > > The monitoring is performed by identifying parallel primative (send, > receive, spawn, suspend, etc) in the runtime system. When a event is > triggered by a matching state transition a message together with a > time stamp and MFA is sent to the Pid/Port you have assigned as > listener. This is similar to erlang:trace. > > I(Bj?rn-Egil) have made a rugh simplification and divided the process > states into two parallel states: running, runnable, exiting -> active, > waiting, suspend -> inactive > > system_profile(Pid, [scheduler]) monitors the scheduler (Those threads > that are actually running Erlang processes on the OS). > They are often mapped 1-1 against the number of processors/cores that > exist on the system. (But some problems still persist) > > Evan ports may be monitored, but this is not as interesting. Some > callbacks are queued and are considered as runnables (active), when > they run (active) and i other case non running (inactive). > > There will be a new OTP-application , Percept. Percept stands for, > Percept - Erlang Concurrency Profiling Tool. > The thought behind it was to offer a better overview of the data. > Amongst other through graphs parallelity over time. > -----End Original Message----- > > I have not tried Percept, yet. I think this tool will be useful to > help you find bottle necks. > I.e. Many "worker" process waits for a single server/process to reply. > > > Kind regards > Andreas Hillqvist > > 2007/12/14, Joel Reymont : >> I see documentation on the Percept profiler API but could someone >> explain the purpose of this tool? >> >> What is a "Concurrency Profiler"? >> >> When and where should it be used? >> >> Thanks, Joel >> >> -- >> http://wagerlabs.com >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From joelr1@REDACTED Fri Dec 14 15:01:42 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 14:01:42 +0000 Subject: [erlang-questions] Mnesia vs When Databases Lie: Consistency vs Availability in Distributed Systems Message-ID: <27B2B9B5-F00A-44B1-BB26-51EEAA6DFB71@gmail.com> How does Erlang change or improve this situation? http://tinyurl.com/2745ha I can't imagine a fragmented Mnesia table would help here, not when one chunk lives in Europe and another in the US. I also imagine there would be significant costs in Transatlantic replication (in terms of transaction time, not dollars) if a regular distributed Mnesia table is used. I want to dig deep into Mnesia for the corresponding chapter of my book. I plan to try to figure out and write up the distributed commit protocol, for example. I think I'll also try to set up exactly the scenario that the above article describes (two machines, multiple Mnesia nodes) and simulate denial of service attacks, tripping over power cords, etc. I want to know exactly how much network bandwidth is taken by replication among other things and what exactly happens when I bring up a Mnesia node that went down. There was a discussion of this recently but nothing beats a step by step explanation. Thanks, Joel -- http://wagerlabs.com From kenneth.lundin@REDACTED Fri Dec 14 15:14:22 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 14 Dec 2007 15:14:22 +0100 Subject: [erlang-questions] Percept profiler In-Reply-To: <3078210B-F5EB-4D06-8AB4-637DC333A509@gmail.com> References: <3078210B-F5EB-4D06-8AB4-637DC333A509@gmail.com> Message-ID: Hi Joel, Have you read the documentation for percept (i.e the user guide?) For short: Percept is a tool for profiling on application level (meaning Erlang processes and ports). Percept can show the level of parallellism that the application allows. For example if you only have one Erlang process that performs all the computation you can obviously not gain anything even if the SMP support in the VM is very good. Other things on application level that prohibits parallell execution is if all computation passes through one process which then becomes a bottleneck. Etc. Etc. Percept can find the bottlenecks (hinders for parallelism) in the application. Profiling of how well the Erlang VM supports parallelism is a completely different thing which requires other tools. /Kenneth On 12/14/07, Joel Reymont wrote: > I see documentation on the Percept profiler API but could someone > explain the purpose of this tool? > > What is a "Concurrency Profiler"? > > When and where should it be used? > > Thanks, Joel > > -- > http://wagerlabs.com > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From joelr1@REDACTED Fri Dec 14 15:18:23 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 14:18:23 +0000 Subject: [erlang-questions] Percept profiler In-Reply-To: References: <3078210B-F5EB-4D06-8AB4-637DC333A509@gmail.com> Message-ID: <1BF7DB7D-5275-42B3-9C62-07D20A290BDA@gmail.com> On Dec 14, 2007, at 2:14 PM, Kenneth Lundin wrote: > Have you read the documentation for percept (i.e the user guide?) Mea Culpa. I undestood the User's Guide link to be something else and was looking at the API and man page. > Profiling of how well the Erlang VM supports parallelism is a > completely different thing which requires other tools. Would you elaborate on how this should be done? Thanks, Joel -- http://wagerlabs.com From kenneth.lundin@REDACTED Fri Dec 14 15:23:03 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 14 Dec 2007 15:23:03 +0100 Subject: [erlang-questions] REF: Pocket PC incarnation ? In-Reply-To: References: Message-ID: Do you really need to run Cygwin on the Windows CE? Cygwin is only required to make the build process work. I suppose there are cross development tools and libraries which are to be run in a Windows XP, 2000 or Vista environment that can be used from Cygwin. /Kenneth On 12/14/07, david.koch@REDACTED wrote: > It's now some months I tried to get Erlang running on my > Pocket PC running under Windows Mobile 5 (aka Windows CE > 2005). As things are Cygwin dependant, and that it's not yet > converted to Windows CE, I tried to follow another path. > >From what I read here > http://www.bluishcoder.co.nz/2007/02/factor-on-windows-mobile-5.html > there is some ways to bypass Cygwin by using another method > of compilation, eg CeGcc which can be found here > http://cegcc.sourceforge.net/ ! Some helper files might > obviously be found here http://mamaich.uni.cc/fr_pocket.htm > > The latests CeGcc file packages are currently only available > under Linux > http://sourceforge.net/project/showfiles.php?group_id=173455&package_id=198682 > > Is there another path to get things compiling under Windows > OS (best fit would be eVC4) or just remove/decrease legacy > *Nix dependencies ? I think I'm close to completion, yet > it's still somewhat frustrating having basic compile error > such 'long long not permited'... Then the following task > would be to open nodes accross Wi-Fi links on Windows Mobile > 5 compatible devices that support such communication model :) > > Kochise > > ------------------------ ALICE C'EST ENCORE MIEUX AVEC CANAL+ LE BOUQUET ! --------------- > D?couvrez vite l'offre exclusive ALICEBOX et CANAL+ LE BOUQUET, en cliquant ici http://alicebox.fr > Soumis ? conditions. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From joelr1@REDACTED Fri Dec 14 15:34:28 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 14:34:28 +0000 Subject: [erlang-questions] RamSan and the EveOnline architecture Message-ID: "EVE Online is the world's largest game universe with over 75,000 dedicated subscribers who play this Massively Multiplayer Online Role- playing Game (MMORPG) in a single, connected environment." "Players connect to the game servers via the Internet and interact in real time with other players worldwide. EVE Online is truly a massive multiplayer game, where all 75,000 plus subscribers inhabit the same game world, not split into smaller limited groups or "shards". http://myeve.eve-online.com/devblog.asp?a=blog&bid=286 Among other interesting things: "Our SQL problems were essentially exterminated recently when we got our RAMSAN-400" The problem: "The EVE Online application software was running fast and scaling well to accommodate tens of thousands of simultaneous users with its 150 IBM servers. However, the system's storage was being overwhelmed with huge amounts of small data requests. Ideal RAID Storage performance is achieved when the requested data blocks are large; conversely, RAID Storage performance is greatly reduced when requested data blocks are small. Typical disk access times are 2-5 milliseconds and what was needed was a faster disk access time of 20-50 microseconds." And the solution: "The RamSan-400 delivers 400,000 I/Os per second, has 3,000 MB of internal bandwidth with latency of less than 15 microseconds. "We did consider upgrading to faster disks, but the specs for the RamSan were so insane that we had to look into it", said J?rundur Matth?asson, Database Manager for CCP Games." "EVE Online's underlying storage bottleneck is a classic problem with Online Transaction Processing. 10,000+ users accessing account information, warping across the galaxy, buying goods from black-market free-lance smugglers and upgrading their mining frigates to assault cruisers all at the same time puts immense stress on disk-based storage. The game makes 60 million process calls per day with around 1,250 transactions per second at peak hours. The RamSan-400, based on solid-state disk (SSD) technology, is ideal for applications that have massive amounts of transactions randomly distributed across the storage media. Where disks are limited by how fast a platter can spin, SSD uses memory chips to read and write data. Transactions run as fast as the server can issue, and are not bottlenecked by grinding disk heads." And the RamSan article: http://www.superssd.com/success/ccpgames.htm Mnesia on a RamSan anyone? Thanks, Joel -- http://wagerlabs.com From kenneth.lundin@REDACTED Fri Dec 14 15:37:47 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 14 Dec 2007 15:37:47 +0100 Subject: [erlang-questions] Percept profiler In-Reply-To: <1BF7DB7D-5275-42B3-9C62-07D20A290BDA@gmail.com> References: <3078210B-F5EB-4D06-8AB4-637DC333A509@gmail.com> <1BF7DB7D-5275-42B3-9C62-07D20A290BDA@gmail.com> Message-ID: On 12/14/07, Joel Reymont wrote: > > On Dec 14, 2007, at 2:14 PM, Kenneth Lundin wrote: > > > Have you read the documentation for percept (i.e the user guide?) > > Mea Culpa. I undestood the User's Guide link to be something else and > was looking at the API and man page. > > > Profiling of how well the Erlang VM supports parallelism is a > > completely different thing which requires other tools. > > > Would you elaborate on how this should be done? Profiling the Erlang VM (which is a C-program using threads) is not supported by tools that are or will be delivered in the Erlang/OTP distribution. The profiling here is done with "ordinary" tools for C and C++ programmers. Example of such a tool "commercial" are: VTUNE including threadchecker etc.from Intel Note that profiling of the VM is for the implementors of the VM and maybe some few highly skilled users which don't understand why they don't get the performance they expected. It is certainly nothing for most of the users developing Erlang programs. /Kenneth Erlang/OTP team at Ericsson > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > > From ulf.wiger@REDACTED Fri Dec 14 15:40:40 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 14 Dec 2007 15:40:40 +0100 Subject: [erlang-questions] Mnesia vs When Databases Lie: Consistency vs Availability in Distributed Systems In-Reply-To: <27B2B9B5-F00A-44B1-BB26-51EEAA6DFB71@gmail.com> References: <27B2B9B5-F00A-44B1-BB26-51EEAA6DFB71@gmail.com> Message-ID: <476295E8.1060409@ericsson.com> Ok, I only browsed the article with half an eye, so I may be firing prematurely, but... If you look at mnesia_frag, it allows you to exercise some control over the distribution of objects into fragments. If you have a structured key {Continent, ...}, you could select a fragment from a subset of fragments on the right continent. These fragments could be replicated "intra-continentally", and you could perhaps guard against someone diving down to the bottom of the Atlantic and cutting the Transatlantic link, by implementing geographical redundancy (asynchronously logging events to a backup store on another continent.) BTW, there is an old slide kit, called Mnesia Internals. It's supposed to be available here: http://www.erlang-projects.org/Public/projects/erlangotp/mnesia_internals_sli/view but I'm getting a "Bad Gateway" error at the moment. BR, Ulf W Joel Reymont skrev: > How does Erlang change or improve this situation? > > http://tinyurl.com/2745ha > > I can't imagine a fragmented Mnesia table would help here, not when > one chunk lives in Europe and another in the US. > > I also imagine there would be significant costs in Transatlantic > replication (in terms of transaction time, not dollars) if a regular > distributed Mnesia table is used. > > I want to dig deep into Mnesia for the corresponding chapter of my > book. I plan to try to figure out and write up the distributed commit > protocol, for example. > > I think I'll also try to set up exactly the scenario that the above > article describes (two machines, multiple Mnesia nodes) and simulate > denial of service attacks, tripping over power cords, etc. > > I want to know exactly how much network bandwidth is taken by > replication among other things and what exactly happens when I bring > up a Mnesia node that went down. There was a discussion of this > recently but nothing beats a step by step explanation. > > Thanks, Joel > > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From david.koch@REDACTED Fri Dec 14 15:45:01 2007 From: david.koch@REDACTED (=?iso-8859-1?Q?david.koch@libertysurf.fr?=) Date: Fri, 14 Dec 2007 15:45:01 +0100 Subject: [erlang-questions] =?iso-8859-1?q?REF=3A_Pocket_PC_incarnation_?= =?iso-8859-1?q?=3F?= Message-ID: OK, will reset my working dev environment tonite and see where I'm stuck, blast the problem off the way, and get the device running Erlang held high in a hand of victory (sun shining in the background, angelic children's vocal, whatever to feel proud of the achieved task)... Kochise <- will defeat the final boss (Koopa ?), get the erlang princess free ! ---------- Initial Header ----------- From : "Kenneth Lundin" To : "david.koch@REDACTED" Cc : erlang-questions Date : Fri, 14 Dec 2007 15:23:03 +0100 Subject : Re: [erlang-questions] REF: Pocket PC incarnation ? Do you really need to run Cygwin on the Windows CE? Cygwin is only required to make the build process work. I suppose there are cross development tools and libraries which are to be run in a Windows XP, 2000 or Vista environment that can be used from Cygwin. /Kenneth On 12/14/07, david.koch@REDACTED wrote: > It's now some months I tried to get Erlang running on my > Pocket PC running under Windows Mobile 5 (aka Windows CE > 2005). As things are Cygwin dependant, and that it's not yet > converted to Windows CE, I tried to follow another path. > >From what I read here > http://www.bluishcoder.co.nz/2007/02/factor-on-windows-mobile-5.html > there is some ways to bypass Cygwin by using another method > of compilation, eg CeGcc which can be found here > http://cegcc.sourceforge.net/ ! Some helper files might > obviously be found here http://mamaich.uni.cc/fr_pocket.htm > > The latests CeGcc file packages are currently only available > under Linux > http://sourceforge.net/project/showfiles.php?group_id=173455&package_id=198682 > > Is there another path to get things compiling under Windows > OS (best fit would be eVC4) or just remove/decrease legacy > *Nix dependencies ? I think I'm close to completion, yet > it's still somewhat frustrating having basic compile error > such 'long long not permited'... Then the following task > would be to open nodes accross Wi-Fi links on Windows Mobile > 5 compatible devices that support such communication model :) > > Kochise > > ------------------------ ALICE C'EST ENCORE MIEUX AVEC CANAL+ LE BOUQUET ! --------------- > D?couvrez vite l'offre exclusive ALICEBOX et CANAL+ LE BOUQUET, en cliquant ici http://alicebox.fr > Soumis ? conditions. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > ------------------------ ALICE C'EST ENCORE MIEUX AVEC CANAL+ LE BOUQUET ! --------------- D?couvrez vite l'offre exclusive ALICEBOX et CANAL+ LE BOUQUET, en cliquant ici http://alicebox.fr Soumis ? conditions. From sean.hinde@REDACTED Fri Dec 14 15:56:19 2007 From: sean.hinde@REDACTED (Sean Hinde) Date: Fri, 14 Dec 2007 14:56:19 +0000 Subject: [erlang-questions] RamSan and the EveOnline architecture In-Reply-To: References: Message-ID: On 14 Dec 2007, at 14:34, Joel Reymont wrote: > Mnesia on a RamSan anyone? Yep. It works well. Sean From michal@REDACTED Fri Dec 14 15:56:54 2007 From: michal@REDACTED (Michal Slaski) Date: Fri, 14 Dec 2007 15:56:54 +0100 Subject: [erlang-questions] =?iso-8859-1?q?ErlLounge_in_Krak=F3w=2C_Poland?= In-Reply-To: References: Message-ID: <84d062da0712140656t5fb81fc6x9f5a50abc0723b6c@mail.gmail.com> Hi, If there are any erlangers on this list that would like to join us on the 18th of December for ErlLounge in Krakow, please send me an email, as the actual presentation on Erlang will start at 20.00 and will be held at the AGH University of Science and Technology. If you are interested in receiving emails about future meetings in Krakow and Poland, please subscribe to http://tech.groups.yahoo.com/group/erlang-krakow/ Cheers, -- Michal Slaski http://www.erlang-consulting.com From joelr1@REDACTED Fri Dec 14 15:59:00 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 14:59:00 +0000 Subject: [erlang-questions] Adding and removing linked-in drivers Message-ID: <2EC96723-3D7F-4A7C-A7F8-834E7024CF1F@gmail.com> It's apparently possible to add and remove drivers from a running driver. The man page for erl_driver says "A driver can add and later remove drivers." Why was this feature added in the first place and when is it useful? Thanks, Joel -- http://wagerlabs.com From joelr1@REDACTED Fri Dec 14 16:18:16 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 15:18:16 +0000 Subject: [erlang-questions] Linked-in drivers: driver_lock_driver and driver_create_port Message-ID: <2E00FB98-B658-4805-A1B9-8B0821A2DDFB@gmail.com> What is the advantage of locking a driver in memory with driver_lock_driver to make it behave like one of Erlang's statically linked drivers? Also, when should I use driver_create_port? I can't see a case where I would want to create a port from within a driver. Thanks, Joel -- http://wagerlabs.com From james.hague@REDACTED Fri Dec 14 16:23:04 2007 From: james.hague@REDACTED (James Hague) Date: Fri, 14 Dec 2007 09:23:04 -0600 Subject: [erlang-questions] Proper benchmarking In-Reply-To: <6344005f0712140441na85eb4at9b0b77a7e94f1aea@mail.gmail.com> References: <3FDB7B76-6314-4018-807B-F6DDC155840D@gmail.com> <6344005f0712140441na85eb4at9b0b77a7e94f1aea@mail.gmail.com> Message-ID: > Just mention timer:tc(M,F,A) as the ultimate beginners profiling tool, > before you venture into anything more advanced. Took a while for me when I > was a beginner to find that out. Fprof, cprof, eprof etc are mentioned > before this in the efficiency guide which in my opinion is the wrong way > around. On a related note, e/f/c/prof are completely buried in the docs. I spent a good 10 minutes last night trying to find them. Yes, they're in the index, but to get to them from the main doc page, you have to choose "Tool Applications" and then "Tools." C'mon, just add a top-level section called "Debugging and Profiling Tools." From james.hague@REDACTED Fri Dec 14 16:43:02 2007 From: james.hague@REDACTED (James Hague) Date: Fri, 14 Dec 2007 09:43:02 -0600 Subject: [erlang-questions] How to track down R12B stability problems under Windows? Message-ID: These days I'm mostly using Erlang on my trusty Mac Book, but I still use it now and again under Windows. Last night I installed R12B on my Windows XP SP2 machine at home. I recompiled the modules I was interested in and tested some image decoding code I wrote a few years ago. It more or less went like this: compile a module run some tests compile the same module CRASH: Visual C++ runtime library error restart werl run some tests compile the same module CRASH: Visual C++ runtime library error The crash was always during a compile, but not every time. How can I track this down? From rickard.s.green@REDACTED Fri Dec 14 16:51:15 2007 From: rickard.s.green@REDACTED (Rickard Green) Date: Fri, 14 Dec 2007 16:51:15 +0100 Subject: [erlang-questions] Source patch for R12B-0 available In-Reply-To: <26B04CE34936014297D381585CCE89B042B459@MTNMAIL1.mtn.co.za> References: <26B04CE34936014297D381585CCE89B042B459@MTNMAIL1.mtn.co.za> Message-ID: <4762A673.10601@ericsson.com> 'kill -ABRT' the emulator when you are sure the emulator hangs (i.e. 0% cpu utilization after quite a while). Make the following available for download: * A complete build log including the environment (use 'script' to capture printouts and type 'env' to print the environment). * The whole source tree you've built in and the core generated (pack with gnu tar). I'll have a look at it, and try to figure out what is going on. By the way: Have anyone else tried to build R12B-0 with the patch on solaris 10 sparc64? If so, did it fail or succeed? BR, Rickard Green, Erlang/OTP, Ericsson AB. Ognian Pantov [ MTN - Innovation Centre ] wrote: > Hi, > > I manage to build R12B-0 Erlang 64 bit with the patch on T2000 without SMP support: > > env CC=/tmp/gcc64 ./configure --disable-smp-support --prefix=/usr/local/erlang/R12B-0 > > We can build R12B-0 on the same machine with the same OS using the same procedure: > - 64 bit with SMP support, no patch > - 64 bit with patch, NO SMP > > We can't build 64 bit with SMP support with the patch. > > It seems that the patch and SMP don't work together on Netra T2000. > > Best regards > Ognian > > -----Original Message----- > From: Rickard Green [mailto:rickard.s.green@REDACTED] > Sent: Thursday, 13 December 2007 05:42 > To: Ognian Pantov [ MTN - Innovation Centre ] > Cc: Valentin Micic; Kenneth Lundin; Sean Hinde; Erlang/OTP discussions; > waynes@REDACTED > Subject: Re: [erlang-questions] Source patch for R12B-0 available > > > > $ uname -a > SunOS xxx 5.10 Generic_125100-10 sun4u sparc SUNW,Ultra-5_10 > > BR, > Rickard Green, Erlang/OTP, Ericsson AB. > > Ognian Pantov [ MTN - Innovation Centre ] wrote: >> Hi, >> >> We can build R12B-0 without the patch on Netra T2000 (SMP) and Netra 440 (No SMP) using Sun tar or GNU tar, with or without -64 flag passed to ld. There is no other Erlang on the box. >> >> We can't build R12B-0 with the patch on Netra T2000 and Netra 440 using Sun tar or GNU tar, with or without -64 flag passed to ld. There is no other Erlang on the box. >> >> What is the hardware you are using to build Solaris 10? >> >> If do env CC=/tmp/gcc64 ./configure --enable-smp-support --prefix=/usr/local/erlang/R11-1 on Netra 440 using R11B-1 we got: >> >> checking whether an emulator with smp support should be built... yes; enabled by user >> configure: error: cannot build smp enabled emulator since hardware platform (ultrasparc wordsize=8) is not supp >> orted >> configure: error: /export/home/smscproj/install/otp_src_R11B-1/erts/configure failed for erts >> >> If we do env CC=/tmp/gcc64 ./configure --enable-smp-support --prefix=/usr/local/erlang/R12B-0 >> configure finish successfully! We can build OK without patch and we fail to build with the patch. >> >> Best regards >> Ognian >> >> -----Original Message----- >> From: Rickard Green [mailto:rickard.s.green@REDACTED] >> Sent: Thursday, 13 December 2007 01:15 >> To: Valentin Micic >> Cc: Ognian Pantov [ MTN - Innovation Centre ]; Kenneth Lundin; Sean >> Hinde; Erlang/OTP discussions; waynes@REDACTED >> Subject: Re: [erlang-questions] Source patch for R12B-0 available >> >> >> Valentin Micic wrote: >>> Not sure how is gnu tar related to the problem, but we'll try... >>> >> As far as I know solaris tar and gnu tar are slightly incompatible, and >> that you might get silent errors if you extract using solaris tar. I'm >> no tar expert, though, I might be wrong, but by using gnu tar you will >> at least remove one possible error source. >> >>> When we've run "truss" command using 'erlc' and arguments as indicated >>> immediately when build "hangs", the execution fails because it cannot >>> locate 'erl'. Unfortunately, the 'erl' hasn't been build at this point, >>> so I am at loss... it appears to me that 'erlc' is invoked to early, >>> that is to say, before 'erl' has been created. Thus, two questions for >>> your consideration, if you please: >>> >>> 1) Could it be that patch is inserted at a wrong place; >> Perhaps, but I've also used gpatch (version 2.5.4), and it works for me. >> You could try to apply the patch manually if you want. Modify all files >> included in the patch manually except for otp_src_R12B-0/configure, and >> otp_src_R12B-0/erts/configure then cd into otp_src_R12B-0 and run >> "./otp_build autoconf" (you need to have autoconf 2.59 in your path). If >> you search for "diff -Naur" in the patch file, you will easily find the >> beginning of each diff. >> >>> 2) Could it be that your build is successful because you do have erl >>> somewhere in your path (I mean erl that you've build before via separate >>> build) -- I've checked it over and over again: erlc will try to invoke >>> erl using any path specified in your $PATH variable. >>> >> The top makefile puts the bootstrap/bin directory (where the bootstrap >> erl and erlc resides) first in your path during the build. I've also >> successfully built it without any erl and erlc in the path and without >> ERLC_EMULATOR set, and also using the runtime system with resp. without >> smp support. >> >> You could also try to enable/disable smp support for erlc by putting >> -smpenable/-smpdisable in the ERL_ZFLAGS environment variable before >> building and see if it makes any difference. >> >> BR, >> Rickard Green, Erlang/OTP, Ericsson AB. >> >>> Thanks for your effort so far. >>> >>> Kind Regards, >>> V. >>> >>> >>> ----- Original Message ----- From: "Rickard Green" >>> >>> To: "Ognian Pantov [ MTN - Innovation Centre ]" >>> Cc: "Kenneth Lundin" ; "Sean Hinde" >>> ; "Erlang/OTP discussions" >>> ; ; "Valentin >>> Micic" >>> Sent: Wednesday, December 12, 2007 2:05 PM >>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>> >>> >>>> It builds fine for me on solaris 10. >>>> >>>> Are you extracting the tar file with gnu tar? If not, you need to. >>>> >>>> Instead of using CC I put a script called gcc (similar to yours) in >>>> the path and also a script called ld (passing -64 as argument to ld) >>>> in the path. >>>> >>>> I use gcc 3.4.4. >>>> >>>> BR, >>>> Rickard Green, Erlang/OTP, Ericsson AB. >>>> >>>> >>>> Ognian Pantov [ MTN - Innovation Centre ] wrote: >>>>> Hi, >>>>> >>>>> We are having a problem making R12B-0 with the patch on Solaris 10. >>>>> We can make and run R12B-0 without the patch on the same machine. See >>>>> below for details of our environment. When we are trying to make >>>>> R12B-0 with the patch, make hangs when is trying to compile >>>>> hipe_rtl_arch.erl file. >>>>> ********************************************************************************************************* >>>>> >>>>> make[2]: Leaving directory >>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/parsetools' >>>>> make[2]: Entering directory >>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' >>>>> make[2]: Nothing to be done for `opt'. >>>>> make[2]: Leaving directory >>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' >>>>> make[2]: Entering directory >>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe' >>>>> Makefile:35: warning: overriding commands for target `docs' >>>>> /export/home/smscproj/install/otp_src_R12B-0/make/otp_subdir.mk:28: >>>>> warning: ignoring old commands for target `docs' >>>>> === Entering application hipe >>>>> make[3]: Entering directory >>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe/rtl' >>>>> /export/home/smscproj/install/otp_src_R12B-0/bin/sparc-sun-solaris2.10/hipe_mkliterals >>>>> -e > hipe_literals.hrl >>>>> erlc -W +debug_info +warn_obsolete_guard +inline -o../ebin >>>>> hipe_rtl_arch.erl >>>>> >>>>> !!! We stay here till we kill the process! >>>>> ******************************************************************************************************** >>>>> >>>>> The command patch doesn't support -Z option on Solaris (it does on >>>>> Linux) and we use gpatch instead. >>>>> We try to patch the source code on Linux and make on Solaris - the >>>>> result is the same the process hangs during compilation on >>>>> hipe_rtl_arch.erl. >>>>> >>>>> We tryed to compile hipe_rtl_arch.erl manually but environment >>>>> doesn't seem to be ready yet. >>>>> >>>>> Any ideas what may cuase this problem? >>>>> >>>>> Best regards >>>>> Ognian >>>>> >>>>> --------------------------Environment-------------------------------------------- >>>>> >>>>> The make for R12B-0 with and without patch is done on the same >>>>> machine using the same procedure. >>>>> We are using Sun Netra-T2000 running Solaris 10 patch level >>>>> 125100-05. We use GCC 3.4.6. >>>>> >>>>> To compile 64 bit code we do: >>>>> >>>>> cat>/tmp/gcc64 >>>>> #!/bin/sh >>>>> exec gcc -m64 "$@" >>>>> ^D >>>>> >>>>> chmod +x /tmp/gcc64 >>>>> >>>>> Every time we make we remove the old otp_src_R12B-0 directory and >>>>> start from scratch. >>>>> >>>>> tar -xvf otp_src_R12B-0.tar >>>>> gpatch -ZNp0 < otp_src_R12B-0-osp1.patch ( only with patch ) >>>>> >>>>> env CC=/tmp/gcc64 ./configure --enable-smp-support >>>>> --prefix=/usr/local/erlang/R12B-0 >>>>> make >>>>> --------------------------------------------------------------------------------------- >>>>> >>>>> >>>>> >>>>> -----Original Message----- >>>>> From: Kenneth Lundin [mailto:kenneth.lundin@REDACTED] >>>>> Sent: Monday, 10 December 2007 02:33 >>>>> To: Valentin Micic >>>>> Cc: Sean Hinde; Rickard Green; Erlang/OTP discussions; Ognian Pantov [ >>>>> MTN - Innovation Centre ]; waynes@REDACTED >>>>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>>>> >>>>> >>>>> Hi, >>>>> >>>>> Since the combination SMP and 64 bit sparc apparently never has worked >>>>> in R11B you can't have any system in service dependent on this patch >>>>> do you? >>>>> >>>>> So if you are planning on using the SMP emulator for the first time >>>>> in a product >>>>> I would really recommend that you put your old policy away and go for >>>>> R12B. >>>>> >>>>> The reasons for that are in my opinion many: >>>>> - R12B is the most stable version with best performance when it comes >>>>> to SMP execution. >>>>> R12B is the version where we will have regular service releases with >>>>> patches and >>>>> improvements. >>>>> R12B is the version where improvements regarding SMP will appear. >>>>> R12B is the version where we may support more platforms. >>>>> Bugs found by open source users in R12B AND PREVIOUS releases will be >>>>> corrected in R12B-1, 2, ..., etc. >>>>> >>>>> /Regards Kenneth Erlang/OTP team, Ericsson AB >>>>> >>>>> On 12/9/07, Valentin Micic wrote: >>>>>> May I second what Sean is asking for? >>>>>> I would really appreciate a fix for R11B-5 -- we have a policy not >>>>>> to run >>>>>> the latest release on production systems, and absence of the patch >>>>>> would >>>>>> force us to do so. Make no mistake, I really like what I saw in R12 >>>>>> so far, >>>>>> but we'd like to migrate on our own pace. >>>>>> Your cooperation will be *highly* appreciated. >>>>>> >>>>>> Valentin Micic >>>>>> Principal Consultant >>>>>> PHAROS CONSVLTING (PTY) LTD. >>>>>> Cell: +27 83 212 9180 >>>>>> >>>>>> ----- Original Message ----- >>>>>> From: "Sean Hinde" >>>>>> To: "Rickard Green" >>>>>> Cc: "Erlang/OTP discussions" >>>>>> Sent: Sunday, December 09, 2007 1:51 AM >>>>>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>>>>> >>>>>> >>>>>>> Hi Rikard, >>>>>>> >>>>>>> Do you have any plans to release a patch for those using R11B-5 on 64 >>>>>>> bit sparc? I'm thinking mainly of the OTP-7006 issue, initially >>>>>>> reported on R11B-5. >>>>>>> >>>>>>> Thanks, >>>>>>> Sean >>>>>>> >>>>>>> On 7 Dec 2007, at 14:17, Rickard Green wrote: >>>>>>> >>>>>>>> A patch that fixes the following issues is now available at >>>>>>>> http://www.erlang.org/download.html . Instructions for applying >>>>>>>> the patch can be found in the patch README. >>>>>>>> >>>>>>>> BR, >>>>>>>> Rickard Green, Erlang/OTP, Ericsson AB. >>>>>>>> >>>>>>>> ------------------------------------------------------------------------ >>>>>>>> >>>>>>>> >>>>>>>> OTP-7006 The SMP emulator on sparc64 erroneously used the sparc32 >>>>>>>> atomic and the sparc32 spinlock implementations which >>>>>>>> caused it to crash. >>>>>>>> >>>>>>>> OTP-7012 Matching an empty binary in a record and then using the >>>>>>>> same record again could cause a compiler crash. >>>>>>>> >>>>>>>> Example code that triggers the crash: >>>>>>>> >>>>>>>> -record(r, {a,b}). >>>>>>>> t(R) -> >>>>>>>> #r{a = <<>>} = R, >>>>>>>> R#r.b. >>>>>>>> >>>>>>>> OTP-7013 file:read/2 and file:consult_stream/1,3 did not use an >>>>>>>> empty >>>>>>>> prompt on I/O devices. This bug has now been corrected. >>>>>>>> >>>>>>>> OTP-7014 configuring --enable-darwin-universal or --enable- >>>>>>>> darwin-64bit >>>>>>>> on MacOSX could result in a non optimized emulator. Top >>>>>>>> level >>>>>>>> configure script now corrected. >>>>>>>> >>>>>>>> OTP-7015 configuring --with-gd did not produce correct include flags >>>>>>>> for percept. >>>>>>>> >>>>>>>> ------------------------------------------------------------------------ >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> erlang-questions mailing list >>>>>>>> erlang-questions@REDACTED >>>>>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>>>> _______________________________________________ >>>>>>> erlang-questions mailing list >>>>>>> erlang-questions@REDACTED >>>>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>>> _______________________________________________ >>>>>> erlang-questions mailing list >>>>>> erlang-questions@REDACTED >>>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>>> >>>>> NOTE: This e-mail message is subject to the MTN Group disclaimer see >>>>> http://www.mtn.co.za/default.aspx?pid=34411 >> NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 >> > NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411 > From kenneth.lundin@REDACTED Fri Dec 14 17:10:07 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 14 Dec 2007 17:10:07 +0100 Subject: [erlang-questions] How to track down R12B stability problems under Windows? In-Reply-To: References: Message-ID: Hi, Some more questions. Have you built it your self or are you using the binary that we deliver. Is it running the SMP version or the non SMP version of the VM ? SMP is automatically started on a dual core processor. When you installed did you then install the VC++ runtime lib that we provided or do you have you own. If the installer detected that you already had a VC++ runtime lib it would be interesting if you tried to force intallation of the runtime lib provided by us. If you have Visual C++ we can send you a binary with PDB files so you can locate the crash in the debugger. Or you can dump with the debugger and send the data to us for analyze. /Kenneth Erlang/OTP team at Ericsson On 12/14/07, James Hague wrote: > These days I'm mostly using Erlang on my trusty Mac Book, but I still > use it now and again under Windows. > > Last night I installed R12B on my Windows XP SP2 machine at home. I > recompiled the modules I was interested in and tested some image > decoding code I wrote a few years ago. It more or less went like > this: > > compile a module > run some tests > compile the same module > CRASH: Visual C++ runtime library error > restart werl > run some tests > compile the same module > CRASH: Visual C++ runtime library error > > The crash was always during a compile, but not every time. How can I > track this down? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From rsaccon@REDACTED Fri Dec 14 17:45:16 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Fri, 14 Dec 2007 14:45:16 -0200 Subject: [erlang-questions] Erlang IDE: easy AST access / method lookup ? Message-ID: I am experimenting with adding better Erlang support to TextMate (a Mac OS X Editor). I have added edoc lookup, see details and sceencast at: http://www.rsaccon.com/2007/12/erlang-textmate-integration.html project page: http://erlymate.googlecode.com/ however I found out that is not very easy to determine the exact link to the Erlang documentation for various reasons: - mapping HTML files to actual modules (I just crawled through and tested if is a modul) - arity of functions (thats tricky, I just quasi-parsed (or "guessed") the current line of source code) So my question is: Does there exist a *very simple way* to lookup the AST of a module to get the arity of a method ? By very simple I mean that I provide just the line number and column number as input. Traditionally parsing through the AST always involves a lot of coding effort, I have learned that with other Erlang projects .. regrads -- Roberto Saccon http://rsaccon.com From james.hague@REDACTED Fri Dec 14 18:49:54 2007 From: james.hague@REDACTED (James Hague) Date: Fri, 14 Dec 2007 11:49:54 -0600 Subject: [erlang-questions] How to track down R12B stability problems under Windows? In-Reply-To: References: Message-ID: On Dec 14, 2007 10:10 AM, Kenneth Lundin wrote: > > Have you built it your self or are you using the binary that we deliver. Pre-built binary. > Is it running the SMP version or the non SMP version of the VM ? > SMP is automatically started on a dual core processor. Whatever the default is. I'm using a P4: single-core but hyperthreaded. I'll try disabling SMP and see how that goes. > When you installed did you then install the VC++ runtime lib that we > provided or do you have you own. I used whatever the Erlang installer sets up. I didn't do anything special. Is there an option to force a specific VC++ runtime lib? > If you have Visual C++ we can send you a binary with PDB files so you can > locate the crash in the debugger. > > Or you can dump with the debugger and send the data to us for analyze. I have Visual C++, so I can do this, but sounds like I'd probably need to build from scratch. How do I "dump with the debugger"? James From rsaccon@REDACTED Fri Dec 14 19:23:20 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Fri, 14 Dec 2007 16:23:20 -0200 Subject: [erlang-questions] Erlang IDE: easy AST access / method lookup ? In-Reply-To: References: Message-ID: maybe I should explain better my problem: a typical link to the edoc (e.g.: locally stored on my PC) looks like this: file:///Users/rsaccon/opensource/otp_doc_html_R12B-0/lib/stdlib-1.15/doc/html/string.html#tokens/2 at the end you notice that here is a "/2" which represents the arity of the function I want to look up the edoc and my problem is to determine from a snippet of source code at a given position to determine the module and function and the arity of that function to construct the link. At my first approach I did that just with a few quick and dirty lines of code, which give expected results only in simple cases. On Dec 14, 2007 2:45 PM, Roberto Saccon wrote: > I am experimenting with adding better Erlang support to TextMate (a > Mac OS X Editor). I have added edoc lookup, see details and sceencast > at: > > http://www.rsaccon.com/2007/12/erlang-textmate-integration.html > > project page: http://erlymate.googlecode.com/ > > however I found out that is not very easy to determine the exact link > to the Erlang documentation for various reasons: > - mapping HTML files to actual modules (I just crawled through and > tested if is a modul) > - arity of functions (thats tricky, I just quasi-parsed (or "guessed") > the current line of source code) > > So my question is: > > Does there exist a *very simple way* to lookup the AST of a module to > get the arity of a method ? By very simple I mean that I provide just > the line number and column number as input. Traditionally parsing > through the AST always involves a lot of coding effort, I have learned > that with other Erlang projects .. > > regrads > -- > Roberto Saccon > http://rsaccon.com > -- Roberto Saccon http://rsaccon.com From jim.mccoy@REDACTED Fri Dec 14 20:40:15 2007 From: jim.mccoy@REDACTED (Jim McCoy) Date: Fri, 14 Dec 2007 11:40:15 -0800 Subject: [erlang-questions] RamSan and the EveOnline architecture In-Reply-To: References: Message-ID: You could also try using one of the more recent NAND solid-state drives. The performance numbers here (http://www.nextlevelhardware.com/storage/battleship/) of running raid 0 on a batch of these drives is pretty impressive, and for a much better price if you are not bottlenecked on write ops. jim From vances@REDACTED Fri Dec 14 21:23:14 2007 From: vances@REDACTED (Vance Shipley) Date: Fri, 14 Dec 2007 15:23:14 -0500 Subject: [erlang-questions] Proper benchmarking In-Reply-To: <3FDB7B76-6314-4018-807B-F6DDC155840D@gmail.com> References: <3FDB7B76-6314-4018-807B-F6DDC155840D@gmail.com> Message-ID: <20071214202313.GH1364@little-black-book.motivity.ca> On Fri, Dec 14, 2007 at 10:01:00AM +0000, Joel Reymont wrote: } I'm gathering information for an extensive chapter on efficiency } optimization. I will also try benchmarking various approaches in other } chapters, e.g. straight binary work vs. pickler combinators, different } types of interaction with a linked-in driver or gb_trees vs ets. } } Do you have any tips or suggestions apart from those given in the } Efficiency Guide? (Apologies in advance for the lengthy post) Joel's benchmarking questions made me wonder about estone. Back in the deep dark past there was a benchmark called "estone". You could compare different emulator versions or platforms using it's estone ratings. The FAQ currently has this to say: http://www.erlang.org/faq/faq.html#AEN795 The last reference to estone I could find is: http://www.erlang.org/pipermail/erlang-questions/2003-August/009557.html ... which says that estone is now part of the emulator test suite used with the test_server application: http://www.erlang.org/doc/apps/test_server So I had my first look at the test_server application. Let me just say that instant gratification was not the order of the day here. There is a webtool front end (vts) which was a good starting point however it absolutely insists on having a configuration file to start with and there are none to be found in the distribution. After a while I came to realize that the specification files (*.spec) refered to in test_server are a superset of the configuration files refered to in common_test. Now there do happen to be several .spec files in R12B-0: ~/lib/edoc/test/edoc.spec ~/lib/lib/inviso/test/inviso.spec ~/lib/lib/lib/megaco/test/megaco.spec ~/lib/lib/lib/lib/lib/percept/test/percept.spec ~/lib/lib/lib/lib/lib/lib/snmp/test/snmp.spec So where are the test specifications for OTP? I found them here: http://www.erlang.org/download/test_server/emulator-test-2004-05-26.tar.gz http://www.erlang.org/download/test_server/stdlib-test-2004-05-26.tar.gz These appear to be the missing test suites for the emulator and stdlib. So I had a go at running the emulator test suites (after make, emake) using the specification file emulator.spec for the configuration file which vts requires. So far so good, it runs the tests. However all the tests fail because the test suies do not export all/0. It seems like there has been a change from all(suite) to all() in the callback API. It is still documented as all(suite) with the exception of the example which follows how it seems to be implemented which is allow/0. So I patched the emulator test suites and was able to run it. 297 cases executed (of 297) 215 successful 82 failed 0 skipped One of the test suites was the estone I so fondly remember however it was sadly one of those which failed. It managed a number of tests but failed on large_dataset_work/1. The FAQ points us at Bj?rn Gustavsso's home page for benchmarks and from there I learn that the new benchmark is bstone (Bj?r's stone?) which I find here: http://www.erlang.org/download/bstone.tar.z This is nice and simple as it once was: $ erl Erlang (BEAM) emulator version 5.6 [source] [smp:2] [async-threads:0] [kernel-poll:false] Eshell V5.6 (abort with ^G) 1> c(bstone). {ok,bstone} 2> bstone:run(). lists(6400) msgp(1515) msgp_medium(1527) msgp_huge(52) pattern(1046) trav(2834) large_dataset_work(1193) large_local_dataset_work(1174) alloc(3710) bif_dispatch(1623) binary_h(581) ets(342) generic(7977) int_arith(4157) float_arith(5526) fcalls(882) timer(2312) links(30) [{seconds,3.98346},{stones,98543}] Nice. For the record though I did find it bombed out when started with a thread pool: $ erl +A 32 Erlang (BEAM) emulator version 5.6 [source] [smp:2] [async-threads:32] [kernel-poll:false] Eshell V5.6 (abort with ^G) 1> bstone:run(). lists(6400) msgp(1515) msgp_medium(1527) msgp_huge(52) pattern(1046) trav(2834) large_dataset_work(1193) large_local_dataset_work(1174) alloc(3710) bif_dispatch(1623) binary_h(581) ets(342) generic(7977) int_arith(4157) float_arith(5526) fcalls(882) timer(2312) links(30) =ERROR REPORT==== 14-Dec-2007::15:09:36 === Error in process <0.12396.0> with exit value: {noproc,[{erlang,link,[<0.12327.0>]},{bstone,lproc,4},{bstone,lproc,1}]} So the questions remain: Is there a bug(s) in test_server/common_test? Where are the up to date test suites for OTP? Is estone deprecated in favour of bstone? Is there a newer version of bstone? -Vance From vances@REDACTED Fri Dec 14 21:40:15 2007 From: vances@REDACTED (Vance Shipley) Date: Fri, 14 Dec 2007 15:40:15 -0500 Subject: [erlang-questions] Linked-in drivers: driver_lock_driver and driver_create_port In-Reply-To: <2E00FB98-B658-4805-A1B9-8B0821A2DDFB@gmail.com> References: <2E00FB98-B658-4805-A1B9-8B0821A2DDFB@gmail.com> Message-ID: <20071214204015.GI1364@little-black-book.motivity.ca> On Fri, Dec 14, 2007 at 03:18:16PM +0000, Joel Reymont wrote: } What is the advantage of locking a driver in memory with } driver_lock_driver to make it behave like one of Erlang's statically } linked drivers? I recently found this useful with a driver to a C API which had no facility to be unlinked. It would be nice if yu could load and unload the driver as needed however this particular library would crash if you tried to unload it. Unloading happens during shutdown so it would always crash. I just disabled unloading. -- -Vance From joelr1@REDACTED Fri Dec 14 22:11:41 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 21:11:41 +0000 Subject: [erlang-questions] Passing a C array to the emulator as an ErlIOVec Message-ID: Is there a way to pass a pointer to a C array to the emulator without copying? Can it be wrapped in an ErlIOVec perhaps? The docs say about ErlIOVec: "The I/O vector used by the emulator and drivers, is a list of binaries, with a SysIOVec pointing to the buffers of the binaries." Since SysIOVec points to the buffers of the binaries then is there any harm in the buffer being the C array in question? I suppose undocumented functions will need to be used to set up such an ErlIOVec but, again, is there any harm doing it? Thanks, Joel -- http://wagerlabs.com From vances@REDACTED Fri Dec 14 22:31:51 2007 From: vances@REDACTED (Vance Shipley) Date: Fri, 14 Dec 2007 16:31:51 -0500 Subject: [erlang-questions] Passing a C array to the emulator as an ErlIOVec In-Reply-To: References: Message-ID: <20071214213151.GJ1364@little-black-book.motivity.ca> Joel, I have some drivers which marshall C structs into binaries and deal with them in erlang. It's a bit tedious to put together but I think I've done a good job of having autotools (autoconf,automake,etc.) handle the portability and some of the library changes (e.g. changes to array sizes). The first thing to be sure of is that you've handled word alignment padding. An example driver is here: http://netaccess-erldrv.googlecode.com/svn/trunk/c_src/netaccess_drv.c http://netaccess-erldrv.googlecode.com/svn/trunk/include/iisdn.hrl.in http://netaccess-erldrv.googlecode.com/svn/trunk/src/iisdn.erl For each C struct in the API I implement a function: foo(#foo{}) -> binary() foo(binary()) -> #foo{} It's tedious to implement bt I've moved between Solaris 32 and 64 and to Linux automatically just by rerunning autotools. Hope that helps. -Vance From joelr1@REDACTED Fri Dec 14 22:49:02 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 21:49:02 +0000 Subject: [erlang-questions] Realistic uses cases for new driver threads and the driver timer Message-ID: <35BEBEAB-DC84-4951-9D9C-39BB7856DDA7@gmail.com> I would like to explain to the readers why they may want to use the new driver threads and the driver timer. I can show them how but I can't come up with the why. I would appreciate example use cases for each and suggestions for a simple but realistic example or two. Thanks in advance, Joel -- http://wagerlabs.com From joelr1@REDACTED Fri Dec 14 22:52:47 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 21:52:47 +0000 Subject: [erlang-questions] Passing a C array to the emulator as an ErlIOVec In-Reply-To: <20071214213151.GJ1364@little-black-book.motivity.ca> References: <20071214213151.GJ1364@little-black-book.motivity.ca> Message-ID: On Dec 14, 2007, at 9:31 PM, Vance Shipley wrote: > I have some drivers which marshall C structs into binaries > and deal with them in erlang. It's a bit tedious to put > together but I think I've done a good job Vance, thanks a lot for the examples. I'm thinking of wrapping a C block of memory in a binary, without copying it, to work on it in Erlang. The copying bit is a stickler, I absolutely do not want to copy, i.e. duplicate, the block of memory. Any way of accomplishing that, using undocumented features perhaps? Thanks, Joel -- http://wagerlabs.com From vances@REDACTED Fri Dec 14 23:22:19 2007 From: vances@REDACTED (Vance Shipley) Date: Fri, 14 Dec 2007 17:22:19 -0500 Subject: [erlang-questions] Passing a C array to the emulator as an ErlIOVec In-Reply-To: References: <20071214213151.GJ1364@little-black-book.motivity.ca> Message-ID: <20071214222219.GK1364@little-black-book.motivity.ca> On Fri, Dec 14, 2007 at 09:52:47PM +0000, Joel Reymont wrote: } I'm thinking of wrapping a C block of memory in a binary, } without copying it, to work on it in Erlang. The copying } bit is a stickler, I absolutely do not want to copy, i.e. } duplicate, the block of memory. Joel, Have a look at this thread: http://www1.erlang.org/pipermail/erlang-questions/2002-October/005858.html You don't get to choose whether or not it gets copied. But you can accomplish it if your binaries are big enough that the emulator wants to. -Vance From matthew@REDACTED Sat Dec 15 00:01:22 2007 From: matthew@REDACTED (Matthew Dempsky) Date: Fri, 14 Dec 2007 15:01:22 -0800 Subject: [erlang-questions] Realistic uses cases for new driver threads and the driver timer In-Reply-To: <35BEBEAB-DC84-4951-9D9C-39BB7856DDA7@gmail.com> References: <35BEBEAB-DC84-4951-9D9C-39BB7856DDA7@gmail.com> Message-ID: On 12/14/07, Joel Reymont wrote: > I would like to explain to the readers why they may want to use the > new driver threads and the driver timer. I can show them how but I > can't come up with the why. You've started multiple threads on this list using the basic template ``Hi guys, does anyone know about X in Erlang? Thanks.'' A book about using Erlang in production environments sounds very interesting to me, but these posts are rapidly lowering mine and others' expectations of it. It is my hope that if you write about Erlang driver threads and timers (or any topic), you will be writing from actual experience in using them in production or at least an environment where you impose production-like restrictions on yourself. Otherwise, it belongs in a blog post, not a book. From anders@REDACTED Fri Dec 14 23:50:15 2007 From: anders@REDACTED (Anders Ramsell) Date: Fri, 14 Dec 2007 23:50:15 +0100 Subject: [erlang-questions] : queues (previously: documentation of data structures) In-Reply-To: <20071212160247.GC11510@erix.ericsson.se> References: <200712070917.13979.bekesa@sch.bme.hu> <200712111344.25828.bekesa@sch.bme.hu> <475E8E41.5040603@lionet.info> <200712111516.50740.bekesa@sch.bme.hu> <20071212160247.GC11510@erix.ericsson.se> Message-ID: <476308A7.4060001@theheartofgold.org> > > Anyways, queue:lait/1 should be liat/1 shouldn't it? Both in > > the doc and impl. (It is the opposite of tail. The opposite of > > cons/2 is snoc/2, the opposite of head/1 is daeh/1 but > > lists:reverse("tail") /= "lait"). > > Oh yes!!! I was tired when I wrote it, then self-blind, and > nobody proofread. If I get a reason to touch the module I will > add liat/1, forget about lait/1 but keep it around for backwards > compatibility... (I'm going to stick my neck out now. Hope I don't get beheaded.) I think the API of the queue module is a mess. Full of weird names and functions that do the same thing. Quite unlike most other modules in stdlib. This is a pity because this module is very useful. Or at least it could be - I'll get back to that. If you're going to change it - change it a lot. My suggestion would be something along these lines. First remove a few functions. Function: Duplicate of: ------------------------ daeh last in_r cons lait init snoc in But we still have some weird names left. How do you 'init' a queue by removing something from it? And out_r isn't all that beautiful either. Then we have 'head' as the opposite of 'last'. I would rename those and a few more to get something that I think look like a "consistent" naming. Function: Rename to: --------------------- init drop_last out_r out_last head first tail drop_first cons in_first Of course all the old names would have to remain for a few versions for backwards compatibility reasons. Now back to what I hinted at before. The names of the API are important but what they do is of course much more important and the API is quite complete. But one, in my opinion, very important function is missing. This fact has kept me from using this module and roll my own on more than one occasion. There is no function that removes a specified item no matter where in the queue it is. Sometimes you just get tired of queueing. No matter what you think of the rest of this mail please add that function. Keeping to my own suggested names it could be called 'drop'. I know it can't be O(1) but that doesn't matter. Well? Will I know get pummeled into my shoes like the noob I am or do I have a point? /Anders From joelr1@REDACTED Sat Dec 15 00:41:13 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 14 Dec 2007 23:41:13 +0000 Subject: [erlang-questions] Book expectations In-Reply-To: References: <35BEBEAB-DC84-4951-9D9C-39BB7856DDA7@gmail.com> Message-ID: Matthew, On Dec 14, 2007, at 11:01 PM, Matthew Dempsky wrote: > It is my hope that if you write about Erlang driver threads and timers > (or any topic), you will be writing from actual experience in using > them in production or at least an environment where you impose > production-like restrictions on yourself. Otherwise, it belongs in a > blog post, not a book. I hate to disappoint you but my goal for the book is not for me to write about things I have experience with in a production environment. My goal is to clearly explain topics that may otherwise look obscure. Device drivers are one such topic. I don't aim to pass myself off as an expert. I do aim for deep and complete coverage of every topic that I write about. This is the reason I ask questions. Does this make me qualified or unqualified to write the book? I don't know! You will be the judge once the book is 2/3 finished and enters the Prags beta book program. Do you think you are more qualified to write an Erlang book than I am? You may well be. Please feel free to write another Erlang book, we don't have enough of them at the moment! Thanks, Joel -- http://wagerlabs.com From fritchie@REDACTED Sat Dec 15 01:24:55 2007 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Fri, 14 Dec 2007 18:24:55 -0600 Subject: [erlang-questions] RamSan and the EveOnline architecture In-Reply-To: Message of "Fri, 14 Dec 2007 11:40:15 PST." Message-ID: <200712150024.lBF0OtKY009998@snookles.snookles.com> >>>>> "jm" == Jim McCoy writes: jm> You could also try using one of the more recent NAND solid-state jm> drives. The performance numbers here jm> (http://www.nextlevelhardware.com/storage/battleship/) of running jm> raid 0 on a batch of these drives is pretty impressive, and for a jm> much better price if you are not bottlenecked on write ops. For anyone thinking of that particular line of NAND drives, you'll do well to fetch the product specification doc and look at page 9 (?) for the max. _*random* write I/O_ rate before making a purchase decision. If two orders of magnitude slower doesn't bother you, go for it. :-) -Scott From jiguorui@REDACTED Sat Dec 15 10:56:57 2007 From: jiguorui@REDACTED (Guorui Ji) Date: Sat, 15 Dec 2007 17:56:57 +0800 Subject: [erlang-questions] How to get a unique id from mnesia. Message-ID: I need your help, all!! for example: -record(item, {uid, name}). I want create a table to store the item record, and the item.uid is a auto-increament unique id. How to do it. Does mnesia have a build-in method?? I have not found!!! Thanks!!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From jiguorui@REDACTED Sat Dec 15 11:05:49 2007 From: jiguorui@REDACTED (Guorui Ji) Date: Sat, 15 Dec 2007 18:05:49 +0800 Subject: [erlang-questions] How to get a unique id from mnesia. In-Reply-To: References: Message-ID: I'm sorry for this question. I find the same question in past list!!! mnesia:dirty_update_counter/3 But is it the best way to do this? On Dec 15, 2007 5:56 PM, Guorui Ji wrote: > I need your help, all!! > > for example: > > -record(item, {uid, name}). > > I want create a table to store the item record, and the item.uid is a > auto-increament unique id. > > How to do it. Does mnesia have a build-in method?? I have not found!!! > > Thanks!!! > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eajam@REDACTED Sat Dec 15 11:45:40 2007 From: eajam@REDACTED (eajam@REDACTED) Date: Sat, 15 Dec 2007 10:45:40 +0000 Subject: [erlang-questions] Book expectations In-Reply-To: References: <35BEBEAB-DC84-4951-9D9C-39BB7856DDA7@gmail.com> Message-ID: Just wondering...any final date for the book? Thanks, Alex > From: joelr1@REDACTED> To: matthew@REDACTED> Date: Fri, 14 Dec 2007 23:41:13 +0000> CC: erlang-questions@REDACTED> Subject: [erlang-questions] Book expectations> > Matthew,> > On Dec 14, 2007, at 11:01 PM, Matthew Dempsky wrote:> > > It is my hope that if you write about Erlang driver threads and timers> > (or any topic), you will be writing from actual experience in using> > them in production or at least an environment where you impose> > production-like restrictions on yourself. Otherwise, it belongs in a> > blog post, not a book.> > > I hate to disappoint you but my goal for the book is not for me to write> about things I have experience with in a production environment. My goal> is to clearly explain topics that may otherwise look obscure.> > Device drivers are one such topic.> > I don't aim to pass myself off as an expert. I do aim for deep and > complete> coverage of every topic that I write about. This is the reason I ask > questions.> > Does this make me qualified or unqualified to write the book? I don't > know!> You will be the judge once the book is 2/3 finished and enters the Prags> beta book program.> > Do you think you are more qualified to write an Erlang book than I am?> You may well be. Please feel free to write another Erlang book,> we don't have enough of them at the moment!> > Thanks, Joel> > --> http://wagerlabs.com> > _______________________________________________> erlang-questions mailing list> erlang-questions@REDACTED> http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Sat Dec 15 12:39:36 2007 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 15 Dec 2007 11:39:36 +0000 Subject: [erlang-questions] Book expectations In-Reply-To: References: <35BEBEAB-DC84-4951-9D9C-39BB7856DDA7@gmail.com> Message-ID: <664FD4B3-398C-404A-A9AB-F8930C0DAC73@gmail.com> On Dec 15, 2007, at 10:45 AM, wrote: > Just wondering...any final date for the book? Sometime this summer, I suppose. Drafts will be published by Pragmatic Programmars once I have written 2/3 of the book. -- http://wagerlabs.com From ulf@REDACTED Sat Dec 15 12:56:05 2007 From: ulf@REDACTED (Ulf Wiger) Date: Sat, 15 Dec 2007 12:56:05 +0100 Subject: [erlang-questions] RamSan and the EveOnline architecture In-Reply-To: <200712150024.lBF0OtKY009998@snookles.snookles.com> References: <200712150024.lBF0OtKY009998@snookles.snookles.com> Message-ID: <8209f740712150356j300ad142v10c31e6dc180be08@mail.gmail.com> Note that mnesia uses disk_log for disc_copies, which doesn't entail random access. For disc_only_copies, on the other hand, it's dets, which would mean random access. BR, Ulf W 2007/12/15, Scott Lystig Fritchie : > >>>>> "jm" == Jim McCoy writes: > > jm> You could also try using one of the more recent NAND solid-state > jm> drives. The performance numbers here > jm> (http://www.nextlevelhardware.com/storage/battleship/) of running > jm> raid 0 on a batch of these drives is pretty impressive, and for a > jm> much better price if you are not bottlenecked on write ops. > > For anyone thinking of that particular line of NAND drives, you'll do > well to fetch the product specification doc and look at page 9 (?) for > the max. _*random* write I/O_ rate before making a purchase decision. > If two orders of magnitude slower doesn't bother you, go for it. :-) > > -Scott > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From tony@REDACTED Sat Dec 15 16:25:13 2007 From: tony@REDACTED (Tony Rogvall) Date: Sat, 15 Dec 2007 16:25:13 +0100 Subject: [erlang-questions] Linked-in drivers: driver_lock_driver and driver_create_port In-Reply-To: <2E00FB98-B658-4805-A1B9-8B0821A2DDFB@gmail.com> References: <2E00FB98-B658-4805-A1B9-8B0821A2DDFB@gmail.com> Message-ID: <6CE6C037-1042-4642-A691-CB9D0CD28018@rogvall.se> driver_create_port was added to simplify the SMP implementation. Previously the driver used a table to store all active open sockets. This meant that the listener socket/port could access the accepting socket and install the file descriptor after accept. Now the listener will create the port and install the descriptor and pass the new port to the erlang side and no locking is involved on the driver level. /Tony On 14 dec 2007, at 16.18, Joel Reymont wrote: > What is the advantage of locking a driver in memory with > driver_lock_driver to make it behave like one of Erlang's statically > linked drivers? > > Also, when should I use driver_create_port? I can't see a case where I > would want to create a port from within a driver. > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From andreasmk2@REDACTED Sat Dec 15 17:38:41 2007 From: andreasmk2@REDACTED (Andreas ZZZ) Date: Sat, 15 Dec 2007 18:38:41 +0200 Subject: [erlang-questions] Percept did not installed on windows Message-ID: Recently I have installed a R12B release on windows using installer Despite documentation for percept was installed percept modules was not. Did I made something wrong or it is not included in release yet ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mberrow1@REDACTED Sat Dec 15 18:47:48 2007 From: mberrow1@REDACTED (Mike Berrow) Date: Sat, 15 Dec 2007 09:47:48 -0800 Subject: [erlang-questions] Book expectations References: <35BEBEAB-DC84-4951-9D9C-39BB7856DDA7@gmail.com> <664FD4B3-398C-404A-A9AB-F8930C0DAC73@gmail.com> Message-ID: <004001c83f42$9e1be9c0$6401a8c0@rubicon> I am surprised that someone is given such grief for asking questions whether they are working on a book or not. Michael Kay, who wrote the "XSLT programmer's reference" (a book that led to a new livelihood for me), and the Saxon XSLT processor, was remembered by a well-known XML expert (a friend of mine) when he showed up in the forums and "asked us all tons and tons of questions". Please just let Joel to ask all he wants and try not to pre-judge his work on the book. -- Mike Berrow From simonpeterchappell@REDACTED Sat Dec 15 20:13:18 2007 From: simonpeterchappell@REDACTED (Simon Chappell) Date: Sat, 15 Dec 2007 13:13:18 -0600 Subject: [erlang-questions] Book expectations In-Reply-To: <004001c83f42$9e1be9c0$6401a8c0@rubicon> References: <35BEBEAB-DC84-4951-9D9C-39BB7856DDA7@gmail.com> <664FD4B3-398C-404A-A9AB-F8930C0DAC73@gmail.com> <004001c83f42$9e1be9c0$6401a8c0@rubicon> Message-ID: <8ed733900712151113h1c03dbbfp68ec1198d002fa4c@mail.gmail.com> On Dec 15, 2007 11:47 AM, Mike Berrow wrote: > Please just let Joel to ask all he wants and try not to pre-judge his work on the book. +1 My expectation is that it will be excellent and I am planning to buy it the moment it hits the beta program like I did for Joe's book. I like this beta program for books. I just ordered the new Scala book from Artima under the same arrangement. :-) Simon -- simonpeter.org | simonpeter.com | newlife-upc.org From joelr1@REDACTED Sat Dec 15 20:16:31 2007 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 15 Dec 2007 19:16:31 +0000 Subject: [erlang-questions] Linked-in drivers: driver_lock_driver and driver_create_port In-Reply-To: <6CE6C037-1042-4642-A691-CB9D0CD28018@rogvall.se> References: <2E00FB98-B658-4805-A1B9-8B0821A2DDFB@gmail.com> <6CE6C037-1042-4642-A691-CB9D0CD28018@rogvall.se> Message-ID: <2125B602-43CF-4272-A522-E84CBC7CF687@gmail.com> On Dec 15, 2007, at 3:25 PM, Tony Rogvall wrote: > Now the listener will create the port and install the descriptor and > pass the new > port to the erlang side and no locking is involved on the driver > level. So this is useful for drivers that deal with lots of file descriptors or network connections and want to let Erlang access them? Right? Thanks, Joel -- http://wagerlabs.com From samuelrivas@REDACTED Fri Dec 14 22:29:28 2007 From: samuelrivas@REDACTED (Samuel Rivas) Date: Fri, 14 Dec 2007 22:29:28 +0100 Subject: [erlang-questions] idea: endianess in interoperability tutorials In-Reply-To: <476278DA.4010609@lionet.info> References: <20071214121008.GA25443@lambdastream.com> <476278DA.4010609@lionet.info> Message-ID: <20071214212928.GB32588@lambdastream.com> Lev Walkin wrote: > There is no problem with endianness in that code. Perhaps > you meant something more involving than that? Yup! You are right. I was somewhat thick when I read that code. I should have checked that it failed in a big-endian machine. I found other true problems with code that was moving bytes back and forth assuming little endianness and I automatically mapped it to the tutorial code. Even I was skeptic about that code were wrong I thought that it might be a forgotten piece of code waiting to crash something ... I was obviously wrong. Disregard my previous mail, sorry for the noise. Cheers -- Samuel From james.hague@REDACTED Sun Dec 16 00:46:47 2007 From: james.hague@REDACTED (James Hague) Date: Sat, 15 Dec 2007 17:46:47 -0600 Subject: [erlang-questions] How to track down R12B stability problems under Windows? In-Reply-To: References: Message-ID: All right, I think I figured this out. It's not as generic a problem as I originally stated--sorry about that. I've got this completely reproducible, at least using my own code. I'm doing this from the shell. eprof:start(). eprof:profile([], tga, test_compressed, []). <-- my own module c(tga). <-- compiling same code being profiled This crashes every time with a VC++ runtime error. James From tony@REDACTED Sun Dec 16 00:04:11 2007 From: tony@REDACTED (Tony Rogvall) Date: Sun, 16 Dec 2007 00:04:11 +0100 Subject: [erlang-questions] Linked-in drivers: driver_lock_driver and driver_create_port In-Reply-To: <2125B602-43CF-4272-A522-E84CBC7CF687@gmail.com> References: <2E00FB98-B658-4805-A1B9-8B0821A2DDFB@gmail.com> <6CE6C037-1042-4642-A691-CB9D0CD28018@rogvall.se> <2125B602-43CF-4272-A522-E84CBC7CF687@gmail.com> Message-ID: <8650C447-5828-4946-ACD2-357FE7FDC4EB@rogvall.se> On 15 dec 2007, at 20.16, Joel Reymont wrote: > > On Dec 15, 2007, at 3:25 PM, Tony Rogvall wrote: > >> Now the listener will create the port and install the descriptor >> and pass the new >> port to the erlang side and no locking is involved on the driver >> level. > > > So this is useful for drivers that deal with lots of file > descriptors or network connections and want to let Erlang access > them? Right? Not generally, No. But for kernel calls that create file descriptors, yes. /Tony > > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > From dominic.chambers@REDACTED Sun Dec 16 10:56:29 2007 From: dominic.chambers@REDACTED (Dominic Chambers) Date: Sun, 16 Dec 2007 09:56:29 +0000 Subject: [erlang-questions] how do I convert a character to an integer (dict broke the integer I put into it) Message-ID: <630336130712160156w129076d3qff8fb4fffb945c41@mail.gmail.com> Hi Everyone, I add some integers as values into a dict, but when I go to retrieve them they are now strings. After an hour of googling the only thing I can find online is that $c does what I want for character literals, but this doesn't seem to work for character variables. I need this because adding to the number I get out of the dict gives me a badarith error. Thanks for any help, Dominic. From rvirding@REDACTED Sun Dec 16 11:44:34 2007 From: rvirding@REDACTED (Robert Virding) Date: Sun, 16 Dec 2007 11:44:34 +0100 Subject: [erlang-questions] how do I convert a character to an integer (dict broke the integer I put into it) In-Reply-To: <630336130712160156w129076d3qff8fb4fffb945c41@mail.gmail.com> References: <630336130712160156w129076d3qff8fb4fffb945c41@mail.gmail.com> Message-ID: <3dbc6d1c0712160244y1bce894dwedca7a0e41d89ea2@mail.gmail.com> Could you please give an example of what you mean? In Erlang strings are just lists of integers, and a character is just an integer. So "abc" is [97,98,99] and $A is 65. Robert On 16/12/2007, Dominic Chambers wrote: > > Hi Everyone, > > I add some integers as values into a dict, but when I go to retrieve > them they are now strings. After an hour of googling the only thing I > can find online is that $c does what I want for character literals, > but this doesn't seem to work for character variables. I need this > because adding to the number I get out of the dict gives me a badarith > error. > > Thanks for any help, Dominic. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominic.chambers@REDACTED Sun Dec 16 12:24:21 2007 From: dominic.chambers@REDACTED (Dominic Chambers) Date: Sun, 16 Dec 2007 11:24:21 +0000 Subject: [erlang-questions] how do I convert a character to an integer (dict broke the integer I put into it) In-Reply-To: <3dbc6d1c0712160244y1bce894dwedca7a0e41d89ea2@mail.gmail.com> References: <630336130712160156w129076d3qff8fb4fffb945c41@mail.gmail.com> <3dbc6d1c0712160244y1bce894dwedca7a0e41d89ea2@mail.gmail.com> Message-ID: <630336130712160324v5ee61d0ei11b8cfe23a0380d@mail.gmail.com> Yes, the following gives me a character instead of a number (I put a number in but I got a character out -- which may, as you say, be identical anyway): dict:fetch("Key", dict:append("Key", 33, dict:new())). but then the problem I get is that if I try to add 1 to that number I get a badarith error: dict:fetch("Key", dict:append("Key", 33, dict:new())) + 1. I have just made misunderstood what is happening here? On Dec 16, 2007 10:44 AM, Robert Virding wrote: > Could you please give an example of what you mean? In Erlang strings are > just lists of integers, and a character is just an integer. So "abc" is > [97,98,99] and $A is 65. > > Robert > > > > On 16/12/2007, Dominic Chambers wrote: > > > > > > > > Hi Everyone, > > > > I add some integers as values into a dict, but when I go to retrieve > > them they are now strings. After an hour of googling the only thing I > > can find online is that $c does what I want for character literals, > > but this doesn't seem to work for character variables. I need this > > because adding to the number I get out of the dict gives me a badarith > > error. > > > > Thanks for any help, Dominic. > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > From dominic.chambers@REDACTED Sun Dec 16 12:29:21 2007 From: dominic.chambers@REDACTED (Dominic Chambers) Date: Sun, 16 Dec 2007 11:29:21 +0000 Subject: [erlang-questions] how do I convert a character to an integer (dict broke the integer I put into it) In-Reply-To: <18277.517.117314.628573@antilipe.corelatus.se> References: <630336130712160156w129076d3qff8fb4fffb945c41@mail.gmail.com> <18277.517.117314.628573@antilipe.corelatus.se> Message-ID: <630336130712160329r5d87f083w132194b0f881897f@mail.gmail.com> Yes, thanks Matthias, that works! Clearly I do not understand the difference between dict:store/3 and dict:append/3. Let me go and educate myself! On Dec 16, 2007 10:46 AM, Matthias Lang wrote: > Dominic Chambers writes: > > > I add some integers as values into a dict, but when I go to retrieve > > them they are now strings. After an hour of googling the only thing I > > can find online is that $c does what I want for character literals, > > but this doesn't seem to work for character variables. I need this > > because adding to the number I get out of the dict gives me a badarith > > error. > > You didn't provide any examples of what you mean. Here's an example > which seems to contradict what you're saying: > > 1> A = dict:new(), B = dict:store(this_is_my_key, 65, A). {dict,1, > 16, > 16, > 8, > 80, > 48, > {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, > {{[],[],[],[],[],[],[],[],[],[[this_is_my_key|65]],[],[],[],[],[],[]}}} > 2> C = dict:fetch(this_is_my_key, B). > 65 > 3> C + 9. > 74 > > A stab in the dark: one explanation for "why would Dominic write the > above" is that you have not understood the difference between > dict:store/3 and dict:append/3? Remember, in Erlang a string is > represented as a list of integers. > > Matt > From matthias@REDACTED Sun Dec 16 11:46:29 2007 From: matthias@REDACTED (Matthias Lang) Date: Sun, 16 Dec 2007 11:46:29 +0100 Subject: [erlang-questions] how do I convert a character to an integer (dict broke the integer I put into it) In-Reply-To: <630336130712160156w129076d3qff8fb4fffb945c41@mail.gmail.com> References: <630336130712160156w129076d3qff8fb4fffb945c41@mail.gmail.com> Message-ID: <18277.517.117314.628573@antilipe.corelatus.se> Dominic Chambers writes: > I add some integers as values into a dict, but when I go to retrieve > them they are now strings. After an hour of googling the only thing I > can find online is that $c does what I want for character literals, > but this doesn't seem to work for character variables. I need this > because adding to the number I get out of the dict gives me a badarith > error. You didn't provide any examples of what you mean. Here's an example which seems to contradict what you're saying: 1> A = dict:new(), B = dict:store(this_is_my_key, 65, A). {dict,1, 16, 16, 8, 80, 48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, {{[],[],[],[],[],[],[],[],[],[[this_is_my_key|65]],[],[],[],[],[],[]}}} 2> C = dict:fetch(this_is_my_key, B). 65 3> C + 9. 74 A stab in the dark: one explanation for "why would Dominic write the above" is that you have not understood the difference between dict:store/3 and dict:append/3? Remember, in Erlang a string is represented as a list of integers. Matt From rvirding@REDACTED Sun Dec 16 19:30:05 2007 From: rvirding@REDACTED (Robert Virding) Date: Sun, 16 Dec 2007 19:30:05 +0100 Subject: [erlang-questions] how do I convert a character to an integer (dict broke the integer I put into it) In-Reply-To: <630336130712160324v5ee61d0ei11b8cfe23a0380d@mail.gmail.com> References: <630336130712160156w129076d3qff8fb4fffb945c41@mail.gmail.com> <3dbc6d1c0712160244y1bce894dwedca7a0e41d89ea2@mail.gmail.com> <630336130712160324v5ee61d0ei11b8cfe23a0380d@mail.gmail.com> Message-ID: <3dbc6d1c0712161030t7c4e746fgbc322ac085c44f84@mail.gmail.com> On 16/12/2007, Dominic Chambers wrote: > > Yes, the following gives me a character instead of a number (I put a > number in but I got a character out -- which may, as you say, be > identical anyway): > > dict:fetch("Key", dict:append("Key", 33, dict:new())). > > but then the problem I get is that if I try to add 1 to that number I > get a badarith error: > > dict:fetch("Key", dict:append("Key", 33, dict:new())) + 1. > > I have just made misunderstood what is happening here? As matthias said dict:append and dict:store are different. Dict:store stores the value under the key while dict:append appends the new value to a list of the existing values. If there are no values then the new value is automatically put in a list. So you get: 1> dict:fetch("Key", dict:store("Key", 33, dict:new())). 33 2> dict:fetch("Key", dict:append("Key", 33, dict:new())). "!" 3> dict:fetch("Key", dict:append("Key", 35, dict:append("Key", 33, dict:new()))). "!#" 4> Dict:fetch (and dict:find) always return the whole value which might be a list of values or one value. Robert P.S. Dict:append will also make a list of value which is already there and not a list. This is probably a mistake, but we were trying to be nice. Better to be consistent than nice. P.P.S. Orddict has exactly the same interface but the dictionary is easier to understand when printed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Sun Dec 16 22:02:56 2007 From: rvirding@REDACTED (Robert Virding) Date: Sun, 16 Dec 2007 22:02:56 +0100 Subject: [erlang-questions] : queues (previously: documentation of data structures) In-Reply-To: <476308A7.4060001@theheartofgold.org> References: <200712070917.13979.bekesa@sch.bme.hu> <200712111344.25828.bekesa@sch.bme.hu> <475E8E41.5040603@lionet.info> <200712111516.50740.bekesa@sch.bme.hu> <20071212160247.GC11510@erix.ericsson.se> <476308A7.4060001@theheartofgold.org> Message-ID: <3dbc6d1c0712161302v366f31bl8153c1876c224419@mail.gmail.com> I quite agree! First it should be liat, if it is supposed to be the reverse of tail. Then I also agree even more that the whole naming of the functions in the queue module sucks. It was probably originally taken from Okasaki who uses a subset of it in a chapter of his book. I personally think it can only be considered as a form of "in joke" which is really only comprehensible to people who know the terminology and as such is not suitable for a general library. I find it easier and faster to rewrite the code than try and remember the functions names if I need a queue. The algorithm is basically quite simple and neat. Rewrite the module with good names for the API and make sure to drop the old names from the documentation to make sure they don't spread, though they will have to be kept for BC. Get out a new version ASAP. Robert P.S. Yes I know I occasionally include small jokes there are limits to what you can do. On 14/12/2007, Anders Ramsell wrote: > > > > Anyways, queue:lait/1 should be liat/1 shouldn't it? Both in > > > the doc and impl. (It is the opposite of tail. The opposite of > > > cons/2 is snoc/2, the opposite of head/1 is daeh/1 but > > > lists:reverse("tail") /= "lait"). > > > > Oh yes!!! I was tired when I wrote it, then self-blind, and > > nobody proofread. If I get a reason to touch the module I will > > add liat/1, forget about lait/1 but keep it around for backwards > > compatibility... > > (I'm going to stick my neck out now. Hope I don't get beheaded.) > > I think the API of the queue module is a mess. Full of weird > names and functions that do the same thing. Quite unlike most > other modules in stdlib. This is a pity because this module is > very useful. Or at least it could be - I'll get back to that. > > If you're going to change it - change it a lot. My suggestion > would be something along these lines. First remove a few > functions. > > Function: Duplicate of: > ------------------------ > daeh last > in_r cons > lait init > snoc in > > But we still have some weird names left. How do you 'init' a > queue by removing something from it? And out_r isn't all that > beautiful either. Then we have 'head' as the opposite of 'last'. > > I would rename those and a few more to get something that I think > look like a "consistent" naming. > > Function: Rename to: > --------------------- > init drop_last > out_r out_last > head first > tail drop_first > cons in_first > > Of course all the old names would have to remain for a few > versions for backwards compatibility reasons. > > > Now back to what I hinted at before. The names of the API are > important but what they do is of course much more important and > the API is quite complete. But one, in my opinion, very important > function is missing. This fact has kept me from using this module > and roll my own on more than one occasion. There is no function > that removes a specified item no matter where in the queue it is. > Sometimes you just get tired of queueing. > > No matter what you think of the rest of this mail please add that > function. Keeping to my own suggested names it could be called > 'drop'. I know it can't be O(1) but that doesn't matter. > > Well? Will I know get pummeled into my shoes like the noob I am > or do I have a point? > > /Anders > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominic.chambers@REDACTED Sun Dec 16 22:44:30 2007 From: dominic.chambers@REDACTED (Dominic Chambers) Date: Sun, 16 Dec 2007 21:44:30 +0000 Subject: [erlang-questions] how do I convert a character to an integer (dict broke the integer I put into it) In-Reply-To: <3dbc6d1c0712161030t7c4e746fgbc322ac085c44f84@mail.gmail.com> References: <630336130712160156w129076d3qff8fb4fffb945c41@mail.gmail.com> <3dbc6d1c0712160244y1bce894dwedca7a0e41d89ea2@mail.gmail.com> <630336130712160324v5ee61d0ei11b8cfe23a0380d@mail.gmail.com> <3dbc6d1c0712161030t7c4e746fgbc322ac085c44f84@mail.gmail.com> Message-ID: <630336130712161344p411342f4p4f8f57ff9e24de9c@mail.gmail.com> > P.S. Dict:append will also make a list of value which is already there and > not a list. This is probably a mistake, but we were trying to be nice. > Better to be consistent than nice. That's very clear, thanks to both of you for all the help. > P.P.S. Orddict has exactly the same interface but the dictionary is easier > to understand when printed. This is also very handy to know, thanks. From davidnwelton@REDACTED Sun Dec 16 23:42:15 2007 From: davidnwelton@REDACTED (David Welton) Date: Sun, 16 Dec 2007 23:42:15 +0100 Subject: [erlang-questions] Book expectations In-Reply-To: <004001c83f42$9e1be9c0$6401a8c0@rubicon> References: <35BEBEAB-DC84-4951-9D9C-39BB7856DDA7@gmail.com> <664FD4B3-398C-404A-A9AB-F8930C0DAC73@gmail.com> <004001c83f42$9e1be9c0$6401a8c0@rubicon> Message-ID: <9877cd600712161442y477146e9mdaf6b408ce7039d@mail.gmail.com> > Please just let Joel to ask all he wants and try not to pre-judge his work on the book. Often, someone asking questions is more likely to be able to translate those questions into good answers, after a lot of research, than someone who knows a subject so well that they no longer recall what beginners know, don't know, and might be likely to struggle with. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From speedguy@REDACTED Mon Dec 17 00:10:19 2007 From: speedguy@REDACTED (SG) Date: Mon, 17 Dec 2007 01:10:19 +0200 Subject: [erlang-questions] Some startup questions Message-ID: <88764392.20071217011019@runbox.com> Hi all, I have just been exploring couple of weeks in Erlang, and found it quite exciting. To enhance my skills, I decided to implement a protocol in Erlang. Now I am in architecture design phase and would not like to make mistakes at this stage :) I do understand there are already some great Erlang implementations, so if someone can point me to (1) Architecture design document of some open systems implemented in Erlang, which I can use as guidance. I have understood that Open Poker has been in Erlang. Could I find its design document somewhere? (2) I do want to make my system "High Available" as well as "Distributed", so that extra hardware can be added. I.e. I would like my SW to run on a HW Rack, where extra blades can be added in future. Probably this is something similar to what Ericsson switches may already be using? My question is, is it possible to find "design guidelines" for building such applications. Of course I am reading Joe's Erlang's book, but would be very much interested to look the design of some of proven Erlang implementations. Thanks :) --SG From andreas.hillqvist@REDACTED Mon Dec 17 08:30:29 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Mon, 17 Dec 2007 08:30:29 +0100 Subject: [erlang-questions] Percept did not installed on windows In-Reply-To: References: Message-ID: <8268eea30712162330t7c963a41uc625579d9d3bde55@mail.gmail.com> I'm experiencing the same problem. The folder erl5.6\lib\percept-0.5.0 only contains: * An info file with the content: group: tools short: A concurrency profiler tool. * And the a doc folder with the html documentation. I see two possible scenarios: * Percept is currently only working on Linux/Unix and a Win version is schedule in a near future. * A miss in the win distribution. Regards Andreas Hillqvist 2007/12/15, Andreas ZZZ : > Recently I have installed a R12B release on windows using installer > Despite documentation for percept was installed percept modules was not. > > Did I made something wrong or it is not included in release yet ? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From tom@REDACTED Mon Dec 17 08:27:23 2007 From: tom@REDACTED (Tom Samplonius) Date: Sun, 16 Dec 2007 23:27:23 -0800 (PST) Subject: [erlang-questions] idle speculation: Ericsson Erlang vision/strategy In-Reply-To: <18271.56598.759839.46911@antilipe.corelatus.se> Message-ID: <4246027.4291197876443192.JavaMail.root@ly.sdf.com> ----- "Matthias Lang" wrote: > Andreas Hillqvist writes: > > > Telecom is moving towards Long Term Evolution(LTE), where an aimed > to > > is to be an all-IP network. > > In the 90s, "everyone" was sure that ATM was going to take over the > world. Operators wrote puffy press releases about their migration to > a > unified all-ATM network. Will the current press releases about > migration to all-IP networks seem just as naive in a few years? I guess that is the point though. ATM lost to IP (well, lost to MPLS). The point the is that IP is winning, and everything else is either losing or already forgotten. > Sometimes, new technologies really do win. Ethernet has pretty much > obliterated everything else, including ethernet. (When was the last > time your ethernet needed to avoid a collision? Got any coax?) Well, collisions were just one aspect of Ethernet. But half-duplex and full-duplex is still an issue on 802.11, where there is one channel for transmit and receive. > Other times, sure hits go mostly nowhere. ISDN 2B+D springs to mind. Well, ISDN protocol types made BRI somewhat complex. Too much configuration. > Often, success is partial. Optical fiber has taken over the backbone > but fallen victim to 'impossibly' high data rates over copper beyond. ??? > Erlang has a strong track record in the sort of complex control and > protocol translation problems that pop up whenever you move to the > latest "next big thing" from the previous "next big thing". Since there are a least five things that have to be transitioned away from these days, and given that a single technology doesn't solve every problem, this is basically a perpetual requirement. > Matt Tom From tom@REDACTED Mon Dec 17 08:36:58 2007 From: tom@REDACTED (Tom Samplonius) Date: Sun, 16 Dec 2007 23:36:58 -0800 (PST) Subject: [erlang-questions] Amazon AWS SimpleDB based on erlang now in beta In-Reply-To: <47626D5C.7040507@itsbeen.sent.com> Message-ID: <235408.4321197877018496.JavaMail.root@ly.sdf.com> I don't know where people are getting "large datasets" from. Amazon says: "Amazon SimpleDB is designed to store relatively small amounts of data and is optimized for fast data access and flexibility in how that data is expressed." So "relatively small amounts of data". Tom ----- "Erlang List" wrote: > I was wondering if anyone has tried this or if now that it is out if > any of > the team who created can give us some insights (for example how big is > "large > data sets", etc): > > From http://www.satine.org/archives/2007/12/13/amazon-simpledb/ : > > What?s cool about SimpleDB > * Really large data sets > * Really Fast > * Highly Available - It?s Amazon. Running Erlang. Whoa. > * On demand scaling - Like S3, EC2, with a sensible data metering > pricing model > * Schemaless - major cool factor for me here; items are little hash > tables > containing sets of key, value pairs > > http://aws.amazon.com/simpledb > http://www.amazon.com/gp/browse.html?node=342335011 > http://docs.amazonwebservices.com/AmazonSimpleDB/2007-11-07/DeveloperGuide/? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From raimo+erlang-questions@REDACTED Mon Dec 17 09:53:45 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Mon, 17 Dec 2007 09:53:45 +0100 Subject: [erlang-questions] : : queues (previously: documentation of data structures) In-Reply-To: <3dbc6d1c0712161302v366f31bl8153c1876c224419@mail.gmail.com> References: <200712070917.13979.bekesa@sch.bme.hu> <200712111344.25828.bekesa@sch.bme.hu> <475E8E41.5040603@lionet.info> <200712111516.50740.bekesa@sch.bme.hu> <20071212160247.GC11510@erix.ericsson.se> <476308A7.4060001@theheartofgold.org> <3dbc6d1c0712161302v366f31bl8153c1876c224419@mail.gmail.com> Message-ID: <20071217085345.GA24694@erix.ericsson.se> On Sun, Dec 16, 2007 at 10:02:56PM +0100, Robert Virding wrote: > I quite agree! First it should be liat, if it is supposed to be the reverse > of tail. > > Then I also agree even more that the whole naming of the functions in the > queue module sucks. It was probably originally taken from Okasaki who uses a > subset of it in a chapter of his book. I personally think it can only be > considered as a form of "in joke" which is really only comprehensible to > people who know the terminology and as such is not suitable for a general > library. > Well for me it was not a joke, but perhaps for the original writer. I just got the module in my lap and found it had two incomplete APIs, so I completed them both. It was probably then the joke ceased to be funny. And I also mis-spelled the liat/1 function. Sorry about that again. Yet another API (that does not refer to Okasaki, but has telling names) is perhaps inevitable. And I can understand why that requested drop/2 function is needed, but if speed is not that important, and if a drop/2 is there a keydrop/2 is bound to be requested, why not make it a drop/2 or delete/2 that takes a predicate? And then foreach/2 and lots of other functions from the lists module will be requested. If speed is not important at all you can of course do Q1 = queue:from_list([X || X <- queue:to_list(Q0), X =/= Y] and such. > I find it easier and faster to rewrite the code than try and remember the > functions names if I need a queue. The algorithm is basically quite simple > and neat. > > Rewrite the module with good names for the API and make sure to drop the old > names from the documentation to make sure they don't spread, though they > will have to be kept for BC. Get out a new version ASAP. > > Robert > > P.S. Yes I know I occasionally include small jokes there are limits to what > you can do. > > On 14/12/2007, Anders Ramsell wrote: > > > > > > Anyways, queue:lait/1 should be liat/1 shouldn't it? Both in > > > > the doc and impl. (It is the opposite of tail. The opposite of > > > > cons/2 is snoc/2, the opposite of head/1 is daeh/1 but > > > > lists:reverse("tail") /= "lait"). > > > > > > Oh yes!!! I was tired when I wrote it, then self-blind, and > > > nobody proofread. If I get a reason to touch the module I will > > > add liat/1, forget about lait/1 but keep it around for backwards > > > compatibility... > > > > (I'm going to stick my neck out now. Hope I don't get beheaded.) > > > > I think the API of the queue module is a mess. Full of weird > > names and functions that do the same thing. Quite unlike most > > other modules in stdlib. This is a pity because this module is > > very useful. Or at least it could be - I'll get back to that. > > > > If you're going to change it - change it a lot. My suggestion > > would be something along these lines. First remove a few > > functions. > > > > Function: Duplicate of: > > ------------------------ > > daeh last > > in_r cons > > lait init > > snoc in > > > > But we still have some weird names left. How do you 'init' a > > queue by removing something from it? And out_r isn't all that > > beautiful either. Then we have 'head' as the opposite of 'last'. > > > > I would rename those and a few more to get something that I think > > look like a "consistent" naming. > > > > Function: Rename to: > > --------------------- > > init drop_last > > out_r out_last > > head first > > tail drop_first > > cons in_first > > > > Of course all the old names would have to remain for a few > > versions for backwards compatibility reasons. > > > > > > Now back to what I hinted at before. The names of the API are > > important but what they do is of course much more important and > > the API is quite complete. But one, in my opinion, very important > > function is missing. This fact has kept me from using this module > > and roll my own on more than one occasion. There is no function > > that removes a specified item no matter where in the queue it is. > > Sometimes you just get tired of queueing. > > > > No matter what you think of the rest of this mail please add that > > function. Keeping to my own suggested names it could be called > > 'drop'. I know it can't be O(1) but that doesn't matter. > > > > Well? Will I know get pummeled into my shoes like the noob I am > > or do I have a point? > > > > /Anders > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From rsaccon@REDACTED Mon Dec 17 11:21:38 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Mon, 17 Dec 2007 08:21:38 -0200 Subject: [erlang-questions] clarify: how to traverse AST with erl_syntax functions ? Message-ID: is there a good example anywhere ? I think I am doing something wrong, e.g.: I want to traverse the AST of the string module and access some of the functions. 1> {_, Beam, _} = code:get_object_code(list_to_atom("string")). {string,<<70,79,82,49,0,0,45,40,66,69,65,77,65,116,111,109,0,0,2,15,0,0,0,69,6, 115,116,...>>, "/Users/rsaccon/R11B/erlang/lib/stdlib-1.14.5/ebin/string.beam"} 2> {ok,{_,[{abstract_code,{_,Ac}}]}} = beam_lib:chunks(Beam,[abstract_code]). ... 3>T= erl_syntax:abstract(Ac). ... 4> erl_syntax:type(T). list 5> Ts=erl_syntax:list_elements(T). now Ii grab one element form the middle of the list, which encapsulates a function of the string module: 11> T_in_the_middle. {tree,tuple, {attr,0,[],none}, [{tree,atom,{attr,0,[],none},function}, {tree,integer,{attr,0,[],none},38}, {tree,atom,{attr,0,[],none},len}, {tree,integer,{attr,0,[],none},1}, {tree,list, {attr,0,[],none}, {list,[{tree,tuple, {attr,0,[],none}, [{tree,atom,{attr,0,[],none},clause}, {tree,integer,{attr,0,[],none},38}, {tree,list,{attr,0,[],...},{list,[...],...}}, {tree,nil,{attr,0,...},[]}, {tree,list,{attr,...},{...}}]}], none}}]} 12> erl_syntax:type(T_in_the_middle). tuple And now how do I get to the function inside ? Is there a "direct way" to get there or do I need to unpack the tuple ? regards -- Roberto Saccon http://rsaccon.com From egil@REDACTED Mon Dec 17 11:33:14 2007 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Mon, 17 Dec 2007 11:33:14 +0100 Subject: [erlang-questions] Percept did not installed on windows In-Reply-To: <8268eea30712162330t7c963a41uc625579d9d3bde55@mail.gmail.com> References: <8268eea30712162330t7c963a41uc625579d9d3bde55@mail.gmail.com> Message-ID: <4766506A.1040707@erix.ericsson.se> The percept application is not included in the windows distribution. This is due to complications with egd and libgd on windows. A solution will be in place and it will probably be in R12B-1. Regards, Bj?rn-Egil Dahlberg Andreas Hillqvist wrote: > I'm experiencing the same problem. > > The folder erl5.6\lib\percept-0.5.0 only contains: > * An info file with the content: > group: tools > short: A concurrency profiler tool. > * And the a doc folder with the html documentation. > > I see two possible scenarios: > * Percept is currently only working on Linux/Unix > and a Win version is schedule in a near future. > * A miss in the win distribution. > > > Regards > Andreas Hillqvist > > 2007/12/15, Andreas ZZZ : >> Recently I have installed a R12B release on windows using installer >> Despite documentation for percept was installed percept modules was not. >> >> Did I made something wrong or it is not included in release yet ? >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From valentin@REDACTED Mon Dec 17 10:04:33 2007 From: valentin@REDACTED (Valentin Micic) Date: Mon, 17 Dec 2007 11:04:33 +0200 Subject: [erlang-questions] Source patch for R12B-0 not working on Netra T2000 with SMP enabled (64-bit) References: <26B04CE34936014297D381585CCE89B042B459@MTNMAIL1.mtn.co.za> <4762A673.10601@ericsson.com> Message-ID: <017801c8408b$d9aa2f20$6401a8c0@moneymaker2> Hi, I know this is a bad time of the year, however, can we get some kind of conclusion and/or resolution for this particular problem? Regards, Valentin. ----- Original Message ----- From: "Rickard Green" To: "Ognian Pantov [ MTN - Innovation Centre ]" Cc: "Valentin Micic" ; "Kenneth Lundin" ; "Sean Hinde" ; "Erlang/OTP discussions" ; Sent: Friday, December 14, 2007 5:51 PM Subject: Re: [erlang-questions] Source patch for R12B-0 available > 'kill -ABRT' the emulator when you are sure the emulator hangs (i.e. 0% > cpu utilization after quite a while). Make the following available for > download: > * A complete build log including the environment (use 'script' to capture > printouts and type 'env' to print the environment). > * The whole source tree you've built in and the core generated (pack with > gnu tar). > > I'll have a look at it, and try to figure out what is going on. > > By the way: Have anyone else tried to build R12B-0 with the patch on > solaris 10 sparc64? If so, did it fail or succeed? > > BR, > Rickard Green, Erlang/OTP, Ericsson AB. > > Ognian Pantov [ MTN - Innovation Centre ] wrote: >> Hi, >> >> I manage to build R12B-0 Erlang 64 bit with the patch on T2000 without >> SMP support: env CC=/tmp/gcc64 >> ./configure --disable-smp-support --prefix=/usr/local/erlang/R12B-0 >> >> We can build R12B-0 on the same machine with the same OS using the same >> procedure: >> - 64 bit with SMP support, no patch >> - 64 bit with patch, NO SMP >> >> We can't build 64 bit with SMP support with the patch. >> >> It seems that the patch and SMP don't work together on Netra T2000. >> >> Best regards >> Ognian >> >> -----Original Message----- >> From: Rickard Green [mailto:rickard.s.green@REDACTED] >> Sent: Thursday, 13 December 2007 05:42 >> To: Ognian Pantov [ MTN - Innovation Centre ] >> Cc: Valentin Micic; Kenneth Lundin; Sean Hinde; Erlang/OTP discussions; >> waynes@REDACTED >> Subject: Re: [erlang-questions] Source patch for R12B-0 available >> >> >> >> $ uname -a >> SunOS xxx 5.10 Generic_125100-10 sun4u sparc SUNW,Ultra-5_10 >> >> BR, >> Rickard Green, Erlang/OTP, Ericsson AB. >> >> Ognian Pantov [ MTN - Innovation Centre ] wrote: >>> Hi, >>> >>> We can build R12B-0 without the patch on Netra T2000 (SMP) and Netra 440 >>> (No SMP) using Sun tar or GNU tar, with or without -64 flag passed to >>> ld. There is no other Erlang on the box. >>> >>> We can't build R12B-0 with the patch on Netra T2000 and Netra 440 using >>> Sun tar or GNU tar, with or without -64 flag passed to ld. There is no >>> other Erlang on the box. >>> >>> What is the hardware you are using to build Solaris 10? >>> >>> If do env CC=/tmp/gcc64 >>> ./configure --enable-smp-support --prefix=/usr/local/erlang/R11-1 on >>> Netra 440 using R11B-1 we got: >>> >>> checking whether an emulator with smp support should be built... yes; >>> enabled by user configure: error: cannot build smp enabled emulator >>> since hardware platform (ultrasparc wordsize=8) is not supp >>> orted >>> configure: error: >>> /export/home/smscproj/install/otp_src_R11B-1/erts/configure failed for >>> erts >>> >>> If we do env CC=/tmp/gcc64 >>> ./configure --enable-smp-support --prefix=/usr/local/erlang/R12B-0 >>> configure finish successfully! We can build OK without patch and we fail >>> to build with the patch. >>> >>> Best regards >>> Ognian >>> >>> -----Original Message----- >>> From: Rickard Green [mailto:rickard.s.green@REDACTED] >>> Sent: Thursday, 13 December 2007 01:15 >>> To: Valentin Micic >>> Cc: Ognian Pantov [ MTN - Innovation Centre ]; Kenneth Lundin; Sean >>> Hinde; Erlang/OTP discussions; waynes@REDACTED >>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>> >>> >>> Valentin Micic wrote: >>>> Not sure how is gnu tar related to the problem, but we'll try... >>>> >>> As far as I know solaris tar and gnu tar are slightly incompatible, and >>> that you might get silent errors if you extract using solaris tar. I'm >>> no tar expert, though, I might be wrong, but by using gnu tar you will >>> at least remove one possible error source. >>> >>>> When we've run "truss" command using 'erlc' and arguments as indicated >>>> immediately when build "hangs", the execution fails because it cannot >>>> locate 'erl'. Unfortunately, the 'erl' hasn't been build at this point, >>>> so I am at loss... it appears to me that 'erlc' is invoked to early, >>>> that is to say, before 'erl' has been created. Thus, two questions for >>>> your consideration, if you please: >>>> >>>> 1) Could it be that patch is inserted at a wrong place; >>> Perhaps, but I've also used gpatch (version 2.5.4), and it works for me. >>> You could try to apply the patch manually if you want. Modify all files >>> included in the patch manually except for otp_src_R12B-0/configure, and >>> otp_src_R12B-0/erts/configure then cd into otp_src_R12B-0 and run >>> "./otp_build autoconf" (you need to have autoconf 2.59 in your path). If >>> you search for "diff -Naur" in the patch file, you will easily find the >>> beginning of each diff. >>> >>>> 2) Could it be that your build is successful because you do have erl >>>> somewhere in your path (I mean erl that you've build before via >>>> separate build) -- I've checked it over and over again: erlc will try >>>> to invoke erl using any path specified in your $PATH variable. >>>> >>> The top makefile puts the bootstrap/bin directory (where the bootstrap >>> erl and erlc resides) first in your path during the build. I've also >>> successfully built it without any erl and erlc in the path and without >>> ERLC_EMULATOR set, and also using the runtime system with resp. without >>> smp support. >>> >>> You could also try to enable/disable smp support for erlc by >>> putting -smpenable/-smpdisable in the ERL_ZFLAGS environment variable >>> before building and see if it makes any difference. >>> >>> BR, >>> Rickard Green, Erlang/OTP, Ericsson AB. >>> >>>> Thanks for your effort so far. >>>> >>>> Kind Regards, >>>> V. >>>> >>>> >>>> ----- Original Message ----- From: "Rickard Green" >>>> >>>> To: "Ognian Pantov [ MTN - Innovation Centre ]" >>>> Cc: "Kenneth Lundin" ; "Sean Hinde" >>>> ; "Erlang/OTP discussions" >>>> ; ; "Valentin >>>> Micic" >>>> Sent: Wednesday, December 12, 2007 2:05 PM >>>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>>> >>>> >>>>> It builds fine for me on solaris 10. >>>>> >>>>> Are you extracting the tar file with gnu tar? If not, you need to. >>>>> >>>>> Instead of using CC I put a script called gcc (similar to yours) in >>>>> the path and also a script called ld (passing -64 as argument to ld) >>>>> in the path. >>>>> >>>>> I use gcc 3.4.4. >>>>> >>>>> BR, >>>>> Rickard Green, Erlang/OTP, Ericsson AB. >>>>> >>>>> >>>>> Ognian Pantov [ MTN - Innovation Centre ] wrote: >>>>>> Hi, >>>>>> >>>>>> We are having a problem making R12B-0 with the patch on Solaris 10. >>>>>> We can make and run R12B-0 without the patch on the same machine. See >>>>>> below for details of our environment. When we are trying to make >>>>>> R12B-0 with the patch, make hangs when is trying to compile >>>>>> hipe_rtl_arch.erl file. >>>>>> ********************************************************************************************************* >>>>>> make[2]: Leaving directory >>>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/parsetools' >>>>>> make[2]: Entering directory >>>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' >>>>>> make[2]: Nothing to be done for `opt'. >>>>>> make[2]: Leaving directory >>>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' >>>>>> make[2]: Entering directory >>>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe' >>>>>> Makefile:35: warning: overriding commands for target `docs' >>>>>> /export/home/smscproj/install/otp_src_R12B-0/make/otp_subdir.mk:28: >>>>>> warning: ignoring old commands for target `docs' >>>>>> === Entering application hipe >>>>>> make[3]: Entering directory >>>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe/rtl' >>>>>> /export/home/smscproj/install/otp_src_R12B-0/bin/sparc-sun-solaris2.10/hipe_mkliterals >>>>>> -e > hipe_literals.hrl >>>>>> erlc -W +debug_info +warn_obsolete_guard +inline -o../ebin >>>>>> hipe_rtl_arch.erl >>>>>> >>>>>> !!! We stay here till we kill the process! >>>>>> ******************************************************************************************************** >>>>>> The command patch doesn't support -Z option on Solaris (it does on >>>>>> Linux) and we use gpatch instead. >>>>>> We try to patch the source code on Linux and make on Solaris - the >>>>>> result is the same the process hangs during compilation on >>>>>> hipe_rtl_arch.erl. >>>>>> >>>>>> We tryed to compile hipe_rtl_arch.erl manually but environment >>>>>> doesn't seem to be ready yet. >>>>>> >>>>>> Any ideas what may cuase this problem? >>>>>> >>>>>> Best regards >>>>>> Ognian >>>>>> >>>>>> --------------------------Environment-------------------------------------------- >>>>>> >>>>>> The make for R12B-0 with and without patch is done on the same >>>>>> machine using the same procedure. >>>>>> We are using Sun Netra-T2000 running Solaris 10 patch level >>>>>> 125100-05. We use GCC 3.4.6. >>>>>> >>>>>> To compile 64 bit code we do: >>>>>> >>>>>> cat>/tmp/gcc64 >>>>>> #!/bin/sh >>>>>> exec gcc -m64 "$@" >>>>>> ^D >>>>>> >>>>>> chmod +x /tmp/gcc64 >>>>>> >>>>>> Every time we make we remove the old otp_src_R12B-0 directory and >>>>>> start from scratch. >>>>>> >>>>>> tar -xvf otp_src_R12B-0.tar >>>>>> gpatch -ZNp0 < otp_src_R12B-0-osp1.patch ( only with patch ) >>>>>> >>>>>> env CC=/tmp/gcc64 >>>>>> ./configure --enable-smp-support --prefix=/usr/local/erlang/R12B-0 >>>>>> make >>>>>> --------------------------------------------------------------------------------------- >>>>>> >>>>>> >>>>>> >>>>>> -----Original Message----- >>>>>> From: Kenneth Lundin [mailto:kenneth.lundin@REDACTED] >>>>>> Sent: Monday, 10 December 2007 02:33 >>>>>> To: Valentin Micic >>>>>> Cc: Sean Hinde; Rickard Green; Erlang/OTP discussions; Ognian Pantov >>>>>> [ >>>>>> MTN - Innovation Centre ]; waynes@REDACTED >>>>>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>>>>> >>>>>> >>>>>> Hi, >>>>>> >>>>>> Since the combination SMP and 64 bit sparc apparently never has >>>>>> worked >>>>>> in R11B you can't have any system in service dependent on this patch >>>>>> do you? >>>>>> >>>>>> So if you are planning on using the SMP emulator for the first time >>>>>> in a product >>>>>> I would really recommend that you put your old policy away and go for >>>>>> R12B. >>>>>> >>>>>> The reasons for that are in my opinion many: >>>>>> - R12B is the most stable version with best performance when it comes >>>>>> to SMP execution. >>>>>> R12B is the version where we will have regular service releases with >>>>>> patches and >>>>>> improvements. >>>>>> R12B is the version where improvements regarding SMP will appear. >>>>>> R12B is the version where we may support more platforms. >>>>>> Bugs found by open source users in R12B AND PREVIOUS releases will be >>>>>> corrected in R12B-1, 2, ..., etc. >>>>>> >>>>>> /Regards Kenneth Erlang/OTP team, Ericsson AB >>>>>> >>>>>> On 12/9/07, Valentin Micic wrote: >>>>>>> May I second what Sean is asking for? >>>>>>> I would really appreciate a fix for R11B-5 -- we have a policy not >>>>>>> to run >>>>>>> the latest release on production systems, and absence of the patch >>>>>>> would >>>>>>> force us to do so. Make no mistake, I really like what I saw in R12 >>>>>>> so far, >>>>>>> but we'd like to migrate on our own pace. >>>>>>> Your cooperation will be *highly* appreciated. >>>>>>> >>>>>>> Valentin Micic >>>>>>> Principal Consultant >>>>>>> PHAROS CONSVLTING (PTY) LTD. >>>>>>> Cell: +27 83 212 9180 >>>>>>> >>>>>>> ----- Original Message ----- >>>>>>> From: "Sean Hinde" >>>>>>> To: "Rickard Green" >>>>>>> Cc: "Erlang/OTP discussions" >>>>>>> Sent: Sunday, December 09, 2007 1:51 AM >>>>>>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>>>>>> >>>>>>> >>>>>>>> Hi Rikard, >>>>>>>> >>>>>>>> Do you have any plans to release a patch for those using R11B-5 on >>>>>>>> 64 >>>>>>>> bit sparc? I'm thinking mainly of the OTP-7006 issue, initially >>>>>>>> reported on R11B-5. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Sean >>>>>>>> >>>>>>>> On 7 Dec 2007, at 14:17, Rickard Green wrote: >>>>>>>> >>>>>>>>> A patch that fixes the following issues is now available at >>>>>>>>> http://www.erlang.org/download.html . Instructions for applying >>>>>>>>> the patch can be found in the patch README. >>>>>>>>> >>>>>>>>> BR, >>>>>>>>> Rickard Green, Erlang/OTP, Ericsson AB. >>>>>>>>> >>>>>>>>> ------------------------------------------------------------------------ >>>>>>>>> >>>>>>>>> >>>>>>>>> OTP-7006 The SMP emulator on sparc64 erroneously used the sparc32 >>>>>>>>> atomic and the sparc32 spinlock implementations which >>>>>>>>> caused it to crash. >>>>>>>>> >>>>>>>>> OTP-7012 Matching an empty binary in a record and then using the >>>>>>>>> same record again could cause a compiler crash. >>>>>>>>> >>>>>>>>> Example code that triggers the crash: >>>>>>>>> >>>>>>>>> -record(r, {a,b}). >>>>>>>>> t(R) -> >>>>>>>>> #r{a = <<>>} = R, >>>>>>>>> R#r.b. >>>>>>>>> >>>>>>>>> OTP-7013 file:read/2 and file:consult_stream/1,3 did not use an >>>>>>>>> empty >>>>>>>>> prompt on I/O devices. This bug has now been corrected. >>>>>>>>> >>>>>>>>> OTP-7014 configuring --enable-darwin-universal or --enable- >>>>>>>>> darwin-64bit >>>>>>>>> on MacOSX could result in a non optimized emulator. Top >>>>>>>>> level >>>>>>>>> configure script now corrected. >>>>>>>>> >>>>>>>>> OTP-7015 configuring --with-gd did not produce correct include >>>>>>>>> flags >>>>>>>>> for percept. >>>>>>>>> >>>>>>>>> ------------------------------------------------------------------------ >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> erlang-questions mailing list >>>>>>>>> erlang-questions@REDACTED >>>>>>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>>>>> _______________________________________________ >>>>>>>> erlang-questions mailing list >>>>>>>> erlang-questions@REDACTED >>>>>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>>>> _______________________________________________ >>>>>>> erlang-questions mailing list >>>>>>> erlang-questions@REDACTED >>>>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>>>> >>>>>> NOTE: This e-mail message is subject to the MTN Group disclaimer see >>>>>> http://www.mtn.co.za/default.aspx?pid=34411 >>> NOTE: This e-mail message is subject to the MTN Group disclaimer see >>> http://www.mtn.co.za/default.aspx?pid=34411 >> NOTE: This e-mail message is subject to the MTN Group disclaimer see >> http://www.mtn.co.za/default.aspx?pid=34411 From alex.arnon@REDACTED Mon Dec 17 11:57:00 2007 From: alex.arnon@REDACTED (Alex Arnon) Date: Mon, 17 Dec 2007 12:57:00 +0200 Subject: [erlang-questions] ODE binding. In-Reply-To: <475E3A73.4060401@erix.ericsson.se> References: <944da41d0712100849i1867bf9eya1ff2ad208b331d@mail.gmail.com> <475E3A73.4060401@erix.ericsson.se> Message-ID: <944da41d0712170257k51dac237h38e62a78d520042d@mail.gmail.com> Hi Dan, Apologies, I somehow missed your reply earlier!! I'm very interesting in seeing the code, even if it has partial coverage. On the other hand, I really cannot tell how long it will take us to properly get into it, due to time constraints and priorities. However, when we DO get around to it we'll certainly share our results. Cheers, Alex. On Dec 11, 2007 9:21 AM, Dan Gudmundsson wrote: > Hi > > I have a half done binding (60-70% done but still missing the famous > last 10%) I made a couple of years ago. I can send you the code if > you're interested and if I can find it :-) it's on one of my computers > somewhere... > > It probably needs to be changed to use todays improved driver api. > And it only implements the parts I was interested in, I have forgotten > which parts though. > > I want a copy when you have finished it, I want to play with it a couple > of years from now when I have finished the other stuff on my today list, > wxwidgets in better form, a new wings3d version :-D > > /Dan > > Alex Arnon wrote: > > Hi All, > > > > Has anyone built a binding (port driver or otherwise) to ODE (the Open > > Dynamics engine, http://www.ode.org/)? Inquiring minds want to know :) > > > > Thanks, > > Alex. > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From richardc@REDACTED Mon Dec 17 12:17:18 2007 From: richardc@REDACTED (Richard Carlsson) Date: Mon, 17 Dec 2007 12:17:18 +0100 Subject: [erlang-questions] clarify: how to traverse AST with erl_syntax functions ? In-Reply-To: References: Message-ID: <47665ABE.4040501@it.uu.se> Roberto Saccon wrote: > And now how do I get to the function inside ? Is there a "direct way" > to get there or do I need to unpack the tuple ? You should only use the functions in the erl_syntax module to compose/decompose abstract syntax trees; the representation is not for human consumption (and could theoretically be changed at any time without warning). There are some utility functions in erl_syntax_lib which make the decomposition easier (not the greatest set of functions i've written, but they work). You should also look at the functions make_tree/2 and subtrees/1 in erl_syntax. /Richard From egil@REDACTED Mon Dec 17 12:26:08 2007 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Mon, 17 Dec 2007 12:26:08 +0100 Subject: [erlang-questions] Percept profiler In-Reply-To: <47628AA3.5050206@ericsson.com> References: <3078210B-F5EB-4D06-8AB4-637DC333A509@gmail.com> <8268eea30712140257q3e9327ew22df0aac9172528c@mail.gmail.com> <47628AA3.5050206@ericsson.com> Message-ID: <47665CD0.10300@erix.ericsson.se> Ulf Wiger (TN/EAB) wrote: > Andreas Hillqvist skrev: >> I got in contact with Bj?rn-Egil Dahlberg, who wrote a thesis on >> "Profiling applications in Erlang Symmetrical MultiProcessing system". >> I do not believe the thesis is public available. But you can find an >> early draft online: >> http://www.cs.umu.se/~tm99bdg/documents/thesis-v.0.3.pdf > > A few statements in the early draft could use some polishing > (no surprise there, of course...) > This document/draft has been removed since it contained errors. It shouldn't have been public even, it was only intended as easy communication between a student and his supervisors. Regards, Bj?rn-Egil Dahlberg From raimo+erlang-questions@REDACTED Mon Dec 17 12:27:12 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Mon, 17 Dec 2007 12:27:12 +0100 Subject: [erlang-questions] : : queues (previously: documentation of data structures) In-Reply-To: <3dbc6d1c0712161302v366f31bl8153c1876c224419@mail.gmail.com> References: <200712070917.13979.bekesa@sch.bme.hu> <200712111344.25828.bekesa@sch.bme.hu> <475E8E41.5040603@lionet.info> <200712111516.50740.bekesa@sch.bme.hu> <20071212160247.GC11510@erix.ericsson.se> <476308A7.4060001@theheartofgold.org> <3dbc6d1c0712161302v366f31bl8153c1876c224419@mail.gmail.com> Message-ID: <20071217112712.GA31567@erix.ericsson.se> If changing the names of daeh, in_r, lait, snoc, init, out_r, head, tail and cons, why not change them all? Proposed new API (along the lines of Anders Ramsell's suggestion: Introduce the notion of a first .. last order in the queue. Elements normally enters the first end and exits the last end. Regular (forward) direction: put(Item, Q1) -> Q2 put_first(Item, Q1) -> Q2 get(Q) -> Item get_last(Q) -> Item drop(Q1) -> Q2 drop_last(Q1) -> Q2 So put/2 is an alias for put_first/2, get/1 is an alias for get_last/1 and drop/1 is an alias for drop_last/1. Goofy (backward) direction: put_last(Item, Q1) -> Q2 get_first(Q) -> Item drop_first(Q1) -> Q2 Inspection: is_empty(Q) -> Bool len(Q) -> Length Creation and conversion: new() -> Q from_list(List) -> Q to_list(Q) -> List Operations: join(Q1, Q2) -> Q3 split(N, Q1) -> {Q2, Q3} Questionables (so list-like there will be no end to it...): delete(Item, Q1) -> Q2 should it be delete(fun/1, Q1) -> Q2 or zf(fun/1, Q1) -> Q2 aka filtermap(fun/1, Q1) -> Q2 or maybe search(fun/1, Q) -> {Position,Item} | false delete(Position, Q1) -> Q2 where search/2 could be replaced with fold(fun/2, Q, Start) -> Term I also aim to add new(Q1) -> Q2 that converts to a new queue format containing length so on a converteed queue len/1 is O(1), but once you have called new/1 you can not code downgrade or send nor save a queue term to be understood by an older node. One can also consider to rename the whole module to deq, but that name should perhaps be reserved for a large and complicated all operations O(1) double ended queue according to Kaplan/Tarjan... On Sun, Dec 16, 2007 at 10:02:56PM +0100, Robert Virding wrote: > I quite agree! First it should be liat, if it is supposed to be the reverse > of tail. > > Then I also agree even more that the whole naming of the functions in the > queue module sucks. It was probably originally taken from Okasaki who uses a > subset of it in a chapter of his book. I personally think it can only be > considered as a form of "in joke" which is really only comprehensible to > people who know the terminology and as such is not suitable for a general > library. > > I find it easier and faster to rewrite the code than try and remember the > functions names if I need a queue. The algorithm is basically quite simple > and neat. > > Rewrite the module with good names for the API and make sure to drop the old > names from the documentation to make sure they don't spread, though they > will have to be kept for BC. Get out a new version ASAP. > > Robert > > P.S. Yes I know I occasionally include small jokes there are limits to what > you can do. > > On 14/12/2007, Anders Ramsell wrote: > > > > > > Anyways, queue:lait/1 should be liat/1 shouldn't it? Both in > > > > the doc and impl. (It is the opposite of tail. The opposite of > > > > cons/2 is snoc/2, the opposite of head/1 is daeh/1 but > > > > lists:reverse("tail") /= "lait"). > > > > > > Oh yes!!! I was tired when I wrote it, then self-blind, and > > > nobody proofread. If I get a reason to touch the module I will > > > add liat/1, forget about lait/1 but keep it around for backwards > > > compatibility... > > > > (I'm going to stick my neck out now. Hope I don't get beheaded.) > > > > I think the API of the queue module is a mess. Full of weird > > names and functions that do the same thing. Quite unlike most > > other modules in stdlib. This is a pity because this module is > > very useful. Or at least it could be - I'll get back to that. > > > > If you're going to change it - change it a lot. My suggestion > > would be something along these lines. First remove a few > > functions. > > > > Function: Duplicate of: > > ------------------------ > > daeh last > > in_r cons > > lait init > > snoc in > > > > But we still have some weird names left. How do you 'init' a > > queue by removing something from it? And out_r isn't all that > > beautiful either. Then we have 'head' as the opposite of 'last'. > > > > I would rename those and a few more to get something that I think > > look like a "consistent" naming. > > > > Function: Rename to: > > --------------------- > > init drop_last > > out_r out_last > > head first > > tail drop_first > > cons in_first > > > > Of course all the old names would have to remain for a few > > versions for backwards compatibility reasons. > > > > > > Now back to what I hinted at before. The names of the API are > > important but what they do is of course much more important and > > the API is quite complete. But one, in my opinion, very important > > function is missing. This fact has kept me from using this module > > and roll my own on more than one occasion. There is no function > > that removes a specified item no matter where in the queue it is. > > Sometimes you just get tired of queueing. > > > > No matter what you think of the rest of this mail please add that > > function. Keeping to my own suggested names it could be called > > 'drop'. I know it can't be O(1) but that doesn't matter. > > > > Well? Will I know get pummeled into my shoes like the noob I am > > or do I have a point? You sure do have point. > > > > /Anders > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From andreas.hillqvist@REDACTED Mon Dec 17 13:35:57 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Mon, 17 Dec 2007 13:35:57 +0100 Subject: [erlang-questions] Percept profiler In-Reply-To: <47665CD0.10300@erix.ericsson.se> References: <3078210B-F5EB-4D06-8AB4-637DC333A509@gmail.com> <8268eea30712140257q3e9327ew22df0aac9172528c@mail.gmail.com> <47628AA3.5050206@ericsson.com> <47665CD0.10300@erix.ericsson.se> Message-ID: <8268eea30712170435l2bf7dc5l252b1821633d5d4f@mail.gmail.com> Erlang is Open source and Percept is now a part of OTP. Is it now possible to release a public version of the paper? Regards Andreas Hillqvist 2007/12/17, Bj?rn-Egil Dahlberg : > Ulf Wiger (TN/EAB) wrote: > > Andreas Hillqvist skrev: > >> I got in contact with Bj?rn-Egil Dahlberg, who wrote a thesis on > >> "Profiling applications in Erlang Symmetrical MultiProcessing system". > >> I do not believe the thesis is public available. But you can find an > >> early draft online: > >> http://www.cs.umu.se/~tm99bdg/documents/thesis-v.0.3.pdf > > > > A few statements in the early draft could use some polishing > > (no surprise there, of course...) > > > > This document/draft has been removed since it contained errors. It > shouldn't have been public even, it was only intended as easy > communication between a student and his supervisors. > > Regards, > Bj?rn-Egil Dahlberg > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bekesa@REDACTED Mon Dec 17 13:19:47 2007 From: bekesa@REDACTED (Andras Georgy Bekes) Date: Mon, 17 Dec 2007 13:19:47 +0100 Subject: [erlang-questions] =?ansi_x3.4-1968?q?=3A_=3A_queues_=28previousl?= =?ansi_x3.4-1968?q?y=3A_documentation_of=09data_structures=29?= In-Reply-To: <20071217112712.GA31567@erix.ericsson.se> References: <200712070917.13979.bekesa@sch.bme.hu> <3dbc6d1c0712161302v366f31bl8153c1876c224419@mail.gmail.com> <20071217112712.GA31567@erix.ericsson.se> Message-ID: <200712171319.47748.bekesa@sch.bme.hu> > Elements normally enters the first end and exits the last end. > > Regular (forward) direction: > > put_first(Item, Q1) -> Q2 > get_last(Q) -> Item A queue is "FIFO" (First In First Out), so the first element is the one that entered the queue first, and that will leave the queue first. Your proposal is the opposite of this. Why? Georgy From bazil@REDACTED Mon Dec 17 13:39:54 2007 From: bazil@REDACTED (Dmitriy Gorbenko) Date: Mon, 17 Dec 2007 14:39:54 +0200 Subject: [erlang-questions] Memory usage by Mnesia growing to fast and it seems very strange Message-ID: <47666E1A.2030600@agenstvo.com> Hi all. Well, I have two .erl files, which makes Mnesia allocating a lot of memory and vary fast. What they are doing ? First file wrote to Mnesia table some values, and then into loop tries to read this value. Second file only writes to mnesia table in loop, and nothing else. You can find in this two test ties to use flags like "fullsweep_after", but they also did not help - memory continue constantly growing. So, If anyone knows why those test produces so much memory usage, please - reply me. Inside the files, you can find small readme, how to run them. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: match_test.erl URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: write_test.erl URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 2244 bytes Desc: S/MIME Cryptographic Signature URL: From egil@REDACTED Mon Dec 17 13:48:54 2007 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Mon, 17 Dec 2007 13:48:54 +0100 Subject: [erlang-questions] Percept profiler In-Reply-To: <8268eea30712170435l2bf7dc5l252b1821633d5d4f@mail.gmail.com> References: <3078210B-F5EB-4D06-8AB4-637DC333A509@gmail.com> <8268eea30712140257q3e9327ew22df0aac9172528c@mail.gmail.com> <47628AA3.5050206@ericsson.com> <47665CD0.10300@erix.ericsson.se> <8268eea30712170435l2bf7dc5l252b1821633d5d4f@mail.gmail.com> Message-ID: <47667036.60906@erix.ericsson.se> Andreas Hillqvist wrote: > Erlang is Open source and Percept is now a part of OTP. > Is it now possible to release a public version of the paper? There is no legal reason to why is not public. It is not public because it hasn't been published yet. I will try to find a current version. > > 2007/12/17, Bj?rn-Egil Dahlberg : >> Ulf Wiger (TN/EAB) wrote: >>> Andreas Hillqvist skrev: >>>> I got in contact with Bj?rn-Egil Dahlberg, who wrote a thesis on >>>> "Profiling applications in Erlang Symmetrical MultiProcessing system". >>>> I do not believe the thesis is public available. But you can find an >>>> early draft online: >>>> http://www.cs.umu.se/~tm99bdg/documents/thesis-v.0.3.pdf >>> A few statements in the early draft could use some polishing >>> (no surprise there, of course...) >>> >> This document/draft has been removed since it contained errors. It >> shouldn't have been public even, it was only intended as easy >> communication between a student and his supervisors. >> >> Regards, >> Bj?rn-Egil Dahlberg >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> > From andreas.hillqvist@REDACTED Mon Dec 17 14:05:10 2007 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Mon, 17 Dec 2007 14:05:10 +0100 Subject: [erlang-questions] : : queues (previously: documentation of data structures) In-Reply-To: <200712171319.47748.bekesa@sch.bme.hu> References: <200712070917.13979.bekesa@sch.bme.hu> <3dbc6d1c0712161302v366f31bl8153c1876c224419@mail.gmail.com> <20071217112712.GA31567@erix.ericsson.se> <200712171319.47748.bekesa@sch.bme.hu> Message-ID: <8268eea30712170505i56d66f5sd065b4b708b3086e@mail.gmail.com> I intrepid Raimo proposal as being FIFO. You add to the beginning(put/2 or put_first/2), removing from the end(get/1 or get_last/1). First item will be last in list even if new element is added, therefor first in will be first out. (Unless you use put_last.) I don't see any point in arguing over: * "Add to beginning and remove from end" or * "Add to end and remove from beginning" It will still be a FIFO or did I miss something? Regards Andreas Hillqvist 2007/12/17, Andras Georgy Bekes : > > Elements normally enters the first end and exits the last end. > > > > Regular (forward) direction: > > > > put_first(Item, Q1) -> Q2 > > get_last(Q) -> Item > > A queue is "FIFO" (First In First Out), so the first element is the one > that entered the queue first, and that will leave the queue first. > > Your proposal is the opposite of this. Why? > > Georgy > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From rasmussen.bryan@REDACTED Mon Dec 17 14:33:38 2007 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Mon, 17 Dec 2007 14:33:38 +0100 Subject: [erlang-questions] A rendering server in Erlang? Performance gains? Message-ID: <3bb44c6e0712170533q2f38809fu1cee583e6b286071@mail.gmail.com> Hi, I'm supposed to make a Rendering Server, defined as a Server that takes a number of file formats as inputs and allows the output of a number of other filetypes. For example if one inputs a PDF it might be output as both TXT, TIFF, Word, Open Office, if one inputs a TIFF it might be output as TXT and PDF. Basically it should be possible to slot new format conversion/rendering services in. It does not need to be over HTTP but I want it to be, mainly because if I can't get it okayed to be over HTTP it will come to have some other non-http compatible functionality that will end up not making it scale very well, as well as being prone to security hazards and needing much more maintanence. So, like I said, I would prefer it to work over HTTP. SSL security needs to be enabled. There are some specific requirements for technology as follows: 1. Must run on Windows because 2. Microsoft Office must be installed because - guy in charge with seniority says he wants MS Office installed. (despite his also insisting that it should be a big piece of hardware that sits in the server room and nobody ever has to do any maintenance or fiddling with it because it is just so secure and if anything fails it just keeps going and going and so forth....) What I am thinking, initially, is the following: a service endpoint takes the File to be converted (or files, the first version doesn't need to support mime multipart messages but it will need to in the future) via a POST. The response code is a 303 See other. The uri it would point to would be http://{server}/outputs/{timestamp}/{filename}/render A request to that would return a dynamically generated XML file ... That would specify the status of the various rendering operations. Thus if one should have a rendering of PDF to TIFF then Would tell the client that the TIFF file was complete and they could request that file via http://{server}/outputs/{timestamp}/{filename}/render/TIFF I think that part of the application seems to be something that Erlang (with YAWS - how easy is it to specify Custom HTTP headers and process the same with YAWS, btw? ) will produce benefits for. The problem is in the rendering. The service takes the file to be rendered and writes it to a folder in the file system. This folder is monitored by the renderer dispatcher. The renderer dispatcher takes the new files and sends them to the appropriate renderer. This will probably need to be via the Command Line (since we do not want to have to write Renderers for every file rendering we support in the future, instead we want to use various tools etc. However the aforementioned person in authority also wants us to use some particular components to do things, specifically http://www.peernet.com/epro/index.html and http://buy.abbyy.com/content/frpro/default.aspx I'm not sure why these particular components are wanted and not others but they're the ones that are specified - as well as the specification of MS Windows and MS Office running on the server). The programs that do the individual rendering will not be be written in erlang. Thus I suppose I do not gain any benefit from erlang in that context. The output from these processes is taken and put into the location where the RenderedResult document can be generated. Errors in the processes doing rendering must be logged. It will also be an error if a process takes to long and such a process should be shut down to free up system resources. Thus if Erlang could run a Windows process, look for it to generate errors and shut it down? Can anyone see any point in the rendering process where Erlang could give performance benefits? If so how should I maximally structure the solution to take advantage of Erlang and to minimize non-erlang process instabilities, performance bottlenecks etc. ? I hope my phrasing has been relatively clear and non-problematic. I have left details out that I figured was just extraneous functionality that would not be especially affected by the decision to use erlang or not - for example specific information as to the posts, responses, redirects, http headers and such of the proposed web service. Cheers, Bryan Rasmussen From patrickerj@REDACTED Mon Dec 17 14:58:19 2007 From: patrickerj@REDACTED (PatrickErj) Date: Mon, 17 Dec 2007 05:58:19 -0800 (PST) Subject: [erlang-questions] Mnesia vs When Databases Lie: Consistency vs Availability in Distributed Systems In-Reply-To: <27B2B9B5-F00A-44B1-BB26-51EEAA6DFB71@gmail.com> References: <27B2B9B5-F00A-44B1-BB26-51EEAA6DFB71@gmail.com> Message-ID: <14370301.post@talk.nabble.com> That option costs min. one million dollars and the Facebook case is just lame. You will need 1Gbps link that is redundant and costs min. 40$/Mbps i.e. 45K$US/month let alone duplicate servers. Globally dis pared system is ok for doc's but not ok for HA/HPC DB. Also Amazon AWS does not cut well for "stock exchange" because you are talking about 10< microseconds and AWS is talking about 10< miliseconds in db transaction time, that is why Google has mapreduce. Joel Reymont wrote: > > How does Erlang change or improve this situation? > > http://tinyurl.com/2745ha > > I can't imagine a fragmented Mnesia table would help here, not when > one chunk lives in Europe and another in the US. > > I also imagine there would be significant costs in Transatlantic > replication (in terms of transaction time, not dollars) if a regular > distributed Mnesia table is used. > > I want to dig deep into Mnesia for the corresponding chapter of my > book. I plan to try to figure out and write up the distributed commit > protocol, for example. > > I think I'll also try to set up exactly the scenario that the above > article describes (two machines, multiple Mnesia nodes) and simulate > denial of service attacks, tripping over power cords, etc. > > I want to know exactly how much network bandwidth is taken by > replication among other things and what exactly happens when I bring > up a Mnesia node that went down. There was a discussion of this > recently but nothing beats a step by step explanation. > > Thanks, Joel > > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/Mnesia-vs-When-Databases-Lie%3A-Consistency-vs-Availability-in-Distributed-Systems-tp14336495p14370301.html Sent from the Erlang Questions mailing list archive at Nabble.com. From raimo+erlang-questions@REDACTED Mon Dec 17 14:56:32 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Mon, 17 Dec 2007 14:56:32 +0100 Subject: [erlang-questions] : =?ansi_x3.4-1968?q?=3A_=3A_queues_=28previousl?= =?ansi_x3.4-1968?q?y=3A_documentation_of=09data_structures=29?= In-Reply-To: <200712171319.47748.bekesa@sch.bme.hu> References: <200712070917.13979.bekesa@sch.bme.hu> <3dbc6d1c0712161302v366f31bl8153c1876c224419@mail.gmail.com> <20071217112712.GA31567@erix.ericsson.se> <200712171319.47748.bekesa@sch.bme.hu> Message-ID: <20071217135632.GA6822@erix.ericsson.se> On Mon, Dec 17, 2007 at 01:19:47PM +0100, Andras Georgy Bekes wrote: > > Elements normally enters the first end and exits the last end. > > > > Regular (forward) direction: > > > > put_first(Item, Q1) -> Q2 > > get_last(Q) -> Item > > A queue is "FIFO" (First In First Out), so the first element is the one > that entered the queue first, and that will leave the queue first. > > Your proposal is the opposite of this. Why? To get a discussion started ;-) No you are right, put_last and get_first as regular direction if you think of a queue of e.g people is more logical. Or just more logical, period. But when inventing names for this module for the 3:rd++ time my head starts spinning. Let me explain the current names, that I maybe will resort to claim as logical and consistent... We have a double ended queue, so it should be called dequeue or deq. But never mind that. The queue is symmetrical, so what is front/first/left/head or back/last/right/tail is just a matter of definition. We have two conflicting API styles: 1) The queue view, inserting and removing items to either end. Retrieving values returns both the requested value and the new queue with the value removed. -> {{value,V},Q2} -> {empty,Q1} So you typically code: case queue:out(Q1) of {{value,V},Q2} -> {reply,{ok,V},Q2}; {empty,Q2} -> {noreply,Q2} end 2) The list view, inserting and removing to either end. Retrieving values return just what is requested, so a test function is needed if you do not know if the queue is empty: case queue:is_empty(Q) of true -> {reply,{ok,queue:head(Q)},queue:tail(Q)}; false -> {noreply,Q} end Believe it or not but 2) is probably faster since data inspection is fast compared to building the result tuple {{value,_},_} which gives garbage that has to be collected, eventually. Queue Forward Backwards in/1 in_r out/1 out_r/1 List HeadEnd TailEnd,TailEndReverseName cons/1 ,snoc/1 head/1 last/1,daeh/1 tail/1 init/1,liat/1 If you operate a list as a queue you use cons/1 to enter items and last/1 to retreive elements. init/1 is for last/1 what tail/1 is for head/1, that is init/1 returns the list without the last element, that is; the initial part of the list. Queue operations for list view: Forward Backwards cons/1 snoc/1 last/1,daeh/1 head/1 init/1,liat/1 tail/1 The daeh/1 and liat/1 are added since snoc/1 felt alone, so now one might argue last/1 and init/1 are redundant. > > Georgy > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From patrickerj@REDACTED Mon Dec 17 15:01:52 2007 From: patrickerj@REDACTED (PatrickErj) Date: Mon, 17 Dec 2007 06:01:52 -0800 (PST) Subject: [erlang-questions] RamSan and the EveOnline architecture In-Reply-To: References: Message-ID: <14370305.post@talk.nabble.com> FusionIO 80GB card costs 2k$US, cca. 100K IOps. Joel Reymont wrote: > > "EVE Online is the world's largest game universe with over 75,000 > dedicated subscribers who play this Massively Multiplayer Online Role- > playing Game (MMORPG) in a single, connected environment." > > "Players connect to the game servers via the Internet and interact in > real time with other players worldwide. EVE Online is truly a massive > multiplayer game, where all 75,000 plus subscribers inhabit the same > game world, not split into smaller limited groups or "shards". > > http://myeve.eve-online.com/devblog.asp?a=blog&bid=286 > > Among other interesting things: > > "Our SQL problems were essentially exterminated recently when we got > our RAMSAN-400" > > The problem: > > "The EVE Online application software was running fast and scaling well > to accommodate tens of thousands of simultaneous users with its 150 > IBM servers. However, the system's storage was being overwhelmed with > huge amounts of small data requests. Ideal RAID Storage performance is > achieved when the requested data blocks are large; conversely, RAID > Storage performance is greatly reduced when requested data blocks are > small. Typical disk access times are 2-5 milliseconds and what was > needed was a faster disk access time of 20-50 microseconds." > > And the solution: > > "The RamSan-400 delivers 400,000 I/Os per second, has 3,000 MB of > internal bandwidth with latency of less than 15 microseconds. "We did > consider upgrading to faster disks, but the specs for the RamSan were > so insane that we had to look into it", said J?rundur Matth?asson, > Database Manager for CCP Games." > > "EVE Online's underlying storage bottleneck is a classic problem with > Online Transaction Processing. 10,000+ users accessing account > information, warping across the galaxy, buying goods from black-market > free-lance smugglers and upgrading their mining frigates to assault > cruisers all at the same time puts immense stress on disk-based > storage. The game makes 60 million process calls per day with around > 1,250 transactions per second at peak hours. The RamSan-400, based on > solid-state disk (SSD) technology, is ideal for applications that have > massive amounts of transactions randomly distributed across the > storage media. Where disks are limited by how fast a platter can spin, > SSD uses memory chips to read and write data. Transactions run as fast > as the server can issue, and are not bottlenecked by grinding disk > heads." > > And the RamSan article: > > http://www.superssd.com/success/ccpgames.htm > > Mnesia on a RamSan anyone? > > Thanks, Joel > > -- > http://wagerlabs.com > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/RamSan-and-the-EveOnline-architecture-tp14337301p14370305.html Sent from the Erlang Questions mailing list archive at Nabble.com. From bazil@REDACTED Mon Dec 17 15:07:29 2007 From: bazil@REDACTED (Dmitriy Gorbenko) Date: Mon, 17 Dec 2007 16:07:29 +0200 Subject: [erlang-questions] Memory usage by Mnesia growing to fast and it seems very strange In-Reply-To: <47666E1A.2030600@agenstvo.com> References: <47666E1A.2030600@agenstvo.com> Message-ID: <476682A1.7000801@agenstvo.com> I should say, that "second" test (write_test.erl) writes all time into the same place in mnesia table, so table isn't grow. Dmitriy Gorbenko wrote: > Hi all. > > Well, I have two .erl files, which makes Mnesia allocating a lot of > memory and vary fast. > > What they are doing ? First file wrote to Mnesia table some values, and > then into loop tries to read this value. > Second file only writes to mnesia table in loop, and nothing else. > > You can find in this two test ties to use flags like "fullsweep_after", > but they also did not help - memory continue constantly growing. > > > So, If anyone knows why those test produces so much memory usage, please > - reply me. > > > Inside the files, you can find small readme, how to run them. > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 2244 bytes Desc: S/MIME Cryptographic Signature URL: From patrickerj@REDACTED Mon Dec 17 15:07:47 2007 From: patrickerj@REDACTED (PatrickErj) Date: Mon, 17 Dec 2007 06:07:47 -0800 (PST) Subject: [erlang-questions] Mnesia vs When Databases Lie: Consistency vs Availability in Distributed Systems In-Reply-To: <476295E8.1060409@ericsson.com> References: <27B2B9B5-F00A-44B1-BB26-51EEAA6DFB71@gmail.com> <476295E8.1060409@ericsson.com> Message-ID: <14370310.post@talk.nabble.com> Ulf could you pls. find where the info on that page vanished. :) Ulf Wiger (TN/EAB) wrote: > > > Ok, I only browsed the article with half an eye, so I > may be firing prematurely, but... > > If you look at mnesia_frag, it allows you to exercise some > control over the distribution of objects into fragments. > > If you have a structured key {Continent, ...}, you could > select a fragment from a subset of fragments on the > right continent. These fragments could be replicated > "intra-continentally", and you could perhaps guard against > someone diving down to the bottom of the Atlantic and > cutting the Transatlantic link, by implementing geographical > redundancy (asynchronously logging events to a backup > store on another continent.) > > BTW, there is an old slide kit, called Mnesia Internals. > It's supposed to be available here: > > http://www.erlang-projects.org/Public/projects/erlangotp/mnesia_internals_sli/view > > but I'm getting a "Bad Gateway" error at the moment. > > BR, > Ulf W > > Joel Reymont skrev: >> How does Erlang change or improve this situation? >> >> http://tinyurl.com/2745ha >> >> I can't imagine a fragmented Mnesia table would help here, not when >> one chunk lives in Europe and another in the US. >> >> I also imagine there would be significant costs in Transatlantic >> replication (in terms of transaction time, not dollars) if a regular >> distributed Mnesia table is used. >> >> I want to dig deep into Mnesia for the corresponding chapter of my >> book. I plan to try to figure out and write up the distributed commit >> protocol, for example. >> >> I think I'll also try to set up exactly the scenario that the above >> article describes (two machines, multiple Mnesia nodes) and simulate >> denial of service attacks, tripping over power cords, etc. >> >> I want to know exactly how much network bandwidth is taken by >> replication among other things and what exactly happens when I bring >> up a Mnesia node that went down. There was a discussion of this >> recently but nothing beats a step by step explanation. >> >> Thanks, Joel >> >> >> -- >> http://wagerlabs.com >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/Mnesia-vs-When-Databases-Lie%3A-Consistency-vs-Availability-in-Distributed-Systems-tp14336495p14370310.html Sent from the Erlang Questions mailing list archive at Nabble.com. From anders@REDACTED Mon Dec 17 15:59:04 2007 From: anders@REDACTED (Anders Ramsell) Date: Mon, 17 Dec 2007 15:59:04 +0100 Subject: [erlang-questions] : : queues (previously: documentation of data structures) In-Reply-To: <20071217112712.GA31567@erix.ericsson.se> References: <200712070917.13979.bekesa@sch.bme.hu> <200712111344.25828.bekesa@sch.bme.hu> <475E8E41.5040603@lionet.info> <200712111516.50740.bekesa@sch.bme.hu> <20071212160247.GC11510@erix.ericsson.se> <476308A7.4060001@theheartofgold.org> <3dbc6d1c0712161302v366f31bl8153c1876c224419@mail.gmail.com> <20071217112712.GA31567@erix.ericsson.se> Message-ID: <47668EB8.3070408@theheartofgold.org> Raimo Niskanen wrote: > If speed is not important at all you can of course do > Q1 = queue:from_list([X || X <- queue:to_list(Q0), X =/= Y] > and such. To my defence I only said that it didn't matter it couldn't be O(1). A reasonably efficient function is always nice. :-) > Proposed new API (along the lines of Anders Ramsell's suggestion: > > Introduce the notion of a first .. last order in the queue. > Elements normally enters the first end and exits the last end. Well, it does look a lot better than what we have today, but it seems "backwards". I do think you enter a queue at the end. Actually the only operations on a "queue" I tend to use is (avoiding API names altogether) these: - create a queue - add element to queue (which is then last in queue) - remove first element from queue for processing (waited the longest) - remove element from queue (no longer relevant) The purpose being handling resources in the order they arrive with the extra constraint that some resources "go away" before it's their turn. That said, I'm sure the other operations also could be very useful in certain circumstances. And even though I beleive that what you call "delete(Item, Q1) -> Q2" is what I called 'drop' (and I'd still like that one added very much) I don't think the queue module should house a wide variety of "list like" funtions. /Anders Ramsell From rickard.s.green@REDACTED Mon Dec 17 16:09:11 2007 From: rickard.s.green@REDACTED (Rickard Green) Date: Mon, 17 Dec 2007 16:09:11 +0100 Subject: [erlang-questions] Source patch for R12B-0 not working on Netra T2000 with SMP enabled (64-bit) In-Reply-To: <017801c8408b$d9aa2f20$6401a8c0@moneymaker2> References: <26B04CE34936014297D381585CCE89B042B459@MTNMAIL1.mtn.co.za> <4762A673.10601@ericsson.com> <017801c8408b$d9aa2f20$6401a8c0@moneymaker2> Message-ID: <47669117.9000801@ericsson.com> No, not without more information. The information I requested would help. Besides that, I've also built a small otp installation which you could install and try to compile your patched R12B-0 source tree with. Unpack http://www.erlang.org/download/r12b-0-osp1-small.tar.gz with gnu tar, cd into the r12b-0-osp1-small directory and run: ./Install -minimal `pwd` (note backticks) Put the small installation in your path, cd into your patched source tree and run: ./otp_build configure --enable-smp-support && ./otp_build opt Note that it is important that you use the otp_build commands above; otherwise, your bootstrap will be used. Is it able to compile the hipe_rtl_arch.erl file? If it hangs, 'kill -ABRT' it and send us the core. Note that we will not be able to put much more effort into this until the second week of January -08. BR, Rickard Green, Erlang/OTP, Ericsson AB. Valentin Micic wrote: > Hi, > > I know this is a bad time of the year, however, can we get some kind of > conclusion and/or resolution for this particular problem? > > Regards, > > Valentin. > > ----- Original Message ----- From: "Rickard Green" > > To: "Ognian Pantov [ MTN - Innovation Centre ]" > Cc: "Valentin Micic" ; "Kenneth Lundin" > ; "Sean Hinde" ; > "Erlang/OTP discussions" ; > > Sent: Friday, December 14, 2007 5:51 PM > Subject: Re: [erlang-questions] Source patch for R12B-0 available > > >> 'kill -ABRT' the emulator when you are sure the emulator hangs (i.e. >> 0% cpu utilization after quite a while). Make the following available >> for download: >> * A complete build log including the environment (use 'script' to >> capture printouts and type 'env' to print the environment). >> * The whole source tree you've built in and the core generated (pack >> with gnu tar). >> >> I'll have a look at it, and try to figure out what is going on. >> >> By the way: Have anyone else tried to build R12B-0 with the patch on >> solaris 10 sparc64? If so, did it fail or succeed? >> >> BR, >> Rickard Green, Erlang/OTP, Ericsson AB. >> >> Ognian Pantov [ MTN - Innovation Centre ] wrote: >>> Hi, >>> >>> I manage to build R12B-0 Erlang 64 bit with the patch on T2000 >>> without SMP support: env CC=/tmp/gcc64 ./configure >>> --disable-smp-support --prefix=/usr/local/erlang/R12B-0 >>> >>> We can build R12B-0 on the same machine with the same OS using the >>> same procedure: >>> - 64 bit with SMP support, no patch >>> - 64 bit with patch, NO SMP >>> >>> We can't build 64 bit with SMP support with the patch. >>> >>> It seems that the patch and SMP don't work together on Netra T2000. >>> >>> Best regards >>> Ognian >>> >>> -----Original Message----- >>> From: Rickard Green [mailto:rickard.s.green@REDACTED] >>> Sent: Thursday, 13 December 2007 05:42 >>> To: Ognian Pantov [ MTN - Innovation Centre ] >>> Cc: Valentin Micic; Kenneth Lundin; Sean Hinde; Erlang/OTP discussions; >>> waynes@REDACTED >>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>> >>> >>> >>> $ uname -a >>> SunOS xxx 5.10 Generic_125100-10 sun4u sparc SUNW,Ultra-5_10 >>> >>> BR, >>> Rickard Green, Erlang/OTP, Ericsson AB. >>> >>> Ognian Pantov [ MTN - Innovation Centre ] wrote: >>>> Hi, >>>> >>>> We can build R12B-0 without the patch on Netra T2000 (SMP) and Netra >>>> 440 (No SMP) using Sun tar or GNU tar, with or without -64 flag >>>> passed to ld. There is no other Erlang on the box. >>>> >>>> We can't build R12B-0 with the patch on Netra T2000 and Netra 440 >>>> using Sun tar or GNU tar, with or without -64 flag passed to ld. >>>> There is no other Erlang on the box. >>>> >>>> What is the hardware you are using to build Solaris 10? >>>> >>>> If do env CC=/tmp/gcc64 ./configure --enable-smp-support >>>> --prefix=/usr/local/erlang/R11-1 on Netra 440 using R11B-1 we got: >>>> >>>> checking whether an emulator with smp support should be built... >>>> yes; enabled by user configure: error: cannot build smp enabled >>>> emulator since hardware platform (ultrasparc wordsize=8) is not supp >>>> orted >>>> configure: error: >>>> /export/home/smscproj/install/otp_src_R11B-1/erts/configure failed >>>> for erts >>>> >>>> If we do env CC=/tmp/gcc64 ./configure --enable-smp-support >>>> --prefix=/usr/local/erlang/R12B-0 >>>> configure finish successfully! We can build OK without patch and we >>>> fail to build with the patch. >>>> >>>> Best regards >>>> Ognian >>>> >>>> -----Original Message----- >>>> From: Rickard Green [mailto:rickard.s.green@REDACTED] >>>> Sent: Thursday, 13 December 2007 01:15 >>>> To: Valentin Micic >>>> Cc: Ognian Pantov [ MTN - Innovation Centre ]; Kenneth Lundin; Sean >>>> Hinde; Erlang/OTP discussions; waynes@REDACTED >>>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>>> >>>> >>>> Valentin Micic wrote: >>>>> Not sure how is gnu tar related to the problem, but we'll try... >>>>> >>>> As far as I know solaris tar and gnu tar are slightly incompatible, >>>> and that you might get silent errors if you extract using solaris >>>> tar. I'm no tar expert, though, I might be wrong, but by using gnu >>>> tar you will at least remove one possible error source. >>>> >>>>> When we've run "truss" command using 'erlc' and arguments as >>>>> indicated immediately when build "hangs", the execution fails >>>>> because it cannot locate 'erl'. Unfortunately, the 'erl' hasn't >>>>> been build at this point, so I am at loss... it appears to me that >>>>> 'erlc' is invoked to early, that is to say, before 'erl' has been >>>>> created. Thus, two questions for your consideration, if you please: >>>>> >>>>> 1) Could it be that patch is inserted at a wrong place; >>>> Perhaps, but I've also used gpatch (version 2.5.4), and it works for >>>> me. You could try to apply the patch manually if you want. Modify >>>> all files included in the patch manually except for >>>> otp_src_R12B-0/configure, and otp_src_R12B-0/erts/configure then cd >>>> into otp_src_R12B-0 and run "./otp_build autoconf" (you need to have >>>> autoconf 2.59 in your path). If you search for "diff -Naur" in the >>>> patch file, you will easily find the beginning of each diff. >>>> >>>>> 2) Could it be that your build is successful because you do have >>>>> erl somewhere in your path (I mean erl that you've build before via >>>>> separate build) -- I've checked it over and over again: erlc will >>>>> try to invoke erl using any path specified in your $PATH variable. >>>>> >>>> The top makefile puts the bootstrap/bin directory (where the >>>> bootstrap erl and erlc resides) first in your path during the build. >>>> I've also successfully built it without any erl and erlc in the path >>>> and without ERLC_EMULATOR set, and also using the runtime system >>>> with resp. without smp support. >>>> >>>> You could also try to enable/disable smp support for erlc by putting >>>> -smpenable/-smpdisable in the ERL_ZFLAGS environment variable before >>>> building and see if it makes any difference. >>>> >>>> BR, >>>> Rickard Green, Erlang/OTP, Ericsson AB. >>>> >>>>> Thanks for your effort so far. >>>>> >>>>> Kind Regards, >>>>> V. >>>>> >>>>> >>>>> ----- Original Message ----- From: "Rickard Green" >>>>> >>>>> To: "Ognian Pantov [ MTN - Innovation Centre ]" >>>>> Cc: "Kenneth Lundin" ; "Sean Hinde" >>>>> ; "Erlang/OTP discussions" >>>>> ; ; >>>>> "Valentin Micic" >>>>> Sent: Wednesday, December 12, 2007 2:05 PM >>>>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>>>> >>>>> >>>>>> It builds fine for me on solaris 10. >>>>>> >>>>>> Are you extracting the tar file with gnu tar? If not, you need to. >>>>>> >>>>>> Instead of using CC I put a script called gcc (similar to yours) >>>>>> in the path and also a script called ld (passing -64 as argument >>>>>> to ld) in the path. >>>>>> >>>>>> I use gcc 3.4.4. >>>>>> >>>>>> BR, >>>>>> Rickard Green, Erlang/OTP, Ericsson AB. >>>>>> >>>>>> >>>>>> Ognian Pantov [ MTN - Innovation Centre ] wrote: >>>>>>> Hi, >>>>>>> >>>>>>> We are having a problem making R12B-0 with the patch on Solaris 10. >>>>>>> We can make and run R12B-0 without the patch on the same machine. >>>>>>> See below for details of our environment. When we are trying to >>>>>>> make R12B-0 with the patch, make hangs when is trying to compile >>>>>>> hipe_rtl_arch.erl file. >>>>>>> ********************************************************************************************************* >>>>>>> >>>>>>> make[2]: Leaving directory >>>>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/parsetools' >>>>>>> make[2]: Entering directory >>>>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' >>>>>>> make[2]: Nothing to be done for `opt'. >>>>>>> make[2]: Leaving directory >>>>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/asn1/src' >>>>>>> make[2]: Entering directory >>>>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe' >>>>>>> Makefile:35: warning: overriding commands for target `docs' >>>>>>> /export/home/smscproj/install/otp_src_R12B-0/make/otp_subdir.mk:28: >>>>>>> warning: ignoring old commands for target `docs' >>>>>>> === Entering application hipe >>>>>>> make[3]: Entering directory >>>>>>> `/export/home/smscproj/install/otp_src_R12B-0/lib/hipe/rtl' >>>>>>> /export/home/smscproj/install/otp_src_R12B-0/bin/sparc-sun-solaris2.10/hipe_mkliterals >>>>>>> -e > hipe_literals.hrl >>>>>>> erlc -W +debug_info +warn_obsolete_guard +inline -o../ebin >>>>>>> hipe_rtl_arch.erl >>>>>>> >>>>>>> !!! We stay here till we kill the process! >>>>>>> ******************************************************************************************************** >>>>>>> >>>>>>> The command patch doesn't support -Z option on Solaris (it does >>>>>>> on Linux) and we use gpatch instead. >>>>>>> We try to patch the source code on Linux and make on Solaris - >>>>>>> the result is the same the process hangs during compilation on >>>>>>> hipe_rtl_arch.erl. >>>>>>> >>>>>>> We tryed to compile hipe_rtl_arch.erl manually but environment >>>>>>> doesn't seem to be ready yet. >>>>>>> >>>>>>> Any ideas what may cuase this problem? >>>>>>> >>>>>>> Best regards >>>>>>> Ognian >>>>>>> >>>>>>> --------------------------Environment-------------------------------------------- >>>>>>> >>>>>>> >>>>>>> The make for R12B-0 with and without patch is done on the same >>>>>>> machine using the same procedure. >>>>>>> We are using Sun Netra-T2000 running Solaris 10 patch level >>>>>>> 125100-05. We use GCC 3.4.6. >>>>>>> >>>>>>> To compile 64 bit code we do: >>>>>>> >>>>>>> cat>/tmp/gcc64 >>>>>>> #!/bin/sh >>>>>>> exec gcc -m64 "$@" >>>>>>> ^D >>>>>>> >>>>>>> chmod +x /tmp/gcc64 >>>>>>> >>>>>>> Every time we make we remove the old otp_src_R12B-0 directory and >>>>>>> start from scratch. >>>>>>> >>>>>>> tar -xvf otp_src_R12B-0.tar >>>>>>> gpatch -ZNp0 < otp_src_R12B-0-osp1.patch ( only with patch ) >>>>>>> >>>>>>> env CC=/tmp/gcc64 ./configure --enable-smp-support >>>>>>> --prefix=/usr/local/erlang/R12B-0 >>>>>>> make >>>>>>> --------------------------------------------------------------------------------------- >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -----Original Message----- >>>>>>> From: Kenneth Lundin [mailto:kenneth.lundin@REDACTED] >>>>>>> Sent: Monday, 10 December 2007 02:33 >>>>>>> To: Valentin Micic >>>>>>> Cc: Sean Hinde; Rickard Green; Erlang/OTP discussions; Ognian >>>>>>> Pantov [ >>>>>>> MTN - Innovation Centre ]; waynes@REDACTED >>>>>>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>>>>>> >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> Since the combination SMP and 64 bit sparc apparently never has >>>>>>> worked >>>>>>> in R11B you can't have any system in service dependent on this patch >>>>>>> do you? >>>>>>> >>>>>>> So if you are planning on using the SMP emulator for the first >>>>>>> time in a product >>>>>>> I would really recommend that you put your old policy away and go >>>>>>> for R12B. >>>>>>> >>>>>>> The reasons for that are in my opinion many: >>>>>>> - R12B is the most stable version with best performance when it >>>>>>> comes >>>>>>> to SMP execution. >>>>>>> R12B is the version where we will have regular service releases >>>>>>> with patches and >>>>>>> improvements. >>>>>>> R12B is the version where improvements regarding SMP will appear. >>>>>>> R12B is the version where we may support more platforms. >>>>>>> Bugs found by open source users in R12B AND PREVIOUS releases >>>>>>> will be >>>>>>> corrected in R12B-1, 2, ..., etc. >>>>>>> >>>>>>> /Regards Kenneth Erlang/OTP team, Ericsson AB >>>>>>> >>>>>>> On 12/9/07, Valentin Micic wrote: >>>>>>>> May I second what Sean is asking for? >>>>>>>> I would really appreciate a fix for R11B-5 -- we have a policy >>>>>>>> not to run >>>>>>>> the latest release on production systems, and absence of the >>>>>>>> patch would >>>>>>>> force us to do so. Make no mistake, I really like what I saw in >>>>>>>> R12 so far, >>>>>>>> but we'd like to migrate on our own pace. >>>>>>>> Your cooperation will be *highly* appreciated. >>>>>>>> >>>>>>>> Valentin Micic >>>>>>>> Principal Consultant >>>>>>>> PHAROS CONSVLTING (PTY) LTD. >>>>>>>> Cell: +27 83 212 9180 >>>>>>>> >>>>>>>> ----- Original Message ----- >>>>>>>> From: "Sean Hinde" >>>>>>>> To: "Rickard Green" >>>>>>>> Cc: "Erlang/OTP discussions" >>>>>>>> Sent: Sunday, December 09, 2007 1:51 AM >>>>>>>> Subject: Re: [erlang-questions] Source patch for R12B-0 available >>>>>>>> >>>>>>>> >>>>>>>>> Hi Rikard, >>>>>>>>> >>>>>>>>> Do you have any plans to release a patch for those using R11B-5 >>>>>>>>> on 64 >>>>>>>>> bit sparc? I'm thinking mainly of the OTP-7006 issue, initially >>>>>>>>> reported on R11B-5. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Sean >>>>>>>>> >>>>>>>>> On 7 Dec 2007, at 14:17, Rickard Green wrote: >>>>>>>>> >>>>>>>>>> A patch that fixes the following issues is now available at >>>>>>>>>> http://www.erlang.org/download.html . Instructions for applying >>>>>>>>>> the patch can be found in the patch README. >>>>>>>>>> >>>>>>>>>> BR, >>>>>>>>>> Rickard Green, Erlang/OTP, Ericsson AB. >>>>>>>>>> >>>>>>>>>> ------------------------------------------------------------------------ >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> OTP-7006 The SMP emulator on sparc64 erroneously used the >>>>>>>>>> sparc32 >>>>>>>>>> atomic and the sparc32 spinlock implementations which >>>>>>>>>> caused it to crash. >>>>>>>>>> >>>>>>>>>> OTP-7012 Matching an empty binary in a record and then using the >>>>>>>>>> same record again could cause a compiler crash. >>>>>>>>>> >>>>>>>>>> Example code that triggers the crash: >>>>>>>>>> >>>>>>>>>> -record(r, {a,b}). >>>>>>>>>> t(R) -> >>>>>>>>>> #r{a = <<>>} = R, >>>>>>>>>> R#r.b. >>>>>>>>>> >>>>>>>>>> OTP-7013 file:read/2 and file:consult_stream/1,3 did not use >>>>>>>>>> an empty >>>>>>>>>> prompt on I/O devices. This bug has now been corrected. >>>>>>>>>> >>>>>>>>>> OTP-7014 configuring --enable-darwin-universal or --enable- >>>>>>>>>> darwin-64bit >>>>>>>>>> on MacOSX could result in a non optimized emulator. Top >>>>>>>>>> level >>>>>>>>>> configure script now corrected. >>>>>>>>>> >>>>>>>>>> OTP-7015 configuring --with-gd did not produce correct >>>>>>>>>> include flags >>>>>>>>>> for percept. >>>>>>>>>> >>>>>>>>>> ------------------------------------------------------------------------ >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> erlang-questions mailing list >>>>>>>>>> erlang-questions@REDACTED >>>>>>>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>>>>>> _______________________________________________ >>>>>>>>> erlang-questions mailing list >>>>>>>>> erlang-questions@REDACTED >>>>>>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>>>>> _______________________________________________ >>>>>>>> erlang-questions mailing list >>>>>>>> erlang-questions@REDACTED >>>>>>>> http://www.erlang.org/mailman/listinfo/erlang-questions >>>>>>>> >>>>>>> NOTE: This e-mail message is subject to the MTN Group disclaimer >>>>>>> see http://www.mtn.co.za/default.aspx?pid=34411 >>>> NOTE: This e-mail message is subject to the MTN Group disclaimer see >>>> http://www.mtn.co.za/default.aspx?pid=34411 >>> NOTE: This e-mail message is subject to the MTN Group disclaimer see >>> http://www.mtn.co.za/default.aspx?pid=34411 > > From bazil@REDACTED Mon Dec 17 16:25:19 2007 From: bazil@REDACTED (Dmitriy Gorbenko) Date: Mon, 17 Dec 2007 17:25:19 +0200 Subject: [erlang-questions] Memory usage by Mnesia growing to fast and it seems very strange Message-ID: <476694DF.7080800@agenstvo.com> We have done again few test, and find that if we shall do transaction writing, memory usage will grow. If we will use dirty commands, then memory growing, but not so fast, and sometimes (and it's interesting fact) even did not grow at all. Ok, even if we use transactions to operate with Mnesia for about 500 000 times, and Mnesia accumulate 40-60 megabytes, after a few minutes of idle (beam process is idle - nothing to do to him), memory usage will fall to 9-11 megabytes. And this gives me opinion to think that Mnesia under heavy load just delay "free memory" procedure until "better time" comes. And then this time is come - memory usage very quickly decrease. Is my assumption right ? Thanks. Dmitriy Gorbenko wrote: > Hi all. > > Well, I have two .erl files, which makes Mnesia allocating a lot of > memory and vary fast. > > What they are doing ? First file wrote to Mnesia table some values, and > then into loop tries to read this value. > Second file only writes to mnesia table in loop, and nothing else. > > You can find in this two test ties to use flags like "fullsweep_after", > but they also did not help - memory continue constantly growing. > > > So, If anyone knows why those test produces so much memory usage, please > - reply me. > > > Inside the files, you can find small readme, how to run them. > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 2244 bytes Desc: S/MIME Cryptographic Signature URL: From jay@REDACTED Mon Dec 17 16:40:05 2007 From: jay@REDACTED (Jay Nelson) Date: Mon, 17 Dec 2007 07:40:05 -0800 Subject: [erlang-questions] Amazon AWS SimpleDB based on erlang now in beta Message-ID: <47681B47-1312-4CA1-85D2-8E31A24CC852@duomark.com> Depends on your perspective. The initial beta test size is 10Gb. They plan to raise that limit. The references to small data sets I believe are used by Amazon in comparison to S3 (simple storage service). The cost of SimpleDB is 10x for storing data versus S3. S3 is filesystem based storage and SimpleDB is a hash table. The intent is that you store your large datasets in S3 and store just the metadata or queryable attributes in SimpleDB. jay From richardc@REDACTED Mon Dec 17 17:04:42 2007 From: richardc@REDACTED (Richard Carlsson) Date: Mon, 17 Dec 2007 17:04:42 +0100 Subject: [erlang-questions] clarify: how to traverse AST with erl_syntax functions ? In-Reply-To: References: Message-ID: <47669E1A.9030507@it.uu.se> Roberto Saccon wrote: > 2> {ok,{_,[{abstract_code,{_,Ac}}]}} = beam_lib:chunks(Beam,[abstract_code]). > ... > 3>T= erl_syntax:abstract(Ac). > ... > 4> erl_syntax:type(T). > list > 5> Ts=erl_syntax:list_elements(T). Oops, I didn't see at first what you were doing. You should not use the function erl_syntax:abstract/1 on the value Ac - that already is a *list* of AST:s (albeit in the form that erl_parse returns), which are acceptable to the erl_syntax functions. The list corresponds to the sequence of declarations in the original program. If you convert the list to a single AST, using erl_syntax:form_list/1, you can pass this AST to erl_prettypr:format/1 to display it. (Or you can iterate over the list and display the individual AST:s one at a time.) The function erl_syntax:abstract/1 is for taking a concrete value, as in erl_syntax:abstract(42), and returning an AST representing the syntax for that value. (When you called abstract/1 on the value Ac above, you created a representation of the representation.) /Richard From patrickerj@REDACTED Mon Dec 17 17:33:44 2007 From: patrickerj@REDACTED (PatrickErj) Date: Mon, 17 Dec 2007 08:33:44 -0800 (PST) Subject: [erlang-questions] Mnesia vs When Databases Lie: Consistency vs Availability in Distributed Systems In-Reply-To: <14370301.post@talk.nabble.com> References: <27B2B9B5-F00A-44B1-BB26-51EEAA6DFB71@gmail.com> <14370301.post@talk.nabble.com> Message-ID: <14373894.post@talk.nabble.com> My bad on AWS, just checked RightScale EC2 tests: http://info.rightscale.com/2007/11/29/network-performance-in-ec2-and-s3 Still the 75 to 350 microsecond latency in EC2 is a lot, for seriously busy database even too much. PatrickErj wrote: > > That option costs min. one million dollars and the Facebook case is just > lame. You will need 1Gbps link that is redundant and costs min. 40$/Mbps > i.e. 45K$US/month let alone duplicate servers. Globally dis pared system > is ok for doc's but not ok for HA/HPC DB. Also Amazon AWS does not cut > well for "stock exchange" because you are talking about 10< microseconds > and AWS is talking about 10< miliseconds in db transaction time, that is > why Google has mapreduce. > > > > > > Joel Reymont wrote: >> >> How does Erlang change or improve this situation? >> >> http://tinyurl.com/2745ha >> >> I can't imagine a fragmented Mnesia table would help here, not when >> one chunk lives in Europe and another in the US. >> >> I also imagine there would be significant costs in Transatlantic >> replication (in terms of transaction time, not dollars) if a regular >> distributed Mnesia table is used. >> >> I want to dig deep into Mnesia for the corresponding chapter of my >> book. I plan to try to figure out and write up the distributed commit >> protocol, for example. >> >> I think I'll also try to set up exactly the scenario that the above >> article describes (two machines, multiple Mnesia nodes) and simulate >> denial of service attacks, tripping over power cords, etc. >> >> I want to know exactly how much network bandwidth is taken by >> replication among other things and what exactly happens when I bring >> up a Mnesia node that went down. There was a discussion of this >> recently but nothing beats a step by step explanation. >> >> Thanks, Joel >> >> >> -- >> http://wagerlabs.com >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions >> >> > > -- View this message in context: http://www.nabble.com/Mnesia-vs-When-Databases-Lie%3A-Consistency-vs-Availability-in-Distributed-Systems-tp14336495p14373894.html Sent from the Erlang Questions mailing list archive at Nabble.com. From rjmh@REDACTED Mon Dec 17 19:52:24 2007 From: rjmh@REDACTED (John Hughes) Date: Mon, 17 Dec 2007 19:52:24 +0100 Subject: [erlang-questions] Jobs in Functional Programming: the dust settles Message-ID: <001c01c840dd$f6d1e500$e475af00$@chalmers.se> The "Jobs in Functional Programming" event at Chalmers is now over-and was a resounding success! So many people preregistered. 111 in total. that I began to worry about the fire regulations for the room we were using! We ran out of chairs, and latecomers were standing around the walls. Six companies sent speakers for the event, and they gave excellent presentations, with many jobs available. All in all, it was a very exciting evening! Photographs and more details can be found at www.jobs-in-fp.org. John Hughes -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Mon Dec 17 20:45:07 2007 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 17 Dec 2007 19:45:07 +0000 Subject: [erlang-questions] Erlide & Eclipse version Message-ID: <95be1d3b0712171145u30564968h4f8200a9996c6386@mail.gmail.com> Hi all, I am asking this question here because I know there are some users that don't subscribe to the erlide-devel list. Does anybody have anything to say against dropping support for Eclipse 3.2 and going for 3.3? best regards, Vlad From kosik@REDACTED Mon Dec 17 22:11:28 2007 From: kosik@REDACTED (Matej Kosik) Date: Mon, 17 Dec 2007 22:11:28 +0100 Subject: [erlang-questions] dict:from_list/1 fragility Message-ID: <4766E600.2040504@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Friends, I think there are two problems with the dict:from_list/1 function. First: it is not trottel-fest (robust against my stupitidity). It lets me call it as follows: E = dict:from_list([{a,b},{c,d}]). Instead of any kind of complain, it vigorously continues and binds E to an invalid dictionary. At the first sight, things seem to be fine. This dict:fetch(a, E). yields b and this dict:fetch(c, E). yields d Hitherto everything seems fine. However, after I update the dictionary: F = dict:update(e, f, E). and try to retrieve newly added element dict:fetch(e, F). I get [f] I have used dictionaries to store PIDs of processes, the dictionary is at the boot-time constructed via dict:from_list/1 constructor and later it I call dict:append/3 function to get the richer dictionary. However, this led to the situation that some values had pid() "type" and others were of [pid()] "type". Do not you think that that the dict:from_list should fail immediatelly if one calls it as I called it: dict:from_list([{a,b},{c,d}]) It should succeed only if the values are lists, such as dict:from_list([{a,[b]}, {c, [d]}]) - ---------------------------------------------------------------------------- Second: do not you think that the documentation should mention this fact? I admit that I may be thinking in wrong (non-Erlang way) but this is how it seems to me. - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHZuYAL+CaXfJI/hgRArxNAJ9oZZ+wt9P1oJW4Gdqm+9B3zMSv9ACffqkP J/aOAH/IzdX7FwxtQps6/TA= =zzkM -----END PGP SIGNATURE----- From vladdu55@REDACTED Mon Dec 17 22:49:02 2007 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 17 Dec 2007 21:49:02 +0000 Subject: [erlang-questions] Fwd: dict:from_list/1 fragility In-Reply-To: <95be1d3b0712171348v22b71dbi2702394a73dd53fc@mail.gmail.com> References: <4766E600.2040504@fiit.stuba.sk> <95be1d3b0712171348v22b71dbi2702394a73dd53fc@mail.gmail.com> Message-ID: <95be1d3b0712171349v1697c45fqa585d9e135342808@mail.gmail.com> forgot to post the answer to the list... ---------- Forwarded message ---------- From: Vlad Dumitrescu Date: Dec 17, 2007 9:48 PM Subject: Re: [erlang-questions] dict:from_list/1 fragility To: Matej Kosik Hi! On Dec 17, 2007 9:11 PM, Matej Kosik wrote: > I think there are two problems with the > dict:from_list/1 > function. > > First: it is not trottel-fest (robust against my stupitidity). It lets me call it as follows: > E = dict:from_list([{a,b},{c,d}]). > Instead of any kind of complain, it vigorously continues and binds E to an invalid dictionary. At > the first sight, things seem to be fine. This > dict:fetch(a, E). > yields > b > and this > dict:fetch(c, E). > yields > d Exactly as expected and documented. Why do you think it should be invalid? The dict contains {Key, Value} tuples, and the Value can be any term. > Hitherto everything seems fine. However, after I update the dictionary: > > F = dict:update(e, f, E). What version of Erlang are you using? The documentation for dict:update/3 states update(Key, Fun, Dict1) -> Dict2 Types: Key = term() Fun = fun(Value1) -> Value2 <----- this isn't an atom, but a fun! Value1 = Value2 = term() Dict1 = Dict2 = dictionary() and calling it in recent versions (R10 and later) gives =ERROR REPORT==== 17-Dec-2007::21:45:53 === Error in process <0.30.0> with exit value: {function_clause,[{dict,update_bkt,[e ,f,[]]},{dict,on_bucket,3},{dict,update,3},{erl_eval,do_apply,5},{erl_eval,expr, 5},{shell,exprs,6},{shell,eval_loop,3}]} ** exited: {function_clause,[{dict,update_bkt,[e,f,[]]}, {dict,on_bucket,3}, {dict,update,3}, {erl_eval,do_apply,5}, {erl_eval,expr,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** So maybe you are doing something wrong? best regards, Vlad From rpettit@REDACTED Mon Dec 17 23:21:17 2007 From: rpettit@REDACTED (Rick Pettit) Date: Mon, 17 Dec 2007 16:21:17 -0600 Subject: [erlang-questions] how: to construct and evaluate qlc expressions dynamically Message-ID: <20071217222117.GA1177@vailsys.com> I am trying to write a function which takes as input a table name and a list of query constraints in the form of triplets (column id, operator, value) which returns a fun wrapping the equivalent qlc expression. For example: QLCFun = generate_qlc_fun("favorites",[{"flavor","==","chocolate"}, {"number","<=","3"}]). QLCFun should be roughly equivalent to: qlc:q([X || X <- mnesia:table(favorites), X#favorites.flavor == "chocolate", X#favorites.number <= 3]). So far I've stumbled across the erl_syntax manpage and functions: list_comp_template/1 list_comp_body/1 list_comp/2 Am I in the ballpark, or is there a better way to do this? Anyone know of a place where a beginner (to dynamic generation and evaluation of erlang code) can find decent sample code? -Rick From rvirding@REDACTED Tue Dec 18 00:07:12 2007 From: rvirding@REDACTED (Robert Virding) Date: Tue, 18 Dec 2007 00:07:12 +0100 Subject: [erlang-questions] : : queues (previously: documentation of data structures) In-Reply-To: <47668EB8.3070408@theheartofgold.org> References: <200712070917.13979.bekesa@sch.bme.hu> <200712111344.25828.bekesa@sch.bme.hu> <475E8E41.5040603@lionet.info> <200712111516.50740.bekesa@sch.bme.hu> <20071212160247.GC11510@erix.ericsson.se> <476308A7.4060001@theheartofgold.org> <3dbc6d1c0712161302v366f31bl8153c1876c224419@mail.gmail.com> <20071217112712.GA31567@erix.ericsson.se> <47668EB8.3070408@theheartofgold.org> Message-ID: <3dbc6d1c0712171507t50ad1904o5665ad2293f5bbdc@mail.gmail.com> On 17/12/2007, Anders Ramsell wrote: > > > Proposed new API (along the lines of Anders Ramsell's suggestion: > > > > Introduce the notion of a first .. last order in the queue. > > Elements normally enters the first end and exits the last end. > > Well, it does look a lot better than what we have today, but it > seems "backwards". I do think you enter a queue at the end. > Actually the only operations on a "queue" I tend to use is > (avoiding API names altogether) these: I agree, the head or front of the queue is where the oldest or next member in line is, and the end or tail is where the most recent or last element. - create a queue > - add element to queue (which is then last in queue) > - remove first element from queue for processing (waited the longest) > - remove element from queue (no longer relevant) I could imagine that you would also like to "peek" at the first element without removing it. The purpose being handling resources in the order they arrive > with the extra constraint that some resources "go away" before > it's their turn. The question is if you add too many functions in the API for doing non-queue like operations to the queue if you have a queue left. You could en up with a more general sequence structure. What have people actually asked for? That said, I'm sure the other operations also could be very useful > in certain circumstances. And even though I beleive that what you > call "delete(Item, Q1) -> Q2" is what I called 'drop' (and I'd > still like that one added very much) I don't think the queue > module should house a wide variety of "list like" funtions. > You could probably need some list like traversing functions as the internal structure is supposed to be hidden. For example drop could be replaced with a more general filter function. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpettit@REDACTED Tue Dec 18 00:28:03 2007 From: rpettit@REDACTED (Rick Pettit) Date: Mon, 17 Dec 2007 17:28:03 -0600 Subject: [erlang-questions] how: to construct and evaluate qlc expressions dynamically In-Reply-To: <20071217222117.GA1177@vailsys.com> References: <20071217222117.GA1177@vailsys.com> Message-ID: <20071217232803.GA18418@vailsys.com> On Mon, Dec 17, 2007 at 04:21:17PM -0600, Rick Pettit wrote: > I am trying to write a function which takes as input a table name and a > list of query constraints in the form of triplets (column id, operator, value) > which returns a fun wrapping the equivalent qlc expression. > > For example: > > QLCFun = generate_qlc_fun("favorites",[{"flavor","==","chocolate"}, > {"number","<=","3"}]). > > QLCFun should be roughly equivalent to: > > qlc:q([X || X <- mnesia:table(favorites), > X#favorites.flavor == "chocolate", > X#favorites.number <= 3]). > > So far I've stumbled across the erl_syntax manpage and functions: > > list_comp_template/1 > list_comp_body/1 > list_comp/2 > > Am I in the ballpark, or is there a better way to do this? > > Anyone know of a place where a beginner (to dynamic generation and evaluation > of erlang code) can find decent sample code? I meant to add that "plan B" is to construct an appropriate mnesia:select/4, but I'm interested in dynamic generation/evaluation of code either way. -Rick From pfisher@REDACTED Tue Dec 18 01:41:30 2007 From: pfisher@REDACTED (Paul Fisher) Date: Mon, 17 Dec 2007 18:41:30 -0600 Subject: [erlang-questions] clarfy: where is -spec(...) syntax documented Message-ID: <1197938490.11729.3.camel@pfisher-laptop> Where is the new "-spec(...)" syntax documented? I've poked around the R12 doc and googled, but turned up nothing. -- paul From kosik@REDACTED Tue Dec 18 06:04:44 2007 From: kosik@REDACTED (Matej Kosik) Date: Tue, 18 Dec 2007 06:04:44 +0100 Subject: [erlang-questions] dict:from_list/1 fragility In-Reply-To: <2F88BCCC-3CC1-4B93-A480-D216BFE33ED8@kscape.com> References: <4766E600.2040504@fiit.stuba.sk> <2F88BCCC-3CC1-4B93-A480-D216BFE33ED8@kscape.com> Message-ID: <476754EC.9010003@fiit.stuba.sk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mike Hales wrote: > From your post it seems like you really want: > > F = dict:store(e,f,E) Yes. This is what I needed. (I just haven't found it. Too many and too flat list of functions...). Thank you. - -- Matej Kosik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHZ1TsL+CaXfJI/hgRAokbAKC6E+g+CBpSb7IR4MvJY1L9XVuglACcC2sC +5/MteC7JCR7VQ7Azoc+uVE= =HP/D -----END PGP SIGNATURE----- From tobias.lindahl@REDACTED Tue Dec 18 09:30:41 2007 From: tobias.lindahl@REDACTED (Tobias Lindahl) Date: Tue, 18 Dec 2007 09:30:41 +0100 Subject: [erlang-questions] clarfy: where is -spec(...) syntax documented In-Reply-To: <1197938490.11729.3.camel@pfisher-laptop> References: <1197938490.11729.3.camel@pfisher-laptop> Message-ID: <47678531.8090908@it.uu.se> Paul Fisher wrote: > Where is the new "-spec(...)" syntax documented? I've poked around the > R12 doc and googled, but turned up nothing. That's because there is no documentation of it ;-) The specs are currently taken into account by Dialyzer, and there is an EEP in the pipe, but we haven't submitted it yet. The spec and type declarations should be considered as unsupported (and undocumented) for now, but if you can't wait until the EEP is submitted, you can have a look around at the various contracts in hipe/kernel/stdlib and you will probably get the idea. Tobias > > > -- > > paul > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From alexis.peter.80@REDACTED Tue Dec 18 10:26:05 2007 From: alexis.peter.80@REDACTED (Alexis Peter) Date: Tue, 18 Dec 2007 14:56:05 +0530 Subject: [erlang-questions] Test! Message-ID: <28083f710712180126x7b7c39a9i302c1726e32a24a6@mail.gmail.com> Test! Alexis. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jerith@REDACTED Tue Dec 18 10:50:58 2007 From: jerith@REDACTED (Jeremy Thurgood) Date: Tue, 18 Dec 2007 11:50:58 +0200 Subject: [erlang-questions] Test! In-Reply-To: <28083f710712180126x7b7c39a9i302c1726e32a24a6@mail.gmail.com> References: <28083f710712180126x7b7c39a9i302c1726e32a24a6@mail.gmail.com> Message-ID: <47679802.9030205@jerith.za.net> Alexis Peter wrote: > Test! 7/10. You pass, congratulations. --J -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3339 bytes Desc: S/MIME Cryptographic Signature URL: From mike.hales@REDACTED Tue Dec 18 00:07:10 2007 From: mike.hales@REDACTED (Mike Hales) Date: Mon, 17 Dec 2007 16:07:10 -0700 Subject: [erlang-questions] dict:from_list/1 fragility In-Reply-To: <4766E600.2040504@fiit.stuba.sk> References: <4766E600.2040504@fiit.stuba.sk> Message-ID: <2F88BCCC-3CC1-4B93-A480-D216BFE33ED8@kscape.com> From your post it seems like you really want: F = dict:store(e,f,E) Mike On Dec 17, 2007, at 2:11 PM, Matej Kosik wrote: > Hitherto everything seems fine. However, after I update the > dictionary: > > F = dict:update(e, f, E). -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Tue Dec 18 11:26:03 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 18 Dec 2007 11:26:03 +0100 Subject: [erlang-questions] : : : queues (previously: documentation of data structures) In-Reply-To: <3dbc6d1c0712171507t50ad1904o5665ad2293f5bbdc@mail.gmail.com> References: <200712070917.13979.bekesa@sch.bme.hu> <200712111344.25828.bekesa@sch.bme.hu> <475E8E41.5040603@lionet.info> <200712111516.50740.bekesa@sch.bme.hu> <20071212160247.GC11510@erix.ericsson.se> <476308A7.4060001@theheartofgold.org> <3dbc6d1c0712161302v366f31bl8153c1876c224419@mail.gmail.com> <20071217112712.GA31567@erix.ericsson.se> <47668EB8.3070408@theheartofgold.org> <3dbc6d1c0712171507t50ad1904o5665ad2293f5bbdc@mail.gmail.com> Message-ID: <20071218102603.GA732@erix.ericsson.se> Perhaps someone should write an EEP, but I think this is a small enough change to do without one. New suggestion: *_first and *_last perhaps did not make things better. Nobody seems to mind the in/2 and out/1 API. We have: new() -> Q len(Q) -> Integer is_empty(Q) -> true | false in(Item, Q1) -> Q2 out(Q1) -> {{value,Item}, Q2} | {empty,Q1} add: get(Q1) -> Item | error(badarg) peek(Q1) -> {value,Item} | empty drop(Q1) -> Q2 % Drop what get/1 and peek/1 would return keep double ended queue API (ugly but easy to remember): in_r/2, out_r/1 add double ended queue API for new functions: get_r/1, peek_r/1, drop_r/1 add new whole-queue operation: filtermap(Fun, Q1) -> Q2 and perhaps: zf(Fun, Q1) -> Q2 % Alias for filtermap /lists joke :-/ filter(Fun, Q1) -> Q2 map(Fun, Q1) -> Q2 or perhaps just add: filter(Fun, Q1) -> Q2 since it is the only one actually asked for. Restructure the man page to put all other functions except to_list/1, from_list/1, split/2, join/2, and reverse/1 in a legacy section after the above recommended. On Tue, Dec 18, 2007 at 12:07:12AM +0100, Robert Virding wrote: > On 17/12/2007, Anders Ramsell wrote: > > > > > Proposed new API (along the lines of Anders Ramsell's suggestion: > > > > > > Introduce the notion of a first .. last order in the queue. > > > Elements normally enters the first end and exits the last end. > > > > Well, it does look a lot better than what we have today, but it > > seems "backwards". I do think you enter a queue at the end. > > Actually the only operations on a "queue" I tend to use is > > (avoiding API names altogether) these: > > > I agree, the head or front of the queue is where the oldest or next member > in line is, and the end or tail is where the most recent or last element. > > - create a queue > > - add element to queue (which is then last in queue) > > - remove first element from queue for processing (waited the longest) > > - remove element from queue (no longer relevant) > > > I could imagine that you would also like to "peek" at the first element > without removing it. > > The purpose being handling resources in the order they arrive > > with the extra constraint that some resources "go away" before > > it's their turn. > > > The question is if you add too many functions in the API for doing non-queue > like operations to the queue if you have a queue left. You could en up with > a more general sequence structure. What have people actually asked for? > > That said, I'm sure the other operations also could be very useful > > in certain circumstances. And even though I beleive that what you > > call "delete(Item, Q1) -> Q2" is what I called 'drop' (and I'd > > still like that one added very much) I don't think the queue > > module should house a wide variety of "list like" funtions. > > > > You could probably need some list like traversing functions as the internal > structure is supposed to be hidden. For example drop could be replaced with > a more general filter function. > > Robert > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From joelr1@REDACTED Tue Dec 18 11:42:35 2007 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 18 Dec 2007 10:42:35 +0000 Subject: [erlang-questions] Using Leex vs rolling your own lexer Message-ID: <7F9DA868-F39F-4FC3-9F82-3668284984AA@gmail.com> No OTP code uses Leex it seems. All apps and libraries roll their own lexer. It's very easy in Erlang to roll your own lexer but any particular reason why Leex is not used more often? Thanks, Joel -- http://wagerlabs.com From mats.cronqvist@REDACTED Tue Dec 18 13:00:24 2007 From: mats.cronqvist@REDACTED (mats cronqvist) Date: Tue, 18 Dec 2007 13:00:24 +0100 Subject: [erlang-questions] Measuring how well ERTS utilizes the CPU by using the scheduler In-Reply-To: <9E73CC3F-D3F0-46E5-9336-BA2AF992BF4D@gmail.com> References: <9E73CC3F-D3F0-46E5-9336-BA2AF992BF4D@gmail.com> Message-ID: <1197979224.28499.69.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> On Fri, 2007-12-14 at 11:23 +0000, Joel Reymont wrote: > How do you accomplish this exactly? > > I understand that you can use the instrumented runtime but what about > the scheduler? the trace BIF? mats From mihai@REDACTED Tue Dec 18 14:08:00 2007 From: mihai@REDACTED (Mihai Balea) Date: Tue, 18 Dec 2007 08:08:00 -0500 Subject: [erlang-questions] Erlide & Eclipse version In-Reply-To: <95be1d3b0712171145u30564968h4f8200a9996c6386@mail.gmail.com> References: <95be1d3b0712171145u30564968h4f8200a9996c6386@mail.gmail.com> Message-ID: <1CB61588-F7C7-404F-A774-C75F4F4C2FC2@hates.ms> On Dec 17, 2007, at 2:45 PM, Vlad Dumitrescu wrote: > > Does anybody have anything to say against dropping support for Eclipse > 3.2 and going for 3.3? Ubuntu 7.10 comes with Eclipse 3.2 by default. Not a big deal, but something to consider... Regards, Mihai -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2411 bytes Desc: not available URL: From joelr1@REDACTED Tue Dec 18 14:56:27 2007 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 18 Dec 2007 13:56:27 +0000 Subject: [erlang-questions] Mnesia: Recovery of fragmented tables Message-ID: <5A01E53E-02F2-48E3-AA77-91E728C5F964@gmail.com> This was asked by Sean Hinde back in '99 but I haven't found the answer yet: -- Does using fragmented tables mean that recovery is done in parallel across the fragments and therefore takes 1/'No of fragments' time to complete? -- Thanks, Joel -- http://wagerlabs.com From joelr1@REDACTED Tue Dec 18 15:12:36 2007 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 18 Dec 2007 14:12:36 +0000 Subject: [erlang-questions] Mnesia internals slides, etc. Message-ID: Does anyone have a copy of the following two files? Old links to Hakan's site are dead. Thanks, Joel -- mnesia_internals_slides.pdf mnesia_consumption.txt -- http://wagerlabs.com From pfisher@REDACTED Tue Dec 18 15:25:53 2007 From: pfisher@REDACTED (Paul Fisher) Date: Tue, 18 Dec 2007 08:25:53 -0600 Subject: [erlang-questions] clarify: SMP disabled by default in OpenSolaris Message-ID: <1197987953.11729.7.camel@pfisher-laptop> Is there a reason that smp support is disabled by default when building R12B-0 on OpenSolaris? I've built it both ways and simple verifications work, but just wondering if there is a good reason for the default. -- paul From vladdu55@REDACTED Tue Dec 18 15:36:00 2007 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 18 Dec 2007 15:36:00 +0100 Subject: [erlang-questions] Erlide & Eclipse version In-Reply-To: <811f2f1c0712180614m54ff950fq8c05d519f754efa7@mail.gmail.com> References: <95be1d3b0712171145u30564968h4f8200a9996c6386@mail.gmail.com> <811f2f1c0712180614m54ff950fq8c05d519f754efa7@mail.gmail.com> Message-ID: <95be1d3b0712180636m49995574n9941adc6a66394e0@mail.gmail.com> On Dec 18, 2007 3:14 PM, Michael Campbell wrote: > This is probably an extreme edge case, but... IBM's suite of eclipse > based tools are currently based on 3.1 (!). The 3.2 versions are > rumored to be out in a few days. > > What about 3.3 is compelling enough to consider this? Well, there is a lot of stuff that is better/faster/prettier in 3.3. There are new APIs that allow hooking into existing functionality instead of having to copy Eclipse code into one's own code tree and hack it - keeping that updated with the latest Eclipse fixes would require at least a person working full time with that. Do you currently run Erlide on 3.1? Does it work? The compromise will have to be made between not shutting out a part of the user base and keeping up with the general Eclipse development. We don't have resources to develop several versions in parallel. A possible solution is to have the basic functionality in 3.2-based plugins and if one runs 3.3 then one can install the "bonus material". We will have to think about this and see how we can best solve it. On a related note, 3.4 is to be out in a few months :-) Thanks everybody for the input! best regards, Vlad From rickard.s.green@REDACTED Tue Dec 18 15:50:47 2007 From: rickard.s.green@REDACTED (Rickard Green) Date: Tue, 18 Dec 2007 15:50:47 +0100 Subject: [erlang-questions] clarify: SMP disabled by default in OpenSolaris In-Reply-To: <1197987953.11729.7.camel@pfisher-laptop> References: <1197987953.11729.7.camel@pfisher-laptop> Message-ID: <4767DE47.30708@ericsson.com> SMP support is only enabled by default if we have automated tests running on that specific platform. BR, Rickard Green, Erlang/OTP, Ericsson AB. Paul Fisher wrote: > Is there a reason that smp support is disabled by default when building > R12B-0 on OpenSolaris? I've built it both ways and simple verifications > work, but just wondering if there is a good reason for the default. > > > -- > > paul > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From vychodil.hynek@REDACTED Tue Dec 18 16:13:34 2007 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 18 Dec 2007 16:13:34 +0100 Subject: [erlang-questions] : : queues (previously: documentation of data structures) In-Reply-To: <20071217112712.GA31567@erix.ericsson.se> References: <200712070917.13979.bekesa@sch.bme.hu> <200712111344.25828.bekesa@sch.bme.hu> <475E8E41.5040603@lionet.info> <200712111516.50740.bekesa@sch.bme.hu> <20071212160247.GC11510@erix.ericsson.se> <476308A7.4060001@theheartofgold.org> <3dbc6d1c0712161302v366f31bl8153c1876c224419@mail.gmail.com> <20071217112712.GA31567@erix.ericsson.se> Message-ID: <4d08db370712180713q7a161121i29ca589491dac0c4@mail.gmail.com> I propose use stack like perl terminology: pop x push unshift x shift unshift -> Q -> pop shift <- Q <- push On 12/17/07, Raimo Niskanen wrote: > If changing the names of daeh, in_r, lait, snoc, init, out_r, head, tail > and cons, why not change them all? > > Proposed new API (along the lines of Anders Ramsell's suggestion: > > Introduce the notion of a first .. last order in the queue. > Elements normally enters the first end and exits the last end. > > Regular (forward) direction: > > put(Item, Q1) -> Q2 > put_first(Item, Q1) -> Q2 > get(Q) -> Item > get_last(Q) -> Item > drop(Q1) -> Q2 > drop_last(Q1) -> Q2 > > So put/2 is an alias for put_first/2, > get/1 is an alias for get_last/1 > and drop/1 is an alias for drop_last/1. > > Goofy (backward) direction: > > put_last(Item, Q1) -> Q2 > get_first(Q) -> Item > drop_first(Q1) -> Q2 > > Inspection: > > is_empty(Q) -> Bool > len(Q) -> Length > > Creation and conversion: > > new() -> Q > from_list(List) -> Q > to_list(Q) -> List > > Operations: > > join(Q1, Q2) -> Q3 > split(N, Q1) -> {Q2, Q3} > > Questionables (so list-like there will be no end to it...): > > delete(Item, Q1) -> Q2 > should it be > delete(fun/1, Q1) -> Q2 > or > zf(fun/1, Q1) -> Q2 > aka > filtermap(fun/1, Q1) -> Q2 > or maybe > search(fun/1, Q) -> {Position,Item} | false > delete(Position, Q1) -> Q2 > where search/2 could be replaced with > fold(fun/2, Q, Start) -> Term > > I also aim to add new(Q1) -> Q2 that converts to a new queue format > containing length so on a converteed queue len/1 is O(1), but > once you have called new/1 you can not code downgrade or send nor > save a queue term to be understood by an older node. > > One can also consider to rename the whole module to deq, but that name > should perhaps be reserved for a large and complicated all operations > O(1) double ended queue according to Kaplan/Tarjan... > > > > On Sun, Dec 16, 2007 at 10:02:56PM +0100, Robert Virding wrote: > > I quite agree! First it should be liat, if it is supposed to be the reverse > > of tail. > > > > Then I also agree even more that the whole naming of the functions in the > > queue module sucks. It was probably originally taken from Okasaki who uses a > > subset of it in a chapter of his book. I personally think it can only be > > considered as a form of "in joke" which is really only comprehensible to > > people who know the terminology and as such is not suitable for a general > > library. > > > > I find it easier and faster to rewrite the code than try and remember the > > functions names if I need a queue. The algorithm is basically quite simple > > and neat. > > > > Rewrite the module with good names for the API and make sure to drop the old > > names from the documentation to make sure they don't spread, though they > > will have to be kept for BC. Get out a new version ASAP. > > > > Robert > > > > P.S. Yes I know I occasionally include small jokes there are limits to what > > you can do. > > > > On 14/12/2007, Anders Ramsell wrote: > > > > > > > > Anyways, queue:lait/1 should be liat/1 shouldn't it? Both in > > > > > the doc and impl. (It is the opposite of tail. The opposite of > > > > > cons/2 is snoc/2, the opposite of head/1 is daeh/1 but > > > > > lists:reverse("tail") /= "lait"). > > > > > > > > Oh yes!!! I was tired when I wrote it, then self-blind, and > > > > nobody proofread. If I get a reason to touch the module I will > > > > add liat/1, forget about lait/1 but keep it around for backwards > > > > compatibility... > > > > > > (I'm going to stick my neck out now. Hope I don't get beheaded.) > > > > > > I think the API of the queue module is a mess. Full of weird > > > names and functions that do the same thing. Quite unlike most > > > other modules in stdlib. This is a pity because this module is > > > very useful. Or at least it could be - I'll get back to that. > > > > > > If you're going to change it - change it a lot. My suggestion > > > would be something along these lines. First remove a few > > > functions. > > > > > > Function: Duplicate of: > > > ------------------------ > > > daeh last > > > in_r cons > > > lait init > > > snoc in > > > > > > But we still have some weird names left. How do you 'init' a > > > queue by removing something from it? And out_r isn't all that > > > beautiful either. Then we have 'head' as the opposite of 'last'. > > > > > > I would rename those and a few more to get something that I think > > > look like a "consistent" naming. > > > > > > Function: Rename to: > > > --------------------- > > > init drop_last > > > out_r out_last > > > head first > > > tail drop_first > > > cons in_first > > > > > > Of course all the old names would have to remain for a few > > > versions for backwards compatibility reasons. > > > > > > > > > Now back to what I hinted at before. The names of the API are > > > important but what they do is of course much more important and > > > the API is quite complete. But one, in my opinion, very important > > > function is missing. This fact has kept me from using this module > > > and roll my own on more than one occasion. There is no function > > > that removes a specified item no matter where in the queue it is. > > > Sometimes you just get tired of queueing. > > > > > > No matter what you think of the rest of this mail please add that > > > function. Keeping to my own suggested names it could be called > > > 'drop'. I know it can't be O(1) but that doesn't matter. > > > > > > Well? Will I know get pummeled into my shoes like the noob I am > > > or do I have a point? > > You sure do have point. > > > > > > > > > /Anders > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil From michael.campbell@REDACTED Tue Dec 18 15:14:59 2007 From: michael.campbell@REDACTED (Michael Campbell) Date: Tue, 18 Dec 2007 09:14:59 -0500 Subject: [erlang-questions] Erlide & Eclipse version In-Reply-To: <95be1d3b0712171145u30564968h4f8200a9996c6386@mail.gmail.com> References: <95be1d3b0712171145u30564968h4f8200a9996c6386@mail.gmail.com> Message-ID: <811f2f1c0712180614m54ff950fq8c05d519f754efa7@mail.gmail.com> On Dec 17, 2007 2:45 PM, Vlad Dumitrescu wrote: > Hi all, > > I am asking this question here because I know there are some users > that don't subscribe to the erlide-devel list. > > Does anybody have anything to say against dropping support for Eclipse > 3.2 and going for 3.3? This is probably an extreme edge case, but... IBM's suite of eclipse based tools are currently based on 3.1 (!). The 3.2 versions are rumored to be out in a few days. What about 3.3 is compelling enough to consider this? From hasan.veldstra@REDACTED Tue Dec 18 18:11:40 2007 From: hasan.veldstra@REDACTED (Hasan Veldstra) Date: Tue, 18 Dec 2007 17:11:40 +0000 Subject: [erlang-questions] Using Leex vs rolling your own lexer In-Reply-To: <7F9DA868-F39F-4FC3-9F82-3668284984AA@gmail.com> References: <7F9DA868-F39F-4FC3-9F82-3668284984AA@gmail.com> Message-ID: > No OTP code uses Leex it seems. All apps and libraries roll their own > lexer. > > It's very easy in Erlang to roll your own lexer but any particular > reason why Leex is not used more often? Perhaps because it's old and unsupported by anyone? (It doesn't even have a homepage.) That coupled with the ease of writing a lexer is probably the reason. I've used Leex quite a lot though, and it works fine. There are a few minor annoyances, but no show-stoppers. (I might even get round to fixing them at some point...) From psa@REDACTED Tue Dec 18 18:42:57 2007 From: psa@REDACTED (=?ISO-8859-1?Q?Paulo_S=E9rgio_Almeida?=) Date: Tue, 18 Dec 2007 17:42:57 +0000 Subject: [erlang-questions] Mnesia internals slides, etc. In-Reply-To: References: Message-ID: <476806A1.5090005@di.uminho.pt> Joel Reymont wrote: > Does anyone have a copy of the following two files? I happen to have a copy of mnesia_internals_slides.pdf (with 13th October 1999 as date). I will mail it to you now. If anyone else is interested ... shall I post it here? (Is it reasonable to attach 169K bytes to send to the whole list?) Regards, psa From paul-trapexit@REDACTED Tue Dec 18 19:29:06 2007 From: paul-trapexit@REDACTED (Paul Mineiro) Date: Tue, 18 Dec 2007 10:29:06 -0800 (PST) Subject: [erlang-questions] clarify: mnesia dets caching Message-ID: is the only caching of dets tables the OS page cache? is it possible that putting an lru cache in front of a dets table could improve read performance? -- p Optimism is an essential ingredient of innovation. How else can the individual favor change over security? -- Robert Noyce From srp@REDACTED Tue Dec 18 19:28:38 2007 From: srp@REDACTED (Scott R Parish) Date: Tue, 18 Dec 2007 12:28:38 -0600 (CST) Subject: [erlang-questions] gen_tcp not correctly handling half duplex (shutdown) sockets? Message-ID: <1198002518.v1.fusewebmail-240137@f> Its not clear to me if i'm doing something wrong, or if gen_tcp isn't correctly handling half duplex sockets. As a refresher, half duplex sockets are created when shutdown(2) is called on a socket to close one direction: http://www.softlab.ntua.gr/facilities/documentation/unix/unix-socket-faq/unix-socket-faq-2.html#ss2.6 My erlang code is acting as follows: maple% erl Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) 1> Opts = [binary, {packet, raw}, {active, false}]. [binary,{packet,raw},{active,false}] 2> {ok, LS} = gen_tcp:listen(6000, Opts). {ok,#Port<0.70>} 3> {ok, S1} = gen_tcp:connect("localhost", 6000, Opts). {ok,#Port<0.72>} 4> {ok, S2} = gen_tcp:accept(LS). {ok,#Port<0.73>} 5> ok = gen_tcp:shutdown(S1, write). ok 6> gen_tcp:recv(S2, 0). {error,closed} 7> gen_tcp:recv(S2, 0). {error,ebadf} 8> gen_tcp:recv(S2, 0). {error,ebadf} After "6>", sending also refuses to work: ... 7> gen_tcp:send(S2, <<"blah">>). {error,ebadf} Its like erlang is thinking that the whole socket got closed, instead of just one direction, and close()ed it. For comparison, some c code i wrote works as i'd expect: <<>> #include #include #include #include int main(int argc, char **argv) { int s[2]; int r; if (0 != socketpair(AF_UNIX, SOCK_STREAM, 0, s)) { fprintf(stderr, "socketpair error: %s\n", strerror(errno)); return 1; } if (0 != shutdown(s[0], SHUT_WR)) { fprintf(stderr, "shutdown: %s\n", strerror(errno)); return 2; } char buf[1024]; r = recv(s[1], buf, 1024, 0); fprintf(stderr, "recv 1 => %d\n", r); if (0 > r) { fprintf(stderr, "recv 1: %s\n", strerror(errno)); return 3; } r = recv(s[1], buf, 1024, 0); fprintf(stderr, "recv 1 => %d\n", r); if (0 > r) { fprintf(stderr, "recv 1: %s\n", strerror(errno)); return 3; } if (5 != send(s[1], "blah", 5, 0)) { fprintf(stderr, "send: %s\n", strerror(errno)); return 2; } r = recv(s[0], buf, 1024, 0); fprintf(stderr, "recv 2 => %d\n", r); if (0 > r) { fprintf(stderr, "recv 2: %s\n", strerror(errno)); return 3; } printf("got: %s\n", buf); return 0; } <<>> maple% make s cc s.c -o s maple% ./s; echo $? recv 1 => 0 recv 1 => 0 recv 2 => 5 got: blah 0 Thanks for any help! sRp From srp@REDACTED Tue Dec 18 19:49:05 2007 From: srp@REDACTED (Scott R Parish) Date: Tue, 18 Dec 2007 12:49:05 -0600 (CST) Subject: [erlang-questions] gen_tcp not correctly handling half duplex (shutdown) sockets? In-Reply-To: <1198002521.v1.fusewebmail-240137@f> References: <1198002521.v1.fusewebmail-240137@f> Message-ID: <1198003745.v1.fusewebmail-240137@f> ----- Original Message ----- > Its not clear to me if i'm doing something wrong, or if gen_tcp isn't > correctly handling half duplex sockets. ... > Its like erlang is thinking that the whole socket got closed, instead of > just one direction, and close()ed it. I think this might be the problem. In R11-B5's inet_drv.c line 8499: else if (n == 0) { DEBUGF((" => detected close\r\n")); return tcp_recv_closed(desc); } tcp_recv_closed()'s is described as: /* The socket has closed, cleanup and send event */ This isn't completely correct as the socket isn't necessarily close()d, just shutdown() in a single direction. sRp From rpettit@REDACTED Wed Dec 19 00:55:01 2007 From: rpettit@REDACTED (Rick Pettit) Date: Tue, 18 Dec 2007 17:55:01 -0600 Subject: [erlang-questions] Mnesia internals slides, etc. In-Reply-To: <476806A1.5090005@di.uminho.pt> References: <476806A1.5090005@di.uminho.pt> Message-ID: <20071218235501.GA13988@vailsys.com> On Tue, Dec 18, 2007 at 05:42:57PM +0000, Paulo S?rgio Almeida wrote: > Joel Reymont wrote: > > Does anyone have a copy of the following two files? > > I happen to have a copy of mnesia_internals_slides.pdf (with 13th > October 1999 as date). > > I will mail it to you now. If anyone else is interested ... shall I post > it here? (Is it reasonable to attach 169K bytes to send to the whole list?) Would you mind sending me a copy, too? :-) Thanks, -Rick From rvirding@REDACTED Wed Dec 19 02:29:00 2007 From: rvirding@REDACTED (Robert Virding) Date: Wed, 19 Dec 2007 02:29:00 +0100 Subject: [erlang-questions] Using Leex vs rolling your own lexer In-Reply-To: References: <7F9DA868-F39F-4FC3-9F82-3668284984AA@gmail.com> Message-ID: <3dbc6d1c0712181729y51fae289m64b5fd40206df002@mail.gmail.com> On 18/12/2007, Hasan Veldstra wrote: > > > > No OTP code uses Leex it seems. All apps and libraries roll their own > > lexer. > > > > It's very easy in Erlang to roll your own lexer but any particular > > reason why Leex is not used more often? Two reasons to use leex: 1. If your tokens can be described by regular expressions then reading a leex file is much clearer and easier than writing code. 2. The resultant scanner is re-entrant which fits i/o. This is not that difficult to do by yourself but why bother. The leex generated scanner is relatively efficient but you can do better yourself. Perhaps because it's old and unsupported by anyone? (It doesn't even > have a homepage.) That coupled with the ease of writing a lexer is > probably the reason. This is the main reason not to use leex. I've used Leex quite a lot though, and it works fine. There are a few > minor annoyances, but no show-stoppers. (I might even get round to > fixing them at some point...) Thank you, I wrote it. :-) There is a version on trapexit that doesn't have a manual but at least an example file. :-) Which is almost the erlang token syntax. It needs a bit of a cleanup and perhaps reworking the input file format. There is a bug which sometimes occurs. It could quite easily be modified to work directly on binaries. One of these days I will get around to it. Now I am fixing a lisp based syntax for Erlang. Perhaps not useful but fun. And easy to make a macro preprocessor for. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From patrickerj@REDACTED Wed Dec 19 06:20:13 2007 From: patrickerj@REDACTED (PatrickErj) Date: Tue, 18 Dec 2007 21:20:13 -0800 (PST) Subject: [erlang-questions] Mnesia internals slides, etc. In-Reply-To: <476806A1.5090005@di.uminho.pt> References: <476806A1.5090005@di.uminho.pt> Message-ID: <14411419.post@talk.nabble.com> Here too!!! :) Paulo S?rgio Almeida wrote: > > Joel Reymont wrote: >> Does anyone have a copy of the following two files? > > I happen to have a copy of mnesia_internals_slides.pdf (with 13th > October 1999 as date). > > I will mail it to you now. If anyone else is interested ... shall I post > it here? (Is it reasonable to attach 169K bytes to send to the whole > list?) > > Regards, > psa > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > -- View this message in context: http://www.nabble.com/Mnesia-internals-slides%2C-etc.-tp14397994p14411419.html Sent from the Erlang Questions mailing list archive at Nabble.com. From bengt.kleberg@REDACTED Wed Dec 19 08:23:42 2007 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 19 Dec 2007 08:23:42 +0100 Subject: [erlang-questions] Was there any Erlang in the heated benchmark discussion? Message-ID: <4768C6FE.3050009@ericsson.com> Some people where unfortunate enough to read the heated discussion part of the harsh benchmark criticism thread (even though I wrote "do not read this"). Those who read it anyway might wonder if there was any Erlang connection. Short answer: Yes, indirectly. Long answer: Yes, because some shootout tests would not allow Erlangs good sides to be seen, thanks to an artificial cap on the input. To show how Erlang might benefit from the idea to increase the limit individually for each language let us create a test: The benchmark test T consists of counting items. The number of items to count is given as an argument N. We have 0.1 second granularity in the timing. After 2 minutes we assume that the test is hanging and kill it. We have two languages, M(ainstream) and O(dd). M takes 0 seconds to start and counts 1 item in 1 millisecond. Language O takes 1 second to start and counts 1 item in 1 millisecond. M can count 1024 items before crashing. O can count 1,048,576. If we choose to use a limited set of N we get the following: 10 100 1000 M 0.0 0.1 1.0 O 1.0 1.1 2.0 In the shootout it is not permitted to increase the fixed limit to something that M can not handle. If we stop using a fixed set of values, and instead let N increase until exhaustion/crash and then stop (as per my suggestion) we get: 10 100 1000 10000 100000 1000000 M 0.0 0.1 1.0 crashed O 1.0 1.1 2.0 11 101 killed The shootout can still use the result from 1000 in the comparison table, but in the graphs we get better information about M and O. This might sound like a silly test. However, there was a create process test in the shootout. Some mainstream languages could only handle less than ten thousand processes. Erlang could do better, but N was limited to give the mainstream languages a chance to do the test for all values. This is why I want to allow N to increase until exhaustion for each language in the shootout, instead of capping N with the same value for all languages in each test. The method will also make it possible to avoid the current shootout problem with several languages being very close at about 1 second because the maximum N is set by a language that takes a long time for that test. Do I think that this will stop all attempts to help languages like M to look better in some test? No. Consider the possibility to change T to count 1 item N times instead. Or change T to first increment 1 item, then decrement 1 item for each N. These kind of helpful designs where present in the shootout to help mainstream languages. When it makes sense to limit things, it is ok (ex: read a file in chunks). bengt -- Those were the days... EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From raimo+erlang-questions@REDACTED Wed Dec 19 10:22:23 2007 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 19 Dec 2007 10:22:23 +0100 Subject: [erlang-questions] : gen_tcp not correctly handling half duplex (shutdown) sockets? In-Reply-To: <1198003745.v1.fusewebmail-240137@f> References: <1198002521.v1.fusewebmail-240137@f> <1198003745.v1.fusewebmail-240137@f> Message-ID: <20071219092223.GB2867@erix.ericsson.se> We will look into this after the holidays... Thank you for the bug report! (at least it appears to be a bug) On Tue, Dec 18, 2007 at 12:49:05PM -0600, Scott R Parish wrote: > > ----- Original Message ----- > > Its not clear to me if i'm doing something wrong, or if gen_tcp isn't > > correctly handling half duplex sockets. > > ... > > > Its like erlang is thinking that the whole socket got closed, instead of > > just one direction, and close()ed it. > > I think this might be the problem. In R11-B5's inet_drv.c line 8499: > > else if (n == 0) { > DEBUGF((" => detected close\r\n")); > return tcp_recv_closed(desc); > } > > tcp_recv_closed()'s is described as: > > /* The socket has closed, cleanup and send event */ > > This isn't completely correct as the socket isn't necessarily close()d, > just shutdown() in a single direction. > > sRp > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From hakan@REDACTED Wed Dec 19 13:05:31 2007 From: hakan@REDACTED (Hakan Mattsson) Date: Wed, 19 Dec 2007 13:05:31 +0100 (CET) Subject: [erlang-questions] Mnesia internals slides, etc. In-Reply-To: References: Message-ID: On Tue, 18 Dec 2007, Joel Reymont wrote: JR> Does anyone have a copy of the following two files? JR> JR> Old links to Hakan's site are dead. JR> JR> Thanks, Joel JR> JR> -- JR> mnesia_internals_slides.pdf JR> mnesia_consumption.txt Now are the old files back at http://www.erlang.org/~hakan /H?kan From joelr1@REDACTED Wed Dec 19 13:21:27 2007 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 19 Dec 2007 12:21:27 +0000 Subject: [erlang-questions] 2002 calling Message-ID: <19787CF2-A3BF-48F5-8928-79642BF4516C@gmail.com> I have been going through the archives of this list since inception to collect material for my book. Although doing this is highly time consuming, I highly recommend you do it if you are a beginner. You may find gems like this: http://www.erlang.org/pipermail/erlang-questions/2002-December/006419.html There's also tons of stuff on Mnesia, benchmarking, optimization and god knows what else since I have only advanced to the end of 2002 :-). Cheers, Joel -- http://wagerlabs.com From olopierpa@REDACTED Wed Dec 19 13:45:50 2007 From: olopierpa@REDACTED (Pierpaolo Bernardi) Date: Wed, 19 Dec 2007 13:45:50 +0100 Subject: [erlang-questions] 2002 calling In-Reply-To: <19787CF2-A3BF-48F5-8928-79642BF4516C@gmail.com> References: <19787CF2-A3BF-48F5-8928-79642BF4516C@gmail.com> Message-ID: <7352e43a0712190445i292b7da3jaf1fd75715e893d1@mail.gmail.com> On Dec 19, 2007 1:21 PM, Joel Reymont wrote: > I have been going through the archives of this list since inception to > collect material for my book. Although doing this is highly time > consuming, I highly recommend you do it if you are a beginner. You may > find gems like this: > > http://www.erlang.org/pipermail/erlang-questions/2002-December/006419.html In case someone missed the announcement in 2004, the book Communicating Sequential Processes mentioned in that message is now available in pdf free of charge. See: http://www.usingcsp.com/ Cheers P. From joelr1@REDACTED Wed Dec 19 13:58:11 2007 From: joelr1@REDACTED (Joel Reymont) Date: Wed, 19 Dec 2007 12:58:11 +0000 Subject: [erlang-questions] 2002 calling In-Reply-To: <7352e43a0712190445i292b7da3jaf1fd75715e893d1@mail.gmail.com> References: <19787CF2-A3BF-48F5-8928-79642BF4516C@gmail.com> <7352e43a0712190445i292b7da3jaf1fd75715e893d1@mail.gmail.com> Message-ID: On Dec 19, 2007, at 12:45 PM, Pierpaolo Bernardi wrote: > In case someone missed the announcement in 2004, the book > Communicating Sequential Processes mentioned in that message > is now available in pdf free of charge. Also, I don't think I was very clear in my last message. The gem is not the book announcement so much as the thread that discusses the message routing paradigms. There are many-many other fun threads like in the archives and I'm having a blast collecting them. Thanks, Joel -- http://wagerlabs.com From hayden@REDACTED Wed Dec 19 16:15:40 2007 From: hayden@REDACTED (Chris Hayden) Date: Wed, 19 Dec 2007 10:15:40 -0500 Subject: [erlang-questions] Projects using Runtime Code Update Message-ID: <8aaad1810712190715q392d9f7ex29b522e84f6b848@mail.gmail.com> I'd like to experiment with using Erlang's runtime code update features using existing medium/large software projects. Can anyone point me towards projects implemented in Erlang for which there are a series of code updates available? Thank you, Chris From kenneth.lundin@REDACTED Wed Dec 19 16:34:03 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Wed, 19 Dec 2007 16:34:03 +0100 Subject: [erlang-questions] How to track down R12B stability problems under Windows? In-Reply-To: References: Message-ID: Hi, We have identified the cause of your problem. There is a bug (on all platforms) which comes to effect during the following circumstances: You have an Erlang module containing calls to the new guard-BIF's byte_size/1 or bit_size/1. You perform tracing on that module (eprof uses tracing) You reload that module (the c/1 function usually used to compile from the shell also performs a load of the module if it compiled successfully and it is during that load you get the crash. We found the bug ourselves before you reported your problems and the bug is corrected in the latest snapshots available. We are also planning to make snapshots of the prebuilt binary Windows installation (including debug symbols). (Will happen real soon, within weeks) /Kenneth Erlang/OTP team , Ericsson AB On 12/14/07, James Hague wrote: > These days I'm mostly using Erlang on my trusty Mac Book, but I still > use it now and again under Windows. > > Last night I installed R12B on my Windows XP SP2 machine at home. I > recompiled the modules I was interested in and tested some image > decoding code I wrote a few years ago. It more or less went like > this: > > compile a module > run some tests > compile the same module > CRASH: Visual C++ runtime library error > restart werl > run some tests > compile the same module > CRASH: Visual C++ runtime library error > > The crash was always during a compile, but not every time. How can I > track this down? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From tblachowicz@REDACTED Wed Dec 19 19:14:17 2007 From: tblachowicz@REDACTED (Tomasz Blachowicz) Date: Wed, 19 Dec 2007 18:14:17 +0000 Subject: [erlang-questions] Regular Expressions in Erlang Message-ID: Hi, I've a couple of questions about regular expressions in Erlang: * Is it possible to capture groups? When I use a pattern "foo(bar)" against string "foobar" I expect to be able to access substring "bar" captured in grouping brackets. * Why "curly bracket" quantifiers can't be used? I mean, usually pattern "fo{2}bar" matches "foobar", but not in Erlang, because regexp module doesn't handle this syntax. Am I right? * Is it possible to specify some parts of a pattern no to be greedy? Most quantifiers are greedy e.g. *, so it there any way to turn off the greediness in some cases? If there are any other decent implementations of regexp available please let me know. Basically, my requirement is to match some strings and extract bits from these. Let's say I have string: \"[DIR]\" c3p0-oracle-thin-extras/ 04-Jan-2007 13:19 - [TXT] maven-metadata.xml.sha1 09-Jul-2006 08:39 132 and I want to extract "DIR" or "TXT", href value and possible a date and size at the end of each string. In other languages I used to do it using regexp, but now I have to implement my logic in Erlang and I don't know exactly how to accomplish this task. Any help would be highly appreciated, Kind Regards, Tomasz -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew@REDACTED Wed Dec 19 19:31:02 2007 From: matthew@REDACTED (Matthew Dempsky) Date: Wed, 19 Dec 2007 10:31:02 -0800 Subject: [erlang-questions] Erlang SIGWINCH bugfix bounty Message-ID: Okay, this has been driving me nuts for the past three months: Open a terminal at 80 columns. Start erl. Resize the terminal to 120 columns. Type a 100 character atom and then a period. Press enter, then up, then down. The 2> prompt has now moved to partially overwrite the interpreter's output for evaluating the first line. I have this problem in OS X's Terminal.app as well as xterm (running under X11.app), though how the output gets clobbered differs slightly. Maybe I'll dig into this, but in the mean time, this has been causing me a bunch of frustration, so I'm offering a bounty of $100 to whoever submits a fix that resolves the problem for me and gets it merged. Thanks. From rpettit@REDACTED Wed Dec 19 21:52:35 2007 From: rpettit@REDACTED (Rick Pettit) Date: Wed, 19 Dec 2007 14:52:35 -0600 Subject: [erlang-questions] Mnesia internals slides, etc. In-Reply-To: References: Message-ID: <20071219205235.GE13988@vailsys.com> On Wed, Dec 19, 2007 at 01:05:31PM +0100, Hakan Mattsson wrote: > On Tue, 18 Dec 2007, Joel Reymont wrote: > > JR> Does anyone have a copy of the following two files? > JR> > JR> Old links to Hakan's site are dead. > JR> > JR> Thanks, Joel > JR> > JR> -- > JR> mnesia_internals_slides.pdf > JR> mnesia_consumption.txt > > Now are the old files back at http://www.erlang.org/~hakan Good deal. Thank you, -Ricik From david_holz@REDACTED Thu Dec 20 00:02:17 2007 From: david_holz@REDACTED (David Holz) Date: Wed, 19 Dec 2007 23:02:17 +0000 Subject: [erlang-questions] Regular Expressions in Erlang In-Reply-To: References: Message-ID: From: tblachowicz@REDACTED > In other languages I used to do it using regexp, but now I have to implement my logic in Erlang and > I don't know exactly how to accomplish this task. It's more heavyweight, but what about using an XML (or HTML if there is one) parser for that chunk of the data and nabbing the attribute field? _________________________________________________________________ Share life as it happens with the new Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_122007 From david_holz@REDACTED Wed Dec 19 23:54:03 2007 From: david_holz@REDACTED (David Holz) Date: Wed, 19 Dec 2007 22:54:03 +0000 Subject: [erlang-questions] 2002 calling In-Reply-To: References: <19787CF2-A3BF-48F5-8928-79642BF4516C@gmail.com> <7352e43a0712190445i292b7da3jaf1fd75715e893d1@mail.gmail.com> Message-ID: From: joelr1@REDACTED > Also, I don't think I was very clear in my last message. The gem is > not the book announcement so much as the thread that discusses the > message routing paradigms. > > There are many-many other fun threads like in the archives and I'm > having a blast collecting them. How about making a "best of erlang-questions" page with a collection of links to the archive? That shouldn't take more than a few minutes and would be a great resource to everybody. _________________________________________________________________ Get the power of Windows + Web with the new Windows Live. http://www.windowslive.com?ocid=TXT_TAGHM_Wave2_powerofwindows_122007 From psa@REDACTED Thu Dec 20 01:08:23 2007 From: psa@REDACTED (=?ISO-8859-1?Q?Paulo_S=E9rgio_Almeida?=) Date: Thu, 20 Dec 2007 00:08:23 +0000 Subject: [erlang-questions] gen_tcp not correctly handling half duplex(shutdown) sockets? In-Reply-To: <1198002518.v1.fusewebmail-240137@f> References: <1198002518.v1.fusewebmail-240137@f> Message-ID: <4769B277.9000200@di.uminho.pt> Hi, to be able to keep sending after the other side has made a half-close you need to pass {exit_on_close, false} while creating the listening socket. I include an example that works (at least with "active" sockets). This "adder" server keeps adding numbers received until the client half-closes the connection, and then replies with the sum of all numbers received so far. Regards, psa P.S. In case someone has spare time to comment ... does my code use binaries efficiently assuming R12B? Scott R Parish wrote: > Its not clear to me if i'm doing something wrong, or if gen_tcp isn't > correctly handling half duplex sockets. As a refresher, half duplex > sockets are created when shutdown(2) is called on a socket to close one > direction: > > http://www.softlab.ntua.gr/facilities/documentation/unix/unix-socket-faq/unix-socket-faq-2.html#ss2.6 > > My erlang code is acting as follows: > > maple% erl > Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [hipe] > [kernel-poll:false] > > Eshell V5.5.5 (abort with ^G) > 1> Opts = [binary, {packet, raw}, {active, false}]. > [binary,{packet,raw},{active,false}] > 2> {ok, LS} = gen_tcp:listen(6000, Opts). -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: adder.erl URL: From jeffm@REDACTED Thu Dec 20 01:10:23 2007 From: jeffm@REDACTED (jm) Date: Thu, 20 Dec 2007 11:10:23 +1100 Subject: [erlang-questions] 2002 calling In-Reply-To: References: <19787CF2-A3BF-48F5-8928-79642BF4516C@gmail.com> <7352e43a0712190445i292b7da3jaf1fd75715e893d1@mail.gmail.com> Message-ID: <4769B2EF.9090705@ghostgun.com> David Holz wrote: > From: joelr1@REDACTED >> Also, I don't think I was very clear in my last message. The gem is >> not the book announcement so much as the thread that discusses the >> message routing paradigms. >> >> There are many-many other fun threads like in the archives and I'm >> having a blast collecting them. > > How about making a "best of erlang-questions" page with a collection of links to the archive? That shouldn't take more than a few minutes and would be a great resource to everybody. As, I imagine, Joel is tracking this anyway can someone suggest a wiki page he (or anyone else) could use to place a list of threads that are interesting. A best of erlang-questions? A simple list of URL and one line description of what was discussed would be enough. I'm guessing somewhere on trapexit. Jeff. From joelr1@REDACTED Thu Dec 20 01:42:16 2007 From: joelr1@REDACTED (Joel Reymont) Date: Thu, 20 Dec 2007 00:42:16 +0000 Subject: [erlang-questions] 2002 calling In-Reply-To: <4769B2EF.9090705@ghostgun.com> References: <19787CF2-A3BF-48F5-8928-79642BF4516C@gmail.com> <7352e43a0712190445i292b7da3jaf1fd75715e893d1@mail.gmail.com> <4769B2EF.9090705@ghostgun.com> Message-ID: <46FCD6C0-EA37-4CD6-ADE5-D8052F6C1BB7@gmail.com> On Dec 20, 2007, at 12:10 AM, jm wrote: > As, I imagine, Joel is tracking this anyway can someone suggest a wiki > page he (or anyone else) could use to place a list of threads that are > interesting. A best of erlang-questions? I'll reward myself for several full-time days spent on this by posting the links at wagerlabs.com once I'm done. I have started on 2004 already so I should be done next week. Joel -- http://wagerlabs.com From srp@REDACTED Thu Dec 20 06:41:50 2007 From: srp@REDACTED (Scott Parish) Date: Wed, 19 Dec 2007 21:41:50 -0800 Subject: [erlang-questions] gen_tcp not correctly handling half duplex(shutdown) sockets? In-Reply-To: <4769B277.9000200@di.uminho.pt> References: <1198002518.v1.fusewebmail-240137@f> <4769B277.9000200@di.uminho.pt> Message-ID: Nice! Thanks for the info; apologies for not reading the documentation carefully enough sRp On Dec 19, 2007, at 4:08 PM, Paulo S?rgio Almeida wrote: > Hi, > > to be able to keep sending after the other side has made a half- > close you need to pass {exit_on_close, false} while creating the > listening socket. > > I include an example that works (at least with "active" sockets). > This "adder" server keeps adding numbers received until the client > half-closes the connection, and then replies with the sum of all > numbers received so far. > > Regards, > psa > > P.S. In case someone has spare time to comment ... does my code use > binaries efficiently assuming R12B? > > Scott R Parish wrote: >> Its not clear to me if i'm doing something wrong, or if gen_tcp isn't >> correctly handling half duplex sockets. As a refresher, half duplex >> sockets are created when shutdown(2) is called on a socket to >> close one >> direction: >> http://www.softlab.ntua.gr/facilities/documentation/unix/unix- >> socket-faq/unix-socket-faq-2.html#ss2.6 >> My erlang code is acting as follows: >> maple% erl >> Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] >> [hipe] >> [kernel-poll:false] >> Eshell V5.5.5 (abort with ^G) >> 1> Opts = [binary, {packet, raw}, {active, false}]. >> [binary,{packet,raw},{active,false}] >> 2> {ok, LS} = gen_tcp:listen(6000, Opts). > > -module(adder). > -export([client/2, client/3, server/1]). > > client(Port, List) -> > client("localhost", Port, List). > client(Host, Port, List) -> > {ok, Sock} = gen_tcp:connect(Host, Port, [binary]), > [ok = gen_tcp:send(Sock, <>) || I <- List], > gen_tcp:shutdown(Sock, write), > receive {tcp, Sock, <>} -> > receive {tcp_closed, Sock} -> ok = gen_tcp:close(Sock), J end > end. > > server(Port) -> > {ok, LSock} = gen_tcp:listen(Port, [{exit_on_close, false}, > binary]), > acceptor(LSock, 0). > > acceptor(LSock, Sum) -> > {ok, Sock} = gen_tcp:accept(LSock), > io:format("new client~n", []), > NewSum = serve(Sock, Sum, <<>>), > acceptor(LSock, NewSum). > > serve(Sock, Sum, Buffer) -> > receive > {tcp, _, Data} -> > {NewSum, NewBuffer} = handle(Sum, < binary>>), > serve(Sock, NewSum, NewBuffer); > {tcp_closed, Sock} -> > io:format("client disconnected~n", []), > ok = gen_tcp:send(Sock, <>), > ok = gen_tcp:close(Sock), > Sum; > {tcp_error, Sock, _} -> > io:format("tcp error~n", []), > Sum > end. > > handle(Sum, <>) -> handle(I + Sum, R); > handle(Sum, Buf) -> {Sum, Buf}. > From mats.cronqvist@REDACTED Thu Dec 20 09:22:18 2007 From: mats.cronqvist@REDACTED (mats cronqvist) Date: Thu, 20 Dec 2007 09:22:18 +0100 Subject: [erlang-questions] Regular Expressions in Erlang In-Reply-To: References: Message-ID: <1198138938.28499.116.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> On Wed, 2007-12-19 at 18:14 +0000, Tomasz Blachowicz wrote: > > If there are any other decent implementations of regexp available > please let me know. i use gregexp (written by pascal brisset); http://www.cellicium.com/erlang/contribs it does submatches and is (or at least used to be) quite a bit faster than the pretty pathetic OTP regexp. rumour has it that robert virding is working on a new erlang implementation; couldn't find any code by googling though. if you want a real (as in something used outside the erlang world) regexp, the links below shows how to turn the PCRE (http://www.pcre.org) library into a couple of BIFs (code by istvan varadi). used to work very well in R11B. http://www.pcre.org http://www.trapexit.org/Adding_my_own_BIF http://forum.trapexit.org/viewtopic.php?t=5906 if i had to do it again i'd chose the TRE library instead. of course, seems like it's already been done by some French guy; http://easyerl.blogspot.com/2007/10/libtre-returning-matching-values.html Claes "klacke" Wikstr?m will of course not be outdone; http://patricklogan.blogspot.com/2007/09/apparently-fast-erlang-file-read-and.html this got to be a bit longer that i intended. i'll post it anyways to aid future googlers. mats From mats.cronqvist@REDACTED Thu Dec 20 09:28:25 2007 From: mats.cronqvist@REDACTED (mats cronqvist) Date: Thu, 20 Dec 2007 09:28:25 +0100 Subject: [erlang-questions] Erlang SIGWINCH bugfix bounty In-Reply-To: References: Message-ID: <1198139305.28499.122.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> On Wed, 2007-12-19 at 10:31 -0800, Matthew Dempsky wrote: > Okay, this has been driving me nuts for the past three months: > > Open a terminal at 80 columns. > Start erl. > Resize the terminal to 120 columns. > Type a 100 character atom and then a period. > Press enter, then up, then down. > > The 2> prompt has now moved to partially overwrite the interpreter's > output for evaluating the first line. I have this problem in OS X's > Terminal.app as well as xterm (running under X11.app), though how the > output gets clobbered differs slightly. my experience is that the erlang shell history mechanism is pretty useless unless the terminal is exactly 80 chars wide. now if you are a REAL PROGRAMMER, and hence use a VT100 terminal (http://en.wikipedia.org/wiki/VT100), it's not a big problem. mats From mats.cronqvist@REDACTED Thu Dec 20 09:51:28 2007 From: mats.cronqvist@REDACTED (mats cronqvist) Date: Thu, 20 Dec 2007 09:51:28 +0100 Subject: [erlang-questions] graphs and trees Message-ID: <1198140688.28499.129.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> so i've made a directad acyclic graph by calling various functions in the digraph module. i theory, the resulting graph should be a tree. is there some snazzy graph theory trick to show that the graph is indeed a tree? disclaimer; i am by training a physicist, and as such uncomfortable with all data structures more complicated than the fixed-size array. so no big words please :> mats From thomasl_erlang@REDACTED Thu Dec 20 10:23:35 2007 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 20 Dec 2007 01:23:35 -0800 (PST) Subject: [erlang-questions] graphs and trees In-Reply-To: <1198140688.28499.129.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> Message-ID: <912181.53404.qm@web38804.mail.mud.yahoo.com> --- mats cronqvist wrote: > so i've made a directad acyclic graph by calling > various functions in > the digraph module. i theory, the resulting graph > should be a tree. is > there some snazzy graph theory trick to show that > the graph is indeed a > tree? Here is a straightforward algorithm, O(number of nodes): Visit all nodes starting from the root, marking each node when visited. If you visit an already seen node, it's not a tree. If some node remains unmarked after this traversal, it's not a tree either. (It's not connected, or there is no unique root, or ...) Best, Thomas ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping From Mike.French@REDACTED Thu Dec 20 10:34:22 2007 From: Mike.French@REDACTED (French, Mike) Date: Thu, 20 Dec 2007 09:34:22 -0000 Subject: [erlang-questions] graphs and trees Message-ID: A graph is a tree if it's connected and nEdges = nVertices - 1 For a simple test, but not necessarily most efficient, use digraph:no_edges/1 and digraph:no_vertices/1 then see if digraph_utils:components/1 returns a single element list: ( digraph:no_edges(G) == digraph:no_vertices(G)-1 ) and ( length(digraph_utils:components(G)) == 1 ) Of course this does not guarantee that the edges are directed from the root outward to the leaves of the tree. Mike -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED]On Behalf Of mats cronqvist Sent: 20 December 2007 08:51 To: erlang-questions@REDACTED Subject: [erlang-questions] graphs and trees so i've made a directad acyclic graph by calling various functions in the digraph module. i theory, the resulting graph should be a tree. is there some snazzy graph theory trick to show that the graph is indeed a tree? disclaimer; i am by training a physicist, and as such uncomfortable with all data structures more complicated than the fixed-size array. so no big words please :> mats _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions Thales UK Ltd (Wells) DISCLAIMER: The information contained in this e-mail is confidential. It may also be legally privileged. It is intended only for the stated addressee(s) and access to it by any other person is unauthorised. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this e-mail. Such unauthorised use may be unlawful. We may monitor all e-mail communications through our networks. If you have received this e-mail in error, please inform us immediately on +44 (0) 1749 672081 and delete it and all copies from your system. We accept no responsibility for changes to any e-mail which occur after it has been sent. Attachments to this e-mail may contain software viruses which could damage your system. We therefore recommend you virus-check all attachments before opening. A business of Thales UK Ltd. Registered Office: 2 Dashwood Lang Road, The Bourne Business Park, Addlestone, Weybridge, Surrey KT15 2NX Registered in England No. 868273 From richardc@REDACTED Thu Dec 20 10:45:48 2007 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 20 Dec 2007 10:45:48 +0100 Subject: [erlang-questions] graphs and trees In-Reply-To: <912181.53404.qm@web38804.mail.mud.yahoo.com> References: <912181.53404.qm@web38804.mail.mud.yahoo.com> Message-ID: <476A39CC.9090806@it.uu.se> Thomas Lindgren wrote: > If some node remains unmarked after this traversal, > it's not a tree either. (It's not connected, or there > is no unique root, or ...) A case of not seeing the tree for all the forests? :-) /Richard From ignatios@REDACTED Thu Dec 20 11:12:34 2007 From: ignatios@REDACTED (Ignatios Souvatzis) Date: Thu, 20 Dec 2007 11:12:34 +0100 Subject: [erlang-questions] graphs and trees In-Reply-To: <912181.53404.qm@web38804.mail.mud.yahoo.com> References: <1198140688.28499.129.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> <912181.53404.qm@web38804.mail.mud.yahoo.com> Message-ID: <20071220101234.GB3992@cs.uni-bonn.de> On Thu, Dec 20, 2007 at 01:23:35AM -0800, Thomas Lindgren wrote: > > Visit all nodes starting from the root, marking each > node when visited. If you visit an already seen node, > it's not a tree. > > If some node remains unmarked after this traversal, > it's not a tree either. (It's not connected, or there > is no unique root, or ...) That is, it is a forest, right? -is From bjorn@REDACTED Thu Dec 20 11:40:50 2007 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 20 Dec 2007 11:40:50 +0100 Subject: [erlang-questions] Regular Expressions in Erlang In-Reply-To: References: Message-ID: "Tomasz Blachowicz" writes: > Hi, > > I've a couple of questions about regular expressions in Erlang: [...] The regexp module is, unfortunately, lacking in both functionality and speed. We plan to provide a better regexp library in a future release, probably during 2008. /Bjorn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From rvirding@REDACTED Thu Dec 20 12:13:35 2007 From: rvirding@REDACTED (Robert Virding) Date: Thu, 20 Dec 2007 12:13:35 +0100 Subject: [erlang-questions] Regular Expressions in Erlang In-Reply-To: <1198138938.28499.116.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> References: <1198138938.28499.116.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> Message-ID: <3dbc6d1c0712200313j663e12b6yd3780262ccd7712f@mail.gmail.com> On 20/12/2007, mats cronqvist wrote: > > On Wed, 2007-12-19 at 18:14 +0000, Tomasz Blachowicz wrote: > > > > If there are any other decent implementations of regexp available > > please let me know. > > rumour has it that robert virding is working on a new erlang > implementation; couldn't find any code by googling though. Yes, I do have one that works but I haven't released it yet. Some info: - It is written entirely in Erlang so it will be always available. - It supports POSIX regexps and can capture subexpressions. - It is a true NFA implementation and will never blow up irrespective of the regexp. Most packages are unsafe for pathological cases, read Russ Cox http://swtch.com/~rsc/regexp/ - It is probably not as fast as C implementations, but see above. - It has a better parser ADT then the existing one. - Having the ADT available in Erlang can be a big win. - As it is written in Erlang it will nevre lock the emulator. All that really needs to be done is to clean up the interface slightly. I will release soon so people who want can test it. I have not been able to compare speed with other implementation like PCRE as I only have access to a toy environment, pure Windows. (see above features) What I really think should be done is to split the work and have the parser/compiler written in Erlang while the actual execution code written in C. Try to get the best of both worlds. One benefit of this would be that it would be then be easier to write other tools/apps which use regexps but don't want to do just standard matching with them, for example leex or other scanner/parser tools. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From richardc@REDACTED Thu Dec 20 12:32:50 2007 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 20 Dec 2007 12:32:50 +0100 Subject: [erlang-questions] graphs and trees In-Reply-To: <1198140688.28499.129.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> References: <1198140688.28499.129.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> Message-ID: <476A52E2.7070809@it.uu.se> mats cronqvist wrote: > so i've made a directad acyclic graph by calling various functions in > the digraph module. i theory, the resulting graph should be a tree. is > there some snazzy graph theory trick to show that the graph is indeed a > tree? > disclaimer; i am by training a physicist, and as such uncomfortable > with all data structures more complicated than the fixed-size array. so > no big words please :> If you get a single component from digraph_utils:components(Graph) and digraph_utils:is_acyclic(Graph) returns true, you have a tree. /Richard From Mike.French@REDACTED Thu Dec 20 12:45:47 2007 From: Mike.French@REDACTED (French, Mike) Date: Thu, 20 Dec 2007 11:45:47 -0000 Subject: [erlang-questions] graphs and trees Message-ID: No, because is_acyclic(G) considers the direction of edges, and a pair of nodes can be connected by multiple paths that do not form a cycle. What you have found is a Directed Acyclic Graph (DAG). Mike -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED]On Behalf Of Richard Carlsson Sent: 20 December 2007 11:33 To: mats cronqvist Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] graphs and trees mats cronqvist wrote: > so i've made a directad acyclic graph by calling various functions in > the digraph module. i theory, the resulting graph should be a tree. is > there some snazzy graph theory trick to show that the graph is indeed a > tree? > disclaimer; i am by training a physicist, and as such uncomfortable > with all data structures more complicated than the fixed-size array. so > no big words please :> If you get a single component from digraph_utils:components(Graph) and digraph_utils:is_acyclic(Graph) returns true, you have a tree. /Richard _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions Thales UK Ltd (Wells) DISCLAIMER: The information contained in this e-mail is confidential. It may also be legally privileged. It is intended only for the stated addressee(s) and access to it by any other person is unauthorised. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this e-mail. Such unauthorised use may be unlawful. We may monitor all e-mail communications through our networks. If you have received this e-mail in error, please inform us immediately on +44 (0) 1749 672081 and delete it and all copies from your system. We accept no responsibility for changes to any e-mail which occur after it has been sent. Attachments to this e-mail may contain software viruses which could damage your system. We therefore recommend you virus-check all attachments before opening. A business of Thales UK Ltd. Registered Office: 2 Dashwood Lang Road, The Bourne Business Park, Addlestone, Weybridge, Surrey KT15 2NX Registered in England No. 868273 From invite+hzlhc66f@REDACTED Thu Dec 20 02:08:18 2007 From: invite+hzlhc66f@REDACTED (Martin Yu) Date: Wed, 19 Dec 2007 17:08:18 -0800 Subject: [erlang-questions] Check out my Facebook profile Message-ID: <638ed594e8e3b24116dc00c98ce75db4@register.facebook.com> I set up a Facebook profile with my pictures, videos and events and I want to add you as a friend so you can see it. First, you need to join Facebook! Once you join, you can also create your own profile. Thanks, Martin Here's the link: http://www.facebook.com/p.php?i=579019752&k=43C326PRQ3TF6FC1VAW6R&r&v=2 ___________________ This e-mail may contain promotional materials. If you do not wish to receive future commercial mailings from Facebook, please click on the link below. Facebook's offices are located at 156 University Ave., Palo Alto, CA 94301. http://www.facebook.com/o.php?u=1047073833&k=738683 -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Thu Dec 20 13:04:26 2007 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 20 Dec 2007 04:04:26 -0800 (PST) Subject: [erlang-questions] graphs and trees In-Reply-To: <476A39CC.9090806@it.uu.se> Message-ID: <688921.97992.qm@web38801.mail.mud.yahoo.com> --- Richard Carlsson wrote: > Thomas Lindgren wrote: > > If some node remains unmarked after this > traversal, > > it's not a tree either. (It's not connected, or > there > > is no unique root, or ...) > > A case of not seeing the tree for all the forests? > :-) Well, I almost called it a forest, but you could also have the case of, say, two distinct root nodes sharing subtrees/-graphs. That's not quite a forest (um, I think) but maybe a banyan tree? :-) Best, Thomas ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From richardc@REDACTED Thu Dec 20 13:14:15 2007 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 20 Dec 2007 13:14:15 +0100 Subject: [erlang-questions] graphs and trees In-Reply-To: References: Message-ID: <476A5C97.9040401@it.uu.se> French, Mike wrote: > No, because is_acyclic(G) considers the direction of edges, > and a pair of nodes can be connected by multiple paths that do not form a > cycle. > What you have found is a Directed Acyclic Graph (DAG). Duh. Sorry, I got ahead of myself looking for a quick solution using the existing libraries. /Richard From mats.cronqvist@REDACTED Thu Dec 20 13:32:23 2007 From: mats.cronqvist@REDACTED (mats cronqvist) Date: Thu, 20 Dec 2007 13:32:23 +0100 Subject: [erlang-questions] graphs and trees In-Reply-To: References: Message-ID: <1198153943.28499.136.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> On Thu, 2007-12-20 at 09:34 +0000, French, Mike wrote: > A graph is a tree if it's connected and nEdges = nVertices - 1 > For a simple test, but not necessarily most efficient, use > digraph:no_edges/1 and digraph:no_vertices/1 then see if > digraph_utils:components/1 returns a single element list: > > ( digraph:no_edges(G) == digraph:no_vertices(G)-1 ) and > ( length(digraph_utils:components(G)) == 1 ) > > Of course this does not guarantee that the edges are > directed from the root outward to the leaves of the tree. so a connected directed acyclic graph where nEdges - nVertices = 1 is a tree, and vice versa(?) in hindsight it's obvious even to me that every vertex, except the root, has exactly one incoming edge. thanks mike! mats From thomasl_erlang@REDACTED Thu Dec 20 13:19:01 2007 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 20 Dec 2007 04:19:01 -0800 (PST) Subject: [erlang-questions] Regular Expressions in Erlang In-Reply-To: <3dbc6d1c0712200313j663e12b6yd3780262ccd7712f@mail.gmail.com> Message-ID: <590730.319.qm@web38809.mail.mud.yahoo.com> --- Robert Virding wrote: > On 20/12/2007, mats cronqvist > wrote: > > > > rumour has it that robert virding is working on > a new erlang > > implementation; couldn't find any code by googling > though. > > > Yes, I do have one that works but I haven't released > it yet. Some info: Sounds great, a big step forward, but as always some additional features may be desirable (sorry!): 1. Does it support efficient operation on strings-as-binaries in addition to lists? [major] 2. Are wide characters handled? [pretty useful too] Best, Thomas ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From richardc@REDACTED Thu Dec 20 15:15:35 2007 From: richardc@REDACTED (Richard Carlsson) Date: Thu, 20 Dec 2007 15:15:35 +0100 Subject: [erlang-questions] graphs and trees In-Reply-To: <1198140688.28499.129.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> References: <1198140688.28499.129.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> Message-ID: <476A7907.2000204@it.uu.se> mats cronqvist wrote: > so i've made a directad acyclic graph by calling various functions in > the digraph module. i theory, the resulting graph should be a tree. is > there some snazzy graph theory trick to show that the graph is indeed a > tree? Suggestion: when you have a working test, call it is_tree(G) and submit it to OTP as a patch to digraph_utils. /Richard From dgud@REDACTED Thu Dec 20 16:33:50 2007 From: dgud@REDACTED (Dan Gudmundsson) Date: Thu, 20 Dec 2007 16:33:50 +0100 Subject: [erlang-questions] program: wxWidgets for erlang (again) In-Reply-To: <468504CD.2080506@erix.ericsson.se> References: <4684C2D6.7010707@erix.ericsson.se> <4684F78A.9010202@gmail.com> <468504CD.2080506@erix.ericsson.se> Message-ID: <476A8B5E.8080000@erix.ericsson.se> Hi I've made a new beta release: see wxerlang.sf.net It requires R12B and wxWidgets-2.8. (which is statically linked in the pre-built version for mac and windows) Windows is now working, Solaris-10, Mac and Linux is also working!! I've added support for xrc and a demo, which is wxwidgets support for gui-builders, are you happy now Mats? You still have write some code though, I haven't written an erlang code generator yet :-) Hopefully this release is more stable, I haven't added so much new functionality. At least the previous reported bug is fixed (in the emulator). Feedback and/or patches are appreciated. I had a hundred downloads of the previous release. So tell me if worked or was complete trash what do you think about the api-mapping. /Dan From thomasl_erlang@REDACTED Thu Dec 20 18:33:55 2007 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 20 Dec 2007 09:33:55 -0800 (PST) Subject: [erlang-questions] Erlang in the news Message-ID: <706147.83528.qm@web38806.mail.mud.yahoo.com> Amazon's SimpleDB (apparently built on Erlang/Mnesia) ... http://www.satine.org/archives/2007/12/13/amazon-simpledb/ ... is garnering a lot of attention, so now Erlang is even getting into the news mainstream (well, by that I mean the writers on the site below are basically analysts/reporters, not techies as such): http://gigaom.com/2007/12/19/erlang-a-new-way-to-program-thats-20-years-old/ Summary: plaintive cries of "It's too weird". The educational mission isn't over yet by far, it seems. This guy doesn't want to hear about Erlang for all his solutions(!), he wants transactions: http://weblogs.mozillazine.org/roc/archives/2007/09/why_erlang_is_n.html Maybe we should tell him about mnesia? And here is a pretty good 'getting started' post: http://kosmaczewski.net/2007/12/19/erlang/ All in all, a fair amount of buzz. Best, Thomas ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From ulf.wiger@REDACTED Thu Dec 20 20:10:47 2007 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Thu, 20 Dec 2007 20:10:47 +0100 Subject: [erlang-questions] extracting funs from source code Message-ID: <476ABE37.3080407@ericsson.com> I wrote a little snippet for comp.lang.functional, which, given a reference to a fun, extracts the abstract form of that fun from the module's debug-info. This is of course incredibly useful... (: I will not guarantee that my method of finding the fun's abstract form won't break in obscure cases. BR, Ulf W -------------- next part -------------- An embedded message was scrubbed... From: Ulf Wiger Subject: Re: Verbose functional languages? Date: Wed, 19 Dec 2007 12:44:47 +0100 Size: 4877 URL: From matthew@REDACTED Thu Dec 20 20:33:48 2007 From: matthew@REDACTED (Matthew Dempsky) Date: Thu, 20 Dec 2007 11:33:48 -0800 Subject: [erlang-questions] Erlang SIGWINCH bugfix bounty In-Reply-To: <1198139305.28499.122.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> References: <1198139305.28499.122.camel@seasc0498.dyn.rnd.as.sw.ericsson.se> Message-ID: On 12/20/07, mats cronqvist wrote: > my experience is that the erlang shell history mechanism is pretty > useless unless the terminal is exactly 80 chars wide. That is not my experience. If I repeat the steps I outlined, but instead start erl in a 120 column terminal rather than resizing it later, erl behaves exactly as I desire. Therefore I am under the impression it is a SIGWINCH handling bug. From kostis@REDACTED Thu Dec 20 22:50:58 2007 From: kostis@REDACTED (Kostis Sagonas) Date: Thu, 20 Dec 2007 23:50:58 +0200 Subject: [erlang-questions] clarfy: where is -spec(...) syntax documented In-Reply-To: <1197938490.11729.3.camel@pfisher-laptop> References: <1197938490.11729.3.camel@pfisher-laptop> Message-ID: <476AE3C2.7090804@cs.ntua.gr> Paul Fisher wrote: > Where is the new "-spec(...)" syntax documented? I've poked around the > R12 doc and googled, but turned up nothing. The Erlang Extension Proposal for types and specs now appears at: http://www.erlang.org/eeps/eep-0008.html Note: although this document corresponds to what has been implemented so far in R12B-0, the above document is just an EEP at this point. It's not yet official and you can in *no way* rely on it yet. But feedback is welcome. Kostis From peter@REDACTED Thu Dec 20 18:53:53 2007 From: peter@REDACTED (Peter K Chan) Date: Thu, 20 Dec 2007 18:53:53 +0100 Subject: [erlang-questions] Erlang in the news In-Reply-To: <706147.83528.qm@web38806.mail.mud.yahoo.com> References: <706147.83528.qm@web38806.mail.mud.yahoo.com> Message-ID: Instead of mnesia, I have read that SimpleDB is built on Erlang and BDB. SimpleDB also has a storage limit of 10 GB (temporary to the beta), which seems higher than what the 32 bit version of mnesia can handle. Peter -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Thomas Lindgren Sent: Thursday, December 20, 2007 11:34 AM To: erlang-questions Subject: [erlang-questions] Erlang in the news Amazon's SimpleDB (apparently built on Erlang/Mnesia) ... http://www.satine.org/archives/2007/12/13/amazon-simpledb/ ... is garnering a lot of attention, so now Erlang is even getting into the news mainstream (well, by that I mean the writers on the site below are basically analysts/reporters, not techies as such): http://gigaom.com/2007/12/19/erlang-a-new-way-to-program-thats-20-years- old/ Summary: plaintive cries of "It's too weird". The educational mission isn't over yet by far, it seems. This guy doesn't want to hear about Erlang for all his solutions(!), he wants transactions: http://weblogs.mozillazine.org/roc/archives/2007/09/why_erlang_is_n.html Maybe we should tell him about mnesia? And here is a pretty good 'getting started' post: http://kosmaczewski.net/2007/12/19/erlang/ All in all, a fair amount of buzz. Best, Thomas ________________________________________________________________________ ____________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://www.erlang.org/mailman/listinfo/erlang-questions From daniel.caune@REDACTED Fri Dec 21 00:56:05 2007 From: daniel.caune@REDACTED (Daniel Caune) Date: Thu, 20 Dec 2007 18:56:05 -0500 Subject: [erlang-questions] Problem with pgsql and prepared statement usign UPDATE Message-ID: <1E293D3FF63A3740B10AD5AAD88535D206C6F8D7@UBIMAIL1.ubisoft.org> Hi, I face a timeout after executing a prepared statement using UPDATE clause against PostgreSQL. I don't have any problem with any SELECT clause, but UPDATE clause only. (u@REDACTED)2> matchmaking_configuration:disable_revision(1). ** exited: {{case_clause,timeout}, [{edbc_postgresql,execute_prepared_statement,3}, {rdbms_helper,execute_prepared_statement,3}, {erl_eval,do_apply,5}, {shell,exprs,6}, {shell,eval_loop,3}]} ** =ERROR REPORT==== 20-Dec-2007::18:41:26 === Error in process <0.36.0> on node 'u@REDACTED' with exit value: {{case_clause,t imeout},[{edbc_postgresql,execute_prepared_statement,3},{rdbms_helper,ex ecute_pr epared_statement,3},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_lo op,3}]} The PostgreSQL log file doesn't reveal any problem. 2007-12-20 18:41:52 EST LOG: execute : UPDATE matchmaking_metadata SET status = $1 WHERE revision_number = $2 2007-12-20 18:41:52 EST DETAIL: parameters: $1 = '2', $2 = '1' 2007-12-20 18:41:52 EST LOG: duration: 0.255 ms The UPDATE has been successfully executed. The timeout is raised somewhere in the pgsql library for some reason. Any idea before I dive into the pgsql code? Regards, -- Daniel From zerthurd@REDACTED Fri Dec 21 07:38:22 2007 From: zerthurd@REDACTED (Maxim Treskin) Date: Fri, 21 Dec 2007 12:38:22 +0600 Subject: [erlang-questions] Erlang jabber conference Message-ID: Hello, Welcome to erlang@REDACTED for realtime questions solution. I has not found erlang conferences anywhere, but I thing anybody will be glad ;) -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsu79@REDACTED Fri Dec 21 10:40:28 2007 From: chsu79@REDACTED (Christian S) Date: Fri, 21 Dec 2007 10:40:28 +0100 Subject: [erlang-questions] Erlang jabber conference In-Reply-To: References: Message-ID: There is the erlang channel on the freenode irc network. On 12/21/07, Maxim Treskin wrote: > Hello, > > Welcome to erlang@REDACTED for realtime questions solution. > I has not found erlang conferences anywhere, but I thing anybody will be > glad ;) > From dgud@REDACTED Fri Dec 21 12:09:42 2007 From: dgud@REDACTED (Dan Gudmundsson) Date: Fri, 21 Dec 2007 12:09:42 +0100 Subject: [erlang-questions] program: wxWidgets for erlang (again) In-Reply-To: <1198234074.5543.10.camel@ubuntu-life-vm> References: <4684C2D6.7010707@erix.ericsson.se> <4684F78A.9010202@gmail.com> <468504CD.2080506@erix.ericsson.se> <476A8B5E.8080000@erix.ericsson.se> <1198234074.5543.10.camel@ubuntu-life-vm> Message-ID: <476B9EF6.2050108@erix.ericsson.se> Bob Cowdery wrote: > Dan > > This looks really good. I have quite a large Swing GUI that I would like > to convert. I wonder are there any getting started guides. I did find a > PDF but it was for an earlier version as the API was completely > different. I'm running XP and have it all loaded except I'm clearly > doing something (or many things) wrong. At the moment I can't get as far > showing a frame! If I do something like. > > wx:new(). > F = wxFrame:new(). > wxFrame:show(F). > > It throws an invalid argument exception. I tried various other things > but just got different results. Any help in getting off the ground > appreciated. I don't have any more documentation or tutorials then what is in package, but the test programs and demos (erltop and xrc) should get you started. And they should work at least start, they are demos so not everything is implemented. Ok the opengl tests may crash depending on drivers, i.e. when running several windows they crash on my win2000 laptop. But that's life with 3D rendering I guess. Otherwise you will have read documentation and or tutorials from http://www.wxwidgets.org The tutorials should be easy to convert from C++ to erlang, I've tried to describe the erlang mapping on the overview page in the docs dir. or here http://www.erlang.org/~dgud/wxerlang/doc/index.html I don't know that much about wxwidgets I know the erlang binding but not wxwidgets, I guess that comes with experience, their documentation isn't the best either. > The other thing I noticed is that after starting 'erl -smp' it no longer > shuts down cleanly with Ctrl'C' but brings up a debug window. Thanks, I'll try to reproduce it. /Dan > Thanks > Bob > > On Thu, 2007-12-20 at 16:33 +0100, Dan Gudmundsson wrote: >> Hi >> >> I've made a new beta release: see wxerlang.sf.net >> >> It requires R12B and wxWidgets-2.8. >> (which is statically linked in the pre-built version for mac and windows) >> >> Windows is now working, Solaris-10, Mac and Linux is also working!! >> >> I've added support for xrc and a demo, which is wxwidgets support for >> gui-builders, are you happy now Mats? >> You still have write some code though, I haven't written an erlang code >> generator yet :-) >> >> Hopefully this release is more stable, I haven't added so much new >> functionality. At least the previous reported bug is fixed (in the >> emulator). >> >> Feedback and/or patches are appreciated. I had a hundred downloads of >> the previous release. So tell me if worked or was complete trash what do >> you think about the api-mapping. >> >> /Dan >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://www.erlang.org/mailman/listinfo/erlang-questions > From bob@REDACTED Fri Dec 21 16:33:17 2007 From: bob@REDACTED (Bob Cowdery) Date: Fri, 21 Dec 2007 15:33:17 +0000 Subject: [erlang-questions] program: wxWidgets for erlang (again) In-Reply-To: <476B9EF6.2050108@erix.ericsson.se> References: <4684C2D6.7010707@erix.ericsson.se> <4684F78A.9010202@gmail.com> <468504CD.2080506@erix.ericsson.se> <476A8B5E.8080000@erix.ericsson.se> <1198234074.5543.10.camel@ubuntu-life-vm> <476B9EF6.2050108@erix.ericsson.se> Message-ID: <1198251197.5543.18.camel@ubuntu-life-vm> Dan Thank you for the response. I should have looked at the test directory but for some reason it completely escaped me. I have it going now. I think it was not using werl and misusing the API that were my fundamental errors. I have used wxPython a couple of years ago, I need to get back up to speed with a new binding. I will let you know how things progress. Bob On Fri, 2007-12-21 at 12:09 +0100, Dan Gudmundsson wrote: > Bob Cowdery wrote: > > Dan > > > > This looks really good. I have quite a large Swing GUI that I would like > > to convert. I wonder are there any getting started guides. I did find a > > PDF but it was for an earlier version as the API was completely > > different. I'm running XP and have it all loaded except I'm clearly > > doing something (or many things) wrong. At the moment I can't get as far > > showing a frame! If I do something like. > > > > wx:new(). > > F = wxFrame:new(). > > wxFrame:show(F). > > > > It throws an invalid argument exception. I tried various other things > > but just got different results. Any help in getting off the ground > > appreciated. > > I don't have any more documentation or tutorials then what is in > package, but the test programs and demos (erltop and xrc) should get > you started. And they should work at least start, they are demos so not > everything is implemented. Ok the opengl tests may crash depending on > drivers, i.e. when running several windows they crash on my win2000 > laptop. But that's life with 3D rendering I guess. > > Otherwise you will have read documentation and or tutorials from > http://www.wxwidgets.org > The tutorials should be easy to convert from C++ to erlang, I've tried > to describe the erlang mapping on the overview page in the docs dir. > or here http://www.erlang.org/~dgud/wxerlang/doc/index.html > > I don't know that much about wxwidgets I know the erlang binding but not > wxwidgets, I guess that comes with experience, their documentation isn't > the best either. > > > The other thing I noticed is that after starting 'erl -smp' it no longer > > shuts down cleanly with Ctrl'C' but brings up a debug window. > > Thanks, I'll try to reproduce it. > > /Dan > > > > Thanks > > Bob > > > > On Thu, 2007-12-20 at 16:33 +0100, Dan Gudmundsson wrote: > >> Hi > >> > >> I've made a new beta release: see wxerlang.sf.net > >> > >> It requires R12B and wxWidgets-2.8. > >> (which is statically linked in the pre-built version for mac and windows) > >> > >> Windows is now working, Solaris-10, Mac and Linux is also working!! > >> > >> I've added support for xrc and a demo, which is wxwidgets support for > >> gui-builders, are you happy now Mats? > >> You still have write some code though, I haven't written an erlang code > >> generator yet :-) > >> > >> Hopefully this release is more stable, I haven't added so much new > >> functionality. At least the previous reported bug is fixed (in the > >> emulator). > >> > >> Feedback and/or patches are appreciated. I had a hundred downloads of > >> the previous release. So tell me if worked or was complete trash what do > >> you think about the api-mapping. > >> > >> /Dan > >> > >> > >> > >> > >> > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://www.erlang.org/mailman/listinfo/erlang-questions > > From olivier.boudeville@REDACTED Fri Dec 21 17:47:01 2007 From: olivier.boudeville@REDACTED (Olivier Boudeville) Date: Fri, 21 Dec 2007 17:47:01 +0100 Subject: [erlang-questions] ann: WOOPER 0.2 released, lightweight OOP with Erlang Message-ID: <476BEE05.3020308@online.fr> Hi, a new version of WOOPER (Wrapper for OOP in Erlang) has been released. It should be more convenient to develop with, more robust and a bit faster. WOOPER is an open source lightweight layer on top of the Erlang language offering constructs dedicated to Object-Oriented Programming, including classes, instances, methods (requests or oneways), life-cycle management (new/new_link/delete), multiple inheritance, polymorphism, state management, etc., with some efforts to preserve overall performances (hashtable-based virtual tables). All documentation, sources and full examples are available here : http://ceylan.sourceforge.net/main/documentation/wooper/ Any constructive feedback would be appreciated! Regards, Olivier Boudeville. From dizzyd@REDACTED Fri Dec 21 21:36:18 2007 From: dizzyd@REDACTED (Dave Smith) Date: Fri, 21 Dec 2007 13:36:18 -0700 Subject: [erlang-questions] Erlang resumes? Message-ID: I'm in the process of building a case for Erlang at my job. We're building a large scale network service and I'm pretty certain that using erlang would reduce both time to market and system complexity. The problem is, when I suggest Erlang people look at me funny (ok, maybe it's just my hairstyle) and say things like "There aren't any erlang developers out there!" and "It's an obscure language and we'd be unable to maintain the system if you got hit by a bus", etc... I suspect that there _are_ erlang devs in the US/Canada area who are competent and would love the chance to work from home with awesome hardware and develop a large scale Erlang service. If you happen to be one of them, would you kindly consider sending me your resume as evidence? I can't promise you a job as a result, but you might consider it your part in getting the word out on Erlang. :) Sincerely, Dave Smith dizzyd at gmail dot com From bob@REDACTED Fri Dec 21 22:17:40 2007 From: bob@REDACTED (Bob Ippolito) Date: Fri, 21 Dec 2007 13:17:40 -0800 Subject: [erlang-questions] Erlang resumes? In-Reply-To: References: Message-ID: <6a36e7290712211317r5b316738x34413d8d251f2a5e@mail.gmail.com> We're also hiring engineers at Mochi Media in San Francisco, CA. We do a LOT of Erlang, but there's also Python code (primarily for the web front-end and database ETL) and JavaScript/ActionScript for the web site and APIs. We've been building Erlang platforms for over a year and use it to process tens of millions of requests a day (each) for our analytics platform MochiBot and our ad network MochiAds. We don't require significant Erlang experience, we're just looking for smart people that learn quickly. http://mochimedia.com/ (if you email me directly use bob@REDACTED - work email gets much more attention) -bob On 12/21/07, Dave Smith wrote: > I'm in the process of building a case for Erlang at my job. We're > building a large scale network service and I'm pretty certain that > using erlang would reduce both time to market and system complexity. > The problem is, when I suggest Erlang people look at me funny (ok, > maybe it's just my hairstyle) and say things like "There aren't any > erlang developers out there!" and "It's an obscure language and we'd > be unable to maintain the system if you got hit by a bus", etc... > > I suspect that there _are_ erlang devs in the US/Canada area who are > competent and would love the chance to work from home with awesome > hardware and develop a large scale Erlang service. If you happen to be > one of them, would you kindly consider sending me your resume as > evidence? I can't promise you a job as a result, but you might > consider it your part in getting the word out on Erlang. :) > > Sincerely, > > Dave Smith > dizzyd at gmail dot com > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From rvirding@REDACTED Fri Dec 21 22:51:36 2007 From: rvirding@REDACTED (Robert Virding) Date: Fri, 21 Dec 2007 22:51:36 +0100 Subject: [erlang-questions] Regular Expressions in Erlang In-Reply-To: <590730.319.qm@web38809.mail.mud.yahoo.com> References: <3dbc6d1c0712200313j663e12b6yd3780262ccd7712f@mail.gmail.com> <590730.319.qm@web38809.mail.mud.yahoo.com> Message-ID: <3dbc6d1c0712211351r20921cccqd586fb2c7eec7464@mail.gmail.com> On 20/12/2007, Thomas Lindgren wrote: > > > --- Robert Virding wrote: > > > On 20/12/2007, mats cronqvist > > wrote: > > > > > > rumour has it that robert virding is working on > > a new erlang > > > implementation; couldn't find any code by googling > > though. > > > > > > Yes, I do have one that works but I haven't released > > it yet. Some info: > > Sounds great, a big step forward, but as always some > additional features may be desirable (sorry!): > > 1. Does it support efficient operation on > strings-as-binaries in addition to lists? [major] Yes, it works directly on binaries and is as efficient (inefficient) as working on lists. Actually in R11 stepping down a binary was slightly slower than stepping over a list. I haven't measured yet in R12. 2. Are wide characters handled? [pretty useful too] Well, yes, but probably not as you mean it. If you operate on a list then your list can contain any size characters. It doesn't try to parse the list/binary to build characters. Actually depending on how you define your regular expression you can use it on lists of anything. Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Fri Dec 21 23:46:09 2007 From: joelr1@REDACTED (Joel Reymont) Date: Fri, 21 Dec 2007 22:46:09 +0000 Subject: [erlang-questions] Erlang resumes? In-Reply-To: References: Message-ID: On Dec 21, 2007, at 8:36 PM, Dave Smith wrote: > I suspect that there _are_ erlang devs in the US/Canada area who are > competent and would love the chance to work from home with awesome > hardware and develop a large scale Erlang service. I have a hunch that there aren't many available and experienced Erlang developers in the US/Canada at the moment. Maybe the training courses given by Pragmatic Programmers will change that. -- http://wagerlabs.com From sten@REDACTED Fri Dec 21 23:51:57 2007 From: sten@REDACTED (Sten Kvamme) Date: Fri, 21 Dec 2007 23:51:57 +0100 Subject: [erlang-questions] Timer Message-ID: I'm working on a vector graphics animation in Ex11. What is the best way to implement acceleration (exponential time delay)? Is it best done in C? The timer module doesn't work on my Mac OS X. timer:sleep () gives me the following error: Error in process <0.42.0> with exit value: {undef,[{timer,sleep,[[500]]},{trigger,for,4},{trigger,trig,1}]} Erlang is new for me, so there is possibly some simple solution. Thanks, Sten From fig@REDACTED Thu Dec 20 01:58:37 2007 From: fig@REDACTED (Michael FIG) Date: Wed, 19 Dec 2007 18:58:37 -0600 (CST) Subject: [erlang-questions] Erlang resumes? In-Reply-To: Message-ID: <11535113.153041198112317725.JavaMail.root@zimbra> Hi, My company is launching a new product that uses an embedded Erlang/OTP release in conjunction with the Asterisk PBX, and C# for the client-side management GUI. If any of you are interested in doing some work for us (flat-rate per-feature contracts, work from home over the Internet), please send resumes to the "dev" e-mail address at my company's domain. Thanks, -- Michael FIG , PMP MarkeTel Multi-Line Dialing Systems, Ltd. Phone: (306) 359-6893 ext. 528 From rpettit@REDACTED Sat Dec 22 01:12:25 2007 From: rpettit@REDACTED (Rick Pettit) Date: Fri, 21 Dec 2007 18:12:25 -0600 Subject: [erlang-questions] Erlang resumes? In-Reply-To: References: Message-ID: <20071222001225.GA21385@vailsys.com> On Fri, Dec 21, 2007 at 10:46:09PM +0000, Joel Reymont wrote: > > On Dec 21, 2007, at 8:36 PM, Dave Smith wrote: > > > I suspect that there _are_ erlang devs in the US/Canada area who are > > competent and would love the chance to work from home with awesome > > hardware and develop a large scale Erlang service. > > I have a hunch that there aren't many available and experienced Erlang > developers in the US/Canada at the moment. Maybe the training courses > given by Pragmatic Programmers will change that. I'm not sure how many of us there are, but we exist :-) -Rick P.S. I've written a number of systems (still in production) over the years, all requiring 24x7 uptime. Many of these systems I've maintained (fixed bugs, added features) without ever taking offline. I couldn't even imagine how much harder my job would be without Erlang at this point. Many, many thanks to those of you who made it possible. From vances@REDACTED Sat Dec 22 07:52:35 2007 From: vances@REDACTED (Vance Shipley) Date: Sat, 22 Dec 2007 01:52:35 -0500 Subject: [erlang-questions] Erlang resumes? In-Reply-To: References: Message-ID: <20071222065205.GG483@little-black-book.motivity.ca> On Fri, Dec 21, 2007 at 01:36:18PM -0700, Dave Smith wrote: } The problem is, when I suggest Erlang people look at me funny (ok, } maybe it's just my hairstyle) and say things like "There aren't any } erlang developers out there!" and "It's an obscure language and we'd } be unable to maintain the system if you got hit by a bus", etc... In cases like this I'm always reminded of the time that someone referred a job posting to an aquantance of mine who responded that he didn't have nearly the called for amount of experience with PHP. That gentleman was Rasmus Lerdorf. -Vance http://en.wikipedia.org/wiki/Rasmus_Lerdorf From ulf@REDACTED Sat Dec 22 08:56:38 2007 From: ulf@REDACTED (Ulf Wiger) Date: Sat, 22 Dec 2007 08:56:38 +0100 Subject: [erlang-questions] Timer In-Reply-To: References: Message-ID: <8209f740712212356u4f0e76bbq1e9ffefc034646d4@mail.gmail.com> 2007/12/21, Sten Kvamme : > I'm working on a vector graphics animation in Ex11. What is the best > way to implement acceleration (exponential time delay)? Is it best > done in C? The timer module doesn't work on my Mac OS X. timer:sleep > () gives me the following error: Error in process <0.42.0> with exit > value: {undef,[{timer,sleep,[[500]]},{trigger,for,4},{trigger,trig,1}]} {undef,[{timer,sleep,[[500]]},...]} means that you have tried to call timer:sleep([500]), which should by all means give an exit, but not 'undef'... timer:sleep() doesn't exist, and should give you an {undef,[{timer,sleep,[]}...]}. Try timer:sleep(Milliseconds) instead. BR, Ulf W From toby@REDACTED Sat Dec 22 13:53:24 2007 From: toby@REDACTED (Toby Thain) Date: Sat, 22 Dec 2007 10:53:24 -0200 Subject: [erlang-questions] 2002 calling In-Reply-To: References: <19787CF2-A3BF-48F5-8928-79642BF4516C@gmail.com> <7352e43a0712190445i292b7da3jaf1fd75715e893d1@mail.gmail.com> Message-ID: On 19-Dec-07, at 8:54 PM, David Holz wrote: > > From: joelr1@REDACTED >> Also, I don't think I was very clear in my last message. The gem is >> not the book announcement so much as the thread that discusses the >> message routing paradigms. >> >> There are many-many other fun threads like in the archives and I'm >> having a blast collecting them. > > How about making a "best of erlang-questions" page with a > collection of links to the archive? That shouldn't take more than > a few minutes and would be a great resource to everybody. +1. --Toby > _________________________________________________________________ > Get the power of Windows + Web with the new Windows Live. > http://www.windowslive.com?ocid=TXT_TAGHM_Wave2_powerofwindows_122007 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From rpwjanze@REDACTED Sat Dec 22 19:15:32 2007 From: rpwjanze@REDACTED (Ryan Janzen) Date: Sat, 22 Dec 2007 11:15:32 -0700 Subject: [erlang-questions] clarify: Shell Crash on Compilation Message-ID: <6B163096-A693-48BC-BC8D-6A650B4FF41B@ucalgary.ca> Hello List, I was compiling code in the erlang shell on my Powerbook and got this: 49> c(flux_http_handshake). *** ERROR: Shell process terminated! *** Eshell V5.6 (abort with ^G) 1> Is there any reason the shell should crash like this? If I retry the compilation, it works. erl --version gives: Erlang (BEAM) emulator version 5.6 [source] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.6 (abort with ^G) 1> and I am running R12B-0 with patch. Ryan From matthias@REDACTED Sat Dec 22 21:12:55 2007 From: matthias@REDACTED (Matthias Lang) Date: Sat, 22 Dec 2007 21:12:55 +0100 Subject: [erlang-questions] clarify: Shell Crash on Compilation In-Reply-To: <6B163096-A693-48BC-BC8D-6A650B4FF41B@ucalgary.ca> References: <6B163096-A693-48BC-BC8D-6A650B4FF41B@ucalgary.ca> Message-ID: <18285.28615.266236.791095@antilipe.corelatus.se> | 9.9. Why does my application die every second time I load new code into it? | | Erlang's code replacement system is based around there being (up to) | two copies of the code loaded at any time, these are called "old" and | "new". When you load new code, the current version becomes "old" and | the "old" code is thrown away. Any processes still running "old" code | are killed. | | You can check if there is any old code for a particular module still running: | | Eshell V4.9.1 (abort with ^G) | 1> l(erl). | {module,erl} | 2> code:soft_purge(erl). | false | | | In this case old code is still running. You can also check if a | particular process is running old code, by using | erlang:check_process_code(Pid, Module). http://www.erlang.org/faq/faq.html Matthias Ryan Janzen writes: > Hello List, > > I was compiling code in the erlang shell on my Powerbook and got this: > > 49> c(flux_http_handshake). > *** ERROR: Shell process terminated! *** > Eshell V5.6 (abort with ^G) > 1> > > Is there any reason the shell should crash like this? If I retry the > compilation, it works. > > erl --version gives: > > Erlang (BEAM) emulator version 5.6 [source] [async-threads:0] [hipe] > [kernel-poll:false] > > Eshell V5.6 (abort with ^G) > 1> > > and I am running R12B-0 with patch. > > Ryan > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From gbulmer@REDACTED Sat Dec 22 21:15:43 2007 From: gbulmer@REDACTED (G Bulmer) Date: Sat, 22 Dec 2007 20:15:43 +0000 Subject: [erlang-questions] Announce: Erlang DTrace project proposal at OpenSolaris.org Message-ID: Tim Becker and I have initiated a project to implement Erlang DTrace. We've been setting things up for a week or more. Brian Cantrill at Sun has been supportive of hosting the code at OpenSolaris, and has encouraged us to make a project proposal to opensolaris.org Brian has posted an invitation to vote at: http://www.opensolaris.org/ jive/thread.jspa?threadID=47801&tstart=0 First of all, I hope that no one is offended by my slightly 'marketing' words, It was past midnight when I wrote it, and the project application instructions encouraged me to write a 'sales pitch' to get community support, and attract other developers to join and contribute. I do apologise if you feel it undersells Erlang; that was definitely not my intention. Secondly, the major benefit will come to systems who are using Erlang in an heterogeneous environment with other technologies. Within a pure Erlang environment, there is less benefit. For an example of an heterogeneous technology architecture, consider an application which uses a web browser (executing lots of JavaScript), a web server, an application server, and SQL database. We might like to observe specific 'usecases' end-to-end, to identify latency, or resource usage, or debug a broken query. That is possible with DTrace, but requires quite a lot of skill. It is possible to write a D script to observe and correlate events in the four applications, but, the default DTrace providers observe the binary program. So it can be very difficult to relate function calls in the VM binary code to the Erlang module functions and processes. (I should add DTrace does a good job for most kernel, filesystem and network events) This type of obstacle has been overcome for some of the components an the example, where more helpful, 'application oriented' DTrace probes have been implemented. While some of these may be a bit unpolished, here are some examples: Mozzila have a JavaScript DTrace in the nightly firefox 3 (http:// www.opensolaris.org/os/project/mozilla-dtrace/) Apache web server has a DTrace module (http://prefetch.net/projects/ apache_modtrace/index.html) PostgreSQL has DTrace probes (http://www.postgresql.org/about/press/ presskit82.html.en) Ruby/Java/Python/PHP: http://groups.google.com/group/erlang-dtrace/ web/reference Our hope is that it will be much easier to use DTrace to observe Erlang applications (rather than the Erlang VM) within its complete application and OS environment as a result of this project. We'd be very happy to receive comments, encouragement, assistance, participation or even Christmas presents from the Erlang community :-) Merry Christmas, and Happy New Year, G Bulmer From pat.eyler@REDACTED Sat Dec 22 21:40:17 2007 From: pat.eyler@REDACTED (pat eyler) Date: Sat, 22 Dec 2007 13:40:17 -0700 Subject: [erlang-questions] Announce: Erlang DTrace project proposal at OpenSolaris.org In-Reply-To: References: Message-ID: <6fd0654b0712221240s72d2fak87c4bd878d2ee506@mail.gmail.com> On Dec 22, 2007 1:15 PM, G Bulmer wrote: > Tim Becker and I have initiated a project to implement Erlang DTrace. > We've been setting things up for a week or more. This looks very cool. One suggestion that I'd make is that people look at supporting system tap in parallel. (System tap is a DTrace-like system being developed for Linux, since there are legal issues with getting DTrace running on a Linux system.) > Merry Christmas, and Happy New Year, > G Bulmer > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- thanks, -pate ------------------------- Duty makes us do things, Love make us do things well. http://on-ruby.blogspot.com http://on-erlang.blogspot.com http://on-soccer.blogspot.com From mateuszb@REDACTED Sat Dec 22 22:32:58 2007 From: mateuszb@REDACTED (Mateusz Berezecki) Date: Sat, 22 Dec 2007 22:32:58 +0100 Subject: [erlang-questions] bug: R12B-0 internal consistency check Message-ID: BUG: bitmap: function intersection/4+14: Internal consistency check failed - please report this bug. Instruction: {bs_put_integer,{f,0}, {integer,8}, 1, {field_flags,[unsigned,big]}, {x,5}} Error: {match_context,{x,5}}: WHAT: -module (bitmap). -export ([gen_bit/2]). -export ([intersection/4]). gen_bit(0, Acc) -> Acc; gen_bit(N, Acc) when is_integer(N), N > 0 -> gen_bit(N-1, <>). intersection(<>, <>, K, Acc) -> intersection(<>, <>, K+1, [K|Acc]); intersection(<>, <>, K, Acc) -> intersection(<>, <>, K+1, [K|Acc]); intersection(<<>>,_, _, _) -> []; intersection(_, <<>>, _, _) -> []. HOW: $ erlc bitmap.erl Mateusz Berezecki P.S. Is there any preferred way to do the intersection of 2 bitmaps using new bit syntax ? What I want to achieve is having two bitmaps I want to have a list of integers on which the two bitmaps have the same bits and I want it to be fast. From fredrik.svahn@REDACTED Sat Dec 22 23:02:31 2007 From: fredrik.svahn@REDACTED (Fredrik Svahn) Date: Sat, 22 Dec 2007 23:02:31 +0100 Subject: [erlang-questions] bug: R12B-0 internal consistency check In-Reply-To: References: Message-ID: See http://erlang.org/pipermail/erlang-bugs/2007-December/000569.html Add a TypeSpecifier to get past the compilation error: intersection(<>, <>, K, Acc) -> intersection(<>, <>, K+1, [K|Acc]); intersection(<>, <>, K, Acc) -> intersection(<>, <>, K+1, [K|Acc]); BR /Fredrik On Dec 22, 2007 10:32 PM, Mateusz Berezecki wrote: > BUG: > bitmap: function intersection/4+14: > Internal consistency check failed - please report this bug. > Instruction: {bs_put_integer,{f,0}, > {integer,8}, > 1, > {field_flags,[unsigned,big]}, > {x,5}} > Error: {match_context,{x,5}}: > > > WHAT: > > -module (bitmap). > > -export ([gen_bit/2]). > -export ([intersection/4]). > > gen_bit(0, Acc) -> Acc; > gen_bit(N, Acc) when is_integer(N), N > 0 -> gen_bit(N-1, < binary, (random:uniform(2)-1):1>>). > > intersection(<>, <>, K, Acc) -> > intersection(<>, <>, K+1, [K|Acc]); > > intersection(<>, <>, K, Acc) -> > intersection(<>, <>, K+1, [K|Acc]); > > intersection(<<>>,_, _, _) -> []; > intersection(_, <<>>, _, _) -> []. > > > HOW: > > $ erlc bitmap.erl > > > Mateusz Berezecki > > > P.S. > Is there any preferred way to do the intersection of 2 bitmaps using > new bit syntax ? > > What I want to achieve is having two bitmaps I want to have a list of > integers on which > the two bitmaps have the same bits and I want it to be fast. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mateuszb@REDACTED Sat Dec 22 23:40:15 2007 From: mateuszb@REDACTED (Mateusz Berezecki) Date: Sat, 22 Dec 2007 23:40:15 +0100 Subject: [erlang-questions] bug: R12B-0 internal consistency check In-Reply-To: References: Message-ID: On Dec 22, 2007, at 11:02 PM, Fredrik Svahn wrote: > See http://erlang.org/pipermail/erlang-bugs/2007-December/000569.html > > Add a TypeSpecifier to get past the compilation error: > > intersection(<>, <>, K, Acc) -> > intersection(<>, <>, K+1, [K|Acc]); > > intersection(<>, <>, K, Acc) -> > intersection(<>, <>, K+1, [K|Acc]); > > BR /Fredrik I just got another error: the code is : -module (bitmap). -export ([gen_bit/2]). -export ([intersection/4]). gen_bit(0, Acc) -> Acc; gen_bit(N, Acc) when is_integer(N), N > 0 -> gen_bit(N-1, <>). intersection(<<>>, <<>>, _, Acc) -> Acc; intersection(<>, <>, K, Acc) -> intersection(<>, <>, K+1, [K | Acc]); intersection(<>, <>, K, Acc) -> intersection(<>, <>, K+1, Acc). the error while compiling is: $ erlc bitmap.erl bitmap: function intersection/4+21: Internal consistency check failed - please report this bug. Instruction: {bs_append,{f,0}, {integer,0}, 0,9,1, {x,5}, {field_flags,[]}, {x,0}} Error: {match_context,{x,5}}: It compiles fine when replacing <> to Rest1 and <> to Rest2 Mateusz From gbulmer@REDACTED Sat Dec 22 23:40:48 2007 From: gbulmer@REDACTED (G Bulmer) Date: Sat, 22 Dec 2007 22:40:48 +0000 Subject: [erlang-questions] Announce: Erlang DTrace project proposal at OpenSolaris.org In-Reply-To: <6fd0654b0712221240s72d2fak87c4bd878d2ee506@mail.gmail.com> References: <6fd0654b0712221240s72d2fak87c4bd878d2ee506@mail.gmail.com> Message-ID: Pat Thank you for your encouragement. On 22 Dec 2007, at 20:40, pat eyler wrote: > On Dec 22, 2007 1:15 PM, G Bulmer wrote: >> Tim Becker and I have initiated a project to implement Erlang DTrace. >> We've been setting things up for a week or more. > > This looks very cool. One suggestion that I'd make is that people > look > at supporting system tap in parallel. The only developers right now are Tim and me, unless you join too ;-) Speaking personally, I would prefer to focus on one target at a time. I assume the parts of erts which are modified to support DTrace will be the same for System tap, so it should be straightforward to follow along behind and do System tap afterwards. > (System tap is a DTrace-like system being developed for Linux, ....) I'm not going to get into this comparison :-) Garry From bob@REDACTED Fri Dec 21 11:47:54 2007 From: bob@REDACTED (Bob Cowdery) Date: Fri, 21 Dec 2007 10:47:54 +0000 Subject: [erlang-questions] program: wxWidgets for erlang (again) In-Reply-To: <476A8B5E.8080000@erix.ericsson.se> References: <4684C2D6.7010707@erix.ericsson.se> <4684F78A.9010202@gmail.com> <468504CD.2080506@erix.ericsson.se> <476A8B5E.8080000@erix.ericsson.se> Message-ID: <1198234074.5543.10.camel@ubuntu-life-vm> Dan This looks really good. I have quite a large Swing GUI that I would like to convert. I wonder are there any getting started guides. I did find a PDF but it was for an earlier version as the API was completely different. I'm running XP and have it all loaded except I'm clearly doing something (or many things) wrong. At the moment I can't get as far showing a frame! If I do something like. wx:new(). F = wxFrame:new(). wxFrame:show(F). It throws an invalid argument exception. I tried various other things but just got different results. Any help in getting off the ground appreciated. The other thing I noticed is that after starting 'erl -smp' it no longer shuts down cleanly with Ctrl'C' but brings up a debug window. Thanks Bob On Thu, 2007-12-20 at 16:33 +0100, Dan Gudmundsson wrote: > Hi > > I've made a new beta release: see wxerlang.sf.net > > It requires R12B and wxWidgets-2.8. > (which is statically linked in the pre-built version for mac and windows) > > Windows is now working, Solaris-10, Mac and Linux is also working!! > > I've added support for xrc and a demo, which is wxwidgets support for > gui-builders, are you happy now Mats? > You still have write some code though, I haven't written an erlang code > generator yet :-) > > Hopefully this release is more stable, I haven't added so much new > functionality. At least the previous reported bug is fixed (in the > emulator). > > Feedback and/or patches are appreciated. I had a hundred downloads of > the previous release. So tell me if worked or was complete trash what do > you think about the api-mapping. > > /Dan > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From msciab@REDACTED Sun Dec 23 14:44:58 2007 From: msciab@REDACTED (Michele Sciabarra) Date: Sun, 23 Dec 2007 14:44:58 +0100 Subject: [erlang-questions] Json for Erlang? Message-ID: <476E665A.9080804@eprometeus.com> Looking for a JSon implementation for Erlang, I have found a post in this list about a release of a similar code in January 2006. This release Google says it should be hosted in the site Erlang-Projects, but trying to access it I consistently get Bad Gateway... Any hint about how to get that code? From martin.beck@REDACTED Sun Dec 23 16:11:57 2007 From: martin.beck@REDACTED (Martin Beck) Date: Sun, 23 Dec 2007 16:11:57 +0100 Subject: [erlang-questions] clarify: Process Garbage Collection Message-ID: <476E7ABD.90507@hpi.uni-potsdam.de> Hi, while digging through some Erlang and Actor Model documentation I came to the question whether unused processes will be garbage collected. E.g. a process I don't have any reference to anymore and which is blocked waiting for messages, will it sit around in my ram or will it get deleted by the Erlang VM? The paper which leaded me to this question was "Garbage collection of actors" by Kafura, Washabaugh, Nelson 1990. regards, Martin From bob@REDACTED Sun Dec 23 16:23:15 2007 From: bob@REDACTED (Bob Ippolito) Date: Sun, 23 Dec 2007 07:23:15 -0800 Subject: [erlang-questions] Json for Erlang? In-Reply-To: <476E665A.9080804@eprometeus.com> References: <476E665A.9080804@eprometeus.com> Message-ID: <6a36e7290712230723i612d3e3eg481ca90619b7e0ec@mail.gmail.com> On 12/23/07, Michele Sciabarra wrote: > Looking for a JSon implementation for Erlang, I have found a post in > this list about a release of a similar code in January 2006. > > This release Google says it should be hosted in the site > Erlang-Projects, but trying to access it I consistently get Bad Gateway... > > Any hint about how to get that code? You probably don't want it, there's JSON implementation in mochiweb: http://mochiweb.com/ There's two actually, mochijson and mochijson2. mochijson2 uses binaries for strings so it doesn't require lists to be tuple tagged. -bob From daniel.goertzen@REDACTED Sun Dec 23 16:37:25 2007 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Sun, 23 Dec 2007 09:37:25 -0600 Subject: [erlang-questions] R12B documentation error Message-ID: In the file erl5.6/erts-5.6/doc/html/erl_ext_dist.html, the types SMALL_BIG_EXT and LARGE_BIG_EXT both list an id of 110. I think LARGE_BIG_EXT is really 111. I like the html file, much nicer to read than than the plain text file from R11. :) Cheers, Dan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sascha.matzke@REDACTED Sun Dec 23 17:08:03 2007 From: sascha.matzke@REDACTED (Sascha Matzke) Date: Sun, 23 Dec 2007 17:08:03 +0100 Subject: [erlang-questions] Json for Erlang? In-Reply-To: <476E665A.9080804@eprometeus.com> References: <476E665A.9080804@eprometeus.com> Message-ID: Hi, I was looking for a JSON implementation for Erlang too. I found this one: http://www.lshift.net/~tonyg/erlang-rfc4627/ Sascha On Dec 23, 2007 2:44 PM, Michele Sciabarra wrote: > Looking for a JSon implementation for Erlang, I have found a post in > this list about a release of a similar code in January 2006. > > This release Google says it should be hosted in the site > Erlang-Projects, but trying to access it I consistently get Bad Gateway... > > Any hint about how to get that code? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chsu79@REDACTED Sun Dec 23 17:08:28 2007 From: chsu79@REDACTED (Christian S) Date: Sun, 23 Dec 2007 17:08:28 +0100 Subject: [erlang-questions] clarify: Process Garbage Collection In-Reply-To: <476E7ABD.90507@hpi.uni-potsdam.de> References: <476E7ABD.90507@hpi.uni-potsdam.de> Message-ID: They will not be garbage collected. It is quite difficult to define what an unused property means for a process, and if one do, it will be expensive to find pid references to the process, as the whole cluster needs to be scanned, processes, ets tables and probably more. On Dec 23, 2007 4:11 PM, Martin Beck wrote: > Hi, > while digging through some Erlang and Actor Model documentation I came > to the question whether unused processes will be garbage collected. E.g. > a process I don't have any reference to anymore and which is blocked > waiting for messages, will it sit around in my ram or will it get > deleted by the Erlang VM? From msciab@REDACTED Sun Dec 23 17:49:31 2007 From: msciab@REDACTED (Michele Sciabarra) Date: Sun, 23 Dec 2007 17:49:31 +0100 Subject: [erlang-questions] Json for Erlang? In-Reply-To: <6a36e7290712230723i612d3e3eg481ca90619b7e0ec@mail.gmail.com> References: <476E665A.9080804@eprometeus.com> <6a36e7290712230723i612d3e3eg481ca90619b7e0ec@mail.gmail.com> Message-ID: <476E919B.6050801@eprometeus.com> Bob Ippolito ha scritto: > On 12/23/07, Michele Sciabarra wrote: > >> Looking for a JSon implementation for Erlang, I have found a post in >> this list about a release of a similar code in January 2006. >> >> This release Google says it should be hosted in the site >> Erlang-Projects, but trying to access it I consistently get Bad Gateway... >> >> Any hint about how to get that code? >> > > You probably don't want it, there's JSON implementation in mochiweb: > http://mochiweb.com/ > > There's two actually, mochijson and mochijson2. mochijson2 uses > binaries for strings so it doesn't require lists to be tuple tagged. > I downloaded and installed it, but I cannot find any example... Because you are also the author of mochikit ajax javascript library I was wondering if there is somewhere a simple demo application to show how to implement an ajax application using mochiweb and mochikit. -------------- next part -------------- An HTML attachment was scrubbed... URL: From msciab@REDACTED Sun Dec 23 18:04:05 2007 From: msciab@REDACTED (Michele Sciabarra) Date: Sun, 23 Dec 2007 18:04:05 +0100 Subject: [erlang-questions] Json for Erlang? In-Reply-To: References: <476E665A.9080804@eprometeus.com> Message-ID: <476E9505.1070609@eprometeus.com> To be complete in this overview, there is also a JSON implementation in the yaws Web Server. BTW, the yaws version 1.73 is not working for me on the OSX with R12B, but the subversion trunk from the sourceforge repository does. /\/\ike Sascha Matzke ha scritto: > Hi, > > I was looking for a JSON implementation for Erlang too. I found this one: > > http://www.lshift.net/~tonyg/erlang-rfc4627/ > > > Sascha > > On Dec 23, 2007 2:44 PM, Michele Sciabarra < msciab@REDACTED > > wrote: > > Looking for a JSon implementation for Erlang, I have found a post in > this list about a release of a similar code in January 2006. > > This release Google says it should be hosted in the site > Erlang-Projects, but trying to access it I consistently get Bad > Gateway... > > Any hint about how to get that code? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From dizzyd@REDACTED Sun Dec 23 18:34:28 2007 From: dizzyd@REDACTED (Dave Smith) Date: Sun, 23 Dec 2007 10:34:28 -0700 Subject: [erlang-questions] R12B documentation error In-Reply-To: References: Message-ID: I'll second Dan's feelings on the HTML docs for R12 -- looks sharp and reads well. Thanks to all involved with that change. :) D. On Dec 23, 2007 8:37 AM, Daniel Goertzen wrote: > In the file erl5.6/erts-5.6/doc/html/erl_ext_dist.html, the types > SMALL_BIG_EXT and LARGE_BIG_EXT both list an id of 110. > > I think LARGE_BIG_EXT is really 111. > > I like the html file, much nicer to read than than the plain text file from > R11. :) > > Cheers, > Dan. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bob@REDACTED Sun Dec 23 18:51:01 2007 From: bob@REDACTED (Bob Ippolito) Date: Sun, 23 Dec 2007 09:51:01 -0800 Subject: [erlang-questions] Json for Erlang? In-Reply-To: <476E919B.6050801@eprometeus.com> References: <476E665A.9080804@eprometeus.com> <6a36e7290712230723i612d3e3eg481ca90619b7e0ec@mail.gmail.com> <476E919B.6050801@eprometeus.com> Message-ID: <6a36e7290712230951o2e4f694eh5345c29daeca4fd3@mail.gmail.com> On 12/23/07, Michele Sciabarra wrote: > > Bob Ippolito ha scritto: > On 12/23/07, Michele Sciabarra wrote: > > > Looking for a JSon implementation for Erlang, I have found a post in > this list about a release of a similar code in January 2006. > > This release Google says it should be hosted in the site > Erlang-Projects, but trying to access it I consistently get Bad Gateway... > > Any hint about how to get that code? > > You probably don't want it, there's JSON implementation in mochiweb: > http://mochiweb.com/ > > There's two actually, mochijson and mochijson2. mochijson2 uses > binaries for strings so it doesn't require lists to be tuple tagged. > > I downloaded and installed it, but I cannot find any example... > Because you are also the author of mochikit ajax javascript library I was > wondering if there is somewhere a simple demo application to show how to > implement an ajax application using mochiweb and mochikit. You asked for a JSON implementation, not a web server. Using mochijson is just a matter of calling it like any other module. The only other module it depends on is mochinum for the number formatting. mochiweb is more of a toolkit for building web servers than what you're looking for, we don't build ajax applications with it, we build high volume services with it. They don't normally even serve HTML pages. The only "example" really is here: http://bob.pythonmac.org/archives/2007/12/17/using-the-mochiweb-project-skeleton/ -bob From ulf@REDACTED Sun Dec 23 19:33:36 2007 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 23 Dec 2007 19:33:36 +0100 Subject: [erlang-questions] clarify: Process Garbage Collection In-Reply-To: <476E7ABD.90507@hpi.uni-potsdam.de> References: <476E7ABD.90507@hpi.uni-potsdam.de> Message-ID: <8209f740712231033v5756aaf8r770b9c06a8b6f22e@mail.gmail.com> The process will have a reference to itself, and has an independent thread. If the thread of execution terminates, either through an explicit exit() (or error()), or if a function returns rather than calling another function, or recursively calling itself, then the process is garbage collected, even if there happen to be other processes holding references to the pid. BR, Ulf W 2007/12/23, Martin Beck : > Hi, > while digging through some Erlang and Actor Model documentation I came > to the question whether unused processes will be garbage collected. E.g. > a process I don't have any reference to anymore and which is blocked > waiting for messages, will it sit around in my ram or will it get > deleted by the Erlang VM? > > The paper which leaded me to this question was "Garbage collection of > actors" by Kafura, Washabaugh, Nelson 1990. > > regards, > Martin > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From jim@REDACTED Sun Dec 23 23:47:38 2007 From: jim@REDACTED (Jim Larson) Date: Sun, 23 Dec 2007 14:47:38 -0800 Subject: [erlang-questions] Amazon AWS SimpleDB based on erlang now in beta In-Reply-To: Your message of "Fri, 14 Dec 2007 03:47:40 PST." <47626D5C.7040507@itsbeen.sent.com> Message-ID: <200712232247.lBNMlcph073079@krumkake.jetcafe.org> In message <47626D5C.7040507@REDACTED> you write: >I was wondering if anyone has tried this or if now that it is out if any of >the team who created can give us some insights (for example how big is "large >data sets", etc): I've been off the team for three months now, so my information isn't fresh, and in any event I can't say much more than what's in the Amazon press release. I will note that everyone seems to understand the right usage model - put your bulk data in S3 and indexable metadata in SimpleDB. I've seen a few blog entries stating disappointment that SimpleDB doesn't have full text search capabilities, which completely misunderstands the abstraction level that SimpleDB is working at. One could build an appropriate full text search facility on top of SimpleDB, with SimpleDB storing the inverted index. For any serious use you'd want application-specific logic in your search anyhow, so you're not missing much by not having it built-in. Jim Larson From jim@REDACTED Sun Dec 23 23:48:16 2007 From: jim@REDACTED (Jim Larson) Date: Sun, 23 Dec 2007 14:48:16 -0800 Subject: [erlang-questions] Json for Erlang? In-Reply-To: Your message of "Sun, 23 Dec 2007 14:44:58 +0100." <476E665A.9080804@eprometeus.com> Message-ID: <200712232248.lBNMmGph073085@krumkake.jetcafe.org> In message <476E665A.9080804@REDACTED> you write: >Looking for a JSon implementation for Erlang, I have found a post in >this list about a release of a similar code in January 2006. > >This release Google says it should be hosted in the site >Erlang-Projects, but trying to access it I consistently get Bad Gateway... > >Any hint about how to get that code? I've been getting the bad gateway error for the last week too. There's a copy available at http://paste.lisp.org/display/48077 I'll also put up a copy on my home page soon. The yaws version is derived from our original version, with modifications to the Erlang encoding. The lshift version is of independent heritage. It requires a full JSON term to be available, whereas the above versions can parse json terms across several chunks of input, for use in the middle-man pattern if there's no other framing available. The lshift version might be faster - I've never done the experiment. Here are the encodings that the various versions use: JSON json v1 json v2 rfc4627 (A2Z) (Yaws) (lshift) - ----- ----- ----- ----- number number number number string string (list) string (list) binary array tuple tagged list list object tagged proplist tagged proplist tagged proplist bool, null atoms atoms atoms They're all roughly equivalent, so choose the one with the best match for the types you'll be encoding/decoding. It's super-handy if you pick an encoding that doesn't require further translation from an "external" to an "internal" Erlang data structure. And if none of the above fit your need, it's quite easy to roll your own. Jim Larson From jim@REDACTED Sun Dec 23 23:46:34 2007 From: jim@REDACTED (Jim Larson) Date: Sun, 23 Dec 2007 14:46:34 -0800 Subject: [erlang-questions] Amazon AWS SimpleDB based on erlang now in beta In-Reply-To: Your message of "Sun, 16 Dec 2007 23:36:58 PST." <235408.4321197877018496.JavaMail.root@ly.sdf.com> Message-ID: <200712232246.lBNMkZph073073@krumkake.jetcafe.org> In message <235408.4321197877018496.JavaMail.root@REDACTED> Tom Samplonius writes: > I don't know where people are getting "large datasets" from. Amazon says: > >"Amazon SimpleDB is designed to store relatively small amounts of data and is >optimized for fast data access and flexibility in how that data is expressed." > >So "relatively small amounts of data". This refers to the data (attributes/values) in a particular item. You can have a large amount of data, total, in a domain (10 GB currently, and much, much larger eventually), and you can also have your data spread across multiple domains, though at the hassle of multiplexing your own cross-domain queries. Jim Larson From vances@REDACTED Mon Dec 24 04:32:14 2007 From: vances@REDACTED (Vance Shipley) Date: Sun, 23 Dec 2007 22:32:14 -0500 Subject: [erlang-questions] OS X gs windows display only after selecting In-Reply-To: <20071126165233.GA226@little-black-book.motivity.ca> References: <20071126165233.GA226@little-black-book.motivity.ca> Message-ID: <20071224033213.GF1590@little-black-book.motivity.ca> Folks, I'm happy to report that this problem seems to have dissappeared (after several years) with the introduction of Tcl/Tk version 8.5.0 released a couple days ago. I installed ActiveTcl's binary package for OS X and it all works perfectly (ASFAIK). On Mon, Nov 26, 2007 at 12:53:05PM -0400, Vance Shipley wrote: } Is anyone else using gs applications such as the debugger or et } on OS X (native not X11) and do you notice that certain windows } do not display until you select them? It's becoming annoying } enough that I'm going to have to track down what is wrong but I } thought I'd ask first in case anyone else has tried. Once I started delving into this I realized I had tried to tackle this once before back in 2004 on a different machine with an earlier version of the OS (Panther): http://www1.erlang.org/pipermail/erlang-questions/2004-February/011483.html Just for the record, to help any future googlers, here is what I found. I enabled DEBUG tracing in the gs port driver: $ erlc -DDEBUG -I lib/erlang/lib/gs-1.5.7/src gstk_port_handler.erl In the trace you can see that the aplication requests configuration events with "bind .w1 ". These will cause the driver to send {80,"co",[Width,Height,X,Y]} to the port. With Tcl/Tk v8.4.7 (native OS X Tiger): DBG: OUTPUT[port]: erlexec {toplevel .w1 -cur top_left_arrow;bind .w1 {if {"%W"==".w1"} {erlsend #80 d}};wm withdraw .w1;wm title .w1 "APPMON: Overview on nonode@REDACTED";update idletasks;wm ge .w1 520x170;update idletasks;;bind .w1 {if {"%W"==".w1"} {erlsend #80 co %w %h %x %y}}} DBG: idle DBG: OUTPUT[port]: erlcall {so_create canvas .w1.c1} DBG: idle DBG: INPUT[port]: \001#80 co 1 1 65 105 DBG: Event = {80,"co",[1,1,65,105]} DBG: idle DBG: INPUT[port]: \002.w1.c1 DBG: idle DBG: call reply: ".w1.c1" We receive a configuration event with Width=1 and Height=1. Not good. With Tcl/Tk v8.5.0: DBG: OUTPUT[port]: erlexec {toplevel .w1 -cur top_left_arrow;bind .w1 {if {"%W"==".w1"} {erlsend #80 d}};wm withdraw .w1;wm title .w1 "APPMON: Overview on nonode@REDACTED";update idletasks;wm ge .w1 520x170;update idletasks;;bind .w1 {if {"%W"==".w1"} {erlsend #80 co %w %h %x %y}}} DBG: idle DBG: OUTPUT[port]: erlcall {so_create canvas .w1.c1} DBG: idle DBG: INPUT[port]: \001#80 co 1 1 35 123 DBG: Event = {80,"co",[1,1,35,123]} DBG: idle DBG: INPUT[port]: \001#80 co 520 170 35 123 DBG: Event = {80,"co",[520,170,35,123]} DBG: idle DBG: INPUT[port]: \002.w1.c1 DBG: idle DBG: call reply: ".w1.c1" With the newer version of Tcl/Tk we received the same lame configuration event however it is immediately followed by a correct one. Much better, now our window is displayed properly. -Vance From david.hopwood@REDACTED Mon Dec 24 05:55:31 2007 From: david.hopwood@REDACTED (David Hopwood) Date: Mon, 24 Dec 2007 04:55:31 +0000 Subject: [erlang-questions] clarify: Process Garbage Collection In-Reply-To: <476E7ABD.90507@hpi.uni-potsdam.de> References: <476E7ABD.90507@hpi.uni-potsdam.de> Message-ID: <476F3BC3.2030107@industrial-designers.co.uk> Martin Beck wrote: > Hi, > while digging through some Erlang and Actor Model documentation I came > to the question whether unused processes will be garbage collected. The short answer is no. See the thread at . -- David Hopwood From tonyg@REDACTED Mon Dec 24 12:42:18 2007 From: tonyg@REDACTED (Tony Garnock-Jones) Date: Mon, 24 Dec 2007 11:42:18 +0000 Subject: [erlang-questions] Json for Erlang? In-Reply-To: <200712232248.lBNMmGph073085@krumkake.jetcafe.org> References: <200712232248.lBNMmGph073085@krumkake.jetcafe.org> Message-ID: <476F9B1A.8030508@lshift.net> Jim Larson wrote: > They're all roughly equivalent, so choose the one with the best > match for the types you'll be encoding/decoding. It's super-handy > if you pick an encoding that doesn't require further translation > from an "external" to an "internal" Erlang data structure. If unicode is important to your JSON application, we've tried pretty hard to make sure we get the utf8/16/32 translations right in the rfc4627.erl codec. Strings are represented as binaries in UTF-8 encoding, no matter the encoding of the JSON source. Regards, Tony -- [][][] Tony Garnock-Jones | Mob: +44 (0)7905 974 211 [][] LShift Ltd | Tel: +44 (0)20 7729 7060 [] [] http://www.lshift.net/ | Email: tonyg@REDACTED From msciab@REDACTED Mon Dec 24 13:18:51 2007 From: msciab@REDACTED (Michele Sciabarra) Date: Mon, 24 Dec 2007 13:18:51 +0100 Subject: [erlang-questions] Ajax in Erlang, anyone? Message-ID: <476FA3AB.203@eprometeus.com> Thank you to all for the overwhelming flood of informations about how to do json in Erlang. Actually, I am exploring Erlang to build Ajax applications, and my impressions are similar to those expressed in the lshift blog entry regarding their Ajax jukebox: >Erlang made a great platform for the server side of the application. Its support for clean, simple concurrency let me design the >program in a very natural way. I have not yet read the code for the jukebox application, that is the only sample ajax application I have found, but I am planning to do. My feeling is that an ajax application can be very simple and elegant in Erlang, just declaring the functions required, connect to the ajax application following some conventions, and provide data as tuples and lists that can be converted to JSON in a very natural way. However, the only simple ajax example I have found is the yaws json example, And it looked me very complex and innatural: http://yaws.hyber.org/json_intro.yaws Has anyone had experiences and examples about ajax in erlang to share? For examples, which fondation javascript library do you feel is the best to use? The example ajax jukebox uses Prototipe, but I was under the impression that the pythonic/functional nature of Mochikit could be more appropriate for Erlang. However also jQuery has a functional nature... From tonyg@REDACTED Mon Dec 24 13:55:45 2007 From: tonyg@REDACTED (Tony Garnock-Jones) Date: Mon, 24 Dec 2007 12:55:45 +0000 Subject: [erlang-questions] Ajax in Erlang, anyone? In-Reply-To: <476FA3AB.203@eprometeus.com> References: <476FA3AB.203@eprometeus.com> Message-ID: <476FAC51.8040608@lshift.net> Michele Sciabarra wrote: > Has anyone had experiences and examples about ajax in erlang to share? I wrote the LShift erlang-jukebox. We started with Yaws, and switched to built-in inets httpd plus mod_jsonrpc (which comes with rfc4627) for the second release. There's a demo AJAX application in the erlang-rfc4627 module, in test/test_jsonrpc.erl. Please see http://www.lshift.net/~tonyg/erlang-rfc4627/doc/mod_jsonrpc.html for documentation. In particular, http://www.lshift.net/~tonyg/erlang-rfc4627/doc/mod_jsonrpc.html#running-the-example shows you how to get the demo running. Just briefly, JSON-RPC services are regular gen_servers, which are gen_server:call'd with {jsonrpc, MethodNameBinary, _InetsHttpdModData, JsonParameterList} On the client side, usually something as simple as var client = new JsonRpcService("http://localhost:5671/rpc/test", onReady); is enough to get access to the methods of the JSON-RPC service. For more detail, see http://www.lshift.net/~tonyg/erlang-rfc4627/doc/mod_jsonrpc.html#implementing http://www.lshift.net/~tonyg/erlang-rfc4627/doc/mod_jsonrpc.html#invoking-js as well as the code itself, namely http://www.lshift.net/~tonyg/erlang-rfc4627/test/test_jsonrpc.erl http://www.lshift.net/~tonyg/erlang-rfc4627/test/server_root/htdocs/test-client.js Regards, Tony -- [][][] Tony Garnock-Jones | Mob: +44 (0)7905 974 211 [][] LShift Ltd | Tel: +44 (0)20 7729 7060 [] [] http://www.lshift.net/ | Email: tonyg@REDACTED From rsaccon@REDACTED Mon Dec 24 14:07:55 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Mon, 24 Dec 2007 11:07:55 -0200 Subject: [erlang-questions] Ajax in Erlang, anyone? In-Reply-To: <476FA3AB.203@eprometeus.com> References: <476FA3AB.203@eprometeus.com> Message-ID: AFAIK, there is no GWT-like tool in Erlang. Look for tercio, that's an alpha-state Erlang web framework with probably the tightest JavaScript integration you can currently get in Erlang. But in my opinion you should keep things separate, unless you like a mess like server side generated JavaScript snippets as in Rails. On Dec 24, 2007 10:18 AM, Michele Sciabarra wrote: > Thank you to all for the overwhelming flood of informations about how > to do json in Erlang. > > Actually, I am exploring Erlang to build Ajax applications, and my > impressions are similar to those expressed in the lshift blog entry > regarding their Ajax jukebox: > > >Erlang made a great platform for the server side of the application. > Its support for clean, simple concurrency let me design the >program in > a very natural way. > > I have not yet read the code for the jukebox application, that is the > only sample ajax application I have found, but I am planning to do. > > My feeling is that an ajax application can be very simple and elegant in > Erlang, just declaring the functions required, connect to the ajax > application following some conventions, and provide data as tuples and > lists that can be converted to JSON in a very natural way. > > However, the only simple ajax example I have found is the yaws json > example, And it looked me very complex and innatural: > > http://yaws.hyber.org/json_intro.yaws > > Has anyone had experiences and examples about ajax in erlang to share? > > For examples, which fondation javascript library do you feel is the best > to use? The example ajax jukebox uses Prototipe, but I was under the > impression that the pythonic/functional nature of Mochikit could be > more appropriate for Erlang. However also jQuery has a functional nature... > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- Roberto Saccon http://rsaccon.com From bob@REDACTED Mon Dec 24 16:40:04 2007 From: bob@REDACTED (Bob Ippolito) Date: Mon, 24 Dec 2007 10:40:04 -0500 Subject: [erlang-questions] Json for Erlang? In-Reply-To: <476F9B1A.8030508@lshift.net> References: <200712232248.lBNMmGph073085@krumkake.jetcafe.org> <476F9B1A.8030508@lshift.net> Message-ID: <6a36e7290712240740n15ea5bacj39e2473f1d72e61@mail.gmail.com> On 12/24/07, Tony Garnock-Jones wrote: > Jim Larson wrote: > > They're all roughly equivalent, so choose the one with the best > > match for the types you'll be encoding/decoding. It's super-handy > > if you pick an encoding that doesn't require further translation > > from an "external" to an "internal" Erlang data structure. > > If unicode is important to your JSON application, we've tried pretty > hard to make sure we get the utf8/16/32 translations right in the > rfc4627.erl codec. Strings are represented as binaries in UTF-8 > encoding, no matter the encoding of the JSON source. > In my experience it's pretty rare for the input encoding to be anything but UTF-8 or ASCII. It's normally the client side which is the problem, which is why the encoders I've written all spit out ASCII with escaped unicode by default. -bob From mike.shaver@REDACTED Mon Dec 24 17:21:57 2007 From: mike.shaver@REDACTED (Mike Shaver) Date: Mon, 24 Dec 2007 11:21:57 -0500 Subject: [erlang-questions] Json for Erlang? In-Reply-To: <6a36e7290712240740n15ea5bacj39e2473f1d72e61@mail.gmail.com> References: <200712232248.lBNMmGph073085@krumkake.jetcafe.org> <476F9B1A.8030508@lshift.net> <6a36e7290712240740n15ea5bacj39e2473f1d72e61@mail.gmail.com> Message-ID: On Dec 24, 2007 10:40 AM, Bob Ippolito wrote: > In my experience it's pretty rare for the input encoding to be > anything but UTF-8 or ASCII. It's normally the client side which is > the problem, which is why the encoders I've written all spit out ASCII > with escaped unicode by default. Indeed, the JSON RFC requires that the encoding be ASCII, with \uXXXX used for non-ASCII characters in the BMP and a combining sequence for the rest. (RFC 4627 S 2.5) Mike From bob@REDACTED Mon Dec 24 17:44:16 2007 From: bob@REDACTED (Bob Ippolito) Date: Mon, 24 Dec 2007 11:44:16 -0500 Subject: [erlang-questions] Json for Erlang? In-Reply-To: References: <200712232248.lBNMmGph073085@krumkake.jetcafe.org> <476F9B1A.8030508@lshift.net> <6a36e7290712240740n15ea5bacj39e2473f1d72e61@mail.gmail.com> Message-ID: <6a36e7290712240844n62846f3ic16e9c5e5e11bf1d@mail.gmail.com> On 12/24/07, Mike Shaver wrote: > On Dec 24, 2007 10:40 AM, Bob Ippolito wrote: > > In my experience it's pretty rare for the input encoding to be > > anything but UTF-8 or ASCII. It's normally the client side which is > > the problem, which is why the encoders I've written all spit out ASCII > > with escaped unicode by default. > > Indeed, the JSON RFC requires that the encoding be ASCII, with \uXXXX > used for non-ASCII characters in the BMP and a combining sequence for > the rest. > > (RFC 4627 S 2.5) That's not what the RFC says. "All Unicode characters may be placed within the quotation marks except for the characters that must be escaped". -bob From mike.shaver@REDACTED Mon Dec 24 17:47:28 2007 From: mike.shaver@REDACTED (Mike Shaver) Date: Mon, 24 Dec 2007 11:47:28 -0500 Subject: [erlang-questions] Json for Erlang? In-Reply-To: <6a36e7290712240844n62846f3ic16e9c5e5e11bf1d@mail.gmail.com> References: <200712232248.lBNMmGph073085@krumkake.jetcafe.org> <476F9B1A.8030508@lshift.net> <6a36e7290712240740n15ea5bacj39e2473f1d72e61@mail.gmail.com> <6a36e7290712240844n62846f3ic16e9c5e5e11bf1d@mail.gmail.com> Message-ID: On Dec 24, 2007 11:44 AM, Bob Ippolito wrote: > On 12/24/07, Mike Shaver wrote: > > Indeed, the JSON RFC requires that the encoding be ASCII, with \uXXXX > > used for non-ASCII characters in the BMP and a combining sequence for > > the rest. > > > > (RFC 4627 S 2.5) > > That's not what the RFC says. > > "All Unicode characters may be placed within the quotation marks > except for the characters that must be escaped". Ahem, quite so. Mike (for Christmas, I would like some improved literacy skills) From sunyin51@REDACTED Mon Dec 24 16:42:10 2007 From: sunyin51@REDACTED (yin sun) Date: Mon, 24 Dec 2007 10:42:10 -0500 Subject: [erlang-questions] Ajax in Erlang, anyone? In-Reply-To: References: <476FA3AB.203@eprometeus.com> Message-ID: <8196381f0712240742w73d819b0k16bcc87394be62c4@mail.gmail.com> Jungerl has a very simple js example, it integrates with YAWS and generate client js from erlang code in server. /Yin On Dec 24, 2007 8:07 AM, Roberto Saccon wrote: > AFAIK, there is no GWT-like tool in Erlang. Look for tercio, that's > an alpha-state Erlang web framework with probably the tightest > JavaScript integration you can currently get in Erlang. But in my > opinion you should keep things separate, unless you like a mess like > server side generated JavaScript snippets as in Rails. > > > On Dec 24, 2007 10:18 AM, Michele Sciabarra wrote: > > Thank you to all for the overwhelming flood of informations about how > > to do json in Erlang. > > > > Actually, I am exploring Erlang to build Ajax applications, and my > > impressions are similar to those expressed in the lshift blog entry > > regarding their Ajax jukebox: > > > > >Erlang made a great platform for the server side of the application. > > Its support for clean, simple concurrency let me design the >program in > > a very natural way. > > > > I have not yet read the code for the jukebox application, that is the > > only sample ajax application I have found, but I am planning to do. > > > > My feeling is that an ajax application can be very simple and elegant in > > Erlang, just declaring the functions required, connect to the ajax > > application following some conventions, and provide data as tuples and > > lists that can be converted to JSON in a very natural way. > > > > However, the only simple ajax example I have found is the yaws json > > example, And it looked me very complex and innatural: > > > > http://yaws.hyber.org/json_intro.yaws > > > > Has anyone had experiences and examples about ajax in erlang to share? > > > > For examples, which fondation javascript library do you feel is the best > > to use? The example ajax jukebox uses Prototipe, but I was under the > > impression that the pythonic/functional nature of Mochikit could be > > more appropriate for Erlang. However also jQuery has a functional nature... > > > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://www.erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > Roberto Saccon > http://rsaccon.com > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > From bhatti_shahzad@REDACTED Mon Dec 24 17:41:34 2007 From: bhatti_shahzad@REDACTED (shahzad bhatti) Date: Mon, 24 Dec 2007 08:41:34 -0800 (PST) Subject: [erlang-questions] GMT difference with DST Message-ID: <313406.60375.qm@web81111.mail.mud.yahoo.com> I am looking for a built-in function to calculate difference between local time and UTC including any day light savings time. Can someone help with this. Thanks. --------------------------------- Never miss a thing. Make Yahoo your homepage. -------------- next part -------------- An HTML attachment was scrubbed... URL: From per@REDACTED Mon Dec 24 21:20:52 2007 From: per@REDACTED (Per Hedeland) Date: Mon, 24 Dec 2007 21:20:52 +0100 (CET) Subject: [erlang-questions] GMT difference with DST In-Reply-To: <313406.60375.qm@web81111.mail.mud.yahoo.com> Message-ID: <200712242020.lBOKKqPK025694@pluto.hedeland.org> shahzad bhatti wrote: > >I am looking for a built-in function to calculate difference between >local time and UTC including any day light savings time. Can someone >help with this. Thanks. 1> UTC = calendar:universal_time(). {{2007,12,24},{20,13,5}} 2> Local = calendar:universal_time_to_local_time(UTC). {{2007,12,24},{21,13,5}} 3> Diff = calendar:datetime_to_gregorian_seconds(Local) - calendar:datetime_to_gregorian_seconds(UTC). 3600 Note that it isn't always possible to find the diff if you're starting with a given local time - see the documentation for local_time_to_universal_time_dst/1 in calendar(3). --Per Hedeland From kenneth.lundin@REDACTED Wed Dec 26 08:23:09 2007 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Wed, 26 Dec 2007 08:23:09 +0100 Subject: [erlang-questions] TEST Message-ID: TEST From sergey@REDACTED Wed Dec 26 23:09:22 2007 From: sergey@REDACTED (Sergey Samokhin) Date: Wed, 26 Dec 2007 14:09:22 -0800 Subject: [erlang-questions] ODBC support doesn't work correctly in Erlang R12B :( Message-ID: <4772D112.8030900@madgroup.ru> Hello. When I was trying to test my ODBC connection with Erlang R12B I saw these strange error message: ============================================ Erlang (BEAM) emulator version 5.6 [source] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.6 (abort with ^G) 1> odbc:connect("DSN=ejabberd;UID=root;PWD=password", [{scrollable_cursors, off}]). {error,odbc_not_started} ============================================ But it works properly with R11B.5 with the same configs and software (except Erlang)! ============================================ Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.5.5 (abort with ^G) 1> odbc:connect("DSN=ejabberd;UID=root;PWD=password", [{scrollable_cursors, off}]). =INFO REPORT==== 25-Dec-2007::17:41:34 === The odbc application was not started. Has now been started as a temporary application. {ok,<0.38.0>} ============================================ I use: Archlinux current myodbc 3.51.17-1 unixodbc 2.2.12-1 Also I tried to do the same at FreeBSD 6.2 and I saw the same error message. odbc.ini: [ejabberd] Description = MySQL database test Driver = /usr/lib/libmyodbc.so Server = localhost Database = ejabberd Port = Socket = /tmp/mysql.sock Option = Stmt = Best regards. From sgolovan@REDACTED Wed Dec 26 12:59:19 2007 From: sgolovan@REDACTED (Sergei Golovan) Date: Wed, 26 Dec 2007 14:59:19 +0300 Subject: [erlang-questions] ODBC support doesn't work correctly in Erlang R12B :( In-Reply-To: <4772D112.8030900@madgroup.ru> References: <4772D112.8030900@madgroup.ru> Message-ID: On 12/27/07, Sergey Samokhin wrote: > Hello. > > When I was trying to test my ODBC connection with Erlang R12B I saw > these strange error message: > > ============================================ > Erlang (BEAM) emulator version 5.6 [source] [async-threads:0] [hipe] > [kernel-poll:false] > > Eshell V5.6 (abort with ^G) > 1> odbc:connect("DSN=ejabberd;UID=root;PWD=password", > [{scrollable_cursors, off}]). > {error,odbc_not_started} odbc application doesn't start automagically anymore. Read OTP-6984 item in http://www.erlang.org/download/otp_src_R12B-0.readme. To start it use application:start(odbc). -- Sergei Golovan From ft27h@REDACTED Wed Dec 26 18:38:20 2007 From: ft27h@REDACTED (Frank) Date: Wed, 26 Dec 2007 18:38:20 +0100 (CET) Subject: [erlang-questions] HiPE for Windows? Message-ID: <322365.63299.qm@web25812.mail.ukl.yahoo.com> Hey all I am new to Erlang, but already i am very very impressed with the language! Currently i am writing programs for evaluating genetic algorithms, and performance is everything. I have found that Erlang is a bit slower in specific areas compared to f.ex. C++ or C# with specialised, custom datastructures. This is not a problem as such since distributed applications are (very) easy to write in Erlang. But i have been looking around for information about High Performace Erlang (HiPE) for windows... does anyone know if, and perhaps when, that will be released? Best regards, and happy holidays Frank --------------------------------- F? en billig laptop. Se Kelkoos gode tilbud her! -------------- next part -------------- An HTML attachment was scrubbed... URL: From zerthurd@REDACTED Wed Dec 26 19:19:49 2007 From: zerthurd@REDACTED (Maxim Treskin) Date: Thu, 27 Dec 2007 00:19:49 +0600 Subject: [erlang-questions] HiPE for Windows? In-Reply-To: <322365.63299.qm@web25812.mail.ukl.yahoo.com> References: <322365.63299.qm@web25812.mail.ukl.yahoo.com> Message-ID: Hello There is benchmarks somewhere, compared HiPE and beam code. According its, beam code sometimes works faster than HiPE. Probably you must see on erlang drivers (written in C) for speed increasing. On 26/12/2007, Frank wrote: > Hey all > > I am new to Erlang, but already i am very very impressed with the language! > Currently i am writing programs for evaluating genetic algorithms, and > performance is everything. I have found that Erlang is a bit slower in > specific areas compared to f.ex. C++ or C# with specialised, custom > datastructures. This is not a problem as such since distributed applications > are (very) easy to write in Erlang. > But i have been looking around for information about High Performace Erlang > (HiPE) for windows... does anyone know if, and perhaps when, that will be > released? > > Best regards, and happy holidays > Frank > > > --------------------------------- > > F? en billig laptop. Se Kelkoos gode tilbud her! From dking@REDACTED Wed Dec 26 19:49:40 2007 From: dking@REDACTED (David King) Date: Wed, 26 Dec 2007 10:49:40 -0800 Subject: [erlang-questions] HiPE for Windows? In-Reply-To: References: <322365.63299.qm@web25812.mail.ukl.yahoo.com> Message-ID: <3348D227-D9C3-4E7A-926F-FFFB01DE4772@ketralnis.com> > There is benchmarks somewhere, compared HiPE and beam code. According > its, beam code sometimes works faster than HiPE. > Probably you must see on erlang drivers (written in C) for speed > increasing. Sometimes BEAM does run faster than HiPE, but there are definitely cases where HiPE is faster. You'll of course have to benchmark your particular code before drawing conclusions for it. > > > On 26/12/2007, Frank wrote: >> Hey all >> >> I am new to Erlang, but already i am very very impressed with the >> language! >> Currently i am writing programs for evaluating genetic algorithms, >> and >> performance is everything. I have found that Erlang is a bit slower >> in >> specific areas compared to f.ex. C++ or C# with specialised, custom >> datastructures. This is not a problem as such since distributed >> applications >> are (very) easy to write in Erlang. >> But i have been looking around for information about High >> Performace Erlang >> (HiPE) for windows... does anyone know if, and perhaps when, that >> will be >> released? >> >> Best regards, and happy holidays >> Frank >> >> >> --------------------------------- >> >> F? en billig laptop. Se Kelkoos gode tilbud her! > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From jao@REDACTED Thu Dec 27 07:21:50 2007 From: jao@REDACTED (Jack Orenstein) Date: Thu, 27 Dec 2007 01:21:50 -0500 Subject: [erlang-questions] gen_server:multi_call/3 causing unexpected invocation of handle_info/2 Message-ID: I have written an Erlang application that uses gen_server:multi_call/ 3, (so the timeout is infinity). I have also written a little test program that does the following: - Starts three VMs on one machine. - Occasionally kills one of the VMs (using kill -9) and then restarts it. (This is intended to simulate a node crashing in a cluster with one VM per node.) - Checks to see that the application is responding to the failure as expected. I will typically do 1000 VM bounces in a single test run. I occasionally see errors due to unexpected calls to gen_server:handle_info/2, which appear to be connected to the multi_call. The cases I've examined have these characteristics: - The multi_call invocation returns one of the nodes in the BadNodes part of the multi_call result. - I retry the request to the nodes listed in BadNodes and the request succeeds. - The ORIGINAL invocation to the node actually did reach the node and eventually execute. The response eventually reaches the node that issued the original request, and is routed to handle_info. I've read the documentation for multi_call, and this behavior does not appear to be documented. This paragraph from the documentation addresses late delivery: To avoid that late answers (after the timeout) pollutes the caller's message queue, a middleman process is used to do the actual calls. Late answers will then be discarded when they arrive to a terminated process. but 1) my timeout is infinity, and 2) the calling process has not terminated. The behavior I'm seeing does not appear to be documented -- is it expected? I'm running on a MacBook Pro, and erl -version says: Erlang (ASYNC_THREADS) (BEAM) emulator version 5.5.1. Jack From hans.bolinder@REDACTED Thu Dec 27 09:49:35 2007 From: hans.bolinder@REDACTED (Hans Bolinder) Date: Thu, 27 Dec 2007 09:49:35 +0100 Subject: [erlang-questions] clarify: Shell Crash on Compilation In-Reply-To: <6B163096-A693-48BC-BC8D-6A650B4FF41B@ucalgary.ca> References: <6B163096-A693-48BC-BC8D-6A650B4FF41B@ucalgary.ca> Message-ID: <18291.26399.543586.465652@gargle.gargle.HOWL> [Ryan Janzen:] > I was compiling code in the erlang shell on my Powerbook and got this: > > 49> c(flux_http_handshake). > *** ERROR: Shell process terminated! *** > Eshell V5.6 (abort with ^G) > 1> > > Is there any reason the shell should crash like this? Most likely there was a reference from the history list to some code that was purged by calling c(flux_http_handshake). See also http://www.erlang.org/doc/man/code.html, "Current and Old Code". By default the shell saves 20 commands and results in the history list. You can change this by for instance 'results(1)' or 'history(1)'. Best regards, Hans Bolinder, Erlang/OTP team From casper2000a@REDACTED Thu Dec 27 12:18:35 2007 From: casper2000a@REDACTED (Eranga Udesh) Date: Thu, 27 Dec 2007 16:48:35 +0530 Subject: [erlang-questions] bug: R12B-0 Hipe compile error In-Reply-To: <18291.26399.543586.465652@gargle.gargle.HOWL> References: <6B163096-A693-48BC-BC8D-6A650B4FF41B@ucalgary.ca> <18291.26399.543586.465652@gargle.gargle.HOWL> Message-ID: <007b01c8487a$39075150$ab15f3f0$@com> Hi, I get below Hipe compiler error. Without Hipe, the compilation succeed. Looks like Current == nil is not handled inside updateStatementUses function in hipe_ssa.inc. Brgds, - Eranga =ERROR REPORT==== 27-Dec-2007::16:40:15 === Error: [hipe:906]: ERROR: {function_clause, [{gb_trees,get_1,[{var,11},nil]}, {hipe_icode_ssa, updateStatementUses,3}, {hipe_icode_ssa,renameVars,3}, {hipe_icode_ssa,rename,4}, {hipe_icode_ssa,childrenRename,4}, {hipe_icode_ssa,convert,1}, {hipe_main,icode_ssa_convert,2}, {hipe_main,icode_ssa,3}]} ../src/omnismsc_msg.erl:none: internal error in native_compile; crash reason: {{hipe,907, {function_clause,[{gb_trees,get_1,[{var,11},nil]}, {hipe_icode_ssa,updateStatementUses,3}, {hipe_icode_ssa,renameVars,3}, {hipe_icode_ssa,rename,4}, {hipe_icode_ssa,childrenRename,4}, {hipe_icode_ssa,convert,1}, {hipe_main,icode_ssa_convert,2}, {hipe_main,icode_ssa,3}]}}, [{hipe,finalize_fun_sequential,2}, {hipe,'-finalize_fun_concurrent/2-fun-3-',3}]} =ERROR REPORT==== 27-Dec-2007::16:40:15 === Error in process <0.69.0> with exit value: {{hipe,907,{function_clause,[{gb_trees,get_1,[{var,11},nil]},{hipe_icode_ssa ,updateStatementUses,3},{hipe_icode_ssa,renameVars,3},{hipe_icode_ssa,rename ,4},{hipe_icode_ssa,childrenRename,4},{hipe_icode_ssa,convert,1},{... From mikpe@REDACTED Thu Dec 27 13:27:31 2007 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 27 Dec 2007 13:27:31 +0100 Subject: [erlang-questions] bug: R12B-0 Hipe compile error In-Reply-To: <007b01c8487a$39075150$ab15f3f0$@com> References: <6B163096-A693-48BC-BC8D-6A650B4FF41B@ucalgary.ca> <18291.26399.543586.465652@gargle.gargle.HOWL> <007b01c8487a$39075150$ab15f3f0$@com> Message-ID: <18291.39475.206539.652995@harpo.it.uu.se> Eranga Udesh writes: > Hi, > > I get below Hipe compiler error. Without Hipe, the compilation succeed. > Looks like Current == nil is not handled inside updateStatementUses function > in hipe_ssa.inc. > > Brgds, > - Eranga > > > =ERROR REPORT==== 27-Dec-2007::16:40:15 === > Error: [hipe:906]: ERROR: {function_clause, > > [{gb_trees,get_1,[{var,11},nil]}, > {hipe_icode_ssa, > updateStatementUses,3}, > {hipe_icode_ssa,renameVars,3}, > {hipe_icode_ssa,rename,4}, > > {hipe_icode_ssa,childrenRename,4}, > {hipe_icode_ssa,convert,1}, > > {hipe_main,icode_ssa_convert,2}, > {hipe_main,icode_ssa,3}]} > ../src/omnismsc_msg.erl:none: internal error in native_compile; > crash reason: {{hipe,907, > {function_clause,[{gb_trees,get_1,[{var,11},nil]}, > > {hipe_icode_ssa,updateStatementUses,3}, > {hipe_icode_ssa,renameVars,3}, > {hipe_icode_ssa,rename,4}, > {hipe_icode_ssa,childrenRename,4}, > {hipe_icode_ssa,convert,1}, > {hipe_main,icode_ssa_convert,2}, > {hipe_main,icode_ssa,3}]}}, > [{hipe,finalize_fun_sequential,2}, > {hipe,'-finalize_fun_concurrent/2-fun-3-',3}]} > > =ERROR REPORT==== 27-Dec-2007::16:40:15 === > Error in process <0.69.0> with exit value: > {{hipe,907,{function_clause,[{gb_trees,get_1,[{var,11},nil]},{hipe_icode_ssa > ,updateStatementUses,3},{hipe_icode_ssa,renameVars,3},{hipe_icode_ssa,rename > ,4},{hipe_icode_ssa,childrenRename,4},{hipe_icode_ssa,convert,1},{... Please show us the Erlang source code that triggers this error. Without that it may be difficult to find the root cause of the problem. /Mikael From mikpe@REDACTED Thu Dec 27 13:31:21 2007 From: mikpe@REDACTED (Mikael Pettersson) Date: Thu, 27 Dec 2007 13:31:21 +0100 Subject: [erlang-questions] HiPE for Windows? In-Reply-To: <322365.63299.qm@web25812.mail.ukl.yahoo.com> References: <322365.63299.qm@web25812.mail.ukl.yahoo.com> Message-ID: <18291.39705.604465.105148@harpo.it.uu.se> Frank writes: > But i have been looking around for information about High Performace Erlang (HiPE) for windows... does anyone know if, and perhaps when, that will be released? There are no plans for a Win32 version of HiPE, due to a combination of technical issues and lack of interest. HiPE works fine on Linux, Solaris, and at least some of the *BSDs. From chsu79@REDACTED Thu Dec 27 15:30:19 2007 From: chsu79@REDACTED (Christian S) Date: Thu, 27 Dec 2007 15:30:19 +0100 Subject: [erlang-questions] probability distribution of system uptime Message-ID: Anyone know research into what system-uptime probability distributions look like? I can imagine that a machine that just started is more crash-prone, since it is likely that it was just restarted because of a crash, but how about long living systems? It would be interesting to see a chart of reason-of-system-failure at different time-scales. Is it a good strategy to make the longest living node the master in leader election? From jao@REDACTED Thu Dec 27 15:59:44 2007 From: jao@REDACTED (Jack Orenstein) Date: Thu, 27 Dec 2007 09:59:44 -0500 (EST) Subject: [erlang-questions] probability distribution of system uptime In-Reply-To: References: Message-ID: <13000.207.190.221.98.1198767584.squirrel@geophile.com> On Thu, December 27, 2007 9:30 am, Christian S wrote: > Is it a good strategy to make the longest living node the master in > leader election? You may want to consider gen_leader for leader election: http://www.cs.chalmers.se/~hanssv/leader_election/doc/gen_leader.html Jack From hans.bolinder@REDACTED Thu Dec 27 16:48:13 2007 From: hans.bolinder@REDACTED (Hans Bolinder) Date: Thu, 27 Dec 2007 16:48:13 +0100 Subject: [erlang-questions] R12B documentation error In-Reply-To: References: Message-ID: <18291.51517.551671.370987@gargle.gargle.HOWL> [Daniel Goertzen:] > In the file erl5.6/erts-5.6/doc/html/erl_ext_dist.html, the types > SMALL_BIG_EXT and LARGE_BIG_EXT both list an id of 110. > > I think LARGE_BIG_EXT is really 111. Thanks for pointing it out. Best regards, Hans Bolinder, Erlang/OTP team From jozsef.berces@REDACTED Fri Dec 28 00:39:22 2007 From: jozsef.berces@REDACTED (=?iso-8859-1?Q?J=F3zsef_B=E9rces?=) Date: Fri, 28 Dec 2007 00:39:22 +0100 Subject: [erlang-questions] NTP timestamp Message-ID: Hi, I would like to convert NTP timestamps (seconds elapsed since 00:00:00 January 1st, 1900) to Erlang date/time tuples (UTC). I did not find any such functions in the OTP libraries. It seems that there is no function for converting now() to UTC date and time, either. Any help would be welcome. Thanks, Jozsef -------------- next part -------------- An HTML attachment was scrubbed... URL: From hokan.stenholm@REDACTED Fri Dec 28 01:02:04 2007 From: hokan.stenholm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Stenholm?=) Date: Fri, 28 Dec 2007 01:02:04 +0100 Subject: [erlang-questions] NTP timestamp In-Reply-To: References: Message-ID: <47743CFC.2090800@bredband.net> J?zsef B?rces wrote: > Hi, > > I would like to convert NTP timestamps (seconds elapsed since 00:00:00 January 1st, 1900) to Erlang date/time tuples (UTC). I did not find any such functions in the OTP libraries. It seems that there is no function for converting now() to UTC date and time, either. > > Any help would be welcome. > something like this should work, to convert NTP timestamps (in UTC) to {date(), time()} in UTC: %% returns: {date(), time()} NTPtimestamps_to_datetime(NTPSeconds) -> %% 1900:01:01 00:00:00 in gregorian seconds NTPBase = calendar:datetime_to_gregorian_seconds({1900,1,1}, {0,0,0}), GregorianSec = NTPBase + NTPSeconds, calendar:gregorian_seconds_to_datetime(Seconds). the calendar module has the following functions for converting now() to UTC {date(), time()}: now_to_universal_time(Now) -> {Date, Time} now_to_datetime(Now) -> {Date, Time} > Thanks, > Jozsef > > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From dbtleonia@REDACTED Fri Dec 28 01:55:41 2007 From: dbtleonia@REDACTED (David Tucker) Date: Thu, 27 Dec 2007 19:55:41 -0500 Subject: [erlang-questions] : : [SOLVED] Can't set long node name on windows In-Reply-To: <200707062021.l66KLRdh070181@pluto.hedeland.org> References: <468CA19E.5020407@gmail.com> <200707062021.l66KLRdh070181@pluto.hedeland.org> Message-ID: <77ac51d70712271655h776f603aiefac46c6d52bfdd1@mail.gmail.com> On Jul 6, 2007 3:21 PM, Per Hedeland wrote: > "Dmitrii 'Mamut' Dimandt" wrote: > > > >I should really be careful when reading books :) : > > > > "We can also use -sname on two different machines when they are > > on the same subnet. Using -sname is also the only method that will > > work if no DNS service is available." > > Uh, unfortunately basically everything in that quote is wrong. -name vs > -sname is a matter of host/domain names, a concept that is quite > orthogonal to the concept of subnets. And -name works just fine without > DNS, as long as you put fully-qualified names in /etc/hosts or whatever > you're using. The erl(1) man page has it right of course, but is maybe a > bit terse. > > The important thing is that the hostname part of a node name must be > unique (among hosts), predictable, and usable by all involved. If your > Windows box thinks that its name is foo.WORKGROUP, while your Unix box > thinks that the Windows box is called foo.your.domain, and has no idea > how to reach a host called foo.WORKGROUP, you will have problems. In > some cases they may agree on the "foo" part, which is where -sname helps > (at the cost of messing things up when you want foo.example.org and > foo.example.com to be able to communicate). But the Windows box may > actually think that its name is DMITRIIS_COMPUTER, a name that isn't > known by anything outside (at best) the bunch of Windows boxes on your > network. > > The clear and obvious way out of this mess is "everything should use > DNS", which amazingly still seems to be a problem in the Windows world. > > >Apart from that, Kirill Zaborski suggested that I directly write > >nodename@REDACTED So I ran > > > > erl -name another_name@REDACTED > > This is actually quite a good workaround when you have a "Windows mess" > - or for that matter a private home network where you can't be bothered > to set up DNS or even distribute hosts files. Using IP addresses clearly > fulfills the unique&predictable&usable requirement. Unfortunately it's > not documented that you can specify the hostname part at all with -name, > let alone that the IP address can be used for it (I think at least the > latter may actually be an "accidental" feature). This still doesn't work for me. I'm running Windows XP with Erlang 5.6; when I do: erl -name foobar@REDACTED I get a popup box saying "erl.exe has encountered a problem and needs to close." There are no other error messages. Has anyone else encountered this bug? Can anyone suggest how to workaround or diagnose the problem? Thanks. Dave > > The downside is that there is zero sanity check on the hostname part, > you can give anything you want there (whether name or IP address), and > so can easily create a different kind of mess. > > --Per Hedeland > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From KONGA@REDACTED Fri Dec 28 02:45:30 2007 From: KONGA@REDACTED (Anthony Kong) Date: Fri, 28 Dec 2007 12:45:30 +1100 Subject: [erlang-questions] : : [SOLVED] Can't set long node name on windows In-Reply-To: <77ac51d70712271655h776f603aiefac46c6d52bfdd1@mail.gmail.com> References: <468CA19E.5020407@gmail.com> <200707062021.l66KLRdh070181@pluto.hedeland.org> <77ac51d70712271655h776f603aiefac46c6d52bfdd1@mail.gmail.com> Message-ID: <4774EFE7.664A.00DD.0@stgeorge.com.au> I am using XP SP2. "-name" works for me. C:\>c:\opt\erl5.6\bin\erl.exe -name foobar@REDACTED Eshell V5.6 (abort with ^G) (foobar@REDACTED)1> Can you try "tracert" to the IP address you use? Can you see anything unusual from the output? Cheers, Anthony >>> "David Tucker" 28/12/2007 11:55 am >>> This still doesn't work for me. I'm running Windows XP with Erlang 5.6; when I do: erl -name foobar@REDACTED I get a popup box saying "erl.exe has encountered a problem and needs to close." There are no other error messages. Has anyone else encountered this bug? Can anyone suggest how to workaround or diagnose the problem? Thanks. Dave ********************************************************************** ***** IMPORTANT INFORMATION ***** This document should be read only by those persons to whom it is addressed and its content is not intended for use by any other persons. If you have received this message in error, please notify us immediately. Please also destroy and delete the message from your computer. Any unauthorised form of reproduction of this message is strictly prohibited. St George Bank Limited AFSL 240997, Advance Asset Management Limited AFSL 240902, St George Life Limited AFSL 240900, ASGARD Capital Management Limited AFSL 240695 and Securitor Financial Group Limited AFSL 240687 is not liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt. ********************************************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjt@REDACTED Thu Dec 27 23:45:25 2007 From: bjt@REDACTED (Benjamin Tolputt) Date: Fri, 28 Dec 2007 09:45:25 +1100 Subject: [erlang-questions] HiPE for Windows? In-Reply-To: <18291.39705.604465.105148@harpo.it.uu.se> References: <322365.63299.qm@web25812.mail.ukl.yahoo.com> <18291.39705.604465.105148@harpo.it.uu.se> Message-ID: <47742B05.40600@pmp.com.au> Mikael Pettersson wrote: > There are no plans for a Win32 version of HiPE, due to a > combination of technical issues and lack of interest. > HiPE works fine on Linux, Solaris, and at least some of the *BSDs. Do you know what these problems are and/or where people (such as myself) can look at them? I've played with (the code of) JIT compilers on Windows and haven't come across show-stoppers before. I had been under the impression that HiPE was working on Windows :( --BJT From saleyn@REDACTED Fri Dec 28 05:16:57 2007 From: saleyn@REDACTED (Serge Aleynikov) Date: Thu, 27 Dec 2007 23:16:57 -0500 Subject: [erlang-questions] NTP timestamp In-Reply-To: References: Message-ID: <477478B9.5040701@gmail.com> Here's a snippet that deals with time conversion from/to SNTP timestamps. In the first function Sec and USec are integers in NTP format. sntp_time_to_now(Sec, USec) -> case Sec band 16#80000000 of 0 -> Time = Sec + 2085978496; % use base: 7-Feb-2036 @ 06:28:16 UTC _ -> Time = Sec - 2208988800 % use base: 1-Jan-1900 @ 01:00:00 UTC end, {Time div 1000000, Time rem 1000000, round((USec * 1000000) / (1 bsl 32))}. now_to_sntp_time({_,_,USec} = Now) -> SecsSinceJan1900 = 16#80000000 bor (calendar:datetime_to_gregorian_seconds(calendar:now_to_universal_time(Now)) - 59958230400), {SecsSinceJan1900, round(USec * (1 bsl 32) / 1000000)}. Serge J?zsef B?rces wrote: > Hi, > > I would like to convert NTP timestamps (seconds elapsed since 00:00:00 January 1st, 1900) to Erlang date/time tuples (UTC). I did not find any such functions in the OTP libraries. It seems that there is no function for converting now() to UTC date and time, either. > > Any help would be welcome. > > Thanks, > Jozsef > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions From casper2000a@REDACTED Fri Dec 28 08:08:35 2007 From: casper2000a@REDACTED (Eranga Udesh) Date: Fri, 28 Dec 2007 12:38:35 +0530 Subject: [erlang-questions] bug: R12B-0 Hipe compile error In-Reply-To: <18291.39475.206539.652995@harpo.it.uu.se> References: <6B163096-A693-48BC-BC8D-6A650B4FF41B@ucalgary.ca> <18291.26399.543586.465652@gargle.gargle.HOWL> <007b01c8487a$39075150$ab15f3f0$@com> <18291.39475.206539.652995@harpo.it.uu.se> Message-ID: <002f01c84920$7641e430$62c5ac90$@com> Attached is the best I can narrow it down. Any part removed from that code snippet, the error disappears. Hope this will help. BRgds, - Eranga -----Original Message----- From: Mikael Pettersson [mailto:mikpe@REDACTED] Sent: Thursday, December 27, 2007 5:58 PM To: Eranga Udesh Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] bug: R12B-0 Hipe compile error Eranga Udesh writes: > Hi, > > I get below Hipe compiler error. Without Hipe, the compilation succeed. > Looks like Current == nil is not handled inside updateStatementUses function > in hipe_ssa.inc. > > Brgds, > - Eranga > > > =ERROR REPORT==== 27-Dec-2007::16:40:15 === > Error: [hipe:906]: ERROR: {function_clause, > > [{gb_trees,get_1,[{var,11},nil]}, > {hipe_icode_ssa, > updateStatementUses,3}, > {hipe_icode_ssa,renameVars,3}, > {hipe_icode_ssa,rename,4}, > > {hipe_icode_ssa,childrenRename,4}, > {hipe_icode_ssa,convert,1}, > > {hipe_main,icode_ssa_convert,2}, > {hipe_main,icode_ssa,3}]} > ../src/omnismsc_msg.erl:none: internal error in native_compile; > crash reason: {{hipe,907, > {function_clause,[{gb_trees,get_1,[{var,11},nil]}, > > {hipe_icode_ssa,updateStatementUses,3}, > {hipe_icode_ssa,renameVars,3}, > {hipe_icode_ssa,rename,4}, > {hipe_icode_ssa,childrenRename,4}, > {hipe_icode_ssa,convert,1}, > {hipe_main,icode_ssa_convert,2}, > {hipe_main,icode_ssa,3}]}}, > [{hipe,finalize_fun_sequential,2}, > {hipe,'-finalize_fun_concurrent/2-fun-3-',3}]} > > =ERROR REPORT==== 27-Dec-2007::16:40:15 === > Error in process <0.69.0> with exit value: > {{hipe,907,{function_clause,[{gb_trees,get_1,[{var,11},nil]},{hipe_icode_ssa > ,updateStatementUses,3},{hipe_icode_ssa,renameVars,3},{hipe_icode_ssa,rename > ,4},{hipe_icode_ssa,childrenRename,4},{hipe_icode_ssa,convert,1},{... Please show us the Erlang source code that triggers this error. Without that it may be difficult to find the root cause of the problem. /Mikael -------------- next part -------------- A non-text attachment was scrubbed... Name: hipe_err.erl Type: application/octet-stream Size: 252 bytes Desc: not available URL: From tobbe@REDACTED Fri Dec 28 13:06:19 2007 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Fri, 28 Dec 2007 13:06:19 +0100 Subject: [erlang-questions] Ajax in Erlang, anyone? In-Reply-To: <476FA3AB.203@eprometeus.com> References: <476FA3AB.203@eprometeus.com> Message-ID: Have a look at: http://blog.tornkvist.org/ http://tpl.tornkvist.org/ Cheers, Tobbe Michele Sciabarra wrote: > Thank you to all for the overwhelming flood of informations about how > to do json in Erlang. > > Actually, I am exploring Erlang to build Ajax applications, and my > impressions are similar to those expressed in the lshift blog entry > regarding their Ajax jukebox: > > >Erlang made a great platform for the server side of the application. > Its support for clean, simple concurrency let me design the >program in > a very natural way. > > I have not yet read the code for the jukebox application, that is the > only sample ajax application I have found, but I am planning to do. > > My feeling is that an ajax application can be very simple and elegant in > Erlang, just declaring the functions required, connect to the ajax > application following some conventions, and provide data as tuples and > lists that can be converted to JSON in a very natural way. > > However, the only simple ajax example I have found is the yaws json > example, And it looked me very complex and innatural: > > http://yaws.hyber.org/json_intro.yaws > > Has anyone had experiences and examples about ajax in erlang to share? > > For examples, which fondation javascript library do you feel is the best > to use? The example ajax jukebox uses Prototipe, but I was under the > impression that the pythonic/functional nature of Mochikit could be > more appropriate for Erlang. However also jQuery has a functional nature... > > > > From rsaccon@REDACTED Fri Dec 28 14:26:33 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Fri, 28 Dec 2007 11:26:33 -0200 Subject: [erlang-questions] clarify: escaping strings in erl_scan:string / erl_parse:parse_term Message-ID: How do I escape strings in Erlang before tokenizing / parsing with erl_scan:string/1 and erl_parse:parse_term/1 ? E.g. in the interactive Erlang shell I simply do: 1> {a_string, "foo(\"hi\")"}. {a_string,"foo(\"hi\")"} But if I try to do the same with erl_scan:string and erl_parse:parse_term, it is tokenizing not as expected and parsing gives an error: 2> {ok,Tokens,_}=erl_scan:string("{a_string, \"foo(\"hi\")\"}."). {ok,[{'{',1}, {atom,1,a_string}, {',',1}, {string,1,"foo("}, {atom,1,hi}, {string,1,")"}, {'}',1}, {dot,1}], 1} 3> erl_parse:parse_term(Tokens). {error,{1,erl_parse,["syntax error before: ","hi"]}} 4> So what is the proper way to escape strings in this context ? -- Roberto Saccon http://rsaccon.com From vladdu55@REDACTED Fri Dec 28 14:38:37 2007 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 28 Dec 2007 14:38:37 +0100 Subject: [erlang-questions] Fwd: clarify: escaping strings in erl_scan:string / erl_parse:parse_term In-Reply-To: <95be1d3b0712280538l63dff007he1860cb7322bbec2@mail.gmail.com> References: <95be1d3b0712280538l63dff007he1860cb7322bbec2@mail.gmail.com> Message-ID: <95be1d3b0712280538t66c3c991j9343df7223e48891@mail.gmail.com> Hi, On Dec 28, 2007 2:26 PM, Roberto Saccon wrote: > But if I try to do the same with erl_scan:string and > erl_parse:parse_term, it is tokenizing not as expected and parsing > gives an error: > > > 2> {ok,Tokens,_}=erl_scan:string("{a_string, \"foo(\"hi\")\"}."). You have to escape even the backslashes in the inside string, like this: {ok,Tokens,_}=erl_scan:string("{a_string, \"foo(\\\"hi\\\")\"}."). best regards, Vlad -- Some people see things that are and ask, Why? Some people dream of things that never were and ask, Why not? Some people have to go to work and don't have time for all that. --- George Carlin From csanto@REDACTED Fri Dec 28 14:52:05 2007 From: csanto@REDACTED (Corrado Santoro) Date: Fri, 28 Dec 2007 14:52:05 +0100 Subject: [erlang-questions] clarify: escaping strings in erl_scan:string / erl_parse:parse_term In-Reply-To: References: Message-ID: <4774FF85.1020207@diit.unict.it> You have to quote the backslashes: 7> {ok,Tokens,_}=erl_scan:string("{a_string, \"foo(\\\"hi\\\")\"}."). {ok,[{'{',1}, {atom,1,a_string}, {',',1}, {string,1,"foo(\"hi\")"}, {'}',1}, {dot,1}], 1} 8> erl_parse:parse_term(Tokens). {ok,{a_string,"foo(\"hi\")"}} :-) Cheers, --Corrado Roberto Saccon wrote: > How do I escape strings in Erlang before tokenizing / parsing with > erl_scan:string/1 and erl_parse:parse_term/1 ? > > E.g. in the interactive Erlang shell I simply do: > > 1> {a_string, "foo(\"hi\")"}. > {a_string,"foo(\"hi\")"} > > > But if I try to do the same with erl_scan:string and > erl_parse:parse_term, it is tokenizing not as expected and parsing > gives an error: > > > 2> {ok,Tokens,_}=erl_scan:string("{a_string, \"foo(\"hi\")\"}."). > {ok,[{'{',1}, > {atom,1,a_string}, > {',',1}, > {string,1,"foo("}, > {atom,1,hi}, > {string,1,")"}, > {'}',1}, > {dot,1}], > 1} > 3> erl_parse:parse_term(Tokens). > {error,{1,erl_parse,["syntax error before: ","hi"]}} > 4> > > > So what is the proper way to escape strings in this context ? > -- ================================================================== Eng. Corrado Santoro, Ph.D. University of Catania - ITALY - Engineering Faculty Tel: +39 095 7382380 VoIP: sip:7035@REDACTED Personal Home Page: http://www.diit.unict.it/users/csanto NUXI Home Page: http://nuxi.diit.unict.it ================================================================== From dizzyd@REDACTED Fri Dec 28 15:13:11 2007 From: dizzyd@REDACTED (Dave Smith) Date: Fri, 28 Dec 2007 07:13:11 -0700 Subject: [erlang-questions] driver_mk_* safe to call from async function? Message-ID: Greetings, I'm writing a driver that will use async functions to do some processing. While in those async functions, is it safe to call the driver_mk_* functions, or do I need to hold a port lock? Thanks, D. From mikpe@REDACTED Fri Dec 28 15:35:20 2007 From: mikpe@REDACTED (Mikael Pettersson) Date: Fri, 28 Dec 2007 15:35:20 +0100 Subject: [erlang-questions] bug: R12B-0 Hipe compile error In-Reply-To: <002f01c84920$7641e430$62c5ac90$@com> References: <6B163096-A693-48BC-BC8D-6A650B4FF41B@ucalgary.ca> <18291.26399.543586.465652@gargle.gargle.HOWL> <007b01c8487a$39075150$ab15f3f0$@com> <18291.39475.206539.652995@harpo.it.uu.se> <002f01c84920$7641e430$62c5ac90$@com> Message-ID: <18293.2472.550153.786705@harpo.it.uu.se> Eranga Udesh writes: > Attached is the best I can narrow it down. Any part removed from that code > snippet, the error disappears. Hope this will help. It does help, thanks. Per Gustafsson of the HiPE group has fixed the bug. Below you'll find a backported & tested patch for R12B-0. /Mikael --- otp_src_R12B-0/lib/hipe/icode/hipe_beam_to_icode.erl.~1~ 2007-11-26 19:58:35.000000000 +0100 +++ otp_src_R12B-0/lib/hipe/icode/hipe_beam_to_icode.erl 2007-12-28 15:31:36.000000000 +0100 @@ -383,14 +383,14 @@ trans_fun([{bif,BifName,{f,Lbl},[_,_] = trans_fun([{allocate,StackSlots,_}|Instructions], Env) -> trans_allocate(StackSlots) ++ trans_fun(Instructions,Env); %%--- allocate_heap --- IGNORED ON PURPOSE -trans_fun([{allocate_heap,_,_,_}|Instructions], Env) -> - trans_fun(Instructions,Env); +trans_fun([{allocate_heap,StackSlots,_,_}|Instructions], Env) -> + trans_allocate(StackSlots) ++ trans_fun(Instructions,Env); %%--- allocate_zero trans_fun([{allocate_zero,StackSlots,_}|Instructions], Env) -> trans_allocate(StackSlots) ++ trans_fun(Instructions,Env); %%--- allocate_heap_zero --- IGNORED ON PURPOSE -trans_fun([{allocate_heap_zero,_,_,_}|Instructions], Env) -> - trans_fun(Instructions,Env); +trans_fun([{allocate_heap_zero,StackSlots,_,_}|Instructions], Env) -> + trans_allocate(StackSlots) ++ trans_fun(Instructions,Env); %%--- test_heap --- IGNORED ON PURPOSE trans_fun([{test_heap,_,_}|Instructions], Env) -> trans_fun(Instructions,Env); From jbamsterdam@REDACTED Fri Dec 28 16:11:18 2007 From: jbamsterdam@REDACTED (Jonathan Amsterdam) Date: Fri, 28 Dec 2007 10:11:18 -0500 Subject: [erlang-questions] newbie: equality Message-ID: <31c6fe8f0712280711k4b87c649xceeb895d4f82792d@mail.gmail.com> Two comments on equality in Erlang. 1. The Reference Manual says that the only difference between == and =:= is that the former will coerce ints to floats. (By the way, the sentence that expresses this says "All comparison operators except =:= and =/= are of type coerce". That isn't grammatical English, unless "of type coerce" is some term of art that I don't know.) Why then does Joe Armstrong in his book strongly advise using =:= in most cases? Is it just the slight performance hit or is there a deeper reason? 2. It seems (from my experimentation) that =:= performs an initial pointer-equality check. This is good and expected, but I think it should be documented in the reference manual (i.e. made part of the language semantics). Although it is in one sense just an efficiency hack, it can have a dramatic effect on how one codes. E.g. I need a list of key-value pairs suitable for use with lists:keysearch and friends. May I use large objects for the keys, or must I use small unique IDs instead? From rsaccon@REDACTED Fri Dec 28 16:20:10 2007 From: rsaccon@REDACTED (Roberto Saccon) Date: Fri, 28 Dec 2007 13:20:10 -0200 Subject: [erlang-questions] clarify: escaping strings in erl_scan:string / erl_parse:parse_term In-Reply-To: <4774FF85.1020207@diit.unict.it> References: <4774FF85.1020207@diit.unict.it> Message-ID: oh yeah, that's it, Vlad and Corrado, thanks a lot ! On Dec 28, 2007 11:52 AM, Corrado Santoro wrote: > You have to quote the backslashes: > > 7> {ok,Tokens,_}=erl_scan:string("{a_string, \"foo(\\\"hi\\\")\"}."). > {ok,[{'{',1}, > {atom,1,a_string}, > {',',1}, > {string,1,"foo(\"hi\")"}, > {'}',1}, > {dot,1}], > 1} > 8> erl_parse:parse_term(Tokens). > {ok,{a_string,"foo(\"hi\")"}} > > :-) > > Cheers, > --Corrado > > > Roberto Saccon wrote: > > How do I escape strings in Erlang before tokenizing / parsing with > > erl_scan:string/1 and erl_parse:parse_term/1 ? > > > > E.g. in the interactive Erlang shell I simply do: > > > > 1> {a_string, "foo(\"hi\")"}. > > {a_string,"foo(\"hi\")"} > > > > > > But if I try to do the same with erl_scan:string and > > erl_parse:parse_term, it is tokenizing not as expected and parsing > > gives an error: > > > > > > 2> {ok,Tokens,_}=erl_scan:string("{a_string, \"foo(\"hi\")\"}."). > > {ok,[{'{',1}, > > {atom,1,a_string}, > > {',',1}, > > {string,1,"foo("}, > > {atom,1,hi}, > > {string,1,")"}, > > {'}',1}, > > {dot,1}], > > 1} > > 3> erl_parse:parse_term(Tokens). > > {error,{1,erl_parse,["syntax error before: ","hi"]}} > > 4> > > > > > > So what is the proper way to escape strings in this context ? > > > > > -- > ================================================================== > Eng. Corrado Santoro, Ph.D. > University of Catania - ITALY - Engineering Faculty > > Tel: +39 095 7382380 VoIP: sip:7035@REDACTED > > Personal Home Page: http://www.diit.unict.it/users/csanto > NUXI Home Page: http://nuxi.diit.unict.it > ================================================================== > > -- Roberto Saccon http://rsaccon.com From richardc@REDACTED Fri Dec 28 17:35:06 2007 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 28 Dec 2007 17:35:06 +0100 Subject: [erlang-questions] newbie: equality In-Reply-To: <31c6fe8f0712280711k4b87c649xceeb895d4f82792d@mail.gmail.com> References: <31c6fe8f0712280711k4b87c649xceeb895d4f82792d@mail.gmail.com> Message-ID: <477525BA.8040902@it.uu.se> Jonathan Amsterdam wrote: > Two comments on equality in Erlang. > > 1. The Reference Manual says that the only difference between == and > =:= is that the former will coerce ints to floats. (By the way, the > sentence that expresses this says "All comparison operators except =:= > and =/= are of type coerce". That isn't grammatical English, unless > "of type coerce" is some term of art that I don't know.) Why then does > Joe Armstrong in his book strongly advise using =:= in most cases? Is > it just the slight performance hit or is there a deeper reason? Various reasons: a) it is slightly cheaper b) =:= is the same (exact) equality test that the pattern matching does, so you avoid nasty surprises with floats matching integers c) =:= gives better hints to the compiler, Dialyzer, and any other program analysis tools, since there is no coercion d) it has the words Don't Panic inscribed in large friendly letters on its cover > 2. It seems (from my experimentation) that =:= performs an initial > pointer-equality check. This is good and expected, but I think it > should be documented in the reference manual (i.e. made part of the > language semantics). Although it is in one sense just an efficiency > hack, it can have a dramatic effect on how one codes. E.g. I need a > list of key-value pairs suitable for use with lists:keysearch and > friends. May I use large objects for the keys, or must I use small > unique IDs instead? The pointer equality optimization will only be effective as long as you have complete control over the data. For example, an object that has been on a round trip to another process is likely to have been copied (depending on the runtime system flavour), so the pointers will be different, causing a costly comparison of the whole objects. I suggest you use small keys right from the start, to get that warm fuzzy future-safe feeling. (Or as a compromise, you might just use a dict with large keys, since it uses hashing. You shouldn't really be using lists:keysearch anyway, if efficiency is an issue, unless you know you will always have lists of only a few elements.) /Richard -- "Having users is like optimization: the wise course is to delay it." -- Paul Graham From mikpe@REDACTED Fri Dec 28 17:39:29 2007 From: mikpe@REDACTED (Mikael Pettersson) Date: Fri, 28 Dec 2007 17:39:29 +0100 (MET) Subject: [erlang-questions] HiPE for Windows? Message-ID: <200712281639.lBSGdThe010694@harpo.it.uu.se> On Fri, 28 Dec 2007 09:45:25 +1100, Benjamin Tolputt wrote: >Mikael Pettersson wrote: >> There are no plans for a Win32 version of HiPE, due to a >> combination of technical issues and lack of interest. >> HiPE works fine on Linux, Solaris, and at least some of the *BSDs. >Do you know what these problems are and/or where people (such as myself) >can look at them? I've played with (the code of) JIT compilers on >Windows and haven't come across show-stoppers before. Asynchronously called functions on the current ESP/RSP stack. Unix signal handlers are by default invoked on the thread's current stack, but they can be redirected to a separate stack using SA_ONSTACK and sigaltstack(). It's my understanding, from reading papers on various systems ported to or developed for Win32, that Win32 (a) will call functions asynchronously on the current stack, and (b) does not provide an altstack-like mechanism. Why is this a problem? Because the stack is managed by the HiPE compiler and runtime system. It starts small and only grows in response to explicit stack overflow checks inserted by the HiPE compiler. Running alien code on the current native stack simply isn't safe. I know of two workarounds, neither of which is attractive: 1. Make stacks larger with at least a page's worth of "slack" at the bottom for asynchronously invoked alien code. Drawback: Erlang processes are supposed to be light-weight, with this "solution" they aren't any more, which negatively affects Erlang's ability to have many thousands of processes around. 2. Don't use ESP/RSP for the Erlang stack in native code. Drawback 1: Loses a general-purpose register on the register- starved x86. Doubleplusungood. Drawback 2: Loses use of the processor's return stack branch predictor, which makes function calls much more expensive. Remember, Erlang isn't Fortran, there are lots and lots of calls to smallish functions. Drawback 3: More instructions needed to implement call and return sequences, again making function calls more expensive. There are superior alternative platforms for servers (just about any *NIX-like OS), so I don't consider the lack of HiPE for Win32 to be a critical problem. /Mikael From als@REDACTED Fri Dec 28 17:23:04 2007 From: als@REDACTED (Anthony Shipman) Date: Sat, 29 Dec 2007 03:23:04 +1100 Subject: [erlang-questions] Ajax in Erlang, anyone? In-Reply-To: References: <476FA3AB.203@eprometeus.com> Message-ID: <200712290323.04423.als@iinet.net.au> > > Michele Sciabarra wrote: > > > > However, the only simple ajax example I have found is the yaws json > > example, And it looked me very complex and innatural: > > > > http://yaws.hyber.org/json_intro.yaws > > > > Has anyone had experiences and examples about ajax in erlang to share? > > > > For examples, which fondation javascript library do you feel is the best > > to use? The example ajax jukebox uses Prototipe, but I was under the > > impression that the pythonic/functional nature of Mochikit could be > > more appropriate for Erlang. However also jQuery has a functional > > nature... I have been using the prototype library for Ajax with Erlang. I don't use JSON. XML works very simply and easily. -- Anthony Shipman Mamas don't let your babies als@REDACTED grow up to be outsourced. From casper2000a@REDACTED Fri Dec 28 18:49:00 2007 From: casper2000a@REDACTED (Eranga Udesh) Date: Fri, 28 Dec 2007 23:19:00 +0530 Subject: [erlang-questions] bug: R12B-0 Hipe compile error In-Reply-To: <18293.2472.550153.786705@harpo.it.uu.se> References: <6B163096-A693-48BC-BC8D-6A650B4FF41B@ucalgary.ca> <18291.26399.543586.465652@gargle.gargle.HOWL> <007b01c8487a$39075150$ab15f3f0$@com> <18291.39475.206539.652995@harpo.it.uu.se> <002f01c84920$7641e430$62c5ac90$@com> <18293.2472.550153.786705@harpo.it.uu.se> Message-ID: <000e01c84979$edbd8470$c9388d50$@com> Works, thanks. BRgds, - Eranga -----Original Message----- From: Mikael Pettersson [mailto:mikpe@REDACTED] Sent: Friday, December 28, 2007 8:05 PM To: Eranga Udesh Cc: erlang-questions@REDACTED Subject: RE: [erlang-questions] bug: R12B-0 Hipe compile error Eranga Udesh writes: > Attached is the best I can narrow it down. Any part removed from that code > snippet, the error disappears. Hope this will help. It does help, thanks. Per Gustafsson of the HiPE group has fixed the bug. Below you'll find a backported & tested patch for R12B-0. /Mikael --- otp_src_R12B-0/lib/hipe/icode/hipe_beam_to_icode.erl.~1~ 2007-11-26 19:58:35.000000000 +0100 +++ otp_src_R12B-0/lib/hipe/icode/hipe_beam_to_icode.erl 2007-12-28 15:31:36.000000000 +0100 @@ -383,14 +383,14 @@ trans_fun([{bif,BifName,{f,Lbl},[_,_] = trans_fun([{allocate,StackSlots,_}|Instructions], Env) -> trans_allocate(StackSlots) ++ trans_fun(Instructions,Env); %%--- allocate_heap --- IGNORED ON PURPOSE -trans_fun([{allocate_heap,_,_,_}|Instructions], Env) -> - trans_fun(Instructions,Env); +trans_fun([{allocate_heap,StackSlots,_,_}|Instructions], Env) -> + trans_allocate(StackSlots) ++ trans_fun(Instructions,Env); %%--- allocate_zero trans_fun([{allocate_zero,StackSlots,_}|Instructions], Env) -> trans_allocate(StackSlots) ++ trans_fun(Instructions,Env); %%--- allocate_heap_zero --- IGNORED ON PURPOSE -trans_fun([{allocate_heap_zero,_,_,_}|Instructions], Env) -> - trans_fun(Instructions,Env); +trans_fun([{allocate_heap_zero,StackSlots,_,_}|Instructions], Env) -> + trans_allocate(StackSlots) ++ trans_fun(Instructions,Env); %%--- test_heap --- IGNORED ON PURPOSE trans_fun([{test_heap,_,_}|Instructions], Env) -> trans_fun(Instructions,Env); From dbtleonia@REDACTED Fri Dec 28 20:12:33 2007 From: dbtleonia@REDACTED (David Tucker) Date: Fri, 28 Dec 2007 14:12:33 -0500 Subject: [erlang-questions] : : [SOLVED] Can't set long node name on windows In-Reply-To: <4774EFE7.664A.00DD.0@stgeorge.com.au> References: <468CA19E.5020407@gmail.com> <200707062021.l66KLRdh070181@pluto.hedeland.org> <77ac51d70712271655h776f603aiefac46c6d52bfdd1@mail.gmail.com> <4774EFE7.664A.00DD.0@stgeorge.com.au> Message-ID: <77ac51d70712281112g3ed59120obddf436ba7b3c5f8@mail.gmail.com> On Dec 27, 2007 8:45 PM, Anthony Kong wrote: > I am using XP SP2. "-name" works for me. > > C:\>c:\opt\erl5.6\bin\erl.exe -name foobar@REDACTED > Eshell V5.6 (abort with ^G) > (foobar@REDACTED)1 > > > Can you try "tracert" to the IP address you use? Can you see anything > unusual from the output? > Nope -- nothing unusual. Any other hints? Is there a flag I can pass to erl to get more verbose output? Thanks. Dave > > Cheers, Anthony > > > > >>> "David Tucker" 28/12/2007 11:55 am >>> > > > > > This still doesn't work for me. I'm running Windows XP with Erlang 5.6; > when I do: > > erl -name foobar@REDACTED > > I get a popup box saying "erl.exe has encountered a problem and needs to > close." There are no other error messages. Has anyone else encountered > this bug? Can anyone suggest how to workaround or diagnose the problem? > Thanks. > > Dave > > ********************************************************************** > > ***** IMPORTANT INFORMATION ***** > > This document should be read only by those persons to whom it is > > addressed and its content is not intended for use by any other > > persons. If you have received this message in error, please notify > > us immediately. Please also destroy and delete the message from > > your computer. Any unauthorised form of reproduction of this message > > is strictly prohibited. > > > > St George Bank Limited AFSL 240997, Advance Asset Management Limited > > AFSL 240902, St George Life Limited AFSL 240900, ASGARD Capital Management > Limited > > AFSL 240695 and Securitor Financial Group Limited AFSL 240687 is not > liable for > > the proper and complete transmission of the information contained in > > this communication, nor for any delay in its receipt. > > ********************************************************************** > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From torben.lehoff@REDACTED Fri Dec 28 23:19:02 2007 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Fri, 28 Dec 2007 23:19:02 +0100 Subject: [erlang-questions] NTP timestamp In-Reply-To: References: Message-ID: On Dec 28, 2007 12:39 AM, J?zsef B?rces wrote: > Hi, > > I would like to convert NTP timestamps (seconds elapsed since 00:00:00 > January 1st, 1900) to Erlang date/time tuples (UTC). I did not find any such > functions in the OTP libraries. It seems that there is no function for > converting now() to UTC date and time, either. > > Any help would be welcome. > > Thanks, > Jozsef > Try looking at http://www.trapexit.org/Todays_Date and you can use now_to_universal_time/1 as well - you have to read the manual for calendar ( http://www.erlang.org/doc/man/calendar.html) for the details. Cheers, Torben -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.hopwood@REDACTED Sat Dec 29 05:45:35 2007 From: david.hopwood@REDACTED (David Hopwood) Date: Sat, 29 Dec 2007 04:45:35 +0000 Subject: [erlang-questions] HiPE for Windows? In-Reply-To: <200712281639.lBSGdThe010694@harpo.it.uu.se> References: <200712281639.lBSGdThe010694@harpo.it.uu.se> Message-ID: <4775D0EF.1070202@industrial-designers.co.uk> Mikael Pettersson wrote: > On Fri, 28 Dec 2007 09:45:25 +1100, Benjamin Tolputt wrote: >> Mikael Pettersson wrote: >>> There are no plans for a Win32 version of HiPE, due to a >>> combination of technical issues and lack of interest. >>> HiPE works fine on Linux, Solaris, and at least some of the *BSDs. >> Do you know what these problems are and/or where people (such as myself) >> can look at them? I've played with (the code of) JIT compilers on >> Windows and haven't come across show-stoppers before. > > Asynchronously called functions on the current ESP/RSP stack. > > Unix signal handlers are by default invoked on the thread's > current stack, but they can be redirected to a separate stack > using SA_ONSTACK and sigaltstack(). > > It's my understanding, from reading papers on various systems > ported to or developed for Win32, that Win32 (a) will call > functions asynchronously on the current stack, and (b) does > not provide an altstack-like mechanism. Windows will only run code asynchronously on the current stack as a result of a VEH/SEH exception. So, a possible solution is to make sure that the handler for these exceptions uses a sufficiently small amount of stack space, that we can reasonably reserve that much space (which could be only a few bytes) for each Erlang process. On Windows XP and later [*], the first-chance VEH handler, which runs before any other exception handlers, can be set using AddVectoredExceptionHandler(TRUE, ...) -- see , or the MSDN API docs. I don't think it's possible for a VEH handler to actually switch the stack and then continue normal exception processing (because it must return on the same stack in order to do that). However, there are at least two possible workarounds: 1. Use only VEH to replace signals. In that case the vectored handler can switch the stack and then call the "signal handler" itself, bypassing Structured Exception Handling entirely. I think that Sun's Hotspot JVM on Win64-Itanium, and Apache's Harmony JVM, use this approach. Note that this prevents the Erlang emulator itself from using SEH. I don't know whether that is a problem or not. Linked-in drivers can still use SEH, because they run with a larger stack (I assume, since they will not have the stack checks inserted by HiPE), and the VEH handler can detect this case and continue normal exception processing. 2. Save the stack area that could be trashed by the signal handler, and have the signal handler restore it just before resuming. For the multi-threaded emulator, it would also be necessary to stop all other threads (or make sure that they will not access the area that could be trashed). This assumes that you don't have any other native libaries installing their own vectored exception handlers. Few libraries do that, but in any case it can be prevented (causing a guaranteed crash rather than possible memory corruption) by setting a breakpoint at the start of RtlAddVectoredExceptionHandler. When writing VEH handlers in C, remember to work around this bug: . [*] The mechanism existed on Windows before XP, but was not supported by documented APIs. I assume that it's unnecessary to support HiPE for earlier versions of Windows. -- David Hopwood From david_holz@REDACTED Sat Dec 29 06:06:38 2007 From: david_holz@REDACTED (David Holz) Date: Sat, 29 Dec 2007 05:06:38 +0000 Subject: [erlang-questions] HiPE for Windows? In-Reply-To: <200712281639.lBSGdThe010694@harpo.it.uu.se> References: <200712281639.lBSGdThe010694@harpo.it.uu.se> Message-ID: From: mikpe@REDACTED > There are superior alternative platforms for servers (just about > any *NIX-like OS), so I don't consider the lack of HiPE for Win32 > to be a critical problem. Not everybody is writing server applications, and especially as Erlang gets more popular, demanding client/workstation applications will continue to come out. BTW, in some hypothetical dreamland, how difficult is it to add another architecture back end to HiPE? I'm thinking a LLVM backend would pretty much be the last one anybody would need to write. Of course, you still have OS issues to deal with like the stack invasion in Windows, but you wouldn't have to worry about the CPU-specific codegen anymore, and would get tons of mature optimizations even on architectures that HiPE already supports. The whole reinventing wheel thing, etc. _________________________________________________________________ The best games are on Xbox 360. Click here for a special offer on an Xbox 360 Console. http://www.xbox.com/en-US/hardware/wheretobuy/ From david.hopwood@REDACTED Sat Dec 29 06:10:02 2007 From: david.hopwood@REDACTED (David Hopwood) Date: Sat, 29 Dec 2007 05:10:02 +0000 Subject: [erlang-questions] HiPE for Windows? In-Reply-To: <4775D0EF.1070202@industrial-designers.co.uk> References: <200712281639.lBSGdThe010694@harpo.it.uu.se> <4775D0EF.1070202@industrial-designers.co.uk> Message-ID: <4775D6AA.9030905@industrial-designers.co.uk> I wrote: [...] > I don't think it's possible for a VEH handler to actually switch the > stack and then continue normal exception processing (because it must > return on the same stack in order to do that). However, there are at > least two possible workarounds: > > 1. Use only VEH to replace signals. In that case the vectored handler > can switch the stack and then call the "signal handler" itself, > bypassing Structured Exception Handling entirely. I think that > Sun's Hotspot JVM on Win64-Itanium, and Apache's Harmony JVM, use > this approach. > > Note that this prevents the Erlang emulator itself from using SEH. > I don't know whether that is a problem or not. Linked-in drivers can > still use SEH, because they run with a larger stack (I assume, since > they will not have the stack checks inserted by HiPE), and the VEH > handler can detect this case and continue normal exception processing. > > 2. Save the stack area that could be trashed by the signal handler, > and have the signal handler restore it just before resuming. For the > multi-threaded emulator, it would also be necessary to stop all other > threads (or make sure that they will not access the area that could be > trashed). Approach 2 assumes that all exception handlers finish by executing the code to restore the stack, which is probably not a desirable assumption. Instead, the VEH handler could set the return IP to code that restores the stack, and then jumps to the original return IP. In any case, approach 1 is probably simpler, and the fact that at least two other language implementations use it is encouraging. -- David Hopwood From bjt@REDACTED Sat Dec 29 05:01:45 2007 From: bjt@REDACTED (Benjamin Tolputt) Date: Sat, 29 Dec 2007 15:01:45 +1100 Subject: [erlang-questions] HiPE for Windows? In-Reply-To: <200712281639.lBSGdThe010694@harpo.it.uu.se> References: <200712281639.lBSGdThe010694@harpo.it.uu.se> Message-ID: <4775C6A9.8000203@pmp.com.au> Mikael Pettersson wrote: > > There are superior alternative platforms for servers (just about > any *NIX-like OS), so I don't consider the lack of HiPE for Win32 > to be a critical problem. > Agreed. The thing is, I am coming from a game/application-level development area. On the one hand, Erlang performance in these areas are not "quite" as critical as those on a server (even in the same domain). Still being able to use HiPE to have even these parts sped up would have been nice. I'll look into the code based on the areas you highlighted. I dislike both the workarounds suggested (for much the same reasons you dislike them) and if they are all that's available - I'd rather stick to the BEAM VM alone. Thanks for the details, --BJT > /Mikael > > From hubaghdadi@REDACTED Sun Dec 30 08:37:51 2007 From: hubaghdadi@REDACTED (Lone Wolf) Date: Sat, 29 Dec 2007 23:37:51 -0800 (PST) Subject: [erlang-questions] Getting Erlang for Linux Message-ID: <549544.19649.qm@web51104.mail.re2.yahoo.com> Hi. How/Where to get Erlang version for Linux (Ubuntu7.10)? Erlang download page doesn't show binary packages of Erlang except for Windows. Thanks. Deep into that darkness peering, long I stood there, wondering, fearing, Doubting, dreaming dreams no mortal ever dreamed before. E.A Poe --------------------------------- Looking for last minute shopping deals? Find them fast with Yahoo! Search. -------------- next part -------------- An HTML attachment was scrubbed... URL: From msciab@REDACTED Sun Dec 30 10:01:19 2007 From: msciab@REDACTED (Michele Sciabarra) Date: Sun, 30 Dec 2007 10:01:19 +0100 Subject: [erlang-questions] Getting Erlang for Linux In-Reply-To: <549544.19649.qm@web51104.mail.re2.yahoo.com> References: <549544.19649.qm@web51104.mail.re2.yahoo.com> Message-ID: <47775E5F.9030103@eprometeus.com> Lone Wolf ha scritto: > Hi. > How/Where to get Erlang version for Linux (Ubuntu7.10)? > Erlang download page doesn't show binary packages of Erlang except for > Windows. > Thanks. This is more of a Linux/Ubuntu question than an Erlang question. In any case, Erlang IS available for Gutsy Gibbon (aka Ubuntu 7.10), as you can see here: http://packages.ubuntu.com/gutsy/interpreters/erlang How to get it? First, ensure that the universe repository for gutsy is in your /etc/apt/sources.list. If is not already there, add this: deb http://archive.ubuntu.com/ubuntu gutsy universe then run (as a root, from the terminal), apt-get update Secondo, you can get erlang, simply typing (again, as a root, from the terminal) apt-get install erlang That's it. -- /\/\ike From matthias@REDACTED Sun Dec 30 10:09:59 2007 From: matthias@REDACTED (Matthias Lang) Date: Sun, 30 Dec 2007 10:09:59 +0100 Subject: [erlang-questions] Getting Erlang for Linux In-Reply-To: <549544.19649.qm@web51104.mail.re2.yahoo.com> References: <549544.19649.qm@web51104.mail.re2.yahoo.com> Message-ID: <18295.24679.44054.62747@antilipe.corelatus.se> Lone Wolf writes: > How/Where to get Erlang version for Linux (Ubuntu7.10)? Erlang > download page doesn't show binary packages of Erlang except for > Windows. Thanks. There's a debian (ubuntu) package for Erlang, called "erlang". So you can just install it in the same way you install any other package for Ubuntu: http://packages.ubuntu.com/cgi-bin/search_packages.pl?keywords=erlang&searchon=names&subword=1&version=gutsy&release=all (I use Debian, so I'd do this to install: 'sudo apt-get install erlang'. Ubuntu is probably the same, but I'm not sure.) Matthias From 0x6e6562@REDACTED Sun Dec 30 10:28:36 2007 From: 0x6e6562@REDACTED (Ben Hood) Date: Sun, 30 Dec 2007 09:28:36 +0000 Subject: [erlang-questions] Debugger crashes Message-ID: <16567772-4264-4143-BB94-5CF29397AF00@gmail.com> Hi, I've recently upgraded to R12 and the debugger has become unstable. It is not easy to reproduce the error - it seems to occur after having stepped through a lot of code. Upon googling this, I found a old post that referred to R115 (http://www.erlang.org/pipermail/erlang-questions/2007-June/026932.html ) which describes this problem with the same trace as I have appended below. Has anybody seen this with R12? I am using OSX 1.5.1 with R12B-0 and it doesn't seem to make a difference if I use tcl/tk 8.4.9 or 8.5. Thx, Ben ---------------------------------------------------------------------------- GS frontend. Last mgs in was:{<0.3260.0>,{destroy,750}} exit:{<0.3260.0>,{destroy,750}} Reason: {'EXIT', {function_clause, [{gs_frontend,remove_objs, [193, {error, {{badmatch,[]}, [{gstk_db,opt,3}, {gstk_gridline,delete,2}, {gstk,delete_only_this_widget,2}, {gstk,destroy_impl,2}, {gstk,doit,2}, {gstk,loop,1}]}}]}, {gs_frontend,doit,2}, {gs_frontend,loop,1}]}} =ERROR REPORT==== 13-Dec-2007::09:34:11 === Error in process <0.3212.0> with exit value: {{badmatch,[]}, [{gstk_db,opt,3},{gstk_gridline,delete,2}, {gstk,delete_only_this_widget,2},{gstk,destroy_impl,2},{gstk,doit,2}, {gstk,loop,1}]} -------------- next part -------------- An HTML attachment was scrubbed... URL: From eajam@REDACTED Sun Dec 30 10:30:51 2007 From: eajam@REDACTED (eajam@REDACTED) Date: Sun, 30 Dec 2007 09:30:51 +0000 Subject: [erlang-questions] Getting Erlang for Linux In-Reply-To: <549544.19649.qm@web51104.mail.re2.yahoo.com> References: <549544.19649.qm@web51104.mail.re2.yahoo.com> Message-ID: Feisty had an older copy... http://packages.ubuntu.com/feisty/interpreters/erlang-base Gusty doesn't seem to have a recent binary. I personally download it from "erlang.org" and compile it. It works every time! FYI... http://blog.ciarang.com/index.php/archives/93 Cheers, Alex Date: Sat, 29 Dec 2007 23:37:51 -0800From: hubaghdadi@REDACTED: erlang-questions@REDACTED: [erlang-questions] Getting Erlang for LinuxHi.How/Where to get Erlang version for Linux (Ubuntu7.10)?Erlang download page doesn't show binary packages of Erlang except for Windows.Thanks. Deep into that darkness peering, long I stood there, wondering, fearing, Doubting, dreaming dreams no mortal ever dreamed before. E.A Poe Looking for last minute shopping deals? Find them fast with Yahoo! Search. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmitrii@REDACTED Sun Dec 30 17:17:26 2007 From: dmitrii@REDACTED (Dmitrii Dimandt) Date: Sun, 30 Dec 2007 18:17:26 +0200 Subject: [erlang-questions] Getting Erlang for Linux In-Reply-To: <549544.19649.qm@web51104.mail.re2.yahoo.com> References: <549544.19649.qm@web51104.mail.re2.yahoo.com> Message-ID: On 12/30/07, Lone Wolf wrote: > > Hi. > How/Where to get Erlang version for Linux (Ubuntu7.10)? > Erlang download page doesn't show binary packages of Erlang except for > Windows. > Thanks. There's an older version in packages (look for erlang package in Synaptic). It's R11B I think. If you want to get the latest release right now, you'll have to download the source and build erlang from source. My past encounters with erlang source were quite pleasant - it compiled without a glitch on both suSE 10.2 and Ubuntu 6.06 -------------- next part -------------- An HTML attachment was scrubbed... URL: From vances@REDACTED Mon Dec 31 03:13:26 2007 From: vances@REDACTED (Vance Shipley) Date: Sun, 30 Dec 2007 21:13:26 -0500 Subject: [erlang-questions] Directly matching record fields illegal? Message-ID: <20071231021326.GB773@h216-235-12-173.host.egate.net> This suprised me, has it always been this way? 5> Foo#foo.ref = Bar#bar.ref. ** 1: illegal pattern ** 6> F = Foo#foo.ref. 1 7> B = Bar#bar.ref. 1 8> F = B. 1 -- -Vance From vychodil.hynek@REDACTED Mon Dec 31 12:44:12 2007 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Mon, 31 Dec 2007 12:44:12 +0100 Subject: [erlang-questions] Directly matching record fields illegal? In-Reply-To: <20071231021326.GB773@h216-235-12-173.host.egate.net> References: <20071231021326.GB773@h216-235-12-173.host.egate.net> Message-ID: <4d08db370712310344l1805cbf8q6c9c87b16ad937@mail.gmail.com> I don't understand what you want do. If you want make new record likely Foo but with some atribute same as Bar you must write (14): 1> rd(foo, {ref=1, val=1}). foo 12> Foo = #foo{ref=1,val=1}. #foo{ref = 1,val = 1} 13> Bar = #foo{ref=2,val=2}. #foo{ref = 2,val = 2} 14> Baz = Foo#foo{val=Bar#foo.val}. #foo{ref = 1,val = 2} If you want make matching constrain, you must write: 15> Bar = Bar#foo{ref = Foo#foo.ref}. ** exited: {{badmatch,{foo,1,2}},[{erl_eval,expr,3}]} ** or: 17> F = Foo#foo.ref, F = Bar#foo.ref. ** exited: {{badmatch,2},[{erl_eval,expr,3}]} ** But if you want just compare, write 18> Foo#foo.ref == Bar#foo.ref. false On 12/31/07, Vance Shipley wrote: > This suprised me, has it always been this way? > > 5> Foo#foo.ref = Bar#bar.ref. > ** 1: illegal pattern ** > > 6> F = Foo#foo.ref. > 1 > 7> B = Bar#bar.ref. > 1 > 8> F = B. > 1 > > -- > -Vance > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-questions > -- --Hynek (Pichi) Vychodil