From christophe.romain@REDACTED Sat Jul 1 00:34:48 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Sat, 1 Jul 2006 00:34:48 +0200 Subject: lightweight Erlang with package management Message-ID: <81de9effa7195bad031857f073ca0224@process-one.net> New version of erlrt is available ! http://erlrt.process-one.net/ erlrt allows to install a minimal binary version of erlang base system by downloading a 1.4Mb self extractable archive. Binary packages are now provided for: MacOSX (powerpc), Linux (alpha, amd64, arm, hppa, ia64, mips, mipsel, powerpc, s390, sparc, x86), SunOS (sparc), Windows. A package management with simple dependency handling (level 1 dependences only) is to be tested in that second version of erlrt. erlrt aims to be for Erlang what CPAN is for Perl. we are ready to add several erlang applications into erlrt if packaged the otp way. usage: list available packages > erlrt:available(). list installed packages > erlrt:installed(). check for an installed packages (returns true/false) > erlrt:installed(mnesia). install a package (mnesia as example) > erlrt:install(mnesia). uninstall a package (mnesia as example) > erlrt:uninstall(mnesia). upgrade a package (ejabberd as example) > erlrt:upgrade(ejabberd). upgrade the whole distribution > erlrt:upgrade(). session exemple: chris@REDACTED:~/Desktop> sh install_erlrt.sh please wait... Erlang (BEAM) emulator version 5.4.13 [source] [hipe] [threads:0] Erlang/OTP R10B-10 darwin-powerpc stripped runtime environment Eshell V5.4.13 (abort with ^G) 1> erlrt:install(tv). + gs md5=<<109,155,181,199,32,47,247,71,239,109,204,124,122,0,61,143>> + mnesia md5=<<206,204,38,247,43,206,40,49,126,67,81,24,238,13,109,24>> + pman md5=<<86,63,0,213,103,200,76,219,187,140,187,148,113,171,196,202>> + tv md5=<<140,111,173,82,54,59,41,75,152,229,22,229,210,127,62,128>> ok 2> Many thanks to Bengt Kleberg who hellped to make scripts not to be "bash specific", gives erlrt web proxy support, and added the sunos-sparc support in both erlrt and repos. From ulf@REDACTED Sat Jul 1 00:55:47 2006 From: ulf@REDACTED (Ulf Wiger) Date: Sat, 01 Jul 2006 00:55:47 +0200 Subject: A Taste of Erlang, a Dynamic, Asynchronous Message-Passing Language In-Reply-To: <21D61D04-1218-4B8D-994D-36E27593C813@process-one.net> References: <21D61D04-1218-4B8D-994D-36E27593C813@process-one.net> Message-ID: Den 2006-06-30 23:29:54 skrev Micka?l R?mond : > Hello, > > I thought you might be interested by this new article on Erlang: > > A Taste of Erlang, a Dynamic, Asynchronous Message-Passing Language > http://www.informit.com/articles/article.asp?p=482670&seqNum=1&rl=1 > > This is again very good press :-) Yes, indeed. Overall a nice article. Curious, though, that he lists as a weakness the difficulty of doing a remote procedure call. I've personally never thought that rpc:call(Node,M,F,A) is particularly difficult to understand or use. Why, you don't even have to write marshalling code. "at the very least you should be able to wait for a specific message and then grab it from the message queue while still processing another message." Indeed, and this is particularly easy to do in Erlang, while quite difficult in, say, UML. What am I missing here? /Ulf W -- Ulf Wiger From david.nospam.hopwood@REDACTED Sat Jul 1 01:20:07 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Sat, 01 Jul 2006 00:20:07 +0100 Subject: Article: A Taste of Erlang.. In-Reply-To: <44A5937F.9060405@fernuni-hagen.de> References: <44A5937F.9060405@fernuni-hagen.de> Message-ID: <44A5B1A7.8010009@blueyonder.co.uk> Marc van Woerkom wrote: > This came in via Google alert: > > http://www.informit.com/articles/article.asp?p=482670&rl=1 On page 6 (http://www.informit.com/articles/article.asp?p=482670&seqNum=6&rl=1) # Erlang is far from perfect. The biggest limitation I?ve encountered is that # there's no neat way of doing a remote function call. While asynchronous # programming is easier to scale, you sometimes need to send a message and wait # for the result before you can proceed. Ideally, you would save the state related # to the current message and proceed with processing the next one, but at the very # least you should be able to wait for a specific message and then grab it from # the message queue while still processing another message. Maybe the RPC module, and selective receive, are not well-enough signposted in the docs and tutorials. Anyway, I have posted a comment to the article to address this. -- David Hopwood From rsaccon@REDACTED Sat Jul 1 05:17:39 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Sat, 1 Jul 2006 00:17:39 -0300 Subject: Problem with smtp_client-1.1 Message-ID: I try to use smtp_client (inside yaws, but also standalone) to send e-mails, but I get an error when the SMTP-FiniteStateMachine starts to send the message: mfrom_error "501 Bad address syntax\r\n" the from-address in this case is: rsaccon@REDACTED , and I don't see what could be wrong with it. And all previous steps work fine, including authentication. the actual function executed when the error happens is: gen_fsm:sync_send_event(Fsm,{mfrom,Address}). All did was just compiling smtp_fsm.erl and run it form the erlang shell (or inside my yaws app with same result). But I am erlang novice, so maybe just my environmental setup is incomplete ? Or what else could cause this strange error ? regards -- Roberto Saccon From surindar.shanthi@REDACTED Sat Jul 1 06:36:50 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Sat, 1 Jul 2006 10:06:50 +0530 Subject: Erlang version Message-ID: <42ea5fb60606302136u6f459a05n266e4fb2219e7b51@mail.gmail.com> Dear all, Please tell me which version of Erlang is good to use with? -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From kruegger@REDACTED Sat Jul 1 06:55:04 2006 From: kruegger@REDACTED (Stephen Han) Date: Fri, 30 Jun 2006 21:55:04 -0700 Subject: Article: A Taste of Erlang.. In-Reply-To: <44A5B1A7.8010009@blueyonder.co.uk> References: <44A5937F.9060405@fernuni-hagen.de> <44A5B1A7.8010009@blueyonder.co.uk> Message-ID: <86f1f5350606302155n7880d1afm54af0291dfaae738@mail.gmail.com> Irony is how come the "Related Book" appears in the Article Information box is "Python"? On 6/30/06, David Hopwood wrote: > > Marc van Woerkom wrote: > > This came in via Google alert: > > > > http://www.informit.com/articles/article.asp?p=482670&rl=1 > > On page 6 ( > http://www.informit.com/articles/article.asp?p=482670&seqNum=6&rl=1) > > # Erlang is far from perfect. The biggest limitation I've encountered is > that > # there's no neat way of doing a remote function call. While asynchronous > # programming is easier to scale, you sometimes need to send a message and > wait > # for the result before you can proceed. Ideally, you would save the state > related > # to the current message and proceed with processing the next one, but at > the very > # least you should be able to wait for a specific message and then grab it > from > # the message queue while still processing another message. > > Maybe the RPC module, and selective receive, are not well-enough > signposted in > the docs and tutorials. > > Anyway, I have posted a comment to the article to address this. > > -- > David Hopwood > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ke.han@REDACTED Sat Jul 1 09:31:32 2006 From: ke.han@REDACTED (ke han) Date: Sat, 1 Jul 2006 15:31:32 +0800 Subject: Erlang version In-Reply-To: <42ea5fb60606302136u6f459a05n266e4fb2219e7b51@mail.gmail.com> References: <42ea5fb60606302136u6f459a05n266e4fb2219e7b51@mail.gmail.com> Message-ID: "use" with what?? As far as I know, all the major erlang libraries and third party projects work with the latest release R11B-0. If your just starting out, then start with the latest release. enjoy, ke han On Jul 1, 2006, at 12:36 PM, Surindar Sivanesan wrote: > > Dear all, > > Please tell me which version of Erlang is good to use with? > > -- > with regards, > S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From surindar.shanthi@REDACTED Sat Jul 1 09:34:16 2006 From: surindar.shanthi@REDACTED (Surindar Sivanesan) Date: Sat, 1 Jul 2006 13:04:16 +0530 Subject: Erlang version In-Reply-To: References: <42ea5fb60606302136u6f459a05n266e4fb2219e7b51@mail.gmail.com> Message-ID: <42ea5fb60607010034p3083e470h1754e64acd3426e4@mail.gmail.com> Thanx for your suggestion On 7/1/06, ke han wrote: > > "use" with what?? As far as I know, all the major erlang libraries > and third party projects work with the latest release R11B-0. If your just > starting out, then start with the latest release. > enjoy, ke han > > > > On Jul 1, 2006, at 12:36 PM, Surindar Sivanesan wrote: > > > Dear all, > > Please tell me which version of Erlang is good to use with? > > -- > with regards, > S.Surindar > > > -- with regards, S.Surindar -------------- next part -------------- An HTML attachment was scrubbed... URL: From ke.han@REDACTED Sat Jul 1 09:34:24 2006 From: ke.han@REDACTED (ke han) Date: Sat, 1 Jul 2006 15:34:24 +0800 Subject: Article: A Taste of Erlang.. In-Reply-To: <86f1f5350606302155n7880d1afm54af0291dfaae738@mail.gmail.com> References: <44A5937F.9060405@fernuni-hagen.de> <44A5B1A7.8010009@blueyonder.co.uk> <86f1f5350606302155n7880d1afm54af0291dfaae738@mail.gmail.com> Message-ID: <85A2468B-1A2E-4FA5-A644-F6F84AF645C4@redstarling.com> On Jul 1, 2006, at 12:55 PM, Stephen Han wrote: > Irony is how come the "Related Book" appears in the Article > Information box is "Python"? Irony it is not...it is a simple reality there are no in-print English books on erlang. I would assume if there were one, the author may have referenced it instead of a python substitute. ke han From ke.han@REDACTED Sat Jul 1 09:54:13 2006 From: ke.han@REDACTED (ke han) Date: Sat, 1 Jul 2006 15:54:13 +0800 Subject: lightweight Erlang with package management In-Reply-To: <5a2ffbc483bc6d68ed166f46c0229d6c@process-one.net> References: <5a2ffbc483bc6d68ed166f46c0229d6c@process-one.net> Message-ID: <8334AF9A-B248-4957-BBAF-53D766075310@redstarling.com> I am in process of compiling archives for OS X intel and freeBSD 6.1. How should I test / upload the archives when the compiles are done? ke han On Jun 30, 2006, at 9:39 PM, Christophe Romain wrote: > New version of erlrt is available ! > http://erlrt.process-one.net/ > > erlrt aims to be for Erlang what CPAN is for Perl. > > It allows to install a minimal binary version of erlang base system > by downloading a 1.4Mb self extractable archive. Binary packages > are now provided for: > MacOSX (powerpc), Linux (alpha, amd64, arm, hppa, ia64, mips, > mipsel, powerpc, s390, sparc, x86), SunOS (sparc), Windows. > > A package management with simple dependency handling (level 1 > dependences only) is to be tested in that second version of erlrt. > > we are ready to add several erlang applications into erlrt if > packaged the otp way. > > new usage: > > list available packages > > erlrt:available(). > list installed packages > > erlrt:installed(). > check for an installed packages (returns true/false) > > erlrt:installed(mnesia). > install a package (mnesia as example) > > erlrt:install(mnesia). > uninstall a package (mnesia as example) > > erlrt:uninstall(mnesia). > upgrade a package (ejabberd as example) > > erlrt:upgrade(ejabberd). > upgrade the whole distribution > > erlrt:upgrade(). > > > session exemple: > chris@REDACTED:~/Desktop> sh install_erlrt.sh > please wait... > Erlang (BEAM) emulator version 5.4.13 [source] [hipe] [threads:0] > > Erlang/OTP R10B-10 darwin-powerpc stripped runtime environment > Eshell V5.4.13 (abort with ^G) > 1> erlrt:install(tv). > + gs md5=<<109,155,181,199,32,47,247,71,239,109,204,124,122,0,61,143>> > + mnesia > md5=<<206,204,38,247,43,206,40,49,126,67,81,24,238,13,109,24>> > + pman > md5=<<86,63,0,213,103,200,76,219,187,140,187,148,113,171,196,202>> > + tv md5=<<140,111,173,82,54,59,41,75,152,229,22,229,210,127,62,128>> > ok > 2> > > Many thanks to Bengt Kleberg who hellped to make scripts not to be > "bash specific", gives erlrt web proxy support, and added the sunos- > sparc support in both erlrt and repos. From christophe.romain@REDACTED Sat Jul 1 10:07:20 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Sat, 1 Jul 2006 10:07:20 +0200 Subject: lightweight Erlang with package management Message-ID: <8318dd0bb6402f97081d16c0bffcab3c@process-one.net> > How should I test / upload the archives when the compiles are done? > if you are using the archive-maker tool from the erlrt site, you can launch the compiled version with /sources/otp_src_R10B-10/bin/erl if compilation is OK, the 3Mb generated archive should be OK as well. when compilation finishes, the script tells you to send the 3Mb archive by email at contrib (AT) process-one (DOT) net This way I can integrate and test it as well. If you wan to compile R11B-0, you can set OTP="R11B-0" into make_build.sh and restart the process. Thanks ! From christophe.romain@REDACTED Sat Jul 1 10:14:59 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Sat, 1 Jul 2006 10:14:59 +0200 Subject: multi platform support into standard Erlang packaging Message-ID: <18c0672bad132fb05de2d69036add197@process-one.net> hello, While packaging erlang apps for several platforms, we face the problem of architecture specific bin/lib location. the usual place is /priv/lib/.so and /priv/bin/ All application subdirectories are common to all platforms except the priv directory. As a result, a maintainer who wants to package an Erlang application must make as much packages as supported architectures. In any cases, only the content of the priv directory is changing. Wouldn't it be nice to define a generic and standard location for priv things that allow to have many platforms into the same priv directory ? example: myapp-1.0/ src/ include/ ebin/ priv/ lib/linux-x86/ lib/darwin-powerpc/ lib/windows/ bin/windows/ REPOS actually does this and exports [libpath/1,binpath/1] erlang code that needs to load drivers are changed from LibDir = code:priv_dir(?MODULE) ++ "/lib", to LibDir = repos:libdir(?MODULE), That would be great not to patch erlang code to reach such binary stuff ! What do you think about ? From andreas.hillqvist@REDACTED Sat Jul 1 20:30:17 2006 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Sat, 1 Jul 2006 19:30:17 +0100 Subject: Erlang and AI reserach or practical experience In-Reply-To: <44A52F97.60607@diit.unict.it> References: <44A52F97.60607@diit.unict.it> Message-ID: <8268eea30607011130s43b3890eiad9c135198045cd5@mail.gmail.com> Thank you for your response. I have had som experiencce with ERESYE in a course at my university. I will have to look in to that. I have an intressted in AI afer our course where we applied erlang on the virtual leage of robotcup . P.S. I attended your thesis presentation at Erlang Training & Consulting. So whe have shortly meet before. ;) D.S. 2006/6/30, Corrado Santoro : > Thanks Ulf for the advertising :-) > > And Andreas, if you want to get the software, please contact me directly. > > All the best, > --Corrado > > Ulf Wiger (AL/EAB) ha scritto: > > > > At EUC 2005: > > > > eXAT: Software Agents in Erlang. by Corrado Santoro > > > > http://www.erlang.se/euc/05/1130Santoro.ppt > > http://www.erlang.se/euc/05/Santoro.pdf > > > > At the ACM SIGPLAN Erlang workshop 2005: > > ERESYE: Artificial Intelligence in Erlang Programs, by > > Antonella Di Stefano, Francesca Gangemi, and Corrado Santoro > > > > http://www.erlang-consulting.com/erlangworkshop05/eresye.pdf > > > > That should get you started. > > > > BR, > > Ulf W > > > > > > ________________________________ > > > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Andreas > > Hillqvist > > Sent: den 26 juni 2006 15:49 > > To: erlang-questions@REDACTED > > Subject: Erlang and AI reserach or practical experience > > > > > > Hi. > > > > IS ther anyone who have herad of resarch or practical > > application of Erlang for AI or AI oriented projects? > > > > Regards, > > Andreas > > > > > > From headspin@REDACTED Sun Jul 2 02:07:30 2006 From: headspin@REDACTED (dda) Date: Sun, 2 Jul 2006 02:07:30 +0200 Subject: Strings (was: Re: are Mnesia tables immutable?) In-Reply-To: <200606290641.k5T6fMeJ333849@atlas.otago.ac.nz> References: <200606290641.k5T6fMeJ333849@atlas.otago.ac.nz> Message-ID: Oh, by the way, UTF stands for Unicode *Transformation* Format, not transmission... http://www.unicode.org/faq/utf_bom.html#14 I guess we all miss a bit or two in the docs... -- Didier On 6/29/06, Richard A. O'Keefe wrote: > True, there are all sorts of good things about UTF-8. It's really cool > that modern systems come with UTF-8 locales set by default so I can type > practically _anything_ in TextEdit. BUT it's a *Transmission* format, > that's what the "T" and "F" stand for. It was never designed to be > used for serious *processing* From jocke@REDACTED Sun Jul 2 23:25:45 2006 From: jocke@REDACTED (Joakim G.) Date: Sun, 02 Jul 2006 23:25:45 +0200 Subject: A Taste of Erlang, a Dynamic, Asynchronous Message-Passing Language In-Reply-To: References: <21D61D04-1218-4B8D-994D-36E27593C813@process-one.net> Message-ID: <44A839D9.7010003@tail-f.com> Ulf Wiger wrote: > Den 2006-06-30 23:29:54 skrev Micka?l R?mond > : > Curious, though, that he lists as a weakness the difficulty of doing a > remote procedure call. > > I've personally never thought that rpc:call(Node,M,F,A) is particularly > difficult to understand or use. Why, you don't even have to write > marshalling code. > > "at the very least you should be able to wait for a > specific message and then grab it from the message > queue while still processing another message." > > Indeed, and this is particularly easy to do in Erlang, while quite > difficult in, say, UML. > > What am I missing here? I suppose he misses a built-in language construct to do rpc. Like Joes !! proposal. I miss !! too. To use a library call for such an important concept does not feel right. /Jocke From joe.armstrong@REDACTED Mon Jul 3 10:07:21 2006 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Mon, 3 Jul 2006 10:07:21 +0200 Subject: lightweight Erlang with package management Message-ID: Brilliant, well done. Just what we need. Comments 1) Remote install extension One nice feature that you might like to add to erlrt is the ability to do remote installs. Let's assume somebody (A) has accounts on machines (B1, B2, B3, ...., Bn) N might be large. >From A I'd like to remotely install the base system on all the B's. << This is what I did for planetErl (Erlang on planet lab) where n = 688. Here the problem is to "push" an Erlang onto 688 different nodes This I did using os:cmd("rsh ...") commands. The script could install and start an erlang daemon on all 688 machines >> 2) Windows install Wings http://www.wings3d.com/ has a windows binary installer, you might like to look to see how this was done. << Just a thought - in order to make a half workable windows environment I usually install a smallish number of extras - the mingw32 msys stuff, with ssh etc and and emacs --- Once we have installed erlrt then I guess it would be easy to write a package that installs a "standard" environment for windows - (all I need is a "wget" in Erlang, and I guess something like wget is hidden inside erlrt :-) /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of > Christophe Romain > Sent: den 1 juli 2006 00:35 > To: erlang-questions@REDACTED > Subject: lightweight Erlang with package management > > New version of erlrt is available ! > http://erlrt.process-one.net/ > > erlrt allows to install a minimal binary version of erlang > base system by downloading a 1.4Mb self extractable archive. > Binary packages are now provided for: > MacOSX (powerpc), Linux (alpha, amd64, arm, hppa, ia64, mips, > mipsel, powerpc, s390, sparc, x86), SunOS (sparc), Windows. > > A package management with simple dependency handling (level 1 > dependences only) is to be tested in that second version of erlrt. > > erlrt aims to be for Erlang what CPAN is for Perl. > we are ready to add several erlang applications into erlrt if > packaged the otp way. > > usage: > > list available packages > > erlrt:available(). > list installed packages > > erlrt:installed(). > check for an installed packages (returns true/false) > > erlrt:installed(mnesia). > install a package (mnesia as example) > > erlrt:install(mnesia). > uninstall a package (mnesia as example) > > erlrt:uninstall(mnesia). > upgrade a package (ejabberd as example) > > erlrt:upgrade(ejabberd). > upgrade the whole distribution > > erlrt:upgrade(). > > > session exemple: > chris@REDACTED:~/Desktop> sh install_erlrt.sh please wait... > Erlang (BEAM) emulator version 5.4.13 [source] [hipe] [threads:0] > > Erlang/OTP R10B-10 darwin-powerpc stripped runtime > environment Eshell V5.4.13 (abort with ^G) > 1> erlrt:install(tv). > + gs md5=<<109,155,181,199,32,47,247,71,239,109,204,124,122,0,61,143>> > + mnesia > md5=<<206,204,38,247,43,206,40,49,126,67,81,24,238,13,109,24>> > + pman > md5=<<86,63,0,213,103,200,76,219,187,140,187,148,113,171,196,202>> > + tv md5=<<140,111,173,82,54,59,41,75,152,229,22,229,210,127,62,128>> > ok > 2> > > Many thanks to Bengt Kleberg who hellped to make scripts not > to be "bash specific", gives erlrt web proxy support, and > added the sunos-sparc support in both erlrt and repos. > > From christophe.romain@REDACTED Mon Jul 3 12:34:36 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Mon, 3 Jul 2006 12:34:36 +0200 Subject: lightweight Erlang with package management In-Reply-To: References: Message-ID: Thank you Joe ! > 1) Remote install extension very interresting feature ! if you have ssh or rsh and an account on all systems, using os:cmd is a way to do that. anyway we have erlang/lib/ssh/ebin/ssh_sftp that could help. I'll look at > 2) Windows install I'll look at wings installer, but it will be difficult for me to help on windows. any volunteer or tester ? > I guess it would be easy to write a package that installs a "standard" > environment for > windows you're right, it's even possible to make windows base system containing this standard environment. > all I need is a "wget" in Erlang, and I guess something like wget erlrt is using ibrowse From vladdu55@REDACTED Mon Jul 3 13:52:25 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 3 Jul 2006 13:52:25 +0200 Subject: lightweight Erlang with package management In-Reply-To: References: Message-ID: <95be1d3b0607030452s6eab1600v885f495a5747a4e@mail.gmail.com> Hi, On 7/3/06, Christophe Romain wrote: > > 2) Windows install > I'll look at wings installer, but it will be difficult for me to help > on windows. > any volunteer or tester ? I'll be glad to help, but after I return from vacation in a month from now :-) Is there a way to identify the correct implementation to use for one's current platform? It would be even nicer if there was a small client that would detect the running platform and if erlang is already installed, and if not, download and install the appropriate base.tgz. This way, one could distribute applications and let their installation script/program install Erlang too. best regards, Vlad From joe.armstrong@REDACTED Mon Jul 3 16:11:43 2006 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Mon, 3 Jul 2006 16:11:43 +0200 Subject: Best windows installer? was : RE: lightweight Erlang with package management Message-ID: Can anybody advise on a good windows installer? requirements: - open source - minimal - adware-free What we don't need is all the goodies - just the basics /Joe > -----Original Message----- > From: Christophe Romain [mailto:christophe.romain@REDACTED] > Sent: den 3 juli 2006 12:35 > To: Joe Armstrong (AL/EAB) > Cc: erlang-questions@REDACTED > Subject: Re: lightweight Erlang with package management > > Thank you Joe ! > > > > 1) Remote install extension > very interresting feature ! > if you have ssh or rsh and an account on all systems, using > os:cmd is a way to do that. > anyway we have erlang/lib/ssh/ebin/ssh_sftp that could help. > I'll look at > > > 2) Windows install > I'll look at wings installer, but it will be difficult for me > to help on windows. > any volunteer or tester ? > > > I guess it would be easy to write a package that installs a > "standard" > > environment for > > windows > you're right, it's even possible to make windows base system > containing this standard environment. > > > all I need is a "wget" in Erlang, and I guess something like wget > erlrt is using ibrowse > > From trapexit.erlang-questions@REDACTED Mon Jul 3 16:25:12 2006 From: trapexit.erlang-questions@REDACTED (Trap Exit) Date: Mon, 03 Jul 2006 15:25:12 +0100 Subject: Test from Trap Exit to erlang-questions (Pleas ignore this) References: Message-ID: <20060703142512.AF01D5A1C8@mail.erlangsystems.com> Did it get through- _________________________________________________________ Sent using Mail2Forum (http://www.mail2forum.com) Read this topic online here: http://trapexit.erlang-consulting.com/forum/viewtopic.php?p=54#54 -------------- next part -------------- An HTML attachment was scrubbed... URL: From trapexit.erlang-questions@REDACTED Mon Jul 3 16:29:19 2006 From: trapexit.erlang-questions@REDACTED (Trap Exit) Date: Mon, 03 Jul 2006 15:29:19 +0100 Subject: Test from Trap Exit to erlang-questions (Pleas ignore this) References: Message-ID: <20060703142919.B0B7A5A1C8@mail.erlangsystems.com> testing test test _________________________________________________________ Sent using Mail2Forum (http://www.mail2forum.com) Read this topic online here: http://trapexit.erlang-consulting.com/forum/viewtopic.php?p=55#55 -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Mon Jul 3 16:37:20 2006 From: serge@REDACTED (Serge Aleynikov) Date: Mon, 03 Jul 2006 10:37:20 -0400 Subject: Best windows installer? was : RE: lightweight Erlang with package management In-Reply-To: References: Message-ID: <44A92BA0.2050004@hq.idt.net> You can try this scriptable open-source system: http://nsis.sourceforge.net Serge Joe Armstrong (AL/EAB) wrote: > > Can anybody advise on a good windows installer? > > requirements: > > - open source > - minimal > - adware-free > > What we don't need is all the goodies - just the basics > > /Joe > > >> -----Original Message----- >> From: Christophe Romain [mailto:christophe.romain@REDACTED] >> Sent: den 3 juli 2006 12:35 >> To: Joe Armstrong (AL/EAB) >> Cc: erlang-questions@REDACTED >> Subject: Re: lightweight Erlang with package management >> >> Thank you Joe ! >> >> >>> 1) Remote install extension >> very interresting feature ! >> if you have ssh or rsh and an account on all systems, using >> os:cmd is a way to do that. >> anyway we have erlang/lib/ssh/ebin/ssh_sftp that could help. >> I'll look at >> >>> 2) Windows install >> I'll look at wings installer, but it will be difficult for me >> to help on windows. >> any volunteer or tester ? >> >>> I guess it would be easy to write a package that installs a >> "standard" >>> environment for >>> windows >> you're right, it's even possible to make windows base system >> containing this standard environment. >> >>> all I need is a "wget" in Erlang, and I guess something like wget >> erlrt is using ibrowse >> >> > From trapexit.erlang-questions@REDACTED Mon Jul 3 16:48:34 2006 From: trapexit.erlang-questions@REDACTED (Trap Exit) Date: Mon, 03 Jul 2006 15:48:34 +0100 Subject: Test References: Message-ID: <20060703144834.26E4A5A1C8@mail.erlangsystems.com> Test _________________________________________________________ Sent using Mail2Forum (http://www.mail2forum.com) Read this topic online here: http://trapexit.erlang-consulting.com/forum/viewtopic.php?p=60#60 -------------- next part -------------- An HTML attachment was scrubbed... URL: From trapexit.erlang-questions@REDACTED Mon Jul 3 17:06:50 2006 From: trapexit.erlang-questions@REDACTED (Trap Exit) Date: Mon, 03 Jul 2006 16:06:50 +0100 Subject: Test References: Message-ID: <20060703150650.1CEA95A1C8@mail.erlangsystems.com> sgsagfdagafd _________________________________________________________ Sent using Mail2Forum (http://www.mail2forum.com) Read this topic online here: http://trapexit.erlang-consulting.com/forum/viewtopic.php?p=63#63 From ke.han@REDACTED Mon Jul 3 17:17:13 2006 From: ke.han@REDACTED (ke han) Date: Mon, 3 Jul 2006 23:17:13 +0800 Subject: Best windows installer? was : RE: lightweight Erlang with package management In-Reply-To: References: Message-ID: Nullsoft has been around a while and seems to be pretty well supported. http://nsis.sourceforge.net/Main_Page Another interesting one is WiX http://sourceforge.net/projects/wix/ ke han On Jul 3, 2006, at 10:11 PM, Joe Armstrong ((AL/EAB)) wrote: > > Can anybody advise on a good windows installer? > > requirements: > > - open source > - minimal > - adware-free > > What we don't need is all the goodies - just the basics > > /Joe > > >> -----Original Message----- >> From: Christophe Romain [mailto:christophe.romain@REDACTED] >> Sent: den 3 juli 2006 12:35 >> To: Joe Armstrong (AL/EAB) >> Cc: erlang-questions@REDACTED >> Subject: Re: lightweight Erlang with package management >> >> Thank you Joe ! >> >> >>> 1) Remote install extension >> very interresting feature ! >> if you have ssh or rsh and an account on all systems, using >> os:cmd is a way to do that. >> anyway we have erlang/lib/ssh/ebin/ssh_sftp that could help. >> I'll look at >> >>> 2) Windows install >> I'll look at wings installer, but it will be difficult for me >> to help on windows. >> any volunteer or tester ? >> >>> I guess it would be easy to write a package that installs a >> "standard" >>> environment for >>> windows >> you're right, it's even possible to make windows base system >> containing this standard environment. >> >>> all I need is a "wget" in Erlang, and I guess something like wget >> erlrt is using ibrowse >> >> From christophe.romain@REDACTED Mon Jul 3 17:22:43 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Mon, 3 Jul 2006 17:22:43 +0200 Subject: lightweight Erlang with package management In-Reply-To: <95be1d3b0607030452s6eab1600v885f495a5747a4e@mail.gmail.com> References: <95be1d3b0607030452s6eab1600v885f495a5747a4e@mail.gmail.com> Message-ID: <4990fd36c35ec729f8e0c047ed2dcf27@process-one.net> On 3 juil. 06, at 13:52, Vlad Dumitrescu wrote: > Hi, > > On 7/3/06, Christophe Romain wrote: >> > 2) Windows install >> I'll look at wings installer, but it will be difficult for me to help >> on windows. >> any volunteer or tester ? > > I'll be glad to help, but after I return from vacation in a month from > now :-) > > Is there a way to identify the correct implementation to use for one's > current platform? It would be even nicer if there was a small client > that would detect the running platform and if erlang is already > installed, and if not, download and install the appropriate base.tgz. > This way, one could distribute applications and let their installation > script/program install Erlang too. > > best regards, > Vlad > From trapexit.erlang-questions@REDACTED Mon Jul 3 17:25:15 2006 From: trapexit.erlang-questions@REDACTED (Trap Exit) Date: Mon, 03 Jul 2006 16:25:15 +0100 Subject: Test to erlang-questions@erlang.org References: Message-ID: <20060703152515.9E4855A1C8@mail.erlangsystems.com> This is a test message from trap exit to erlang-questions@REDACTED _________________________________________________________ Sent using Mail2Forum (http://www.mail2forum.com) Read this topic online here: http://trapexit.erlang-consulting.com/forum/viewtopic.php?p=69#69 From christophe.romain@REDACTED Mon Jul 3 17:26:50 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Mon, 3 Jul 2006 17:26:50 +0200 Subject: lightweight Erlang with package management In-Reply-To: <95be1d3b0607030452s6eab1600v885f495a5747a4e@mail.gmail.com> References: <95be1d3b0607030452s6eab1600v885f495a5747a4e@mail.gmail.com> Message-ID: <96d3b31fb75fac8f6120ee86e2e4ec0c@process-one.net> > Is there a way to identify the correct implementation to use for one's > current platform? the start script does that this way: arch() { case $1 in i[3456]86 ) echo x86 ;; * ) echo `uname -p | tr [:upper:] [:lower:]` ;; esac } OS=`uname -s | tr A-Z a-z` HARD=`uname -m` ARCHDIR="$OS-`arch $HARD`" export ARCHDIR note: the url of one's current platform for base.tar.gz is https://erlrt.process-one.net/R1?B/$ARCHDIR/base.tar.gz > It would be even nicer if there was a small client > that would detect the running platform and if erlang is already > installed erlrt is not necessary installed into a directory from $PATH this would be possible only for system installation with standard path for the erl script. From ken@REDACTED Mon Jul 3 17:29:30 2006 From: ken@REDACTED (Kenneth Johansson) Date: Mon, 03 Jul 2006 17:29:30 +0200 Subject: Best windows installer? was : RE: lightweight Erlang with package management In-Reply-To: References: Message-ID: <1151940570.9522.29.camel@tiger> Well it's not open source (I think) but the microsoft installer are commonly used even by open source projects. http://www.python.org/download/releases/2.4/msi/ http://www.python.org/pycon/dc2004/papers/44/ On Mon, 2006-07-03 at 16:11 +0200, Joe Armstrong (AL/EAB) wrote: > Can anybody advise on a good windows installer? > > requirements: > > - open source > - minimal > - adware-free > > What we don't need is all the goodies - just the basics > > /Joe > > > > -----Original Message----- > > From: Christophe Romain [mailto:christophe.romain@REDACTED] > > Sent: den 3 juli 2006 12:35 > > To: Joe Armstrong (AL/EAB) > > Cc: erlang-questions@REDACTED > > Subject: Re: lightweight Erlang with package management > > > > Thank you Joe ! > > > > > > > 1) Remote install extension > > very interresting feature ! > > if you have ssh or rsh and an account on all systems, using > > os:cmd is a way to do that. > > anyway we have erlang/lib/ssh/ebin/ssh_sftp that could help. > > I'll look at > > > > > 2) Windows install > > I'll look at wings installer, but it will be difficult for me > > to help on windows. > > any volunteer or tester ? > > > > > I guess it would be easy to write a package that installs a > > "standard" > > > environment for > > > windows > > you're right, it's even possible to make windows base system > > containing this standard environment. > > > > > all I need is a "wget" in Erlang, and I guess something like wget > > erlrt is using ibrowse > > > > From vladdu55@REDACTED Mon Jul 3 17:53:54 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 3 Jul 2006 16:53:54 +0100 Subject: lightweight Erlang with package management In-Reply-To: <96d3b31fb75fac8f6120ee86e2e4ec0c@process-one.net> References: <95be1d3b0607030452s6eab1600v885f495a5747a4e@mail.gmail.com> <96d3b31fb75fac8f6120ee86e2e4ec0c@process-one.net> Message-ID: <95be1d3b0607030853m35a5e269k361ed41fd2608d18@mail.gmail.com> On 7/3/06, Christophe Romain wrote: > > Is there a way to identify the correct implementation to use for one's > > current platform? > > the start script does that this way: Ah, great! I didn't realize the start script was generic. Cool! > > It would be even nicer if there was a small client > > that would detect the running platform and if erlang is already > > installed > > erlrt is not necessary installed into a directory from $PATH > this would be possible only for system installation with standard path > for the erl script. true, but it may be useful enough to check that * erl isn't on the path * there is no erlang related process running (erl.exe, beam, epmd) regards, Vlad From christophe.romain@REDACTED Mon Jul 3 17:54:48 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Mon, 3 Jul 2006 17:54:48 +0200 Subject: new erlrt port : MacOSX-x86 and OpenBSD-x86 Message-ID: <4bb3bc1bf8fcadc9bb5cc772ab81ad00@process-one.net> Thanks to Ke Han, we have MacOSX-x86 support Thanks to Jay Nelson, we have OpenBSD-x86 support From andreas.hillqvist@REDACTED Mon Jul 3 18:32:53 2006 From: andreas.hillqvist@REDACTED (Andreas Hillqvist) Date: Mon, 3 Jul 2006 17:32:53 +0100 Subject: Regarding the Trap Exit test mails Message-ID: <8268eea30607030932x2c8abb4ev57ea3e224b72a0c5@mail.gmail.com> Hi. I am seting up Trap Exit. As a part of Trap Exit where the Mail 2 Forum component that automaticly recived and sent message to the forum at trap Exit. I have made som test and configurations of this today and I am sorry if this has caused any inconvinience to any of the members of the erlang mailing lists. I can inform that trap Exit will soon be up and running. Whit some "small" face lifts. Regards, Andreas hillqvist From bengt.kleberg@REDACTED Mon Jul 3 19:57:18 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 03 Jul 2006 19:57:18 +0200 Subject: lightweight Erlang with package management In-Reply-To: <95be1d3b0607030452s6eab1600v885f495a5747a4e@mail.gmail.com> References: <95be1d3b0607030452s6eab1600v885f495a5747a4e@mail.gmail.com> Message-ID: <44A95A7E.9030600@ericsson.com> On 2006-07-03 13:52, Vlad Dumitrescu wrote: ...deleted > current platform? It would be even nicer if there was a small client > that would detect the running platform and if erlang is already > installed, and if not, download and install the appropriate base.tgz. > This way, one could distribute applications and let their installation > script/program install Erlang too. is it correct to say that you want to find out if the target computer has erlang already installed? and if not, install base.tgz? if erlang is already installed what would be the appropriate measure? for erlrt it could be to do install erlrt only, and inform erlrt about the location of the erlang installation (soft link?) bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From bengt.kleberg@REDACTED Mon Jul 3 20:10:26 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 03 Jul 2006 20:10:26 +0200 Subject: lightweight Erlang with package management In-Reply-To: References: Message-ID: <44A95D92.9030600@ericsson.com> On 2006-07-03 12:34, Christophe Romain wrote: ...delete >> 1) Remote install extension > very interresting feature ! > if you have ssh or rsh and an account on all systems, using os:cmd is a > way to do that. is it neccessary to go via os:cmd()? would not a script be simpler? it would not work under windows, but would os:cmd() help? > anyway we have erlang/lib/ssh/ebin/ssh_sftp that could help. yes, but do you know where the documentation is? bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From vladdu55@REDACTED Mon Jul 3 20:41:15 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 3 Jul 2006 19:41:15 +0100 Subject: lightweight Erlang with package management In-Reply-To: <44A95A7E.9030600@ericsson.com> References: <95be1d3b0607030452s6eab1600v885f495a5747a4e@mail.gmail.com> <44A95A7E.9030600@ericsson.com> Message-ID: <95be1d3b0607031141x114d2857vcae79015d4aa64d7@mail.gmail.com> Hi, On 7/3/06, Bengt Kleberg wrote: > On 2006-07-03 13:52, Vlad Dumitrescu wrote: > ...deleted > > current platform? It would be even nicer if there was a small client > > that would detect the running platform and if erlang is already > > installed, and if not, download and install the appropriate base.tgz. > > This way, one could distribute applications and let their installation > > script/program install Erlang too. > > is it correct to say that you want to find out if the target computer > has erlang already installed? and if not, install base.tgz? > > if erlang is already installed what would be the appropriate measure? > for erlrt it could be to do install erlrt only, and inform erlrt about > the location of the erlang installation (soft link?) Something like that, yes. Or not install at all and just use the existing one. What I had in mind was to be able to let Erlide install its own Erlang support, if there isn't any. So it's "just"(tm) to implement the uname command in Java, and then download the right archive. regards, Vlad From bengt.kleberg@REDACTED Tue Jul 4 10:11:04 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 04 Jul 2006 10:11:04 +0200 Subject: Problem with smtp_client-1.1 In-Reply-To: References: Message-ID: <44AA2298.6010803@ericsson.com> On 2006-07-01 05:17, Roberto Saccon wrote: > I try to use smtp_client (inside yaws, but also standalone) to send > e-mails, but I get an error when the SMTP-FiniteStateMachine starts to > send the message: > > mfrom_error "501 Bad address syntax\r\n" > > the from-address in this case is: rsaccon@REDACTED , and I don't sorry, but i have been unable to reproduce this error. moreover, from reading the code (yaws-1.63/applications/mail/src/smtp.erl) i can not find how that error could happen. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From yani.dzhurov@REDACTED Tue Jul 4 10:43:23 2006 From: yani.dzhurov@REDACTED (Yani Dzhurov) Date: Tue, 4 Jul 2006 11:43:23 +0300 Subject: odbc and MS sql server Message-ID: <002901c69f45$e9393c80$1500a8c0@dobrosoft.local> Hi I've been reading through the docs of odbc module and tried to establish connection to a Microsoft sql server..but without any success: {error,"No SQL-driver information available. Connection to database failed."} I've tried it to run it both from windows and freebsd machine. Does anybody know which odbc drivers I exactly need? And is it possible to connect to MS SQL server with erlang app, at all ? Thanks in advance, Jani -------------- 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: 3326 bytes Desc: not available URL: From bertil.karlsson@REDACTED Tue Jul 4 10:57:59 2006 From: bertil.karlsson@REDACTED (Bertil Karlsson) Date: Tue, 04 Jul 2006 10:57:59 +0200 Subject: http client us ascii restriction In-Reply-To: <871wtbq97p.fsf@yandex-team.ru> References: <871wtbq97p.fsf@yandex-team.ru> Message-ID: <44AA2D97.1030903@ericsson.com> Igor, thanks for notifying of this bug. I will add your patch to the next release of inets. regards Bertil Igor Goryachev wrote: > Hello. > > I have met some US ASCII restrictions in erlang's http client: > > igor@REDACTED:~% erl > Erlang (BEAM) emulator version 5.5 [source] [64-bit] [async-threads:0] [kernel-poll:false] > > Eshell V5.5 (abort with ^G) > 1> http_uri:parse("http://www.google.com/search?q=%D1%82%D0%B5%D1%81%D1%82"). > {error,no_query} > 2> > > I have made a trivial patch that fixes this misbehaviour (attached in this message): > > goryachev@REDACTED:~% erl > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [kernel-poll:false] > > Eshell V5.5 (abort with ^G) > 1> http_uri:parse("http://www.google.com/search?q=%D1%82%D0%B5%D1%81%D1%82"). > {http,"www.google.com",80,"/search","?q=%d1%82%d0%b5%d1%81%d1%82"} > 2> > > > ------------------------------------------------------------------------ > > > > From goryachev@REDACTED Tue Jul 4 11:04:37 2006 From: goryachev@REDACTED (Igor Goryachev) Date: Tue, 04 Jul 2006 13:04:37 +0400 Subject: http client us ascii restriction In-Reply-To: <44AA2D97.1030903@ericsson.com> (Bertil Karlsson's message of "Tue, 04 Jul 2006 10:57:59 +0200") References: <871wtbq97p.fsf@yandex-team.ru> <44AA2D97.1030903@ericsson.com> Message-ID: <87ac7pn3kq.fsf@yandex-team.ru> Bertil Karlsson writes: > thanks for notifying of this bug. I will add your patch to the next > release of inets. Bertil, there is also updated patch, please, see http://www.erlang.org/ml-archive/erlang-patches/200607/msg00000.html. Thanks for the attention. -- Igor Goryachev Yandex development team. From Pieter.Rautenbach@REDACTED Tue Jul 4 12:51:02 2006 From: Pieter.Rautenbach@REDACTED (Pieter Rautenbach) Date: Tue, 4 Jul 2006 12:51:02 +0200 Subject: odbc and MS sql server Message-ID: <88B5DDE8C1A06741B754B910DE2DEFBBC08437@HERMES.swistgroup.com> ******************************************************** Click here to view our e-mail legal notice: http://www.tebivo.com/email.htm or call: +27 21 888 7920 ******************************************************** Hi Jani, You can definitely access MS SQL DBs from Erlang. Take a look at the FreeTDS driver (www.freetds.org) and the unixODBC manager (www.unixodbc.org). Regards Pieter Rautenbach ________________________________ From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Yani Dzhurov Sent: 04 July 2006 10:43 AM To: erlang-questions@REDACTED Subject: odbc and MS sql server Hi I've been reading through the docs of odbc module and tried to establish connection to a Microsoft sql server....but without any success: {error,"No SQL-driver information available. Connection to database failed."} I've tried it to run it both from windows and freebsd machine. Does anybody know which odbc drivers I exactly need? And is it possible to connect to MS SQL server with erlang app, at all ? Thanks in advance, Jani -------------- next part -------------- An HTML attachment was scrubbed... URL: From Micic_V@REDACTED Tue Jul 4 13:04:59 2006 From: Micic_V@REDACTED (Valentin Micic [ MTN - Innovation Centre ]) Date: Tue, 4 Jul 2006 13:04:59 +0200 Subject: 64-Bit Erlang on SOLARIS 10 Message-ID: <23684C9CDF88C04FA8800AA825EADF5103472510@MTNMAIL.mtn.co.za> Hi, Can anybody, please, tell me what parameters to pass to configure utility in order to force 64-bit support for Erlang emulator. Thanks in advance. Valentin. NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/disclaimer -------------- next part -------------- An HTML attachment was scrubbed... URL: From per@REDACTED Tue Jul 4 13:07:55 2006 From: per@REDACTED (Per Hedeland) Date: Tue, 4 Jul 2006 13:07:55 +0200 (CEST) Subject: Problem with smtp_client-1.1 In-Reply-To: <44AA2298.6010803@ericsson.com> Message-ID: <200607041107.k64B7teI001362@pluto.hedeland.org> Bengt Kleberg wrote: > >On 2006-07-01 05:17, Roberto Saccon wrote: >> I try to use smtp_client (inside yaws, but also standalone) to send >> e-mails, but I get an error when the SMTP-FiniteStateMachine starts to >> send the message: >> >> mfrom_error "501 Bad address syntax\r\n" >> >> the from-address in this case is: rsaccon@REDACTED , and I don't > >sorry, but i have been unable to reproduce this error. >moreover, from reading the code >(yaws-1.63/applications/mail/src/smtp.erl) i can not find how that error >could happen. Presumably the error comes from the SMTP server - e.g. the SMTP protocol spec requires that the addresses given as arguments to "MAIL From:" and "RCPT To:" are enclosed in < > brackets. Many/most MTAs aren't picky about that, but some may be - in particular these days some people find that strict enforcement of standards may block messages from badly written spamware with little or no "collateral damage". It might be a good idea to have smtp.erl add the brackets (if they aren't there already) - or make sure that it always talks to a local SMTP server that still follows the old "be liberal in what you accept" adage. --Per Hedeland From yerl@REDACTED Tue Jul 4 13:20:00 2006 From: yerl@REDACTED (yerl@REDACTED) Date: Tue, 4 Jul 2006 13:20:00 +0200 Subject: odbc and MS sql server Message-ID: An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Tue Jul 4 13:59:27 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 04 Jul 2006 13:59:27 +0200 Subject: Problem with smtp_client-1.1 In-Reply-To: <200607041107.k64B7teI001362@pluto.hedeland.org> References: <200607041107.k64B7teI001362@pluto.hedeland.org> Message-ID: <44AA581F.7090805@ericsson.com> On 2006-07-04 13:07, Per Hedeland wrote: ...deleted > Presumably the error comes from the SMTP server - e.g. the SMTP protocol > spec requires that the addresses given as arguments to "MAIL From:" and > "RCPT To:" are enclosed in < > brackets. Many/most MTAs aren't picky you are correct about < > brackets. the lack thereof could cause the server to refuse to send an email. i just have a problem locating where in the erlang code the error from the SMTP server will end up as a thrown error. perhaps the error is in another smtp module, than the one i am looking at? bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From christophe.romain@REDACTED Tue Jul 4 14:17:56 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Tue, 4 Jul 2006 14:17:56 +0200 Subject: lightweight Erlang with package management In-Reply-To: <44A95D92.9030600@ericsson.com> References: <44A95D92.9030600@ericsson.com> Message-ID: <01471c00c4dfb2c0f67b41ed83411df0@process-one.net> >> anyway we have erlang/lib/ssh/ebin/ssh_sftp that could help. > > yes, but do you know where the documentation is? I have no idea about that, but code is good documentation anyway. is this module working under windows ? if yes this is certainly the best way to do remote installation everywere... if no, is remote installation even possible with windows ? From yani.dzhurov@REDACTED Tue Jul 4 15:42:30 2006 From: yani.dzhurov@REDACTED (Yani Dzhurov) Date: Tue, 4 Jul 2006 16:42:30 +0300 Subject: are function parameters copied? Message-ID: <00c401c69f6f$b22456b0$1500a8c0@dobrosoft.local> Hi, I've wondered whether functions share memory or for a function call new memory is allocated and parameters are copied ? This is what I mean: fun()-> Record = #some_record{}, fun1(Record). fun1(Record)-> fun2(Record). fun2(Record)-> fun3(Record). .fun3(Record)-> fun4(Record). fun4(Record)-> Some operations with records:. Is the VM going to copy Record four times for each function call or all functions will share this object Record:having in mind that it's immutable this shouldn't be a problem? Thanks, Jani -------------- 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: 3326 bytes Desc: not available URL: From joe.armstrong@REDACTED Tue Jul 4 16:09:18 2006 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Tue, 4 Jul 2006 16:09:18 +0200 Subject: are function parameters copied? Message-ID: In the example you give they share memory. Record = #some_record() Creates a record - this is actually stored on the heap. The local variable Record or the arguments to the functions are just tagged pointers. Virtually all objects in Erlang are represented by tagged pointers which fit into 32 bits (on a 32 bit machine) - exceptions are things like small integers, and the empty list. If you say X = {1,2,3} foo(X). Then foo(X) -> Y = g(X), ... Thing of X = {1,2,3} as doing the following: First malloc space for a {1,2,3} structure on the heap. Then create the {1,2,3} structure. Put a tagged pointer to the malloced area on the heap into X. X is (internally) a 32 bit tagged pointer. This pointer is passed into foo and so on. Heap data structures are garbage collected when they can no longer be referred to. So after the call to g(X) the space used by X can be reclaimed, if there are no other references to X. /Joe ________________________________ From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Yani Dzhurov Sent: den 4 juli 2006 15:43 To: erlang-questions@REDACTED Subject: are function parameters copied? Hi, I've wondered whether functions share memory or for a function call new memory is allocated and parameters are copied ? This is what I mean: fun()-> Record = #some_record{}, fun1(Record). fun1(Record)-> fun2(Record). fun2(Record)-> fun3(Record). .fun3(Record)-> fun4(Record). fun4(Record)-> Some operations with records.... Is the VM going to copy Record four times for each function call or all functions will share this object Record...having in mind that it's immutable this shouldn't be a problem? Thanks, Jani -------------- next part -------------- An HTML attachment was scrubbed... URL: From rsaccon@REDACTED Tue Jul 4 17:17:54 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Tue, 4 Jul 2006 12:17:54 -0300 Subject: Problem with smtp_client-1.1 In-Reply-To: <44AA581F.7090805@ericsson.com> References: <200607041107.k64B7teI001362@pluto.hedeland.org> <44AA581F.7090805@ericsson.com> Message-ID: Per and Bengt, thanks very much, after adding the brackets to the address, it works like charm ! On 7/4/06, Bengt Kleberg wrote: > On 2006-07-04 13:07, Per Hedeland wrote: > ...deleted > > Presumably the error comes from the SMTP server - e.g. the SMTP protocol > > spec requires that the addresses given as arguments to "MAIL From:" and > > "RCPT To:" are enclosed in < > brackets. Many/most MTAs aren't picky > > you are correct about < > brackets. the lack thereof could cause the > server to refuse to send an email. i just have a problem locating where > in the erlang code the error from the SMTP server will end up as a > thrown error. > perhaps the error is in another smtp module, than the one i am looking at? > > > bengt > -- > EPO guidelines 1978: "If the contribution to the known art resides > solely in a computer program then the subject matter is not > patentable in whatever manner it may be presented in the claims." > -- Roberto Saccon From apnadkarni@REDACTED Tue Jul 4 17:28:52 2006 From: apnadkarni@REDACTED (Ashok P. Nadkarni) Date: Tue, 04 Jul 2006 20:58:52 +0530 Subject: Best windows installer? was : RE: lightweight Erlang with package management In-Reply-To: References: Message-ID: <44AA8934.4080107@users.sourceforge.net> InstallJammer (www.installjammer.com) is open-source, scriptable AND *cross platform* (Windows and Unix). /Ashok Joe Armstrong (AL/EAB) wrote: > > Can anybody advise on a good windows installer? > > requirements: > > - open source > - minimal > - adware-free > > What we don't need is all the goodies - just the basics > > /Joe > > > >> -----Original Message----- >> From: Christophe Romain [mailto:christophe.romain@REDACTED] >> Sent: den 3 juli 2006 12:35 >> To: Joe Armstrong (AL/EAB) >> Cc: erlang-questions@REDACTED >> Subject: Re: lightweight Erlang with package management >> >> Thank you Joe ! >> >> >> >>> 1) Remote install extension >>> >> very interresting feature ! >> if you have ssh or rsh and an account on all systems, using >> os:cmd is a way to do that. >> anyway we have erlang/lib/ssh/ebin/ssh_sftp that could help. >> I'll look at >> >> >>> 2) Windows install >>> >> I'll look at wings installer, but it will be difficult for me >> to help on windows. >> any volunteer or tester ? >> >> >>> I guess it would be easy to write a package that installs a >>> >> "standard" >> >>> environment for >>> windows >>> >> you're right, it's even possible to make windows base system >> containing this standard environment. >> >> >>> all I need is a "wget" in Erlang, and I guess something like wget >>> >> erlrt is using ibrowse >> >> >> > > From Micic_V@REDACTED Tue Jul 4 17:35:31 2006 From: Micic_V@REDACTED (Valentin Micic [ MTN - Innovation Centre ]) Date: Tue, 4 Jul 2006 17:35:31 +0200 Subject: 64-Bit Erlang on SOLARIS 10 Message-ID: <23684C9CDF88C04FA8800AA825EADF51034726F6@MTNMAIL.mtn.co.za> Hello Mikael and others, Thank you very much -- that part worked!!! My next problem: Compiler complains about undefined data types (i.e. ctid_t), but I suspect GCC version that I'm running (will download one for Sol10) V. -----Original Message----- From: Mikael Pettersson [mailto:mikpe@REDACTED] Sent: Tuesday, 04 July 2006 3:06 PM To: Valentin Micic [ MTN - Innovation Centre ]; erlang-questions@REDACTED Subject: Re: 64-Bit Erlang on SOLARIS 10 On Tue, 4 Jul 2006 13:04:59 +0200, "Valentin Micic [ MTN - Innovation Centre ]" wrote: >Can anybody, please, tell me what parameters to pass to configure >utility in order to force 64-bit support for Erlang emulator. > >Thanks in advance. Assuming it's SPARC and you're using gcc, then you need to pass -m64 to gcc. On the rare occasion that I do a 64-bit SPARC build, I do it via the following kludge: cat>/tmp/gcc64 #!/bin/sh exec gcc -m64 "$@" ^D chmod +x /tmp/gcc64 env CC=/tmp/gcc64 ./configure make Maybe 'env CFLAGS="-O2 -m64" ./configure' would work too. NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/disclaimer From anders.nygren@REDACTED Tue Jul 4 18:04:10 2006 From: anders.nygren@REDACTED (Anders Nygren) Date: Tue, 4 Jul 2006 11:04:10 -0500 Subject: Compiler bug?? Message-ID: Hi I recently gave an Erlang course and one of my students found the following. I would have expected a compiler error in this case. But as You can see it compiles and runs with a somewhat unexpected result. A similar error is a case statement gives a compiler error. -module(if_bug). -export([foo/1]). foo(X) -> if X > 1 -> ok; % <- Note semicolon here not_ok; true -> true end. Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] 12> c(if_bug). {ok,if_bug} 13> if_bug:foo(2). ok 14> /Anders From Micic_V@REDACTED Tue Jul 4 18:48:15 2006 From: Micic_V@REDACTED (Valentin Micic [ MTN - Innovation Centre ]) Date: Tue, 4 Jul 2006 18:48:15 +0200 Subject: 64-Bit Erlang on SOLARIS 10 Message-ID: <23684C9CDF88C04FA8800AA825EADF5103472729@MTNMAIL.mtn.co.za> Has anybody successfully compiled Erlang R11B-0 (or R10B-10) on Solaris 10, using ./configure utility. I get the following error(s): make cd erts/emulator && ERL_TOP=/export/home/micic_v/ERLANG/otp_src_R11B-0 make generate depend make[1]: Entering directory `/export/home/micic_v/ERLANG/otp_src_R11B-0/erts/emulator' make -f sparc-sun-solaris2.10/Makefile generate make[2]: Entering directory `/export/home/micic_v/ERLANG/otp_src_R11B-0/erts/emulator' /tmp/gcc64 -g -O3 -I/export/home/micic_v/ERLANG/otp_src_R11B-0/erts/sparc-sun-solaris2.10 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wa,-xarch=v8plusa -Ibeam -Isys/unix -Isys/common -Isparc-sun-solaris2.10/opt -Isparc-sun-solaris2.10 -Izlib -Ihipe -I../include/internal -I../include/internal/sparc-sun-solaris2.10 -c hipe/hipe_mkliterals.c -o /export/home/micic_v/ERLANG/otp_src_R11B-0/erts/obj.beam/sparc-sun-solar is2.10/hipe_mkliterals.o In file included from /usr/include/sys/signal.h:34, from /usr/include/signal.h:27, from sys/unix/erl_unix_sys.h:46, from beam/sys.h:46, from hipe/hipe_mkliterals.c:37: /usr/include/sys/siginfo.h:259: error: parse error before "ctid_t" /usr/include/sys/siginfo.h:292: error: parse error before '}' token /usr/include/sys/siginfo.h:294: error: parse error before '}' token /usr/include/sys/siginfo.h:390: error: parse error before "ctid_t" /usr/include/sys/siginfo.h:392: error: conflicting types for `__proc' /usr/include/sys/siginfo.h:261: error: previous declaration of `__proc' /usr/include/sys/siginfo.h:398: error: conflicting types for `__fault' /usr/include/sys/siginfo.h:267: error: previous declaration of `__fault' /usr/include/sys/siginfo.h:404: error: conflicting types for `__file' /usr/include/sys/siginfo.h:273: error: previous declaration of `__file' /usr/include/sys/siginfo.h:420: error: conflicting types for `__prof' /usr/include/sys/siginfo.h:287: error: previous declaration of `__prof' /usr/include/sys/siginfo.h:424: error: conflicting types for `__rctl' /usr/include/sys/siginfo.h:291: error: previous declaration of `__rctl' /usr/include/sys/siginfo.h:426: error: parse error before '}' token /usr/include/sys/siginfo.h:428: error: parse error before '}' token /usr/include/sys/siginfo.h:432: error: parse error before "k_siginfo_t" /usr/include/sys/siginfo.h:437: error: parse error before '}' token In file included from /usr/include/signal.h:27, from sys/unix/erl_unix_sys.h:46, from beam/sys.h:46, from hipe/hipe_mkliterals.c:37: /usr/include/sys/signal.h:85: error: parse error before "siginfo_t" In file included from sys/unix/erl_unix_sys.h:46, from beam/sys.h:46, from hipe/hipe_mkliterals.c:37: /usr/include/signal.h:112: error: parse error before "siginfo_t" /usr/include/signal.h:114: error: parse error before "siginfo_t" make[2]: *** [/export/home/micic_v/ERLANG/otp_src_R11B-0/erts/obj.beam/sparc-sun-sola ris2.10/hipe_mkliterals.o] Error 1 make[2]: Leaving directory `/export/home/micic_v/ERLANG/otp_src_R11B-0/erts/emulator' make[1]: *** [generate] Error 2 make[1]: Leaving directory `/export/home/micic_v/ERLANG/otp_src_R11B-0/erts/emulator' make: *** [depend] Error 2 -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Valentin Micic [ MTN - Innovation Centre ] Sent: Tuesday, 04 July 2006 5:36 PM To: Mikael Pettersson; erlang-questions@REDACTED Subject: RE: 64-Bit Erlang on SOLARIS 10 Hello Mikael and others, Thank you very much -- that part worked!!! My next problem: Compiler complains about undefined data types (i.e. ctid_t), but I suspect GCC version that I'm running (will download one for Sol10) V. -----Original Message----- From: Mikael Pettersson [mailto:mikpe@REDACTED] Sent: Tuesday, 04 July 2006 3:06 PM To: Valentin Micic [ MTN - Innovation Centre ]; erlang-questions@REDACTED Subject: Re: 64-Bit Erlang on SOLARIS 10 On Tue, 4 Jul 2006 13:04:59 +0200, "Valentin Micic [ MTN - Innovation Centre ]" wrote: >Can anybody, please, tell me what parameters to pass to configure >utility in order to force 64-bit support for Erlang emulator. > >Thanks in advance. Assuming it's SPARC and you're using gcc, then you need to pass -m64 to gcc. On the rare occasion that I do a 64-bit SPARC build, I do it via the following kludge: cat>/tmp/gcc64 #!/bin/sh exec gcc -m64 "$@" ^D chmod +x /tmp/gcc64 env CC=/tmp/gcc64 ./configure make Maybe 'env CFLAGS="-O2 -m64" ./configure' would work too. NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/disclaimer NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/disclaimer From vladdu55@REDACTED Tue Jul 4 19:52:15 2006 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 4 Jul 2006 18:52:15 +0100 Subject: Compiler bug?? In-Reply-To: References: Message-ID: <95be1d3b0607041052o6f5debf9s9518962cc45110b6@mail.gmail.com> Hi, > foo(X) -> > if > X > 1 -> > ok; % <- Note semicolon here > not_ok; > true -> > true > end. This is because "not_ok; true" is a valid guard expression and guards have higher priority in the parser than the if clause.... Can be confusing, I agree. best regards, Vlad From rsaccon@REDACTED Tue Jul 4 21:31:26 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Tue, 4 Jul 2006 16:31:26 -0300 Subject: mnesia primary key creation In-Reply-To: References: Message-ID: I liked the cheap solution: oid() -> {node(), erlang:now()}. but how can I turn erlang:now() into a String ?? (which probablly won't look very URL-friendly) I thouhgt of turing it into a list, then into a binary, then base64 encoding it, but list_to_binary(tuple_to_list(erlang:now())) does not work. regards Roberto On 6/30/06, Ulf Wiger (AL/EAB) wrote: > > I sketched the attached code for maintaining a node-specific sequence > number in a cluster of nodes. The code is untested - probably doesn't > even compile, and upon reflection, I'd do away with all the dirty ops. > Basically, you should never use dirty ops on replicated tables. > > The thing I was after was a system-unique object identifier which was > compact enough to be human- and URL-friendly. > > For cheap(in terms of CPU cost) automatic primary keys, I tend to use > > oid() -> {node(), erlang:now()}. > > Given a reasonably well-behaved system clock(*), this is certain to give > unique values - increasing values, even - each time. > > (*) AFAIK, even though it's not documented, erlang:now() is derived from > sys_gethrtime(), except on Win32, where it's derived from GetTickCount() > - I gave up before understanding from the source how erlang:now() > relates to "zero hour" on Windows. A cursory inspection of the code made > me doubt that my statement holds true for Windows. Correct me, please, > anyone. > > BR, > Ulf W > > > -----Original Message----- > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Roberto Saccon > > Sent: den 30 juni 2006 03:59 > > To: erlang-questions@REDACTED > > Subject: mnesia primary key creation > > > > I am wondering whether experienced erlang developers have > > something better in their best-practises-treasure-box than > > what I have come up with to create mnesia primary keys: > > > > 1. use "ordered_set" tables > > > > 2. use "mnesia:dirty_last(myTable)" to get the last inserted > > key and increment it for a new key before inserting a new record. > > > > > > regards > > -- > > Roberto Saccon > > > > > -- Roberto Saccon From ulf@REDACTED Tue Jul 4 23:18:18 2006 From: ulf@REDACTED (Ulf Wiger) Date: Tue, 04 Jul 2006 23:18:18 +0200 Subject: mnesia primary key creation In-Reply-To: References: Message-ID: Den 2006-07-04 21:31:26 skrev Roberto Saccon : > I liked the cheap solution: > > oid() -> {node(), erlang:now()}. > > but how can I turn erlang:now() into a String ?? (which probablly > won't look very URL-friendly) > > I thouhgt of turing it into a list, then into a binary, then base64 > encoding it, but > list_to_binary(tuple_to_list(erlang:now())) > does not work. Well, for example: 1> {Node,{MS,S,US}} = {node(), erlang:now()}. {nonode@REDACTED,{1152,47770,297000}} 2> list_to_binary([atom_to_list(Node),"-",integer_to_list(MS),"-",integer_to_list(S),"-",integer_to_list(US)]). <<110,111,110,111,100,101,64,110,111,104,111,115,116,45,49,49,53,50,45,52,55,55,55,48,45,50,57,55,48,...>> 3> binary_to_list(v(2)). "nonode@REDACTED" BR, Ulf W -- Ulf Wiger From rsaccon@REDACTED Tue Jul 4 23:37:06 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Tue, 4 Jul 2006 18:37:06 -0300 Subject: mnesia primary key creation In-Reply-To: References: Message-ID: Thanks, after seeing the example it looks soooo simple and obvious ! On 7/4/06, Ulf Wiger wrote: > Den 2006-07-04 21:31:26 skrev Roberto Saccon : > > > I liked the cheap solution: > > > > oid() -> {node(), erlang:now()}. > > > > but how can I turn erlang:now() into a String ?? (which probablly > > won't look very URL-friendly) > > > > I thouhgt of turing it into a list, then into a binary, then base64 > > encoding it, but > > list_to_binary(tuple_to_list(erlang:now())) > > does not work. > > Well, for example: > > 1> {Node,{MS,S,US}} = {node(), erlang:now()}. > {nonode@REDACTED,{1152,47770,297000}} > 2> > list_to_binary([atom_to_list(Node),"-",integer_to_list(MS),"-",integer_to_list(S),"-",integer_to_list(US)]). > <<110,111,110,111,100,101,64,110,111,104,111,115,116,45,49,49,53,50,45,52,55,55,55,48,45,50,57,55,48,...>> > 3> binary_to_list(v(2)). > "nonode@REDACTED" > > BR, > Ulf W > > -- > Ulf Wiger > -- Roberto Saccon From richardc@REDACTED Tue Jul 4 23:47:55 2006 From: richardc@REDACTED (Richard Carlsson) Date: Tue, 04 Jul 2006 23:47:55 +0200 Subject: Compiler bug?? In-Reply-To: References: Message-ID: <44AAE20B.6000009@it.uu.se> Anders Nygren wrote: > > foo(X) -> if X > 1 -> ok; % <- Note semicolon here not_ok; true -> true end. You are being misled by the indentation. If you write it like this, it's easier to see: foo(X) -> if X > 1 -> ok; % <- Note semicolon here not_ok; true -> true end. Semicolon within a guard separates disjunctions, i.e., it's an "or" operator. It can't be nested, and has lower precedence than comma ("and"). It would have made a nice submission to the Obfuscated Erlang Contest, though. :-) /Richard From thomasl_erlang@REDACTED Tue Jul 4 23:57:51 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 4 Jul 2006 14:57:51 -0700 (PDT) Subject: mnesia primary key creation In-Reply-To: Message-ID: <20060704215751.55918.qmail@web38815.mail.mud.yahoo.com> --- Ulf Wiger wrote: > Den 2006-07-04 21:31:26 skrev Roberto Saccon > : > > > I liked the cheap solution: > > > > oid() -> {node(), erlang:now()}. > > > > but how can I turn erlang:now() into a String ?? > (which probablly > > won't look very URL-friendly) > > > > I thouhgt of turing it into a list, then into a > binary, then base64 > > encoding it, but > > list_to_binary(tuple_to_list(erlang:now())) > > does not work. > > Well, for example: > > 1> {Node,{MS,S,US}} = {node(), erlang:now()}. > {nonode@REDACTED,{1152,47770,297000}} > 2> > list_to_binary([atom_to_list(Node),"-",integer_to_list(MS),"-",integer_to_list(S),"-",integer_to_list(US)]). > <<110,111,110,111,100,101,64,110,111,104,111,115,116,45,49,49,53,50,45,52,55,55,55,48,45,50,57,55,48,...>> > 3> binary_to_list(v(2)). > "nonode@REDACTED" Or, a bit easier on the eyes (though perhaps a bit more expensive): fmt_oid({Node, {MS, S, US}}) -> list_to_binary( io_lib:format("~w-~w-~w-~w", [Node, MS, S, US])). Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From rsaccon@REDACTED Wed Jul 5 00:22:28 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Tue, 4 Jul 2006 19:22:28 -0300 Subject: mnesia primary key creation In-Reply-To: References: Message-ID: yeah, you are right, why not. Thanks for the suggestion. regards Roberto On 7/4/06, RCB wrote: > {T1, T2, T3} = now(), > <>. > > Why not just generate a unique string? > > -module(randstr). > > -export([randstr/1, seedrand/0, seedrandstr/1]). > > chartab() -> > { $a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l, $m, > $n, $o, $p, $q, $r, $s, $t, $u, $v, $w, $x, $y, $z, > $A, $B, $C, $D, $E, $F, $G, $H, $I, $J, $K, $L, $M, > $N, $O, $P, $Q, $R, $S, $T, $U, $V, $W, $X, $Y, $Z, > $0, $1, $2, $3, $4, $5, $6, $7, $8, $9 }. > > seedrand() -> > {S1, S2, S3} = now(), > random:seed(S1,S2,S3), > > seedrandstr(N) -> > seedrand(), > randstr(N). > > randstr(N) -> > C = chartab(), > randstr(N,C,size(C),[]). > randstr(0,_,_,Acc) -> > Acc; > randstr(N,C,Csz,Acc) -> > randstr(N - 1, C, Csz, [element(random:uniform(Csz),C) | Acc]). > > > > > > On 7/4/06, Roberto Saccon wrote: > > I liked the cheap solution: > > > > oid() -> {node(), erlang:now()}. > > > > but how can I turn erlang:now() into a String ?? (which probablly > > won't look very URL-friendly) > > > > I thouhgt of turing it into a list, then into a binary, then base64 > > encoding it, but > > list_to_binary(tuple_to_list(erlang:now())) > > does not work. > > > > regards > > Roberto > -- > Rich Beerman > Cupertino, California > mobile: 408/221-2444 > fax: 408/255-7944 > -- Roberto Saccon From shehan@REDACTED Wed Jul 5 06:20:56 2006 From: shehan@REDACTED (shehan) Date: Wed, 5 Jul 2006 09:50:56 +0530 Subject: Problem with smtp_client-1.1 References: <200607041107.k64B7teI001362@pluto.hedeland.org> <44AA581F.7090805@ericsson.com> Message-ID: <03a901c69fea$69eb4db0$8b0a10ac@wavenet.lk> Hi all, After sending email , I used smtp_fsm:close(Pid) in my erlang appplication. Then following error occured.So therefore my application crashed.So how to avoid or handle that error to stop crashing?? Regards, Shehan =ERROR REPORT==== 5-Jul-2006::09:41:16 === ** State machine <0.22477.0> terminating ** Last event in was close (for all states) ** When State == smtp_conn ** Data == [] ** Reason for termination = ** i_have_quit =CRASH REPORT==== 5-Jul-2006::09:41:16 === crasher: pid: <0.22477.0> registered_name: [] error_info: i_have_quit initial_call: {gen,init_it, [gen_fsm, <0.22476.0>, self, omniesme_fsm, ["192.168.4.21",25], []]} ancestors: [<0.22476.0>] messages: [] links: [#Port<0.383>] dictionary: [] trap_exit: false status: running heap_size: 610 stack_size: 21 reductions: 889 neighbours: From bengt.kleberg@REDACTED Wed Jul 5 08:21:02 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 05 Jul 2006 08:21:02 +0200 Subject: Problem with smtp_client-1.1 In-Reply-To: <03a901c69fea$69eb4db0$8b0a10ac@wavenet.lk> References: <200607041107.k64B7teI001362@pluto.hedeland.org> <44AA581F.7090805@ericsson.com> <03a901c69fea$69eb4db0$8b0a10ac@wavenet.lk> Message-ID: <44AB5A4E.8090600@ericsson.com> On 2006-07-05 06:20, shehan wrote: > Hi all, > After sending email , I used smtp_fsm:close(Pid) in my erlang appplication. > Then following error occured. According to the example in smtp_fsm.erl this is not an error, but the expected behaviour/result of smtp_fsm:close(Pid). > So therefore my application crashed.So how to > avoid or handle that error to stop crashing?? smtp_fsm:handle_event(close, ...) returns i_have_quit as the Reason (in {stop,Reason,NewStateData}) and according to the gen_fsm manual : ''Note that for any other reason than normal or shutdown, the gen_fsm is assumed to terminate due to an error'' so you can change i_have_quit to normal or shutdown to avoid the crash. fyi: unless you need some of the features only available in smtp_client-1.1 there is another smtp client (distributed with yaws) that does not have this problem. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From robert.virding@REDACTED Wed Jul 5 15:24:28 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 05 Jul 2006 15:24:28 +0200 Subject: Strings (was: Re: are Mnesia tables immutable?) In-Reply-To: <200606300515.k5U5FCKS346738@atlas.otago.ac.nz> References: <200606300515.k5U5FCKS346738@atlas.otago.ac.nz> Message-ID: <44ABBD8C.4040202@telia.com> I have been reading this discussion off-line so I have not been able to reply quickly. As I see it we are discussing (at least) 3 different types of strings: 1) internal mutable strings, strings we want to modify and work on (yes I KNOW Erlang doesn't really have mutable datatypes :-) 2) internal immutable strings, strings we don't want to modify 3) external representation of strings, term_to_binary Unfortunately we are using the same name for these different things. Before I go on I would like to point out that the convention of strings being lists of integers >= 0, =< 255 originated in the code for fwrite ~p because I needed an easy way to decide when a list should be printed as a string. Just to be helpful. Nothing more. I know because I wrote the code and "invented" the convention. I am guessing that it became part of binary encoding because such lists could be encoded efficiently and useful for strings. But that doesn't mean that strings must only contain small integers. I think some people are putting WAY too much significance into a trivial convention. That being said some comments on representation: 1. Internal mutable strings. Sorry, I can't for the life of me understand why they should be represented as anything else other than one unicode character per list element. Easy to work with, backwards compatible (which I NEVER worried about before, ask Joe) and relatively efficient. Anything else at this level would be a serious pain in the arse. 2. Internal immutable strings. I am wondering if we really need fix this. These strings are VERY application dependant and the application definitely knows what it needs in the way of encoding. Store them as binaries and provide some libraries for converting between list strings which can handle everything, and various encodings in the binaries. 3. External representation. In one respect I don't really see the problem here, if you solve 1&2 then this problem goes away. What I want from an external representation is that I get back out of it what I put into it! Nothing more, nothing less! I have chosen the representation so I don't want "help" in converting it. If I have a list of integers in then I want the SAME list of integers out, if I have a binary string in I want the SAME binary string out. If term_to_binary detects that my list consists of only 8/16/24/32 bit integers and smart-codes that then fine, as long as I get it back the same way. I am definitely not an expert on Unicode so I may have missed something important. But keep it simple so the programmer knows what is happening and can work with that. KISS principle. My main worry that if you start baking in hard-wired solutions into the systems then you a) will get it wrong, b) make a lot of people unhappy because you made the wrong choice and c) make the system bigger and harder to maintain. Provide libraries and credit the programmer with some intelligence in making their own choices as to what they need. As you may understand I am definitely for having different representations depending on what you are doing. One-size does definitely NOT fit all. Robert From chsu79@REDACTED Wed Jul 5 16:39:22 2006 From: chsu79@REDACTED (Christian S) Date: Wed, 5 Jul 2006 16:39:22 +0200 Subject: Strings (was: Re: are Mnesia tables immutable?) In-Reply-To: <44ABBD8C.4040202@telia.com> References: <200606300515.k5U5FCKS346738@atlas.otago.ac.nz> <44ABBD8C.4040202@telia.com> Message-ID: On 7/5/06, Robert Virding wrote: > I want the SAME binary string out. If term_to_binary detects that my > list consists of only 8/16/24/32 bit integers and smart-codes that then > fine, as long as I get it back the same way. There is a term_to_binary(Term, Options) that allow compressed external representations. So on the same path: how about adding different levels of compression? term_to_binary(Term, {compressed, text}) that perform cdr coding for various bitlength integers, but avoid zlib compression? Saves some memory but doesnt make binary_to_term() cost anything. Could optionally be done automaticly on everything inserted in an ets table. I dont experience problems with high memory use myself, so what are people working with that do have real mem consuption problems? Would it feel crufty to have an ets table around just to be able to store large amounts of text compactly in memory? From ulf.wiger@REDACTED Wed Jul 5 16:43:15 2006 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Wed, 5 Jul 2006 16:43:15 +0200 Subject: safe script evaluator Message-ID: I'm playing around with writing a (supposedly) safe script evaluator using erl_eval. The current state of the code is shown below (it's work in progress - don't expect it to be complete.) I kindof got stuck on the following description of the non-local function handler, which can be used with erl_eval:exprs/4: "The nonlocal function handler argument is probably not used as frequently as the local function handler argument. A possible use is to call exit/1 on calls to functions that for some reason are not allowed to be called." This is all fine, and exactly what I want - BUT, it seems the non-local function handler is NOT called for calls to apply/3. This means that I can't really use the non-local function handler for disallowing any calls, unless I traverse the expressions and rewrite them. This is what I do in the code below. I also search for message sending and receive expressions, which are also disallowed. If anyone can think of anything else that needs to be trapped in the code below, please hollar. BR, Ulf W %%% =========================== Begin script evaluator op_eval(W, Script) -> fun() -> case erl_scan:string(Script, 1) of {ok, Tokens, _} -> case erl_parse:parse_exprs(Tokens) of {ok, Exprs} -> io:format("Exprs = ~p~n", [Exprs]), Exprs1 = rewrite_expr(Exprs), case erl_eval:exprs(Exprs1, [], {value, fun local_fun/2}, {value, fun remote_fun/2}) of {value, Value, NewBs} -> {true, {Value, NewBs}} end; Error -> {false, Error} end; ScanError -> {false, ScanError} end end. rewrite_expr(E) -> [erl_syntax:revert(T) || T <- lists:flatten(rewrite_expr1(E))]. rewrite_expr1(Es) when is_list(Es) -> [rewrite_expr1(E) || E <- Es]; rewrite_expr1(E) -> E1 = case erl_syntax:type(E) of application -> case erl_syntax_lib:analyze_application(E) of {apply, 3} -> safe_apply_expr(E); {erlang,apply,3} -> safe_apply_expr(E); _ -> E end; receive_expr -> erlang:error({invalid_expr, 'receive'}); infix_expr -> Op = erl_syntax:operator_name( erl_syntax:infix_expr_operator(E)), case valid_infix_operator(Op) of true -> E; false -> erlang:error({invalid_operator, Op}) end; _ -> E end, case erl_syntax:subtrees(E1) of [] -> E1; SubTrees -> erl_syntax:update_tree(E1, [rewrite_expr1(T) || T <- SubTrees]) end. valid_infix_operator('!') -> false; valid_infix_operator(_) -> true. safe_apply_expr(E) -> Args = erl_syntax:application_arguments(E), erl_syntax:application( erl_syntax:atom(safe_apply), Args). local_fun(safe_apply, [M, F, Args]) -> io:format("safe_apply(~p, ~p, ~p)~n", [M, F, Args]), case is_allowed(M, F, length(Args)) of true -> apply(M, F, Args); false -> erlang:error({undef, [{M, F, Args}]}) end; local_fun(Name, Args) -> io:format("local_fun(~p, ~p)~n", [Name, Args]), true. remote_fun({M, F}, Args) -> Arity = length(Args), case is_allowed(M, F, Arity) of true -> apply(M, F, Args); false -> erlang:error({undef, [{M, F, Arity}]}) end; remote_fun(F, Args) -> erlang:error({undef, [{F, length(Args)}]}). is_allowed(erlang, round, 1) -> true; is_allowed(erlang, atom_to_list, 1) -> true; is_allowed(erlang, binary_to_list, 1) -> true; is_allowed(erlang, list_to_binary, 1) -> true; is_allowed(erlang, integer_to_list, 1) -> true; is_allowed(erlang, list_to_integer, 1) -> true; is_allowed(erlang, setelement, 3) -> true; is_allowed(erlang, element, 2) -> true; is_allowed(erlang, size, 1) -> true; is_allowed(erlang, split_binary, 2) -> true; is_allowed(erlang, term_to_binary, 1) -> true; is_allowed(erlang, term_to_binary, 2) -> true; is_allowed(erlang, binary_to_term, 1) -> true; is_allowed(erlang, throw, 1) -> true; is_allowed(erlang, time, 0) -> true; is_allowed(erlang, now, 0) -> true; is_allowed(erlang, universal_time, 0) -> true; is_allowed(erlang, localtime, 0) -> true; is_allowed(erlang, localtime_to_universaltime, 1) -> true; is_allowed(erlang, localtime_to_universaltime, 2) -> true; is_allowed(erlang, make_ref, 0) -> true; %% is_allowed(lists, _, _) -> true; is_allowed(sets, _, _) -> true; is_allowed(ordsets, _, _) -> true; is_allowed(dict, _, _) -> true; is_allowed(orddict, _, _) -> true; is_allowed(gb_trees, _, _) -> true; is_allowed(calendar, _, _) -> true; is_allowed(_, _, _) -> false. %%% =========================== End script evaluator From Micic_V@REDACTED Wed Jul 5 18:20:52 2006 From: Micic_V@REDACTED (Valentin Micic [ MTN - Innovation Centre ]) Date: Wed, 5 Jul 2006 18:20:52 +0200 Subject: Desperately again: 64-bit Erlang on SOLARIS 10 Message-ID: <23684C9CDF88C04FA8800AA825EADF5103472AA3@MTNMAIL.mtn.co.za> Ok, people. I've managed to narrow a problem to version of gnu compiler. I can successfully compile Erlang 11 on Solaris10 using gcc ver. 2.95.3. Unfortunately, this version does not support 64-bit architecture (it does not recognize -m64 flag). Whenever I've tried gcc version 3.3.2 (or 3.4.2) the whole hell brakes lose. Well, I'm getting desperate now. I would appreciate hint as to which gcc version to use to deliver 64-bit erlang on Solaris 10. Valentin. PS I've downloaded gcc from www.sunfreeware.com , which happens to be sponsored by SUN. Can they be trusted :-). NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/disclaimer -------------- next part -------------- An HTML attachment was scrubbed... URL: From yarivvv@REDACTED Wed Jul 5 18:53:16 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 5 Jul 2006 12:53:16 -0400 Subject: question about Erlang's future Message-ID: <17244f480607050953y57c37f37qa6cf87ec44166336@mail.gmail.com> Hi, I read Joe Armstrong's PhD thesis. It's a great read for everybody who's learning Erlang. One passage that stood out to me was the following: "In February 1998 Erlang was banned for new product development wit hin Ericsson - the main reason for the ban was that Ericsson wanted to be a consumer of software technologies rather than a producer. In December 1998 Erlang and the OTP libraries were released subject to an Open Source License. Since that date it has been freely available for download from http://www.erlang.org/. In 1998 I left Ericsson together with a number of the original Erlang group to found a new company Bluetail AB?in all 15 people left Ericsson. The idea behind Bluet ail was to use the Erlang technology to program products which make Internet services more reliable. " What does this mean for Erlang's future? Has Ericsson abandoned Erlang development besides periodic maintenance or will Ericsson push Erlang in new directions? Where is Erlang heading? Regards, Yariv From richardc@REDACTED Wed Jul 5 23:18:56 2006 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 05 Jul 2006 23:18:56 +0200 Subject: edoc custom XML layout In-Reply-To: <449D5AC5.3030102@hq.idt.net> References: <449D5AC5.3030102@hq.idt.net> Message-ID: <44AC2CC0.2080200@it.uu.se> Serge Aleynikov wrote: > As the edoc's documentation doesn't mention the guidelines for creating > custom layouts, is there any reference or samples with some helpful info > (other than the *.erl sources)? Sorry, but no. And actually, the edoc_layout.erl module is really an ad hoc piece of junk that I'd like to rewrite completely. But it's pretty simple to follow what it does, if you want to write your own layout module. Believe me, if I had had any guidelines when I wrote that thing, I would have been happier, because then I could have followed them myself. I guess I was hoping for some trigger happy young'un with a degree in web design to turn up and rewrite it for me. At least now I know how not to do it, which is a start. > I tried to call edoc:read/2, but it doesn't seem to work with > otpsgml_layout: > 25> edoc:read("edoc_layout.erl", [{layout, otpsgml_layout}]). > edoc: error in layout 'otpsgml_layout': > {'EXIT',{badarg,[{erlang,binary_to_list,[{aname,[[82,105,99,104,97,114,100|...]]}]},{xmerl_lib,export_text,2},{xmerl_lib,export_text,2},{xmerl,apply_cb,5},{xmerl,export_content,2},{xmerl,export_content,2},{xmerl,export_content,2},{xmerl,export_content,2}]}}. > > ** exited: error ** There's a bug in the otpsgml_layout module which makes it generate malformed data for 'author' declarations. Here's a patch if you like (it's been checked in and will show up in the next release): --- src/otpsgml_layout.erl 10 Dec 2005 17:51:33 -0000 1.12 +++ src/otpsgml_layout.erl 5 Jul 2006 20:56:07 -0000 @@ -165,7 +165,7 @@ {Short,Long} = find_first_p(FullDesc,[]), Description = {description, [?NL,{p,Short}|Long]++[?NL|types(SortedTs)]}, Funcs = functions(SortedFs), - Authors = authors(Es), + Authors = {authors, authors(Es)}, See = sees1(Es), {erlref, [ ?NL,Header, > Is my assumption correct that I would need to create a xxx_layout.erl > module similar to otpsgml_layout, and then make the following call to > generate edoc documentation using that layout: > > edoc:run([], ["my_file.erl"], [{layout, xxx_layout}]). Yes, or via any of the other main functions (application/2, files/2, packages/2), or as you did in your example via read/2. > I am only guessing because edoc:run/3 doesn't mention the {layout, > Layout} option. But it does however say "Also see layout/2 for layout-related options", and layout/2 describes the {layout, Module} option. Anyway, good luck! /Richard -- "Having users is like optimization: the wise course is to delay it." -- Paul Graham From richardc@REDACTED Wed Jul 5 23:25:36 2006 From: richardc@REDACTED (Richard Carlsson) Date: Wed, 05 Jul 2006 23:25:36 +0200 Subject: [Fwd: edoc custom XML layout] In-Reply-To: <449FE9EA.5050501@hq.idt.net> References: <449FE9EA.5050501@hq.idt.net> Message-ID: <44AC2E50.1050404@it.uu.se> Serge Aleynikov wrote: > I seemed to have figured out how to do custom layouts in edoc by looking > at the otpsgml_layout.erl code. > > Here is a patch for otpsgml_layout.erl that fixes a bug in its output: Doh! Thanks. I should have read your followup before fixing the bug myself. /Richard -- "Having users is like optimization: the wise course is to delay it." -- Paul Graham From mikpe@REDACTED Tue Jul 4 15:06:14 2006 From: mikpe@REDACTED (Mikael Pettersson) Date: Tue, 4 Jul 2006 15:06:14 +0200 (MEST) Subject: 64-Bit Erlang on SOLARIS 10 Message-ID: <200607041306.k64D6EY9003385@harpo.it.uu.se> On Tue, 4 Jul 2006 13:04:59 +0200, "Valentin Micic [ MTN - Innovation Centre ]" wrote: >Can anybody, please, tell me what parameters to pass to configure >utility in order to force 64-bit support for Erlang emulator. > >Thanks in advance. Assuming it's SPARC and you're using gcc, then you need to pass -m64 to gcc. On the rare occasion that I do a 64-bit SPARC build, I do it via the following kludge: cat>/tmp/gcc64 #!/bin/sh exec gcc -m64 "$@" ^D chmod +x /tmp/gcc64 env CC=/tmp/gcc64 ./configure make Maybe 'env CFLAGS="-O2 -m64" ./configure' would work too. From apnadkarni@REDACTED Tue Jul 4 17:09:33 2006 From: apnadkarni@REDACTED (Ashok P. Nadkarni) Date: Tue, 04 Jul 2006 20:39:33 +0530 Subject: Best windows installer? was : RE: lightweight Erlang with package management In-Reply-To: References: Message-ID: <44AA84AD.6030600@yahoo.com> InstallJammer (www.installjammer.com) is open-source, scriptable AND *cross platform* (Windows and Unix). /Ashok Joe Armstrong (AL/EAB) wrote: > > Can anybody advise on a good windows installer? > > requirements: > > - open source > - minimal > - adware-free > > What we don't need is all the goodies - just the basics > > /Joe > > > From david.nospam.hopwood@REDACTED Thu Jul 6 02:26:10 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Thu, 06 Jul 2006 01:26:10 +0100 Subject: [Off-topic] Re: Best windows installer? In-Reply-To: <44AA84AD.6030600@yahoo.com> References: <44AA84AD.6030600@yahoo.com> Message-ID: <44AC58A2.5020006@blueyonder.co.uk> Ashok P. Nadkarni wrote: > InstallJammer (www.installjammer.com) is open-source, scriptable AND > *cross platform* (Windows and Unix). Don't Windows and Unix users generally have quite different expectations about how installation should work? I would have thought that most Unix users prefer to use their OS/distribution's package manager, rather than a standalone executable installer. -- David Hopwood From apnadkarni@REDACTED Thu Jul 6 04:54:50 2006 From: apnadkarni@REDACTED (Ashok P. Nadkarni) Date: Thu, 06 Jul 2006 08:24:50 +0530 Subject: [Off-topic] Re: Best windows installer? In-Reply-To: <44AC58A2.5020006@blueyonder.co.uk> References: <44AA84AD.6030600@yahoo.com> <44AC58A2.5020006@blueyonder.co.uk> Message-ID: <44AC7B7A.8060707@users.sourceforge.net> David Hopwood wrote: > Ashok P. Nadkarni wrote: > >> InstallJammer (www.installjammer.com) is open-source, scriptable AND >> *cross platform* (Windows and Unix). >> > > Don't Windows and Unix users generally have quite different expectations > about how installation should work? I would have thought that most Unix > users prefer to use their OS/distribution's package manager, rather than > a standalone executable installer. > > I've only used the Windows version so I'm not sure if the Unix installers produced by Installjammer are "compatible" with the native Unix methods. /Ashok From rlenglet@REDACTED Thu Jul 6 05:42:30 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Thu, 6 Jul 2006 12:42:30 +0900 Subject: [Off-topic] Re: Best windows installer? In-Reply-To: <44AC7B7A.8060707@users.sourceforge.net> References: <44AC58A2.5020006@blueyonder.co.uk> <44AC7B7A.8060707@users.sourceforge.net> Message-ID: <200607061242.30534.rlenglet@users.forge.objectweb.org> Ashok P. Nadkarni wrote: > David Hopwood wrote: > > Ashok P. Nadkarni wrote: > >> InstallJammer (www.installjammer.com) is open-source, > >> scriptable AND *cross platform* (Windows and Unix). > > > > Don't Windows and Unix users generally have quite different > > expectations about how installation should work? I would > > have thought that most Unix users prefer to use their > > OS/distribution's package manager, rather than a standalone > > executable installer. > > I've only used the Windows version so I'm not sure if the Unix > installers produced by Installjammer are "compatible" with the > native Unix methods. It is not compatible with any Unix/Linux packaging system. But that system may still be fine for Windows, though. Just to be even more off-topic, I would like to repeat one point that I raised during the discussion thread related to packaging a few months ago. Introducing a new packaging system, such as erlrt, is very fine, and very useful, especially to users of Windows and other OSes without a packaging system. But that packaging system must not be the only form into which an Erlang application is distributed. "Upstream" developers of Erlang applications should still first distribute their applications is source code form with a simple build system (makefiles or whatever), and *additionally* and *optionally*, as ready-to-install packages (Debian packages, BSD ports, erlrt packages, auto-installers for Windows, etc.). The imposed use of a particular packaging system by an upstream application developer would be a *pain in the ass* to some users (especially users of OSes that already have a good packaging system) and packagers. I know that nobody recently suggested otherwise, but I feel paranoid these days, and just wanted to make a kind of "preventive rant". ;-) -- Romain LENGLET From francesco@REDACTED Thu Jul 6 09:38:48 2006 From: francesco@REDACTED (Francesco Cesarini) Date: Thu, 06 Jul 2006 08:38:48 +0100 Subject: question about Erlang's future In-Reply-To: <17244f480607050953y57c37f37qa6cf87ec44166336@mail.gmail.com> References: <17244f480607050953y57c37f37qa6cf87ec44166336@mail.gmail.com> Message-ID: <44ACBE08.7010408@erlang-consulting.com> > What does this mean for Erlang's future? That was 8 years ago. So more than mean, I would use the word meant. The "ban" resulted in Erlang being released as open source, with numerous companies outside Ericsson adopting it and even more looking into it. (The person responsible to the "Ban" has since been promoted sideways). DOwnloads of the VM are at an all time high. > Has Ericsson abandoned Erlang > development besides periodic maintenance or will Ericsson push Erlang > in new directions? Ericsson is using Erlang internally, and quoting others on the list, like never before. > Where is Erlang heading? Proof for Ericsson acceptance is two clicks away from http://www.ericsson.com, following technology and open source. Francesco -- http://www.erlang-consulting.com From joe.armstrong@REDACTED Thu Jul 6 11:36:39 2006 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Thu, 6 Jul 2006 11:36:39 +0200 Subject: Thoughts about CEAN/refactoring Message-ID: Some thoughts on CEAN How can we make CEAN? (Comprehensive Erlang Archive Network) I want to address the following problem? How can be keep multiple versions of code in the same namespace in a consistent manner? Here's a proposal. Rule 1 ====== Versions are named like this AppName-Vsn Vsn is of no significance it is just a "distinguished string" << It might be like this: myAPP-2.3.4 myAPP-1 myApp-gold myApp-beta2 >> Rule 2 ====== We have One source code tree: Root/foo-1.2.3/Dependencies /src/ /ebin /xsrc /foo-gold/Dependencies /src /ebin /xsrc /yaws-super-fast/Dependencies /src /ebin /xsrc Same as the OTP tree - with two additions 1) A file called Dependencies 2) A new directory called xsrc (short for transformed source) Rule 3 ====== All applications are named with the "usual" module naming convention. ie. The application foo-Vsn has a "main module" foo.erl and a number of sub-modules foo_xxxxxx.erl. External applications MUST only call exported routines from foo.erl and NOT foo_xxxxx.erl Rule 4 ====== xsrc is derived from src using the information in the file "Dependencies". Let's assume that the file foo-2.3.4/Dependencies Contains the following: bar-7.0 boo-gold This means that foo-2.3.4 depends upon bar-7.0 and boo-gold. Now we transform the code as follows: all module names foo foo_XXXX are transformed to foo_2.3.4 foo_XXXX_2.3.4 bar bar_XXXX are transformed to bar_7.0 and bar_XXXX_7.0 boo boo_XXXX are transformed to boo_gold and boo_XXXX_gold apply(M,F,A) is transformed to foo_2.3.4:apply_xform(M, F, A) were foo:apply_x is a local function which dynamically transforms inter-module calls to the correct namespace - o O o - Rule 5 ====== The /ebin directory contains compiled code from /xsrc Comments: 1) I have shown how to provide multiple namespaces with code transformation - the same think can be achieved internally by tinkering with the loader and run-time system 2) Dubugging function names may not look so nice So while debugging once might wish to run with no name translation 3) <> There seems to be great opportunities for code refactoring here The way I work is to work with some version of a program App-2.3 Then when it works make a snapshot and copy everything to App-2.4 When App-2.4 works and I start with App-2.5 I would like to ask "what are the changes between App-2.3 and App-2.4" - Can knowledge of the changes be used in compilation to minimise the object code size if I want to run both versions in the same namespace (using some kind of transformation strategy) Indeed if I take multiple versions of an application and transform them how can I minimise the total size of the application, while having the same external interface. Here we would transform a tree like foo-1.2.3/src/... foo-beta3/src/... boo-8/src/ So that after the transformation the only visible modules would be foo_1.2.3.erl foo_beta3.erl boo_8.erl And all the "internal" modules would have been merged/consolidated into a minimal set. 4) Question to those who know (ie Richard) Can igor, and the module namespaces do this already???? Cheers /Joe From bengt.kleberg@REDACTED Thu Jul 6 12:28:53 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 06 Jul 2006 12:28:53 +0200 Subject: lightweight Erlang with package management In-Reply-To: <95be1d3b0607031141x114d2857vcae79015d4aa64d7@mail.gmail.com> References: <95be1d3b0607030452s6eab1600v885f495a5747a4e@mail.gmail.com> <44A95A7E.9030600@ericsson.com> <95be1d3b0607031141x114d2857vcae79015d4aa64d7@mail.gmail.com> Message-ID: <44ACE5E5.6020302@ericsson.com> On 2006-07-03 20:41, Vlad Dumitrescu wrote: > Hi, > > On 7/3/06, Bengt Kleberg wrote: ...deleted >> for erlrt it could be to do install erlrt only, and inform erlrt about >> the location of the erlang installation (soft link?) > > Something like that, yes. Or not install at all and just use the > existing one. sorry about the confusion. i was thinking about allowing for erlrt to handle the extra applications available in repos, too. but we where not talking about repos, so i deleted that reasoning, but not sufficiently. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From thomasl_erlang@REDACTED Thu Jul 6 12:45:14 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 6 Jul 2006 03:45:14 -0700 (PDT) Subject: Thoughts about CEAN/refactoring In-Reply-To: Message-ID: <20060706104514.31691.qmail@web38805.mail.mud.yahoo.com> --- "Joe Armstrong (AL/EAB)" wrote: > Now we transform the code as follows: > > all module names > > foo foo_XXXX are transformed to foo_2.3.4 > foo_XXXX_2.3.4 > > bar bar_XXXX are transformed to bar_7.0 and > bar_XXXX_7.0 > > boo boo_XXXX are transformed to boo_gold and > boo_XXXX_gold > > apply(M,F,A) is transformed to > > foo_2.3.4:apply_xform(M, F, A) > > were foo:apply_x is a local function which > > dynamically transforms inter-module calls to the > correct namespace This is basically the approach taken by my Erlang optimizer, as described in EUC 2001 -- though there it was used to specialize, merge, split, and optimize modules. Note that you will have to handle a couple of corner cases: 1. Apply of apply apply(erlang, apply, [M, F, As]) and so on. 2. The approach is 'insecure' in that someone can build a module name on their own and invoke a 'hidden' module with a raw apply. I'm agnostic whether this is a good or bad thing. (The safe approach is to never provide external access to the 'actual' apply.) Regarding dead code after module merging: yes, this is often present. However, do note that you will have to be a bit careful not to accidentally delete live functions :-) Furthermore, if you merge modules, you will have to be clever about changing/patching/hot-loading individual modules inside a merged entity. Otherwise, you can inadvertently hang on to a great deal of now-dead code. This may be okay, of course. Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From thomasl_erlang@REDACTED Thu Jul 6 12:55:25 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Thu, 6 Jul 2006 03:55:25 -0700 (PDT) Subject: Strings (was: Re: are Mnesia tables immutable?) In-Reply-To: <44ABBD8C.4040202@telia.com> Message-ID: <20060706105525.62974.qmail@web38815.mail.mud.yahoo.com> --- Robert Virding wrote: > [lots of good stuff] I mainly agree with your points. My only caveat here is that strings with an implicit encoding run the risk of that encoding being inadvertently forgotten -- for example, when storing them in a database, changing maintainers/developers, changing specification version, sending strings between nodes, ... But that problem can perhaps (and hopefully) be solved with appropriate libraries, rather than some sort of low-level hacking. Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From christophe.romain@REDACTED Thu Jul 6 13:36:28 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Thu, 6 Jul 2006 13:36:28 +0200 Subject: Thoughts about CEAN/refactoring In-Reply-To: References: Message-ID: <8157947a1d0f9b61bcc74baf1bd89f90@process-one.net> if a purpose of CEAN is to provide binary packages, to allow cross-platform binary packages, what about the /priv/lib/os-arch see: http://www.erlang.org/ml-archive/erlang-questions/200607/msg00011.html From yarivvv@REDACTED Thu Jul 6 14:45:25 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 6 Jul 2006 08:45:25 -0400 Subject: question about Erlang's future In-Reply-To: <44ACBE08.7010408@erlang-consulting.com> References: <17244f480607050953y57c37f37qa6cf87ec44166336@mail.gmail.com> <44ACBE08.7010408@erlang-consulting.com> Message-ID: <17244f480607060545n5ca720c7w34ce9894b3257000@mail.gmail.com> On 7/6/06, Francesco Cesarini wrote: > > > What does this mean for Erlang's future? > > That was 8 years ago. So more than mean, I would use the word meant. The > "ban" resulted in Erlang being released as open source, with numerous > companies outside Ericsson adopting it and even more looking into it. > (The person responsible to the "Ban" has since been promoted sideways). > DOwnloads of the VM are at an all time high. > > > Has Ericsson abandoned Erlang > > development besides periodic maintenance or will Ericsson push Erlang > > in new directions? > > Ericsson is using Erlang internally, and quoting others on the list, > like never before. > > > Where is Erlang heading? > > Proof for Ericsson acceptance is two clicks away from > http://www.ericsson.com, following technology and open source. Whew. That's reassuring. It would be a shame if Ericsson truly abandoned new development with Erlang, both for Erlang developers and for Ericsson. My confidence in Erlang is now fully regained :) Ericsson has a powerful language on its hands, and a great antidote to mainstream server languages (Java/C#/PHP). It'll be interesting to see Erlang challenging those languages in their home court, i.e., web development. My 2c. Thanks for clarifiying! Best, Yariv From ulf.wiger@REDACTED Thu Jul 6 16:19:32 2006 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Thu, 6 Jul 2006 16:19:32 +0200 Subject: compiling a module from a string Message-ID: So, I was able to hack my way in, in lieu of a documented solution: 1) Copy file_io_server.erl (from kernel) to ram_file_io_server.erl and modify slightly: diff ram_file_io_server.erl file_io_server.erl 18c18 < -module(ram_file_io_server). --- > -module(file_io_server). 27c27 < -define(PRIM_FILE, ram_file). --- > -define(PRIM_FILE, prim_file). 2) Write the following code: compile_string(_W, Mod, Str) -> Fname = Mod ++ ".erl", {ok, Fd} = open_ram_file(Fname), file:write(Fd, Str), file:position(Fd, 0), case epp_dodger:parse(Fd) of {ok, Tree} -> Forms = revert_tree(Tree), close_ram_file(Fd), Forms; Error -> close_ram_file(Fd), Error end. open_ram_file(Fname) -> ram_file_io_server:start(self(), Fname, [read,write]). close_ram_file(Fd) -> file:close(Fd). revert_tree(Tree) -> [erl_syntax:revert(T) || T <- Tree]. The 'ram' option to file:open/2 is not documented; the whole ram_file framework seems to be secret. The problem with file:open(F, [ram, read, write]) is that the opened file seems to get the same type of semantics as with 'raw'. Epp_dodger uses the io module to parse the contents behind Fd, and this doesn't work with raw devices. (One could of course imagine a slight rewrite of file_io_server so that it accepts some other low-level file driver other than prim_file... but file_io_server is by all means undocumented too.) After this, one just needs to call {ok,M,Bin} = compile:forms(Forms, [binary]), compile:load_binary(M, F, Bin). BR, Ulf W > -----Original Message----- > From: Ulf Wiger (AL/EAB) > Sent: den 6 juli 2006 14:22 > To: erlang-questions@REDACTED > Subject: compiling a module from a string > > > I want to effectively call > > Str = "-module(m).\n-export([foo/0]).\nfoo() -> foo.\n". > compile:string(Str, [binary]). > > > Of course, this doesn't work, since compile.erl assumes that > the source has to come from a file. So does epp.erl, BTW, and > epp_dodger. > > A naive, but futile approach is of course: > > {ok, Tokens, _} = erl_scan:string(Str), > erl_parse:tokens(Tokens). > > I'm sure there's a elegant sequence of commands that does > this, but which is it? > > BR, > Ulf W From bengt.kleberg@REDACTED Thu Jul 6 16:55:09 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 06 Jul 2006 16:55:09 +0200 Subject: compiling a module from a string In-Reply-To: References: Message-ID: <44AD244D.9080404@ericsson.com> On 2006-07-06 16:19, Ulf Wiger (AL/EAB) wrote: >> Of course, this doesn't work, since compile.erl assumes that >> the source has to come from a file. So does epp.erl, BTW, and >> epp_dodger. when faced with a similar problem for a pretty printer (epp_dodger wanting a file) i found that epp_dodger:parse/1 could handle an io object, instead of a file. so i wrote a string_io module that has open()/close() and received the io_requests. would this have worked for you? ie, can compile take an io object? bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From bengt.kleberg@REDACTED Thu Jul 6 12:23:51 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 06 Jul 2006 12:23:51 +0200 Subject: [Off-topic] Re: Best windows installer? In-Reply-To: <44AC58A2.5020006@blueyonder.co.uk> References: <44AA84AD.6030600@yahoo.com> <44AC58A2.5020006@blueyonder.co.uk> Message-ID: <44ACE4B7.5060602@ericsson.com> On 2006-07-06 02:26, David Hopwood wrote: ...deleted > Don't Windows and Unix users generally have quite different expectations > about how installation should work? I would have thought that most Unix this one i pass. i do not use windows. perhaps i could be permitted to compare mac and unix, instead? on unix i am quite comfortable with a source/compile installation. whereas on a mac i am only use the normal pre-compiled drag-and-drop installation. otherwise i forgoe the software. > users prefer to use their OS/distribution's package manager, rather than > a standalone executable installer. ''most''? those that do not have the password for root are surely not able to use their OS/distribution's package manager, are they? so, does most unix user have root, or not? bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From bengt.kleberg@REDACTED Thu Jul 6 13:42:05 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 06 Jul 2006 13:42:05 +0200 Subject: multi platform support into standard Erlang packaging In-Reply-To: <18c0672bad132fb05de2d69036add197@process-one.net> References: <18c0672bad132fb05de2d69036add197@process-one.net> Message-ID: <44ACF70C.5060904@ericsson.com> On 2006-07-01 10:14, Christophe Romain wrote: ...deleted > Wouldn't it be nice to define a generic and standard location for priv > things that allow to have many platforms into the same priv directory ? > example: > myapp-1.0/ > src/ > include/ > ebin/ > priv/ > lib/linux-x86/ > lib/darwin-powerpc/ > lib/windows/ > bin/windows/ how about myapp-1.0/priv/linux-x86/lib/ ? for the special case of a single computer installation (no network export/mounting) it could then be possible to link myapp-1.0/priv/linux-x86/lib/* to myapp-1.0/priv/lib/* which is backwards compatible. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From marc.vanwoerkom@REDACTED Thu Jul 6 18:45:44 2006 From: marc.vanwoerkom@REDACTED (Marc van Woerkom) Date: Thu, 06 Jul 2006 18:45:44 +0200 Subject: ICFP Contest 2006 Message-ID: <44AD3E38.8010207@fernuni-hagen.de> Is there any Erlang team this year? Regards, Marc From trapexit.erlang-questions@REDACTED Thu Jul 6 19:46:08 2006 From: trapexit.erlang-questions@REDACTED (Trap Exit) Date: Thu, 06 Jul 2006 18:46:08 +0100 Subject: mnesia:transform_table(Tab, Fun, NewAttributeList) References: Message-ID: <20060706174608.7369C5A1E5@mail.erlangsystems.com> Hi, folks. I have a mnesia table where I am about to change the definition of the record which it is based on. I have found the mnesia:transform_table/3 and mnesia:transform_table/4 functions. I know how to implement this if I use tuples in the funs that transform the objects in the table. fun({user, UserId, UserName, UserPassword}) -> UserEMail = none, {user, UserId, UserName, UserPassword, UserEMail}. The problem is that I have been thought to to assume that records are tuples. You cant have a record name with two definitions, if you have diffrent name, you will have to enter the new recordnam into the databas. So, how should one procede? * When changeing the recodord defintion for at mnesia table change the record name, or * Use the tuple definition of records. The code will only be used once so who cares, or * None of the above. Regards, Andreas Hillqvist _________________________________________________________ Post sent from www.trapexit.org Read this topic online here: http://trapexit.erlang-consulting.com/forum/viewtopic.php?p=135#135 From bjarne@REDACTED Thu Jul 6 21:36:27 2006 From: bjarne@REDACTED (=?iso-8859-1?Q?Bjarne_D=E4cker?=) Date: Thu, 6 Jul 2006 21:36:27 +0200 Subject: ICFP Contest 2006 References: <44AD3E38.8010207@fernuni-hagen.de> Message-ID: <000e01c6a133$7a3167a0$412269d4@segeltorp> More info can be found here http://icfpcontest.org/ Bjarne ----- Original Message ----- From: "Marc van Woerkom" To: "Erlang Questions" Sent: Thursday, July 06, 2006 6:45 PM Subject: ICFP Contest 2006 > Is there any Erlang team this year? > > Regards, > Marc > From bsder@REDACTED Thu Jul 6 21:49:26 2006 From: bsder@REDACTED (Andrew Lentvorski) Date: Thu, 06 Jul 2006 12:49:26 -0700 Subject: question about Erlang's future In-Reply-To: <17244f480607060545n5ca720c7w34ce9894b3257000@mail.gmail.com> References: <17244f480607050953y57c37f37qa6cf87ec44166336@mail.gmail.com> <44ACBE08.7010408@erlang-consulting.com> <17244f480607060545n5ca720c7w34ce9894b3257000@mail.gmail.com> Message-ID: <44AD6946.7000708@allcaps.org> Yariv Sadan wrote: > Whew. That's reassuring. It would be a shame if Ericsson truly > abandoned new development with Erlang, both for Erlang developers and > for Ericsson. My confidence in Erlang is now fully regained :) Sure, it would suck to lose a bunch of good developers. However, you have the code. I use Erlang for the productivity it provides, not because it is "fashionable". If it provides that much benefit, you can maintain the code yourself. > Ericsson has a powerful language on its hands, and a great antidote to > mainstream server languages (Java/C#/PHP). It'll be interesting to see > Erlang challenging those languages in their home court, i.e., web > development. And Ericsson couldn't care less about any of this. Ericsson doesn't make money on the language. That is, after all, why they open sourced it. -a From bsder@REDACTED Thu Jul 6 21:56:16 2006 From: bsder@REDACTED (Andrew Lentvorski) Date: Thu, 06 Jul 2006 12:56:16 -0700 Subject: [Off-topic] Re: Best windows installer? In-Reply-To: <44ACE4B7.5060602@ericsson.com> References: <44AA84AD.6030600@yahoo.com> <44AC58A2.5020006@blueyonder.co.uk> <44ACE4B7.5060602@ericsson.com> Message-ID: <44AD6AE0.3050101@allcaps.org> Bengt Kleberg wrote: > on unix i am quite comfortable with a source/compile installation. > whereas on a mac i am only use the normal pre-compiled drag-and-drop > installation. otherwise i forgoe the software. Actually, I have the Mac/OS X attitude about software even for Windows and Linux nowadays. If you ask for my root/administrator password, I dump your software. I expect to unpack/mount an archive and run. A package must run in user space to allow me to check it out, if it does not, I do not install it. Obviously, there are exceptions (insert rant about Apple packaging their own software, grrrr ....), but I am making fewer and fewer of them. -a From bsder@REDACTED Thu Jul 6 21:59:49 2006 From: bsder@REDACTED (Andrew Lentvorski) Date: Thu, 06 Jul 2006 12:59:49 -0700 Subject: multi platform support into standard Erlang packaging In-Reply-To: <44ACF70C.5060904@ericsson.com> References: <18c0672bad132fb05de2d69036add197@process-one.net> <44ACF70C.5060904@ericsson.com> Message-ID: <44AD6BB5.8030909@allcaps.org> Bengt Kleberg wrote: > On 2006-07-01 10:14, Christophe Romain wrote: > ...deleted >> Wouldn't it be nice to define a generic and standard location for priv >> things that allow to have many platforms into the same priv directory ? >> example: >> myapp-1.0/ >> src/ >> include/ >> ebin/ >> priv/ >> lib/linux-x86/ >> lib/darwin-powerpc/ >> lib/windows/ >> bin/windows/ > > how about > myapp-1.0/priv/linux-x86/lib/ +1 Different OS/arch combos have different naming conventions and limitations. Better to have those allocated to the right of the OS/arch markers. -a From ulf.wiger@REDACTED Thu Jul 6 14:22:05 2006 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Thu, 6 Jul 2006 14:22:05 +0200 Subject: compiling a module from a string Message-ID: I want to effectively call Str = "-module(m).\n-export([foo/0]).\nfoo() -> foo.\n". compile:string(Str, [binary]). Of course, this doesn't work, since compile.erl assumes that the source has to come from a file. So does epp.erl, BTW, and epp_dodger. A naive, but futile approach is of course: {ok, Tokens, _} = erl_scan:string(Str), erl_parse:tokens(Tokens). I'm sure there's a elegant sequence of commands that does this, but which is it? BR, Ulf W From rcbeerman@REDACTED Thu Jul 6 23:41:55 2006 From: rcbeerman@REDACTED (RCB) Date: Thu, 6 Jul 2006 14:41:55 -0700 Subject: mnesia:transform_table(Tab, Fun, NewAttributeList) In-Reply-To: <20060706174608.7369C5A1E5@mail.erlangsystems.com> References: <20060706174608.7369C5A1E5@mail.erlangsystems.com> Message-ID: Here's a hack (sorry!) It obviously applies the tuple definition of records that you've already mentioned in your message. -module(mt). -export([test/0]). -define(URNAME, user). user_record_v1(Uid, Uname, Upwd) -> {?URNAME, Uid, Uname, Upwd}. user_record_v2(Uid, Uname, Upwd, Email) -> {?URNAME, Uid, Uname, Upwd, Email}. test() -> RecV1 = [uid, uname, upassword], RecV2 = [uid, uname, upassword, uemail], {atomic, ok} = mnesia:create_table(?URNAME, [{attributes, RecV1}]), ok = mnesia:dirty_write(user_record_v1(1, "john doe", "password")), ok = mnesia:dirty_write(user_record_v1(2, "jane doe", "password")), {atomic, ok} = mnesia:transform_table(?URNAME, fun({_, Uid, Uname, Upwd}) -> user_record_v2(Uid, Uname, Upwd, none) end, RecV2, ?URNAME), ok = mnesia:dirty_write(user_record_v2(3, "baby joe", "password3", none)). (mt@REDACTED)44> mt:test(). ok (mt@REDACTED)45> ets:tab2list(user). [{user,1,"john doe","password",none}, {user,2,"jane doe","password",none}, {user,3,"baby joe","password3",none}] I suppose you could take your application offline, apply a conversion tool like this one (_after making a physical backup_ :->), and then push and start a new version of your software which uses the new 'user' record in the source. YMMV. Alternatively, a somewhat common pattern that can be applied is... -record(user, {id, urec}). -record(urec1, {username, password}). -record(urec2, {username, password, email}). #user{id = 1234, urec=#urec2{username = "John", password = "pw", email = none}}. You can then use run-time pattern matching on urec if you wish to have both record types to coexist in your table. By doing this, the name of the record does not change, nor does the primary key, but the actual payload can mutate along with your application's needs. There are some definite drawbacks to this, but it might make table transformation a little less involved. Good luck, Rich -- Rich Beerman Cupertino, California mobile: 408/221-2444 fax: 408/255-7944 On 7/6/06, Trap Exit wrote: > > Hi, folks. > > I have a mnesia table where I am about to change the definition of the record which it is based on. > I have found the mnesia:transform_table/3 and mnesia:transform_table/4 functions. I know how to implement this if I use tuples in the funs that transform the objects in the table. > > fun({user, UserId, UserName, UserPassword}) -> > UserEMail = none, > {user, UserId, UserName, UserPassword, UserEMail}. > > The problem is that I have been thought to to assume that records are tuples. > You cant have a record name with two definitions, if you have diffrent name, you will have to enter the new recordnam into the databas. > > So, how should one procede? > * When changeing the recodord defintion for at mnesia table change the record name, or > * Use the tuple definition of records. The code will only be used once so who cares, or > * None of the above. > > > Regards, > Andreas Hillqvist > _________________________________________________________ > Post sent from www.trapexit.org > > Read this topic online here: http://trapexit.erlang-consulting.com/forum/viewtopic.php?p=135#135 > From tobbe@REDACTED Thu Jul 6 23:50:03 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Thu, 06 Jul 2006 23:50:03 +0200 Subject: mnesia:transform_table(Tab, Fun, NewAttributeList) In-Reply-To: <20060706174608.7369C5A1E5@mail.erlangsystems.com> References: <20060706174608.7369C5A1E5@mail.erlangsystems.com> Message-ID: Trap Exit wrote: > Hi, folks. > > I have a mnesia table where I am about to change the definition of the record which it is based on. > I have found the mnesia:transform_table/3 and mnesia:transform_table/4 functions. I know how to implement this if I use tuples in the funs that transform the objects in the table. > > fun({user, UserId, UserName, UserPassword}) -> > UserEMail = none, > {user, UserId, UserName, UserPassword, UserEMail}. > > The problem is that I have been thought to to assume that records are tuples. > You cant have a record name with two definitions, if you have diffrent name, you will have to enter the new recordnam into the databas. > > So, how should one procede? > * When changeing the recodord defintion for at mnesia table change the record name, or > * Use the tuple definition of records. The code will only be used once so who cares, or Yes! --Tobbe > * None of the above. > > > Regards, > Andreas Hillqvist > _________________________________________________________ > Post sent from www.trapexit.org > > Read this topic online here: http://trapexit.erlang-consulting.com/forum/viewtopic.php?p=135#135 > From tobbe@REDACTED Thu Jul 6 23:53:46 2006 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Thu, 06 Jul 2006 23:53:46 +0200 Subject: odbc and MS sql server In-Reply-To: <002901c69f45$e9393c80$1500a8c0@dobrosoft.local> References: <002901c69f45$e9393c80$1500a8c0@dobrosoft.local> Message-ID: There is a HowTo describing this at trapexit.org. --Tobbe Yani Dzhurov wrote: > Hi > > > > I?ve been reading through the docs of odbc module and tried to establish > connection to a Microsoft sql server?.but without any success: > > {error,"No SQL-driver information available. Connection to database > failed."} > > I?ve tried it to run it both from windows and freebsd machine. > > Does anybody know which odbc drivers I exactly need? And is it possible > to connect to MS SQL server with erlang app, at all ? > > > > Thanks in advance, > > > > Jani > From nm@REDACTED Thu Jul 6 23:57:24 2006 From: nm@REDACTED (Gaspar Chilingarov) Date: Fri, 07 Jul 2006 02:57:24 +0500 Subject: Vim and Erlang syntax files - update - 2006/07/07 In-Reply-To: <44ACC906.8060704@club-internet.fr> References: <44ACC906.8060704@club-internet.fr> Message-ID: <44AD8744.6050809@web.am> Hello! I'm pleased to announce update of my erlang spport package for vim. Fixed some small problems with highlighting, added convient help browsing shortcut. With gvim 7.x you can view function definition (in/outargs) from help in baloon expression. You can download package from http://jsobfuscate.com/uploads/erlang/erlang-vim-20060707.tar.bz2 Readme file from archive is here: This package includes a bunch of files to help erlang program development with vim editor. Most commands will work in 6.3 and 6.4 versions, only one command require 7.0 version to run. Also fixed nasty buf with beaking correct syntax highlighting after using $" and $% character notations. What this package incudes: o compiler message parsing o syntax highligth o indentation rules o erlang-specific macros and shortcuts o 2 coloschemes tuned for erlang development o another files :) Please refer ls-R file for file-by-file description. Here are useful commands which you can use editing erlang files after this package setup. vim generic shortcuts (from .vimrc) restoring editint position to last edit position F2 - save file F11 - change to next buffer F4 - toggle explorer and tag manager F3/Space in normal mode - toggle fold (open/close) useful changes to n/N search commands (center search result) gvim generic settings: ZZ does not close gvi window - only current buffer, to close use :q - open xterminal in current directory - change to next buffer - change to previous buffer - give UP on this buffer - close it - write DOWN this buffer to disk erlang specific shortcuts and commands coming from .vim/ftplugin/erlang* Commenting out with % sign at line start like in borland IDE's [ Comment erlang code (add one level of %) ] Strip comments (remove one level of %) - compile current file (see erlang.vim, and uncomment one of the possible cases - using make or directly calling erlc) (only in gvim) or ;; -- show all lines, where identificator under cursor is used \l - list all error and warning messages which you got crom compilation and jump to one of them \= - just to next error message in list \p - jump to previous message in list \b - run make in current dir (same as F9) ex (in mnormal mode) - show list of all clauses defined in this module Time saving shortcuts: -- lanuch browser with help for this function if you are on Module:Function definition it will lookup Module.html under /usr/local/lib/erlang/lib/, and will try to jump to the Function definition. completition functions and possibly or will also lookup in erlang_dictionary which is distributed in this package and have function names from most of comonly used modules. \serv -- will generate gen_server template code using template in ftplugin/erlang.gen_server.tmpl \ecl -- generate test clause for use with test_server or simple_server And - finally quite useful function working only in gvim 7.0 and higher - baloon evaluation expression -- if you keep cursor on system library module:function call, it will lookup arguments and return value and show them in baloon near mouse cursor. -- Gaspar Chilingarov System Administrator, Network security consulting t +37493 419763 (mob) i 63174784 e nm@REDACTED From vik_jai@REDACTED Thu Jul 6 10:57:54 2006 From: vik_jai@REDACTED (vikash jaiswal) Date: Thu, 6 Jul 2006 09:57:54 +0100 (BST) Subject: Menubar within packer frame Message-ID: <20060706085754.13911.qmail@web8502.mail.in.yahoo.com> Hello , While trying to implement menubar within a packer frame , I'm getting a runtime error . The code is as -module(Menubar_with_packer). -export([start/0]). start()-> GSStart = gs:start(), WH = [{width,1000},{height,750}], Win = gs:window(GSStart,[{title," Menu_Bar with packer "}, {map, true},{configure,true},{width,1000},{height,750}]), F1 = gs:frame(packer,Win,[{packer_x,[{stretch,1,15},{stretch,1,15},{stretch,1,15}]},{packer_y,[{stretch,1,15},{stretch,1,15},{stretch,1,15}]}]), Bar = gs:menubar(F1,[{pack_x,{1,3}},{pack_y,1}), Menu_Item1 = gs:create(menubutton,Bar, [{label,{text,"ABC"}},{pack_x,1},{pack_y,1}]), Menu_item2 = gs:create(menubutton, Bar, [{label, {text,"MNO"}},{pack_x,2},{pack_y,1}]), gs:config(F1,WH), loop(F1). loop(F1)-> receive {gs,_,configure,_Data,[Width,Height|,_]} -> gs:config(F1,[{width,Width},{height,Height}]), loop(F1); Any -> loop(F1) end. Could you please tell me whether packing menubar within a packer frame is possible in erlang , or is there some problem with my code ? Waiting for your reply , Regards, Vikash --------------------------------- Yahoo! India Answers: Share what you know. Learn something new Click here Catch all the FIFA World Cup 2006 action on Yahoo! India Click here -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvg@REDACTED Thu Jul 6 20:15:01 2006 From: rvg@REDACTED (Rudolph van Graan) Date: Thu, 6 Jul 2006 20:15:01 +0200 Subject: mnesia:transform_table(Tab, Fun, NewAttributeList) In-Reply-To: <20060706174608.7369C5A1E5@mail.erlangsystems.com> References: <20060706174608.7369C5A1E5@mail.erlangsystems.com> Message-ID: Hi Andreas, On 06 Jul 2006, at 7:46 PM, Trap Exit wrote: > > The problem is that I have been thought to to assume that records > are tuples. Your assumption is correct. > You cant have a record name with two definitions, if you have > diffrent name, you will have to enter the new recordnam into the > databas. The record definition is not stored in a/the database. Mnesia translates the record tuple into an internal format based on the schema of the table. The purpose of the transform function is to give you an opportunity of changing this schema and at the same time to update all the old records to the new specification. If your function does not change the records to the new format, they will still be stored in mnesia in the old format, with the additional problem that your new record definition and mnesia's is now out of sync. The moment you change the record definition and recompile, all your code will understand the new format. But mnesia won't. This is the purpose of the transform functions. > * When changeing the recodord defintion for at mnesia table change > the record name, or No. use the same record name. > * Use the tuple definition of records. The code will only be used > once so who cares, or You will probably have to, as when you run this function *your* definition has already changed, but mnesia's has not. Match on the old record as a tuple and populate the new record. Something like this: {record, A, B, C} = OldRecord, NewRecord = #record{a = A, b = B, c = C, d = 123}, NewRecord. Rudolph van Graan Telecommunications Specialist Pattern Matched Technologies E-Mail: rvg@REDACTED Mobile: +27 83 390 7767 Fax: +27 12 667 5342 Web: www.patternmatched.com From jonslenk@REDACTED Thu Jul 6 22:40:45 2006 From: jonslenk@REDACTED (Jon Slenk) Date: Thu, 6 Jul 2006 13:40:45 -0700 Subject: "raw" or "verbatim" PIDs? Message-ID: <055501c6a13c$75cf2fe0$9b2042ab@snickerdoodle> (I've been Googling and looking through the archives, but haven't hit an explanation/answer so far.) I'm very new to Erlang, I'm just working my way through a tutorial. I spawned a process and was told that it has PID <0.47.0>, but I failed to assign that to a variable. Now, is there any way I can send a message to that PID by using the "raw" ID? I tried writing stuff like "<0.47.0> ! foobar." or "0.47.0 ! foobar." in an attempt to mimic the code I've seen where people write something like "ThePid = spawn(...). ThePid ! foobar." However, the Erlang shell did not like my attempts :-) Is there a way to use "raw" PIDs, or must it be stored in a variable? many thanks, -Jon. From joe.armstrong@REDACTED Thu Jul 6 10:17:07 2006 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Thu, 6 Jul 2006 10:17:07 +0200 Subject: question about Erlang's future Message-ID: Have you ever noted where my email's come from :-) My thesis was penned in 2003. Let's write the continuation: In 2004 I rejoined Ericsson, after 6 years, working in start-ups and research. Had things changed? - Yes Had the ban (which caused us to leave) worked? - No. "Was Erlang still banned?" - I asked, "Don't ask, just use it", they said - o O o - Once upon a time, when I was a kid, we had problems. "Hello Huston we have a problem" - Erlang is banned Then "problems" became "issues" << in about 1999, please, correct me here, I was gobsmacked - suddenly a perfectly good word totally vanished from the language - did you ever hear a politician use the word !"problem" after 1999=? >> Issues were pretty stable, for several years, but then suddenly, (two years ago?) "issues" became "challenges" Challenges were short lived (lasted about a year) and rapidly became "opportunities" So we have problem -> issue issue -> challenge challenge -> opportunity So the problem we had in 1998 is now a wonderful opportunity "moving forward". - o O o - > > What does this mean for Erlang's future? Has Ericsson > abandoned Erlang development besides periodic maintenance or > will Ericsson push Erlang in new directions? Where is Erlang heading? > Let's try to answer this: Ericsson has no corporate policy, regarding Erlang. Corporate policy is way more abstract than talking about individual technologies - nobody in above middle management knows how a phone works. Policy is all about "providing shareholder value, and moving forward, etc." So there is no policy about Erlang. Where are we heading etc. - silly question - nobody knows. It's like this: - We (Ericsson) have a number of products written in Erlang - these earn stuff called MONEY - We (and this includes me) are developing "secret-project-number-1" and "secret-project-number-2" etc. these we hope will one day earn MONEY - If the sum total of MONEY earnt is >> 0 and we win some internal wars then We will do a lot more than periodic maintenance, and will actively develop and exploit what the technology Fi Now it is my belief that multi-core Erlang etc. will give us just the edge we need so that our "secret-project-number-1" will be orders of magnitude faster than other peoples "secret-project-number-1" Will this earn money? - who knows? Will a competitor produce a better product using Haskell, or Java? - who knows? Will we win our wars? - who knows? The only statement I can make is that, I and the other Ericsson people who post to this list believe in what we are doing - and as long as they pay our wages and let us work on the stuff we believe in then we will work to support and improve the system. I have quit once, and I will quit again if this ceases to be true. /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Yariv Sadan > Sent: den 5 juli 2006 18:53 > To: Erlang Questions > Subject: question about Erlang's future > > Hi, > > I read Joe Armstrong's PhD thesis. It's a great read for > everybody who's learning Erlang. > > One passage that stood out to me was the following: > > "In February 1998 Erlang was banned for new product > development wit hin Ericsson - the main reason for the ban > was that Ericsson wanted to be a consumer of software > technologies rather than a producer. > In December 1998 Erlang and the OTP libraries were released > subject to an Open Source License. Since that date it has > been freely available for download from http://www.erlang.org/. > > In 1998 I left Ericsson together with a number of the > original Erlang group to found a new company Bluetail AB-in > all 15 people left Ericsson. The idea behind Bluet ail was to > use the Erlang technology to program products which make > Internet services more reliable. " > > > What does this mean for Erlang's future? Has Ericsson > abandoned Erlang development besides periodic maintenance or > will Ericsson push Erlang in new directions? Where is Erlang heading? > > Regards, > Yariv > From javierparis@REDACTED Fri Jul 7 00:54:18 2006 From: javierparis@REDACTED (Javier =?iso-8859-1?q?Par=EDs?=) Date: Fri, 7 Jul 2006 00:54:18 +0200 Subject: "raw" or "verbatim" PIDs? In-Reply-To: <055501c6a13c$75cf2fe0$9b2042ab@snickerdoodle> References: <055501c6a13c$75cf2fe0$9b2042ab@snickerdoodle> Message-ID: <200607070054.19255.javierparis@udc.es> El Jueves, 6 de Julio de 2006 22:40, Jon Slenk escribi?: > I'm very new to Erlang, I'm just working my way through a tutorial. I > spawned a process and was told that it has PID <0.47.0>, but I failed to > assign that to a variable. Now, is there any way I can send a message to > that PID by using the "raw" ID? I tried writing stuff like "<0.47.0> ! > foobar." or "0.47.0 ! foobar." in an attempt to mimic the code I've seen > where people write something like "ThePid = spawn(...). ThePid ! foobar." > However, the Erlang shell did not like my attempts :-) Is there a way to > use "raw" PIDs, or must it be stored in a variable. This way, for example: list_to_pid("<0.47.0>") ! foobar. Regards. From rcbeerman@REDACTED Fri Jul 7 01:56:48 2006 From: rcbeerman@REDACTED (RCB) Date: Thu, 6 Jul 2006 16:56:48 -0700 Subject: "raw" or "verbatim" PIDs? In-Reply-To: <055501c6a13c$75cf2fe0$9b2042ab@snickerdoodle> References: <055501c6a13c$75cf2fe0$9b2042ab@snickerdoodle> Message-ID: >From the Erlang shell, pid(X,Y,Z) pid(0,47,0) ! foobar. On 7/6/06, Jon Slenk wrote: > (I've been Googling and looking through the archives, but haven't hit an > explanation/answer so far.) > > I'm very new to Erlang, I'm just working my way through a tutorial. I > spawned a process and was told that it has PID <0.47.0>, but I failed to > assign that to a variable. Now, is there any way I can send a message to > that PID by using the "raw" ID? I tried writing stuff like "<0.47.0> ! > foobar." or "0.47.0 ! foobar." in an attempt to mimic the code I've seen > where people write something like "ThePid = spawn(...). ThePid ! foobar." > However, the Erlang shell did not like my attempts :-) Is there a way to use > "raw" PIDs, or must it be stored in a variable? > > many thanks, > -Jon. > -- Rich Beerman Cupertino, California mobile: 408/221-2444 fax: 408/255-7944 From ok@REDACTED Fri Jul 7 03:48:03 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 7 Jul 2006 13:48:03 +1200 (NZST) Subject: Thoughts about CEAN/refactoring Message-ID: <200607070148.k671m35d399646@atlas.otago.ac.nz> "Joe Armstrong \(AL/EAB\)" wrote: Versions are named like this AppName-Vsn Vsn is of no significance it is just a "distinguished string" It would be really REALLY nice if Vsn terms could be compared so that one could tell whether rabbit-ping was more recent than rabbit-pong without having to fossick around in some possibly remote and possibly inaccessible data base. From dgou@REDACTED Fri Jul 7 05:00:14 2006 From: dgou@REDACTED (Douglas Philips) Date: Thu, 6 Jul 2006 23:00:14 -0400 Subject: [Off-topic] Re: Best windows installer? In-Reply-To: <44AD6AE0.3050101@allcaps.org> References: <44AA84AD.6030600@yahoo.com> <44AC58A2.5020006@blueyonder.co.uk> <44ACE4B7.5060602@ericsson.com> <44AD6AE0.3050101@allcaps.org> Message-ID: On 2006 Jul 6, at 3:56 PM, Andrew Lentvorski indited: > Actually, I have the Mac/OS X attitude about software even for > Windows and Linux nowadays. > > If you ask for my root/administrator password, I dump your > software. I expect to unpack/mount an archive and run. > > A package must run in user space to allow me to check it out, if it > does not, I do not install it. Fair enough. But then at some point don't you want it integrated a bit more deeply? The Mac OS X solution works because the GUI is where you live, so you don't have to fret about getting 35 things onto your PATH, or about integrating with the whatis database or creating a user account for a server to run as, or ... --Douug From james.hague@REDACTED Fri Jul 7 05:42:48 2006 From: james.hague@REDACTED (James Hague) Date: Thu, 6 Jul 2006 22:42:48 -0500 Subject: Sometimes I miss destructively updating local variables Message-ID: Often I find myself writing a function that's just a case statement where each branch ends with a tail-recursive call. Here's an example pulled from working code: make_line_rec([{Tag,Ofs,Len}=Attr|T], B, Acc, X1, Y1, X2, Y2) -> case Tag of x1 -> make_line_rec(T, B, Acc, parse_units(B, Ofs, Len), Y1, X2, Y2); y1 -> make_line_rec(T, B, Acc, X1, parse_units(B, Ofs, Len), X2, Y2); x2 -> make_line_rec(T, B, Acc, X1, Y1, parse_units(B, Ofs, Len), Y2); y2 -> make_line_rec(T, B, Acc, X1, Y1, X2, parse_units(B, Ofs, Len)); _ -> case is_attr(Tag) of true -> make_line_rec(T, B, [get_attr(Attr, B)|Acc], X1, Y1, X2, Y2); false -> make_line_rec(T, B, Acc, X1, Y1, X2, Y2) end end; make_line_rec([], _, Acc, X1, Y1, X2, Y2) -> {line, Acc, X1, Y1, X2, Y2}. What bugs me is having to list all the variables in the make_line_rec call. In reality, this function is just a while loop, and each time through the loop one of a set of local variables (Acc, X1, Y1, X2, Y2) is updated. Before any functional purists jump on me, this is EXACTLY how the generated BEAM code works. Those variables live in registers, and each make_line_rec "call" destructively updates one of those values, then jumps to the start of the function. In fact, I could write a language with destructive updates for locals, and the generated code would be fast and efficient--and perfectly normal--Erlang. The difference being that all the listing of parameters goes away, and the function is less dense and simpler to maintain. How do other Erlang programmers deal with this? James From rlenglet@REDACTED Fri Jul 7 05:50:48 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Fri, 7 Jul 2006 12:50:48 +0900 Subject: [Off-topic] Re: Best windows installer? In-Reply-To: <44ACE4B7.5060602@ericsson.com> References: <44AC58A2.5020006@blueyonder.co.uk> <44ACE4B7.5060602@ericsson.com> Message-ID: <200607071250.49106.rlenglet@users.forge.objectweb.org> Bengt Kleberg wrote: > On 2006-07-06 02:26, David Hopwood wrote: > ...deleted > > > Don't Windows and Unix users generally have quite different > > expectations about how installation should work? I would > > have thought that most Unix > > this one i pass. i do not use windows. > perhaps i could be permitted to compare mac and unix, instead? > > on unix i am quite comfortable with a source/compile > installation. whereas on a mac i am only use the normal > pre-compiled drag-and-drop installation. otherwise i forgoe > the software. And how do you do upgrades? And uninstallations? > > users prefer to use their OS/distribution's package manager, > > rather than a standalone executable installer. > > ''most''? those that do not have the password for root are > surely not able to use their OS/distribution's package > manager, are they? so, does most unix user have root, or not? "Users" above also includes administrators. If you don't have root access, or if your administrator has not given you enough sudo(1) rights, then your administrator should be willing to help you install the software that you need to do your work. If he is not willing to help, and then you have no way to install software correctly (i.e., using the OS's packaging system if there is one, and respecting standards such as the LSB and the FHS), then that system administrator should be fired. This reminds me of "security managers" who are responsible for the maintainance of firewalls, but who systematically refuse to open ports that are necessary for work (CVS, etc.). In the end, users are forced to establish (in secret!) SSH or HTTP tunnels with systems outside, or even to buy separate xDSL lines using the company's budget, to have direct access to the outside without having to use the company's network (yes, I have seen that IRL!), which completely ruins the interest of having a firewall in the first place. Stated otherwise, if you can't use the packaging system of your OS to install and upgrade software (even if this would require that you ask your administrator to do so), it is not a technical problem, but it is a human and managerial one. Don't expect a technical solution to solve this problem. And when administrators have to manage several tens or hundreds of computers, what do you believe they prefer: (1) download sources and compile, and install by hand all software, on every computer, and for every installation or upgrade of every software, or (2) use automatic tools based on existing packaging systems (e.g., cfengine, apt, fai, etc. for GNU/Linux distros)? -- Romain LENGLET From rcbeerman@REDACTED Fri Jul 7 07:10:12 2006 From: rcbeerman@REDACTED (RCB) Date: Thu, 6 Jul 2006 22:10:12 -0700 Subject: Sometimes I miss destructively updating local variables In-Reply-To: References: Message-ID: Maybe something like this... -record(vrec, {x1, y1, x2, y2}). % (or just use a 'raw' tuple if the x1,.. set is static) make_line_rec([{Tag, Ofs, Len} | T], B, Acc, V) when Tag == x1; Tag == y1; Tag == x2; Tag == y2 -> make_line_rec(T, B, Acc, parse_units(Tag, V, B, Ofs, Len)); make_line_rec([{Tag, _, _} = Attr|T], B, Acc, V) -> case is_attr(Tag) of true -> make_line_rec(T, B, [get_attr(Attr, B)|Acc], V); false -> make_line_rec(T, B, Acc, V) end end; make_line_rec([], _, Acc, V) -> {line, Acc, V#vrec.x1, V#vrec.y1, V#vrec.x2, V#vrec.y2}. parse_units(Tag, V, B, Ofs, Len) -> % create data to assign to one of the x1... vars set_vrec(Tag, V, Data). set_vrec(x1, V, Data) -> V#vrec{x1 = Data}; set_vrec(x2, V, Data) -> V#vrec{x2 = Data}; ... Of course, I'm pushing some of the density down beyond parse_units, but this seems to be what I typically do. Isolating the X1,... vars into a single #vrec{} also makes the function a little easier to modify if you ever need to add extra elements. My .02.... Rich On 7/6/06, James Hague wrote: > Often I find myself writing a function that's just a case statement > where each branch ends with a tail-recursive call. Here's an example > pulled from working code: > > make_line_rec([{Tag,Ofs,Len}=Attr|T], B, Acc, X1, Y1, X2, Y2) -> > case Tag of > x1 -> make_line_rec(T, B, Acc, parse_units(B, Ofs, Len), Y1, X2, Y2); > y1 -> make_line_rec(T, B, Acc, X1, parse_units(B, Ofs, Len), X2, Y2); > x2 -> make_line_rec(T, B, Acc, X1, Y1, parse_units(B, Ofs, Len), Y2); > y2 -> make_line_rec(T, B, Acc, X1, Y1, X2, parse_units(B, Ofs, Len)); > _ -> > case is_attr(Tag) of > true -> make_line_rec(T, B, [get_attr(Attr, B)|Acc], X1, > Y1, X2, Y2); > false -> make_line_rec(T, B, Acc, X1, Y1, X2, Y2) > end > end; > make_line_rec([], _, Acc, X1, Y1, X2, Y2) -> {line, Acc, X1, Y1, X2, Y2}. > > What bugs me is having to list all the variables in the make_line_rec > call. In reality, this function is just a while loop, and each time > through the loop one of a set of local variables (Acc, X1, Y1, X2, Y2) > is updated. Before any functional purists jump on me, this is EXACTLY > how the generated BEAM code works. Those variables live in registers, > and each make_line_rec "call" destructively updates one of those > values, then jumps to the start of the function. > > In fact, I could write a language with destructive updates for locals, > and the generated code would be fast and efficient--and perfectly > normal--Erlang. The difference being that all the listing of > parameters goes away, and the function is less dense and simpler to > maintain. > > How do other Erlang programmers deal with this? > > James > -- Rich Beerman Cupertino, California mobile: 408/221-2444 fax: 408/255-7944 From ok@REDACTED Fri Jul 7 08:21:23 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 7 Jul 2006 18:21:23 +1200 (NZST) Subject: Sometimes I miss destructively updating local variables Message-ID: <200607070621.k676LNsn407483@atlas.otago.ac.nz> "James Hague" wrote (a recursive function which can be rewritten as) make_line_rec([{Tag,Ofs,Len}=Attr|T], B, Acc, X1, Y1, X2, Y2) -> {Acc_,X1_,Y1_,X2_,Y2_} = case Tag of x1 -> {Acc,parse_units(B, Ofs, Len),Y1,X2,Y2} ; x2 -> {Acc,X1,parse_units(B, Ofs, Len),X2,Y2} ; y1 -> {Acc,X1,Y1,parse_units(B, Ofs, Len),Y2} ; y2 -> {Acc,X1,Y1,X2,parse_units(B, Ofs, Len)} ; _ -> case is_attr(Tag) of true -> {get_attr(Attr,B)|Acc],X1,Y1,X2,Y2} ; false -> {Acc,X1,Y1,X2,Y2} end end, make_line_rec(T, B, Acc_, X1_, Y1_, X2_, Y2_); make_line_rec([], _, Acc, X1, Y1, X2, Y2) -> {line,Acc,X1,Y1,X2,Y2}. Using the "let loop" notation proposed earlier for generalised folds, this could be make_line_rec(Attrs, B, Acc, X1, Y1, X2, Y2) -> let {List,Xa,Ya,Xb,Yb} = {Acc,X1,Y1,X2,Y2} then case Tag of of x1 -> {List,parse_units(B, Ofs, Len),Ya,Xb,Yb} ; x2 -> {List,Xa,parse_units(B, Ofs, Len),Xb,Yb} ; y1 -> {List,Xa,Ya,parse_units(B, Ofs, Len),Yb} ; y2 -> {List,Xa,Ya,Xb,parse_units(B, Ofs, Len)} ; _ -> case is_attr(Tag) of true -> {get_attr(Attr,B)|List],Xa,Ya,Xb,Yb} ; false -> {List,Xa,Ya,Xb,Yb} end end for Attr = {Tag,Ofs,Len} <- Attrs in {line,List,Xa,Ya,Xb,Yb}. Now there _is_ some redundancy here, but not as much. I'm not sure that listing the unchanged variables is a bad thing as long as there aren't too many of them. It _would_ be possible to extend Erlang syntax with "Variable := Expression", meaning to introduce a new binding for Variable, but there are a lot of details to work out. From ok@REDACTED Fri Jul 7 08:31:42 2006 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 7 Jul 2006 18:31:42 +1200 (NZST) Subject: [Off-topic] Re: Best windows installer? Message-ID: <200607070631.k676Vgc0407161@atlas.otago.ac.nz> Romain Lenglet wrote: If you don't have root access, or if your administrator has not given you enough sudo(1) rights, then your administrator should be willing to help you install the software that you need to do your work. On the UltraSPARC II box that I use, my sysadmin made a /users/local directory with lots of space for me to play with. As long as software lets me "waltz" with a ONE ./configure --prefix=/users/local TWO make THREE make install I can use it. On the MacOS X box that I use, I have a $HOME/local directory, and as long as software lets me "waltz" with a ONE ./configure --prefix=$HOME/local TWO make THREE make install I can use it. That's because I have the developer tools installed. Too much potentially useful Mac software assumes (1) You do not have the developer tools, so you have to install binaries; (2) You DO have root access, so stuff can be placed in /Applications and Library. That stuff I cannot install (which is why I don't have SML on my Mac). Other software assumes I can use something called fink, which again assumes that I have root access so stuff can be placed in /usr/local and so on. That stuff I cannot install either. If he is not willing to help, and then you have no way to install software correctly (i.e., using the OS's packaging system if there is one, and respecting standards such as the LSB and the FHS), then that system administrator should be fired. You have forgotten the third alternative: - user cannot install (because stuff would have to go into directories the user does not have permission to change) - sysadmin is WILLING to help - sysadmin is seriously snowed under with other higher-priority work. We have ONE Macintosh expert to look after all staff and student Macs in this department, AND she has other jobs to do as well. We also have ONE Unix expert. There are very pleasant MacOS X programs, like the ICab web and Amaya browsers and Ambrai and Squeak Smalltalk and OpenOffice which are or contain binaries but let you put them anywhere. Stated otherwise, if you can't use the packaging system of your OS to install and upgrade software (even if this would require that you ask your administrator to do so), it is not a technical problem, but it is a human and managerial one. Don't expect a technical solution to solve this problem. The managerial problem is the fundamental one. From matthias@REDACTED Fri Jul 7 08:36:49 2006 From: matthias@REDACTED (Matthias Lang) Date: Fri, 7 Jul 2006 08:36:49 +0200 Subject: Menubar within packer frame In-Reply-To: <20060706085754.13911.qmail@web8502.mail.in.yahoo.com> References: <20060706085754.13911.qmail@web8502.mail.in.yahoo.com> Message-ID: <17582.257.935073.764511@antilipe.corelatus.se> vikash jaiswal writes: > While trying to implement menubar within a packer frame , > I'm getting a runtime error . The code is as The code you've attached doesn't even compile: 3> c(menubar_with_packer). ./menubar_with_packer.erl:14: syntax error before: ')' ... You didn't say which runtime error you're getting. Looking at your code, it looks unlikely that it ever compiled. It's full of mistakes. Could it be that you are confusing a "my code does not compile" error with a "runtime" error? Matthias From xpdoka@REDACTED Fri Jul 7 08:39:39 2006 From: xpdoka@REDACTED (Dominic Williams) Date: Fri, 7 Jul 2006 08:39:39 +0200 (CEST) Subject: Sometimes I miss destructively updating local variables In-Reply-To: References: Message-ID: <46113.81.249.0.175.1152254379.squirrel@www.geekisp.com> Hi James, > What bugs me is having to list all the variables in the make_line_rec > call. How about using a dict (or orddict)? make_line_rec([{Tag,Ofs,Len}|T], B, Acc, Dict) when Tag==x1; Tag==y1; Tag==x2; Tag==y2 -> make_line_rec(T, B, Acc, dict:store(Tag, parse_units(B, Ofs, Len), Dict)); make_line_rec([{Tag,Ofs,Len}=Attr|T], B, Acc, Dict) -> case is_attr(Tag) of true -> make_line_rec(T, B, [get_attr(Attr, B)|Acc], Dict); false -> make_line_rec(T, B, Acc, Dict) end; make_line_rec([], _, Acc, Dict) -> {line, Acc, dict:fetch(x1, Dict), dict:fetch(y1, Dict), dict:fetch(x2, Dict), dict:fetch(y2, Dict)}. That last clause could also be: make_line_rec([], _, Acc, Dict) -> list_to_tuple([line, Acc | [dict:fetch(X, Dict) || X <- [x1, y1, x2, y2]]]). Cheers, Dominic Williams http://www.dominicwilliams.net ---- From ulf.wiger@REDACTED Fri Jul 7 09:45:34 2006 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Fri, 7 Jul 2006 09:45:34 +0200 Subject: mnesia:transform_table(Tab, Fun, NewAttributeList) Message-ID: Andreas Hillqvist wrote: > > The problem is that I have been thought to to assume that > records are tuples. > You cant have a record name with two definitions, if you have > diffrent name, you will have to enter the new recordnam into > the databas. The unwritten rule is that during upgrade - code_change() functions and mnesia:transform_table() - one breaks the record abstraction and treats the old records as tuples, like Rudolph and Tobbe suggested. BR, Ulf W From richardc@REDACTED Fri Jul 7 10:57:55 2006 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 07 Jul 2006 10:57:55 +0200 Subject: "raw" or "verbatim" PIDs? In-Reply-To: <055501c6a13c$75cf2fe0$9b2042ab@snickerdoodle> References: <055501c6a13c$75cf2fe0$9b2042ab@snickerdoodle> Message-ID: <44AE2213.2000708@it.uu.se> Jon Slenk wrote: > I'm very new to Erlang, I'm just working my way through a tutorial. I > spawned a process and was told that it has PID <0.47.0>, but I failed to > assign that to a variable. Now, is there any way I can send a message to > that PID by using the "raw" ID? I tried writing stuff like "<0.47.0> ! > foobar." or "0.47.0 ! foobar." in an attempt to mimic the code I've seen > where people write something like "ThePid = spawn(...). ThePid ! > foobar." However, the Erlang shell did not like my attempts :-) Is there > a way to use "raw" PIDs, or must it be stored in a variable? You can, but it's probably best not to make it a habit. Try to learn how to work with variables in the shell instead - it pays off. First, note that if you do something like this: 1> ThePid = spawn(...). <0.47.0> 2> ThePid ! hello. ... 7> ThePid = spawn(...). then the last "assignment" will fail, since ThePid is already bound to another pid, so the "=" match will fail. You can use the shell function f() to forget all previous variable bindings, or f(ThePid) to forget a particular binding. A handy thing is the v(N) shell function. If you e.g. spawn a process but forget to bind the pid to something, you can still access the value by referring to the number of the command. For example: 17> spawn(...). <0.99.0> ... 23> MyPid = v(17). <0.99.0> 24> MyPid ! hello. (only the last N results are saved, though - about 20 or so). /Richard From christophe.romain@REDACTED Fri Jul 7 11:00:15 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Fri, 7 Jul 2006 11:00:15 +0200 Subject: multi platform support into standard Erlang packaging In-Reply-To: <44ACF70C.5060904@ericsson.com> References: <18c0672bad132fb05de2d69036add197@process-one.net> <44ACF70C.5060904@ericsson.com> Message-ID: <69d2dbfc35a6bbe41ef713b03b258bd8@process-one.net> > how about > myapp-1.0/priv/linux-x86/lib/ with link for backward compatibility we can even package apps that are still not patched... good point ! thanks. From chaitanya.chalasani@REDACTED Fri Jul 7 12:16:27 2006 From: chaitanya.chalasani@REDACTED (Chaitanya Chalasani) Date: Fri, 7 Jul 2006 15:46:27 +0530 Subject: Standby system handover Message-ID: <200607071546.28327.chaitanya.chalasani@gmail.com> Hi, We currently have a non-realtime standby server for our mission critical application. In our struggle to make a realtime standby system my job is to develop an application that does TCP/IP packet forwarding to the active server and in an event of active server unavailability it would send the packet to any of the configured standby server. The application is not written in erlang, but I am planning to write the soft handover application in erlang. I am attaching a test module for the same which serves the purpose but I wanted to know a better design for the same or any feature in erlang/OTP that can help me build more robust application. -- CHAITANYA CHALASANI LINUX USER #410931 -------------- next part -------------- -module(routerApp). -compile(export_all). listener(PortOwn,ClusterList) -> case gen_tcp:listen(PortOwn,[binary,{packet,0},{keepalive,true},{reuseaddr,true}]) of {ok,LSock} -> acceptConnections(LSock,ClusterList), gen_tcp:close(LSock), listener(PortOwn,ClusterList); Other -> io:format("Received ~p~n",[Other]) end. acceptConnections(LSock,ClusterList) -> case gen_tcp:accept(LSock) of {ok,Sock} -> Pid = spawn(routerApp,clientConnectionThread,[Sock,ClusterList]), gen_tcp:controlling_process(Sock,Pid ), acceptConnections(LSock,ClusterList); {error,Reason} -> io:format("Unknown error ~p~n",[Reason]); Other -> io:format("Unknown responce ~p~n",[Other]) end. clientConnectionThread(Sock,[{Ipaddress,Port}|ClusterList]) -> case gen_tcp:connect(Ipaddress,Port ,[binary,{active,true}] ) of {ok,ClustSock} -> case listenForMessages(Sock,ClustSock) of {error,clusterNodeClosed} -> clientConnectionThread(Sock,ClusterList++[{Ipaddress,Port}]); {error,clientClosed} -> io:format("Client Closed and so parallel thread dieing~n"); Other -> io:format("Unknown error ~p and so parallel thread dieing~n",[Other]) end; Other1 -> io:format("Received ~p while connecting to ~p ~n",[Other1,{Ipaddress,Port}] ), clientConnectionThread(Sock,ClusterList++[{Ipaddress,Port}]) end. listenForMessages(Sock,ClustSock) -> receive {tcp_closed,ClustSock} -> gen_tcp:close(ClustSock), gen_tcp:close(Sock), {error,clientCloses}; %{error,clusterNodeClosed}; {tcp_closed,Sock} -> gen_tcp:close(Sock), gen_tcp:close(ClustSock), {error,clientClosed}; {tcp,ClustSock,Data} -> io:format("Received ~w from server socket~n",[Data]), gen_tcp:send(Sock,Data ), listenForMessages(Sock,ClustSock); {tcp,Sock,Data} -> io:format("Received ~w from client socket~n",[Data]), gen_tcp:send(ClustSock,Data ), listenForMessages(Sock,ClustSock); Other -> io:format("Received unknown info ~p~n",[Other]), {error,unknown} end. From Micic_V@REDACTED Fri Jul 7 13:08:19 2006 From: Micic_V@REDACTED (Valentin Micic [ MTN - Innovation Centre ]) Date: Fri, 7 Jul 2006 13:08:19 +0200 Subject: Desperately again: 64-bit Erlang on SOLARIS 10 Message-ID: <23684C9CDF88C04FA8800AA825EADF51034CA124@MTNMAIL.mtn.co.za> Problem that I've been talking about are known and if one RTFM, things are nicely explained. Thus, for the benefit of other people that might be having Attention Deficit Disorder, allow me to paste the following explanation, as posted on www.sunfreeware.com for SOLARIS 10 ggc.3.3.2 download: * Note that this version of gcc was created on build 60 of Solaris 10. If you are using a higher version, you will need to redo some of the header files. This is done by doing the following steps: * cd /usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2/install-tools/ * * Put the line SHELL=/bin/sh on the first line of the mkheaders.conf * file. Then run * * ./mkheaders * * This will correct some files and make the build 60 gcc usable on * higher builds. I have tested this on build 72 and it works fine. Apologies for any inconvenience and time wasted. Valentin. ________________________________ From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Valentin Micic [ MTN - Innovation Centre ] Sent: Wednesday, 05 July 2006 6:21 PM To: erlang-questions@REDACTED Cc: valentin@REDACTED Subject: Desperately again: 64-bit Erlang on SOLARIS 10 Ok, people. I've managed to narrow a problem to version of gnu compiler. I can successfully compile Erlang 11 on Solaris10 using gcc ver. 2.95.3. Unfortunately, this version does not support 64-bit architecture (it does not recognize -m64 flag). Whenever I've tried gcc version 3.3.2 (or 3.4.2) the whole hell brakes lose. Well, I'm getting desperate now. I would appreciate hint as to which gcc version to use to deliver 64-bit erlang on Solaris 10. Valentin. PS I've downloaded gcc from www.sunfreeware.com , which happens to be sponsored by SUN. Can they be trusted :-). NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/disclaimer NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/disclaimer -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Fri Jul 7 13:50:19 2006 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 07 Jul 2006 07:50:19 -0400 Subject: Standby system handover In-Reply-To: <200607071546.28327.chaitanya.chalasani@gmail.com> References: <200607071546.28327.chaitanya.chalasani@gmail.com> Message-ID: <44AE4A7B.8050001@hq.idt.net> Chaitanya, Wouldn't your packet forwarder be a single point of failure then? Unless you have some balancing capability at the client with added intelligence of removing unavailable packet forwarders from the list of known servers. Though this increases the complexity of the client's implementation. The way we deal with a similar problem domain is as follows. Two hosts and two routers are selected to form a redundant cluster. Each host has two NICs and a serial crossover link to its mate server. Ethernet bonding kernel module is configured to form a bonding interface with a *single* MAC address assigned to both NICs in the active/standby link configuration. Each NIC is connected to a router (CISCO 3750, or alike) running HSRP protocol. The server-side connections are placed in the same VLAN. This gives Layer 2 redundancy and resilience to router failures or NIC failures: | L A N | | | +----+----+ HSRP +----+----+ | CISCO +------+ CISCO | | +------+ | +----+----+ +----+----+ | \ / | | \ / | | \/ | | VIP1 /\ VIP2 | | / \ | +-+-----+ +-----+-+ |Server1| |Server2| +----+--+ +---+---+ | | +-----------+ Serial Hartbeat Link Secondly, we use http://linux-ha.org project for virtual IP management. Two VIPs are configurd that are owned one per active server. Clients talk to servers through these VIPs. Additionally a serial hartbeat link is used as a separate hardware path between VIP management software for heath checks. In the event that a server goes down or a service goes down for maintenance, the VIP owned by the server gets migrated to the other server until the former owner becomes available. This gives us Layer 3 redundancy. As far as the server application is concerned, do you need the servers running in the active-standby mode or load sharing? If the servers need to share some state, you could store that state in mnesia, and have it replicated between both nodes, while both nodes would be available sharing the workload. In this configuration there may not even be a need for a separate packet forwarder, as each TCP server would simply listen for incoming packets on the "0.0.0.0" address (which covers all VIPs currently managed by the server), and do its job, or be a protocol converter between some TCP protocol and Erlang terms forwarded to another Erlang gen_server process running in the cluster using some balancing method such as pg2 application. This approach works well for us for making highly available server processes. Regards, Serge Chaitanya Chalasani wrote: > Hi, > > We currently have a non-realtime standby server for our mission critical > application. In our struggle to make a realtime standby system my job is to > develop an application that does TCP/IP packet forwarding to the active > server and in an event of active server unavailability it would send the > packet to any of the configured standby server. The application is not > written in erlang, but I am planning to write the soft handover application > in erlang. I am attaching a test module for the same which serves the purpose > but I wanted to know a better design for the same or any feature in > erlang/OTP that can help me build more robust application. > > > > ------------------------------------------------------------------------ > > -module(routerApp). > -compile(export_all). > > > listener(PortOwn,ClusterList) -> > case gen_tcp:listen(PortOwn,[binary,{packet,0},{keepalive,true},{reuseaddr,true}]) of > {ok,LSock} -> > acceptConnections(LSock,ClusterList), > gen_tcp:close(LSock), > listener(PortOwn,ClusterList); > Other -> > io:format("Received ~p~n",[Other]) > end. > > acceptConnections(LSock,ClusterList) -> > case gen_tcp:accept(LSock) of > {ok,Sock} -> > Pid = spawn(routerApp,clientConnectionThread,[Sock,ClusterList]), > gen_tcp:controlling_process(Sock,Pid ), > acceptConnections(LSock,ClusterList); > {error,Reason} -> > io:format("Unknown error ~p~n",[Reason]); > Other -> > io:format("Unknown responce ~p~n",[Other]) > end. > > clientConnectionThread(Sock,[{Ipaddress,Port}|ClusterList]) -> > case gen_tcp:connect(Ipaddress,Port ,[binary,{active,true}] ) of > {ok,ClustSock} -> > case listenForMessages(Sock,ClustSock) of > {error,clusterNodeClosed} -> > clientConnectionThread(Sock,ClusterList++[{Ipaddress,Port}]); > {error,clientClosed} -> > io:format("Client Closed and so parallel thread dieing~n"); > Other -> > io:format("Unknown error ~p and so parallel thread dieing~n",[Other]) > end; > Other1 -> > io:format("Received ~p while connecting to ~p ~n",[Other1,{Ipaddress,Port}] ), > clientConnectionThread(Sock,ClusterList++[{Ipaddress,Port}]) > end. > > listenForMessages(Sock,ClustSock) -> > receive > {tcp_closed,ClustSock} -> > gen_tcp:close(ClustSock), > gen_tcp:close(Sock), > {error,clientCloses}; > %{error,clusterNodeClosed}; > {tcp_closed,Sock} -> > gen_tcp:close(Sock), > gen_tcp:close(ClustSock), > {error,clientClosed}; > {tcp,ClustSock,Data} -> > io:format("Received ~w from server socket~n",[Data]), > gen_tcp:send(Sock,Data ), > listenForMessages(Sock,ClustSock); > {tcp,Sock,Data} -> > io:format("Received ~w from client socket~n",[Data]), > gen_tcp:send(ClustSock,Data ), > listenForMessages(Sock,ClustSock); > Other -> > io:format("Received unknown info ~p~n",[Other]), > {error,unknown} > end. From chaitanya.chalasani@REDACTED Fri Jul 7 14:00:38 2006 From: chaitanya.chalasani@REDACTED (Chaitanya Chalasani) Date: Fri, 7 Jul 2006 17:30:38 +0530 Subject: Standby system handover In-Reply-To: <44AE4A7B.8050001@hq.idt.net> References: <200607071546.28327.chaitanya.chalasani@gmail.com> <44AE4A7B.8050001@hq.idt.net> Message-ID: <200607071730.38615.chaitanya.chalasani@gmail.com> Dear Serge, Thank you very much. This seems to be a very good architecture for highly availability. I will try the same. On Friday 07 July 2006 17:20, Serge Aleynikov wrote: > Chaitanya, > > Wouldn't your packet forwarder be a single point of failure then? > Unless you have some balancing capability at the client with added > intelligence of removing unavailable packet forwarders from the list of > known servers. Though this increases the complexity of the client's > implementation. > > The way we deal with a similar problem domain is as follows. Two hosts > and two routers are selected to form a redundant cluster. Each host has > two NICs and a serial crossover link to its mate server. Ethernet > bonding kernel module is configured to form a bonding interface with a > *single* MAC address assigned to both NICs in the active/standby link > configuration. Each NIC is connected to a router (CISCO 3750, or alike) > running HSRP protocol. The server-side connections are placed in the > same VLAN. This gives Layer 2 redundancy and resilience to router > > failures or NIC failures: > | L A N | > > +----+----+ HSRP +----+----+ > > | CISCO +------+ CISCO | > | +------+ | > > +----+----+ +----+----+ > > | \ / | > | \ / | > | \/ | > | VIP1 /\ VIP2 | > | / \ | > > +-+-----+ +-----+-+ > > |Server1| |Server2| > > +----+--+ +---+---+ > > +-----------+ > Serial Hartbeat Link > > Secondly, we use http://linux-ha.org project for virtual IP management. > Two VIPs are configurd that are owned one per active server. Clients > talk to servers through these VIPs. Additionally a serial hartbeat link > is used as a separate hardware path between VIP management software for > heath checks. In the event that a server goes down or a service goes > down for maintenance, the VIP owned by the server gets migrated to the > other server until the former owner becomes available. This gives us > Layer 3 redundancy. > > As far as the server application is concerned, do you need the servers > running in the active-standby mode or load sharing? If the servers need > to share some state, you could store that state in mnesia, and have it > replicated between both nodes, while both nodes would be available > sharing the workload. > > In this configuration there may not even be a need for a separate packet > forwarder, as each TCP server would simply listen for incoming packets > on the "0.0.0.0" address (which covers all VIPs currently managed by the > server), and do its job, or be a protocol converter between some TCP > protocol and Erlang terms forwarded to another Erlang gen_server process > running in the cluster using some balancing method such as pg2 application. > > This approach works well for us for making highly available server > processes. > > Regards, > > Serge > > Chaitanya Chalasani wrote: > > Hi, > > > > We currently have a non-realtime standby server for our mission critical > > application. In our struggle to make a realtime standby system my job is > > to develop an application that does TCP/IP packet forwarding to the > > active server and in an event of active server unavailability it would > > send the packet to any of the configured standby server. The application > > is not written in erlang, but I am planning to write the soft handover > > application in erlang. I am attaching a test module for the same which > > serves the purpose but I wanted to know a better design for the same or > > any feature in erlang/OTP that can help me build more robust application. > > > > > > > > ------------------------------------------------------------------------ > > > > -module(routerApp). > > -compile(export_all). > > > > > > listener(PortOwn,ClusterList) -> > > case > > gen_tcp:listen(PortOwn,[binary,{packet,0},{keepalive,true},{reuseaddr,tru > >e}]) of {ok,LSock} -> > > acceptConnections(LSock,ClusterList), > > gen_tcp:close(LSock), > > listener(PortOwn,ClusterList); > > Other -> > > io:format("Received ~p~n",[Other]) > > end. > > > > acceptConnections(LSock,ClusterList) -> > > case gen_tcp:accept(LSock) of > > {ok,Sock} -> > > Pid = > > spawn(routerApp,clientConnectionThread,[Sock,ClusterList]), > > gen_tcp:controlling_process(Sock,Pid ), > > acceptConnections(LSock,ClusterList); > > {error,Reason} -> > > io:format("Unknown error ~p~n",[Reason]); > > Other -> > > io:format("Unknown responce ~p~n",[Other]) > > end. > > > > clientConnectionThread(Sock,[{Ipaddress,Port}|ClusterList]) -> > > case gen_tcp:connect(Ipaddress,Port ,[binary,{active,true}] ) of > > {ok,ClustSock} -> > > case listenForMessages(Sock,ClustSock) of > > {error,clusterNodeClosed} -> > > > > clientConnectionThread(Sock,ClusterList++[{Ipaddress,Port}]); > > {error,clientClosed} -> > > io:format("Client Closed and so parallel thread > > dieing~n"); Other -> > > io:format("Unknown error ~p and so parallel thread > > dieing~n",[Other]) end; > > Other1 -> > > io:format("Received ~p while connecting to ~p > > ~n",[Other1,{Ipaddress,Port}] ), > > clientConnectionThread(Sock,ClusterList++[{Ipaddress,Port}]) end. > > > > listenForMessages(Sock,ClustSock) -> > > receive > > {tcp_closed,ClustSock} -> > > gen_tcp:close(ClustSock), > > gen_tcp:close(Sock), > > {error,clientCloses}; > > %{error,clusterNodeClosed}; > > {tcp_closed,Sock} -> > > gen_tcp:close(Sock), > > gen_tcp:close(ClustSock), > > {error,clientClosed}; > > {tcp,ClustSock,Data} -> > > io:format("Received ~w from server socket~n",[Data]), > > gen_tcp:send(Sock,Data ), > > listenForMessages(Sock,ClustSock); > > {tcp,Sock,Data} -> > > io:format("Received ~w from client socket~n",[Data]), > > gen_tcp:send(ClustSock,Data ), > > listenForMessages(Sock,ClustSock); > > Other -> > > io:format("Received unknown info ~p~n",[Other]), > > {error,unknown} > > end. -- CHAITANYA CHALASANI LINUX USER #410931 From richardc@REDACTED Fri Jul 7 14:23:48 2006 From: richardc@REDACTED (Richard Carlsson) Date: Fri, 07 Jul 2006 14:23:48 +0200 Subject: Sometimes I miss destructively updating local variables In-Reply-To: References: Message-ID: <44AE5254.80704@it.uu.se> James Hague wrote: > Often I find myself writing a function that's just a case statement > where each branch ends with a tail-recursive call. > [...] > What bugs me is having to list all the variables in the make_line_rec > call. In reality, this function is just a while loop, and each time > through the loop one of a set of local variables (Acc, X1, Y1, X2, Y2) > is updated. I usually start by looking for a wider context (more than one function) where a set of parameters can be abstracted out into a record, like Rich Beerman suggested. Things that are accessed or updated in every iteration of a loop, I'd try to keep in separate parameters for efficiency. In your example, the shape of the final result suggests this solution: -record(line, {acc, x1, y1, x2, y2}). make_line_rec(Tags, B, OtherStuff) -> make_line_rec(Tags, B, [], #line{}). make_line_rec([{Tag,Ofs,Len}=Attr|T], B, Acc, L) -> case Tag of x1 -> make_line_rec(T, B, Acc, L#line{x1 = parse_units(B, Ofs, Len)}); y1 -> make_line_rec(T, B, Acc, L#line{y1 = parse_units(B, Ofs, Len)}); x2 -> make_line_rec(T, B, Acc, L#line{x2 = parse_units(B, Ofs, Len)}); y2 -> make_line_rec(T, B, Acc, L#line{y2 = parse_units(B, Ofs, Len)}); _ -> case is_attr(Tag) of true -> make_line_rec(T, B, [get_attr(Attr, B)|Acc], L); false -> make_line_rec(T, B, Acc, L) end end; make_line_rec([], _, Acc, L) -> L#line{acc = Acc}. (Note that the Acc is kept in a parameter during the loop.) My guess would be that with some small modifications, you could use the #line record in other functions in the same module. Maybe you'll want to put the B parameter in the record as well. /Richard From bengt.kleberg@REDACTED Fri Jul 7 16:39:38 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Fri, 07 Jul 2006 16:39:38 +0200 Subject: [Off-topic] Re: Best windows installer? In-Reply-To: <200607071250.49106.rlenglet@users.forge.objectweb.org> References: <44AC58A2.5020006@blueyonder.co.uk> <44ACE4B7.5060602@ericsson.com> <200607071250.49106.rlenglet@users.forge.objectweb.org> Message-ID: <44AE722A.5040500@ericsson.com> Romain Lenglet On 2006-07-07 05:50, Romain Lenglet wrote: > Bengt Kleberg wrote: ...deleted >> on unix i am quite comfortable with a source/compile >> installation. whereas on a mac i am only use the normal >> pre-compiled drag-and-drop installation. otherwise i forgoe >> the software. > > And how do you do upgrades? And uninstallations? on unix i get the new-version. [compile]/install it as - move the link from - to -. uninstallation is rm -rf - on mac i get the new-version. drag-and-drop it uninstallation is drag to trash. >> those that do not have the password for root are >> surely not able to use their OS/distribution's package >> manager, are they? so, does most unix user have root, or not? > > "Users" above also includes administrators. > If you don't have root access, or if your administrator has not > given you enough sudo(1) rights, then your administrator should > be willing to help you install the software that you need to do > your work. If he is not willing to help, and then you have no > way to install software correctly (i.e., using the OS's > packaging system if there is one, and respecting standards such > as the LSB and the FHS), then that system administrator should > be fired. this is the first time you mention ''software that you need to do your work''. that makes a change. in that case there is never any problem. i was not considering only such software. ...deleted > Stated otherwise, if you can't use the packaging system of your > OS to install and upgrade software (even if this would require > that you ask your administrator to do so), it is not a technical > problem, but it is a human and managerial one. Don't expect a > technical solution to solve this problem. i was kind of hoping that it would be possible to install software that i like but is not needed to do my work. eg: i can do my work with one of ed, vi, textedit and emacs, but i prefer to use wily. > And when administrators have to manage several tens or hundreds > of computers, what do you believe they prefer: (1) download > sources and compile, and install by hand all software, on every > computer, and for every installation or upgrade of every > software, or (2) use automatic tools based on existing packaging > systems (e.g., cfengine, apt, fai, etc. for GNU/Linux distros)? when i was a sysadm i used exported/mounted filesystems, instead of installing on each individual machine. there where no GNU/Linux distros. heterogenous systems meant build-your-own-solution when i was doing this. now i would need to check, before i know. has cfengine now evolved their own packaging? interesting. i only used version 1, to keep files in /etc up to date. bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From david.nospam.hopwood@REDACTED Fri Jul 7 20:24:14 2006 From: david.nospam.hopwood@REDACTED (David Hopwood) Date: Fri, 07 Jul 2006 19:24:14 +0100 Subject: Thoughts about CEAN/refactoring In-Reply-To: <200607070148.k671m35d399646@atlas.otago.ac.nz> References: <200607070148.k671m35d399646@atlas.otago.ac.nz> Message-ID: <44AEA6CE.3040104@blueyonder.co.uk> Richard A. O'Keefe wrote: > "Joe Armstrong \(AL/EAB\)" wrote: > Versions are named like this AppName-Vsn > > Vsn is of no significance it is just a "distinguished string" > > It would be really REALLY nice if Vsn terms could be compared > so that one could tell whether rabbit-ping was more recent than > rabbit-pong without having to fossick around in some possibly > remote and possibly inaccessible data base. Recency of package versions is a partial ordering, not a total ordering. -- David Hopwood From shidan@REDACTED Sat Jul 8 00:51:39 2006 From: shidan@REDACTED (Shidan) Date: Fri, 7 Jul 2006 18:51:39 -0400 Subject: Erlang Media Libraries Message-ID: <429b380e0607071551t6c2bf3d6hdd8df8e2633208d1@mail.gmail.com> Hi are there any media frameworks, media servers, RTP stacks, etc, written in Erlang? From erlangX@REDACTED Sat Jul 8 01:18:06 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Fri, 7 Jul 2006 16:18:06 -0700 Subject: R11B multiple processes starting Message-ID: <20060707231806.GL14356@delora.autosys.us> SHORT VERSION: After installing R11B-0, my application starts multiple OS processes where before it only started a single OS process. ----------- LONG VERSION: I have just installed R11B-0 on one of my servers (formerly at R10B-8). $ uname -a Linux xq02 2.4.21-99-default #1 Wed Sep 24 13:30:51 UTC 2003 i686 i686 i386 GNU/Linux An application that I start thusly: $ /bin/su mmcdanie -c "cd /home/erl ; /usr/local/bin/erl -sname \ ${HOST}_block -home /home/erl -setcookie fake -heart -detached \ -config /home/erl/sys.config -s block start" is still working fine. However, now when I start it, three OS processes are running rather than as with R10B-8 where only a single OS process would run when application started. $ ps xuaw | egrep block | egrep -v grep mmcdanie 14771 0.1 1.2 12964 6440 pts/1 S 15:59 0:00 /usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang -progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl -setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s block start mmcdanie 14774 0.0 1.2 12964 6440 pts/1 S 15:59 0:00 /usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang -progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl -setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s block start mmcdanie 14775 0.0 1.2 12964 6440 pts/1 S 15:59 0:00 /usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang -progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl -setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s block start (apologies for line wraps) I am not understanding why multiple OS processes are running now when I start the application. I have changed nothing on the machine other than installing the new R11B-0 (and the way I did that was to move the old /usr/local/lib/erlang directory before doing the install, so the new /usr/local/lib/erlang is completely fresh, not an install-over-old). As I mention above, the application is working fine. The contents of /home/erl/sys.config are: [{mnesia, [{dir, "/home/erl/Mnesia.block"} , %% {debug, trace} , {schema_location, disc}]}]. and mnesia is getting updated just fine. I compiled *without* --enable-smp-support since the native POSIX threads library is not installed (it is not an SMP machine). Does anyone have any tips on how to figure out why multiple OS processes are now starting? Or perhaps already knows the answer to the question? thanks, ~Michael From ryanobjc@REDACTED Sat Jul 8 03:36:21 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Fri, 7 Jul 2006 18:36:21 -0700 Subject: R11B multiple processes starting In-Reply-To: <20060707231806.GL14356@delora.autosys.us> References: <20060707231806.GL14356@delora.autosys.us> Message-ID: <78568af10607071836j3c9400fax9dfd55739055a3da@mail.gmail.com> All modern Linux distros have pthread libraries in /lib now if not /usr/lib that are posix threads that are native. Linux models those threads as light weight processes - thus appear as multiple entries in the process table. R11B-0 included the SMP improvements, and also I think threading improvements for lower level driver things. Blocking IO and the like I think. Someone else can give a detailed view on that, but I believe that is the high level. -ryan On 7/7/06, Michael McDaniel wrote: > SHORT VERSION: > > After installing R11B-0, my application starts multiple OS processes > where before it only started a single OS process. > ----------- > > > LONG VERSION: > > I have just installed R11B-0 on one of my servers (formerly at R10B-8). > > $ uname -a > Linux xq02 2.4.21-99-default #1 Wed Sep 24 13:30:51 UTC 2003 i686 i686 i386 GNU/Linux > > > An application that I start thusly: > > $ /bin/su mmcdanie -c "cd /home/erl ; /usr/local/bin/erl -sname \ > ${HOST}_block -home /home/erl -setcookie fake -heart -detached \ > -config /home/erl/sys.config -s block start" > > is still working fine. However, now when I start it, three OS > processes are running rather than as with R10B-8 where only a > single OS process would run when application started. > > $ ps xuaw | egrep block | egrep -v grep > mmcdanie 14771 0.1 1.2 12964 6440 pts/1 S 15:59 0:00 /usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang -progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl -setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s block start > mmcdanie 14774 0.0 1.2 12964 6440 pts/1 S 15:59 0:00 /usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang -progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl -setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s block start > mmcdanie 14775 0.0 1.2 12964 6440 pts/1 S 15:59 0:00 /usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang -progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl -setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s block start > > (apologies for line wraps) > > I am not understanding why multiple OS processes are running now when > I start the application. I have changed nothing on the machine other > than installing the new R11B-0 (and the way I did that was to move > the old /usr/local/lib/erlang directory before doing the install, so > the new /usr/local/lib/erlang is completely fresh, not an > install-over-old). > > As I mention above, the application is working fine. > > The contents of /home/erl/sys.config are: > [{mnesia, [{dir, "/home/erl/Mnesia.block"} , > %% {debug, trace} , > {schema_location, disc}]}]. > > and mnesia is getting updated just fine. > > I compiled *without* --enable-smp-support since the native POSIX threads > library is not installed (it is not an SMP machine). > > > Does anyone have any tips on how to figure out why multiple OS processes > are now starting? Or perhaps already knows the answer to the question? > > thanks, > > ~Michael > > > > From michael206@REDACTED Sun Jul 9 11:57:29 2006 From: michael206@REDACTED (Michael Leonhard) Date: Sun, 9 Jul 2006 04:57:29 -0500 Subject: lightweight Erlang with package management In-Reply-To: <44A95A7E.9030600@ericsson.com> References: <95be1d3b0607030452s6eab1600v885f495a5747a4e@mail.gmail.com> <44A95A7E.9030600@ericsson.com> Message-ID: <21f8b6e20607090257s2c2c3964g2fb2e3213a4ced3f@mail.gmail.com> I hope there would be an easy way to use erlrt as its own stand-alone installation of Erlang. I'm tired of having dependancies among unrelated software on my systems. Disk space is so cheap nowadays that it's not worth the headache to share files among applications. I request that erlrt allow standalone installation, completely ignoring any other Erlang installation. Perhaps its scripts could even fix the PATH variable before calling any Erlang programs to make sure that the proper programs are used? I'm looking forward to trying out erlrt later this summer. I'd also like to test any Windows versions. -Michael Michael Leonhard michael206@REDACTED > is it correct to say that you want to find out if the target computer > has erlang already installed? and if not, install base.tgz? > > if erlang is already installed what would be the appropriate measure? > for erlrt it could be to do install erlrt only, and inform erlrt about > the location of the erlang installation (soft link?) > > > bengt From christophe.romain@REDACTED Mon Jul 10 09:43:20 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Mon, 10 Jul 2006 09:43:20 +0200 Subject: lightweight Erlang with package management In-Reply-To: <21f8b6e20607090257s2c2c3964g2fb2e3213a4ced3f@mail.gmail.com> References: <95be1d3b0607030452s6eab1600v885f495a5747a4e@mail.gmail.com> <44A95A7E.9030600@ericsson.com> <21f8b6e20607090257s2c2c3964g2fb2e3213a4ced3f@mail.gmail.com> Message-ID: <4d42403e73f1e9e4ad00e09e7804f78e@process-one.net> > I hope there would be an easy way to use erlrt as its own stand-alone > installation of Erlang. you can do that already. let say you want yaws and mnesia+tv in two separates installations of erlang. $ sh install_erlrt.sh > erlrt:install(yaws). > q(). $ mv erlrt erlrt-yaws $ sh install_erlrt.sh > erlrt:install(tv). > q(). $ mv erlrt erlrt-mnesia you have now erlrt-yaws/start.sh and erlrt-mnesia/start.sh, both starting the correct environment. From mats.cronqvist@REDACTED Mon Jul 10 12:54:28 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 10 Jul 2006 12:54:28 +0200 Subject: compiling a module from a string In-Reply-To: References: Message-ID: <44B231E4.7070406@ericsson.com> Ulf Wiger (AL/EAB) wrote: > I want to effectively call > > Str = "-module(m).\n-export([foo/0]).\nfoo() -> foo.\n". > compile:string(Str, [binary]). this should work iff there are no #@#$&* macros. if there is, it's pretty easy to write a subset of epp and call it between scanning and parsing. mats cl(Text) -> Forms = scan_and_parse(Text,1,[]), {ok,Mod,Bin} = compile:forms(Forms), code:load_binary(Mod,"generated",Bin). scan_and_parse([],_Line,Forms) -> lists:reverse(Forms); scan_and_parse(Text,Line,Forms) -> {done,{ok,Toks,NLine},Cont} = erl_scan:tokens([],Text,Line), {ok,Form} = erl_parse:parse_form(Toks), scan_and_parse(Cont,NLine,[Form|Forms]). From ulf.wiger@REDACTED Mon Jul 10 13:27:59 2006 From: ulf.wiger@REDACTED (Ulf Wiger (AL/EAB)) Date: Mon, 10 Jul 2006 13:27:59 +0200 Subject: compiling a module from a string Message-ID: MaCro = Mats Cronqvist wrote: > > > > Str = "-module(m).\n-export([foo/0]).\nfoo() -> foo.\n". > > compile:string(Str, [binary]). > > this should work iff there are no #@#$&* macros. if there > is, it's pretty easy to write a subset of epp and call it > between scanning and parsing. Well, my ram_file_io_server works like a charm and lets me use all the wonderful macros too. (: /U From mats.cronqvist@REDACTED Mon Jul 10 13:40:12 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 10 Jul 2006 13:40:12 +0200 Subject: compiling a module from a string In-Reply-To: References: Message-ID: <44B23C9C.7090201@ericsson.com> Ulf Wiger (AL/EAB) wrote: > > MaCro = Mats Cronqvist wrote: >>> Str = "-module(m).\n-export([foo/0]).\nfoo() -> foo.\n". >>> compile:string(Str, [binary]). >> this should work iff there are no #@#$&* macros. if there >> is, it's pretty easy to write a subset of epp and call it >> between scanning and parsing. > > Well, my ram_file_io_server works like a charm and lets me > use all the wonderful macros too. (: > my post was mainly to inform the lurkers that it is not necessary to hack around in the kernel sources. of course, if i can save even one poor, unsuspecting soul from using macros i will surely get my reward in the hereafter. mats From erlangX@REDACTED Mon Jul 10 22:57:27 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Mon, 10 Jul 2006 13:57:27 -0700 Subject: [Re: R11B multiple processes starting] Message-ID: <20060710205727.GU14356@delora.autosys.us> Thank you for that explanation, Ryan. I do see $ ls /lib/*pthread* /lib/libpthread.so.0 $ ls /usr/lib/*pthread* /usr/lib/libpthread.a /usr/lib/libpthread_nonshared.a /usr/lib/libpthread.so on the original machine in which 'ps' shows multiple OS processes (it has a 2.4 kernel with Pentium 4 processor) New information is that on another machine (2.6 kernel with Celeron processor) (again, R11B-0 compiled *without* --enable-smp-support) $ uname -a Linux cougora 2.6.4-52-default #1 Wed Apr 7 02:08:30 UTC 2004 i686 i686 i386 GNU/Linux $ ls /lib/*pthread* /lib/libpthread.so.0 $ ls /usr/lib/*pthread* /usr/lib/libgcrypt-pthread.a /usr/lib/libgcrypt-pthread.so.7 /usr/lib/libpthread_nonshared.a /usr/lib/libgcrypt-pthread.la /usr/lib/libgcrypt-pthread.so.7.3.1 /usr/lib/libpthread.so /usr/lib/libgcrypt-pthread.so /usr/lib/libpthread.a and, starting the same application in the same manner, it only shows a single process. So, a new question is why might those machines be different? ~Michael On Fri, Jul 07, 2006 at 06:36:21PM -0700, Ryan Rawson wrote: > All modern Linux distros have pthread libraries in /lib now if not > /usr/lib that are posix threads that are native. Linux models those > threads as light weight processes - thus appear as multiple entries in > the process table. > > R11B-0 included the SMP improvements, and also I think threading > improvements for lower level driver things. Blocking IO and the like > I think. Someone else can give a detailed view on that, but I believe > that is the high level. > > -ryan > > On 7/7/06, Michael McDaniel wrote: > >SHORT VERSION: > > > >After installing R11B-0, my application starts multiple OS processes > >where before it only started a single OS process. > >----------- > > > > > >LONG VERSION: > > > >I have just installed R11B-0 on one of my servers (formerly at R10B-8). > > > >$ uname -a > >Linux xq02 2.4.21-99-default #1 Wed Sep 24 13:30:51 UTC 2003 i686 i686 > >i386 GNU/Linux > > > > > >An application that I start thusly: > > > >$ /bin/su mmcdanie -c "cd /home/erl ; /usr/local/bin/erl -sname \ > > ${HOST}_block -home /home/erl -setcookie fake -heart -detached \ > > -config /home/erl/sys.config -s block start" > > > >is still working fine. However, now when I start it, three OS > >processes are running rather than as with R10B-8 where only a > >single OS process would run when application started. > > > >$ ps xuaw | egrep block | egrep -v grep > >mmcdanie 14771 0.1 1.2 12964 6440 pts/1 S 15:59 0:00 > >/usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang > >-progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl > >-setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s > >block start > >mmcdanie 14774 0.0 1.2 12964 6440 pts/1 S 15:59 0:00 > >/usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang > >-progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl > >-setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s > >block start > >mmcdanie 14775 0.0 1.2 12964 6440 pts/1 S 15:59 0:00 > >/usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang > >-progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl > >-setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s > >block start > > > >(apologies for line wraps) > > > >I am not understanding why multiple OS processes are running now when > >I start the application. I have changed nothing on the machine other > >than installing the new R11B-0 (and the way I did that was to move > >the old /usr/local/lib/erlang directory before doing the install, so > >the new /usr/local/lib/erlang is completely fresh, not an > >install-over-old). > > > >As I mention above, the application is working fine. > > > >The contents of /home/erl/sys.config are: > >[{mnesia, [{dir, "/home/erl/Mnesia.block"} , > >%% {debug, trace} , > > {schema_location, disc}]}]. > > > >and mnesia is getting updated just fine. > > > >I compiled *without* --enable-smp-support since the native POSIX threads > >library is not installed (it is not an SMP machine). > > > > > >Does anyone have any tips on how to figure out why multiple OS processes > >are now starting? Or perhaps already knows the answer to the question? > > > >thanks, > > > >~Michael > > > > > > > > -- Michael McDaniel Portland, Oregon, USA http://autosys.us +1 503 283 5284 From jonslenk@REDACTED Fri Jul 7 00:54:07 2006 From: jonslenk@REDACTED (Jon Slenk) Date: Thu, 6 Jul 2006 15:54:07 -0700 Subject: "raw" or "verbatim" PIDs? Message-ID: <065f01c6a14f$16a099b0$9b2042ab@snickerdoodle> Ah, I finally figured out that I can use list_to_pid(), although there are dire warnings in the documentation that it and pid_to_list() should not be used in application code. (Is there a "constructor" for PIDs, or does one have to use list_to_pid()?) sincerely, -Jon. ----- Original Message ----- From: "Jon Slenk" To: Sent: Thursday, July 06, 2006 1:40 PM Subject: "raw" or "verbatim" PIDs? > (I've been Googling and looking through the archives, but haven't hit an > explanation/answer so far.) > > I'm very new to Erlang, I'm just working my way through a tutorial. I > spawned a process and was told that it has PID <0.47.0>, but I failed to > assign that to a variable. Now, is there any way I can send a message to > that PID by using the "raw" ID? I tried writing stuff like "<0.47.0> ! > foobar." or "0.47.0 ! foobar." in an attempt to mimic the code I've seen > where people write something like "ThePid = spawn(...). ThePid ! foobar." > However, the Erlang shell did not like my attempts :-) Is there a way to > use "raw" PIDs, or must it be stored in a variable? > > many thanks, > -Jon. > From jonslenk@REDACTED Fri Jul 7 01:06:39 2006 From: jonslenk@REDACTED (Jon Slenk) Date: Thu, 6 Jul 2006 16:06:39 -0700 Subject: "raw" or "verbatim" PIDs? Message-ID: <067d01c6a150$d68f50d0$9b2042ab@snickerdoodle> Thanks to Didier for pointing out the i-should-have-guessed-it obvious: "Try pid(0,47,0). It converts 3 integers to a Pid." sincerely, -Jon. ----- Original Message ----- From: "Jon Slenk" To: Sent: Thursday, July 06, 2006 3:54 PM Subject: Re: "raw" or "verbatim" PIDs? > Ah, I finally figured out that I can use list_to_pid(), although there are > dire warnings in the documentation that it and pid_to_list() should not be > used in application code. (Is there a "constructor" for PIDs, or does one > have to use list_to_pid()?) > > sincerely, > -Jon. From erlang@REDACTED Fri Jul 7 01:31:33 2006 From: erlang@REDACTED (Michael McDaniel) Date: Thu, 6 Jul 2006 16:31:33 -0700 Subject: "raw" or "verbatim" PIDs? In-Reply-To: <055501c6a13c$75cf2fe0$9b2042ab@snickerdoodle> References: <055501c6a13c$75cf2fe0$9b2042ab@snickerdoodle> Message-ID: <20060706233133.GF14356@delora.autosys.us> On Thu, Jul 06, 2006 at 01:40:45PM -0700, Jon Slenk wrote: > (I've been Googling and looking through the archives, but haven't hit an > explanation/answer so far.) > > I'm very new to Erlang, I'm just working my way through a tutorial. I ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Congratulations, and Welcome! ~~M > spawned a process and was told that it has PID <0.47.0>, but I failed to > assign that to a variable. Now, is there any way I can send a message to > that PID by using the "raw" ID? I tried writing stuff like "<0.47.0> ! > foobar." or "0.47.0 ! foobar." in an attempt to mimic the code I've seen > where people write something like "ThePid = spawn(...). ThePid ! foobar." > However, the Erlang shell did not like my attempts :-) Is there a way to > use "raw" PIDs, or must it be stored in a variable? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ try, for example, ... list_to_pid("<0.47.0>") ! foobar ~~Michael > > many thanks, > -Jon. From jonslenk@REDACTED Fri Jul 7 21:16:45 2006 From: jonslenk@REDACTED (Jon Slenk) Date: Fri, 7 Jul 2006 12:16:45 -0700 Subject: "raw" or "verbatim" PIDs? Message-ID: <00fd01c6a1f9$e3d93770$c02142ab@snickerdoodle> Many thanks to all for the education! sincerely, -Jon. From jonslenk@REDACTED Sat Jul 8 00:44:35 2006 From: jonslenk@REDACTED (Jon Slenk) Date: Fri, 7 Jul 2006 15:44:35 -0700 Subject: (newbie still) error messages Message-ID: <022201c6a216$ec2b9fe0$c02142ab@snickerdoodle> hi, What habits or tools are used to understand or expand upon Erlang error messages? For example, I am getting a badarg error but it does not tell me exactly which argument is bad. The last thing on the stack is {test,ping,2} which means test:ping/2 rather than "test:ping, argument 2 was bad" (because according to the docs the format is {Module, Name, Arity}). It seems to me that if I were to have to debug a problem in a larger system it would be nice to know exactly where and what arg is bad, but I don't see how to get such information. Just so you know, I am getting the error on purpose while experimenting / learning, since test:ping/2 takes (Count, Pong_pid) and I am calling it as test:ping( 0, [] ). thanks for any edification. sincerely, -Jon. From jonslenk@REDACTED Sat Jul 8 00:53:05 2006 From: jonslenk@REDACTED (Jon Slenk) Date: Fri, 7 Jul 2006 15:53:05 -0700 Subject: (newbie still) compile-time checks? Message-ID: <022c01c6a218$1bb74bf0$c02142ab@snickerdoodle> hello, I'm experimenting with the ping/pong code from the "Getting Started with Erlang" tutorial and am wondering what happens if I were to mis-spell an atom that is used in message passing. Are there ways to have something like an enumerated type of atoms, so that if I use something outside of the enumeration the compiler will tell me I made an error? Can Dialyzer or some such tool figure out these kinds of possible typographical human errors, or is the answer "extensive unit testing"? :-) many thanks, -Jon. From erlang@REDACTED Sat Jul 8 08:55:08 2006 From: erlang@REDACTED (Michael McDaniel) Date: Fri, 7 Jul 2006 23:55:08 -0700 Subject: R11B multiple processes starting In-Reply-To: <78568af10607071836j3c9400fax9dfd55739055a3da@mail.gmail.com> References: <20060707231806.GL14356@delora.autosys.us> <78568af10607071836j3c9400fax9dfd55739055a3da@mail.gmail.com> Message-ID: <20060708065508.GN14356@delora.autosys.us> Thank you for that explanation. I do see $ ls /lib/*pthread* /lib/libpthread.so.0 $ ls /usr/lib/*pthread* /usr/lib/libpthread.a /usr/lib/libpthread_nonshared.a /usr/lib/libpthread.so on the original machine in which 'ps' shows multiple OS processes (it has a 2.4 kernel with Pentium 4 processor) New information is that on another machine (2.6 kernel with Celeron processor) (again, R11B-0 compiled *without* --enable-smp-support) $ uname -a Linux cougora 2.6.4-52-default #1 Wed Apr 7 02:08:30 UTC 2004 i686 i686 i386 GNU/Linux $ ls /lib/*pthread* /lib/libpthread.so.0 $ ls /usr/lib/*pthread* /usr/lib/libgcrypt-pthread.a /usr/lib/libgcrypt-pthread.so.7 /usr/lib/libpthread_nonshared.a /usr/lib/libgcrypt-pthread.la /usr/lib/libgcrypt-pthread.so.7.3.1 /usr/lib/libpthread.so /usr/lib/libgcrypt-pthread.so /usr/lib/libpthread.a and, starting the same application in the same manner, it only shows a single process. So, a new question is why might those machines be different? ~~Michael On Fri, Jul 07, 2006 at 06:36:21PM -0700, Ryan Rawson wrote: > All modern Linux distros have pthread libraries in /lib now if not > /usr/lib that are posix threads that are native. Linux models those > threads as light weight processes - thus appear as multiple entries in > the process table. > > R11B-0 included the SMP improvements, and also I think threading > improvements for lower level driver things. Blocking IO and the like > I think. Someone else can give a detailed view on that, but I believe > that is the high level. > > -ryan > > On 7/7/06, Michael McDaniel wrote: > >SHORT VERSION: > > > >After installing R11B-0, my application starts multiple OS processes > >where before it only started a single OS process. > >----------- > > > > > >LONG VERSION: > > > >I have just installed R11B-0 on one of my servers (formerly at R10B-8). > > > >$ uname -a > >Linux xq02 2.4.21-99-default #1 Wed Sep 24 13:30:51 UTC 2003 i686 i686 > >i386 GNU/Linux > > > > > >An application that I start thusly: > > > >$ /bin/su mmcdanie -c "cd /home/erl ; /usr/local/bin/erl -sname \ > > ${HOST}_block -home /home/erl -setcookie fake -heart -detached \ > > -config /home/erl/sys.config -s block start" > > > >is still working fine. However, now when I start it, three OS > >processes are running rather than as with R10B-8 where only a > >single OS process would run when application started. > > > >$ ps xuaw | egrep block | egrep -v grep > >mmcdanie 14771 0.1 1.2 12964 6440 pts/1 S 15:59 0:00 > >/usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang > >-progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl > >-setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s > >block start > >mmcdanie 14774 0.0 1.2 12964 6440 pts/1 S 15:59 0:00 > >/usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang > >-progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl > >-setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s > >block start > >mmcdanie 14775 0.0 1.2 12964 6440 pts/1 S 15:59 0:00 > >/usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang > >-progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl > >-setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s > >block start > > > >(apologies for line wraps) > > > >I am not understanding why multiple OS processes are running now when > >I start the application. I have changed nothing on the machine other > >than installing the new R11B-0 (and the way I did that was to move > >the old /usr/local/lib/erlang directory before doing the install, so > >the new /usr/local/lib/erlang is completely fresh, not an > >install-over-old). > > > >As I mention above, the application is working fine. > > > >The contents of /home/erl/sys.config are: > >[{mnesia, [{dir, "/home/erl/Mnesia.block"} , > >%% {debug, trace} , > > {schema_location, disc}]}]. > > > >and mnesia is getting updated just fine. > > > >I compiled *without* --enable-smp-support since the native POSIX threads > >library is not installed (it is not an SMP machine). > > > > > >Does anyone have any tips on how to figure out why multiple OS processes > >are now starting? Or perhaps already knows the answer to the question? > > > >thanks, > > > >~Michael > > > > > > > > -- Michael McDaniel Portland, Oregon, USA http://autosys.us +1 503 283 5284 From ryanobjc@REDACTED Tue Jul 11 00:54:49 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Mon, 10 Jul 2006 15:54:49 -0700 Subject: R11B multiple processes starting In-Reply-To: <20060708065508.GN14356@delora.autosys.us> References: <20060707231806.GL14356@delora.autosys.us> <78568af10607071836j3c9400fax9dfd55739055a3da@mail.gmail.com> <20060708065508.GN14356@delora.autosys.us> Message-ID: <78568af10607101554i1837859xf183a38ae17cf2b3@mail.gmail.com> The way the OS handles threads changed from 2.4 to kernel 2.6. No longer in 2.6 do you see multiple entries in the process table for threads. It's now 'hidden' in one big process id, and there are thread ids. -ryan On 7/7/06, Michael McDaniel wrote: > Thank you for that explanation. I do see > > $ ls /lib/*pthread* > /lib/libpthread.so.0 > > $ ls /usr/lib/*pthread* > /usr/lib/libpthread.a /usr/lib/libpthread_nonshared.a /usr/lib/libpthread.so > > on the original machine in which 'ps' shows multiple OS processes > (it has a 2.4 kernel with Pentium 4 processor) > > > New information is that on another machine (2.6 kernel with Celeron processor) > (again, R11B-0 compiled *without* --enable-smp-support) > > $ uname -a > Linux cougora 2.6.4-52-default #1 Wed Apr 7 02:08:30 UTC 2004 i686 i686 i386 GNU/Linux > > $ ls /lib/*pthread* > /lib/libpthread.so.0 > > $ ls /usr/lib/*pthread* > /usr/lib/libgcrypt-pthread.a /usr/lib/libgcrypt-pthread.so.7 /usr/lib/libpthread_nonshared.a > /usr/lib/libgcrypt-pthread.la /usr/lib/libgcrypt-pthread.so.7.3.1 /usr/lib/libpthread.so > /usr/lib/libgcrypt-pthread.so /usr/lib/libpthread.a > > and, starting the same application in the same manner, it only shows > a single process. > > So, a new question is why might those machines be different? > > > > ~~Michael > > > On Fri, Jul 07, 2006 at 06:36:21PM -0700, Ryan Rawson wrote: > > All modern Linux distros have pthread libraries in /lib now if not > > /usr/lib that are posix threads that are native. Linux models those > > threads as light weight processes - thus appear as multiple entries in > > the process table. > > > > R11B-0 included the SMP improvements, and also I think threading > > improvements for lower level driver things. Blocking IO and the like > > I think. Someone else can give a detailed view on that, but I believe > > that is the high level. > > > > -ryan > > > > On 7/7/06, Michael McDaniel wrote: > > >SHORT VERSION: > > > > > >After installing R11B-0, my application starts multiple OS processes > > >where before it only started a single OS process. > > >----------- > > > > > > > > >LONG VERSION: > > > > > >I have just installed R11B-0 on one of my servers (formerly at R10B-8). > > > > > >$ uname -a > > >Linux xq02 2.4.21-99-default #1 Wed Sep 24 13:30:51 UTC 2003 i686 i686 > > >i386 GNU/Linux > > > > > > > > >An application that I start thusly: > > > > > >$ /bin/su mmcdanie -c "cd /home/erl ; /usr/local/bin/erl -sname \ > > > ${HOST}_block -home /home/erl -setcookie fake -heart -detached \ > > > -config /home/erl/sys.config -s block start" > > > > > >is still working fine. However, now when I start it, three OS > > >processes are running rather than as with R10B-8 where only a > > >single OS process would run when application started. > > > > > >$ ps xuaw | egrep block | egrep -v grep > > >mmcdanie 14771 0.1 1.2 12964 6440 pts/1 S 15:59 0:00 > > >/usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang > > >-progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl > > >-setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s > > >block start > > >mmcdanie 14774 0.0 1.2 12964 6440 pts/1 S 15:59 0:00 > > >/usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang > > >-progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl > > >-setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s > > >block start > > >mmcdanie 14775 0.0 1.2 12964 6440 pts/1 S 15:59 0:00 > > >/usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang > > >-progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl > > >-setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s > > >block start > > > > > >(apologies for line wraps) > > > > > >I am not understanding why multiple OS processes are running now when > > >I start the application. I have changed nothing on the machine other > > >than installing the new R11B-0 (and the way I did that was to move > > >the old /usr/local/lib/erlang directory before doing the install, so > > >the new /usr/local/lib/erlang is completely fresh, not an > > >install-over-old). > > > > > >As I mention above, the application is working fine. > > > > > >The contents of /home/erl/sys.config are: > > >[{mnesia, [{dir, "/home/erl/Mnesia.block"} , > > >%% {debug, trace} , > > > {schema_location, disc}]}]. > > > > > >and mnesia is getting updated just fine. > > > > > >I compiled *without* --enable-smp-support since the native POSIX threads > > >library is not installed (it is not an SMP machine). > > > > > > > > >Does anyone have any tips on how to figure out why multiple OS processes > > >are now starting? Or perhaps already knows the answer to the question? > > > > > >thanks, > > > > > >~Michael > > > > > > > > > > > > > > -- > Michael McDaniel > Portland, Oregon, USA > http://autosys.us > +1 503 283 5284 > From nils.muellner@REDACTED Tue Jul 11 05:32:47 2006 From: nils.muellner@REDACTED (=?ISO-8859-15?Q?Nils_M=FCllner?=) Date: Tue, 11 Jul 2006 05:32:47 +0200 Subject: erlang.se down? Message-ID: <44B31BDF.7060400@heh.uni-oldenburg.de> its up... my admin just fumbled with the proxy... nils From nils.muellner@REDACTED Tue Jul 11 05:13:29 2006 From: nils.muellner@REDACTED (=?ISO-8859-15?Q?Nils_M=FCllner?=) Date: Tue, 11 Jul 2006 05:13:29 +0200 Subject: erlang.se down? Message-ID: <44B31759.9090303@heh.uni-oldenburg.de> hi, erlang.se seems to be down. has someone the paper from last years convention regarding the mmporpg-server developed in germany? kind regards... nils From chsu79@REDACTED Tue Jul 11 09:17:11 2006 From: chsu79@REDACTED (Christian S) Date: Tue, 11 Jul 2006 09:17:11 +0200 Subject: (newbie still) compile-time checks? In-Reply-To: <022c01c6a218$1bb74bf0$c02142ab@snickerdoodle> References: <022c01c6a218$1bb74bf0$c02142ab@snickerdoodle> Message-ID: You can have 'catch all' receive patterns and error out if they catch something. At least if you dont depend on selective receives. On 7/8/06, Jon Slenk wrote: > hello, > > I'm experimenting with the ping/pong code from the "Getting Started with > Erlang" tutorial and am wondering what happens if I were to mis-spell an > atom that is used in message passing. Are there ways to have something like > an enumerated type of atoms, so that if I use something outside of the > enumeration the compiler will tell me I made an error? Can Dialyzer or some > such tool figure out these kinds of possible typographical human errors, or > is the answer "extensive unit testing"? :-) > > many thanks, > -Jon. > From thomasl_erlang@REDACTED Tue Jul 11 09:37:51 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 11 Jul 2006 00:37:51 -0700 (PDT) Subject: "raw" or "verbatim" PIDs? In-Reply-To: <065f01c6a14f$16a099b0$9b2042ab@snickerdoodle> Message-ID: <20060711073751.90837.qmail@web38803.mail.mud.yahoo.com> --- Jon Slenk wrote: > Ah, I finally figured out that I can use > list_to_pid(), although there are > dire warnings in the documentation that it and > pid_to_list() should not be > used in application code. (Is there a "constructor" > for PIDs, or does one > have to use list_to_pid()?) PIDs are normally considered opaque handles (if you will) to processes, and ordinary usage is to construct PIDs with spawn/spawn_link/self, then pass them around. As far as I know, the list_to_pid/1 and pid/3 functions are basically intended for debugging. There are more such convenience functions (e.g., processes/0) but using them in applications can lead to a system which is quite difficult to understand -- hence the warnings. Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From mats.cronqvist@REDACTED Tue Jul 11 09:49:22 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Tue, 11 Jul 2006 09:49:22 +0200 Subject: (newbie still) compile-time checks? In-Reply-To: <022c01c6a218$1bb74bf0$c02142ab@snickerdoodle> References: <022c01c6a218$1bb74bf0$c02142ab@snickerdoodle> Message-ID: <44B35802.4000003@ericsson.com> Jon Slenk wrote: > hello, > > I'm experimenting with the ping/pong code from the "Getting Started with > Erlang" tutorial and am wondering what happens if I were to mis-spell an > atom that is used in message passing. Are there ways to have something > like an enumerated type of atoms, so that if I use something outside of > the enumeration the compiler will tell me I made an error? Can Dialyzer > or some such tool figure out these kinds of possible typographical human > errors, or is the answer "extensive unit testing"? :-) i believe dialyzer will (at least often) find such typos in function calls. for message passing you'll probably have to resort to macros... a mistyped macro is caught be the compiler. of course, macros suck in a million different ways, so it's probably better to stick with unit testing. mats crappymacro.hrl -define(ONE,1). -define(TWO,2). bar.erl -include("crappymacro.hrl"). foo ! ?ONE. foo.erl -include("crappymacro.hrl"). receive ?ONE -> one; ?TWO -> two From mats.cronqvist@REDACTED Tue Jul 11 10:06:40 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Tue, 11 Jul 2006 10:06:40 +0200 Subject: (newbie still) error messages In-Reply-To: <022201c6a216$ec2b9fe0$c02142ab@snickerdoodle> References: <022201c6a216$ec2b9fe0$c02142ab@snickerdoodle> Message-ID: <44B35C10.5030808@ericsson.com> Jon Slenk wrote: > hi, > > What habits or tools are used to understand or expand upon Erlang error > messages? For example, I am getting a badarg error but it does not tell > me exactly which argument is bad. The last thing on the stack is > {test,ping,2} which means test:ping/2 rather than "test:ping, argument 2 > was bad" the error message means "somewhere in test:ping/2 there was something that failed because of a bad argument". > It seems to me that if I were to have to debug a problem in a > larger system it would be nice to know exactly where and what arg is > bad, but I don't see how to get such information. you don't see it because it's not there(*) :>. debugging large systems is possible because (typically) any one function has at most one thing that can toss a badarg (that's one reason to keep the functions small). of course, this only helps you once you've learnt where badargs might come from. e.g. "!" will exit with badarg if the first arg is not a pid or a registered name. > Just so you know, I am getting the error on purpose while experimenting > / learning, since test:ping/2 takes (Count, Pong_pid) and I am calling > it as test:ping( 0, [] ). so there's probably a Pong_pid ! Data in test:ping/2 mats * rumour has it that smart_exceptions in jungerl.sourceforge.net provides this functionality. i've never tried it though From Yani.Dzhurov@REDACTED Tue Jul 11 10:18:19 2006 From: Yani.Dzhurov@REDACTED (Yani Dzhurov) Date: Tue, 11 Jul 2006 11:18:19 +0300 Subject: working with binaries Message-ID: <006201c6a4c2$912a7f90$1500a8c0@dobrosoft.local> Hi all, Are there any more possible operations, except size, with binarites(<<.>>). I need such as appending binaries and getting sub-binaries. I know I can get them by first converting to lists , operating with lists and then convert to binaries again, but is there a way to do it straight with binaries? Thanx, Jani -------------- 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: 3326 bytes Desc: not available URL: From chsu79@REDACTED Tue Jul 11 10:58:51 2006 From: chsu79@REDACTED (Christian S) Date: Tue, 11 Jul 2006 10:58:51 +0200 Subject: working with binaries In-Reply-To: <006201c6a4c2$912a7f90$1500a8c0@dobrosoft.local> References: <006201c6a4c2$912a7f90$1500a8c0@dobrosoft.local> Message-ID: list_to_binary([A,B]) for concatenation. As for sub binaries, I tend to use pattern matching. 1> A = <<"ABCDEFGHIJKLM">>. <<65,66,67,68,69,70,71,72,73,74,75,76,77>> 2> <<_:5/binary,Sub:3/binary,_/binary>> = A. <<65,66,67,68,69,70,71,72,73,74,75,76,77>> 3> Sub. <<70,71,72>> It would be interesting to hear comments on the pattern matching approach. I tend to use the method to index individual bytes from binaries too. Is it terribly inefficient or as low constant factor O(1) as one can get? On 7/11/06, Yani Dzhurov wrote: > > > > > Hi all, > > > > Are there any more possible operations, except size, with binarites(<>). > I need such as appending binaries and getting sub-binaries. > > I know I can get them by first converting to lists , operating with lists > and then convert to binaries again, but is there a way to do it straight > with binaries? > > > > Thanx, > > > > Jani > From joe.armstrong@REDACTED Tue Jul 11 11:20:34 2006 From: joe.armstrong@REDACTED (Joe Armstrong (AL/EAB)) Date: Tue, 11 Jul 2006 11:20:34 +0200 Subject: "raw" or "verbatim" PIDs? Message-ID: The problem with pid_to_pid/3 and pid/3 is that they are not guaranteed to work forever. Suppose you find out that the pid of your program is <0.97.0> and that you say Pid = pid(0,97,0), if the program has not died between the point in time when you found out that is was <0.97.0> and the time when you evaluate pid(0,97,0) then Pid will get the correct value. If the process is dead or non-existent, you'll still get a valid Pid So if I do pid(0,123,22) ! abc This will work - it just sends a message to a non-existing process. Now if the pid created by evaluating pid(X,Y,Z) responds to your messages there is no guarantee that this is the process you thought it was. This can happen if - there is a very long time between finding the value of the three integers representing the pid and creating a new Pid - the original process died between the two operations above - the Pid got "recycled" (ie is reused, for a new process, this can happen after a long time) This is very unlikely but can happen. As the manual says - "It should not be used in application programs" /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of > Thomas Lindgren > Sent: den 11 juli 2006 09:38 > To: erlang-questions@REDACTED > Subject: Re: "raw" or "verbatim" PIDs? > > > > --- Jon Slenk wrote: > > > Ah, I finally figured out that I can use list_to_pid(), > although there > > are dire warnings in the documentation that it and > > pid_to_list() should not be > > used in application code. (Is there a "constructor" > > for PIDs, or does one > > have to use list_to_pid()?) > > PIDs are normally considered opaque handles (if you > will) to processes, and ordinary usage is to construct PIDs > with spawn/spawn_link/self, then pass them around. > > As far as I know, the list_to_pid/1 and pid/3 functions are > basically intended for debugging. There are more such > convenience functions (e.g., > processes/0) but using them in applications can lead to a > system which is quite difficult to understand -- hence the warnings. > > Best, > Thomas > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection > around http://mail.yahoo.com > From vances@REDACTED Tue Jul 11 11:22:09 2006 From: vances@REDACTED (Vance Shipley) Date: Tue, 11 Jul 2006 05:22:09 -0400 Subject: working with binaries In-Reply-To: References: <006201c6a4c2$912a7f90$1500a8c0@dobrosoft.local> Message-ID: <20060711092209.GE81314@frogman.motivity.ca> On Tue, Jul 11, 2006 at 10:58:51AM +0200, Christian S wrote: } list_to_binary([A,B]) for concatenation. 1> A = <<1,2,3>>. <<1,2,3>> 2> B = <<4,5,6>>. <<4,5,6>> 3> <>. <<1,2,3,4,5,6>> -Vance From per.gustafsson@REDACTED Tue Jul 11 15:23:01 2006 From: per.gustafsson@REDACTED (Per Gustafsson) Date: Tue, 11 Jul 2006 15:23:01 +0200 Subject: working with binaries In-Reply-To: References: <006201c6a4c2$912a7f90$1500a8c0@dobrosoft.local> Message-ID: <44B3A635.2000806@it.uu.se> Christian S wrote: > list_to_binary([A,B]) for concatenation. > > As for sub binaries, I tend to use pattern matching. > > 1> A = <<"ABCDEFGHIJKLM">>. > <<65,66,67,68,69,70,71,72,73,74,75,76,77>> > 2> <<_:5/binary,Sub:3/binary,_/binary>> = A. > <<65,66,67,68,69,70,71,72,73,74,75,76,77>> > 3> Sub. > <<70,71,72>> > > It would be interesting to hear comments on the pattern matching > approach. I tend to use the method to index individual bytes from > binaries too. Is it terribly inefficient or as low constant factor > O(1) as one can get? > Indexing an individual byte in a binary using pattern matching is reasonably efficient. It is O(1) and pretty close to using a bif to index the binary, in fact if you extract several values in one pattern matching statement it is often faster than using a bif to extract the values. Per From erlangX@REDACTED Tue Jul 11 15:54:52 2006 From: erlangX@REDACTED (Michael McDaniel) Date: Tue, 11 Jul 2006 06:54:52 -0700 Subject: R11B multiple processes starting In-Reply-To: <78568af10607101554i1837859xf183a38ae17cf2b3@mail.gmail.com> References: <20060707231806.GL14356@delora.autosys.us> <78568af10607071836j3c9400fax9dfd55739055a3da@mail.gmail.com> <20060708065508.GN14356@delora.autosys.us> <78568af10607101554i1837859xf183a38ae17cf2b3@mail.gmail.com> Message-ID: <20060711135434.GA5780@delora.autosys.us> 'Mystery' resolved, and thank you again! ~M On Mon, Jul 10, 2006 at 03:54:49PM -0700, Ryan Rawson wrote: > The way the OS handles threads changed from 2.4 to kernel 2.6. No > longer in 2.6 do you see multiple entries in the process table for > threads. It's now 'hidden' in one big process id, and there are > thread ids. > > -ryan > > On 7/7/06, Michael McDaniel wrote: > >Thank you for that explanation. I do see > > > >$ ls /lib/*pthread* > >/lib/libpthread.so.0 > > > >$ ls /usr/lib/*pthread* > >/usr/lib/libpthread.a /usr/lib/libpthread_nonshared.a > >/usr/lib/libpthread.so > > > >on the original machine in which 'ps' shows multiple OS processes > >(it has a 2.4 kernel with Pentium 4 processor) > > > > > >New information is that on another machine (2.6 kernel with Celeron > >processor) > >(again, R11B-0 compiled *without* --enable-smp-support) > > > >$ uname -a > >Linux cougora 2.6.4-52-default #1 Wed Apr 7 02:08:30 UTC 2004 i686 i686 > >i386 GNU/Linux > > > >$ ls /lib/*pthread* > >/lib/libpthread.so.0 > > > >$ ls /usr/lib/*pthread* > >/usr/lib/libgcrypt-pthread.a /usr/lib/libgcrypt-pthread.so.7 > >/usr/lib/libpthread_nonshared.a > >/usr/lib/libgcrypt-pthread.la /usr/lib/libgcrypt-pthread.so.7.3.1 > >/usr/lib/libpthread.so > >/usr/lib/libgcrypt-pthread.so /usr/lib/libpthread.a > > > >and, starting the same application in the same manner, it only shows > >a single process. > > > >So, a new question is why might those machines be different? > > > > > > > >~~Michael > > > > > >On Fri, Jul 07, 2006 at 06:36:21PM -0700, Ryan Rawson wrote: > >> All modern Linux distros have pthread libraries in /lib now if not > >> /usr/lib that are posix threads that are native. Linux models those > >> threads as light weight processes - thus appear as multiple entries in > >> the process table. > >> > >> R11B-0 included the SMP improvements, and also I think threading > >> improvements for lower level driver things. Blocking IO and the like > >> I think. Someone else can give a detailed view on that, but I believe > >> that is the high level. > >> > >> -ryan > >> > >> On 7/7/06, Michael McDaniel wrote: > >> >SHORT VERSION: > >> > > >> >After installing R11B-0, my application starts multiple OS processes > >> >where before it only started a single OS process. > >> >----------- > >> > > >> > > >> >LONG VERSION: > >> > > >> >I have just installed R11B-0 on one of my servers (formerly at R10B-8). > >> > > >> >$ uname -a > >> >Linux xq02 2.4.21-99-default #1 Wed Sep 24 13:30:51 UTC 2003 i686 i686 > >> >i386 GNU/Linux > >> > > >> > > >> >An application that I start thusly: > >> > > >> >$ /bin/su mmcdanie -c "cd /home/erl ; /usr/local/bin/erl -sname \ > >> > ${HOST}_block -home /home/erl -setcookie fake -heart -detached \ > >> > -config /home/erl/sys.config -s block start" > >> > > >> >is still working fine. However, now when I start it, three OS > >> >processes are running rather than as with R10B-8 where only a > >> >single OS process would run when application started. > >> > > >> >$ ps xuaw | egrep block | egrep -v grep > >> >mmcdanie 14771 0.1 1.2 12964 6440 pts/1 S 15:59 0:00 > >> >/usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang > >> >-progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl > >> >-setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s > >> >block start > >> >mmcdanie 14774 0.0 1.2 12964 6440 pts/1 S 15:59 0:00 > >> >/usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang > >> >-progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl > >> >-setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s > >> >block start > >> >mmcdanie 14775 0.0 1.2 12964 6440 pts/1 S 15:59 0:00 > >> >/usr/local/lib/erlang/erts-5.5/bin/beam -- -root /usr/local/lib/erlang > >> >-progname erl -- -home /home/mmcdanie -sname xq02_block -home /home/erl > >> >-setcookie fake -heart -noshell -noinput -config /home/erl/sys.config -s > >> >block start > >> > > >> >(apologies for line wraps) > >> > > >> >I am not understanding why multiple OS processes are running now when > >> >I start the application. I have changed nothing on the machine other > >> >than installing the new R11B-0 (and the way I did that was to move > >> >the old /usr/local/lib/erlang directory before doing the install, so > >> >the new /usr/local/lib/erlang is completely fresh, not an > >> >install-over-old). > >> > > >> >As I mention above, the application is working fine. > >> > > >> >The contents of /home/erl/sys.config are: > >> >[{mnesia, [{dir, "/home/erl/Mnesia.block"} , > >> >%% {debug, trace} , > >> > {schema_location, disc}]}]. > >> > > >> >and mnesia is getting updated just fine. > >> > > >> >I compiled *without* --enable-smp-support since the native POSIX threads > >> >library is not installed (it is not an SMP machine). > >> > > >> > > >> >Does anyone have any tips on how to figure out why multiple OS processes > >> >are now starting? Or perhaps already knows the answer to the question? > >> > > >> >thanks, > >> > > >> >~Michael > >> > > >> > > >> > > >> > > > > >-- > >Michael McDaniel > >Portland, Oregon, USA > >http://autosys.us > >+1 503 283 5284 > > -- Michael McDaniel Portland, Oregon, USA http://autosys.us +1 503 283 5284 From yarivvv@REDACTED Tue Jul 11 23:52:09 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 11 Jul 2006 17:52:09 -0400 Subject: blogging about Erlang Message-ID: <17244f480607111452g50512e5rab27cd042b745a95@mail.gmail.com> Hi list, I've been blogging about Erlang, etc in my blog at http://yarivblog.wordpress.com. I just wrote a posting comparing Erlang + Yaws to Ruby on Rails and submitted it to digg.com. If enough people digg it, it'll rise on the front page. Sometimes the crowds have wisdom, but sometimes wisdom just has to be fed to the crowds :) Cheers, Yariv From yarivvv@REDACTED Wed Jul 12 00:10:03 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Tue, 11 Jul 2006 18:10:03 -0400 Subject: is there an Erlang graphing library? Message-ID: <17244f480607111510x5991daa6q8a28223336f339d5@mail.gmail.com> Hi, I'm looking for a graphing library for Erlang (similar to http://nubyonrails.com/pages/gruff). I couldn't find one on Google or in Jungerl. Does such a library exist? Thanks Yariv From rsaccon@REDACTED Wed Jul 12 05:33:55 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Wed, 12 Jul 2006 00:33:55 -0300 Subject: is there an Erlang graphing library? In-Reply-To: <17244f480607111510x5991daa6q8a28223336f339d5@mail.gmail.com> References: <17244f480607111510x5991daa6q8a28223336f339d5@mail.gmail.com> Message-ID: I didn't find one (but that means nothing), and I worked around by just generating the paramters for calling ImageMagick as OS command. (I did that also in RubyOnRails for eliminating the memleaks of the RMagick Wrapper). On 7/11/06, Yariv Sadan wrote: > Hi, > > I'm looking for a graphing library for Erlang (similar to > http://nubyonrails.com/pages/gruff). I couldn't find one on Google or > in Jungerl. Does such a library exist? > > Thanks > Yariv > -- Roberto Saccon From shidan@REDACTED Wed Jul 12 07:51:31 2006 From: shidan@REDACTED (Shidan) Date: Wed, 12 Jul 2006 01:51:31 -0400 Subject: RTP Library for Erlang Message-ID: <429b380e0607112251p28e415a6rcdad35abc94d2475@mail.gmail.com> Hi, is there an RTP stack written in Erlang and any media frameworks comparable even remotely to Java's JMF? ---- Shidan From rsaccon@REDACTED Wed Jul 12 08:54:42 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Wed, 12 Jul 2006 03:54:42 -0300 Subject: trouble with jinterface Message-ID: For a web application I am trying to connect via Jininterface-RPC a Java-Videoserver (http://osflash.org/red5) to yaws for authentication purposes. It works fine, with expected result just for the first RPC call, all subsequent calls fail ("cannot connect to peer node"). If I restart either the Javer server or yaws, it again just works for the first RPC call. I am using latest Erlang distribution compiled form source on Ubuntu Linux and Java 1.5. Here is how my RPC Java code looks like: ------------------- begin java snippet -------------- OtpSelf self; try { self = new OtpSelf("red5"); OtpPeer other = new OtpPeer("mytest@REDACTED"); OtpConnection connection = self.connect(other); String testSess = "mytest@REDACTED"; OtpErlangList sessList = new OtpErlangList(new OtpErlangString(testSess)); connection.sendRPC("my_auth","check_sess", sessList); OtpErlangObject received = connection.receiveRPC(); log.info("received: " + received.toString()); return true; } catch (Exception e) { e.printStackTrace(); return false; } ------------------- end java snippet -------------- I start yaws with the following nodename paramter: --sname mytest The Java exception I get, with the non-first calls, is the following (just the erlang-part): java.io.IOException: Cannot connect to peer node at com.ericsson.otp.erlang.AbstractConnection.doConnect(AbstractConnection.java:925) at com.ericsson.otp.erlang.AbstractConnection.(AbstractConnection.java:187) at com.ericsson.otp.erlang.OtpConnection.(OtpConnection.java:80) at com.ericsson.otp.erlang.OtpSelf.connect(OtpSelf.java:207) I also tried with connection cookie as second Parameter when creating the OptSelf object, but the behaviour is the same, if the cookie has the right value. If the cookie has the wrong value, the connection is denied by yaws at the first and all subsequent calls and no exceptions are thrown at java-side. Has anybody an idea, whether there is something missing or wrong with my approach ? regards -- Roberto Saccon From xlcr@REDACTED Wed Jul 12 09:11:55 2006 From: xlcr@REDACTED (Nick Linker) Date: Wed, 12 Jul 2006 14:11:55 +0700 Subject: blogging about Erlang In-Reply-To: <17244f480607111452g50512e5rab27cd042b745a95@mail.gmail.com> References: <17244f480607111452g50512e5rab27cd042b745a95@mail.gmail.com> Message-ID: <44B4A0BB.1070305@mail.ru> Hi, Yariv. > Hi list, > > I've been blogging about Erlang, etc in my blog at > http://yarivblog.wordpress.com. I just wrote a posting comparing > Erlang + Yaws to Ruby on Rails and submitted it to digg.com. If enough > people digg it, it'll rise on the front page. Sometimes the crowds Ok, how to "digg it"? Nick. From bengt.kleberg@REDACTED Wed Jul 12 10:02:26 2006 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 12 Jul 2006 10:02:26 +0200 Subject: blogging about Erlang In-Reply-To: <44B4A0BB.1070305@mail.ru> References: <17244f480607111452g50512e5rab27cd042b745a95@mail.gmail.com> <44B4A0BB.1070305@mail.ru> Message-ID: <44B4AC92.8010302@ericsson.com> On 2006-07-12 09:11, Nick Linker wrote: > Hi, Yariv. >> Hi list, >> >> I've been blogging about Erlang, etc in my blog at ...deleted > Ok, how to "digg it"? search for erlang or yaws in the Upcoming Stories (1) tab (technology topic). bengt -- EPO guidelines 1978: "If the contribution to the known art resides solely in a computer program then the subject matter is not patentable in whatever manner it may be presented in the claims." From xlcr@REDACTED Wed Jul 12 10:43:00 2006 From: xlcr@REDACTED (Nick Linker) Date: Wed, 12 Jul 2006 15:43:00 +0700 Subject: blogging about Erlang In-Reply-To: <44B4A0BB.1070305@mail.ru> References: <17244f480607111452g50512e5rab27cd042b745a95@mail.gmail.com> <44B4A0BB.1070305@mail.ru> Message-ID: <44B4B614.8090504@mail.ru> PS: > Ok, how to "digg it"? Unfortunately, it is quite boring, and I am not sure that people will not give up before they finish with "diggging it". :-) From yarivvv@REDACTED Wed Jul 12 14:00:19 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 12 Jul 2006 08:00:19 -0400 Subject: blogging about Erlang In-Reply-To: <44B4AC92.8010302@ericsson.com> References: <17244f480607111452g50512e5rab27cd042b745a95@mail.gmail.com> <44B4A0BB.1070305@mail.ru> <44B4AC92.8010302@ericsson.com> Message-ID: <17244f480607120500l447a7ca4p69805cde90730955@mail.gmail.com> I added a digg link to the bottom of the Erlang + Yaws vs. Ruby on Rails posting. Thanks! On 7/12/06, Bengt Kleberg wrote: > On 2006-07-12 09:11, Nick Linker wrote: > > Hi, Yariv. > >> Hi list, > >> > >> I've been blogging about Erlang, etc in my blog at > > ...deleted > > Ok, how to "digg it"? > > search for erlang or yaws in the Upcoming Stories (1) tab (technology > topic). > > > bengt > -- > EPO guidelines 1978: "If the contribution to the known art resides > solely in a computer program then the subject matter is not > patentable in whatever manner it may be presented in the claims." > From igor@REDACTED Wed Jul 12 14:09:53 2006 From: igor@REDACTED (Igor Goryachev) Date: Wed, 12 Jul 2006 16:09:53 +0400 Subject: error_logger, multi-file support? Message-ID: <87k66jqb1q.fsf@goryachev.org> Hello. Is there any chance to split event logging (using error_logger(3)) into several files, i.e. to log some events in the first file and rest in the second? I have already seen log_mf_h(3), but it is not right solution for my kind of problems. Thanks for the attention. -- Igor Goryachev E-Mail/Jabber: igor@REDACTED From yarivvv@REDACTED Wed Jul 12 14:10:34 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 12 Jul 2006 08:10:34 -0400 Subject: blogging about Erlang In-Reply-To: <44B4B614.8090504@mail.ru> References: <17244f480607111452g50512e5rab27cd042b745a95@mail.gmail.com> <44B4A0BB.1070305@mail.ru> <44B4B614.8090504@mail.ru> Message-ID: <17244f480607120510o33986d2s167963033d86a73d@mail.gmail.com> I don't know... we'll see. I got 5 diggs so far, 1 of which is mine, so maybe you're right :) I thought putting Ruby on Rails in the title would draw the crowds in large numbers... maybe next time I'll compare Erlang to the One Red Paper Clip guy :) On 7/12/06, Nick Linker wrote: > PS: > > Ok, how to "digg it"? > Unfortunately, it is quite boring, and I am not sure that people will > not give up before they finish with "diggging it". :-) > > From rsaccon@REDACTED Wed Jul 12 15:49:30 2006 From: rsaccon@REDACTED (Roberto Saccon) Date: Wed, 12 Jul 2006 10:49:30 -0300 Subject: blogging about Erlang In-Reply-To: <17244f480607120510o33986d2s167963033d86a73d@mail.gmail.com> References: <17244f480607111452g50512e5rab27cd042b745a95@mail.gmail.com> <44B4A0BB.1070305@mail.ru> <44B4B614.8090504@mail.ru> <17244f480607120510o33986d2s167963033d86a73d@mail.gmail.com> Message-ID: If the context with RubyOnRails is not enough to make it popular for the crowd, just bring it in context with google or apple or create a mySpace widget out of it, or make a youtube video, and put Zidane or Paris Hilton in the title. Just joking :) On 7/12/06, Yariv Sadan wrote: > I don't know... we'll see. I got 5 diggs so far, 1 of which is mine, > so maybe you're right :) I thought putting Ruby on Rails in the title > would draw the crowds in large numbers... maybe next time I'll compare > Erlang to the One Red Paper Clip guy :) > > On 7/12/06, Nick Linker wrote: > > PS: > > > Ok, how to "digg it"? > > Unfortunately, it is quite boring, and I am not sure that people will > > not give up before they finish with "diggging it". :-) > > > > > -- Roberto Saccon From Yani.Dzhurov@REDACTED Wed Jul 12 16:37:23 2006 From: Yani.Dzhurov@REDACTED (Yani Dzhurov) Date: Wed, 12 Jul 2006 17:37:23 +0300 Subject: messages among processes Message-ID: <003501c6a5c0$b0133330$1500a8c0@dobrosoft.local> Hi What is the most efficient approach to send messages among processes? As far as I read when sending binaries among processes is just sending 16 bytes /header + size/ of the binary. The binary itself is shared. Is it much slower sending records? And records containing binaries? Thanks, Jani -------------- 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: 3326 bytes Desc: not available URL: From vances@REDACTED Wed Jul 12 19:46:55 2006 From: vances@REDACTED (Vance Shipley) Date: Wed, 12 Jul 2006 13:46:55 -0400 Subject: string literal in binary construction Message-ID: <20060712174655.GA87220@frogman.motivity.ca> 1> <<"123">>. <<"123">> 2> String = "123". "123" 3> <>. ** exited: {badarg,[{erl_eval,expr,3}]} ** Bummer. -Vance From thomasl_erlang@REDACTED Wed Jul 12 19:49:51 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 12 Jul 2006 10:49:51 -0700 (PDT) Subject: messages among processes In-Reply-To: <003501c6a5c0$b0133330$1500a8c0@dobrosoft.local> Message-ID: <20060712174951.27345.qmail@web38808.mail.mud.yahoo.com> --- Yani Dzhurov wrote: > Hi > > > > What is the most efficient approach to send messages > among processes? > > As far as I read when sending binaries among > processes is just sending 16 > bytes /header + size/ of the binary. The binary > itself is shared. Is it much > slower sending records? > > And records containing binaries? The standard approach is to copy all data except (large enough) binaries. If message copying really is a bottleneck, then you might consider using the shared heap emulator, which minimizes copying. (How do I get that, you ask? "erl -shared", I believe, though you might have to build it first.) The only experience I've heard from using the shared emulator on a real system reported ... no effect. If your experience differs, I'd be interested in hearing about it. Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From yarivvv@REDACTED Wed Jul 12 21:32:43 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Wed, 12 Jul 2006 15:32:43 -0400 Subject: is there an Erlang graphing library? In-Reply-To: References: <17244f480607111510x5991daa6q8a28223336f339d5@mail.gmail.com> Message-ID: <17244f480607121232w33452585j1415f032c193a25@mail.gmail.com> ImageMagick is a bit too low level for me. I guess I can just write a simple ruby script that uses Gruff to generate the images and call it from os:cmd. This should avoid memory leaks too. Thanks Yariv On 7/11/06, Roberto Saccon wrote: > I didn't find one (but that means nothing), and I worked around by > just generating the paramters for calling ImageMagick as OS command. > (I did that also in RubyOnRails for eliminating the memleaks of the > RMagick Wrapper). > > On 7/11/06, Yariv Sadan wrote: > > Hi, > > > > I'm looking for a graphing library for Erlang (similar to > > http://nubyonrails.com/pages/gruff). I couldn't find one on Google or > > in Jungerl. Does such a library exist? > > > > Thanks > > Yariv > > > > > -- > Roberto Saccon > From ulf@REDACTED Wed Jul 12 22:17:20 2006 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 12 Jul 2006 22:17:20 +0200 Subject: messages among processes In-Reply-To: <20060712174951.27345.qmail@web38808.mail.mud.yahoo.com> References: <20060712174951.27345.qmail@web38808.mail.mud.yahoo.com> Message-ID: Den 2006-07-12 19:49:51 skrev Thomas Lindgren : > The standard approach is to copy all data except > (large enough) binaries. If message copying really is > a bottleneck, then you might consider using the shared > heap emulator, which minimizes copying. The shared heap emulator is really deprecated (if that's a proper term for a feature that was never more than experimental to begin with...) 'erl -hybrid' is the currently recommended experimental feature. (http://www.erlang.org/ml-archive/erlang-questions/200512/msg00231.html) See also http://www.erlang.org/ml-archive/erlang-questions/200603/msg00412.html BR, Ulf W -- Ulf Wiger From thomasl_erlang@REDACTED Wed Jul 12 23:14:34 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 12 Jul 2006 14:14:34 -0700 (PDT) Subject: messages among processes In-Reply-To: Message-ID: <20060712211434.99807.qmail@web38804.mail.mud.yahoo.com> --- Ulf Wiger wrote: > The shared heap emulator is really deprecated (if > that's a proper term for > a feature that was never more than experimental to > begin with...) > > 'erl -hybrid' is the currently recommended > experimental feature. You're right, I forgot about the hybrid emulator. The mail you cite is a bit unclear on how much the shared area is actually used, though. Does anyone have any experiences to share? Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From rlenglet@REDACTED Thu Jul 13 02:38:21 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Thu, 13 Jul 2006 09:38:21 +0900 Subject: string literal in binary construction In-Reply-To: <20060712174655.GA87220@frogman.motivity.ca> References: <20060712174655.GA87220@frogman.motivity.ca> Message-ID: <200607130938.21494.rlenglet@users.forge.objectweb.org> Vance Shipley wrote: > 1> <<"123">>. This is syntactic sugar for <<$1, $2, $3>>. > <<"123">> > 2> String = "123". > "123" > 3> <>. > ** exited: {badarg,[{erl_eval,expr,3}]} ** Use list_to_binary(String) instead. -- Romain LENGLET From klacke@REDACTED Thu Jul 13 10:09:37 2006 From: klacke@REDACTED (Claes Wikstrom) Date: Thu, 13 Jul 2006 10:09:37 +0200 Subject: string literal in binary construction In-Reply-To: <200607130938.21494.rlenglet@users.forge.objectweb.org> References: <20060712174655.GA87220@frogman.motivity.ca> <200607130938.21494.rlenglet@users.forge.objectweb.org> Message-ID: <44B5FFC1.9000905@hyber.org> Romain Lenglet wrote: > Vance Shipley wrote: >> 1> <<"123">>. > > This is syntactic sugar for <<$1, $2, $3>>. > >> <<"123">> >> 2> String = "123". >> "123" >> 3> <>. >> ** exited: {badarg,[{erl_eval,expr,3}]} ** > > Use list_to_binary(String) instead. > Hmmm <> would certainly be useful (easy to implement too) /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control cellphone: +46 70 2097763 From rlenglet@REDACTED Thu Jul 13 10:18:20 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Thu, 13 Jul 2006 17:18:20 +0900 Subject: string literal in binary construction In-Reply-To: <44B5FFC1.9000905@hyber.org> References: <20060712174655.GA87220@frogman.motivity.ca> <200607130938.21494.rlenglet@users.forge.objectweb.org> <44B5FFC1.9000905@hyber.org> Message-ID: <200607131718.21051.rlenglet@users.forge.objectweb.org> Claes Wikstrom wrote: > Romain Lenglet wrote: > > Vance Shipley wrote: > >> 1> <<"123">>. > > > > This is syntactic sugar for <<$1, $2, $3>>. > > > >> <<"123">> > >> 2> String = "123". > >> "123" > >> 3> <>. > >> ** exited: {badarg,[{erl_eval,expr,3}]} ** > > > > Use list_to_binary(String) instead. > > Hmmm > > <> > > would certainly be useful (easy to implement too) Or even better: L = [1, 2, [<<"hello">>, 3] ], <> -- Romain LENGLET From tony@REDACTED Thu Jul 13 15:25:59 2006 From: tony@REDACTED (Tony Rogvall) Date: Thu, 13 Jul 2006 15:25:59 +0200 Subject: string literal in binary construction In-Reply-To: <44B5FFC1.9000905@hyber.org> References: <20060712174655.GA87220@frogman.motivity.ca> <200607130938.21494.rlenglet@users.forge.objectweb.org> <44B5FFC1.9000905@hyber.org> Message-ID: <3A1F7A36-BCEA-4F0D-AB04-554BAD43DB17@rogvall.com> > > Hmmm > > <> > Hmmm, what is a string ? ;-) String of what.... lets expand the context: String/utf-8 String/utf-16-big String/utf-16-little String/utf-32-big String/utf-32-little String/ascii String/iso-8859-1 And so on. ( I could survive with utf extensions ) > would certainly be useful (easy to implement too) Should not totally kill any one to implement either ;-) /Tony > > > /klacke > > -- > Claes Wikstrom -- Caps lock is nowhere and > http://www.hyber.org -- everything is under control > cellphone: +46 70 2097763 From rasmussen.bryan@REDACTED Fri Jul 14 12:43:44 2006 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Fri, 14 Jul 2006 12:43:44 +0200 Subject: Mondrian / Erlang? Message-ID: <3bb44c6e0607140343j33960367tab827f0ae6fc72e1@mail.gmail.com> Hey, Has anyone done anything to use mondrian http://mondrian.sourceforge.net/ from Erlang, or even better, done XML for Analysis work in Erlang? Cheers, Bryan Rasmussen From robert.virding@REDACTED Fri Jul 14 15:42:29 2006 From: robert.virding@REDACTED (Robert Virding) Date: Fri, 14 Jul 2006 15:42:29 +0200 Subject: Bug in statistics(runtime) on Windows XP? Message-ID: <44B79F45.4010307@telia.com> I am running Erlang R11B-0, the pre-compiled distribution, on Windows XP. The figures I get doing erlang:statistics(runtime) are completely weird, they seem to have no relation with what the OS reports and what I expect. They are at about 1/8th of wall-clock time on an otherwise unloaded system. Is this a bug, or does runtime mean something different here, or what? Robert From headspin@REDACTED Fri Jul 14 18:01:42 2006 From: headspin@REDACTED (dda) Date: Fri, 14 Jul 2006 18:01:42 +0200 Subject: Building OTP on a shared server Message-ID: I am trying to build Erlang on a shared server, which doesn't have ncurses installed. So I built ncurses, and stuck it into a directory in my account. However, I can't figure out what to tell configure in order to have it find ncurses. configure's options don't seem to provide for that... Any ideas? -- Didier From matthias@REDACTED Fri Jul 14 22:49:41 2006 From: matthias@REDACTED (Matthias Lang) Date: Fri, 14 Jul 2006 22:49:41 +0200 Subject: Building OTP on a shared server In-Reply-To: References: Message-ID: <17592.869.242109.23096@antilipe.corelatus.se> dda writes: > I am trying to build Erlang on a shared server, which doesn't have > ncurses installed. So I built ncurses, and stuck it into a directory > in my account. However, I can't figure out what to tell configure in > order to have it find ncurses. configure's options don't seem to > provide for that... Any ideas? Assuming you use bash, try export LDFLAGS="-L the_path_to_your_ncurses_library" Disclaimer: I haven't tried it for exactly your setup, but the above works for cross compiling and I can't think why it wouldn't work for what you're doing. Matthias From headspin@REDACTED Fri Jul 14 23:12:39 2006 From: headspin@REDACTED (dda) Date: Fri, 14 Jul 2006 23:12:39 +0200 Subject: Building OTP on a shared server In-Reply-To: <17592.869.242109.23096@antilipe.corelatus.se> References: <17592.869.242109.23096@antilipe.corelatus.se> Message-ID: Thanks, worked like a charm. LDFLAGS, LDFLAGS, LDFLAGS -- Didier On 7/14/06, Matthias Lang wrote: > dda writes: > > I am trying to build Erlang on a shared server, which doesn't have > > ncurses installed. So I built ncurses, and stuck it into a directory > > in my account. However, I can't figure out what to tell configure in > > order to have it find ncurses. configure's options don't seem to > > provide for that... Any ideas? > > Assuming you use bash, try > > export LDFLAGS="-L the_path_to_your_ncurses_library" > > Disclaimer: I haven't tried it for exactly your setup, but the above > works for cross compiling and I can't think why it wouldn't work for > what you're doing. > > Matthias From yarivvv@REDACTED Fri Jul 14 23:41:18 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Fri, 14 Jul 2006 17:41:18 -0400 Subject: Yaws + haXe remoting Message-ID: <17244f480607141441q4f3cea4ay5afcfa845b72a086@mail.gmail.com> (I'm forwarding this message that I sent to the erlyaws list) As of release 1.64, Yaws supports haXe (http://www.haxe.org) remoting. haXe is a great open source client side language for websites. It compiles to both Javascript AND Flash (and also NekoVM, its own virtual machine). You can now have easy Yaws/AJAX and Yaws/Flash interoperability. Look at the last item in the reference pages for more info. Please let me know if this helps you or if you find any problems! Thanks Yariv From rasmussen.bryan@REDACTED Sat Jul 15 09:02:43 2006 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Sat, 15 Jul 2006 09:02:43 +0200 Subject: Yaws + haXe remoting In-Reply-To: <17244f480607141441q4f3cea4ay5afcfa845b72a086@mail.gmail.com> References: <17244f480607141441q4f3cea4ay5afcfa845b72a086@mail.gmail.com> Message-ID: <3bb44c6e0607150002x30ff5f95gc150e64397f88282@mail.gmail.com> Since it is a client-side language what was required to do to support it? is there a link to documentation. cheers, Bryan Rasmussen On 7/14/06, Yariv Sadan wrote: > (I'm forwarding this message that I sent to the erlyaws list) > > As of release 1.64, Yaws supports haXe (http://www.haxe.org) remoting. > haXe is a great open > source client side language for websites. It compiles to both > Javascript AND Flash (and also NekoVM, its own virtual machine). You > can now have easy Yaws/AJAX and Yaws/Flash interoperability. Look at > the last item in the reference pages for more info. > > Please let me know if this helps you or if you find any problems! > > Thanks > Yariv > From ulf@REDACTED Sat Jul 15 11:28:45 2006 From: ulf@REDACTED (Ulf Wiger) Date: Sat, 15 Jul 2006 11:28:45 +0200 Subject: Yaws + haXe remoting In-Reply-To: <3bb44c6e0607150002x30ff5f95gc150e64397f88282@mail.gmail.com> References: <17244f480607141441q4f3cea4ay5afcfa845b72a086@mail.gmail.com> <3bb44c6e0607150002x30ff5f95gc150e64397f88282@mail.gmail.com> Message-ID: Den 2006-07-15 09:02:43 skrev bryan rasmussen : > Since it is a client-side language what was required to do to support > it? is there a link to documentation. This seems like a pretty good starting point: http://www.haxe.org/tutos/remoting /Ulf W -- Ulf Wiger From yarivvv@REDACTED Sat Jul 15 15:20:37 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Sat, 15 Jul 2006 09:20:37 -0400 Subject: Yaws + haXe remoting In-Reply-To: References: <17244f480607141441q4f3cea4ay5afcfa845b72a086@mail.gmail.com> <3bb44c6e0607150002x30ff5f95gc150e64397f88282@mail.gmail.com> Message-ID: <17244f480607150620i4df4a22w407d728e93598cb9@mail.gmail.com> Unfortunately, the haXe remoting protocol isn't documented outside of the source code, and even in the source code there are very few comments. I just looked at the haXe source and implemented the same protocol in Erlang. (I didn't implement the full protocol as Class objects and Enums would be too cumbersome to use in Erlang -- but they aren't necessary for almost all RPC usage cases. Anonymous objects work very well.) For more info on how to use it in Erlang, check out http://yaws.hyber.org/haxe_intro.yaws. Best Yariv On 7/15/06, Ulf Wiger wrote: > Den 2006-07-15 09:02:43 skrev bryan rasmussen : > > > Since it is a client-side language what was required to do to support > > it? is there a link to documentation. > > This seems like a pretty good starting point: > > http://www.haxe.org/tutos/remoting > > /Ulf W > -- > Ulf Wiger > From kruegger@REDACTED Sun Jul 16 13:05:15 2006 From: kruegger@REDACTED (Stephen Han) Date: Sun, 16 Jul 2006 04:05:15 -0700 Subject: R11B-0 ddll_server child specification question Message-ID: <86f1f5350607160405g62f81cd3mf7374254dd9dba29@mail.gmail.com> Hi. I looked at the kernel.erl of R11B-0 and find out that in line number 129 and 143, we have ddll_server child specification defined twice. Of course that the latter one really controlled by the kernel application environment variable 'start_ddll" but isn't that potentially can bring up and trying to register two ddll_server at the same time if the 'start_ddll" environment variable is 'true', though? Why do we have ErlDdll and Ddll specifications in R11B-0? regards, -------------- next part -------------- An HTML attachment was scrubbed... URL: From yarivvv@REDACTED Sun Jul 16 18:00:24 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Sun, 16 Jul 2006 12:00:24 -0400 Subject: Yaws + haXe remoting In-Reply-To: References: <17244f480607141441q4f3cea4ay5afcfa845b72a086@mail.gmail.com> <3bb44c6e0607150002x30ff5f95gc150e64397f88282@mail.gmail.com> Message-ID: <17244f480607160900g585d51bamd2ac4b5e772c91f4@mail.gmail.com> I wrote some thoughts on this stuff on my blog (please note the new URL of my blog -- http://yarivsblog.com): http://yarivsblog.com/articles/2006/07/14/haxe-remoting-with-erlang-yaws http://yarivsblog.com/articles/2006/06/26/erlang-yaws-haxe-perfect-comet-recipe I also had some fun while hacking Yaws (not too many web servers let you hack their code while they're running :) ) http://yarivsblog.com/articles/2006/06/22/erlang-hot-code-swapping-hacking-nirvana Cheers Yariv On 7/15/06, Ulf Wiger wrote: > Den 2006-07-15 09:02:43 skrev bryan rasmussen : > > > Since it is a client-side language what was required to do to support > > it? is there a link to documentation. > > This seems like a pretty good starting point: > > http://www.haxe.org/tutos/remoting > > /Ulf W > -- > Ulf Wiger > From nm@REDACTED Sun Jul 16 19:32:05 2006 From: nm@REDACTED (Gaspar Chilingarov) Date: Sun, 16 Jul 2006 22:32:05 +0500 Subject: Yaws + haXe remoting In-Reply-To: <17244f480607141441q4f3cea4ay5afcfa845b72a086@mail.gmail.com> References: <17244f480607141441q4f3cea4ay5afcfa845b72a086@mail.gmail.com> Message-ID: <44BA7815.6070700@web.am> Yariv Sadan wrote: > (I'm forwarding this message that I sent to the erlyaws list) > > As of release 1.64, Yaws supports haXe (http://www.haxe.org) remoting. > haXe is a great open Hi! Are there any demo in haxe, which is compiled to JS? I've found only ones, which use Flash -- and I have no flash at all on my freebsd. I've looked a little on their site - and because I have some idiosyncrasy against C++/Java like languages, I'm wish to see it in action befoce even trying to learning it :). -- Gaspar Chilingarov System Administrator, Network security consulting t +37493 419763 (mob) i 63174784 e nm@REDACTED From yarivvv@REDACTED Sun Jul 16 22:35:48 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Sun, 16 Jul 2006 16:35:48 -0400 Subject: Yaws + haXe remoting In-Reply-To: <44BA7815.6070700@web.am> References: <17244f480607141441q4f3cea4ay5afcfa845b72a086@mail.gmail.com> <44BA7815.6070700@web.am> Message-ID: <17244f480607161335k4d2ef35cl795a399a78cce9e1@mail.gmail.com> Hi Gaspar I attached a small app, which is a modified version of the example from the yaws side. Just unzip the file into your root yaws folder and it'll create a subfolder called 'test' with the working sample. The test.js file is generated by the haXe compiler. To compile it yourself, call "haxe compile.hxml". Yes, haXe is one of those "other" languages, but unfortunately Erlang doesn't run in the browser, and haXe still beats Javascript and Actionscript/Flash by a wide margin IMO :) Best Yariv > > Hi! > Are there any demo in haxe, which is compiled to JS? > I've found only ones, which use Flash -- and I have no flash at all on > my freebsd. > > I've looked a little on their site - and because I have some > idiosyncrasy against C++/Java like languages, I'm wish to see it in > action befoce even trying to learning it :). > > -- > Gaspar Chilingarov > > System Administrator, > Network security consulting > > t +37493 419763 (mob) > i 63174784 > e nm@REDACTED > -------------- next part -------------- A non-text attachment was scrubbed... Name: test.zip Type: application/zip Size: 9299 bytes Desc: not available URL: From xlcr@REDACTED Mon Jul 17 09:59:51 2006 From: xlcr@REDACTED (Nick Linker) Date: Mon, 17 Jul 2006 14:59:51 +0700 Subject: Lightweight processes in Scala Message-ID: <44BB4377.7020809@mail.ru> Hi all, Martin Odersky and Philipp Haller did some effort and implemented Erlang-like lightweight processes over JVM using Scala language. Their lightweight "actors" look like this: class Counter extends Actor { override def run(): unit = loop(0) def loop(value: int): unit = { Console.println("Value: " + value) receive { case Incr() => loop(value + 1) case Value(a) => a ! value; loop(value) case Lock(a) => a ! value receive { case UnLock(v) => loop(v) } case _ => loop(value) } } } The article can be found at http://lampwww.epfl.ch/~odersky/papers/jmlc06.html. Scala language homepage is http://scala.epfl.ch/. Maybe I have overactive imagination, but I'm afraid, it could be serious threat for Erlang from Java side because one of the most significant advantages of Erlang over JVM were lightweight processes and now JVM will have them. With best regards, Nick. From ulf.wiger@REDACTED Mon Jul 17 19:37:02 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Mon, 17 Jul 2006 19:37:02 +0200 Subject: updating a newly created table within the same transaction Message-ID: I keep running into the nuisance that I can't create a mnesia table and then write to it in the same transaction. Currently, one has to use mnesia's restore for that kind of thing - not quite as convenient. Here's a patch (not quite finished) that seems to do the trick. Example: 5> mnesia_schema:schema_transaction(fun() -> mnesia_schema:do_create_table(mnesia_schema:list2cs([{name,test}])), mnesia:write({test,a,17}) end). {atomic,ok} 6> ets:tab2list(test). [{test,a,17}] ...and it also fixes the slight bug that one has been able to read from a table that's just been deleted, as long as one does it within the same transaction (mnesia doesn't detect that it's been deleted until it tries to commit the update.) 7> mnesia_schema:schema_transaction(fun() -> mnesia_schema:do_delete_table(test), mnesia:activity(transaction,fun() -> mnesia:write({test,b,18}) end) end). {aborted,{aborted,{no_exists,test}}} Patches, relative to mnesia-4.3.1 (OTP R11B) below, and attached, an access module that is automatically used as a wrapper to any user-defined access module, if mnesia_tm detects that it's a schema transaction (first time I've ever found a use for parameterized modules ;) The access module only handles write and delete at this time. The idea is that it needs to emulate all ops using only the transaction store (objects in a newly created table cannot be anywhere else until the transaction is committed.) BR, Ulf W > diff mnesia_schema.erl $OTP_ROOT/lib/mnesia-4.3.1/src/mnesia_schema.erl 107d106 < -export([is_schema_transaction/0]). 591,598d589 < is_schema_transaction() -> < case process_info(self(), initial_call) of < {_, {?MODULE, schema_coordinator,_}} -> < true; < _ -> < false < end. < 615,618c606 < Res = case catch mnesia:activity(transaction, Fun) of < {'EXIT', BadRes} -> {aborted, BadRes}; < GoodRes -> {atomic, GoodRes} < end, --- > Res = mnesia:transaction(Fun), > diff mnesia_tm.erl $OTP_ROOT/lib/mnesia-4.3.1/src/mnesia_tm.erl 62d61 < tab_info = [], 772c771 < transaction(OldTidTs, Fun, Args, Retries, Mod0, Type) -> --- > transaction(OldTidTs, Fun, Args, Retries, Mod, Type) -> 774,779d772 < Mod = case mnesia_schema:is_schema_transaction() of < true -> < mnesia_schema_access:new(Mod0); < false -> < Mod0 < end, 1161,1164c1154 < case catch begin < Prep1 = do_arrange_schema(Tid, Store, Prep), < do_arrange(Tid, Store, Key, Prep1, N) < end of --- > case catch do_arrange(Tid, Store, Key, Prep, N) of 1194,1207d1183 < do_arrange_schema(Tid, Store, Prep) -> < SchemaKey = op, < Items = ?ets_lookup(Store, SchemaKey), < TabInfo = < lists:foldl( < fun({op, delete_table, [{name, Tab}|_]}, I) -> < orddict:store(Tab, [], I); < ({op, _, [{name, Tab}|_] = Opts}, I) -> < orddict:store(Tab, Opts, I); < (_, I) -> < I < end, orddict:new(), Items), < prepare_schema_items(Tid, Items, Prep#prep{tab_info = TabInfo}). < 1216,1217c1192,1194 < %%% schema items handled separately < do_arrange(Tid, Store, ?ets_next(Store, SchemaKey), Prep, N + 1); --- > Items = ?ets_lookup(Store, SchemaKey), %% Store is a bag > P2 = prepare_schema_items(Tid, Items, Prep), > do_arrange(Tid, Store, ?ets_next(Store, SchemaKey), P2, N + 1); 1258c1235 < prepare_items(Tid, Tab, Key, Items, #prep{tab_info = []} = Prep) -> --- > prepare_items(Tid, Tab, Key, Items, Prep) -> 1272,1297c1249 < end; < < prepare_items(Tid, Tab, Key, Items, #prep{tab_info = TI} = Prep) -> < case orddict:find(Tab, TI) of < {ok, []} -> < mnesia:abort({no_exists, Tab}); < {ok, TabInfo} -> < Snmp = proplists:get_value(snmp, TabInfo), < Types = % where_to_commit < where_to_commit(TabInfo, [node() | nodes()]), < Recs2 = do_prepare_items(Tid, Tab, Key, Types, < Snmp, Items, Prep#prep.records), < Prep2 = Prep#prep{records = Recs2, prev_tab = Tab, < prev_types = Types, prev_snmp = Snmp}, < check_prep(Prep2, Types); < error -> < mnesia:abort({no_exists, Tab}) < end. < < where_to_commit(TI, LiveNodes) -> < Cs = fun(Type) -> < [{N, Type} || N <- proplists:get_value(Type, TI), < lists:member(N, LiveNodes)] < end, < lists:concat([Cs(T) || T <- [ram_copies, disc_copies, disc_only_copies]]). < --- > end. -------------- next part -------------- A non-text attachment was scrubbed... Name: mnesia_schema_access.erl Type: application/octet-stream Size: 4992 bytes Desc: mnesia_schema_access.erl URL: From francesco@REDACTED Tue Jul 18 15:21:16 2006 From: francesco@REDACTED (Francesco Cesarini) Date: Tue, 18 Jul 2006 14:21:16 +0100 Subject: Trapexit is back! Message-ID: <44BCE04C.4010200@erlang-consulting.com> Hi All, Trapexit is back! We have now launched a beta and want your feedback. The URL is still http://www.trapexit.org New to the site is that we have moved all the how-tos to a media wiki so others can correct, update (and revert) the existing versions. The media wiki also has a calendar, which you can add your events to, as well as the ability to add your own blogs and other erlang related feeds. The URL is http://wiki.trapexit.org/index.php/Main_Page With an ever growing amount of traffic on the Erlang mailing list, we have relaunched the forums, separating the various subjects we thought might be of interest. Hopefully, the forums will become a good point of reference and complement to the Erlang mailing list. The URL is http://forum.trapexit.org/ There is also a section for contributions. We have set it up as a forum, where you can upload files, provide pointers to repositories where you store the latest release, and more! Be the first to post your contribution at http://forum.trapexit.org/viewforum.php?f=20 Welcome back to trapexit! Andreas, Ludvig, and everyone else at Erlang Training and Consulting -- http://www.erlang-consulting.com From serge@REDACTED Tue Jul 18 15:26:01 2006 From: serge@REDACTED (Serge Aleynikov) Date: Tue, 18 Jul 2006 09:26:01 -0400 Subject: error_logger, multi-file support? In-Reply-To: <87k66jqb1q.fsf@goryachev.org> References: <87k66jqb1q.fsf@goryachev.org> Message-ID: <44BCE169.5070702@hq.idt.net> You can accomplish this by installing a custom event handler to the error_logger event manager. Such an event handler can do anything you wish. For example you can look into the LAMA contrib in the jungerl that uses this technique to reformat and forward all error_logger reports to syslog. Serge Igor Goryachev wrote: > Hello. > > Is there any chance to split event logging (using error_logger(3)) into > several files, i.e. to log some events in the first file and rest in the > second? I have already seen log_mf_h(3), but it is not right solution > for my kind of problems. > > Thanks for the attention. From goryachev@REDACTED Tue Jul 18 16:30:57 2006 From: goryachev@REDACTED (Igor Goryachev) Date: Tue, 18 Jul 2006 18:30:57 +0400 Subject: error_logger, multi-file support? In-Reply-To: <44BCE169.5070702@hq.idt.net> (Serge Aleynikov's message of "Tue, 18 Jul 2006 09:26:01 -0400") References: <87k66jqb1q.fsf@goryachev.org> <44BCE169.5070702@hq.idt.net> Message-ID: <87odvnasta.fsf@yandex-team.ru> Serge Aleynikov writes: >> Is there any chance to split event logging (using error_logger(3)) into >> several files, i.e. to log some events in the first file and rest in the >> second? I have already seen log_mf_h(3), but it is not right solution >> for my kind of problems. > > You can accomplish this by installing a custom event handler to the > error_logger event manager. Such an event handler can do anything you > wish. For example you can look into the LAMA contrib in the jungerl > that uses this technique to reformat and forward all error_logger > reports to syslog. Thank you very much. -- Igor Goryachev Yandex development team. From erights@REDACTED Tue Jul 18 22:14:16 2006 From: erights@REDACTED (Mark Miller) Date: Tue, 18 Jul 2006 13:14:16 -0700 Subject: [e-lang] [Fwd: Lightweight processes in Scala] In-Reply-To: <44BB9660.2060306@blueyonder.co.uk> References: <44BB9660.2060306@blueyonder.co.uk> Message-ID: On 7/17/06, David Hopwood wrote: >Subject: Lightweight processes in Scala >Date: Mon, 17 Jul 2006 14:59:51 +0700 >From: Nick Linker > > Martin Odersky and Philipp Haller did some effort and implemented > Erlang-like lightweight processes over JVM using Scala language. Their > lightweight "actors" look like this: > > class Counter extends Actor { > override def run(): unit = loop(0) > > def loop(value: int): unit = { > Console.println("Value: " + value) > receive { > case Incr() => loop(value + 1) > case Value(a) => a ! value; loop(value) > case Lock(a) => a ! value > receive { case UnLock(v) => loop(v) } > case _ => loop(value) > } > } > } >The article can be found at >http://lampwww.epfl.ch/~odersky/papers/jmlc06.html. I've now read the article. I'm puzzled by the title and claims -- they clearly understand that Erlang does "Event-Based Programming Without Inversion of Control", and they explicitly state that they are seeking to get the same effects in Scala. Nevertheless, they seem to suggest that demonstrating event-based programming without inversion of control is itself novel. I don't get it. In any case, in the previous conversation about E-style concurrency in Erlang, Ulf put his finger on the crucial issue: selective receive. Scala is clearly trying to emulate Erlang's selective receive style. For contrast, here's how to do something much like the above example in E as event-based programming without inversion of control, and without selective receive. The try-finally below is a hack to avoid introducing a temporary variable. ------------------------------------------------ #!/usr/bin/env rune pragma.enable("easy-return") pragma.disable("explicit-result-guard") def makeCounter() { var value := 0 var optResolver := null def counter { to __printOn(out :TextWriter) { out.print(`Value: $value`) } to incr() { value := value <- add(1) } to getValue() { return value } to lock() { try { return value } finally { def [p,r] := Ref.promise() value := p optResolver := r } } to unlock(v) { optResolver.resolve(v) optResolver := null } } return counter } ? def counter := makeCounter() # value: Value: 0 ? counter.incr() ? counter.getValue() # value: 1 ? counter.lock() # value: 1 ? counter.incr() ? def x := counter.getValue() # value: ? counter.unlock(33) ? x # value: 34 ----------------------------------------- -- Text by me above is hereby placed in the public domain Cheers, --MarkM From serge@REDACTED Wed Jul 19 18:17:04 2006 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 19 Jul 2006 12:17:04 -0400 Subject: deleting records from mnesia Message-ID: <44BE5B00.6080904@hq.idt.net> Hi, Is there a way to delete all records from a table in mnesia within a transaction? This won't work because mnesia:clean_table/1 doesn't support nested transactions: F = fun() -> {atomic, ok} = mnesia:clear_table(Tab), insert_records(Tab) end, mnesia:transaction(F). I know that I could do this: [mnesia:delete(Tab, Key, sticky_write) || Key <- mnesia:all_keys(Tab)]. but is there a way to truncate table in one shot within a transaction instead of iterating over all records? Serge From ulf.wiger@REDACTED Wed Jul 19 19:28:37 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Wed, 19 Jul 2006 19:28:37 +0200 Subject: deleting records from mnesia Message-ID: I tried with my slightly patched version: (tups1@REDACTED)2> mnesia:create_table(test,[]). {atomic,ok} (tups1@REDACTED)3> [mnesia:dirty_write({test,I,v}) || I <- lists:seq(1,10)]. [ok,ok,ok,ok,ok,ok,ok,ok,ok,ok] (tups1@REDACTED)4> ets:tab2list(test). [{test,1,v}, {test,10,v}, {test,2,v}, {test,3,v}, {test,8,v}, {test,4,v}, {test,5,v}, {test,7,v}, {test,6,v}, {test,9,v}] (tups1@REDACTED)5> mnesia_schema:schema_transaction( fun() -> mnesia_schema:do_clear_table(test), mnesia:write({test,1,a}) end). {atomic,ok} (tups1@REDACTED)6> ets:tab2list(test). [{test,1,a}] The only change that's required is that mnesia_schema:do_clear_table/1 is exported. BR, Ulf W > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Serge > Aleynikov > Sent: den 19 juli 2006 18:17 > To: Erlang Users' List > Subject: deleting records from mnesia > > Hi, > > Is there a way to delete all records from a table in mnesia > within a transaction? > > This won't work because mnesia:clean_table/1 doesn't support nested > transactions: > > F = fun() -> > {atomic, ok} = mnesia:clear_table(Tab), > insert_records(Tab) > end, > mnesia:transaction(F). > > I know that I could do this: > > [mnesia:delete(Tab, Key, sticky_write) || Key <- > mnesia:all_keys(Tab)]. > > but is there a way to truncate table in one shot within a > transaction instead of iterating over all records? > > Serge > From serge@REDACTED Wed Jul 19 19:46:54 2006 From: serge@REDACTED (Serge Aleynikov) Date: Wed, 19 Jul 2006 13:46:54 -0400 Subject: deleting records from mnesia In-Reply-To: References: Message-ID: <44BE700E.4090501@hq.idt.net> Hmm... I was hoping there was a solution using mnesia:activity call that wouldn't require patching. :-( Can this function be exported in the future OTP release? Serge Ulf Wiger (TN/EAB) wrote: > I tried with my slightly patched version: > > (tups1@REDACTED)2> mnesia:create_table(test,[]). > {atomic,ok} > (tups1@REDACTED)3> [mnesia:dirty_write({test,I,v}) || I <- > lists:seq(1,10)]. > [ok,ok,ok,ok,ok,ok,ok,ok,ok,ok] > (tups1@REDACTED)4> ets:tab2list(test). > [{test,1,v}, > {test,10,v}, > {test,2,v}, > {test,3,v}, > {test,8,v}, > {test,4,v}, > {test,5,v}, > {test,7,v}, > {test,6,v}, > {test,9,v}] > (tups1@REDACTED)5> mnesia_schema:schema_transaction( > fun() -> mnesia_schema:do_clear_table(test), > mnesia:write({test,1,a}) end). > {atomic,ok} > (tups1@REDACTED)6> ets:tab2list(test). > [{test,1,a}] > > > The only change that's required is that > mnesia_schema:do_clear_table/1 is exported. > > BR, > Ulf W > > >> -----Original Message----- >> From: owner-erlang-questions@REDACTED >> [mailto:owner-erlang-questions@REDACTED] On Behalf Of Serge >> Aleynikov >> Sent: den 19 juli 2006 18:17 >> To: Erlang Users' List >> Subject: deleting records from mnesia >> >> Hi, >> >> Is there a way to delete all records from a table in mnesia >> within a transaction? >> >> This won't work because mnesia:clean_table/1 doesn't support nested >> transactions: >> >> F = fun() -> >> {atomic, ok} = mnesia:clear_table(Tab), >> insert_records(Tab) >> end, >> mnesia:transaction(F). >> >> I know that I could do this: >> >> [mnesia:delete(Tab, Key, sticky_write) || Key <- >> mnesia:all_keys(Tab)]. >> >> but is there a way to truncate table in one shot within a >> transaction instead of iterating over all records? >> >> Serge >> > -- Serge Aleynikov R&D Telecom, MIS, IDT Corp Tel: +1 (973) 438-3436 Fax: +1 (973) 438-1464 From rcbeerman@REDACTED Wed Jul 19 19:48:20 2006 From: rcbeerman@REDACTED (RCB) Date: Wed, 19 Jul 2006 10:48:20 -0700 Subject: deleting records from mnesia In-Reply-To: <44BE5B00.6080904@hq.idt.net> References: <44BE5B00.6080904@hq.idt.net> Message-ID: Hi Serge, mnesia:delete_object(#record{_ = '_'}). seems to work for me. -Rich On 7/19/06, Serge Aleynikov wrote: > Is there a way to delete all records from a table in mnesia within a > transaction? -- Rich Beerman Cupertino, California mobile: 408/221-2444 fax: 408/255-7944 From rasmussen.bryan@REDACTED Wed Jul 19 20:40:48 2006 From: rasmussen.bryan@REDACTED (bryan rasmussen) Date: Wed, 19 Jul 2006 20:40:48 +0200 Subject: deleting records from mnesia In-Reply-To: References: Message-ID: <3bb44c6e0607191140v28d90e3bye0fec670f4646f25@mail.gmail.com> > The only change that's required is that > mnesia_schema:do_clear_table/1 is exported. > Is there any reason that it wasn't exported in the first place? Cheers, Bryan Rasmussen From ulf.wiger@REDACTED Wed Jul 19 22:10:07 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Wed, 19 Jul 2006 22:10:07 +0200 Subject: deleting records from mnesia In-Reply-To: <3bb44c6e0607191140v28d90e3bye0fec670f4646f25@mail.gmail.com> Message-ID: Well, the mnesia_schema functions aren't really part of the mnesia API. Several of the do_xxx functions have been exported as part of my hacking with rdbms, but it's never been documented. I think it's desirable to allow the user to create, delete and modify several tables within one transaction, and also to allow writes to all tables (even newly created) within the same transaction. Not trivial, though... BR, Ulf W > -----Original Message----- > From: bryan rasmussen [mailto:rasmussen.bryan@REDACTED] > Sent: den 19 juli 2006 20:41 > To: Ulf Wiger (TN/EAB) > Cc: Serge Aleynikov; Erlang Users' List > Subject: Re: deleting records from mnesia > > > The only change that's required is that > > mnesia_schema:do_clear_table/1 is exported. > > > > Is there any reason that it wasn't exported in the first place? > > Cheers, > Bryan Rasmussen > From headspin@REDACTED Wed Jul 19 23:27:07 2006 From: headspin@REDACTED (dda) Date: Wed, 19 Jul 2006 23:27:07 +0200 Subject: partial match in [d]ets Message-ID: Is there a way of making partial matches in [d]ets? ie, let's say I want to do something like: ets:match(myTable, {'$1', }). --> replacing with the correct syntax, if any... -- Didier From map@REDACTED Tue Jul 18 17:33:51 2006 From: map@REDACTED (Magnus Ahltorp) Date: Tue, 18 Jul 2006 17:33:51 +0200 Subject: Mnesia overloaded Message-ID: <074F724A-6E7A-4A28-9703-EF9D32FDB11C@kth.se> I'm trying to move mnesia tables from computer1 to computer2: (incomingproxy@REDACTED)> mnesia:add_table_copy(regexproute, 'incomingproxy@REDACTED', ram_copies). but this just hangs and I get these messages: Mnesia('incomingproxy@REDACTED'): ** WARNING ** Mnesia is overloaded: {dump_log, time_threshold} The system is not very loaded, and I waited something like 10 minutes, and still nothing happened. I'm running R9C on computer1 and R11B on computer2. /Magnus From onlyopensource@REDACTED Thu Jul 20 10:35:43 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Thu, 20 Jul 2006 14:05:43 +0530 Subject: newbie query Message-ID: Hello I just tried Yaws and its really fast and nice. Now, I want to learn Erlang and here is my query. How does erlang record compare to 'C' struct or C++ class ? I have a background in C++ and want to know about erlang record. What it is and what one needs to be careful about ? Thank you very much. -- oo@@oo From onlyopensource@REDACTED Thu Jul 20 10:51:47 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Thu, 20 Jul 2006 14:21:47 +0530 Subject: multi-core processors and erlang Message-ID: hello Does erlang take benefit of multi-core processors which are now available in desktop machines ? erlang supports concurrency and can definitely benefit from native support from multi-core processors. Is it a correct assumption or am I just too sleepy ? -- oo@@oo From joe.armstrong@REDACTED Thu Jul 20 11:15:50 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Thu, 20 Jul 2006 11:15:50 +0200 Subject: multi-core processors and erlang In-Reply-To: Message-ID: Absolutely - <> Yes Erlang runs happily on multi core processors - drop your Erlang program onto a multi core and it *will* go faster, exactly how much faster depends upon the dependencies between you parallel processes. If they are all independent and CPU bound you'll probably run K * N times faster on an N core CPU. Say 16 times on a Sun Niagara. << K depends upon the Erlang implementation, it's currently about 0.5, were hoping for 0.75, the current implementation strategy emphasis stability over speed ... >> Turning a sequential program into a parallel program is also really really easy, for example, I changed a single map to pmap (pmap is a parallel map function) and the program went 7 times faster. Read http://www.erlang.org/ml-archive/erlang-questions/200606/msg00187.html See also Multicore Erlang performance http://www.erlang-stuff.net/blog/ /Joe > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Only > OpenSource > Sent: den 20 juli 2006 10:52 > To: erlang-questions@REDACTED > Subject: multi-core processors and erlang > > hello > > Does erlang take benefit of multi-core processors which are > now available in desktop machines ? > > erlang supports concurrency and can definitely benefit from > native support from multi-core processors. > > Is it a correct assumption or am I just too sleepy ? > > -- > oo@@oo > From chsu79@REDACTED Thu Jul 20 11:17:27 2006 From: chsu79@REDACTED (Christian S) Date: Thu, 20 Jul 2006 11:17:27 +0200 Subject: multi-core processors and erlang In-Reply-To: References: Message-ID: On 7/20/06, Only OpenSource wrote: > > Does erlang take benefit of multi-core processors which are now > available in desktop machines ? http://www.erlang.org/doc/doc-5.5/doc/highlights.html http://www.erlang-stuff.net/wordpress/?p=14 -------------- next part -------------- An HTML attachment was scrubbed... URL: From slasci@REDACTED Thu Jul 20 14:07:33 2006 From: slasci@REDACTED (rage machine) Date: Thu, 20 Jul 2006 12:07:33 +0000 Subject: erlang crashes in user mode linux Message-ID: Hi When running erlang in user mode linux I get segmentation fault. erlang@REDACTED:~$ erl Segmentation fault Some info about the uml: erlang@REDACTED:~/otp/bin$ ROOTDIR=/home/erlang/otp/lib/erlang erlang@REDACTED:~/otp/bin$ BINDIR=$ROOTDIR/erts-5.5/bin erlang@REDACTED:~/otp/bin$ EMU=beam erlang@REDACTED:~/otp/bin$ PROGNAME=erl erlang@REDACTED:~/otp/bin$ export EMU erlang@REDACTED:~/otp/bin$ export ROOTDIR erlang@REDACTED:~/otp/bin$ export BINDIR erlang@REDACTED:~/otp/bin$ export PROGNAME erlang@REDACTED:~/otp/bin$ /home/erlang/otp/lib/erlang/erts-5.5/bin/erlexec Segmentation fault erlang@REDACTED:~/otp/bin$ gdb /home/erlang/otp/lib/erlang/erts-5.5/bin/erlexec GNU gdb 6.4.90-debian Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) run Starting program: /home/erlang/otp/lib/erlang/erts-5.5/bin/erlexec [New LWP 1287] Program received signal SIGSEGV, Segmentation fault. [Switching to LWP 1287] 0x00000000 in ?? () (gdb) The program is running. Exit anyway? (y or n) y erlang@REDACTED:~/otp/bin$ valgrind -v --db-attach=yes --tool=memcheck /home/erlang/otp/lib/erlang/erts-5.5/bin/erlexec ==1288== Memcheck, a memory error detector. ==1288== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al. ==1288== Using LibVEX rev 1606, a library for dynamic binary translation. ==1288== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. ==1288== Using valgrind-3.2.0-Debian, a dynamic binary instrumentation framework. ==1288== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. ==1288== --1288-- Command line --1288-- /home/erlang/otp/lib/erlang/erts-5.5/bin/erlexec --1288-- Startup, with flags: --1288-- -v --1288-- --db-attach=yes --1288-- --tool=memcheck --1288-- Contents of /proc/version: --1288-- Linux version 2.6.17.6 (shrek@REDACTED) (gcc version 4.0.4 20060507 (prerelease) (Debian 4.0.3-3)) #1 Sun Jul 16 12:25:48 CEST 2006 --1288-- Arch and hwcaps: X86, x86-sse1-sse2 --1288-- Valgrind library directory: /usr/lib/valgrind --1288-- Reading syms from /lib/ld-2.3.6.so (0x4000000) --1288-- Reading debug info from /lib/ld-2.3.6.so... --1288-- ... CRC mismatch (computed 8D0DB48E wanted BF5D33FD) --1288-- object doesn't have a symbol table --1288-- Reading syms from /home/erlang/otp/lib/erlang/erts-5.5/bin/erlexec (0x8048000) --1288-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0x38000000) --1288-- object doesn't have a dynamic symbol table --1288-- Reading suppressions file: /usr/lib/valgrind/default.supp Valgrind's memory management: out of memory: initialiseSector(TC)'s request for 20127744 bytes failed. 15462400 bytes have already been allocated. Valgrind cannot continue. Sorry. erlang@REDACTED:~/otp/bin$ erlang@REDACTED:~/otp/bin$ strace /home/erlang/otp/lib/erlang/erts-5.5/bin/erlexec ... open("/etc/localtime", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=56, ...}) = 0 fstat64(3, {st_mode=S_IFREG|0644, st_size=56, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40019000 read(3, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0"..., 4096) = 56 close(3) = 0 munmap(0x40019000, 4096) = 0 rt_sigaction(SIGINT, {0x8105970, [], SA_STACK}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGUSR1, {0x81059a0, [], SA_STACK}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGQUIT, {0x81059f0, [], SA_STACK}, {SIG_DFL}, 8) = 0 gettimeofday({1153397168, 556219}, NULL) = 0 times({tms_utime=0, tms_stime=0, tms_cutime=0, tms_cstime=0}) = 65006 pipe([3, 4]) = 0 fcntl64(3, F_GETFL) = 0 (flags O_RDONLY) fcntl64(3, F_SETFL, O_RDONLY|O_NONBLOCK) = 0 rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGCHLD, {0x8105c40, [], SA_STACK}, {SIG_DFL}, 8) = 0 rt_sigprocmask(SIG_BLOCK, [INT USR1 CHLD], [], 8) = 0 mmap2(NULL, 8388608, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x404fb000 mprotect(0x404fb000, 4096, PROT_NONE) = 0 clone(child_stack=0x40cfa4c4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED, parent_tidptr=0x40cfabf8, {entry_number:0, base_addr:0x40cfabb0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0x40cfabf8) = 1291 +++ killed by SIGSEGV +++ Process 1290 detached erlang@REDACTED:~$ erlc -h Usage: erlc [options] file.ext ... Options: -b type type of output file (e.g. jam or beam) -d turn on debugging of erlc itself erlang@REDACTED:~$ free total used free shared buffers cached Mem: 30188 15416 14772 0 1512 9004 -/+ buffers/cache: 4900 25288 Swap: 0 0 0 erlang@REDACTED:~$ uname -a Linux uml0 2.6.17.6 #1 Sun Jul 16 12:25:48 CEST 2006 i686 GNU/Linux erlang@REDACTED:~$ From erlang@REDACTED Thu Jul 20 14:11:03 2006 From: erlang@REDACTED (Inswitch Solutions) Date: Thu, 20 Jul 2006 09:11:03 -0300 Subject: multi-core processors and erlang References: Message-ID: <00ac01c6abf5$b2ea6200$4a00a8c0@Inswitch251> Hi Joe, In the link http://www.erlang.org/ml-archive/erlang-questions/200606/msg00187.html you wrote: "Sure I *could* speed things up with messy optimised code, but the code would be less beautiful, and more difficult to maintain." What kind of optimizations can be done, to the code mentioned there, to speed things up? regards, Eduardo Figoli ----- Original Message ----- From: "Joe Armstrong (TN/EAB)" To: "Only OpenSource" ; Sent: Thursday, July 20, 2006 6:15 AM Subject: RE: multi-core processors and erlang > > Absolutely - > > <> > > Yes Erlang runs happily on multi core processors - drop your Erlang > program onto a multi core > and it *will* go faster, exactly how much faster depends upon the > dependencies between you parallel > processes. If they are all independent and CPU bound you'll probably run > K * N > times faster on an N core CPU. Say 16 times on a Sun Niagara. > > << K depends upon the Erlang implementation, it's currently about 0.5, > were hoping for 0.75, > the current implementation strategy emphasis stability over speed ... > >> > > Turning a sequential program into a parallel program is also really > really easy, for > example, I changed a single map to pmap (pmap is a parallel map > function) > and the program went 7 times faster. > > Read > > http://www.erlang.org/ml-archive/erlang-questions/200606/msg00187.html > > > See also > > Multicore Erlang performance > > http://www.erlang-stuff.net/blog/ > > > /Joe > > > -----Original Message----- > > From: owner-erlang-questions@REDACTED > > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Only > > OpenSource > > Sent: den 20 juli 2006 10:52 > > To: erlang-questions@REDACTED > > Subject: multi-core processors and erlang > > > > hello > > > > Does erlang take benefit of multi-core processors which are > > now available in desktop machines ? > > > > erlang supports concurrency and can definitely benefit from > > native support from multi-core processors. > > > > Is it a correct assumption or am I just too sleepy ? > > > > -- > > oo@@oo > > > From yarivvv@REDACTED Thu Jul 20 15:20:22 2006 From: yarivvv@REDACTED (Yariv Sadan) Date: Thu, 20 Jul 2006 09:20:22 -0400 Subject: dets with Mnesia question Message-ID: <17244f480607200620m5e82c3dftaa1da6dd3b477fb6@mail.gmail.com> Hi, Currently, if you're using a dets table and the VM crashes, the dets table would have to be repaired next time it's opened. The repair process involves scanning through the whole table, which could take a while for long tables (it was mentioned in this list it could take half an hour for big tables, which is too long for some systems). When dets is used outside of Mnesia, this is really the only solution that makes sense AFAIK, because there's no information on the activity that took place during the crash. However, when dets is used within Mnesia, the Mnesia system knows exactly which records in the table are in a "dirty" state by looking at the transaction log, so maybe dets could use this information. My question is, would it be possible to shorten the repair time by modifing the dets startup procedure such that Mnesia could "inform" it of exactly which records need to be cleaned up and what their real values should be? I just want to know if it's possible before I seriously start looking at the source code to see if I can hack something... Best, Yariv From joe.armstrong@REDACTED Thu Jul 20 15:20:02 2006 From: joe.armstrong@REDACTED (Joe Armstrong (TN/EAB)) Date: Thu, 20 Jul 2006 15:20:02 +0200 Subject: multi-core processors and erlang In-Reply-To: <00ac01c6abf5$b2ea6200$4a00a8c0@Inswitch251> Message-ID: Well the code I was referring to was a wiki markup language -> Erlang rich text -> html transformation. Now this is written in a horrendously inefficient style - I think I take about five separate passes though the data to make the rich text, with some careful thought this program could be turned into a single pass nightmare that was more efficient and impossible to maintain. Most program optimisations take place in my head before the program ever gets written, I try to choose reasonable representations that are a balance between clarity, speed, and. Usually by concentrating on clarity, and a decent representation, speed will follow. When you actually get round to writing the stuff, I know when to use binaries, or lists or trees or ets tables etc - but it's very difficult to give rules for this - all ya need to do is spend twenty years writing thousands of modules and it gets pretty easy :-) What I liked about the example I posted (and the point of the article) was that the top level pseudo code for my problem was: foreach file in Dir do process(file) Given that the processing of the files, could de done simultaneously, the top level code became foreach file in Dir do IN PARALLEL process(file) This in practise meant replacing a single map, with a pmap and I had to write a (trivial) pmap function. Now we need some care in replacing maps with pmaps, so replacing map(fun(I) -> compile_file(I) end, L) with a pmap would be fine, but map(fun(I) -> 2*I end, L) would be silly since the effort in computing 2*I is less than the effort required to spawn #L processes and gather the results. /Joe > -----Original Message----- > From: Inswitch Solutions [mailto:erlang@REDACTED] > Sent: den 20 juli 2006 14:11 > To: Joe Armstrong (TN/EAB); Only OpenSource; > erlang-questions@REDACTED > Subject: Re: multi-core processors and erlang > > Hi Joe, > > In the link > http://www.erlang.org/ml-archive/erlang-questions/200606/msg00 > 187.html you > wrote: > "Sure I *could* speed things up with messy optimised code, > but the code would be less beautiful, and more difficult to maintain." > > What kind of optimizations can be done, to the code mentioned > there, to speed things up? > > > regards, Eduardo Figoli > > > > ----- Original Message ----- > From: "Joe Armstrong (TN/EAB)" > To: "Only OpenSource" ; > > Sent: Thursday, July 20, 2006 6:15 AM > Subject: RE: multi-core processors and erlang > > > > > > Absolutely - > > > > <> > > > > Yes Erlang runs happily on multi core processors - drop your Erlang > > program onto a multi core > > and it *will* go faster, exactly how much faster depends upon the > > dependencies between you parallel > > processes. If they are all independent and CPU bound you'll > probably run > > K * N > > times faster on an N core CPU. Say 16 times on a Sun Niagara. > > > > << K depends upon the Erlang implementation, it's currently > about 0.5, > > were hoping for 0.75, > > the current implementation strategy emphasis stability > over speed ... > > >> > > > > Turning a sequential program into a parallel program is also really > > really easy, for > > example, I changed a single map to pmap (pmap is a parallel map > > function) > > and the program went 7 times faster. > > > > Read > > > > > http://www.erlang.org/ml-archive/erlang-questions/200606/msg00187.html > > > > > > See also > > > > Multicore Erlang performance > > > > http://www.erlang-stuff.net/blog/ > > > > > > /Joe > > > > > -----Original Message----- > > > From: owner-erlang-questions@REDACTED > > > [mailto:owner-erlang-questions@REDACTED] On Behalf Of Only > > > OpenSource > > > Sent: den 20 juli 2006 10:52 > > > To: erlang-questions@REDACTED > > > Subject: multi-core processors and erlang > > > > > > hello > > > > > > Does erlang take benefit of multi-core processors which are > > > now available in desktop machines ? > > > > > > erlang supports concurrency and can definitely benefit from > > > native support from multi-core processors. > > > > > > Is it a correct assumption or am I just too sleepy ? > > > > > > -- > > > oo@@oo > > > > > > > > From jahakala@REDACTED Thu Jul 20 16:07:55 2006 From: jahakala@REDACTED (Jani Hakala) Date: Thu, 20 Jul 2006 17:07:55 +0300 Subject: erlang crashes in user mode linux In-Reply-To: (rage machine's message of "Thu, 20 Jul 2006 12:07:33 +0000") References: Message-ID: <8764hsv078.fsf@pingviini.kortex.jyu.fi> "rage machine" writes: > Hi > When running erlang in user mode linux I get segmentation fault. > erlang@REDACTED:~$ erl > Segmentation fault > Do you have libraries in /lib/tls? Does erl work if you rename /lib/tls? Jani Hakala From ulf.wiger@REDACTED Thu Jul 20 16:22:07 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Thu, 20 Jul 2006 16:22:07 +0200 Subject: mult-core race speeding up Message-ID: According to news.com, Intel intends to release its quad-core server and desktop processors in Q4 this year instead of next year. AMD will come out with its quad-core chips in mid-2007. This is good. The more cores, the better. (: /Ulf W From slasci@REDACTED Thu Jul 20 16:31:54 2006 From: slasci@REDACTED (rage machine) Date: Thu, 20 Jul 2006 14:31:54 +0000 Subject: erlang crashes in user mode linux In-Reply-To: <8764hsv078.fsf@pingviini.kortex.jyu.fi> Message-ID: >From: Jani Hakala >To: "rage machine" >CC: erlang-questions@REDACTED >Subject: Re: erlang crashes in user mode linux >Date: Thu, 20 Jul 2006 17:07:55 +0300 > >"rage machine" writes: > > > Hi > > When running erlang in user mode linux I get segmentation fault. > > erlang@REDACTED:~$ erl > > Segmentation fault > > >Do you have libraries in /lib/tls? Does erl work if you rename >/lib/tls? > >Jani Hakala That was the problem, it works after renaming. Thanks alot! From chris.double@REDACTED Thu Jul 20 16:54:43 2006 From: chris.double@REDACTED (Chris Double) Date: Fri, 21 Jul 2006 02:54:43 +1200 Subject: erlang crashes in user mode linux In-Reply-To: References: Message-ID: On 7/21/06, rage machine wrote: > When running erlang in user mode linux I get segmentation fault. I run Erlang and Yaws under UML and it's been working fine for months. Could it be something else in your setup? Chris. -- http://www.bluishcoder.co.nz From james.hague@REDACTED Thu Jul 20 16:57:58 2006 From: james.hague@REDACTED (James Hague) Date: Thu, 20 Jul 2006 09:57:58 -0500 Subject: Sometimes I miss destructively updating local variables Message-ID: Thanks for all the interesting replies to this. I gave them all some thought and continued to mull over the problem. What it comes down to for me is that Erlang/BEAM handles destructive updates extraordinarily well behind the scenes. Records and dicts are fine, but they bypass the beauty of the current system. Just list all variables in a function, and update them as needed in a tail call. I think lots of people don't realize that in a function like this: f(A,B,C,D,E,F,G,H,I,J) -> f(A,B,C,D,E,F+1,G,H,I,J); [...] essentially turns into this code: f: parameter(5) += 1 goto f What would be nice is to have a syntax similar to that of records, where one lists the changes to the parameter list. Let's say that "@" means "tail call," so in this example we'd have: f(A,B,C,D,E,F,G,H,I,J) -> @(F -> F + 1); Ignoring the syntactic details, I really like this. It's simple, clean, and leads to code that's very tight in terms of source and object code. It's also easy to write a short Perl script to take a function in the above format and expand the "@" syntax. (It's a little trickier than it needs to be, because parameters like [H|T] need to look like [H|T]=L, but this wouldn't be needed with native support.) From onlyopensource@REDACTED Thu Jul 20 17:46:32 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Thu, 20 Jul 2006 21:16:32 +0530 Subject: how to interpret these results ? Message-ID: Hello Here is a comparison of Erlang and C http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=hipe&lang2=gcc What is the recommended approach towards understanding the benchmark numbers ? For starter's do they even make any sense at all ? All observations and suggestions for a newbie will be greatly appreciated ! -- oo@@oo From francesco@REDACTED Thu Jul 20 17:45:12 2006 From: francesco@REDACTED (Francesco Cesarini) Date: Thu, 20 Jul 2006 16:45:12 +0100 Subject: Trapexit wants your user contributions! Message-ID: <44BFA508.3040100@erlang-consulting.com> Do you have an oracle driver lying around on your hard drive gathering dust? Or are still sitting on that 5 minute hack that might save someone else hours of work? Since relaunching trap exit, we added a section for user contributions. We put it in as a forum, where people can upload their own files, add links to sites where they have the source code, and possibly come with follow ups when updates are available. Looking at the traffic on trapexit this past week (200+ unique visitors / day), the user contributions section is the most visited part of the site after the forums. But it is empty!!!! When you get a second over, why not upload all your hacks, libraries and applications others might need? The URL is http://forum.trapexit.org/viewforum.php?f=20 Thanks, Francesco -- http://www.erlang-consulting.com From hp@REDACTED Thu Jul 20 19:23:23 2006 From: hp@REDACTED (HP Wei) Date: Thu, 20 Jul 2006 13:23:23 -0400 (EDT) Subject: is there /dev/null process in Erlang ? In-Reply-To: <95be1d3b0606270610q596930d6nc8b6ee483c20d014@mail.gmail.com> References: <001a01c699d5$7d9e06b0$1500a8c0@dobrosoft.local> <95be1d3b0606270610q596930d6nc8b6ee483c20d014@mail.gmail.com> Message-ID: I have a bunch of io:format(ios, "~p~n", [Data]). ... where ios is established by register(ios, Pid). and Pid is either Erlang's user process or {ok, Pid} = file:open("filename", write). ----------------------------- Question, is there a process in erlang that acts like a data sinker (receiving and doing nothing) ? [ so that I can direct format(ios...) to it. ] [ something like in unix, cat some_file > /dev/null. ] thanks hp From fritchie@REDACTED Thu Jul 20 20:02:33 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Thu, 20 Jul 2006 13:02:33 -0500 Subject: Mnesia overloaded In-Reply-To: Message of "Tue, 18 Jul 2006 17:33:51 +0200." <074F724A-6E7A-4A28-9703-EF9D32FDB11C@kth.se> Message-ID: <200607201802.k6KI2Xru009733@snookles.snookles.com> >>>>> "ma" == Magnus Ahltorp writes: ma> [...] but this just hangs and I get these messages: ma> Mnesia('incomingproxy@REDACTED'): ** WARNING ** Mnesia is ma> overloaded: {dump_log, time_threshold} I don't know about the "just hangs" part, but I believe that they are (mostly) harmless. Quoting Ulf Wiger from Message-ID on Tue, 9 May 2006 21:35:16 +0200: uw> The warning about mnesia being overloaded uw> mean that a dump of the transaction log uw> has been triggered before the previous uw> transaction log dump has been completed. uw> uw> That's ok. Mnesia can handle it, but it is uw> an indication that mnesia is temporarily uw> backlogged. I said "(mostly)" because I've encountered a situation where being backlogged for long periods of time can be A Bad Thing. If Mnesia is so busy that it cannot periodically truncate its transaction log, then that log file (the "LATEST.LOG" file in the Mnesia data directory, if I'm not mistaken) will continue to grow until all available disk space is consumed. I wrote a simple Erlang process that periodically checks how big that file is ... and if it gets too big, then it adds an artificial throttle: other parts of the application start calling timer:sleep/1. The resulting reduction of DB transactions gives Mnesia enough time to catch up. When the size of "LATEST.LOG" falls below the high water mark, the calls to timer:sleep/1 stop, and transaction processing resumes at full speed. -Scott From map@REDACTED Thu Jul 20 21:14:38 2006 From: map@REDACTED (Magnus Ahltorp) Date: Thu, 20 Jul 2006 21:14:38 +0200 Subject: Mnesia overloaded In-Reply-To: <200607201802.k6KI2Xru009733@snookles.snookles.com> References: <200607201802.k6KI2Xru009733@snookles.snookles.com> Message-ID: > I don't know about the "just hangs" part, but I believe that they are > (mostly) harmless. Quoting Ulf Wiger from Message-ID > > > on Tue, 9 May 2006 21:35:16 +0200: The system continues to work, so the only thing that "hangs" is the command line, the command never completes. I tried the command again, now with another table (call) to appserver@REDACTED I have now waited about 3 hours, and it still hasn't completed. My tables are quite small, and not very many writes are made, only a few per minute. Some info from my system, command still running: (adminwww@REDACTED)23> mnesia:info(). ---> Processes holding locks <--- Lock: {{schema,'______WHOLETABLE_____'},write,{tid, 105072102,<2135.4587.0>}} ---> Processes waiting for locks <--- ---> Participant transactions <--- Tid: 105072102 (owned by <2135.4587.0>) with participant objects {commit,'adminwww@REDACTED', {decision, {tid,105072102,<2135.4587.0>}, presume_abort, ['incomingproxy@REDACTED', 'incomingproxy@REDACTED'], ['adminwww@REDACTED', 'appserver@REDACTED', 'pstnproxy@REDACTED', 'appserver@REDACTED']}, [], [], [], [], [{op,add_table_copy, ram_copies, 'appserver@REDACTED', [{name,call}, {type,set}, {ram_copies, ['appserver@REDACTED', 'appserver@REDACTED']}, {disc_copies,[]}, {disc_only_copies,[]}, {load_order,0}, {access_mode,read_write}, {index,[]}, {snmp,[]}, {local_content,false}, {record_name,call}, {attributes, [callid,type,headers,data]}, {user_properties,[]}, {frag_properties,[]}, {cookie, {{1055,341655,841578}, 'appserver@REDACTED'}}, {version, {{6,0}, {'incomingproxy@REDACTED', {1153,411051,528844}}}}]}]} ---> Coordinator transactions <--- ---> Uncertain transactions <--- ---> Active tables <--- schema : with 8 records occupying 1249 words of mem login : with 3 records occupying 538 words of mem ===> System info in version "4.1.4", debug level = none <=== opt_disc. Directory "/nobackup/home/sipvxl/sip/ Mnesia.adminwww@REDACTED" is NOT used. use fallback at restart = false running db nodes = ['appserver@REDACTED','incomingproxy@REDACTED','pstnproxy@REDACTED',' appserver@REDACTED','incomingproxy@REDACTED','adminwww@REDACTED'] stopped db nodes = [] master node tables = [] remote = [call,forward,numbers,phone,regexproute,user] ram_copies = [login,schema] disc_copies = [] disc_only_copies = [] [{'adminwww@REDACTED',ram_copies}] = [login] [{'adminwww@REDACTED',ram_copies}, {'appserver@REDACTED',ram_copies}, {'appserver@REDACTED',ram_copies}, {'incomingproxy@REDACTED',disc_copies}, {'incomingproxy@REDACTED',disc_copies}, {'pstnproxy@REDACTED',ram_copies}] = [schema] [{'appserver@REDACTED',ram_copies}, {'appserver@REDACTED',ram_copies}] = [call] [{'incomingproxy@REDACTED',disc_copies}] = [regexproute, forward, numbers, user, phone] 209 transactions committed, 0 aborted, 3 restarted, 0 logged to disc 1 held locks, 0 in queue; 0 local transactions, 1 remote 0 transactions waits for other nodes: [] ok ls -l Mnesia.incomingproxy\@computer1 -rw-r--r-- 1 sipvxl default 233 Jul 20 17:56 DECISION_TAB.LOG -rw-r--r-- 1 sipvxl default 393369 Jul 20 21:04 LATEST.LOG -rw-r--r-- 1 sipvxl default 1605 Jul 17 09:35 forward.DCD -rw-r--r-- 1 sipvxl default 280 Dec 11 2003 forward.DCD.bak -rw-r--r-- 1 root bin 678 Mar 30 2004 forward.DCD.bak.040330 -rw-r--r-- 1 sipvxl default 105 Dec 15 2003 forward.DCD.bak2 -rw-r--r-- 1 sipvxl default 192 Jul 18 09:14 forward.DCL -rw-r--r-- 1 sipvxl default 163 Dec 15 2003 forward.DCL.bak -rw-r--r-- 1 sipvxl default 3911 Jun 9 15:41 numbers.DCD -rw-r--r-- 1 sipvxl default 453 Jul 14 14:50 numbers.DCL -rw-r--r-- 1 sipvxl default 8669 Jul 20 17:56 phone.DCD -rw-r--r-- 1 sipvxl default 6805 Dec 15 2003 phone.DCD.bak -rw-r--r-- 1 sipvxl default 225 Mar 22 20:44 regexproute.DCD -rw-r--r-- 1 sipvxl default 14453 Jul 20 17:54 schema.DAT -rw-r--r-- 1 sipvxl default 11921 Jun 29 13:20 user.DCD -rw-r--r-- 1 sipvxl default 1683 Jul 19 00:02 user.DCL ls -l Mnesia.incomingproxy\@computer2 -rw------- 1 yxa yxa 171 Jul 18 17:20 DECISION_TAB.LOG -rw------- 1 yxa yxa 3559 Jul 20 17:57 LATEST.LOG -rw------- 1 yxa yxa 13928 Jul 20 17:54 schema.DAT From ulf@REDACTED Thu Jul 20 23:27:04 2006 From: ulf@REDACTED (Ulf Wiger) Date: Thu, 20 Jul 2006 23:27:04 +0200 Subject: Mnesia overloaded In-Reply-To: References: <200607201802.k6KI2Xru009733@snookles.snookles.com> Message-ID: Den 2006-07-20 21:14:38 skrev Magnus Ahltorp : >> I don't know about the "just hangs" part, but I believe that they are >> (mostly) harmless. Quoting Ulf Wiger from Message-ID >> >> on Tue, 9 May 2006 21:35:16 +0200: > > The system continues to work, so the only thing that "hangs" is the > command line, the command never completes. Try starting Erlang with a thread pool, e.g. erl +A 128 In my experience, that can make a world of difference in cases like these. BR, Ulf W -- Ulf Wiger From ulf@REDACTED Thu Jul 20 23:40:54 2006 From: ulf@REDACTED (Ulf Wiger) Date: Thu, 20 Jul 2006 23:40:54 +0200 Subject: how to interpret these results ? In-Reply-To: References: Message-ID: Den 2006-07-20 17:46:32 skrev Only OpenSource : > Hello > > Here is a comparison of Erlang and C > http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=hipe&lang2=gcc > > What is the recommended approach towards understanding the benchmark > numbers ? > For starter's do they even make any sense at all ? > > All observations and suggestions for a newbie will be greatly > appreciated ! The thing to keep in mind is that performance in micro benchmarks like these say little about the performance in a more complex system. In real applications, Erlang tends to offer much better performance than these benchmarks seem to indicate. The only way to find out what's valid for your particular applications is to prototype and measure. Having said this, the benchmarks do indicate that for raw, low-level processing, C tends to leave Erlang in the dust. A worthwhile strategy can be to prototype the application in Erlang, then measure and identify bottlenecks. In some cases, rewriting a small part of the program in C can have a great impact on performance. An interesting point in this particular comparison is the concurrency benchmark. It shows that using Erlang for concurrency is far better than using C and stock Linux processes or threads. Not only is it much faster and more scalable - it is also far easier to program. A fairly common newbie mistake is to underestimate the amount of natural concurrency inherent in a typical application. Since most programming languages are pitifully bad at modeling concurrency, we get used to hiding the concurrency rather than emphasizing it as one of our most fundamental modeling techniques. BR, Ulf W -- Ulf Wiger From ryanobjc@REDACTED Fri Jul 21 04:31:43 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Thu, 20 Jul 2006 19:31:43 -0700 Subject: how to interpret these results ? In-Reply-To: References: Message-ID: <78568af10607201931y4d8e448fkdbb7d5b50b7a5ec1@mail.gmail.com> The missing reply-to field of this mailing list caused me to email this only to 'only': Apparently for hardcore numerical computations C is better. Most of those algorithms seem to be of that nature. The one where erlang did well was entitled 'cheap concurrency'. I think it's important to realize what Erlang is good at, and what it isnt as good at. The other thing is correctness - is it easier to write correct multi-process/threaded applications in erlang or C? I dont feel that Erlang is as wasteful as Java is however. 20-40 bytes overhead per object?! Of course I threw in that Java thing because I have and axe to grind. I did a project and I was not feeling like I got very good bang for my Java buck. I don't feel that way with Erlang - but I'm still early on in my project. -ryan On 7/20/06, Ulf Wiger wrote: > Den 2006-07-20 17:46:32 skrev Only OpenSource : > > > Hello > > > > Here is a comparison of Erlang and C > > http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=hipe&lang2=gcc > > > > What is the recommended approach towards understanding the benchmark > > numbers ? > > For starter's do they even make any sense at all ? > > > > All observations and suggestions for a newbie will be greatly > > appreciated ! > > The thing to keep in mind is that performance in micro benchmarks > like these say little about the performance in a more complex > system. In real applications, Erlang tends to offer much better > performance than these benchmarks seem to indicate. The only > way to find out what's valid for your particular applications > is to prototype and measure. > > Having said this, the benchmarks do indicate that for raw, > low-level processing, C tends to leave Erlang in the dust. > > A worthwhile strategy can be to prototype the application > in Erlang, then measure and identify bottlenecks. In some > cases, rewriting a small part of the program in C can have > a great impact on performance. > > An interesting point in this particular comparison is the > concurrency benchmark. It shows that using Erlang for > concurrency is far better than using C and stock Linux > processes or threads. Not only is it much faster and more > scalable - it is also far easier to program. > > A fairly common newbie mistake is to underestimate the > amount of natural concurrency inherent in a typical > application. Since most programming languages are pitifully > bad at modeling concurrency, we get used to hiding the > concurrency rather than emphasizing it as one of our most > fundamental modeling techniques. > > BR, > Ulf W > -- > Ulf Wiger > From onlyopensource@REDACTED Fri Jul 21 04:44:12 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Fri, 21 Jul 2006 08:14:12 +0530 Subject: how to interpret these results ? In-Reply-To: <78568af10607201931y4d8e448fkdbb7d5b50b7a5ec1@mail.gmail.com> References: <78568af10607201931y4d8e448fkdbb7d5b50b7a5ec1@mail.gmail.com> Message-ID: > I think it's important to realize what Erlang is good at, and what it > isnt as good at. The other thing is correctness - is it easier to > write correct multi-process/threaded applications in erlang or C? > Sincere thanks to all the members who responded to my query. I admire the confidence with which the experienced members write on this list while maintaining pragmatism. Truly open I must say ! Thank you all very much. I have downloaded Erlang and look forward to learning it daily. -- oo@@oo From onlyopensource@REDACTED Fri Jul 21 05:51:53 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Fri, 21 Jul 2006 09:21:53 +0530 Subject: compiling erlang src sans' java Message-ID: Hello Is there a way to compile the smallest core set of erlang without java ? autoconf itself fails on FreeBSD 6.1 if Java/JDK is not present. However, this may be a FreeBSD port specific issue. autoconf on Fedora Core 5 reports that jinterface will not be built, if Java/JDK is not present. What I am looking for is the requisite changes to be made to the main erlang conf scripts to disable java completely ? Are there any core features that are affected if Java support is not compiled in ? Thanks in advance. -- oo@@oo From rpettit@REDACTED Fri Jul 21 06:51:01 2006 From: rpettit@REDACTED (Rick Pettit) Date: Thu, 20 Jul 2006 23:51:01 -0500 Subject: compiling erlang src sans' java In-Reply-To: References: Message-ID: <20060721045101.GA3917@vailsys.com> On Fri, Jul 21, 2006 at 09:21:53AM +0530, Only OpenSource wrote: > Hello > > Is there a way to compile the smallest core set of erlang without java ? > > autoconf itself fails on FreeBSD 6.1 if Java/JDK is not present. > However, this may be a FreeBSD port specific issue. > > autoconf on Fedora Core 5 reports that jinterface will not be built, > if Java/JDK is not present. > > What I am looking for is the requisite changes to be made > to the main erlang conf scripts to disable java completely ? You can enable/disable features (like java support) when running the configure script (i.e. before running make). Running "./configure --help" should give more information on how to do that. > Are there any core features that are affected if Java support is > not compiled in ? Not that I am aware of. As far as I know the main difference is OtpErlang.jar will not be built, which has no impact unless you write java code which requires it. -Rick From matt@REDACTED Fri Jul 21 10:08:00 2006 From: matt@REDACTED (Matthew McDonnell) Date: Fri, 21 Jul 2006 09:08:00 +0100 (BST) Subject: compiling erlang src sans' java In-Reply-To: References: Message-ID: On Fri, 21 Jul 2006, Only OpenSource wrote: > Is there a way to compile the smallest core set of erlang without java ? > > autoconf itself fails on FreeBSD 6.1 if Java/JDK is not present. > However, this may be a FreeBSD port specific issue. > I think in this case it is probably a FreeBSD issue, had the same problem myself. If you look at /usr/ports/lang/erlang/Makefile you will see a few blocks of the form ".if !defined(WITHOUT_JAVA) " (or X11, ODBC etc) From memory I managed to compile the port without java by setting the WITHOUT_JAVA environment variable eg setenv WITHOUT_JAVA true Cheers, Matt Matt McDonnell Email: matt@REDACTED Web: http://www.matt-mcdonnell.com/ From trapexit.erlang-questions@REDACTED Fri Jul 21 10:43:42 2006 From: trapexit.erlang-questions@REDACTED (Trap Exit) Date: Fri, 21 Jul 2006 09:43:42 +0100 Subject: is there /dev/null process in Erlang ? References: Message-ID: <20060721084342.8D40D5A1E9@mail.erlangsystems.com> Have you thougth of using Macros, or is this output buffer something you would like to change in run-time? A macro solution could look like this: -define(debug_2_stdout, ok). -ifdef(debug_2_file).     -define(DBGOUT(String, Values), io:format(ios, String, Values)). -else.     -ifdef(debug_2_stdout).         -define(DBGOUT(String, Values), io:format(String, Values)).     -else.         -define(DBGOUT(String, Values), ok).     -endif. -endif. test() ->     ?DBGOUT("Test: ~pn", [data]). _________________________________________________________ Post sent from http://www.trapexit.org From tobez@REDACTED Fri Jul 21 10:49:10 2006 From: tobez@REDACTED (Anton Berezin) Date: Fri, 21 Jul 2006 10:49:10 +0200 Subject: compiling erlang src sans' java In-Reply-To: References: Message-ID: <20060721084910.GA46429@heechee.tobez.org> On Fri, Jul 21, 2006 at 09:08:00AM +0100, Matthew McDonnell wrote: > On Fri, 21 Jul 2006, Only OpenSource wrote: > > > Is there a way to compile the smallest core set of erlang without java ? > > > > autoconf itself fails on FreeBSD 6.1 if Java/JDK is not present. > > However, this may be a FreeBSD port specific issue. > > > I think in this case it is probably a FreeBSD issue, had the same problem > myself. If you look at /usr/ports/lang/erlang/Makefile you will see a few > blocks of the form ".if !defined(WITHOUT_JAVA) " (or X11, ODBC etc) > From memory I managed to compile the port without java by setting > the WITHOUT_JAVA environment variable eg setenv WITHOUT_JAVA true Alternatively, one can just use lang/erlang-lite port (no java, no X11, no ODBC). \Anton. -- An undefined problem has an infinite number of solutions. -- Robert A. Humphrey From trapexit.erlang-questions@REDACTED Fri Jul 21 11:03:14 2006 From: trapexit.erlang-questions@REDACTED (Trap Exit) Date: Fri, 21 Jul 2006 10:03:14 +0100 Subject: ESense 1.11 released References: Message-ID: <20060721090314.CA7AD5A1E9@mail.erlangsystems.com> tpatro at gmail.com wrote: Changes https://sourceforge.net/project/shownotes.php?group_id=139206&release_id=378365 (https://sourceforge.net/project/shownotes.php?group_id=139206&release_id=378365) (https://sourceforge.net/project/shownotes.php?group_id=139206&release_id=373190) Files https://sourceforge.net/projects/esense/ (https://sourceforge.net/projects/esense/) Homepage http:// esense.sourceforge.net/ (http://esense.sourceforge.net/) Post generated using Mail2Forum (http://m2f.sourceforge.net) (end of quote) Hi! I wonder if you or anybody else has tweaked Esense to work with xemacs. I have tried but failed. It would be super if anybody could tell me how to fix this. I really miss the intellisense functionallity in my xemacs. _________________________________________________________ Post sent from http://www.trapexit.org From oscar-erl@REDACTED Fri Jul 21 12:57:32 2006 From: oscar-erl@REDACTED (Oscar =?ISO-8859-1?Q?Hellstr=F6m?=) Date: Fri, 21 Jul 2006 11:57:32 +0100 Subject: Multithreaded drivers Message-ID: <1153479453.7334.24.camel@battlestar.oscarh.net> Hi, Are multithreaded drivers supported on any POSIX systems these days? Or rather, is it supported on Linux? Some of the docs say that it's only Windows and Solaris. Also, to be able to use driver_async() all communication with the port must be done using port_command/2 rather than port_control/3 or port_call/3, since the later expects a return value, am I right? Regards -- ?Oscar Hellstr?m, oscar@REDACTED web: personal.oscarh.net jid: oscar@REDACTED From tpatro@REDACTED Fri Jul 21 12:59:20 2006 From: tpatro@REDACTED (Tamas Patrovics) Date: Fri, 21 Jul 2006 12:59:20 +0200 Subject: ESense 1.11 released In-Reply-To: <20060721090314.CA7AD5A1E9@mail.erlangsystems.com> References: <20060721090314.CA7AD5A1E9@mail.erlangsystems.com> Message-ID: On 7/21/06, Trap Exit wrote: > > Hi! > > I wonder if you or anybody else has tweaked Esense to work with xemacs. I have tried but failed. It would be super if anybody could tell me how to fix this. I really miss the intellisense functionallity in my xemacs. Hi, It definitely works with XEmacs 21.4 (patch 10), since I've seen people using it. /Tamas From onlyopensource@REDACTED Fri Jul 21 13:12:12 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Fri, 21 Jul 2006 16:42:12 +0530 Subject: ESense 1.11 released In-Reply-To: <20060721090314.CA7AD5A1E9@mail.erlangsystems.com> References: <20060721090314.CA7AD5A1E9@mail.erlangsystems.com> Message-ID: On 7/21/06, Trap Exit wrote: > > > tpatro at gmail.com wrote: > Changes > https://sourceforge.net/project/shownotes.php?group_id=139206&release_id=378365 (https://sourceforge.net/project/shownotes.php?group_id=139206&release_id=378365) > (https://sourceforge.net/project/shownotes.php?group_id=139206&release_id=373190) > Files > https://sourceforge.net/projects/esense/ (https://sourceforge.net/projects/esense/) > > Homepage > http:// esense.sourceforge.net/ (http://esense.sourceforge.net/) > > Post generated using Mail2Forum (http://m2f.sourceforge.net) > (end of quote) > > > Hi! > > I wonder if you or anybody else has tweaked Esense to work with xemacs. I have tried but failed. It would be super if anybody could tell me how to fix this. I really miss the intellisense functionallity in my xemacs. > _________________________________________________________ > Post sent from http://www.trapexit.org > Is this functionality expected to work with emacs ? If yes, I can try it out. What was the intellisense functionality that you talk about ? -- oo@@oo From rlenglet@REDACTED Fri Jul 21 13:36:27 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Fri, 21 Jul 2006 20:36:27 +0900 Subject: Multithreaded drivers In-Reply-To: <1153479453.7334.24.camel@battlestar.oscarh.net> References: <1153479453.7334.24.camel@battlestar.oscarh.net> Message-ID: <200607212036.28158.rlenglet@users.forge.objectweb.org> Oscar Hellstr?m wrote: > Hi, > > Are multithreaded drivers supported on any POSIX systems these > days? Or rather, is it supported on Linux? Yes. It is supported on Linux. > Some of the docs > say that it's only Windows and Solaris. > > Also, to be able to use driver_async() all communication with > the port must be done using port_command/2 rather than > port_control/3 or port_call/3, since the later expects a > return value, am I right? You must return a value when using port_call/3, yes, but that does not prevent you from calling driver_async() anyway, how you want and when you want. Just return nil if you have nothing useful to return. nil is the smallest term, when encoded in the standard external format: it takes only one byte (after the version header byte, of course...). -- Romain LENGLET From thomasl_erlang@REDACTED Fri Jul 21 13:50:32 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 21 Jul 2006 04:50:32 -0700 (PDT) Subject: Trap Exit (was Re: is there /dev/null process in Erlang ?) In-Reply-To: <20060721084342.8D40D5A1E9@mail.erlangsystems.com> Message-ID: <20060721115032.41546.qmail@web38814.mail.mud.yahoo.com> --- Trap Exit wrote: ... Unless Trap Exit became self-aware with the latest upgrade, I think its maintainers should tinker a bit more with, say, setting the authors of mails properly :-) Here is a suggestion for how to make more people use, visit and contribute to trapexit, by the way: import the erlang docs into the wiki. I for one would love to be able to scrub away irritating bugs, omissions, etc. Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From ulf.wiger@REDACTED Fri Jul 21 14:05:21 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 21 Jul 2006 14:05:21 +0200 Subject: Trap Exit (was Re: is there /dev/null process in Erlang ?) In-Reply-To: <20060721115032.41546.qmail@web38814.mail.mud.yahoo.com> Message-ID: Joe is working on a erlang-docs-to-wiki project, but it won't be mediawiki. It will of course be something much better. ;-) BR, Ulf > -----Original Message----- > From: owner-erlang-questions@REDACTED > [mailto:owner-erlang-questions@REDACTED] On Behalf Of > Thomas Lindgren > Sent: den 21 juli 2006 13:51 > To: erlang-questions@REDACTED > Subject: Trap Exit (was Re: is there /dev/null process in Erlang ?) > > > > --- Trap Exit > > wrote: > ... > > Unless Trap Exit became self-aware with the latest upgrade, I > think its maintainers should tinker a bit more with, say, > setting the authors of mails properly > :-) > > Here is a suggestion for how to make more people use, visit > and contribute to trapexit, by the way: import the erlang > docs into the wiki. I for one would love to be able to scrub > away irritating bugs, omissions, etc. > > Best, > Thomas > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection > around http://mail.yahoo.com > From andreas@REDACTED Fri Jul 21 14:14:46 2006 From: andreas@REDACTED (andreas) Date: Fri, 21 Jul 2006 13:14:46 +0100 Subject: Trap Exit (was is there /dev/null process in Erlang ?) References: Message-ID: <20060721121446.A596F5A1E9@mail.erlangsystems.com> I'm intressted in doing AI, but I have not come so far that Trap Exit has become self-aware. I have now configured Mail2Forum to post to the mailing list with the registred users e-mail address insted of the trap exit. It would be nice if we could get all mebers of the mailing list to register at . :wink: By the way, I'm Andreas Hillqvist one of maintainers of Trap Exit. I will look in to how we could import the erlang docs into the wiki. Could be nice if it keept it updated with the online documentation. The questiuon, how do we keep "user input". Might use some sort of user comments like . Thomas Lindgren wrote: --- Trap Exit wrote: ... Unless Trap Exit became self-aware with the latest upgrade, I think its maintainers should tinker a bit more with, say, setting the authors of mails properly :-) Here is a suggestion for how to make more people use, visit and contribute to trapexit, by the way: import the erlang docs into the wiki. I for one would love to be able to scrub away irritating bugs, omissions, etc. Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Post recived from mailinglist (end of quote) _________________________________________________________ Post sent from http://www.trapexit.org From thomasl_erlang@REDACTED Fri Jul 21 15:19:52 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 21 Jul 2006 06:19:52 -0700 (PDT) Subject: Trap Exit (was Re: is there /dev/null process in Erlang ?) In-Reply-To: Message-ID: <20060721131952.87619.qmail@web38812.mail.mud.yahoo.com> --- "Ulf Wiger (TN/EAB)" wrote: > Joe is working on a erlang-docs-to-wiki project, but > it won't be > mediawiki. It will of course be something much > better. ;-) Kudos to him, though I honestly wouldn't mind using a solution that is globally available Right Now :-) And which is also hosted, and maintained, indefinitely of course. My sources (Jocke, that is, one of the original authors) tell me that the pre-publication format of the Erlang docs should be fairly straightforward to translate, by the way. If these sources were made available, Ericsson could reap the rewards of busy open sourcers working for free. Nice, huh? Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From james.hague@REDACTED Fri Jul 21 15:26:22 2006 From: james.hague@REDACTED (James Hague) Date: Fri, 21 Jul 2006 08:26:22 -0500 Subject: how to interpret these results ? In-Reply-To: <78568af10607201931y4d8e448fkdbb7d5b50b7a5ec1@mail.gmail.com> References: <78568af10607201931y4d8e448fkdbb7d5b50b7a5ec1@mail.gmail.com> Message-ID: On 7/20/06, Ryan Rawson wrote: > > Apparently for hardcore numerical computations C is better. Most of > those algorithms seem to be of that nature. The one where erlang did > well was entitled 'cheap concurrency'. Even so, Erlang often does surprisingy well for algorithms that are more than just doing lots of math on a large data set. Sometimes working symbolically with leads to higher-level optimizations. Garbage collection helps a lot. Ditto for having match expressions automatically compiled down to a minimum set of comparisons. You might like this article: http://www.dadgum.com/james/performance.html Personally, it's good to see Erlang beating Python and Ruby by quite a bit on many raw processing power benchmarks. Something else to consider is that it's easy to tweak many of these benchmarks to spawn processes for various computations, and then all of a sudden you're going to see massive speedups on multi-core machines. From james.hague@REDACTED Fri Jul 21 15:27:42 2006 From: james.hague@REDACTED (James Hague) Date: Fri, 21 Jul 2006 08:27:42 -0500 Subject: how to interpret these results ? In-Reply-To: References: <78568af10607201931y4d8e448fkdbb7d5b50b7a5ec1@mail.gmail.com> Message-ID: I wrote: > Even so, Erlang often does surprisingy well for algorithms that are > more than just doing lots of math on a large data set. Sometimes > working symbolically with leads to higher-level optimizations. I get a failing grade for proofreading. That should be "Sometimes working symbolically with data leads to..." From ulf.wiger@REDACTED Fri Jul 21 17:14:27 2006 From: ulf.wiger@REDACTED (Ulf Wiger (TN/EAB)) Date: Fri, 21 Jul 2006 17:14:27 +0200 Subject: Trap Exit (was Re: is there /dev/null process in Erlang ?) In-Reply-To: <20060721131952.87619.qmail@web38812.mail.mud.yahoo.com> Message-ID: Thomas Lindgren wrote: > > --- "Ulf Wiger (TN/EAB)" > wrote: > > > Joe is working on a erlang-docs-to-wiki project, but it won't be > > mediawiki. It will of course be something much better. ;-) > > Kudos to him, though I honestly wouldn't mind using a > solution that is globally available Right Now :-) And which > is also hosted, and maintained, indefinitely of course. Oh, you're too conservative. > My sources (Jocke, that is, one of the original > authors) tell me that the pre-publication format of the > Erlang docs should be fairly straightforward to translate, by > the way. If these sources were made available, Ericsson could > reap the rewards of busy open sourcers working for free. > Nice, huh? What's the fun in that??? (: Joe has a tool that transforms the OTP docs to wiki syntax. It would probably be possible to convert to another syntax than Joe's own (which has undergone a large number of iterations). Right now, Joe is on vacation, so you'll most likely have to be patient. Regardless of wiki syntax, part of the idea is indeed to activate lots of free labour on the Open Source side. BTW, the syntax is just one aspect. It's the whole package that's really interesting, and we'd like to see this evolve into a really good documentation tool for all erlang users - not just for the OTP docs. Please stay tuned. We think we have some really cool stuff that's just about(*) ready to roll. (*) just about = let me guess August or September time frame. /Ulf W From thomasl_erlang@REDACTED Fri Jul 21 18:58:18 2006 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 21 Jul 2006 09:58:18 -0700 (PDT) Subject: Trap Exit (was Re: is there /dev/null process in Erlang ?) In-Reply-To: Message-ID: <20060721165818.77444.qmail@web38815.mail.mud.yahoo.com> --- "Ulf Wiger (TN/EAB)" wrote: > /.../ > (*) just about = let me guess August or September > time frame. You know, though I'm sure we will all be astounded and delighted when this super-wiki materializes, you could as a backup option just publish the docs sources tomorrow morning and see what happens :-) Best, Thomas __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From tosvar@REDACTED Sat Jul 22 19:02:39 2006 From: tosvar@REDACTED (Clint Miller) Date: Sat, 22 Jul 2006 12:02:39 -0500 Subject: py_interface and extended pids and ports Message-ID: <84a01e000607221002j522dcc05g3cd62ee8d26d1b1e@mail.gmail.com> Hi there erlang gurus - I'm trying to reuse a python codebase that *I believe* is a good candidate to live it's next life as a set of erlang nodes. So, I was naturally drawn to py_interface. On running the tests I get =ERROR REPORT==== 22-Jul-2006::11:02:54 === ** enode1@REDACTED: Connection attempt to node py_interface_test@REDACTED aborted since it cannot handle extended pids and ports. ** The occurs with R10B-10 and R11B-0 on both linux and OSX. I've not tried any earlier versions. Googling erlang.org for this I find this conversation and accompanying totally untested patch. http://www.erlang.org/ml-archive/erlang-questions/200504/msg00012.html It says that the ports and pids extension occured in R10. The patch doesn't work (being totally untested and all...no surprise there) but the tests then do merely time out. So, I tried the +R flag to erl and viola! Works consistently with +R 9. Now, my questions are these: *) what do I lose or risk by using +R 9 throughout my erlang development? Do I give up feeatures/bugfixes/etc introduced in R10 and beyond? *) can someone point me to where I would look in the erlang codebase / docs to start implementing extended ports and pids in py_interface so that I don't have to live in a R9 world? (I bet I'm not the only person interested in this...) *) should I just give up and use the R9 distribution? *) is this a fool's errand? Thanks for your guidance -- Clint From serge@REDACTED Sat Jul 22 20:06:50 2006 From: serge@REDACTED (Serge Aleynikov) Date: Sat, 22 Jul 2006 14:06:50 -0400 Subject: Trap Exit (was Re: is there /dev/null process in Erlang ?) In-Reply-To: References: Message-ID: <44C2693A.4070709@hq.idt.net> Is this tool anyhow related to edoc? Would it be possible to use edoc's doclet engine to export documentation using edoc tags into a wiki format? Since I've seen quite a bit of code besides ours using edoc tags, I assume many people take advantage of it's ability to generate documentation. Serge Ulf Wiger (TN/EAB) wrote: > Thomas Lindgren wrote: > >>--- "Ulf Wiger (TN/EAB)" >>wrote: >> >> >>>Joe is working on a erlang-docs-to-wiki project, but it won't be >>>mediawiki. It will of course be something much better. ;-) >> >>Kudos to him, though I honestly wouldn't mind using a >>solution that is globally available Right Now :-) And which >>is also hosted, and maintained, indefinitely of course. > > > Oh, you're too conservative. > > > >>My sources (Jocke, that is, one of the original >>authors) tell me that the pre-publication format of the >>Erlang docs should be fairly straightforward to translate, by >>the way. If these sources were made available, Ericsson could >>reap the rewards of busy open sourcers working for free. >>Nice, huh? > > > What's the fun in that??? (: > > Joe has a tool that transforms the OTP docs to wiki syntax. > It would probably be possible to convert to another syntax > than Joe's own (which has undergone a large number of > iterations). Right now, Joe is on vacation, so you'll most > likely have to be patient. > > Regardless of wiki syntax, part of the idea is indeed to > activate lots of free labour on the Open Source side. > > BTW, the syntax is just one aspect. It's the whole package > that's really interesting, and we'd like to see this evolve > into a really good documentation tool for all erlang users > - not just for the OTP docs. Please stay tuned. We think we > have some really cool stuff that's just about(*) ready to roll. > > (*) just about = let me guess August or September time frame. > > /Ulf W > From ulf@REDACTED Sat Jul 22 20:40:03 2006 From: ulf@REDACTED (Ulf Wiger) Date: Sat, 22 Jul 2006 20:40:03 +0200 Subject: Trap Exit (was Re: is there /dev/null process in Erlang ?) In-Reply-To: <44C2693A.4070709@hq.idt.net> References: <44C2693A.4070709@hq.idt.net> Message-ID: Den 2006-07-22 20:06:50 skrev Serge Aleynikov : > Is this tool anyhow related to edoc? Would it be possible to use edoc's > doclet engine to export documentation using edoc tags into a wiki format? > > Since I've seen quite a bit of code besides ours using edoc tags, I > assume many people take advantage of it's ability to generate > documentation. > > Serge There are many aspects of the tool. One of them is certainly that it should be able to deal with edoc. We are also trying to address the problem of writing technical documentation in general, something that edoc doesn't address. BR, Ulf W -- Ulf Wiger From tosvar@REDACTED Mon Jul 24 16:50:28 2006 From: tosvar@REDACTED (Clint Miller) Date: Mon, 24 Jul 2006 09:50:28 -0500 Subject: py_interface and extended pids and ports In-Reply-To: <84a01e000607221002j522dcc05g3cd62ee8d26d1b1e@mail.gmail.com> References: <84a01e000607221002j522dcc05g3cd62ee8d26d1b1e@mail.gmail.com> Message-ID: <84a01e000607240750g5495ed28pbd883b96b4021b17@mail.gmail.com> Extended PIDs and PORTs are simply a change from 18 to 28 bits? Is that it? On 7/22/06, Clint Miller wrote: > Hi there erlang gurus - > > I'm trying to reuse a python codebase that *I believe* is a good > candidate to live it's next life as a set of erlang nodes. So, I was > naturally drawn to py_interface. On running the tests I get > > =ERROR REPORT==== 22-Jul-2006::11:02:54 === > ** enode1@REDACTED: Connection attempt to node > py_interface_test@REDACTED aborted since it cannot handle extended > pids and ports. ** > > The occurs with R10B-10 and R11B-0 on both linux and OSX. I've not > tried any earlier versions. > Googling erlang.org for this I find this conversation and accompanying > totally untested patch. > > http://www.erlang.org/ml-archive/erlang-questions/200504/msg00012.html > > It says that the ports and pids extension occured in R10. The patch > doesn't work (being totally untested and all...no surprise there) but > the tests then do merely time out. So, I tried the +R flag to erl > and viola! Works consistently with +R 9. > > Now, my questions are these: > > *) what do I lose or risk by using +R 9 throughout my erlang > development? Do I give up feeatures/bugfixes/etc introduced in R10 > and beyond? > *) can someone point me to where I would look in the erlang codebase / > docs to start implementing extended ports and pids in py_interface so > that I don't have to live in a R9 world? (I bet I'm not the only > person interested in this...) > *) should I just give up and use the R9 distribution? > *) is this a fool's errand? > > Thanks for your guidance > -- > Clint > -- Clint Miller -- "Never have so many known so little about so much" -- James Burke From goertzen@REDACTED Tue Jul 25 15:00:44 2006 From: goertzen@REDACTED (Daniel Goertzen) Date: Tue, 25 Jul 2006 08:00:44 -0500 Subject: startup on slow computer Message-ID: <44C615FC.40703@ertw.com> I've got Erlang running on a 100MHz 486 PC-104 module. It runs reasonably well, but it takes upward of 45 seconds to start erlang and mnesia, and there are many more apps to come. Are there any secrets to accelerating boot up time? Thanks, Dan. From oscar-erl@REDACTED Tue Jul 25 15:22:29 2006 From: oscar-erl@REDACTED (Oscar =?ISO-8859-1?Q?Hellstr=F6m?=) Date: Tue, 25 Jul 2006 14:22:29 +0100 Subject: Multithreaded drivers (agin) Message-ID: <1153833750.7334.49.camel@battlestar.oscarh.net> Hi, When using the driver_async (erl_driver(1)) it does not seem to use different threads even though different keys are used. Furthermore, it seems to choose a already blocked thread instead of a non-blocked one. As an example. One entity (#1) assign itself a resource, and starts using it. Another entity (#2) asks for the same resource, using the same, or another, thread. This thread is then blocked. Then the first entity (#1) tries to release the resource, but it happens to be queued in the blocked thread. By not passing it a key, "the threads from the pool are used in a round-robin way", but even with this behaviour, it seems one of the requests are being queued in a already busy thread. Regards -- ?Oscar Hellstr?m, oscar@REDACTED web: personal.oscarh.net jid: oscar@REDACTED From tomas.abrahamsson@REDACTED Tue Jul 25 16:44:46 2006 From: tomas.abrahamsson@REDACTED (Tomas Abrahamsson) Date: Tue, 25 Jul 2006 16:44:46 +0200 Subject: py_interface and extended pids and ports In-Reply-To: <84a01e000607221002j522dcc05g3cd62ee8d26d1b1e@mail.gmail.com> References: <84a01e000607221002j522dcc05g3cd62ee8d26d1b1e@mail.gmail.com> Message-ID: On 7/22/06, Clint Miller wrote: > Hi there erlang gurus - > > I'm trying to reuse a python codebase that *I believe* is a good > candidate to live it's next life as a set of erlang nodes. So, I was > naturally drawn to py_interface. On running the tests I get > > =ERROR REPORT==== 22-Jul-2006::11:02:54 === > ** enode1@REDACTED: Connection attempt to node > py_interface_test@REDACTED aborted since it cannot handle extended > pids and ports. ** Hi, try py_interface-0.93 from http://assar.dyndns.org/py_interface/py_interface-0.93.tar.gz (temporary site until the main site at http://www.lysator.liu.se/~tab/erlang/py_interface/ is up again). This version handles extended pids and ports and works with Erlang/OTP R10 as well as R11. /Tomas From fritchie@REDACTED Tue Jul 25 18:24:31 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Tue, 25 Jul 2006 11:24:31 -0500 Subject: Multithreaded drivers (agin) In-Reply-To: Message of "Tue, 25 Jul 2006 14:22:29 BST." <1153833750.7334.49.camel@battlestar.oscarh.net> Message-ID: <200607251624.k6PGOVrV078058@snookles.snookles.com> >>>>> "oh" == Oscar =?ISO-8859-1?Q?Hellstr=F6m?= writes: oh> By not passing it a key, "the threads from the pool are used in a oh> round-robin way", but even with this behaviour, it seems one of oh> the requests are being queued in a already busy thread. My knowledge about multi-threaded drivers may be slightly out-of-date, so I hope someone will correct me if I'm wrong. If you specify no key (for the round-robin behavior), I don't believe there's a guarantee that the round-robin will avoid worker pool threads that are already busy.(*) Sorry it's been a few years since I last looked at the stuff. Some debugging steps I'd suggest: 1. Does the execution behavior change if you increase the size of the worker thread pool (+A whatever)? 2. If you add a printf() (or whatever) to display the value of pthread_self(), as executed by a worker pool thread and not the VM's master/main/parent/whatever thread :-), are you always seeing the same thread ID? -Scott (*) It used to be that way. I dunno if R10-B or R11-B changed that bit of behavior. From tosvar@REDACTED Tue Jul 25 23:11:29 2006 From: tosvar@REDACTED (Clint Miller) Date: Tue, 25 Jul 2006 16:11:29 -0500 Subject: py_interface and extended pids and ports In-Reply-To: References: <84a01e000607221002j522dcc05g3cd62ee8d26d1b1e@mail.gmail.com> Message-ID: <84a01e000607251411q47682ff6p82ced784b1232ca0@mail.gmail.com> Tomas - Thanks very much! I'm anxious to look at 0.93 and see if my modifications were even close to right. My hack seems to work... but I'm sure I missed a lot. Thanks again. On 7/25/06, Tomas Abrahamsson wrote: > Hi, > > try py_interface-0.93 from > http://assar.dyndns.org/py_interface/py_interface-0.93.tar.gz > (temporary site until the main site at > http://www.lysator.liu.se/~tab/erlang/py_interface/ is up again). > > This version handles extended pids and ports and works with Erlang/OTP > R10 as well as R11. > > /Tomas > -- Clint Miller -- "Never have so many known so little about so much" -- James Burke From joelr1@REDACTED Wed Jul 26 00:22:54 2006 From: joelr1@REDACTED (Joel Reymont) Date: Tue, 25 Jul 2006 23:22:54 +0100 Subject: Latency and throughput Message-ID: <3D5BD063-E815-4C8E-90D5-50FBDBEC9442@gmail.com> Folks, Can you build low-latency network servers with Erlang? Has anyone done it? Doing it? I'm thinking of building an Order Management System (OMS) in Erlang for trade routing to exchanges. Very high performance and low latency are, of course, a requirement. My alternatives are OCaml and Ensemble [1]. OCaml is already proven in this area from what I know, i.e. can capture and store thousands of ticks/trades per second. From the Ensemble overview: "By moving to ML, we have made it possible to use formal verification tools to prove the correctness of critical Horus protocols and algorithms. The ML version of the system is also amenable to semi- automated protocol optimizations, which have slashed overhead and latency for heavily used protocols: latency is as low as 75us on ATM, and throughput as high as 80,000 multicasts per second." Please note the latency and throughput numbers in the last sentence above. Also from the Ensemble FAQ (general section): "Distributed communication in ML!?!? It must be slow.... Actually, it isn't. With specially optimized protocols, Ensemble can be around 10% slower than raw UDP socket communication. (The version distributed contains these protocols, but they are not used by default.) With these protocols in use, the performance of Ensemble is comparable to other group communication systems written in C -- and faster than most. The use of ML has helped us evolve the system so that in the normal case Ensemble costs very little." Thanks, Joel P.S. Yes, I know I will have to build on top of a cluster! [1] http://dsl.cs.technion.ac.il/projects/Ensemble/ -- http://wagerlabs.com/ From robert.virding@REDACTED Wed Jul 26 00:35:20 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 26 Jul 2006 00:35:20 +0200 Subject: Bug in statistics(runtime) on Windows XP? Message-ID: <44C69CA8.6050706@telia.com> I am running Erlang R11B-0, the pre-compiled distribution, on Windows XP. The figures I get doing erlang:statistics(runtime) are completely weird, they seem to have no relation with what the OS reports and what I expect. They are at about 1/8th of wall-clock time on an otherwise unloaded system. Is this a bug, or does runtime mean something different here, or what? Robert From robert.virding@REDACTED Wed Jul 26 00:39:51 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 26 Jul 2006 00:39:51 +0200 Subject: string literal in binary construction In-Reply-To: <3A1F7A36-BCEA-4F0D-AB04-554BAD43DB17@rogvall.com> References: <20060712174655.GA87220@frogman.motivity.ca> <200607130938.21494.rlenglet@users.forge.objectweb.org> <44B5FFC1.9000905@hyber.org> <3A1F7A36-BCEA-4F0D-AB04-554BAD43DB17@rogvall.com> Message-ID: <44C69DB7.1000609@telia.com> Tony Rogvall wrote: >> >> Hmmm >> >> <> >> > > Hmmm, what is a string ? ;-) > > String of what.... > > lets expand the context: > > String/utf-8 > > String/utf-16-big String/utf-16-little > > String/utf-32-big String/utf-32-little > > String/ascii > > String/iso-8859-1 > > And so on. > > ( I could survive with utf extensions ) > > > >> would certainly be useful (easy to implement too) > > > Should not totally kill any one to implement either ;-) Again I have two comments: 1. What does it mean? Is String a list of ... what? 32-bit Unicode codes? 8-bit characters in utf? Or what? And what is then put in the binary? 8-bit characters, 16-bit characters, or what? 2. The follow-up is of course what does it mean to use it in a match? The fun comes when you a binary of say utf-8 and match on it, do I get bytes or unicode codes? And why? I would prefer a set of conversion functions between strings (lists) of 32-bit unicode codes and binary representations of that string, for example: string_to_utf8, string_to_utf16, utf8_to_string etc. Or better yet put them in module string so we get: string:to_uf8, string:to_utf16, string:from_utf8, etc. From my point of thinking the meaning is much clearer and it feels less hardwired. It should be possible to put these conversion functions in a separate file and make it easy to add new conversions. Robert From robert.virding@REDACTED Wed Jul 26 00:46:45 2006 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 26 Jul 2006 00:46:45 +0200 Subject: string literal in binary construction In-Reply-To: <44C69E7D.9000507@telia.com> References: <20060712174655.GA87220@frogman.motivity.ca> <200607130938.21494.rlenglet@users.forge.objectweb.org> <44B5FFC1.9000905@hyber.org> <200607131718.21051.rlenglet@users.forge.objectweb.org> <44C69E7D.9000507@telia.com> Message-ID: <44C69F55.1050802@telia.com> Whoops! Sent this from my wife's account, should be from me of course. Robert Elisabeth Virding wrote: > Romain Lenglet wrote: > >>Claes Wikstrom wrote: >> >>>Romain Lenglet wrote: >>> >>>>Vance Shipley wrote: >>>> >>>>>1> <<"123">>. >>>>> >>>>This is syntactic sugar for <<$1, $2, $3>>. >>>> >>>>><<"123">> >>>>>2> String = "123". >>>>>"123" >>>>>3> <>. >>>>>** exited: {badarg,[{erl_eval,expr,3}]} ** >>>>> >>>>Use list_to_binary(String) instead. >>>> >>>Hmmm >>> >>><> >>> >>>would certainly be useful (easy to implement too) >>> >> >>Or even better: >> >>L = [1, 2, [<<"hello">>, 3] ], >><> >> > I am assuming you mean that L is an iolist and the binary should > contain the bytes in it. I have two comments: > > 1. I don't really see the point as you can use list_to_binary/1 instead. > > 2. What would it mean in a pattern where you are matching a binary? > Get back a binary? Or a random iolist containing he same bytes. It > would violate a fundamental invariant which is that if use a pattern > to build an object you can use the same pattern to pull the object > apart and get back the same objects. > > The same question holds for String/string. Would using it in a match > return a list of the bytes? > > Robert > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rlenglet@REDACTED Wed Jul 26 04:46:57 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Wed, 26 Jul 2006 11:46:57 +0900 Subject: string literal in binary construction In-Reply-To: <44C69F55.1050802@telia.com> References: <20060712174655.GA87220@frogman.motivity.ca> <44C69E7D.9000507@telia.com> <44C69F55.1050802@telia.com> Message-ID: <200607261146.57579.rlenglet@users.forge.objectweb.org> Robert Virding wrote: > >>L = [1, 2, [<<"hello">>, 3] ], > >><> > > > > I am assuming you mean that L is an iolist and the binary > > should contain the bytes in it. I have two comments: > > > > 1. I don't really see the point as you can use > > list_to_binary/1 instead. > > > > 2. What would it mean in a pattern where you are matching a > > binary? Get back a binary? Or a random iolist containing he > > same bytes. It would violate a fundamental invariant which > > is that if use a pattern to build an object you can use the > > same pattern to pull the object apart and get back the same > > objects. Actually, I asked myself the exact same questions, just seconds after posting my message. And I went to the same conclusion that this idea was dumb. ;-) -- Romain LENGLET From jeffm@REDACTED Wed Jul 26 11:34:14 2006 From: jeffm@REDACTED (jm) Date: Wed, 26 Jul 2006 19:34:14 +1000 Subject: simple proc_lib test example Message-ID: <1b70cce2c3dbca0b1c6ae89b5e07529d@ghostgun.com> Having some problems with the following program is simplified example based on something I'm trying to write, -module(test_proc). -export([go/0]). go() -> proc_lib:start_link(?MODULE, simple, [], infinity). simple() -> proc_lib:init_ack({ok, self()}), await(). await() -> receive after 1000 -> exit({ok, timeout}) end. $ erlc test_proc.erl ./test_proc.erl:21: Warning: function await/0 is unused ./test_proc.erl:21: Warning: function simple/0 is unused It doesn't look good at this stage. Why does it say unused? await/0 is call from simple and simple/0 from proc_lib:start_link. I can understand the latter though as it's call from proc_lib:start_link as a parameter. Ignoring this and continuing.... $ erl Erlang (BEAM) emulator version 5.4.8 [source] [hipe] Eshell V5.4.8 (abort with ^G) 1> test_proc:go(). ** exited: {undef,[{test_proc,simple,[]},{proc_lib,init_p,5}]} ** 2> and this where it hits a wall. Most likely it a simple beginner's error. Anyone to point out the glaringly obvious to me? Also, are the any good examples of code floating around? Jeff. From her@REDACTED Wed Jul 26 12:06:41 2006 From: her@REDACTED (Helmut Enck-Radana) Date: Wed, 26 Jul 2006 12:06:41 +0200 Subject: simple proc_lib test example In-Reply-To: <1b70cce2c3dbca0b1c6ae89b5e07529d@ghostgun.com> References: <1b70cce2c3dbca0b1c6ae89b5e07529d@ghostgun.com> Message-ID: <7.0.1.0.0.20060726115536.01acbb48@paradigma-software.de> At 11:34 2006-07-26, jm wrote: >-module(test_proc). > >-export([go/0]). > >go() -> > proc_lib:start_link(?MODULE, simple, [], infinity). > >simple() -> > proc_lib:init_ack({ok, self()}), > await(). > >await() -> > receive > after 1000 -> > exit({ok, timeout}) > end. > > >$ erlc test_proc.erl >./test_proc.erl:21: Warning: function await/0 is unused >./test_proc.erl:21: Warning: function simple/0 is unused > >It doesn't look good at this stage. Why does it say unused? await/0 >is call from simple and simple/0 from proc_lib:start_link. simple/0 is neither exported nor called by any used function in this module. So it is unused. >$ erl >Erlang (BEAM) emulator version 5.4.8 [source] [hipe] > >Eshell V5.4.8 (abort with ^G) >1> test_proc:go(). >** exited: {undef,[{test_proc,simple,[]},{proc_lib,init_p,5}]} ** Since simple/0 isn't exported, it isn't visible to functions which are not defined within your module. -- Helmut From rlenglet@REDACTED Wed Jul 26 12:11:36 2006 From: rlenglet@REDACTED (Romain Lenglet) Date: Wed, 26 Jul 2006 19:11:36 +0900 Subject: simple proc_lib test example In-Reply-To: <1b70cce2c3dbca0b1c6ae89b5e07529d@ghostgun.com> References: <1b70cce2c3dbca0b1c6ae89b5e07529d@ghostgun.com> Message-ID: <200607261911.36412.rlenglet@users.forge.objectweb.org> jm wrote: > Having some problems with the following program is simplified > example based on something I'm trying to write, > > -module(test_proc). > > -export([go/0]). > > go() -> > proc_lib:start_link(?MODULE, simple, [], infinity). > > simple() -> > proc_lib:init_ack({ok, self()}), > await(). > > await() -> > receive > after 1000 -> > exit({ok, timeout}) > end. > > > $ erlc test_proc.erl > ./test_proc.erl:21: Warning: function await/0 is unused > ./test_proc.erl:21: Warning: function simple/0 is unused > > It doesn't look good at this stage. Why does it say unused? > await/0 is call from simple and simple/0 from > proc_lib:start_link. I can understand the latter though as > it's call from proc_lib:start_link as a parameter. Ignoring > this and continuing.... > > $ erl > Erlang (BEAM) emulator version 5.4.8 [source] [hipe] > > Eshell V5.4.8 (abort with ^G) > 1> test_proc:go(). > ** exited: {undef,[{test_proc,simple,[]},{proc_lib,init_p,5}]} > ** 2> > > and this where it hits a wall. Most likely it a simple > beginner's error. Anyone to point out the glaringly obvious to > me? -export([simple/0]). This function must be exported since it is to be called from the proc_lib module. -- Romain LENGLET From launoja@REDACTED Wed Jul 26 12:16:50 2006 From: launoja@REDACTED (launoja@REDACTED) Date: Wed, 26 Jul 2006 13:16:50 +0300 Subject: Fwd: simple proc_lib test example Message-ID: Copy for the Erlang list... --- v?litett?v? viesti alkaa --- -------------- next part -------------- An embedded message was scrubbed... From: launoja@REDACTED Subject: Re: simple proc_lib test example Date: Wed, 26 Jul 2006 13:12:09 +0300 Size: 2004 URL: From w.a.de.jong@REDACTED Wed Jul 26 12:26:43 2006 From: w.a.de.jong@REDACTED (Willem de Jong) Date: Wed, 26 Jul 2006 12:26:43 +0200 Subject: simple proc_lib test example In-Reply-To: <1b70cce2c3dbca0b1c6ae89b5e07529d@ghostgun.com> References: <1b70cce2c3dbca0b1c6ae89b5e07529d@ghostgun.com> Message-ID: <407d9ef80607260326s69dadcc7u3343040c00904369@mail.gmail.com> Hi, You have to export simple(). (add a line "-export([simple/0]."). Regards, Willem On 7/26/06, jm wrote: > Having some problems with the following program is simplified example > based on something I'm trying to write, > > -module(test_proc). > > -export([go/0]). > > go() -> > proc_lib:start_link(?MODULE, simple, [], infinity). > > simple() -> > proc_lib:init_ack({ok, self()}), > await(). > > await() -> > receive > after 1000 -> > exit({ok, timeout}) > end. > > > $ erlc test_proc.erl > ./test_proc.erl:21: Warning: function await/0 is unused > ./test_proc.erl:21: Warning: function simple/0 is unused > > It doesn't look good at this stage. Why does it say unused? await/0 is > call from simple and simple/0 from proc_lib:start_link. I can > understand the latter though as it's call from proc_lib:start_link as a > parameter. Ignoring this and continuing.... > > $ erl > Erlang (BEAM) emulator version 5.4.8 [source] [hipe] > > Eshell V5.4.8 (abort with ^G) > 1> test_proc:go(). > ** exited: {undef,[{test_proc,simple,[]},{proc_lib,init_p,5}]} ** > 2> > > and this where it hits a wall. Most likely it a simple beginner's > error. Anyone to point out the glaringly obvious to me? > > Also, are the any good examples of code floating around? > > Jeff. > > From chandrashekhar.mullaparthi@REDACTED Wed Jul 26 12:27:04 2006 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Wed, 26 Jul 2006 11:27:04 +0100 Subject: simple proc_lib test example In-Reply-To: <1b70cce2c3dbca0b1c6ae89b5e07529d@ghostgun.com> References: <1b70cce2c3dbca0b1c6ae89b5e07529d@ghostgun.com> Message-ID: Hi, On 26/07/06, jm wrote: > > Having some problems with the following program is simplified example > based on something I'm trying to write, > > -module(test_proc). > > -export([go/0]). > > go() -> > proc_lib:start_link(?MODULE, simple, [], infinity). > > simple() -> > proc_lib:init_ack({ok, self()}), > await(). > > await() -> > receive > after 1000 -> > exit({ok, timeout}) > end. > > > $ erlc test_proc.erl > ./test_proc.erl:21: Warning: function await/0 is unused > ./test_proc.erl:21: Warning: function simple/0 is unused You have to export the simple/0 function for your proc_lib:start_link to work. Once you export that, these warnings will disappear and your example will work. Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseerlang@REDACTED Wed Jul 26 12:36:42 2006 From: joseerlang@REDACTED (jose) Date: Wed, 26 Jul 2006 12:36:42 +0200 Subject: simple proc_lib test example In-Reply-To: <1b70cce2c3dbca0b1c6ae89b5e07529d@ghostgun.com> References: <1b70cce2c3dbca0b1c6ae89b5e07529d@ghostgun.com> Message-ID: <44C745BA.5000809@gmail.com> jm escribi?: > Having some problems with the following program is simplified example > based on something I'm trying to write, > > -module(test_proc). > > -export([go/0]). > > go() -> > proc_lib:start_link(?MODULE, simple, [], infinity). > > simple() -> > proc_lib:init_ack({ok, self()}), > await(). > > await() -> > receive > after 1000 -> > exit({ok, timeout}) > end. > > > $ erlc test_proc.erl > ./test_proc.erl:21: Warning: function await/0 is unused > ./test_proc.erl:21: Warning: function simple/0 is unused > > It doesn't look good at this stage. Why does it say unused? await/0 is > call from simple and simple/0 from proc_lib:start_link. I can > understand the latter though as it's call from proc_lib:start_link as > a parameter. Ignoring this and continuing.... > > $ erl > Erlang (BEAM) emulator version 5.4.8 [source] [hipe] > > Eshell V5.4.8 (abort with ^G) > 1> test_proc:go(). > ** exited: {undef,[{test_proc,simple,[]},{proc_lib,init_p,5}]} ** > 2> > > and this where it hits a wall. Most likely it a simple beginner's > error. Anyone to point out the glaringly obvious to me? > > Also, are the any good examples of code floating around? > > Jeff. > > -module(test_proc). %% ;-) -export([go/0,simple/0]). go() -> proc_lib:start_link(?MODULE, simple, [], infinity). simple() -> proc_lib:init_ack({ok, self()}), await(). await() -> receive after 1000 -> exit({ok, timeout}) end. jgarcia@REDACTED:~$ erl Erlang (BEAM) emulator version 5.4.9 [source] [threads:0] Eshell V5.4.9 (abort with ^G) 1> c(test_proc). {ok,test_proc} 2> test_proc:go(). {ok,<0.38.0>} ** exited: {ok,timeout} ** 3> 3> halt(). From joseerlang@REDACTED Wed Jul 26 12:53:43 2006 From: joseerlang@REDACTED (jose) Date: Wed, 26 Jul 2006 12:53:43 +0200 Subject: Fwd: simple proc_lib test example In-Reply-To: References: Message-ID: <44C749B7.2060601@gmail.com> launoja@REDACTED escribi?: > Copy for the Erlang list... > > > --- v?litett?v? viesti alkaa --- > > ------------------------------------------------------------------------ > > Asunto: > Re: simple proc_lib test example > De: > launoja@REDACTED > Fecha: > Wed, 26 Jul 2006 13:12:09 +0300 > Para: > jm > > Para: > jm > > > You have to export the simple and await functions also. Otherwise > calls from proc_lib module can't access the functions. > > The compiler complains because of this. Simple cannot be called from > outside of module and ditto for await. > > On Wed, 26 Jul 2006 19:34:14 +1000 > jm wrote: >> Having some problems with the following program is simplified example >> based on something I'm trying to write, >> >> -module(test_proc). >> >> -export([go/0]). >> >> go() -> >> proc_lib:start_link(?MODULE, simple, [], infinity). >> >> simple() -> >> proc_lib:init_ack({ok, self()}), >> await(). >> >> await() -> >> receive >> after 1000 -> >> exit({ok, timeout}) >> end. >> >> >> $ erlc test_proc.erl >> ./test_proc.erl:21: Warning: function await/0 is unused >> ./test_proc.erl:21: Warning: function simple/0 is unused >> >> It doesn't look good at this stage. Why does it say unused? await/0 >> is call from simple and simple/0 from proc_lib:start_link. I can >> understand the latter though as it's call from proc_lib:start_link as >> a parameter. Ignoring this and continuing.... >> >> $ erl >> Erlang (BEAM) emulator version 5.4.8 [source] [hipe] >> >> Eshell V5.4.8 (abort with ^G) >> 1> test_proc:go(). >> ** exited: {undef,[{test_proc,simple,[]},{proc_lib,init_p,5}]} ** >> 2> >> >> and this where it hits a wall. Most likely it a simple beginner's >> error. Anyone to point out the glaringly obvious to me? >> >> Also, are the any good examples of code floating around? >> >> Jeff. >> > await functions also? I think not necessary . Salu2 ;-) From launoja@REDACTED Wed Jul 26 13:16:49 2006 From: launoja@REDACTED (launoja@REDACTED) Date: Wed, 26 Jul 2006 14:16:49 +0300 Subject: simple proc_lib test example In-Reply-To: <44C749B7.2060601@gmail.com> References: <44C749B7.2060601@gmail.com> Message-ID: On Wed, 26 Jul 2006 12:53:43 +0200 jose wrote: > launoja@REDACTED escribi?: [cut] >> > await functions also? I think not necessary . Well, I was bit hasty. You're right: it really is not necessary to export await. > Salu2 ;-) > From onlyopensource@REDACTED Thu Jul 27 07:06:42 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Thu, 27 Jul 2006 10:36:42 +0530 Subject: can erlang code talk directly with device driver ? Message-ID: Hello Is there a tutorial / article / howto for - how to write erlang module that can talk directly with device driver ? -- oo@@oo From ryanobjc@REDACTED Thu Jul 27 07:37:58 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Wed, 26 Jul 2006 22:37:58 -0700 Subject: can erlang code talk directly with device driver ? In-Reply-To: References: Message-ID: <78568af10607262237x15a31bao7c826fbed513d522@mail.gmail.com> Just write a erlang port or library. See EDTK. Also, what exactly is "device driver" - ? -ryan On 7/26/06, Only OpenSource wrote: > Hello > > Is there a tutorial / article / howto for - > how to write erlang module that can talk directly with device driver ? > > -- > oo@@oo > From bjorn@REDACTED Thu Jul 27 10:08:59 2006 From: bjorn@REDACTED (Bjorn Gustavsson) Date: 27 Jul 2006 10:08:59 +0200 Subject: R11B-0 ddll_server child specification question In-Reply-To: <86f1f5350607160405g62f81cd3mf7374254dd9dba29@mail.gmail.com> References: <86f1f5350607160405g62f81cd3mf7374254dd9dba29@mail.gmail.com> Message-ID: It is a bug that will be corrected in R11B-1. /Bjorn "Stephen Han" writes: > Hi. > > I looked at the kernel.erl of R11B-0 and find out that in line number 129 > and 143, we have ddll_server child specification defined twice. > Of course that the latter one really controlled by the kernel application > environment variable 'start_ddll" but isn't that potentially can bring up > and trying to register two ddll_server at the same time if the 'start_ddll" > environment variable is 'true', though? > > Why do we have ErlDdll and Ddll specifications in R11B-0? > > regards, -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From onlyopensource@REDACTED Thu Jul 27 12:36:01 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Thu, 27 Jul 2006 16:06:01 +0530 Subject: can erlang code talk directly with device driver ? In-Reply-To: <78568af10607262237x15a31bao7c826fbed513d522@mail.gmail.com> References: <78568af10607262237x15a31bao7c826fbed513d522@mail.gmail.com> Message-ID: On 7/27/06, Ryan Rawson wrote: > Just write a erlang port or library. See EDTK. > Thanks Ryan. I downloaded the paper list on the snookles.com site However, I am looking for an example, wherein erlang program works with - Network Device driver - USB Device driver I am also keen to figure out how the 'single-assignment' issue mentioned in the paper has been handled. -- oo@@oo From onlyopensource@REDACTED Thu Jul 27 12:37:19 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Thu, 27 Jul 2006 16:07:19 +0530 Subject: can erlang code talk directly with device driver ? In-Reply-To: <78568af10607262237x15a31bao7c826fbed513d522@mail.gmail.com> References: <78568af10607262237x15a31bao7c826fbed513d522@mail.gmail.com> Message-ID: On 7/27/06, Ryan Rawson wrote: > Just write a erlang port or library. See EDTK. > > Also, what exactly is "device driver" - ? > A device driver is a program that talks to a device eg. network card, USB device Let me know if this helps. -- oo@@oo From javierparis@REDACTED Thu Jul 27 13:14:03 2006 From: javierparis@REDACTED (Javier =?utf-8?q?Par=C3=ADs?=) Date: Thu, 27 Jul 2006 13:14:03 +0200 Subject: can erlang code talk directly with device driver ? In-Reply-To: References: <78568af10607262237x15a31bao7c826fbed513d522@mail.gmail.com> Message-ID: <200607271314.04041.javierparis@udc.es> El Jueves, 27 de Julio de 2006 12:36, Only OpenSource escribi?: > On 7/27/06, Ryan Rawson wrote: > > Just write a erlang port or library. See EDTK. > > Thanks Ryan. > > I downloaded the paper list on the snookles.com site > > However, I am looking for an example, wherein erlang program works with > - Network Device driver > - USB Device driver You mean ioctls? You would do that, as Ryan said, using a port. There is a nice tutorial on how to do that on the web. In the network device case, if wou are only going to use a socket, there is already a library for that: look for gen_tcp and gen_udp. Regards. From onlyopensource@REDACTED Thu Jul 27 14:03:15 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Thu, 27 Jul 2006 17:33:15 +0530 Subject: can erlang code talk directly with device driver ? In-Reply-To: <200607271314.04041.javierparis@udc.es> References: <78568af10607262237x15a31bao7c826fbed513d522@mail.gmail.com> <200607271314.04041.javierparis@udc.es> Message-ID: On 7/27/06, Javier Par?s wrote: > El Jueves, 27 de Julio de 2006 12:36, Only OpenSource escribi?: > > On 7/27/06, Ryan Rawson wrote: > > > Just write a erlang port or library. See EDTK. > > > > Thanks Ryan. > > > > I downloaded the paper list on the snookles.com site > > > > However, I am looking for an example, wherein erlang program works with > > - Network Device driver > > - USB Device driver > > You mean ioctls? You would do that, as Ryan said, using a port. There is a > nice tutorial on how to do that on the web. In the network device case, if > wou are only going to use a socket, there is already a library for that: look > for gen_tcp and gen_udp. > > Regards. > Yes IOCTLS or something similar to that. As an illustration iptables on Linux implemented in erlang ! Could you point out the url of the nice tutorial ? For network device, I donot intend to use a socket ! What are the options available from an Erlang perspective ? I am also keen to do a Erlang prototype for a Wireless USB device driver. Like to hear about what the erlang community has thought about this ! In case I want to explore DMA in the erlang code, how do I do that ? Thanks in advance for any pointers. -- oo@@oo From serge@REDACTED Thu Jul 27 15:23:18 2006 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 27 Jul 2006 09:23:18 -0400 Subject: SMP and kernel poll Message-ID: <44C8BE46.9000808@hq.idt.net> In the R11B-0 release you can either start a node with SMP support or have kernel poll, but not both. I suppose that the kernel poll feature isn't compatible yet with the SMP support. Is this something that will be available soon? $ erl +K true Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] [kernel-poll:true] Eshell V5.5 (abort with ^G) 1> q(). ok $ erl +K true -smp kernel-poll not supported; "K" parameter ignored Erlang (BEAM) emulator version 5.5 [source] [smp:2] [async-threads:0] [hipe] Eshell V5.5 (abort with ^G) 1> Serge From goertzen@REDACTED Thu Jul 27 15:20:32 2006 From: goertzen@REDACTED (Daniel Goertzen) Date: Thu, 27 Jul 2006 08:20:32 -0500 Subject: can erlang code talk directly with device driver ? In-Reply-To: References: <78568af10607262237x15a31bao7c826fbed513d522@mail.gmail.com> <200607271314.04041.javierparis@udc.es> Message-ID: <44C8BDA0.9020406@ertw.com> Only OpenSource wrote: > On 7/27/06, Javier Par?s wrote: >> El Jueves, 27 de Julio de 2006 12:36, Only OpenSource escribi?: >> > On 7/27/06, Ryan Rawson wrote: >> > > Just write a erlang port or library. See EDTK. >> > >> > Thanks Ryan. >> > >> > I downloaded the paper list on the snookles.com site >> > >> > However, I am looking for an example, wherein erlang program works >> with >> > - Network Device driver >> > - USB Device driver >> >> You mean ioctls? You would do that, as Ryan said, using a port. There >> is a >> nice tutorial on how to do that on the web. In the network device >> case, if >> wou are only going to use a socket, there is already a library for >> that: look >> for gen_tcp and gen_udp. >> >> Regards. >> > > Yes IOCTLS or something similar to that. > As an illustration iptables on Linux implemented in erlang ! > Could you point out the url of the nice tutorial ? > > For network device, I donot intend to use a socket ! > What are the options available from an Erlang perspective ? > > I am also keen to do a Erlang prototype for a Wireless USB device driver. > Like to hear about what the erlang community has thought about this ! > > In case I want to explore DMA in the erlang code, how do I do that ? > > Thanks in advance for any pointers. > If you want to solve the problem with Erlang, you need to think of it terms of message streams. You'll need some way to get USB messages to an from the USB device. I'm not that familiar in this area, but there must be some userland or kernel debugger that will give you access to a USB stream, perhaps as an erlang port or perhaps through direct file io with a device node. On the other end of this you need some way to stream ethernet packets to and from a network interface. The linux tap driver is what you want for this: it provides a device node on one end and network interface on the other. Once you've figured out all that, you can write your elrang program that converts USB packets to ethernet frames and vice versa. I would think DMA would happen at the USB subsystem level, so I doubt you need to think about that. Cheers, Dan. From onlyopensource@REDACTED Thu Jul 27 16:01:33 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Thu, 27 Jul 2006 19:31:33 +0530 Subject: can erlang code talk directly with device driver ? In-Reply-To: <44C8BDA0.9020406@ertw.com> References: <78568af10607262237x15a31bao7c826fbed513d522@mail.gmail.com> <200607271314.04041.javierparis@udc.es> <44C8BDA0.9020406@ertw.com> Message-ID: On 7/27/06, Daniel Goertzen wrote: > Only OpenSource wrote: > > On 7/27/06, Javier Par?s wrote: > >> El Jueves, 27 de Julio de 2006 12:36, Only OpenSource escribi?: > >> > On 7/27/06, Ryan Rawson wrote: > >> > > Just write a erlang port or library. See EDTK. > >> > > >> > Thanks Ryan. > >> > > >> > I downloaded the paper list on the snookles.com site > >> > > >> > However, I am looking for an example, wherein erlang program works > >> with > >> > - Network Device driver > >> > - USB Device driver > >> > >> You mean ioctls? You would do that, as Ryan said, using a port. There > >> is a > >> nice tutorial on how to do that on the web. In the network device > >> case, if > >> wou are only going to use a socket, there is already a library for > >> that: look > >> for gen_tcp and gen_udp. > >> > >> Regards. > >> > > > > Yes IOCTLS or something similar to that. > > As an illustration iptables on Linux implemented in erlang ! > > Could you point out the url of the nice tutorial ? > > > > For network device, I donot intend to use a socket ! > > What are the options available from an Erlang perspective ? > > > > I am also keen to do a Erlang prototype for a Wireless USB device driver. > > Like to hear about what the erlang community has thought about this ! > > > > In case I want to explore DMA in the erlang code, how do I do that ? > > > > Thanks in advance for any pointers. > > > If you want to solve the problem with Erlang, you need to think of it > terms of message streams. You'll need some way to get USB messages to > an from the USB device. I'm not that familiar in this area, but there > must be some userland or kernel debugger that will give you access to a > USB stream, perhaps as an erlang port or perhaps through direct file io > with a device node. Dan, thanks for your reply. Do I necessarily need to construct the program in such a way that the two modules communicate with each other using messages ? As an illustration, the typical model in C would be to define a structure. Write a bunch of functions that would work on the struct. Next come in the attach, detach, init, fini functions. If it's a driver ctl, then I would define a bunch of IOCTLS > On the other end of this you need some way to > stream ethernet packets to and from a network interface. > > I would think DMA would happen at the USB subsystem level, so I doubt > you need to think about that. > > Cheers, > Dan. > The scenario that I am trying to visualize is this (I may be wrong) - Erlang runs on top of a virtual machine. Within erlang runtime env, there is no kernel or userland demarcation. If I can implement a good enough boot-loader, ELF loader and some process start code (not same as RTOS), then I have a good enough substrate on which erlang can be hosted. May be I just do a single 1 Gb memory allocation (lets say i have 1Gb RAM) and mmap the erlang into this single address space. All the segments are fused into a single address space (no need for multiple segments). In this scenario soft real-time capabilities are available in erlang (OS like behaviours) and the various process hierarchy is similar to the UNIX process groups etc. Now, the only part that remains is the device drivers - in particular for USB (boot device) and NIC (networking device) For USB I use a extent based fs which maintains the erlang runtime file. I am not sure if this has been attempted before. However, I am interested in accomplishing this (no OS and no VxWorks)! Does it make sense ? -- oo@@oo From christophe.romain@REDACTED Thu Jul 27 16:17:01 2006 From: christophe.romain@REDACTED (Christophe Romain) Date: Thu, 27 Jul 2006 16:17:01 +0200 Subject: SMP and kernel poll In-Reply-To: <44C8BE46.9000808@hq.idt.net> References: <44C8BE46.9000808@hq.idt.net> Message-ID: <21f87d40fd409eac1d2bf844afa4a432@process-one.net> I tryed to patch erts/emulator/sys/unix/sys.c without any success. I always got file descriptors mess while calling devpoll_update_pix (get a fstat error). this module needs a rewrite and in the current state does not seems to allow kernel poll and smp. I rewrote a little bit this module to make it more readable (suppress some #ifdef, using function pointers) and got the same error. From luna@REDACTED Thu Jul 27 17:06:59 2006 From: luna@REDACTED (Daniel Luna) Date: Thu, 27 Jul 2006 17:06:59 +0200 (CEST) Subject: shell rr/1 problem in R11B-0 In-Reply-To: <200606141035.20923.ft@it.su.se> References: <200606141035.20923.ft@it.su.se> Message-ID: On Wed, 14 Jun 2006, Fredrik Thulin wrote: > but with R11B-0, it gives me an error that seems to be incorrect : > > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] > > Eshell V5.5 (abort with ^G) > 1> > rr("/pkg/erlang/R11B-0/lib/erlang/lib/xmerl-1.0.5/include/xmerl.hrl"). > ** exited: "record xmlNamespace undefined" ** > 2> > > the record xmlNamespace _is_ defined before it's first use. Bj?rn or someone: Will this rr thingie be fixed in R11B-1? Sort of a showstopper for upgrading our test (and later live) environment to R11. And it would be nice to be able to run the (new and improved) dialyzer on the same system as the rest of our tests. /Luna, who is currently wearing his Kreditor hat but is to lazy to subscribe the luna (at) kreditor.se address... -- 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 nick@REDACTED Thu Jul 27 17:31:08 2006 From: nick@REDACTED (Niclas Eklund) Date: Thu, 27 Jul 2006 17:31:08 +0200 (MEST) Subject: shell rr/1 problem in R11B-0 In-Reply-To: Message-ID: Hello! See http://www.erlang.org/ml-archive/erlang-bugs/200606/msg00002.html /Nick On Thu, 27 Jul 2006, Daniel Luna wrote: > On Wed, 14 Jun 2006, Fredrik Thulin wrote: > > but with R11B-0, it gives me an error that seems to be incorrect : > > > > Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] > > > > Eshell V5.5 (abort with ^G) > > 1> > > rr("/pkg/erlang/R11B-0/lib/erlang/lib/xmerl-1.0.5/include/xmerl.hrl"). > > ** exited: "record xmlNamespace undefined" ** > > 2> > > > > the record xmlNamespace _is_ defined before it's first use. > > Bj?rn or someone: > > Will this rr thingie be fixed in R11B-1? > > > Sort of a showstopper for upgrading our test (and later live) environment > to R11. And it would be nice to be able to run the (new and improved) > dialyzer on the same system as the rest of our tests. > > /Luna, who is currently wearing his Kreditor hat but is to lazy to > subscribe the luna (at) kreditor.se address... > -- > 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 bhaber@REDACTED Thu Jul 27 19:19:47 2006 From: bhaber@REDACTED (Haber, Bryan) Date: Thu, 27 Jul 2006 10:19:47 -0700 Subject: can erlang code talk directly with device driver ? Message-ID: So unless I miss my guess, you're trying to build an OS that's based off erlang. My suggestion would be to port the vm directly, or write your own. The vm, most likely, requires more then a simple elf loader to run. Its a full fledged binary that would require the support of a complete OS. -- bryan -----Original Message----- From: owner-erlang-questions@REDACTED To: erlang-questions@REDACTED Sent: Thu Jul 27 07:01:33 2006 Subject: Re: can erlang code talk directly with device driver ? On 7/27/06, Daniel Goertzen wrote: > Only OpenSource wrote: > > On 7/27/06, Javier Par?s wrote: > >> El Jueves, 27 de Julio de 2006 12:36, Only OpenSource escribi?: > >> > On 7/27/06, Ryan Rawson wrote: > >> > > Just write a erlang port or library. See EDTK. > >> > > >> > Thanks Ryan. > >> > > >> > I downloaded the paper list on the snookles.com site > >> > > >> > However, I am looking for an example, wherein erlang program works > >> with > >> > - Network Device driver > >> > - USB Device driver > >> > >> You mean ioctls? You would do that, as Ryan said, using a port. There > >> is a > >> nice tutorial on how to do that on the web. In the network device > >> case, if > >> wou are only going to use a socket, there is already a library for > >> that: look > >> for gen_tcp and gen_udp. > >> > >> Regards. > >> > > > > Yes IOCTLS or something similar to that. > > As an illustration iptables on Linux implemented in erlang ! > > Could you point out the url of the nice tutorial ? > > > > For network device, I donot intend to use a socket ! > > What are the options available from an Erlang perspective ? > > > > I am also keen to do a Erlang prototype for a Wireless USB device driver. > > Like to hear about what the erlang community has thought about this ! > > > > In case I want to explore DMA in the erlang code, how do I do that ? > > > > Thanks in advance for any pointers. > > > If you want to solve the problem with Erlang, you need to think of it > terms of message streams. You'll need some way to get USB messages to > an from the USB device. I'm not that familiar in this area, but there > must be some userland or kernel debugger that will give you access to a > USB stream, perhaps as an erlang port or perhaps through direct file io > with a device node. Dan, thanks for your reply. Do I necessarily need to construct the program in such a way that the two modules communicate with each other using messages ? As an illustration, the typical model in C would be to define a structure. Write a bunch of functions that would work on the struct. Next come in the attach, detach, init, fini functions. If it's a driver ctl, then I would define a bunch of IOCTLS > On the other end of this you need some way to > stream ethernet packets to and from a network interface. > > I would think DMA would happen at the USB subsystem level, so I doubt > you need to think about that. > > Cheers, > Dan. > The scenario that I am trying to visualize is this (I may be wrong) - Erlang runs on top of a virtual machine. Within erlang runtime env, there is no kernel or userland demarcation. If I can implement a good enough boot-loader, ELF loader and some process start code (not same as RTOS), then I have a good enough substrate on which erlang can be hosted. May be I just do a single 1 Gb memory allocation (lets say i have 1Gb RAM) and mmap the erlang into this single address space. All the segments are fused into a single address space (no need for multiple segments). In this scenario soft real-time capabilities are available in erlang (OS like behaviours) and the various process hierarchy is similar to the UNIX process groups etc. Now, the only part that remains is the device drivers - in particular for USB (boot device) and NIC (networking device) For USB I use a extent based fs which maintains the erlang runtime file. I am not sure if this has been attempted before. However, I am interested in accomplishing this (no OS and no VxWorks)! Does it make sense ? -- oo@@oo -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Fri Jul 28 14:08:06 2006 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 28 Jul 2006 08:08:06 -0400 Subject: release_handler In-Reply-To: <44C9CE02.5050609@erix.ericsson.se> References: <449AA113.600@hq.idt.net> <449FED0B.8060208@erix.ericsson.se> <449FF995.10404@hq.idt.net> <44C9CE02.5050609@erix.ericsson.se> Message-ID: <44C9FE26.1050806@hq.idt.net> Gunilla, Thank you for looking into this. I guess it was a misuse of this functionality on my part. Initially I tried this code in order to reload configuration in a running node: reload_config() -> case init:get_argument(config) of {ok, [ Files ]} -> ConfFiles = [begin S = filename:basename(F,".config"), filename:join(filename:dirname(F), S ++ ".config") end || F <- Files], % Move sys.config to the head of the list Config = lists:sort(fun("sys.config", _) -> true; (_, _) -> false end, ConfFiles), OldEnv = application_controller:prep_config_change(), Apps = [{application, A, element(2,application:get_all_key(A))} || {A,_,_} <- application:which_applications()], application_controller:change_application_data(Apps, Config), application_controller:config_change(OldEnv); _ -> {ok, []} end. This worked except it didn't remove old environment variables. Initially I thought that application_controller:do_change_appl was at fault, but later I realized that application:get_all_key/1 among other things returns not only the environment read from the *.app file, but a merged environment (*.app file + whatever was read from a config file). Upon realizing that I had to use the following solution to properly reload configuration without restarting a node. This indeed removes the *old* environment not found in the new config files. Perhaps there are other ways? reload_config() -> case init:get_argument(config) of {ok, [ Files ]} -> ConfFiles = [begin S = filename:basename(F,".config"), filename:join(filename:dirname(F), S ++ ".config") end || F <- Files], % Move sys.config to the head of the list Config = lists:sort(fun("sys.config", _) -> true; (_, _) -> false end, ConfFiles), OldEnv = application_controller:prep_config_change(), Apps = [{application, A, make_appl(A)} || {A,_,_} <- application:which_applications()], application_controller:change_application_data(Apps, Config), application_controller:config_change(OldEnv); _ -> {ok, []} end. make_appl(App) when is_atom(App) -> AppList = element(2,application:get_all_key(App)), FullName = code:where_is_file(atom_to_list(App) ++ ".app"), case file:consult(FullName) of {ok, [{application, _, Opts}]} -> Env = proplists:get_value(env, Opts, []), lists:keyreplace(env, 1, AppList, {env, Env}); {error, _Reason} -> lists:keyreplace(env, 1, AppList, {env, []}) end. Regards, Serge Gunilla Arendt wrote: > Hi Serge, > > After having been on vacation for a few weeks, I finally got around to > take a look at this. What happens in do_change_appl/3 is that a new > "env" for the application is created by merging the configuration > parameters in the .app file with configuration parameters set for > the application in the sys.config file and on the command line. > > The call to Mod:config_change/3 isn't made here, but in > do_config_change/3 where the previous "env" is compared with the new > "env" as created above: > > ... > case AppEnvNow of > AppEnvBefore -> > ok; > _ -> > case do_config_diff(AppEnvNow, AppEnvBefore) of > {[], [], []} -> > ok; > {Changed, New, Removed} -> > case application:get_key(App, mod) of > {ok, {Mod, _Para}} -> > case catch Mod:config_change(Changed, New, > Removed) of > ok -> > ok; > ... > > do_config_diff/1 does look for removed parameters, so as far as I can > see it looks correct. > > Regards, > Gunilla > > (FYI, I'm going on vacation again and will be back August 14) > > Serge Aleynikov wrote: >> Thanks, Gunilla! >> >> Also, when I was experimenting with the application:config_change/3 it >> seemed that the third parameter (Deleted) did not ever get set with >> the list of deleted application's environment entries. >> >> A closer look into the application_controller:do_change_appl/3 showed >> that the environment (NewEnv1, NewEnv2, NewEnv3) would always get >> appended/replaced but never deleted: >> >> do_change_appl({ok, {ApplData, Env, IncApps, Descr, Id, Vsn, Apps}}, >> OldAppl, Config) -> >> AppName = OldAppl#appl.name, >> >> %% Merge application env with env from sys.config, if any >> ConfEnv = get_opt(AppName, Config, []), >> NewEnv1 = merge_app_env(Env, ConfEnv), >> >> %% Merge application env with command line arguments, if any >> CmdLineEnv = get_cmd_env(AppName), >> NewEnv2 = merge_app_env(NewEnv1, CmdLineEnv), >> >> %% included_apps is made into an env parameter as well >> NewEnv3 = keyreplaceadd(included_applications, 1, NewEnv2, >> {included_applications, IncApps}), >> >> %% Update ets table with new application env >> del_env(AppName), >> add_env(AppName, NewEnv3), >> >> While you are looking at the previous bug report, please also verify >> this one. >> >> Regards, >> >> Serge >> >> >> Gunilla Arendt wrote: >>> Hi Serge, >>> >>> Yes, the config_change/1 and change_application_data/2 calls should >>> be done in the opposite order. >>> >>> Note however that release_handler:eval_appup_script/4 is actually not >>> used by release_handler (the process), but is primarily intended to be >>> called by the release_handler (the module) functions upgrade_app/2 >>> and downgrade_app/2,3. These two functions were added rather recently >>> to simplify testing of .appup files. (the release_handler process >>> calls do_install_release/3 to install a new release.) >>> >>> I will correct the bug and try to clarify the documentation. >>> >>> Thanks, >>> Gunilla >>> >>> >>> Serge Aleynikov wrote: >>> >>>> OTP team: >>>> >>>> I've been studying the code of the sasl's release_handler, and came >>>> up with this question that perhaps someone qualified would be able >>>> to answer. >>>> >>>> As far as I understand, the following functions do the following tasks: >>>> >>>> application_controller:prep_config_change() >>>> - Fetch OLD applications' environment from >>>> application controller's internal ETS table. >>>> >>>> application_controller:config_change(EnvBefore) >>>> - Notify running applications (via config_change/3 callback) about >>>> configuration changes derived from comparing EnvBefore with the >>>> content of the application controller's ETS table storing >>>> applications' environment. >>>> >>>> application_controller:change_application_data(AppSpecs, Config) >>>> - Rereads applications' environment from config files stored on disk >>>> and stores it to the application controller's ETS table. >>>> >>>> Now with this background let's look at how the release handler does >>>> the application upgrade: >>>> >>>> ==[begin]== sasl/src/release_handler.erl ===== >>>> ... >>>> eval_appup_script(App, ToVsn, ToDir, Script) -> >>>> EnvBefore = application_controller:prep_config_change(), >>>> AppSpecL = read_appspec(App, ToDir), >>>> Res = release_handler_1:eval_script(Script, >>>> [], % [AppSpec] >>>> [{App, ToVsn, ToDir}], >>>> []), % [Opt] >>>> case Res of >>>> {ok, _Unpurged} -> >>>> application_controller:config_change(EnvBefore), >>>> application_controller:change_application_data(AppSpecL,[]); >>>> _Res -> >>>> ignore >>>> end, >>>> Res. >>>> ... >>>> ==[end]======================================= >>>> >>>> Unless I am wrong, from this code it does *not* look like >>>> application's config_change/3 callback will ever be invoked by >>>> application_controller:config_change(EnvBefore) because EnvBefore >>>> has the same applications' environment information as the current >>>> content of the applications' controller's ETS table. It seems to me >>>> that at least the config_change/1 and change_application_data/2 >>>> calls should be done in the opposite order, or better, do something >>>> like this: >>>> >>>> ... >>>> {ok, _Unpurged} -> >>>> Files = >>>> case init:get_argument(config) of >>>> {ok, [ ConfFileNames ]} -> >>>> [begin >>>> S = filename:basename(F,".config"), >>>> filename:join(filename:dirname(F), S ++ ".config") >>>> end || F <- ConfFileNames], >>>> {ok, _} -> >>>> [] >>>> end, >>>> application_controller:change_application_data(AppSpecL, Files); >>>> application_controller:config_change(EnvBefore); >>>> _Res -> >>>> ignore >>>> ... >>>> >>>> I'd appreciate some clarification on the subject. >>>> >>>> Regards, >>>> >>>> Serge >>>> >>>> >>> >>> >> > > From andreas@REDACTED Fri Jul 28 19:11:18 2006 From: andreas@REDACTED (andreas) Date: Fri, 28 Jul 2006 18:11:18 +0100 Subject: Prefix string matching References: Message-ID: <20060728171118.5E3ED5A1C8@mail.erlangsystems.com> I wonder if the following expression:     add_prefix(String = "prefix" ++ _) ->         String;     add_prefix(Path) ->         "prefix" ++ String. is equal to:     add_prefix(String = [$p,$r,$e,$f,$i,$x|_]) ->         String;     add_prefix(Path) ->         "prefix" ++ String. Can the compiler optimize:     "Const" ++ VariableString to:     [$C, $o, $n, $s, $t | VariableString] If the compiler can not optimize this, how costly is ++ operations in pattern matching? Regards, Andreas Hillqvist _________________________________________________________ Post sent from http://www.trapexit.org From cyberhigh@REDACTED Fri Jul 28 20:30:04 2006 From: cyberhigh@REDACTED (CyBerHigh) Date: Fri, 28 Jul 2006 13:30:04 -0500 Subject: Erlang on multiple cpus Message-ID: <44CA57AC.5000203@gurusnetwork.org> I was wondering if erlangs concurrency supports spreading itself over multiple cpus or would I have to run more than one copy of my erlang app and use distributive computing to make it work on all the cpus of the computer Thank you CyBerHigh From ryanobjc@REDACTED Fri Jul 28 21:02:18 2006 From: ryanobjc@REDACTED (Ryan Rawson) Date: Fri, 28 Jul 2006 12:02:18 -0700 Subject: Erlang on multiple cpus In-Reply-To: <44CA57AC.5000203@gurusnetwork.org> References: <44CA57AC.5000203@gurusnetwork.org> Message-ID: <78568af10607281202q467a574fn6ed8a6cafaf01a3c@mail.gmail.com> R11 is the first release which supports SMP. See: http://www.erlang.org/doc/doc-5.5/doc/highlights.html Note the configure flag "--enable-smp-support" -ryan On 7/28/06, CyBerHigh wrote: > I was wondering if erlangs concurrency supports spreading itself over > multiple cpus or would I have to run more than one copy of my erlang app > and use distributive computing to make it work on all the cpus of the > computer > > Thank you > CyBerHigh > From ulf@REDACTED Fri Jul 28 21:36:02 2006 From: ulf@REDACTED (Ulf Wiger) Date: Fri, 28 Jul 2006 21:36:02 +0200 Subject: Prefix string matching In-Reply-To: <20060728171118.5E3ED5A1C8@mail.erlangsystems.com> References: <20060728171118.5E3ED5A1C8@mail.erlangsystems.com> Message-ID: Den 2006-07-28 19:11:18 skrev andreas : > I wonder if the following expression: > add_prefix(String = "prefix" ++ _) -> > String; > add_prefix(Path) -> > "prefix" ++ String. > > is equal to: > > add_prefix(String = [$p,$r,$e,$f,$i,$x|_]) -> String; > add_prefix(Path) -> > "prefix" ++ String. Yes, the two are equivalent. > Can the compiler optimize: > "Const" ++ VariableString > to: > [$C, $o, $n, $s, $t | VariableString] Well, the former is syntactic sugar for the latter. I don't know if that counts as "compiler optimization"... > If the compiler can not optimize this, how costly is > ++ operations in pattern matching? It is allowed only as syntactic sugar in cases like the one above. BR, Ulf W -- Ulf Wiger From nm@REDACTED Fri Jul 28 21:56:36 2006 From: nm@REDACTED (Gaspar Chilingarov) Date: Sat, 29 Jul 2006 00:56:36 +0500 Subject: Prefix string matching In-Reply-To: <20060728171118.5E3ED5A1C8@mail.erlangsystems.com> References: <20060728171118.5E3ED5A1C8@mail.erlangsystems.com> Message-ID: <44CA6BF4.9020902@web.am> Hi andreas! yes, it's a syntaxic sugar for [ $C, $o, $n, $s, $t | Variable ] /Gaspar andreas wrote: > I wonder if the following expression: > >     add_prefix(String = "prefix" ++ _) -> >         String; >     add_prefix(Path) -> >         "prefix" ++ String. > > is equal to: > >     add_prefix(String = [$p,$r,$e,$f,$i,$x|_]) -> >         String; >     add_prefix(Path) -> >         "prefix" ++ String. > > > Can the compiler optimize: > >     "Const" ++ VariableString > > to: > >     [$C, $o, $n, $s, $t | VariableString] > > > If the compiler can not optimize this, how costly is ++ operations in pattern matching? > > > Regards, > Andreas Hillqvist > _________________________________________________________ > Post sent from http://www.trapexit.org > -- Gaspar Chilingarov System Administrator, Network security consulting t +37493 419763 (mob) i 63174784 e nm@REDACTED From cyberhigh@REDACTED Sat Jul 29 00:03:13 2006 From: cyberhigh@REDACTED (CyBerHigh) Date: Fri, 28 Jul 2006 17:03:13 -0500 Subject: starting erlang app from command line Message-ID: <44CA89A1.70700@gurusnetwork.org> I was wondering if it was possible to start an erlang app from the command line. Like a simple shell script you would just put in the shebang and mark it as executable then run it. However this doesn't seem to be possible with erlang. Anything I write seems to have to be done from the erlang shell. Are there any workarounds? Thanks CyBerHigh From hokan.stenholm@REDACTED Sat Jul 29 00:56:09 2006 From: hokan.stenholm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Stenholm?=) Date: Sat, 29 Jul 2006 00:56:09 +0200 Subject: starting erlang app from command line In-Reply-To: <44CA89A1.70700@gurusnetwork.org> References: <44CA89A1.70700@gurusnetwork.org> Message-ID: <44CA9609.70706@bredband.net> CyBerHigh wrote: > I was wondering if it was possible to start an erlang app from the > command line. Like a simple shell script you would just put in the > shebang and mark it as executable then run it. However this doesn't > seem to be possible with erlang. Anything I write seems to have to be > done from the erlang shell. Are there any workarounds? > > Thanks > CyBerHigh > Read the 'erl' man page, this can be done with the '-s' or '-run' flag: -run Mod [Fun [Args]]: Passes the -run flag to the init:boot() routine. -s Mod [Fun [Args]]: Passes the -s flag to the init:boot() routine. init documentation: |-run Module [Function [Args]]| Evaluate the specified function during system initialization. |Function| defaults to |start| and |Args| to |[]|. If the function call ends abnormally, the Erlang runtime system stops with an error message. The arguments after |-run| are used as arguments to Erlang functions. All arguments are passed as strings. For example: $ *erl -run foo -run foo bar -run foo bar baz 1 2* This starts the Erlang runtime system and then evaluates the following Erlang functions: foo:start() foo:bar() foo:bar(["baz", "1", "2"]). The functions are executed sequentially in the initialization process, which then terminates normally and passes control to the user. This means that a |-run| call which does not terminate will block further processing; to avoid this, use some variant of |spawn| in such cases. |-s Module [Function [Args]]| Evaluate the specified function during system initialization. |Function| defaults to |start| and |Args| to |[]|. If the function call ends abnormally, the Erlang runtime system stops with an error message. The arguments after |-s| are used as arguments to Erlang functions. All arguments are passed as atoms. For example: $ *erl -s foo -s foo bar -s foo bar baz 1 2* This starts the Erlang runtime system and then evaluates the following Erlang functions: foo:start() foo:bar() foo:bar([baz, '1', '2']). The functions are executed sequentially in the initialization process, which then terminates normally and passes control to the user. This means that a |-s| call which does not terminate will block further processing; to avoid this, use some variant of |spawn| in such cases. Due to the limited length of atoms, it is recommended that |-run| be used instead. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anders.nygren@REDACTED Sat Jul 29 01:12:55 2006 From: anders.nygren@REDACTED (Anders Nygren) Date: Fri, 28 Jul 2006 18:12:55 -0500 Subject: starting erlang app from command line In-Reply-To: <44CA89A1.70700@gurusnetwork.org> References: <44CA89A1.70700@gurusnetwork.org> Message-ID: On 7/28/06, CyBerHigh wrote: > I was wondering if it was possible to start an erlang app from the > command line. Like a simple shell script you would just put in the > shebang and mark it as executable then run it. However this doesn't > seem to be possible with erlang. Anything I write seems to have to be > done from the erlang shell. Are there any workarounds? Hi To execute an erlang function from the shell You can do > erl -run Mod Fun [Arg1 [Arg2...]] See 'erl -man erl' for details. That will start an Erlang shell and execute Mod:Fun([Args]), but the shell will not terminate. If You want it to terminate when it is finishedYou can do > erl -run Mod Fun [Arg1 [Arg2...]] -run init stop If You don't want the shell You can also add -noshell. If You want to run Your erlang application as a server You can also take a look at 'System Principles' and 'Embedded System' parts of the erlang documentation. Once upon a time there was something called escript that allowed You to do what You asked for, but it disappeared some releases ago. /Anders From onlyopensource@REDACTED Sun Jul 30 15:46:05 2006 From: onlyopensource@REDACTED (Only OpenSource) Date: Sun, 30 Jul 2006 19:16:05 +0530 Subject: erlang VM memory utilization Message-ID: Hello Let's say there are two independent erlang processes started on the same machine from two different terminals under the same user (uid) context. Given the scenario, here are my queries - 1. how many VM instances are running ? 2. does the second VM try to connect to the first instance and share the memory structures that load the base library ? 3. assuming one VM consumes x Mb of memory to load the base library then does running two VM instance consume 2x Mb of memory ? Would be thankful if experienced members could share some insight on the memory utilization issue. Thanks in advance. -- oo@@oo From launoja@REDACTED Sun Jul 30 17:29:47 2006 From: launoja@REDACTED (Jani Launonen) Date: Sun, 30 Jul 2006 18:29:47 +0300 Subject: erlang VM memory utilization In-Reply-To: References: Message-ID: <941E1D0D-70C3-4A0C-945A-C6DF033EBDDE@dnainternet.net> Only OpenSource kirjoitti 30.7.2006 kello 16.46: > Hello > > Let's say there are two independent erlang processes > started on the same machine from two different terminals > under the same user (uid) context. > > Given the scenario, here are my queries - > > 1. how many VM instances are running ? Two. But you could use the second VM's terminal to just spawn another process in the first one, assuming named (distributed) nodes. See below. Or (still assuming named nodes) you could make remote connection to the first one with erlang shell and spawn things there and quit the second VM. Others propably fill you in in the erlang shell trickery. > 2. does the second VM try to connect to the first instance > and share the memory structures that load the base library ? No. They are indepedent and unaware of each other. You could of course make them named nodes (-sname a_node and the other vm started with -sname b_node for example. See http://www.erlang.org/doc/ doc-5.5/doc/reference_manual/distributed.html#11). > 3. assuming one VM consumes x Mb of memory to load the base library > then does running two VM instance consume 2x Mb of memory ? Yes. VM propably have read only pages shared, but the erlang (byte) code itself is propably non shared as they might have different versions loaded. > Would be thankful if experienced members could share some insight > on the memory utilization issue. I hope I helped a bit. > Thanks in advance No problem. > -- > oo@@oo From thomas.raes@REDACTED Sun Jul 30 23:45:58 2006 From: thomas.raes@REDACTED (Thomas Raes) Date: Sun, 30 Jul 2006 23:45:58 +0200 Subject: list comprehension compilation Message-ID: <44CD2896.10908@pandora.be> Hello, I'm new to Erlang and I've got a question about list comprehensions: Compiling code that contains list comprehensions with lots of variables seems to take a long time on my system. For example, compiling the following code takes more than 4 minutes: test() -> [[X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18,X19,X20] || X1 <- [0],X2 <- [0],X3 <- [0],X4 <- [0],X5 <- [0],X6 <- [0],X7 <- [0],X8 <- [0],X9 <- [0],X10 <- [0], X11 <- [0],X12 <- [0],X13 <- [0],X14 <- [0],X15 <- [0],X16 <- [0],X17 <- [0],X18 <- [0],X19 <- [0],X20 <- [0]]. However, when I enter this code at the erl-prompt, it evaluates immediately. The more variables there are, the longer the compilation takes. Is this normal or am I doing something wrong? (I've compiled the code with "c(filename)." in the erl prompt.). Best regards, Thomas PS: I've used: Erlang (BEAM) emulator version 5.5 [source] [async-threads:0] [hipe] From mats.cronqvist@REDACTED Mon Jul 31 14:29:19 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 31 Jul 2006 14:29:19 +0200 Subject: how to interpret these results ? In-Reply-To: References: Message-ID: <44CDF79F.1000200@ericsson.com> Only OpenSource wrote: > Hello > > Here is a comparison of Erlang and C > http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=hipe&lang2=gcc > What is the recommended approach towards understanding the benchmark numbers ? i think comparing to C is pretty worthless, since they are so different. when comparing erlang to python or java, one notices a few things; erlang is strong in concurrency erlang is not great for problems involving number crunching and mutable arrays erlang is bad when you have to use regexps erlang is REALLY bad at using stdin/stdout an observation; the benchmarks basically measure how fast really well-written code executes. so C is inherently ~10 times faster than erlang. otoh, my personal experience is that for a distributed, highly concurrent, million lines of code type project, erlang will beat C in speed (it will of course beat C in reliability, development cost and time-to-market as well). i believe this means that it is much easier to get close to the theoretical maximum execution speed in erlang than in C. mats From ernie.makris@REDACTED Mon Jul 31 15:12:01 2006 From: ernie.makris@REDACTED (Ernie Makris) Date: Mon, 31 Jul 2006 09:12:01 -0400 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CDF79F.1000200@ericsson.com> References: <44CDF79F.1000200@ericsson.com> Message-ID: <44CE01A1.1060402@comcast.net> Hello Erlangers, One thing I wanted to start a discussion on is getting pcre style regexps in erlang. The question I pose to the list is: What would be the best way to integrate the pcre library into erlang. The possible approaches I've seen so far are: - create a linked in driver - create a port program - create new bifs (I'd really like this) My obvious concerns are: - How stable is the C pcre library for long running servers - Stability implies: - Memory leaks - SIGSEGVs I would love the library calls in erlang to be bifs. Are there any external examples, aside from just looking at the source that demonstrate how to cleanly add a new bif? Thanks Ernie From mats.cronqvist@REDACTED Mon Jul 31 16:51:35 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 31 Jul 2006 16:51:35 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CE01A1.1060402@comcast.net> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> Message-ID: <44CE18F7.1020602@ericsson.com> Ernie Makris wrote: > Hello Erlangers, > > One thing I wanted to start a discussion on is getting pcre style > regexps in erlang. The question > I pose to the list is: What would be the best way to integrate the pcre > library into erlang. > The possible approaches I've seen so far are: > - create a linked in driver > - create a port program > - create new bifs (I'd really like this) a bif is the way to go, imo. > My obvious concerns are: > - How stable is the C pcre library for long running servers > - Stability implies: > - Memory leaks > - SIGSEGVs > > I would love the library calls in erlang to be bifs. Are there any > external examples, aside from just looking at the source that > demonstrate how to cleanly add a new bif? two weeks ago me and a colleague implemented two new bifs; re:grep/2 and re:compile/1. documentation is a bit scarce; re:compile([RegExp]) -> [RegExpC] re:grep(Str,[RegExp]) -> [MatchItem] RegExp = string() RegExpC = term() MatchItem = no_match | {int(Beg),int(End),[string(SubMatch)]} | {error,{string(ErrorStr),int(ErrorChar)}} we have not yet observed any problems with stability. OTP has indicated that they will not introduce any bif that does not execute in bound time, or yields. i believe this can be met by limiting the length of the string and the regexp. if there is interest, we can probably make the code available. mats From ernie.makris@REDACTED Mon Jul 31 16:56:42 2006 From: ernie.makris@REDACTED (Ernie Makris) Date: Mon, 31 Jul 2006 10:56:42 -0400 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CE18F7.1020602@ericsson.com> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE18F7.1020602@ericsson.com> Message-ID: <44CE1A2A.8040908@comcast.net> Hi Mats, I'd definitely be interested in seeing the code, or even an overview of the process to properly add a bif. I think the best thing I can do is add in the pcre library, create the bif and then run it indefinitely in a loop of regex tests to observe the memory behavior of the VM. Thanks Ernie Mats Cronqvist wrote: > Ernie Makris wrote: >> Hello Erlangers, >> >> One thing I wanted to start a discussion on is getting pcre style >> regexps in erlang. The question >> I pose to the list is: What would be the best way to integrate the pcre >> library into erlang. >> The possible approaches I've seen so far are: >> - create a linked in driver >> - create a port program >> - create new bifs (I'd really like this) > > a bif is the way to go, imo. > >> My obvious concerns are: >> - How stable is the C pcre library for long running servers >> - Stability implies: >> - Memory leaks >> - SIGSEGVs >> >> I would love the library calls in erlang to be bifs. Are there any >> external examples, aside from just looking at the source that >> demonstrate how to cleanly add a new bif? > > two weeks ago me and a colleague implemented two new bifs; re:grep/2 > and re:compile/1. > > documentation is a bit scarce; > > re:compile([RegExp]) -> [RegExpC] > re:grep(Str,[RegExp]) -> [MatchItem] > RegExp = string() > RegExpC = term() > MatchItem = no_match | {int(Beg),int(End),[string(SubMatch)]} | > {error,{string(ErrorStr),int(ErrorChar)}} > > we have not yet observed any problems with stability. > > OTP has indicated that they will not introduce any bif that does not > execute in bound time, or yields. i believe this can be met by > limiting the length of the string and the regexp. > > if there is interest, we can probably make the code available. > > mats > From Martin.Logan@REDACTED Mon Jul 31 17:14:44 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Mon, 31 Jul 2006 10:14:44 -0500 Subject: Simple DB Access Message-ID: <9CB79C836F98504C81BF082C4291E987792A25@CHITDSEXC02.tds.corp.cendant.org> I have been working with Erlang for many years now. I love it. It is bar none the best platform for creating distributed applications out there. In the face of that *fact* Erlang has not hit the main stream yet. There are probably a few small reasons why it has not, one of them is undoubtedly the lack of a quick and painless database access library. I have lamented this fact ever since I did my first erlang application and had to use some terrible 3rd party odbc package to connect my app with Sybase. I love mnesia and ets as much as the next guy but the simple fact of the matter is that enterprise stores its data in relational databases. As I move up the corporate ladder I will continue to be an advocate of Erlang, I will advocate it in those places where it makes sense for the operational efficiency of my company. The lack of an easy, clean, and professional quality way to integrate with the heart of enterprise is one impediment to being able to use it without fear. No manager wants to justify the learning curve of some new language and on top of that show many hours having to be devoted to installing and debugging quirky odbc on unix packages. It is also hard to get buy in from a team that is used to Java, python or perl when they find out that they have to jump through hoops just to do something they typically take for granted. I don't think this is a community project, I think that the core erlang team has to take this up and create a database access package similar to that in perl, ruby, python etc. Having quick and painless mysql access would be a great start. I don't know if there are many business drivers at Ericsson for something like this, though I would be surprised to find out there are none, but I would be willing to bet the download statistics show how valuable this addition is the minute it is released. Cheers, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.hinde@REDACTED Mon Jul 31 17:16:26 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 31 Jul 2006 16:16:26 +0100 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CE01A1.1060402@comcast.net> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> Message-ID: Hi Ernie, On 31 Jul 2006, at 14:12, Ernie Makris wrote: > Hello Erlangers, > > One thing I wanted to start a discussion on is getting pcre style > regexps in erlang. The question > I pose to the list is: What would be the best way to integrate the > pcre > library into erlang. > The possible approaches I've seen so far are: > - create a linked in driver > - create a port program > - create new bifs (I'd really like this) Yes, that about covers it. > My obvious concerns are: > - How stable is the C pcre library for long running servers > - Stability implies: > - Memory leaks > - SIGSEGVs No idea, but.. > > I would love the library calls in erlang to be bifs. Are there any > external examples, aside from just looking at the source that > demonstrate how to cleanly add a new bif? If you add this feature by hacking the otp release and adding bifs you would create all the long term issues of having a patched OTP release. You would unlikely to get adopters of any open source version you released for much the same reason. OTOH it is not too hard to create a linked in driver that could alternatively be compiled as a port program. That way you give users a choice between speed of a driver (almost the same as a BIF), or fault isolation. Sean From ernie.makris@REDACTED Mon Jul 31 17:21:13 2006 From: ernie.makris@REDACTED (Ernie Makris) Date: Mon, 31 Jul 2006 11:21:13 -0400 Subject: pcre, bifs, drivers and ports In-Reply-To: References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> Message-ID: <44CE1FE9.9090104@comcast.net> Hi Sean > > If you add this feature by hacking the otp release and adding bifs you > would create all the long term issues of having a patched OTP release. > Thats ok, I already patch my releases in order to fix a linux to_erl bug, and to allow the file driver to open /dev/urandom. The only pain is verifying the patch on a new release. But I know the code well enough that I can do it by hand each time. > You would unlikely to get adopters of any open source version you > released for much the same reason. > I would still put it out there, if anyone wanted to use it, they would be welcome. > OTOH it is not too hard to create a linked in driver that could > alternatively be compiled as a port program. That way you give users a > choice between speed of a driver (almost the same as a BIF), or fault > isolation. > I agree, but I also wanted to see how easy/difficult it would be to add a few new bifs. > Sean > > > > From mats.cronqvist@REDACTED Mon Jul 31 17:24:46 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 31 Jul 2006 17:24:46 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CE1A2A.8040908@comcast.net> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE18F7.1020602@ericsson.com> <44CE1A2A.8040908@comcast.net> Message-ID: <44CE20BE.5070102@ericsson.com> Ernie Makris wrote: > Hi Mats, > > I'd definitely be interested in seeing the code, i'll ask istvan (the author, i just came up with the idea and the API :>) if he'll post the code. forgot to post an example in the previous post; > re:grep("foofoo",["fo","of([a-z])"]). [{0,2,[]},{2,5,["o"]}] > or even an overview of > the process to properly add a bif. the (probably non-proper) process to add a bif is like this; 0) run configure 1) add your bifs to erts/emulator/beam/bif.tab e.g. bif re:grep/2 bif re:compile/1 2) create a C file e.g. erts/emulator/beam/erl_bif_re.c 3) implement your bifs by stealing bits from existing erl_bif_*.c files e.g. BIF_RETTYPE re_grep_2(BIF_ALIST_2){ Eterm result; result = magic_function(); BIF_RET(result); } 4) add your C file to erts/emulator//Makefile e.g. RUN_OBJS = $(OBJDIR)/erl_bif_re.o \ 5) run make; make install note that if you add bif ernie:makris/1 to bif.tab there should be a erl_bif_ernie.c that implements BIF_RETTYPE ernie_makris_1(BIF_ALIST_1); note that i'm not really an expert on this. consider it an educated guess :> mats From ernie.makris@REDACTED Mon Jul 31 17:28:17 2006 From: ernie.makris@REDACTED (Ernie Makris) Date: Mon, 31 Jul 2006 11:28:17 -0400 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CE20BE.5070102@ericsson.com> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE18F7.1020602@ericsson.com> <44CE1A2A.8040908@comcast.net> <44CE20BE.5070102@ericsson.com> Message-ID: <44CE2191.6050604@comcast.net> Hi Mats, Excellent, that process description will help! Thanks Ernie Mats Cronqvist wrote: > Ernie Makris wrote: >> Hi Mats, >> >> I'd definitely be interested in seeing the code, > > i'll ask istvan (the author, i just came up with the idea and the > API :>) if he'll post the code. > > forgot to post an example in the previous post; > > re:grep("foofoo",["fo","of([a-z])"]). > [{0,2,[]},{2,5,["o"]}] > >> or even an overview of >> the process to properly add a bif. > > > the (probably non-proper) process to add a bif is like this; > > 0) run configure > > 1) add your bifs to erts/emulator/beam/bif.tab > > e.g. > bif re:grep/2 > bif re:compile/1 > > 2) create a C file > > e.g. > erts/emulator/beam/erl_bif_re.c > > 3) implement your bifs by stealing bits from existing erl_bif_*.c files > > e.g. > BIF_RETTYPE re_grep_2(BIF_ALIST_2){ > Eterm result; > result = magic_function(); > BIF_RET(result); > } > > 4) add your C file to erts/emulator//Makefile > > e.g. > RUN_OBJS = $(OBJDIR)/erl_bif_re.o \ > > 5) run make; make install > > > note that if you add > bif ernie:makris/1 > to bif.tab > there should be a erl_bif_ernie.c > that implements > BIF_RETTYPE ernie_makris_1(BIF_ALIST_1); > > > note that i'm not really an expert on this. consider it an educated > guess :> > > mats > From mats.cronqvist@REDACTED Mon Jul 31 17:36:49 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 31 Jul 2006 17:36:49 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> Message-ID: <44CE2391.9030102@ericsson.com> Sean Hinde wrote: > Hi Ernie, > > On 31 Jul 2006, at 14:12, Ernie Makris wrote: > >> Hello Erlangers, >> >> One thing I wanted to start a discussion on is getting pcre style >> regexps in erlang. The question >> I pose to the list is: What would be the best way to integrate the pcre >> library into erlang. >> The possible approaches I've seen so far are: >> - create a linked in driver >> - create a port program >> - create new bifs (I'd really like this) > > Yes, that about covers it. you could re-implement it in erlang, of course. [snip] > OTOH it is not too hard to create a linked in driver that could > alternatively be compiled as a port program. That way you give users a > choice between speed of a driver (almost the same as a BIF), or fault > isolation. it would be grand if i could write my glue code once, and have a tool generate a linked-in driver, a port program, a bif or a c-node from that. this is (i think) the goal of dryverl, but i'm too dense to figure it out... mats From mats.cronqvist@REDACTED Mon Jul 31 17:57:17 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 31 Jul 2006 17:57:17 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CE2191.6050604@comcast.net> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE18F7.1020602@ericsson.com> <44CE1A2A.8040908@comcast.net> <44CE20BE.5070102@ericsson.com> <44CE2191.6050604@comcast.net> Message-ID: <44CE285D.2010300@ericsson.com> Ernie Makris wrote: > Hi Mats, > > Excellent, that process description will help! > i put the howto here; http://wiki.trapexit.org/index.php/Adding_my_own_BIF please correct all the bugs you will undoubtedly find... mats From sean.hinde@REDACTED Mon Jul 31 18:12:00 2006 From: sean.hinde@REDACTED (Sean Hinde) Date: Mon, 31 Jul 2006 17:12:00 +0100 Subject: pcre, bifs, drivers and ports In-Reply-To: <44CE1FE9.9090104@comcast.net> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> Message-ID: <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> Hi Ernie, On 31 Jul 2006, at 16:21, Ernie Makris wrote: > Hi Sean > >> >> If you add this feature by hacking the otp release and adding bifs >> you >> would create all the long term issues of having a patched OTP >> release. >> > Thats ok, I already patch my releases in order to fix a linux to_erl > bug, and to allow the file driver to open /dev/urandom. The only > pain is > verifying the patch on a new release. But I know the code well enough > that I can do it by hand each time. Where I work we already have a quite heavily patched OTP release so I know well the pain. For me the hassle of yet more patches would almost certainly outweigh some small speed benefit.. >> You would unlikely to get adopters of any open source version you >> released for much the same reason. >> > I would still put it out there, if anyone wanted to use it, they would > be welcome. And I guess if they liked it enough they could add a driver option :-) >> OTOH it is not too hard to create a linked in driver that could >> alternatively be compiled as a port program. That way you give >> users a >> choice between speed of a driver (almost the same as a BIF), or fault >> isolation. >> > I agree, but I also wanted to see how easy/difficult it would be to > add > a few new bifs. One more thing to think on - assuming that pcre itself is thread safe, adding it as a driver would make multithreading quite straightforward. Mats' comment about limiting length of REs does not really cut it IMO. Blocking the whole emulator during a long regexp calculation rarely sounds like the right solution for typical Erlang apps. But. It would be most fascinating to compare real world characteristics of: 1. BIF pcre 2. Driver pcre, 3. BIF pcre in SMT erlang. Sean From mats.cronqvist@REDACTED Mon Jul 31 18:28:40 2006 From: mats.cronqvist@REDACTED (Mats Cronqvist) Date: Mon, 31 Jul 2006 18:28:40 +0200 Subject: pcre, bifs, drivers and ports In-Reply-To: <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> References: <44CDF79F.1000200@ericsson.com> <44CE01A1.1060402@comcast.net> <44CE1FE9.9090104@comcast.net> <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> Message-ID: <44CE2FB8.2070306@ericsson.com> Sean Hinde wrote: > One more thing to think on - assuming that pcre itself is thread safe, > adding it as a driver would make multithreading quite straightforward. i believe this is what OTP wants. > Mats' comment about limiting length of REs does not really cut it IMO. it is pretty lame, but better lameness today than perfection in the future. > Blocking the whole emulator during a long regexp calculation rarely > sounds like the right solution for typical Erlang apps. that is of course totally unacceptable. so the bif will have to be able to yield (difficult), or refuse potentially long calculations (easy). > But. It would be most fascinating to compare real world characteristics of: > > 1. BIF pcre > 2. Driver pcre, > 3. BIF pcre in SMT erlang. indeed. mats From jocke@REDACTED Mon Jul 31 16:45:30 2006 From: jocke@REDACTED (Joakim G.) Date: Mon, 31 Jul 2006 16:45:30 +0200 Subject: SGML documentation? Message-ID: <44CE178A.7070102@tail-f.com> Hi, Are there reasons for keeping the OTP SGML documentation closed source? If not; would it be possible to get a snapshot of the SGML and corresponding DTD files? Something like: find /otp-repository -name '*.dtd' -o -name '*.sgml' | xargs tar zcvf doc.tgz Cheers /Jocke -- tail-f.com Without followers, evil cannot spread. -- Spock, stardate 5029.5 From tobez@REDACTED Mon Jul 31 20:26:41 2006 From: tobez@REDACTED (Anton Berezin) Date: Mon, 31 Jul 2006 20:26:41 +0200 Subject: http:request/4 proxy redirection problem Message-ID: <20060731182641.GB33105@heechee.tobez.org> Hi, It appears that when one uses http:request/4 with a configured proxy, and the webserver returns 3XX code, http:request/4 enters an endless loop. There seems to be two problems in fact: First, the guard statement that checks for HTTP_MAX_REDIRECTS to prevent looping is written as Code / 100 == 3, which does not quite do what it should, so redirection loops are not detected. Secondly, when httpc_response:redirect/2 constructs a new request, it does not update #request.abs_uri, which in fact is the only thing that is used by the proxy branch of the code when making the request. A patch follows. The last chunk of the patch is a quick hack. My Erlang knowledge is rather embryonic, and I could not find the opposite to http_uri:parse/1 anywhere. If this is already fixed in unreleased version of inets, sorry for wasting everybody's time. --- lib/inets-4.7.4/src/httpc_response.erl Wed May 3 10:22:37 2006 +++ lib/inets-4.7.4/src/httpc_response.erl Mon Jul 31 20:13:09 2006 @@ -84,7 +84,7 @@ result(Response = {{_,100,_}, _, _}, Req result(Response = {{_, Code, _}, _, _}, Request = #request{redircount = Redirects, settings = #http_options{autoredirect = true}}) - when Code / 100 == 3, Redirects > ?HTTP_MAX_REDIRECTS -> + when Code div 100 == 3, Redirects > ?HTTP_MAX_REDIRECTS -> transparent(Response, Request); %% multiple choices or use proxy @@ -114,7 +114,7 @@ result(Response = {{_, Code, _}, _, _}, result(Response = {{_,503,_}, _, _}, Request) -> status_service_unavailable(Response, Request); -result(Response = {{_,Code,_}, _, _}, Request) when (Code / 100) == 5 -> +result(Response = {{_,Code,_}, _, _}, Request) when (Code div 100) == 5 -> status_server_error_50x(Response, Request); result(Response, Request) -> @@ -247,7 +247,11 @@ redirect(Response = {StatusLine, Headers headers = NewHeaders, address = {Host,Port}, path = Path, - pquery = Query}, + pquery = Query, + abs_uri = + atom_to_list(Scheme)++"://"++ + Host++":"++integer_to_list(Port)++ + Path++Query}, {redirect, NewRequest, Data} end end. \Anton. -- We're going for 'working' here. 'Clean' is for people with skills... -- Flemming Jacobsen From fritchie@REDACTED Mon Jul 31 22:00:55 2006 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Mon, 31 Jul 2006 15:00:55 -0500 Subject: pcre, bifs, drivers and ports In-Reply-To: Message of "Mon, 31 Jul 2006 17:12:00 BST." <6ED1A901-94C2-4EF7-8826-39245CFF4DB8@gmail.com> Message-ID: <200607312000.k6VK0tKA087753@snookles.snookles.com> >>>>> "sh" == Sean Hinde writes: sh> Mats' comment about limiting length of REs does sh> not really cut it IMO. Blocking the whole emulator during a long sh> regexp calculation rarely sounds like the right solution for sh> typical Erlang apps. One more thing to consider. A *really* useful regexp library (or any library that deals with strings) would be one that worked on: 1. lists of byte values (the traditional Erlang "string") 2. single binary terms 3. "I/O lists", an arbitrarily deep list of #1 and/or #2. (Or #2 alone :-) I would guess that that would come at a high cost implementaion, since most C/C++ regexp packages operate on buffers of contiguous bytes, not a string of bytes located in perhaps thousands of non-contiguous places. Oops, I forgot one: 4. A possibly UNICODE/whatever internationalized "string" thingie stored in an I/O list. As discussed on this list a few weeks ago, there is no agreement on how to represent such a thing ... in Erlang or most other languages. sh> But. It would be most fascinating to compare real world sh> characteristics of: sh> 1. BIF pcre 2. Driver pcre, 3. BIF pcre in SMT erlang. Yup. A linked-in driver can cheat even more if it can get a (internal C) pointer to the term(s) it's operating on. It's quite easy to create a new BIF that returns the internal pointer/address of its argument and return it as an integer.(*) Turning that integer into a pointer, the driver has full access to the term. Use the power only for good. :-) -Scott (*) It is a good, simple experiment if you've never tried writing a BIF before. From chsu79@REDACTED Mon Jul 31 22:07:24 2006 From: chsu79@REDACTED (Christian S) Date: Mon, 31 Jul 2006 22:07:24 +0200 Subject: Simple DB Access In-Reply-To: <9CB79C836F98504C81BF082C4291E987792A25@CHITDSEXC02.tds.corp.cendant.org> References: <9CB79C836F98504C81BF082C4291E987792A25@CHITDSEXC02.tds.corp.cendant.org> Message-ID: On 7/31/06, Logan, Martin wrote: > > the lack of a quick and painless database access library. I have lamented > this fact ever since I > Could you dig up wire protocol docs for any of these non-open source databases? These big company sites have a tendency to put me off within 5 minutes so I never managed to find the docs myself. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Logan@REDACTED Mon Jul 31 22:14:13 2006 From: Martin.Logan@REDACTED (Logan, Martin) Date: Mon, 31 Jul 2006 15:14:13 -0500 Subject: Simple DB Access In-Reply-To: Message-ID: <9CB79C836F98504C81BF082C4291E987792A28@CHITDSEXC02.tds.corp.cendant.org> I guess the question would be; who is interested and can dig up these protocols. The only thing I do know for sure is that this type of tool would go a long way to making Erlang enterprise integration a reality. Erlang can be a fantastic middleware platform for corporations. ________________________________ From: Christian S [mailto:chsu79@REDACTED] Sent: Monday, July 31, 2006 3:07 PM To: Logan, Martin Cc: erlang-questions@REDACTED Subject: Re: Simple DB Access On 7/31/06, Logan, Martin wrote: the lack of a quick and painless database access library. I have lamented this fact ever since I Could you dig up wire protocol docs for any of these non-open source databases? These big company sites have a tendency to put me off within 5 minutes so I never managed to find the docs myself. -------------- next part -------------- An HTML attachment was scrubbed... URL: