From vladimir.kirichenko@REDACTED Sat Sep 1 00:59:30 2012 From: vladimir.kirichenko@REDACTED (Volodymyr Kyrychenko) Date: Sat, 01 Sep 2012 01:59:30 +0300 Subject: [erlang-questions] Licensing an Erlang/Emacs Lisp project In-Reply-To: References: Message-ID: <504141D2.1020108@gmail.com> Thomas J?rvstrand wrote: > Thank you for your reply. > > Correct me if I'm wrong but as far as I've understood it, writing a > program to be run in the erlang vm is fine since that qualifies in GPL > as being system libraries. The problem supposedly is that the moment you > call one of the otp standard libraries you're toast since that is the > equivalent of dynamic linking, meaning that in practice it's not really > feasible to license an Erlang project under GPL? GPL as a strong copyleft license requires you to make your project licensed under GPL. That does not mean that code licensed under other licenses will be relicensed under GPL, this actually is opposite of being true. I'll show you an example. You combining larger work with: erlang (Erlang PL). your_library (your total control over rights on code) libraryX (licensed under GPL). So your larger work as a whole have to be GPL (with its parts under their own licenses). your_library could be licensed as GPL or any other GPL compatible license in a larger work. Any modifications or parts of the code governed by Erlang PL should be licensed under Erlang PL in the combined work that as a whole is licensed under GPL. The issue with linking your referring to arises when you calling GPL licensed library from the project you dont want to be GPL licensed, not the opposite. So if you call otp from GPL - that's fine. But if you want to amend otp library (governed by Erlang PL, amendment required to be governed by Erlang PL) with calling GPL code - that is a problem because of two licenses copyleft clash, unless you manage to do so making GPL code optional and not distributed within your amended otp code. -- Volodymyr Kyrychenko -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: From vladimir.kirichenko@REDACTED Sat Sep 1 01:10:20 2012 From: vladimir.kirichenko@REDACTED (Volodymyr Kyrychenko) Date: Sat, 01 Sep 2012 02:10:20 +0300 Subject: [erlang-questions] Licensing an Erlang/Emacs Lisp project In-Reply-To: <504141D2.1020108@gmail.com> References: <504141D2.1020108@gmail.com> Message-ID: <5041445C.8010406@gmail.com> BTW just got the idea that OTP library could be amended in the way that erlang derivative would depended on GPL library for example, because there is no requirement in the license that modification should be 'working code' at all. And there will be erlang derivative under Erlang PL that effectively imposes GPL unless such modification will be removed from it. -- Volodymyr Kyrychenko -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: From thomas.jarvstrand@REDACTED Sat Sep 1 07:12:09 2012 From: thomas.jarvstrand@REDACTED (=?ISO-8859-1?Q?Thomas_J=E4rvstrand?=) Date: Sat, 1 Sep 2012 07:12:09 +0200 Subject: [erlang-questions] Licensing an Erlang/Emacs Lisp project In-Reply-To: <5041445C.8010406@gmail.com> References: <504141D2.1020108@gmail.com> <5041445C.8010406@gmail.com> Message-ID: On Sat, Sep 1, 2012 at 1:10 AM, Volodymyr Kyrychenko < vladimir.kirichenko@REDACTED> wrote: > BTW just got the idea that OTP library could be amended in the way that > erlang derivative would depended on GPL library for example, because > there is no requirement in the license that modification should be > 'working code' at all. And there will be erlang derivative under Erlang > PL that effectively imposes GPL unless such modification will be removed > from it. > > > -- > Volodymyr Kyrychenko > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > Ok, it seems that GPL is the only way to go then. Thank you for your help! Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksoe@REDACTED Sat Sep 1 10:31:31 2012 From: eriksoe@REDACTED (=?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?=) Date: Sat, 1 Sep 2012 10:31:31 +0200 Subject: [erlang-questions] Licensing an Erlang/Emacs Lisp project In-Reply-To: References: Message-ID: Den 31/08/2012 16.00 skrev "Thomas J?rvstrand" : > > Hi, > > I'm currently working on a project that is a combination of Erlang and Emacs Lisp. The project is currently open sourced under the LGPL but I recently realized that some of the submodules I use are under GPL (the elisp ones) and so I believe I have to change my licensing. > > My problem is that I have no idea what license to choose. Part of my code will be running in Erlang and part of the code will be running in Elisp inside an Emacs instance. The submodules are not actually shipped with the project if that makes any difference, but are fetched upon building the project. > > Specifically, in Erlang I currently have one submodule licensed under the MIT license, and one under Apache v2. In Elisp I'm using 3 submodules, all of which are licensed under GPLv3. > > Is there any way that I can cook this soup? I hear that Erlang doesn't really work that well with GPL so should I pull out the Erlang parts of the project and license them separately? Can I then use these as part of my project? The Elisp code will be communicating with the Erlang parts through a rest-interface if that makes any difference. I believe it does - if your code is not linked to the GPL parts, but merely communicate with GPL parts which exist in a separate OS process, then there is no issue, as I recall it. (Ianal, of course.) > All these licenses confuse me to no end, so it'd be great to get some advice. Basically my project a bunch of porcelain code that binds together and configures a bunch of useful tools for erlang development. The whole point of it is to be an easy-to-setup solution, so I'd really not like to have to resort to "download this from here, configure this way, rinse, repeat". > > I have no issue with licensing my project under GPL, but I would like a model that is compatible with what I currently use and gives me freedom to add new parts to the project in the future. > > I would be thankful for any help > > Sincerely > > Thomas J?rvstrand > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From avinash@REDACTED Sat Sep 1 14:58:57 2012 From: avinash@REDACTED (Avinash Dhumane) Date: Sat, 1 Sep 2012 20:58:57 +0800 (SGT) Subject: [erlang-questions] AMQP payload between C & Erlang Message-ID: <1346504337.39567.YahooMailNeo@web2710.biz.mail.sg3.yahoo.com> This is my first ever shot at AMQP! A legacy "C" application needs to interoperate with Erlang application over AMQP (RabbitMQ) by exchanging native C-structs as payload. What do I need to do in Erlang-side application (because this is where I have maximum control) so that C-app sees the payload as structs and Erlang-app sees the payload as tuples? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Sat Sep 1 17:35:05 2012 From: g@REDACTED (Garrett Smith) Date: Sat, 1 Sep 2012 10:35:05 -0500 Subject: [erlang-questions] AMQP payload between C & Erlang In-Reply-To: <1346504337.39567.YahooMailNeo@web2710.biz.mail.sg3.yahoo.com> References: <1346504337.39567.YahooMailNeo@web2710.biz.mail.sg3.yahoo.com> Message-ID: On Sat, Sep 1, 2012 at 7:58 AM, Avinash Dhumane wrote: > This is my first ever shot at AMQP! > > A legacy "C" application needs to interoperate with Erlang application over > AMQP (RabbitMQ) by exchanging native C-structs as payload. > > What do I need to do in Erlang-side application (because this is where I > have maximum control) so that C-app sees the payload as structs and > Erlang-app sees the payload as tuples? If I was doing this, I'd first look closely at MessagePack: http://msgpack.org/ Here's an example in C: http://wiki.msgpack.org/display/MSGPACK/QuickStart+for+C+Language and one in Erlang: http://wiki.msgpack.org/display/MSGPACK/QuickStart+for+Erlang Garrett From heinz@REDACTED Sun Sep 2 03:40:40 2012 From: heinz@REDACTED (Heinz Nikolaus Gies) Date: Sun, 2 Sep 2012 03:40:40 +0200 Subject: [erlang-questions] DTrace consumer Message-ID: <0846C996-DF37-44E3-AA65-C35A604DE31A@licenser.net> Has anyone investigated into DTrace consumers written in erlang or is that an untouched area so far? Regards, Heinz -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4349 bytes Desc: not available URL: From eriksoe@REDACTED Sun Sep 2 09:25:33 2012 From: eriksoe@REDACTED (=?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?=) Date: Sun, 2 Sep 2012 09:25:33 +0200 Subject: [erlang-questions] Fail politely, fail noisily In-Reply-To: References: Message-ID: We used a similar, though more lightweight and probably less thought-through version of this: use make_ref() and show the reference both to the user and in the logs. (Compared to Jesper's approach, this has potential uniqueness issues, and gives less control over display form, unless you really work for it. On the other hand, Jesper's function technically has a uniqueness problem wrt. multiple nodes - so it'd make sense to add a node() component there.) Den 30/08/2012 16.53 skrev "Jesper Louis Andersen" < jesper.louis.andersen@REDACTED>: > > On Aug 29, 2012, at 9:47 AM, Thomas Elsgaard > wrote: > > > Hi Joe > > > > There is also PHK's concept of "guru meditation" in the varnish http > accelerator.. > > > > http://www.version2.dk/blog/guru-meditation-9738 > > > > Basically the idea is: the user cannot do anything about the error, so > let it fail, but provide the transaction Id (xid) so the admin can can > troubleshoot... > > I did this in erlang. It is very easy. When the web server crashes on the > message, you grab Trace = erlang:get_stacktrace(), and Now = erlang:now(). > Then you generate a unique token: crypto:sha(term_to_binary({Trace, Now})) > and you put that token to the user as well as in the crash log of the > server. > > Now any bug reported with a proper token just requires a grep on the logs > to find the exact error the user had. > > I think it took me 1-2 hours to write and test. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From freeakk@REDACTED Sun Sep 2 12:05:39 2012 From: freeakk@REDACTED (Michael Uvarov) Date: Sun, 2 Sep 2012 14:05:39 +0400 Subject: [erlang-questions] [notification] New address for code Message-ID: Hi, I moved my code to the organizations on github. The first group contains i18n and ux and it is here: The second group contains parse transforms: The old repositories and links are unavailable. My apologies for any inconvenience. -- Best regards, Uvarov Michael From max.lapshin@REDACTED Sun Sep 2 12:44:25 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Sun, 2 Sep 2012 14:44:25 +0400 Subject: [erlang-questions] Why appmon doesn't show supervisor Id in process tree? Message-ID: Appmon is showing only registered names of processes. Why not to show Id of supervisor tree? Should I make a patch, or this is not a desired functionality? From zabrane3@REDACTED Sun Sep 2 15:58:03 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Sun, 2 Sep 2012 15:58:03 +0200 Subject: [erlang-questions] Print Eunit report as HTML Message-ID: Hi guys, Is there an option for Eunit to print the report as HTML? Regards, Zabrane From zabrane3@REDACTED Sun Sep 2 15:58:04 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Sun, 2 Sep 2012 15:58:04 +0200 Subject: [erlang-questions] Print Eunit report as HTML Message-ID: <526BC0EF-8072-4DC8-8657-00DE9207DCF9@gmail.com> Hi guys, Is there an option for Eunit to print the report as HTML? Regards, Zabrane From per.melin@REDACTED Sun Sep 2 16:55:47 2012 From: per.melin@REDACTED (Per Melin) Date: Sun, 2 Sep 2012 16:55:47 +0200 Subject: [erlang-questions] What I dislike about Erlang In-Reply-To: References: Message-ID: <2BB7F1C0-7C6B-4A49-9378-7A874B05EAE0@gmail.com> On Aug 31, 2012, at 20:57 , Evan Miller wrote: > A few more comments specific to TinyMQ: > > On Fri, Aug 31, 2012 at 1:20 AM, Richard O'Keefe wrote: >> Another documentation failure is that we fail to document what >> is not there. In TinyMQ, a channel automatically comes into >> existence when you try to use it. Perhaps as a consequence of >> this, there is no way to shut a channel down. In TinyMQ, old >> messages are not removed from a channel when they expire, but >> the next time someone does a 'subscribe' (waves hands) or a 'poll' >> or a 'push' *after* they expire. So if processes stop sending >> and requesting messages to some channel, the last few messages, >> no matter how large, may hang around forever. I'm sure there >> is a reason, but because it's a reason for something *not* being >> there, there's no obvious place to hang the comment, and there >> isn't one. (Except for the dead 'expire' clause mentioned above.) >> >> IT'S HARD TO SPOT SALIENT DETAIL IN A SEA OF GLUE CODE. > > This probably proves your point, but just to be clear old messages > will only "hang around forever" if 1. there are no new messages on a > channel and 2. the channel continues to receive requests. If there is > no activity on a channel for max_age, the gen_server timeout is > invoked here: > > https://github.com/evanmiller/tinymq/blob/master/src/tinymq_channel_controller.erl#L76 There must be a bug there. You only specify a timeout in the return of init, but that does not persist beyond the first message received. I can't see how that timeout would ever be invoked. > That calls "expire" (erasing the reference to the channel) and then > exits the supervisor (eliminating the channel and all of its > messages). If you by that mean that it kills the supervisor, it does not. It kills itself, with the supervisor pid as its exit message. Either way, why do you create a new supervisor for each channel, and why do you create it outside the supervisor tree (i.e from a gen_server and not another supervisor)? What purpose does it serve? From mononcqc@REDACTED Sun Sep 2 17:05:20 2012 From: mononcqc@REDACTED (Fred Hebert) Date: Sun, 02 Sep 2012 11:05:20 -0400 Subject: [erlang-questions] Poll on Erlang maintenance, according to Erlang developers In-Reply-To: <503782AB.4050507@ferd.ca> References: <503782AB.4050507@ferd.ca> Message-ID: <504375B0.2090603@ferd.ca> Hello everyone, I've closed the poll and compiled the results. I'm happy to announce them on my blog, at http://ferd.ca/poll-results-erlang-maintenance.html Enjoy! On 12-08-24 9:33 AM, Fred Hebert wrote: > Hi everyone, > > in an attempt to better understand the ecosystem we Erlang developers > live in, I've decided to create a poll on what fellow developers > consider important when working with an Erlang code base that isn't > theirs. > > The poll can be filled at http://ferd.ca/poll/ and I will be thankful > for all answers we get. > > I'll come back with the results later, if enough people want to know > about them. > > Thanks for your (potential) participation, > Regards, > Fred. From emmiller@REDACTED Sun Sep 2 17:12:19 2012 From: emmiller@REDACTED (Evan Miller) Date: Sun, 2 Sep 2012 10:12:19 -0500 Subject: [erlang-questions] What I dislike about Erlang In-Reply-To: <2BB7F1C0-7C6B-4A49-9378-7A874B05EAE0@gmail.com> References: <2BB7F1C0-7C6B-4A49-9378-7A874B05EAE0@gmail.com> Message-ID: On Sun, Sep 2, 2012 at 9:55 AM, Per Melin wrote: > On Aug 31, 2012, at 20:57 , Evan Miller wrote: > >> A few more comments specific to TinyMQ: >> >> On Fri, Aug 31, 2012 at 1:20 AM, Richard O'Keefe wrote: >>> Another documentation failure is that we fail to document what >>> is not there. In TinyMQ, a channel automatically comes into >>> existence when you try to use it. Perhaps as a consequence of >>> this, there is no way to shut a channel down. In TinyMQ, old >>> messages are not removed from a channel when they expire, but >>> the next time someone does a 'subscribe' (waves hands) or a 'poll' >>> or a 'push' *after* they expire. So if processes stop sending >>> and requesting messages to some channel, the last few messages, >>> no matter how large, may hang around forever. I'm sure there >>> is a reason, but because it's a reason for something *not* being >>> there, there's no obvious place to hang the comment, and there >>> isn't one. (Except for the dead 'expire' clause mentioned above.) >>> >>> IT'S HARD TO SPOT SALIENT DETAIL IN A SEA OF GLUE CODE. >> >> This probably proves your point, but just to be clear old messages >> will only "hang around forever" if 1. there are no new messages on a >> channel and 2. the channel continues to receive requests. If there is >> no activity on a channel for max_age, the gen_server timeout is >> invoked here: >> >> https://github.com/evanmiller/tinymq/blob/master/src/tinymq_channel_controller.erl#L76 > > There must be a bug there. You only specify a timeout in the return of init, but that does not persist beyond the first message received. I can't see how that timeout would ever be invoked. > Perhaps I am confused, but I thought the gen_server timeout will also occur between messages. > >> That calls "expire" (erasing the reference to the channel) and then >> exits the supervisor (eliminating the channel and all of its >> messages). > > If you by that mean that it kills the supervisor, it does not. It kills itself, with the supervisor pid as its exit message. Thanks, that is a bug in the code. > > Either way, why do you create a new supervisor for each channel, and why do you create it outside the supervisor tree (i.e from a gen_server and not another supervisor)? What purpose does it serve? > The gen_server does "double duty" as a controller and a supervisor; this is poor design on my part. There should probably be a single supervisor process for all the channels, monitored by the same supervisor that monitors the main controller. -- Evan Miller http://www.evanmiller.org/ From per.melin@REDACTED Sun Sep 2 17:41:54 2012 From: per.melin@REDACTED (Per Melin) Date: Sun, 2 Sep 2012 17:41:54 +0200 Subject: [erlang-questions] What I dislike about Erlang In-Reply-To: References: <2BB7F1C0-7C6B-4A49-9378-7A874B05EAE0@gmail.com> Message-ID: <9587CD0F-491E-4CE9-956C-38C4BD03A4BB@gmail.com> On Sep 2, 2012, at 17:12 , Evan Miller wrote: >>> This probably proves your point, but just to be clear old messages >>> will only "hang around forever" if 1. there are no new messages on a >>> channel and 2. the channel continues to receive requests. If there is >>> no activity on a channel for max_age, the gen_server timeout is >>> invoked here: >>> >>> https://github.com/evanmiller/tinymq/blob/master/src/tinymq_channel_controller.erl#L76 >> >> There must be a bug there. You only specify a timeout in the return of init, but that does not persist beyond the first message received. I can't see how that timeout would ever be invoked. >> > > Perhaps I am confused, but I thought the gen_server timeout will also > occur between messages. The timeout only persists until it fires or a message comes in. The timer is not restarted by a message, it is discarded. So you'll need to supply the timeout duration again in each and every reply/noreply tuple from handle_call, handle_cast and handle_info. I find this inconvenient and very error prone though, and normally use erlang:send_after(Time, self(), timeout) instead. You'll of course need to keep track of the reference though and reset the timer yourself. From max.lapshin@REDACTED Sun Sep 2 18:14:11 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Sun, 2 Sep 2012 20:14:11 +0400 Subject: [erlang-questions] Poll on Erlang maintenance, according to Erlang developers In-Reply-To: <504375B0.2090603@ferd.ca> References: <503782AB.4050507@ferd.ca> <504375B0.2090603@ferd.ca> Message-ID: Fred, thank you very much. Last three graphs are very interesting, because it is possible to see, how understanding of importance migrates in time. From mahesh@REDACTED Sun Sep 2 19:33:15 2012 From: mahesh@REDACTED (Mahesh Paolini-Subramanya) Date: Sun, 2 Sep 2012 12:33:15 -0500 Subject: [erlang-questions] Poll on Erlang maintenance, according to Erlang developers In-Reply-To: References: <503782AB.4050507@ferd.ca> <504375B0.2090603@ferd.ca> Message-ID: <5B465B5A-39B6-4DD5-9C36-991B77E1A286@dieswaytoofast.com> > If I'd have to give a personnal guess to explain it, I'd say that the common structure of OTP behaviours and applications tend to give some stricter modularity constraints to a system, on top of wrapping common behaviours under very well known patterns. I would quite agree with this - it applies across quite a few of the results from your poll, (Importance of OTP, Time to adapt, Factors in maintenance, Knowledge of OTP, etc.) While not a guarantee, the odds are that the more OTP-like the code, the more likely that a reasonable "Separation of Concerns" has been maintained, with "distribution" and "business logic" being somewhat distinct. There are also a whole bunch of second-order effects that come into play - if you're using OTP, you probably spent some time figuring out how to actually accomplish the task at hand (w/ the obligatory hierarchy of gen_server, gen_fsm, and gen_event usage :-) ), etc., which definitely makes other people's lives easier if they have to live/work with your code... Cheers p.s. Thanks for the yeoman's work Fred! Mahesh Paolini-Subramanya That Tall Bald Indian Guy... Blog | Twitter | Google+ On Sep 2, 2012, at 11:14 AM, Max Lapshin wrote: > Fred, thank you very much. > > Last three graphs are very interesting, because it is possible to see, > how understanding of importance migrates in time. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From zabrane3@REDACTED Sun Sep 2 20:05:55 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Sun, 2 Sep 2012 20:05:55 +0200 Subject: [erlang-questions] Difference between ei.a and ei_st.a? Message-ID: <4DA18AB8-A446-42E3-AA91-1D0F271C0969@gmail.com> Hi guys, $ ls -la /usr/lib/erlang/lib/erl_interface-3.7.7/lib/ total 3352 drwxr-xr-x 6 root wheel 204 11 jui 17:59 . drwxr-xr-x 6 root wheel 204 11 jui 17:15 .. -rw-r--r-- 1 root wheel 611488 11 jui 17:59 libei.a -rw-r--r-- 1 root wheel 599240 11 jui 17:59 libei_st.a -rw-r--r-- 1 root wheel 247816 11 jui 17:59 liberl_interface.a -rw-r--r-- 1 root wheel 247000 11 jui 17:59 liberl_interface_st.a Why there's 2 libei*.a? Which one should I link to when building my linked-in driver (or NIF)? N.B: same for Windows, there's: ei.lib and ei_md.lib (and even ei_mdd.lib) !!! Regards, Zabrane From wallentin.dahlberg@REDACTED Mon Sep 3 00:42:17 2012 From: wallentin.dahlberg@REDACTED (=?ISO-8859-1?Q?Bj=F6rn=2DEgil_Dahlberg?=) Date: Mon, 3 Sep 2012 00:42:17 +0200 Subject: [erlang-questions] Difference between ei.a and ei_st.a? In-Reply-To: <4DA18AB8-A446-42E3-AA91-1D0F271C0969@gmail.com> References: <4DA18AB8-A446-42E3-AA91-1D0F271C0969@gmail.com> Message-ID: Hi, ST is not thread safe. You get only libei_st.a if configure can't find a suitable thread library. Both are built when a thread library is found. On a side note. Are you sure you want to use erl_interface in a NIF or a linked-in driver? Erl_Interface is useful when creating c-nodes and talking distribution to erlang nodes otherwise, not so much. I know there are examples where ei is used in linked-in drivers and I think they are misleading. // Bj?rn-Egil 2012/9/2 Zabrane Mickael > Hi guys, > > $ ls -la /usr/lib/erlang/lib/erl_interface-3.7.7/lib/ > total 3352 > drwxr-xr-x 6 root wheel 204 11 jui 17:59 . > drwxr-xr-x 6 root wheel 204 11 jui 17:15 .. > -rw-r--r-- 1 root wheel 611488 11 jui 17:59 libei.a > -rw-r--r-- 1 root wheel 599240 11 jui 17:59 libei_st.a > -rw-r--r-- 1 root wheel 247816 11 jui 17:59 liberl_interface.a > -rw-r--r-- 1 root wheel 247000 11 jui 17:59 liberl_interface_st.a > > > Why there's 2 libei*.a? > Which one should I link to when building my linked-in driver (or NIF)? > > N.B: same for Windows, there's: ei.lib and ei_md.lib (and even ei_mdd.lib) > !!! > > Regards, > Zabrane > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Mon Sep 3 01:23:54 2012 From: ok@REDACTED (Richard O'Keefe) Date: Mon, 3 Sep 2012 11:23:54 +1200 Subject: [erlang-questions] What I dislike about Erlang In-Reply-To: References: Message-ID: <4A5C003C-4B5F-471A-B262-43D3710BF93A@cs.otago.ac.nz> On 1/09/2012, at 5:42 AM, Evan Miller wrote: > Richard, > > Thanks for your comments. To preface, I plead guilty to charges of > gross negligence in failing to document TinyMQ's internals. This was > laziness on my part. I do hope that I did not give offence. There would not have been any point in criticising something *bad*. I picked on your code for three reasons: - I had just downloaded it and spent some time reading it carefully. - It was small enough that I *could* read it carefully in full. - The problems I had doing that are ones that I have had over and over again, and the biggest of them is nothing to do with you. > I released TinyMQ only because I felt guilty for sitting on the code > for about a year. Like many open-source programmers, I have a lot of > demands on my attention, and it is not clear in advance what > documentation is actually worth writing. Limitations and examples. > The @spec and @doc strings > for the public API seemed like a good start. But if it turned out that > no one was interested in using the library in the first place, why > should I bother documenting internal protocols and data structures? All I can say is that the best programmers I have worked with wrote the documentation *first*. It's part of the "research" phase that Joe Armstrong mentioned. It's how you get quality code. As Dijkstra once meant but said differently, "I am a bear of very little brain", and the first person I have to explain the code to is myself. > I've wasted many hours in the past documenting, refactoring, and > generally cleaning up application internals for the benefit of > nebulous "others", only to receive zero patches and no indication that > any of my efforts were of any assistance to anyone. > > So in the spirit of your capitalized complaints, I will just say: > > ALL YOU HAVE TO DO IS ASK > > Want to know about the big-O performance characteristics? But this is where you *START* the design! If it's a well known data structure, you can get away with leaving it to the books, but sliding windows, while common, are _not_ a well known data structure. (Well, ones where the window is a *count* of elements are tolerably well known, but ones where the window is an *age* are not. I asked about this in the Haskell mailing list, and Chris Okasaki -- Mr Functional Data Structures himself -- didn't know of anything off-the-shelf, although he did suggest something that might just work. He also raised an interesting question about the interface.) > Just ask. By the time I've asked and got a reply, seeing as we're in very different time zones, I'd have written my own. Last year I was involved in a project where I had to "just ask". The turnaround time was a week at best, and about half of my questions never did get answered. > Now, I know you were not trying to pick on TinyMQ, and your interest > is more in how Erlang tends to result in lumps of code that obscure > key characteristics of the application. I agree with the assessment, > but I am not quite as hopeless about the situation. > > I would like to see the development of graphical tools that let you > see in an instant how applications are structured and how they behave. > I am thinking of something like Pman on steroids, where I can *watch* > messages travel between processes, *inspect* gen_server state, and > *test* the system by seeing the result of single function calls or > many (load-testing). I'd like to be able to do all this with my mouse, > and generally get the feeling that I am watching the operation of a > machine that *shows* me how messages are passed, processes are > created, and state is updated. Something very like such graphical tools already exists; I recall viewing some videos someone had made using Ubigraph showing the dynamic process structure of Erlang programs. What I want, though, is to see the structure of something without having to run it or even compile it. I'm thinking more in terms of some sort of preprocessor taking something visibly and obviously a server process and emitting the lower-level Erlang code. The thing is that I believe that it is better to make something really obvious at the outset than to provide better tools for undoing obfuscation. Oh, let's put this all in perspective. Apart from my general complaint that all Erlang code tends to look alike (just like all Smalltalk or Prolog or Haskell or Lisp code tends to look alike), the internal documentation that I'd have liked to see is this: TinyMQ is a gen_server guarding a dictionary mapping channel names (normally strings) to channels, where a channel is a supervised gen_server guarding a list of subscribers and a list of {Message,Timestamp} pairs. Messages expire after MaxAge seconds but are not removed until the next time the channel does something There's an hour's close reading time saved right there. From ok@REDACTED Mon Sep 3 02:41:42 2012 From: ok@REDACTED (Richard O'Keefe) Date: Mon, 3 Sep 2012 12:41:42 +1200 Subject: [erlang-questions] Which EEP would you pick as the most important one to implement next? In-Reply-To: References: <5040842C.6010702@ninenines.eu> <87e026c04bdafbec879831e969e632a4.squirrel@chasm.otago.ac.nz> <5040FDC5.7080507@gmail.com> Message-ID: <920A4DA9-D503-450B-B76F-CDAE6809991D@cs.otago.ac.nz> On 1/09/2012, at 6:22 AM, Garrett Smith wrote: > So if there was an EEP #40 for Frames, how would that fall out in the voting? > > +1 for me - this is easily the most missing feature from the language. > > I'm not familiar with the EEP process (lazy) but if someone were to > just convert Richard's most current proposal, whatever format it's in, > to an EEP, would that work? I'd be more than happy to tackle that. The current proposal is a LaTeX document that formats as 54 pages of PDF. It needs to be drastically shortened to make a good EEP. From ok@REDACTED Mon Sep 3 02:53:41 2012 From: ok@REDACTED (Richard O'Keefe) Date: Mon, 3 Sep 2012 12:53:41 +1200 Subject: [erlang-questions] Which EEP would you pick as the most important one to implement next? In-Reply-To: References: <5040842C.6010702@ninenines.eu> <87e026c04bdafbec879831e969e632a4.squirrel@chasm.otago.ac.nz> Message-ID: <93A456AC-A73E-4F55-98DE-ED6A63E8843F@cs.otago.ac.nz> On 1/09/2012, at 2:39 AM, Steve Vinoski wrote: > Agreed. Also, Richard, you might try writing your proposal in > something other than markdown, something that gives you what you're > aiming for, and then using pandoc to convert it to markdown for > submission -- see http://johnmacfarlane.net/pandoc/ if you're not > familiar with pandoc. No, I wasn't familiar with pandoc. I'm installing it now. It's a little disconcerting seeing deprecation warnings, but at least they're _only_ deprecation warnings, whoops, wrote too soon. ld: warning: could not create compact unwind for .LFB3: non-standard register 5 being saved in prolog There is a problem. It converts LaTeX `` to `` and ' and '' to some UTF8 gibberish even when I specify --ascii. When I convert to HTML, I see this: The topic is really a little more general: it???s ``getting insight into the structure and behaviour of a program by using tools that summarise execution traces??????. From zabrane3@REDACTED Mon Sep 3 06:27:12 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Mon, 3 Sep 2012 06:27:12 +0200 Subject: [erlang-questions] Difference between ei.a and ei_st.a? In-Reply-To: References: <4DA18AB8-A446-42E3-AA91-1D0F271C0969@gmail.com> Message-ID: <3D6A4B06-72FE-4DE4-AF63-0824D5E4C029@gmail.com> Hi Bj?rn, > ST is not thread safe. You get only libei_st.a if configure can't find a suitable thread library. > Both are built when a thread library is found. Ok I see. So the best is to link with "libei.a" which is threa safe (and avoid "ibei_st.a"), right? Does the same apply for windows? Should I link with "ei.lib" instead of "ei_md.lib"? > On a side note. Are you sure you want to use erl_interface in a NIF or a linked-in driver? No no, it was just an example. Regards, Zabrane From satyamshekhar@REDACTED Mon Sep 3 06:47:23 2012 From: satyamshekhar@REDACTED (Satyam Shekhar) Date: Mon, 3 Sep 2012 10:17:23 +0530 Subject: [erlang-questions] gen_tcp send blocks gen_tcp recv. Message-ID: Hi, I know this question has been asked many times. http://erlang.2086793.n4.nabble.com/Non-blocking-sends-in-gen-tcp-td2114537.html https://groups.google.com/forum/?fromgroups=#!topic/erlang-programming/4DBmCK4GAK8 But my concern is slightly different. I have a separate sending/receiving process, P1, for a gen_tcp socket which receives messages it has to send, from process P2. There is no acking between the P1 and P2. Data is buffered at P2 and data acking is client driven, i.e that client says how much data it has received when it reconnects. Right now, P2 sends data to P1 as soon as it generates any data, and also adds it to its buffer, so that it can send it to the client if the socket gets closed before client receives it. The issue is, since the gen_tcp send call is blocking, and P2 might flood P1s mailbox at times, received messages(socket in active once mode) from the client are delayed quite a bit. What is the best way to handle this? Regards, Satyam Shekhar -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.jarvstrand@REDACTED Mon Sep 3 08:24:41 2012 From: thomas.jarvstrand@REDACTED (=?ISO-8859-1?Q?Thomas_J=E4rvstrand?=) Date: Mon, 3 Sep 2012 08:24:41 +0200 Subject: [erlang-questions] Licensing an Erlang/Emacs Lisp project In-Reply-To: References: Message-ID: Hi again, After some time, I finally got the below reply from the free software foundation. It seems my worries where unfounded and I can move on with my life :) Thomas Hello and thank you for writing in. > I'm currently working on a project in Emacs Lisp. The project is open > sourced under the LGPL but I recently realized that some of the > submodules I use is under GPL and so I believe I have to change my > licensing. LGPLv3 is compatible with GPLv3. So there isn't anything in the above that would pose a problem. > My problem is that I have no idea what license to choose. Part of my > code will be running in Erlang and part of the code will be running in > Elisp inside an Emacs instance. The submodules are not actually > shipped *with*the project if that makes any difference, but are > fetched upon building the project. Generally speaking, what matters is if the separate modules combine to make one program, not how they are distributed. > Specifically, in Erlang I currently have one submodule licensed under > the MIT license, I'll assume you mean a generally permissive license such as the Expat license (http://directory.fsf.org/wiki/License:Expat), which is often ambiguously called the MIT license. It is GPL compatible, so no problem here. > and one under Apache v2. Apache v2 is also GPLv3 compatible. > In Elisp I'm using 3 submodules that are licensed under GPLv3. > Is there any way that I can cook this soup? I hear that Erlang doesn't > really work that well with GPL People will often write in to say that because of feature X then they think that language Y breaks the GPL. But the GPL is a copyright license which can be applied to essentially any copyrightable work for which you can identify the source. There are issues regarding the use of interpreted languages with runtime bindings (detailed in the two FAQ entries below) but it is unclear if any of these apply to your situation: http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL http://www.gnu.org/licenses/gpl-faq.html#InterpreterIncompat > so should I pull out the Erlang parts of the project and license them > separately? Can I then use these as part of my project? So far I didn't really see a licensing issue, since all of the separate parts had mutually compatible licenses. See: http://www.gnu.org/licenses/gpl-faq.html#WhatIsCompatible http://www.gnu.org/licenses/gpl-faq.html#WhatDoesCompatMean > The Elisp code will be communicating with the Erlang parts through a > rest-interface. Actually, if your software is making calls to the Erlang code via a REST interface, as an external service calling a published external interface without really knowing anything about how that specific Erlang program works internally, then it might be the case that you are interacting with it "at arms length". > All these licenses confuse me to no end, so it'd be great to get some > advice. Basically my project a bunch of porcelain code that binds > together and configures a bunch of useful tools for erlang > development. The whole point of it is to be an easy-to-setup solution, > so I'd really not like to have to resort to "download this from here, > configure this way, rinse, repeat". > I have no issue with licensing my project under GPL, but I need a > model that will be compatible with what I currently use and gives me > freedom to add new parts to the project in the future. It seems most > Emacs libraries are licensed under GPL, but I hear GPL does not really > work that well for Erlang projects due to how linking is > interpreted. I believe for Erlang projects, the most commonly used are > MIT or Apache. I hope my answers above are of help. If you have further doubts or questions, please feel free to write back and I'll do my best to expedite my reply. -- I am not a lawyer, the above is not legal advice Regards, Yoni Rabkin On Sat, Sep 1, 2012 at 10:31 AM, Erik S?e S?rensen wrote: > > Den 31/08/2012 16.00 skrev "Thomas J?rvstrand" < > thomas.jarvstrand@REDACTED>: > > > > > Hi, > > > > I'm currently working on a project that is a combination of Erlang and > Emacs Lisp. The project is currently open sourced under the LGPL but I > recently realized that some of the submodules I use are under GPL (the > elisp ones) and so I believe I have to change my licensing. > > > > My problem is that I have no idea what license to choose. Part of my > code will be running in Erlang and part of the code will be running in > Elisp inside an Emacs instance. The submodules are not actually shipped > with the project if that makes any difference, but are fetched upon > building the project. > > > > Specifically, in Erlang I currently have one submodule licensed under > the MIT license, and one under Apache v2. In Elisp I'm using 3 submodules, > all of which are licensed under GPLv3. > > > > Is there any way that I can cook this soup? I hear that Erlang doesn't > really work that well with GPL so should I pull out the Erlang parts of the > project and license them separately? Can I then use these as part of my > project? The Elisp code will be communicating with the Erlang parts through > a rest-interface if that makes any difference. > > I believe it does - if your code is not linked to the GPL parts, but > merely communicate with GPL parts which exist in a separate OS process, > then there is no issue, as I recall it. > (Ianal, of course.) > > > All these licenses confuse me to no end, so it'd be great to get some > advice. Basically my project a bunch of porcelain code that binds together > and configures a bunch of useful tools for erlang development. The whole > point of it is to be an easy-to-setup solution, so I'd really not like to > have to resort to "download this from here, configure this way, rinse, > repeat". > > > > I have no issue with licensing my project under GPL, but I would like a > model that is compatible with what I currently use and gives me freedom to > add new parts to the project in the future. > > > > I would be thankful for any help > > > > Sincerely > > > > Thomas J?rvstrand > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksoe@REDACTED Mon Sep 3 09:17:10 2012 From: eriksoe@REDACTED (=?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?=) Date: Mon, 3 Sep 2012 09:17:10 +0200 Subject: [erlang-questions] gen_tcp send blocks gen_tcp recv. In-Reply-To: References: Message-ID: Have you considered having one process for sending and one for receiving (on the same socket)? Den 03/09/2012 06.47 skrev "Satyam Shekhar" : > Hi, > > I know this question has been asked many times. > > > http://erlang.2086793.n4.nabble.com/Non-blocking-sends-in-gen-tcp-td2114537.html > > https://groups.google.com/forum/?fromgroups=#!topic/erlang-programming/4DBmCK4GAK8 > > But my concern is slightly different. I have a separate sending/receiving > process, P1, for a gen_tcp socket which receives messages it has to send, > from process P2. There is no acking between the P1 and P2. Data is buffered > at P2 and data acking is client driven, i.e that client says how much data > it has received when it reconnects. Right now, P2 sends data to P1 as soon > as it generates any data, and also adds it to its buffer, so that it can > send it to the client if the socket gets closed before client receives it. > > The issue is, since the gen_tcp send call is blocking, and P2 might flood > P1s mailbox at times, received messages(socket in active once mode) from > the client are delayed quite a bit. > > What is the best way to handle this? > > Regards, > Satyam Shekhar > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From poprosturadek@REDACTED Mon Sep 3 10:00:43 2012 From: poprosturadek@REDACTED (=?UTF-8?B?UmFkb3PFgmF3IE1pc2l1aw==?=) Date: Mon, 03 Sep 2012 10:00:43 +0200 Subject: [erlang-questions] Which EEP would you pick as the most important one to implement next? In-Reply-To: <93A456AC-A73E-4F55-98DE-ED6A63E8843F@cs.otago.ac.nz> References: <5040842C.6010702@ninenines.eu> <87e026c04bdafbec879831e969e632a4.squirrel@chasm.otago.ac.nz> <93A456AC-A73E-4F55-98DE-ED6A63E8843F@cs.otago.ac.nz> Message-ID: <504463AB.6050102@gmail.com> W dniu 2012-09-03 02:53, Richard O'Keefe pisze: > On 1/09/2012, at 2:39 AM, Steve Vinoski wrote: >> Agreed. Also, Richard, you might try writing your proposal in >> something other than markdown, something that gives you what you're >> aiming for, and then using pandoc to convert it to markdown for >> submission -- see http://johnmacfarlane.net/pandoc/ if you're not >> familiar with pandoc. > No, I wasn't familiar with pandoc. > I'm installing it now. > It's a little disconcerting seeing deprecation warnings, > but at least they're _only_ deprecation warnings, > whoops, wrote too soon. > > ld: warning: could not create compact unwind for .LFB3: non-standard register 5 being saved in prolog > > There is a problem. It converts LaTeX `` to `` and ' and '' to some UTF8 > gibberish even when I specify --ascii. When I convert to HTML, I see this: > > The topic is really a little more general: > it???s ``getting insight into the structure and behaviour of a > program by using tools that summarise execution traces??????. > While I'm not really sure, it probably has something to do with xunicode package in LaTeX. I had similar problems and |--latex-engine=|/xelatex/ helped. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From Sergey_Zhemzhitsky@REDACTED Mon Sep 3 10:23:58 2012 From: Sergey_Zhemzhitsky@REDACTED (Zhemzhitsky Sergey) Date: Mon, 3 Sep 2012 08:23:58 +0000 Subject: [erlang-questions] Port is NULL verification in the start callback of a linked-in driver Message-ID: <06139A918ACCA041BF46A0F36940C7FA4FE39FA0@exch-mbx1.msk.trd.ru> Hi erlangers, I'm wondering whether it?s necessary to check that port is not NULL in the start callback of the driver: ErlDrvData (*start)(ErlDrvPort port, char *command); I?m asking because there are some samples that do such a verification, i.e. https://github.com/dlfen/erlang-db-driver/blob/master/c_src/base/AsyncDrv.cpp#L29 https://github.com/norton/lets/blob/master/c_src/lets_drv.cc#L251 and a lot of port drivers that do not. As I understand (according to the otp sources) port parameter is only a number of the port in the erts_port array (https://github.com/erlang/otp/blob/maint/erts/emulator/beam/io.c#L60) and 0 (zero) is a valid value for it. So I have two questions: 1. Is it necessary to check that the port parameter in the start callback of the driver is not NULL (not 0) and why? 2. If 0 (zero) is a legal value for the port parameter in the start callback of the driver, why there are drivers which require that parameter to be not NULL (or this is a kind of a bug)? Best Regards, Sergey _______________________________________________________ The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. If you need assistance please contact our Contact Center (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Mon Sep 3 10:38:32 2012 From: dmkolesnikov@REDACTED (dmitry kolesnikov) Date: Mon, 3 Sep 2012 11:38:32 +0300 Subject: [erlang-questions] Print Eunit report as HTML In-Reply-To: <526BC0EF-8072-4DC8-8657-00DE9207DCF9@gmail.com> References: <526BC0EF-8072-4DC8-8657-00DE9207DCF9@gmail.com> Message-ID: <-2112727161973902506@unknownmsgid> Hello, Rebar has a feature to get coverage reports in HTML. Best Regards, Dmitry >-|-|-*> On 2.9.2012, at 16.59, Zabrane Mickael wrote: > Hi guys, > > Is there an option for Eunit to print the report as HTML? > > Regards, > Zabrane > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From sverker.eriksson@REDACTED Mon Sep 3 10:52:00 2012 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Mon, 3 Sep 2012 10:52:00 +0200 Subject: [erlang-questions] Port is NULL verification in the start callback of a linked-in driver In-Reply-To: <06139A918ACCA041BF46A0F36940C7FA4FE39FA0@exch-mbx1.msk.trd.ru> References: <06139A918ACCA041BF46A0F36940C7FA4FE39FA0@exch-mbx1.msk.trd.ru> Message-ID: <50446FB0.2000805@erix.ericsson.se> ErlDrvPort is an opaque type. Comparing it to NULL is not only unnecessary but wrong. /Sverker, Erlang/OTP Zhemzhitsky Sergey wrote: > Hi erlangers, > > > > I'm wondering whether it?s necessary to check that port is not NULL in the start > callback of the driver: > > ErlDrvData (*start)(ErlDrvPort port, char *command); > > > > I?m asking because there are some samples that do such a verification, i.e. > > https://github.com/dlfen/erlang-db-driver/blob/master/c_src/base/AsyncDrv.cpp#L29 > > https://github.com/norton/lets/blob/master/c_src/lets_drv.cc#L251 > > and a lot of port drivers that do not. > > > > As I understand (according to the otp sources) port parameter is only a number > of the port in the erts_port array > (https://github.com/erlang/otp/blob/maint/erts/emulator/beam/io.c#L60) and 0 > (zero) is a valid value for it. > > > > So I have two questions: > > > > 1. Is it necessary to check that the port parameter in the start callback > of the driver is not NULL (not 0) and why? > > 2. If 0 (zero) is a legal value for the port parameter in the start > callback of the driver, why there are drivers which require that parameter to be > not NULL (or this is a kind of a bug)? > > > > > > Best Regards, > > Sergey > > > > _______________________________________________________ > > > > The information contained in this message may be privileged and conf idential > and protected from disclosure. If you are not the original intended recipient, > you are hereby notified that any review, retransmission, dissemination, or other > use of, or taking of any action in reliance upon, this information is > prohibited. If you have received this communication in error, please notify the > sender immediately by replying to this message and delete it from your computer. > Thank you for your cooperation. Troika Dialog, Russia. > > If you need assistance please contact our Contact Center (+7495) 258 0500 or go > to www.troika.ru/eng/Contacts/system.wbp > > > > From dangud@REDACTED Mon Sep 3 10:59:37 2012 From: dangud@REDACTED (Dan Gudmundsson) Date: Mon, 3 Sep 2012 10:59:37 +0200 Subject: [erlang-questions] Why appmon doesn't show supervisor Id in process tree? In-Reply-To: References: Message-ID: We are dropping appmon, and replacing it with observer instead. If you click on process in observer, the pid is shown in the status bar. /Dan On Sun, Sep 2, 2012 at 12:44 PM, Max Lapshin wrote: > Appmon is showing only registered names of processes. > Why not to show Id of supervisor tree? Should I make a patch, or this > is not a desired functionality? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From tobias.lindahl@REDACTED Mon Sep 3 10:59:45 2012 From: tobias.lindahl@REDACTED (Tobias Lindahl) Date: Mon, 3 Sep 2012 10:59:45 +0200 Subject: [erlang-questions] incomplete union checks in dialyzer In-Reply-To: <20120830200158.GA4846@precise> References: <503F37BE.4030002@cs.ntua.gr> <503F3A77.4010004@cs.ntua.gr> <20120830200158.GA4846@precise> Message-ID: 2012/8/30 Motiejus Jak?tys > On Thu, Aug 30, 2012 at 02:41:19PM +0200, Tobias Lindahl wrote: > > 2012/8/30 Motiejus Jak?tys > > > > > On Thu, Aug 30, 2012 at 12:03 PM, Kostis Sagonas > > > wrote: > > > > On 08/30/2012 11:53 AM, Motiejus Jak?tys wrote: > > > >> > > > >> I wonder how hard would this be to encapsulate and add to dialyzer > as > > > >> a run-time option? > > > > > > > > > > > > Very simple, I guess. > > > > > > Thanks again. I will look into that. > > > > > > > > I'm not sure that this is a good idea. This set limit is controlling the > > size of the inferred types, basically telling Dialyzer when to abstract > > some types (i.e., 15 separate atoms will be collapsed into atom()). This > is > > of course affecting the fix point behavior of the analysis, as Kostis > says, > > which is fine. > > > > However, if the plt is built with one setting and the later analysis uses > > another, I can imagine that you might end up in a situation where no fix > > point can be found, yielding an infinite loop. > > > > Making this into a run time option indicates that it is something you can > > play around with in order to get better results. To some extent it is, > but > > since it can have pretty serious implications it might not be a good > idea. > > Hi, > thanks for your comments. > > This is a good point. PLT and dialyzer runtime should be compatible. > > How about making this an option for --build_plt? And always getting the > value from PLT for analysis? > > Sounds reasonable. > Motiejus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Sergey_Zhemzhitsky@REDACTED Mon Sep 3 11:15:34 2012 From: Sergey_Zhemzhitsky@REDACTED (Zhemzhitsky Sergey) Date: Mon, 3 Sep 2012 09:15:34 +0000 Subject: [erlang-questions] Port is NULL verification in the start callback of a linked-in driver In-Reply-To: <50446FB0.2000805@erix.ericsson.se> References: <06139A918ACCA041BF46A0F36940C7FA4FE39FA0@exch-mbx1.msk.trd.ru> <50446FB0.2000805@erix.ericsson.se> Message-ID: <06139A918ACCA041BF46A0F36940C7FA4FE3A2C4@exch-mbx1.msk.trd.ru> Hello Sverker, Thanks a lot for help! Regards, Sergey Zhemzhitsky -----Original Message----- From: Sverker Eriksson [mailto:sverker.eriksson@REDACTED] Sent: Monday, September 03, 2012 12:52 PM To: Zhemzhitsky Sergey Cc: Erlang Questions Subject: Re: [erlang-questions] Port is NULL verification in the start callback of a linked-in driver ErlDrvPort is an opaque type. Comparing it to NULL is not only unnecessary but wrong. /Sverker, Erlang/OTP Zhemzhitsky Sergey wrote: > Hi erlangers, > > > > I'm wondering whether it?s necessary to check that port is not NULL in > the start callback of the driver: > > ErlDrvData (*start)(ErlDrvPort port, char *command); > > > > I?m asking because there are some samples that do such a verification, i.e. > > https://github.com/dlfen/erlang-db-driver/blob/master/c_src/base/Async > Drv.cpp#L29 > > https://github.com/norton/lets/blob/master/c_src/lets_drv.cc#L251 > > and a lot of port drivers that do not. > > > > As I understand (according to the otp sources) port parameter is only > a number of the port in the erts_port array > (https://github.com/erlang/otp/blob/maint/erts/emulator/beam/io.c#L60) > and 0 > (zero) is a valid value for it. > > > > So I have two questions: > > > > 1. Is it necessary to check that the port parameter in the start callback > of the driver is not NULL (not 0) and why? > > 2. If 0 (zero) is a legal value for the port parameter in the start > callback of the driver, why there are drivers which require that > parameter to be not NULL (or this is a kind of a bug)? > > > > > > Best Regards, > > Sergey > > > > _______________________________________________________ > > > > The information contained in this message may be privileged and conf > idential and protected from disclosure. If you are not the original > intended recipient, you are hereby notified that any review, > retransmission, dissemination, or other use of, or taking of any > action in reliance upon, this information is prohibited. If you have > received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. > Thank you for your cooperation. Troika Dialog, Russia. > > If you need assistance please contact our Contact Center (+7495) 258 > 0500 or go to www.troika.ru/eng/Contacts/system.wbp > > > > From egil@REDACTED Mon Sep 3 11:40:34 2012 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Mon, 3 Sep 2012 11:40:34 +0200 Subject: [erlang-questions] Difference between ei.a and ei_st.a? In-Reply-To: <3D6A4B06-72FE-4DE4-AF63-0824D5E4C029@gmail.com> References: <4DA18AB8-A446-42E3-AA91-1D0F271C0969@gmail.com> <3D6A4B06-72FE-4DE4-AF63-0824D5E4C029@gmail.com> Message-ID: <50447B12.3050200@erlang.org> On 2012-09-03 06:27, Zabrane Mickael wrote: > Hi Bj?rn, > >> ST is not thread safe. You get only libei_st.a if configure can't find a suitable thread library. >> Both are built when a thread library is found. > Ok I see. So the best is to link with "libei.a" which is threa safe (and avoid "ibei_st.a"), right? > > Does the same apply for windows? Should I link with "ei.lib" instead of "ei_md.lib"? MD = multithreaded dynamic MDD = multithreaded dynamic with debug symbols (Became unsure and have to look it up =) Note also that in the non-windows case the name can change meaning. If thread lib detected libei_st = not thread safe (single threaded) libei = thread safe if no thread lib is detected libei = not thread safe (single threaded) I'm unsure if this is a wise convention. Probably just to be able to say "link with libei.a and liberl_interface.a" regardless. This can all be seen in lib/erl_interface/src/Makefile.in // egil > >> On a side note. Are you sure you want to use erl_interface in a NIF or a linked-in driver? > No no, it was just an example. > > Regards, > Zabrane > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > From max.lapshin@REDACTED Mon Sep 3 12:19:49 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 3 Sep 2012 14:19:49 +0400 Subject: [erlang-questions] Why appmon doesn't show supervisor Id in process tree? In-Reply-To: References: Message-ID: On Mon, Sep 3, 2012 at 12:59 PM, Dan Gudmundsson wrote: > We are dropping appmon, and replacing it with observer instead. > > If you click on process in observer, the pid is shown in the status bar. > Ok. I see. Is it possible that once observer will work under OS X? From zabrane3@REDACTED Mon Sep 3 13:16:47 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Mon, 3 Sep 2012 13:16:47 +0200 Subject: [erlang-questions] Difference between ei.a and ei_st.a? In-Reply-To: <50447B12.3050200@erlang.org> References: <4DA18AB8-A446-42E3-AA91-1D0F271C0969@gmail.com> <3D6A4B06-72FE-4DE4-AF63-0824D5E4C029@gmail.com> <50447B12.3050200@erlang.org> Message-ID: <43BC4D32-F51A-4268-9221-D23ACDE5C67C@gmail.com> 1000x thanks Egil. Regards, Zabrane On Sep 3, 2012, at 11:40 AM, Bj?rn-Egil Dahlberg wrote: > On 2012-09-03 06:27, Zabrane Mickael wrote: >> Hi Bj?rn, >> >>> ST is not thread safe. You get only libei_st.a if configure can't find a suitable thread library. >>> Both are built when a thread library is found. >> Ok I see. So the best is to link with "libei.a" which is threa safe (and avoid "ibei_st.a"), right? >> >> Does the same apply for windows? Should I link with "ei.lib" instead of "ei_md.lib"? > MD = multithreaded dynamic > MDD = multithreaded dynamic with debug symbols > > (Became unsure and have to look it up =) > > Note also that in the non-windows case the name can change meaning. > > If thread lib detected > libei_st = not thread safe (single threaded) > libei = thread safe > > if no thread lib is detected > libei = not thread safe (single threaded) > > I'm unsure if this is a wise convention. Probably just to be able to say "link with libei.a and liberl_interface.a" regardless. > > This can all be seen in lib/erl_interface/src/Makefile.in > > // egil > > >> >>> On a side note. Are you sure you want to use erl_interface in a NIF or a linked-in driver? >> No no, it was just an example. >> >> Regards, >> Zabrane >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions Regards, Zabrane From zabrane3@REDACTED Mon Sep 3 13:18:20 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Mon, 3 Sep 2012 13:18:20 +0200 Subject: [erlang-questions] Print Eunit report as HTML In-Reply-To: <-2112727161973902506@unknownmsgid> References: <526BC0EF-8072-4DC8-8657-00DE9207DCF9@gmail.com> <-2112727161973902506@unknownmsgid> Message-ID: <72D962F5-D85C-48C7-A887-58A20CF1102B@gmail.com> Hi Dmitry, > Rebar has a feature to get coverage reports in HTML. This is not a "rebar" feature, but provided by "cover" in general. Anyway thx. Regards, Zabrane > Best Regards, > Dmitry >-|-|-*> > > > On 2.9.2012, at 16.59, Zabrane Mickael wrote: > >> Hi guys, >> >> Is there an option for Eunit to print the report as HTML? >> >> Regards, >> Zabrane >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From per@REDACTED Mon Sep 3 15:05:48 2012 From: per@REDACTED (Per Hedeland) Date: Mon, 3 Sep 2012 15:05:48 +0200 (CEST) Subject: [erlang-questions] Difference between ei.a and ei_st.a? In-Reply-To: <50447B12.3050200@erlang.org> Message-ID: <201209031305.q83D5m8d093435@pluto.hedeland.org> Bj?rn-Egil Dahlberg wrote: > >Note also that in the non-windows case the name can change meaning. > >If thread lib detected >libei_st = not thread safe (single threaded) >libei = thread safe > >if no thread lib is detected >libei = not thread safe (single threaded) (and ditto for liberl_interface). Thanks, I was just about to point this out, since we got bitten by the silent build of a non-thread-safe version called liberl_interface.a (on QNX...). >I'm unsure if this is a wise convention. Probably just to be able to say >"link with libei.a and liberl_interface.a" regardless. Right, who wants to link with an unsafe version.:-) It makes superficial sense, but is a really bad idea if you need to build for many different OSes and don't dig deeply into the configure/Makefile logic when it just "seems to work", nor specifically test thread-safeness of the result (may not be simple). What I did - besides teaching lib/erl_interface/configure.in to look for pthreads support in libc (where it can be found on QNX) - was a minor tweak such that this configure *fails* if you pass --enable-threads and no pthreads support can be found (and then made sure to pass this option in our builds, of course). Unfortunately I never got around to offer those changes back to OTP, and as reward I now find that they were lost in one of our OTP upgrades.:-( (I still have the original ones of course.) --Per From gleber.p@REDACTED Mon Sep 3 15:35:23 2012 From: gleber.p@REDACTED (Gleb Peregud) Date: Mon, 3 Sep 2012 15:35:23 +0200 Subject: [erlang-questions] Segmentation fault with lcnt compiled beam and +A In-Reply-To: <503F7CD0.6050701@erlang.org> References: <503F7BDD.2080802@erlang.org> <503F7CD0.6050701@erlang.org> Message-ID: On Thu, Aug 30, 2012 at 4:46 PM, Bj?rn-Egil Dahlberg wrote: > I couldn't reproduce the error on current OTP_R15B02-maint branch but not I > could reproduce the error in OTP_R15B01. Hopefully the problem is already > fixed =) > > Give me a shout if you see it in current maint branch as well. I've tested it out on one of those machines and it works without problems using maint branch (at commit 66573cb). Thanks! From arun11299@REDACTED Mon Sep 3 17:31:19 2012 From: arun11299@REDACTED (Arun Muralidharan) Date: Mon, 3 Sep 2012 21:01:19 +0530 Subject: [erlang-questions] gen_tcp send blocks gen_tcp recv. In-Reply-To: References: Message-ID: Can you be more specific on how your sending process is overloading your receiving process(P1) by making a "blocking" call ? I didnt quite get it. Why dont you try an async design pattern as shown in http://www.trapexit.org/Building_a_Non-blocking_TCP_server_using_OTP_principles -Arun On Mon, Sep 3, 2012 at 12:47 PM, Erik S?e S?rensen wrote: > Have you considered having one process for sending and one for receiving > (on the same socket)? > Den 03/09/2012 06.47 skrev "Satyam Shekhar" : > >> Hi, >> >> I know this question has been asked many times. >> >> >> http://erlang.2086793.n4.nabble.com/Non-blocking-sends-in-gen-tcp-td2114537.html >> >> https://groups.google.com/forum/?fromgroups=#!topic/erlang-programming/4DBmCK4GAK8 >> >> But my concern is slightly different. I have a separate sending/receiving >> process, P1, for a gen_tcp socket which receives messages it has to send, >> from process P2. There is no acking between the P1 and P2. Data is buffered >> at P2 and data acking is client driven, i.e that client says how much data >> it has received when it reconnects. Right now, P2 sends data to P1 as soon >> as it generates any data, and also adds it to its buffer, so that it can >> send it to the client if the socket gets closed before client receives it. >> >> The issue is, since the gen_tcp send call is blocking, and P2 might flood >> P1s mailbox at times, received messages(socket in active once mode) from >> the client are delayed quite a bit. >> >> What is the best way to handle this? >> >> Regards, >> Satyam Shekhar >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Mon Sep 3 20:41:21 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 3 Sep 2012 22:41:21 +0400 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? Message-ID: cowboy:set_protocol_options doesn't change dispatch rules. From essen@REDACTED Mon Sep 3 20:42:30 2012 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Mon, 03 Sep 2012 20:42:30 +0200 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: References: Message-ID: <5044FA16.5050406@ninenines.eu> On 09/03/2012 08:41 PM, Max Lapshin wrote: > cowboy:set_protocol_options doesn't change dispatch rules. It changes protocol options which includes dispatch rules? -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From max.lapshin@REDACTED Mon Sep 3 20:45:31 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 3 Sep 2012 22:45:31 +0400 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: <5044FA16.5050406@ninenines.eu> References: <5044FA16.5050406@ninenines.eu> Message-ID: On Mon, Sep 3, 2012 at 10:42 PM, Lo?c Hoguin wrote: > On 09/03/2012 08:41 PM, Max Lapshin wrote: >> >> cowboy:set_protocol_options doesn't change dispatch rules. > > > It changes protocol options which includes dispatch rules? > I put io:format in cowboy_dispatcher on line 104: match(_Host, Path, [{'_', PathMatchs}|_Tail]) -> match_path(Path, PathMatchs, [], undefined); and see, that PathMatchs and cowboy:get_protocol_options differs. Looks like new protocol options are passed only to new workers, while old live with old rules. From essen@REDACTED Mon Sep 3 20:46:33 2012 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 03 Sep 2012 20:46:33 +0200 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: References: <5044FA16.5050406@ninenines.eu> Message-ID: <5044FB09.5060209@ninenines.eu> On 09/03/2012 08:45 PM, Max Lapshin wrote: > On Mon, Sep 3, 2012 at 10:42 PM, Lo?c Hoguin wrote: >> On 09/03/2012 08:41 PM, Max Lapshin wrote: >>> >>> cowboy:set_protocol_options doesn't change dispatch rules. >> >> >> It changes protocol options which includes dispatch rules? >> > > I put io:format in cowboy_dispatcher on line 104: > > match(_Host, Path, [{'_', PathMatchs}|_Tail]) -> > match_path(Path, PathMatchs, [], undefined); > > and see, that PathMatchs and cowboy:get_protocol_options differs. > > Looks like new protocol options are passed only to new workers, while > old live with old rules. Yep. -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From max.lapshin@REDACTED Mon Sep 3 20:56:55 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 3 Sep 2012 22:56:55 +0400 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: <5044FB09.5060209@ninenines.eu> References: <5044FA16.5050406@ninenines.eu> <5044FB09.5060209@ninenines.eu> Message-ID: So what is the good way to go? Maybe somehow flush currently inactive workers? From essen@REDACTED Mon Sep 3 21:05:34 2012 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 03 Sep 2012 21:05:34 +0200 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: References: <5044FA16.5050406@ninenines.eu> <5044FB09.5060209@ninenines.eu> Message-ID: <5044FF7E.7020700@ninenines.eu> On 09/03/2012 08:56 PM, Max Lapshin wrote: > So what is the good way to go? > Maybe somehow flush currently inactive workers? It's entirely application dependent. For short-lived requests there's pretty much no concerns to have since they'll stop soon anyway. For long-lived requests, you can send/receive a message in your handler that tell them to shutdown. -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From greg@REDACTED Mon Sep 3 21:12:07 2012 From: greg@REDACTED (Greg Burd) Date: Mon, 3 Sep 2012 15:12:07 -0400 Subject: [erlang-questions] [ANN] EGTM: embedded ACID compliant NoSQL engine for Erlang In-Reply-To: <96d705fa-93c6-4476-9e80-9967e80deb90@zimbra> References: <96d705fa-93c6-4476-9e80-9967e80deb90@zimbra> Message-ID: Given that this project is AGPLv3 I assume that this is a dual-license commercial option product, correct? If so, does someone need to acquire a license from you and from the copyright holders of GT.M or do you have some commercial agreement with them? Where is the price list? Just curious given the prevalence of ASLv2 licensing for Erlang code, AGPLv3 is a highly infectious license. @gregburd On Thursday, August 23, 2012, Tomas Morstein wrote: > Dear Erlang community, > > It's finally here! We've just released first public version of IDEA EGTM. > > EGTM is an Erlang application built on the top of FIS GT.M engine what is > a complete implementation of M[UMPS] technology. > The main characteristics of M[UMPS] is that it is both language and > database, so one can directly access persistent multidimensional arrays > from M language. > > Main benefits of GT.M itself: > - it's ANSI/ISO M[UMPS] compatible > - fully ACID compliant > - it's _very_ fast even if your data layout is not so well optimized > - it's small and embedded > - it has native replication > - it can be distributed across multiple nodes (remote data may be treated > as local) > - it's mature -- as a heart of PROFILE core-banking system, it is used in > hundreds of financial institutions around the world > - its Linux version is free > > Main benefits of EGTM: > - inherits all the properties of GT.M > - allows Erlang to freely call MUMPS routines and share data with M[UMPS] > applications without any limitations > - can be used as a data-only storage for Erlang, without a single line of > M[UMPS] code, so you don't have to learn M language that may not look so > friendly (but in fact, is very simple and powerful!) > - EGTM can be deployed on a private secondary GT.M replica instance just > to make some data mining (web reporting via ChicagoBoss, for example) > without affecting master database > - can be used with any Erlang application as well as with ChicagoBoss or > any other web framework > - through layered software (from IDEA :) ) like IODB, it's possible to map > EGTM tree structures to Erlang objects and optionally access them via SQL > - IODB is not publicly available yet (coming soon!), but we use it in > production and at the moment in conjunction with ChicagoBoss integration > module, although the model compiler is ready to be used standalone > - another layered software is EGTM HAC what is EGTM HighAvailibility > Cluster extension -- the best of HA properties of native GT.M and Erlang > distributed properties > > Even if the performance of any external binding will never be as good as > native M code, it should be enough for many applications. If the > performance is a primary requirement, it's possible to implement complex > tasks with native M and simply call the native routine from EGTM. > > An example of application that is written in ChicagoBoss framework with > pure EGTM (completely without IODB objects) is our website > http://www.idea.cz. > I am not able to do it immediately, but the source code may be released as > a sample CB+EGTM reference project later. > > Some resources: > - EGTM on GitHub: http://github.com/ztmr/egtm > - EGTM "homepage": http://labs.idea.cz/egtm > - GT.M documentation: http://www.mumps.cz/gtm/ > - slides about GT.M: > http://www.mumps.cz/gtm/misc/120730-1agtmasnosqldatabase.pdf > - introduction to M-based systems for relational people: > http://www.fooboo.org/~tmr/gtm/UniversalNoSQL.pdf > > In meantime of posting this message, there were started several > discussions in another Erlang-related groups: > - https://groups.google.com/forum/#!forum/chicagoboss > - > https://www.linkedin.com/groups/EGTM-embedded-ACID-compliant-NoSQL-90878.S.149660834 > > Enjoy and feel free to ask! > > Tom > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- @gregburd Architect, Basho Technologies | http://basho.com | @basho -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Mon Sep 3 21:22:30 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 3 Sep 2012 23:22:30 +0400 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: <5044FF7E.7020700@ninenines.eu> References: <5044FA16.5050406@ninenines.eu> <5044FB09.5060209@ninenines.eu> <5044FF7E.7020700@ninenines.eu> Message-ID: Ok, what is the good way to restart all current workers? How can I get their pids? Right now I have a very bad behaviour, when config is reloaded, but "nothing works". From essen@REDACTED Mon Sep 3 21:27:10 2012 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 03 Sep 2012 21:27:10 +0200 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: References: <5044FA16.5050406@ninenines.eu> <5044FB09.5060209@ninenines.eu> <5044FF7E.7020700@ninenines.eu> Message-ID: <5045048E.2040802@ninenines.eu> On 09/03/2012 09:22 PM, Max Lapshin wrote: > Ok, what is the good way to restart all current workers? > How can I get their pids? You'd typically register them somewhere (using gproc or alike). > Right now I have a very bad behaviour, when config is reloaded, but > "nothing works". No idea what that means. -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From max.lapshin@REDACTED Mon Sep 3 21:30:40 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 3 Sep 2012 23:30:40 +0400 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: <5045048E.2040802@ninenines.eu> References: <5044FA16.5050406@ninenines.eu> <5044FB09.5060209@ninenines.eu> <5044FF7E.7020700@ninenines.eu> <5045048E.2040802@ninenines.eu> Message-ID: I mean, that after calling API cowboy:set_protocol_options, I have large list of workers, that use old configuration and user cannot go to new routes. This is why I can't use "cowboy:set_protocol_options" at all and I need to shutdown whole cowboy and start it back again. From steven.charles.davis@REDACTED Mon Sep 3 21:33:19 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Mon, 3 Sep 2012 12:33:19 -0700 (PDT) Subject: [erlang-questions] What I dislike about Erlang In-Reply-To: References: Message-ID: <8458d5c6-975f-40db-be15-f4388a363242@googlegroups.com> Think I said before that the greatest missing piece of code maintainability is not type safety, but documentation of intent. -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Mon Sep 3 21:34:41 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 3 Sep 2012 23:34:41 +0400 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: References: <5044FA16.5050406@ninenines.eu> <5044FB09.5060209@ninenines.eu> <5044FF7E.7020700@ninenines.eu> <5045048E.2040802@ninenines.eu> Message-ID: I see the problem: you don't use undocumented call prim_inet:async_accept and thus you can't catch message in acceptor, that something has changed. It really cannot be changed, unless proper undocumented feature is used here =( From essen@REDACTED Mon Sep 3 21:41:18 2012 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 03 Sep 2012 21:41:18 +0200 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: References: <5044FA16.5050406@ninenines.eu> <5044FB09.5060209@ninenines.eu> <5044FF7E.7020700@ninenines.eu> <5045048E.2040802@ninenines.eu> Message-ID: <504507DE.3030605@ninenines.eu> On 09/03/2012 09:34 PM, Max Lapshin wrote: > I see the problem: you don't use undocumented call > prim_inet:async_accept and thus you can't catch message in > acceptor, that something has changed. > > It really cannot be changed, unless proper undocumented feature is used here =( The code in Ranch has async accept through a documented method. So the protocol options upgrade is more instantaneous there (as opposed to "the connection after next"). Cowboy will be able to make use of that soon. But that doesn't really change anything about currently running requests which still use the old options. It shouldn't give you any problem unless you use release upgrades and API/data changed though. Old options and new options can run side-by-side without issue. I'm not sure what you are doing, especially since you said it requires restarting Cowboy? I'll need more details to be able to help you. What are you trying to do? -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From max.lapshin@REDACTED Mon Sep 3 21:46:02 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 3 Sep 2012 23:46:02 +0400 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: <504507DE.3030605@ninenines.eu> References: <5044FA16.5050406@ninenines.eu> <5044FB09.5060209@ninenines.eu> <5044FF7E.7020700@ninenines.eu> <5045048E.2040802@ninenines.eu> <504507DE.3030605@ninenines.eu> Message-ID: I'm trying to update routes. I call cowboy:set_protocol_options with new dispatch rules. After this I reload page in web browser (firefox) and see in logs that some process is still using old dispatch map. It looks, like cowboy_acceptor is starting child in acceptor/7 with old options. From essen@REDACTED Mon Sep 3 21:47:28 2012 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 03 Sep 2012 21:47:28 +0200 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: References: <5044FA16.5050406@ninenines.eu> <5044FB09.5060209@ninenines.eu> <5044FF7E.7020700@ninenines.eu> <5045048E.2040802@ninenines.eu> <504507DE.3030605@ninenines.eu> Message-ID: <50450950.6010604@ninenines.eu> On 09/03/2012 09:46 PM, Max Lapshin wrote: > I'm trying to update routes. > > I call cowboy:set_protocol_options with new dispatch rules. > After this I reload page in web browser (firefox) and see in logs that > some process is still using old dispatch map. > > It looks, like cowboy_acceptor is starting child in acceptor/7 with old options. In the current Cowboy code, the next request is using the old options. It's only the one after that that uses the new options. In the upcoming code the change is instantaneous. -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From max.lapshin@REDACTED Mon Sep 3 21:48:07 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 3 Sep 2012 23:48:07 +0400 Subject: [erlang-questions] What is the right way to update cowboy dispatch rules on-fly? In-Reply-To: <50450950.6010604@ninenines.eu> References: <5044FA16.5050406@ninenines.eu> <5044FB09.5060209@ninenines.eu> <5044FF7E.7020700@ninenines.eu> <5045048E.2040802@ninenines.eu> <504507DE.3030605@ninenines.eu> <50450950.6010604@ninenines.eu> Message-ID: On Mon, Sep 3, 2012 at 11:47 PM, Lo?c Hoguin wrote: > > In the current Cowboy code, the next request is using the old options. It's > only the one after that that uses the new options. > > In the upcoming code the change is instantaneous. > Ok, thanks! From ok@REDACTED Tue Sep 4 00:07:35 2012 From: ok@REDACTED (Richard O'Keefe) Date: Tue, 4 Sep 2012 10:07:35 +1200 Subject: [erlang-questions] Which EEP would you pick as the most important one to implement next? In-Reply-To: <504463AB.6050102@gmail.com> References: <5040842C.6010702@ninenines.eu> <87e026c04bdafbec879831e969e632a4.squirrel@chasm.otago.ac.nz> <93A456AC-A73E-4F55-98DE-ED6A63E8843F@cs.otago.ac.nz> <504463AB.6050102@gmail.com> Message-ID: On 3/09/2012, at 8:00 PM, Rados?aw Misiuk wrote: >> > > While I'm not really sure, it probably has something to do with xunicode package in LaTeX. > I had similar problems and --latex-engine=xelatex helped. Given that I've never even heard of xunicode before and from checking the LaTeX .log file do not pick it up in this case even indirectly, "probably" has to be read as "probably, for p = 0". Pandoc's handling of LaTeX is simply buggy. It pays no attention to ``obeylines'', it simply drops \slash instead of turning it into /, it inserts paragraph breaks between two adjacent printing characters, ... From ngocdaothanh@REDACTED Tue Sep 4 03:58:13 2012 From: ngocdaothanh@REDACTED (Ngoc Dao) Date: Tue, 4 Sep 2012 10:58:13 +0900 Subject: [erlang-questions] Why appmon doesn't show supervisor Id in process tree? In-Reply-To: References: Message-ID: observer works on OS X. I'm not sure about 64 bit, but I'm using Erlang 32 bit. From ngocdaothanh@REDACTED Tue Sep 4 03:59:07 2012 From: ngocdaothanh@REDACTED (Ngoc Dao) Date: Tue, 4 Sep 2012 10:59:07 +0900 Subject: [erlang-questions] Why appmon doesn't show supervisor Id in process tree? In-Reply-To: References: Message-ID: For a screenshot of observer, see http://www.slideshare.net/ngocdaothanh/cloud-erlang On Tue, Sep 4, 2012 at 10:58 AM, Ngoc Dao wrote: > observer works on OS X. > I'm not sure about 64 bit, but I'm using Erlang 32 bit. From zabrane3@REDACTED Tue Sep 4 07:20:34 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Tue, 4 Sep 2012 07:20:34 +0200 Subject: [erlang-questions] Cover crash Message-ID: Hi guys, I want to test code coverage of my code on OSX 10.7.4. So: $ make ### with "debug_info" Then: $ erl -pa ebin Eshell V5.9.1 (abort with ^G) 1> cover:compile_beam_directory("ebin/"). =ERROR REPORT==== 4-Sep-2012::07:01:03 === Error in process <0.35.0> with exit value: {{case_clause,{error,beam_lib,{missing_chunk,'/usr/lib/erlang/lib/pimco-1.0.0/ebin/pimco_rat.beam',"Abst"}}},[{cover,do_compile_beam,3,[{file,"cover.erl"},{line,1277}]},{cover,main_process_loop,1,[{file,"cover.erl"},{line,629}]}]}... ** exception exit: {{case_clause,{error,beam_lib, {missing_chunk,'/usr/lib/erlang/lib/pimco-1.0.0/ebin/pimco_rat.beam', "Abst"}}}, [{cover,do_compile_beam,3,[{file,"cover.erl"},{line,1277}]}, {cover,main_process_loop,1, [{file,"cover.erl"},{line,629}]}]} in function cover:call/1 (cover.erl, line 521) in call from cover:compile_beams/2 (cover.erl, line 341) 2> q(). What I'm doing wrong? N.B: unfortunately, I can't share the company's code! Regards, Zabrane From erlang@REDACTED Tue Sep 4 08:36:11 2012 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 4 Sep 2012 08:36:11 +0200 Subject: [erlang-questions] write appending a file on a replicated file store Message-ID: Is write appending a file on a replicated file store like dropbox or gdrive an inefficient operation? I want to make a write-append only changelog on a replicated store (like dropbox or gdrive) Does anybody know if these stores handle write appends in an efficient manner. The worse case would be that each new write append treats the new version of the file as a totally new file and copies everything. I have no idea if this is the case or not - does anybody know if the entire file gets copied every time or just the increment? If the entire file gets copied then I'd need some kind of incremental system, create many small files, then occasionally merge them has anybody done this? Cheers /Joe From bourinov@REDACTED Tue Sep 4 09:32:48 2012 From: bourinov@REDACTED (Max Bourinov) Date: Tue, 4 Sep 2012 11:32:48 +0400 Subject: [erlang-questions] [ANN] EGTM: embedded ACID compliant NoSQL engine for Erlang In-Reply-To: References: <96d705fa-93c6-4476-9e80-9967e80deb90@zimbra> Message-ID: Hi Tomas, Great news indeed. Before I dive into it, could you please tell me: - What is a main advantages compare to traditional RDBMS? - For what kind of data it is good? Is it good for keeping log entries or I better use traditional RDBMS (say PostgreSQL)? I am trying to understand how I can use IDEA EGTM in my projects. So far we live with PostgreSQL. It is very good (as we all know), but there are some natural limitations when I use it for Erlang - just because it is general purpose DB. Tomas, could you just gime me some ideas where and how IDEA EGTM will kick the a**? I think IDEA EGTM will perfectly match my needs, because at the very bottom my app. business logic is very similar to what banks do. p.s. I have found all docs and they looks superior. So, I see that IDEA EGTM is pretty well kept software. Best regards, Max On Mon, Sep 3, 2012 at 11:12 PM, Greg Burd wrote: > Given that this project is AGPLv3 I assume that this is a dual-license > commercial option product, correct? If so, does someone need to acquire a > license from you and from the copyright holders of GT.M or do you have some > commercial agreement with them? Where is the price list? > > Just curious given the prevalence of ASLv2 licensing for Erlang code, > AGPLv3 is a highly infectious license. > > @gregburd > > > On Thursday, August 23, 2012, Tomas Morstein wrote: > >> Dear Erlang community, >> >> It's finally here! We've just released first public version of IDEA EGTM. >> >> EGTM is an Erlang application built on the top of FIS GT.M engine what is >> a complete implementation of M[UMPS] technology. >> The main characteristics of M[UMPS] is that it is both language and >> database, so one can directly access persistent multidimensional arrays >> from M language. >> >> Main benefits of GT.M itself: >> - it's ANSI/ISO M[UMPS] compatible >> - fully ACID compliant >> - it's _very_ fast even if your data layout is not so well optimized >> - it's small and embedded >> - it has native replication >> - it can be distributed across multiple nodes (remote data may be treated >> as local) >> - it's mature -- as a heart of PROFILE core-banking system, it is used in >> hundreds of financial institutions around the world >> - its Linux version is free >> >> Main benefits of EGTM: >> - inherits all the properties of GT.M >> - allows Erlang to freely call MUMPS routines and share data with M[UMPS] >> applications without any limitations >> - can be used as a data-only storage for Erlang, without a single line of >> M[UMPS] code, so you don't have to learn M language that may not look so >> friendly (but in fact, is very simple and powerful!) >> - EGTM can be deployed on a private secondary GT.M replica instance just >> to make some data mining (web reporting via ChicagoBoss, for example) >> without affecting master database >> - can be used with any Erlang application as well as with ChicagoBoss or >> any other web framework >> - through layered software (from IDEA :) ) like IODB, it's possible to >> map EGTM tree structures to Erlang objects and optionally access them via >> SQL >> - IODB is not publicly available yet (coming soon!), but we use it in >> production and at the moment in conjunction with ChicagoBoss integration >> module, although the model compiler is ready to be used standalone >> - another layered software is EGTM HAC what is EGTM HighAvailibility >> Cluster extension -- the best of HA properties of native GT.M and Erlang >> distributed properties >> >> Even if the performance of any external binding will never be as good as >> native M code, it should be enough for many applications. If the >> performance is a primary requirement, it's possible to implement complex >> tasks with native M and simply call the native routine from EGTM. >> >> An example of application that is written in ChicagoBoss framework with >> pure EGTM (completely without IODB objects) is our website >> http://www.idea.cz. >> I am not able to do it immediately, but the source code may be released >> as a sample CB+EGTM reference project later. >> >> Some resources: >> - EGTM on GitHub: http://github.com/ztmr/egtm >> - EGTM "homepage": http://labs.idea.cz/egtm >> - GT.M documentation: http://www.mumps.cz/gtm/ >> - slides about GT.M: >> http://www.mumps.cz/gtm/misc/120730-1agtmasnosqldatabase.pdf >> - introduction to M-based systems for relational people: >> http://www.fooboo.org/~tmr/gtm/UniversalNoSQL.pdf >> >> In meantime of posting this message, there were started several >> discussions in another Erlang-related groups: >> - https://groups.google.com/forum/#!forum/chicagoboss >> - >> https://www.linkedin.com/groups/EGTM-embedded-ACID-compliant-NoSQL-90878.S.149660834 >> >> Enjoy and feel free to ask! >> >> Tom >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > -- > @gregburd > Architect, Basho Technologies | http://basho.com | @basho > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From satyamshekhar@REDACTED Tue Sep 4 09:45:23 2012 From: satyamshekhar@REDACTED (Satyam Shekhar) Date: Tue, 4 Sep 2012 13:15:23 +0530 Subject: [erlang-questions] gen_tcp send blocks gen_tcp recv. In-Reply-To: References: Message-ID: @erik: I wasn't sure if this was the standard practice. Also, this complicates the architecture. Now, I ll have 2 processes, that manage a tcp socket. One for receiving and one for sending, both having reference to the same socket. Is this ok? @arun: The article on trapexit only show how to do async accept. It doesnt do async send of gen_tcp socket. To elaborate on the problem - I have one process that is an abstraction over the gen_tcp socket. It does xml parsing on the data received on the tcp socket and forwards parsed data to the controlling process. Also it receives the xml from a process and sends it on the tcp socket. Lets call this smart socket. Now, if the process that sends data to smart socket, sends too much of it, smart socket starts to starts blocking on send calls. How do people usually handle such scenarios? On Mon, Sep 3, 2012 at 9:01 PM, Arun Muralidharan wrote: > Can you be more specific on how your sending process is overloading your > receiving process(P1) by making a "blocking" call ? I didnt quite get it. > Why dont you try an async design pattern as shown in > > http://www.trapexit.org/Building_a_Non-blocking_TCP_server_using_OTP_principles > > -Arun > > > > On Mon, Sep 3, 2012 at 12:47 PM, Erik S?e S?rensen wrote: > >> Have you considered having one process for sending and one for receiving >> (on the same socket)? >> Den 03/09/2012 06.47 skrev "Satyam Shekhar" : >> >>> Hi, >>> >>> I know this question has been asked many times. >>> >>> >>> http://erlang.2086793.n4.nabble.com/Non-blocking-sends-in-gen-tcp-td2114537.html >>> >>> https://groups.google.com/forum/?fromgroups=#!topic/erlang-programming/4DBmCK4GAK8 >>> >>> But my concern is slightly different. I have a separate >>> sending/receiving process, P1, for a gen_tcp socket which receives messages >>> it has to send, from process P2. There is no acking between the P1 and P2. >>> Data is buffered at P2 and data acking is client driven, i.e that client >>> says how much data it has received when it reconnects. Right now, P2 sends >>> data to P1 as soon as it generates any data, and also adds it to its >>> buffer, so that it can send it to the client if the socket gets closed >>> before client receives it. >>> >>> The issue is, since the gen_tcp send call is blocking, and P2 might >>> flood P1s mailbox at times, received messages(socket in active once mode) >>> from the client are delayed quite a bit. >>> >>> What is the best way to handle this? >>> >>> Regards, >>> Satyam Shekhar >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Tue Sep 4 09:52:42 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 4 Sep 2012 11:52:42 +0400 Subject: [erlang-questions] gen_tcp send blocks gen_tcp recv. In-Reply-To: References: Message-ID: https://github.com/erlyvideo/erlyvideo/blob/master/apps/erlyvideo/src/media/ems_media_clients.erl#L282 This is undocumented asynchronous gen_tcp:send. Just a port_command. From norton@REDACTED Tue Sep 4 10:07:20 2012 From: norton@REDACTED (Joseph Wayne Norton) Date: Tue, 4 Sep 2012 17:07:20 +0900 Subject: [erlang-questions] gen_tcp send blocks gen_tcp recv. In-Reply-To: References: Message-ID: <48DA2118-9BF5-4739-9013-DCC93CF06767@lovely.email.ne.jp> Satyam - The UBF framework may offer some examples for building a server, client, and protocol driver: generic socket server: https://github.com/ubf/ubf/blob/master/src/proc_socket_server.erl generic protocol driver: https://github.com/ubf/ubf/blob/master/src/contract_driver.erl There is some documentation that describes how the framework works at a high-level: http://ubf.github.com/ubf/ubf-user-guide.en.html Hope this helps. - Joe N. On Sep 4, 2012, at 4:45 PM, Satyam Shekhar wrote: > @erik: I wasn't sure if this was the standard practice. Also, this complicates the architecture. Now, I ll have 2 processes, that manage a tcp socket. One for receiving and one for sending, both having reference to the same socket. Is this ok? > > @arun: The article on trapexit only show how to do async accept. It doesnt do async send of gen_tcp socket. > To elaborate on the problem - I have one process that is an abstraction over the gen_tcp socket. It does xml parsing on the data received on the tcp socket and forwards parsed data to the controlling process. Also it receives the xml from a process and sends it on the tcp socket. Lets call this smart socket. Now, if the process that sends data to smart socket, sends too much of it, smart socket starts to starts blocking on send calls. > > How do people usually handle such scenarios? > > > On Mon, Sep 3, 2012 at 9:01 PM, Arun Muralidharan wrote: > Can you be more specific on how your sending process is overloading your receiving process(P1) by making a "blocking" call ? I didnt quite get it. > Why dont you try an async design pattern as shown in > http://www.trapexit.org/Building_a_Non-blocking_TCP_server_using_OTP_principles > -Arun > > > > On Mon, Sep 3, 2012 at 12:47 PM, Erik S?e S?rensen wrote: > Have you considered having one process for sending and one for receiving (on the same socket)? > > Den 03/09/2012 06.47 skrev "Satyam Shekhar" : > Hi, > > I know this question has been asked many times. > > http://erlang.2086793.n4.nabble.com/Non-blocking-sends-in-gen-tcp-td2114537.html > https://groups.google.com/forum/?fromgroups=#!topic/erlang-programming/4DBmCK4GAK8 > > But my concern is slightly different. I have a separate sending/receiving process, P1, for a gen_tcp socket which receives messages it has to send, from process P2. There is no acking between the P1 and P2. Data is buffered at P2 and data acking is client driven, i.e that client says how much data it has received when it reconnects. Right now, P2 sends data to P1 as soon as it generates any data, and also adds it to its buffer, so that it can send it to the client if the socket gets closed before client receives it. > > The issue is, since the gen_tcp send call is blocking, and P2 might flood P1s mailbox at times, received messages(socket in active once mode) from the client are delayed quite a bit. > > What is the best way to handle this? > > Regards, > Satyam Shekhar > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From cgsmcmlxxv@REDACTED Tue Sep 4 10:23:39 2012 From: cgsmcmlxxv@REDACTED (CGS) Date: Tue, 4 Sep 2012 10:23:39 +0200 Subject: [erlang-questions] Cover crash In-Reply-To: References: Message-ID: Have you compiled modules in another environment? If memory serves, I got similar problems when I did that. CGS On Tue, Sep 4, 2012 at 7:20 AM, Zabrane Mickael wrote: > Hi guys, > > I want to test code coverage of my code on OSX 10.7.4. > > So: > $ make ### with "debug_info" > > Then: > $ erl -pa ebin > Eshell V5.9.1 (abort with ^G) > > 1> cover:compile_beam_directory("ebin/"). > > =ERROR REPORT==== 4-Sep-2012::07:01:03 === > Error in process <0.35.0> with exit value: > {{case_clause,{error,beam_lib,{missing_chunk,'/usr/lib/erlang/lib/pimco-1.0.0/ebin/pimco_rat.beam',"Abst"}}},[{cover,do_compile_beam,3,[{file,"cover.erl"},{line,1277}]},{cover,main_process_loop,1,[{file,"cover.erl"},{line,629}]}]}... > > ** exception exit: {{case_clause,{error,beam_lib, > > {missing_chunk,'/usr/lib/erlang/lib/pimco-1.0.0/ebin/pimco_rat.beam', > "Abst"}}}, > > [{cover,do_compile_beam,3,[{file,"cover.erl"},{line,1277}]}, > {cover,main_process_loop,1, > [{file,"cover.erl"},{line,629}]}]} > in function cover:call/1 (cover.erl, line 521) > in call from cover:compile_beams/2 (cover.erl, line 341) > > 2> q(). > > > What I'm doing wrong? > > N.B: unfortunately, I can't share the company's code! > > Regards, > Zabrane > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zabrane3@REDACTED Tue Sep 4 10:37:40 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Tue, 4 Sep 2012 10:37:40 +0200 Subject: [erlang-questions] Cover crash In-Reply-To: References: Message-ID: <24002018-0147-452F-93C3-5BE82FE7E97A@gmail.com> Hi CGS, > Have you compiled modules in another environment? No, same environment. Anyway, this workaround fix it: [cover:compile_beam(Mod) || Mod <- filelib:wildcard("ebin/*.beam")]) Regards, Zabrane > If memory serves, I got similar problems when I did that. > > CGS > > > > > On Tue, Sep 4, 2012 at 7:20 AM, Zabrane Mickael wrote: > Hi guys, > > I want to test code coverage of my code on OSX 10.7.4. > > So: > $ make ### with "debug_info" > > Then: > $ erl -pa ebin > Eshell V5.9.1 (abort with ^G) > > 1> cover:compile_beam_directory("ebin/"). > > =ERROR REPORT==== 4-Sep-2012::07:01:03 === > Error in process <0.35.0> with exit value: {{case_clause,{error,beam_lib,{missing_chunk,'/usr/lib/erlang/lib/pimco-1.0.0/ebin/pimco_rat.beam',"Abst"}}},[{cover,do_compile_beam,3,[{file,"cover.erl"},{line,1277}]},{cover,main_process_loop,1,[{file,"cover.erl"},{line,629}]}]}... > > ** exception exit: {{case_clause,{error,beam_lib, > {missing_chunk,'/usr/lib/erlang/lib/pimco-1.0.0/ebin/pimco_rat.beam', > "Abst"}}}, > [{cover,do_compile_beam,3,[{file,"cover.erl"},{line,1277}]}, > {cover,main_process_loop,1, > [{file,"cover.erl"},{line,629}]}]} > in function cover:call/1 (cover.erl, line 521) > in call from cover:compile_beams/2 (cover.erl, line 341) > > 2> q(). > > > What I'm doing wrong? > > N.B: unfortunately, I can't share the company's code! > > Regards, > Zabrane > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Tue Sep 4 11:13:09 2012 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 4 Sep 2012 11:13:09 +0200 Subject: [erlang-questions] write appending a file on a replicated file store In-Reply-To: References: Message-ID: On Sep 4, 2012, at 8:36 AM, Joe Armstrong wrote: > Does anybody know if these stores handle write appends in an efficient manner. > The worse case would be that each new write append treats the new version of > the file as a totally new file and copies everything. > There are two methods which come to mind: Rsync-like functionality and merkle-trees. > > If the entire file gets copied then I'd need some kind of incremental > system, create many small files, then occasionally merge them > has anybody done this? Merkle trees is the tool you want I think. It will quickly find out that there are new data appended and only transfer the data there. Coincidentally, there is some merkle tree stuff inside riak :) From hm@REDACTED Tue Sep 4 13:57:26 2012 From: hm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Mattsson?=) Date: Tue, 4 Sep 2012 13:57:26 +0200 Subject: [erlang-questions] In what way am I misusing inet's tftpd? In-Reply-To: <0517E48C-7266-4E24-B6BA-F9533DA973E8@troutwine.us> References: <0517E48C-7266-4E24-B6BA-F9533DA973E8@troutwine.us> Message-ID: Hi! You can check your actual tftp server configuration with: tftp:info(daemons). and you can debug with tftp:change_config(daemons, [{debug,Level}]). % Level = none | error | warning | brief | normal | verbose | all Once you have connected to port 6969 (with tftp localhost 6969) you can inspect the config for the server process for that session with tftp:info(servers). and start debugging with tftp:change_config(servers, [{debug,Level}]). % Level = none | error | warning | brief | normal | verbose | all hopefully you will see what the server does with your messages. /H?kan On Fri, Jul 27, 2012 at 11:37 PM, Brian L. Troutwine wrote: > I'm attempting to use inet's tftp, but I'm doing something incorrectly. I have a simple example application here: https://github.com/blt/tftp-problems While tftp-problemst does bind to the correct port, it never returns data to a client. > > To reproduce, open a terminal in the project root and: > > make && ./bin/console > > This should boot the tftp_hellp application, and drop you into an erlang shell. Confirm that inets is running: > > 1> application:which_applications(). > [{inets,"INETS CXC 138 49","5.9"}, > {sasl,"SASL CXC 138 11","2.2.1"}, > {stdlib,"ERTS CXC 138 10","1.18.1"}, > {kernel,"ERTS CXC 138 10","2.15.1"}] > > and that the tftp daemon is running: > > 2> inets:services(). > [{tftpd,<0.56.0>},{httpc,<0.50.0>}] > > Great. Now, if you look in `etc/inets.config` you'll notice we're binding tftpd to 6969. Open another terminal and: > > > tftp localhost 6969 > tftp> get hello.txt > Transfer timed out. > > Bother. If my understanding of tftpd were correct--which clearly it's not--we'd get `<<"hello world">>` back. > > What am I doing wrong? > > - blt > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From arun11299@REDACTED Tue Sep 4 14:12:38 2012 From: arun11299@REDACTED (Arun Muralidharan) Date: Tue, 4 Sep 2012 17:42:38 +0530 Subject: [erlang-questions] gen_tcp send blocks gen_tcp recv. In-Reply-To: <48DA2118-9BF5-4739-9013-DCC93CF06767@lovely.email.ne.jp> References: <48DA2118-9BF5-4739-9013-DCC93CF06767@lovely.email.ne.jp> Message-ID: Hi Satyam, I think you are probably using a flawed term in describing your application' "performance" issue. In most of the cases unlike "blocking recv" , send function is fast meaning it wont take much time to copy the data from application to kernel buffer unless there is low memory in kernel buffer to copy your data or due to some page fault. But what can really be a problem is when your process is processing the received data from socket slowly. For this you have to decouple the logic of receiving and processing. For eg. a single erlang process for receiving events (maybe a gen_server or gen_fsm) and for each received data spawn a new process that acts on it and sends it. -Arun On Tue, Sep 4, 2012 at 1:37 PM, Joseph Wayne Norton < norton@REDACTED> wrote: > > Satyam - > > The UBF framework may offer some examples for building a server, client, > and protocol driver: > > generic socket server: > https://github.com/ubf/ubf/blob/master/src/proc_socket_server.erl > > generic protocol driver: > https://github.com/ubf/ubf/blob/master/src/contract_driver.erl > > There is some documentation that describes how the framework works at a > high-level: > http://ubf.github.com/ubf/ubf-user-guide.en.html > > Hope this helps. > > - Joe N. > > On Sep 4, 2012, at 4:45 PM, Satyam Shekhar > wrote: > > @erik: I wasn't sure if this was the standard practice. Also, this > complicates the architecture. Now, I ll have 2 processes, that manage a tcp > socket. One for receiving and one for sending, both having reference to the > same socket. Is this ok? > > @arun: The article on trapexit only show how to do async accept. It doesnt > do async send of gen_tcp socket. > To elaborate on the problem - I have one process that is an abstraction > over the gen_tcp socket. It does xml parsing on the data received on the > tcp socket and forwards parsed data to the controlling process. Also it > receives the xml from a process and sends it on the tcp socket. Lets call > this smart socket. Now, if the process that sends data to smart socket, > sends too much of it, smart socket starts to starts blocking on send calls. > > How do people usually handle such scenarios? > > > On Mon, Sep 3, 2012 at 9:01 PM, Arun Muralidharan wrote: > >> Can you be more specific on how your sending process is overloading your >> receiving process(P1) by making a "blocking" call ? I didnt quite get it. >> Why dont you try an async design pattern as shown in >> >> http://www.trapexit.org/Building_a_Non-blocking_TCP_server_using_OTP_principles >> >> -Arun >> >> >> >> On Mon, Sep 3, 2012 at 12:47 PM, Erik S?e S?rensen wrote: >> >>> Have you considered having one process for sending and one for receiving >>> (on the same socket)? >>> Den 03/09/2012 06.47 skrev "Satyam Shekhar" : >>> >>>> Hi, >>>> >>>> I know this question has been asked many times. >>>> >>>> >>>> http://erlang.2086793.n4.nabble.com/Non-blocking-sends-in-gen-tcp-td2114537.html >>>> >>>> https://groups.google.com/forum/?fromgroups=#!topic/erlang-programming/4DBmCK4GAK8 >>>> >>>> But my concern is slightly different. I have a separate >>>> sending/receiving process, P1, for a gen_tcp socket which receives messages >>>> it has to send, from process P2. There is no acking between the P1 and P2. >>>> Data is buffered at P2 and data acking is client driven, i.e that client >>>> says how much data it has received when it reconnects. Right now, P2 sends >>>> data to P1 as soon as it generates any data, and also adds it to its >>>> buffer, so that it can send it to the client if the socket gets closed >>>> before client receives it. >>>> >>>> The issue is, since the gen_tcp send call is blocking, and P2 might >>>> flood P1s mailbox at times, received messages(socket in active once mode) >>>> from the client are delayed quite a bit. >>>> >>>> What is the best way to handle this? >>>> >>>> Regards, >>>> Satyam Shekhar >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From esente@REDACTED Tue Sep 4 15:42:20 2012 From: esente@REDACTED (Son Tran-Nguyen) Date: Tue, 4 Sep 2012 08:42:20 -0500 Subject: [erlang-questions] Maximum number of children for simple_one_for_one supervisor? Message-ID: Hi, I'm experimenting with a gen_event system where there is a supervisor to spawn lots of event managers. Each event manager can be added different combinations of handlers. My question is how many event managers can the supervisor manage? My goal may get to million of children. I see that I can create millions of processes, but not sure whether the supervisor can manage it effectively. Or is it a completely stupid idea to have a supervisor that big? Sincerely, Son Tran-Nguyen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Tue Sep 4 16:43:07 2012 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 4 Sep 2012 16:43:07 +0200 Subject: [erlang-questions] Maximum number of children for simple_one_for_one supervisor? In-Reply-To: References: Message-ID: On Sep 4, 2012, at 3:42 PM, Son Tran-Nguyen wrote: > My question is how many event managers can the supervisor manage? My goal may > get to million of children. I see that I can create millions of processes, but > not sure whether the supervisor can manage it effectively. My guess would be you will run into limitations long before that. A gentle guess is that a process takes 500 bytes. One million of those is thus half a gigabyte. The supervisor can manage this number, but of course it will use more CPU time and memory managing this large amount by itself. My best advice is: Try it and see. We don't know enough about what you are trying to build, so we cannot estimate what will work for you. You will need to set up some hard numbers and then work towards that goal. Also, what hardware do you have available? And do you plan to run distribution? Answering these questions might help you going further. You should be able to write an attempt in a relatively short time frame. Just try spawning a million children like the ones you are seeking to run and see if that works for you. From uwe@REDACTED Tue Sep 4 17:38:18 2012 From: uwe@REDACTED (Uwe Dauernheim) Date: Tue, 4 Sep 2012 17:38:18 +0200 Subject: [erlang-questions] Excludes from ERL_LIBS Message-ID: <19561E3B-3F69-4637-A36F-ECBA88B61623@dauernheim.net> I have a project which has the directory structure of an OTP release (lib/*/{src,ebin}), but the project is not yet fully OTP'fied. I use ERL_LIBS to specify the location of all application. But now I want to exclude on application from being loaded. What would be the cleanest/easiest way to do this? /Uwe From carlsson.richard@REDACTED Tue Sep 4 17:54:27 2012 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Tue, 04 Sep 2012 17:54:27 +0200 Subject: [erlang-questions] Excludes from ERL_LIBS In-Reply-To: <19561E3B-3F69-4637-A36F-ECBA88B61623@dauernheim.net> References: <19561E3B-3F69-4637-A36F-ECBA88B61623@dauernheim.net> Message-ID: <50462433.5080302@gmail.com> On 2012-09-04 17:38, Uwe Dauernheim wrote: > I have a project which has the directory structure of an OTP release (lib/*/{src,ebin}), but the project is not yet fully OTP'fied. I use ERL_LIBS to specify the location of all application. But now I want to exclude on application from being loaded. What would be the cleanest/easiest way to do this? You could create a separate directory containing only links to the actual application directories, and make ERL_LIBS point to that. Then just remove those links that you don't want for now. /Richard From dmkolesnikov@REDACTED Tue Sep 4 20:43:38 2012 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Tue, 4 Sep 2012 21:43:38 +0300 Subject: [erlang-questions] Maximum number of children for simple_one_for_one supervisor? In-Reply-To: References: Message-ID: Hello, Yes, the main limitation factor is HW resources. 1M process can be handled both by supervisor and VM. Of course, if process does heavy lifting then you are in trouble. I've made very simple empirical experiment. I've used simple_one_to_one supervisor to spawn 1M processes. Each process is container for data and does not perform any actions. First I've wrote 1KB of binary data to each process, there was about 100 writer. After that I was reading this data by 10, 100, and 1000 readers. Write operation took 100% CPU utilization and beam weight is 4.25GB. You can see some KPI of that experiment from list below. put by 100 process 1000000 times ------------------------------------------------------------------------------- Wclock (ms): 233895.186 Completed: 1000000 Failed: 0 (0.00%) TPS: 4275.4 Latency (ms): 0.234 IO tput (MB): 4.192 get by 10 process 10000 times ------------------------------------------------------------------------------- Wclock (ms): 191.787 Completed: 10000 Failed: 0 (0.00%) TPS: 52141.2 Latency (ms): 0.019 IO tput (MB): 51.118 get by 100 process 100000 times ------------------------------------------------------------------------------- Wclock (ms): 1455.720 Completed: 100000 Failed: 0 (0.00%) TPS: 68694.5 Latency (ms): 0.015 IO tput (MB): 67.347 get by 1000 process 1000000 times ------------------------------------------------------------------------------- Wclock (ms): 14794.269 Completed: 1000000 Failed: 0 (0.00%) TPS: 67593.7 Latency (ms): 0.015 IO tput (MB): 66.267 - Dmitry On Sep 4, 2012, at 5:43 PM, Jesper Louis Andersen wrote: > On Sep 4, 2012, at 3:42 PM, Son Tran-Nguyen wrote: > >> My question is how many event managers can the supervisor manage? My goal may >> get to million of children. I see that I can create millions of processes, but >> not sure whether the supervisor can manage it effectively. > > My guess would be you will run into limitations long before that. A gentle guess is that a process takes 500 bytes. One million of those is thus half a gigabyte. The supervisor can manage this number, but of course it will use more CPU time and memory managing this large amount by itself. > > My best advice is: Try it and see. We don't know enough about what you are trying to build, so we cannot estimate what will work for you. You will need to set up some hard numbers and then work towards that goal. Also, what hardware do you have available? And do you plan to run distribution? Answering these questions might help you going further. > > You should be able to write an attempt in a relatively short time frame. Just try spawning a million children like the ones you are seeking to run and see if that works for you. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay@REDACTED Tue Sep 4 21:28:03 2012 From: jay@REDACTED (Jay Nelson) Date: Tue, 4 Sep 2012 12:28:03 -0700 Subject: [erlang-questions] Maximum number of children for simple_one_for_one supervisor? Message-ID: <98677721-A4E6-4AAA-8DB8-9C0AF7D8B85A@duomark.com> The bigger question beyond launching 1M procs is what happens if you kill one and try to replace it. I have heard anecdotal evidence that 100K children is a problem and a tiered supervisor hierarchy is needed to be able to access/replace children in a performant way but I am not certain what strategy was being used in the tales. Supervisor uses sets, dict and list for children, depending on type. What are you hoping supervisor will do for these children during the operation of a system? Do you do code upgrade, or automated process replacement/migration? The memory and performance requirements are likely wholly independent of the supervisor (other than yet another copy of memory being kept by the supervisor to refer to its children). If you just need to clean them up, a simple link can suffice, but if they have OTP dependencies the supervisor may offer some advantages. jay From jay@REDACTED Tue Sep 4 22:43:13 2012 From: jay@REDACTED (Jay Nelson) Date: Tue, 4 Sep 2012 13:43:13 -0700 Subject: [erlang-questions] Open Algorithmic Execution (OAE) next logical step after Open Source Software (OSS) ? Message-ID: <7D5ECEE9-20FF-4A51-8770-006E9FA83C83@duomark.com> I have been very grateful for Open Source Software (OSS) and things like github which have transformed the way code is distributed, coding is learned and ideas in software are propagated. When I started it required reading an armspan worth of vendor published documents to write a program. Source code was proprietary and not available for learning. Everyone muddled through and developed their own style or a collective style of employee peers. OSS has made the industry more accessible by exposing code to any curious eyes. I have accomplished many things which would have been impossible without reading the source code. But as ROK's recent post indicates, after the vast survey that OSS allows, it becomes apparent that the world is awash in a sea of code that does not have visible characteristics of how it works. One must just "read the code" in intricate detail to fully understand how it works. The counter-argument that the traditional approach of private code in a black box with well-defined interfaces no longer holds water as the code is put to many different uses, with differing performance requirements. It is not enough to know an API and that a black box implementation is correct. The characteristics of the performance under different environments or scenarios must be measured and considered. The variety of solutions available through OSS makes the choice more complicated, although I welcome the ability to have any choice where previously there was none. It seems that the next step is what I call Open Algorithmic Execution (OAE). As ROK states, improvements in the languages and expression of algorithms are needed because it shouldn't be a requirement to compile or execute the code to find out what it does, however, once you decide to run it, there should be a transparency in execution that is equivalent to the transparency that OSS provides. I believe that OSS projects need to be more easily integrated with other software, but that the algorithmic complexity and performance should be graphically visible during execution so that the user / integrator can see the effects of the algorithm under different conditions and evaluate how that might impact the whole system. This form of "openness" about algorithms would enable a greater ability to choose the right components when assembling a solution. It would also promote better understanding of how the algorithms perform, and support the ability to communicate to non-engineers what is happening in a system. The real issue is that algorithm, code and execution should share a model so that the mental mapping that occurs when switching from one form to the other is reduced and made more explicitly comparable. jay From watson.timothy@REDACTED Tue Sep 4 23:09:40 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Tue, 4 Sep 2012 22:09:40 +0100 Subject: [erlang-questions] gen_tcp send blocks gen_tcp recv. In-Reply-To: References: Message-ID: <4FEAC52E-9193-47E1-84DD-D47ACDA6BA1A@gmail.com> On 4 Sep 2012, at 08:45, Satyam Shekhar wrote: > @erik: I wasn't sure if this was the standard practice. Also, this complicates the architecture. Now, I ll have 2 processes, that manage a tcp socket. One for receiving and one for sending, both having reference to the same socket. Is this ok? That is not at all unusual in Erlang. > > @arun: The article on trapexit only show how to do async accept. It doesnt do async send of gen_tcp socket. > To elaborate on the problem - I have one process that is an abstraction over the gen_tcp socket. It does xml parsing on the data received on the tcp socket and forwards parsed data to the controlling process. Also it receives the xml from a process and sends it on the tcp socket. Lets call this smart socket. Now, if the process that sends data to smart socket, sends too much of it, smart socket starts to starts blocking on send calls. > > How do people usually handle such scenarios? > Well that just depends on how the client(s) will use the socket. In some protocols it makes good sense to block during send, and in others not so much. The canonical way to do this is with multiple processes sharing the socket, but of course you can just port_command to send data (asynchronously) - the writer process in RabbitMQ does that as well, see rabbit_writer which is called by rabbit_channel. You will notice that some writes are blocking and others are not (using port_command to write). -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 235 bytes Desc: Message signed with OpenPGP using GPGMail URL: From per.melin@REDACTED Wed Sep 5 01:17:56 2012 From: per.melin@REDACTED (Per Melin) Date: Wed, 5 Sep 2012 01:17:56 +0200 Subject: [erlang-questions] Excludes from ERL_LIBS In-Reply-To: <19561E3B-3F69-4637-A36F-ECBA88B61623@dauernheim.net> References: <19561E3B-3F69-4637-A36F-ECBA88B61623@dauernheim.net> Message-ID: <1790F351-2D20-40F7-AC5F-1ECB5000DE0D@gmail.com> On Sep 4, 2012, at 17:38 , Uwe Dauernheim wrote: > I have a project which has the directory structure of an OTP release (lib/*/{src,ebin}), but the project is not yet fully OTP'fied. I use ERL_LIBS to specify the location of all application. But now I want to exclude on application from being loaded. What would be the cleanest/easiest way to do this? I'm not sure what you mean by excluding the app from being *loaded*. If you're saying that you have ERL_LIBS=lib and you want to exclude one application from the code path you can take advantage of the fact that ERL_LIBS can be a list of directories separated by colon (or semicolon on Windows). This could be prettier, but you get the idea: ERL_LIBS=$(ls -d lib/* | grep -v '/APP_TO_EXCLUDE$' | tr '\n' ':') From solomon.wzs@REDACTED Wed Sep 5 08:02:58 2012 From: solomon.wzs@REDACTED (Solomon) Date: Wed, 5 Sep 2012 14:02:58 +0800 Subject: [erlang-questions] Mnesia slow down system performance when table size reaches a certain value Message-ID: I set up a web server with erlang and use mnesia to save the session. I test server, at beginning, system run well and cpu load were about 90%. Whe session table size reached a certain value, most web requests were failure, and cpu were idle. I delete some records in session table, but it were not worked, then I used mnesia:clear_table/1 to clear session, system run normal again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrtndimitrov@REDACTED Wed Sep 5 08:56:46 2012 From: mrtndimitrov@REDACTED (Martin Dimitrov) Date: Wed, 05 Sep 2012 09:56:46 +0300 Subject: [erlang-questions] list manipulation Message-ID: <5046F7AE.9020109@gmail.com> Hello, I have a list, representing a UTF8 string, containing more than 225000 elements. I have load it in var L: 8> lists:flatten(L). [60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49, 46,48,34,32,101,110,99,111,100,105,110,103,61|...] 9> list_to_binary(L). ** exception error: bad argument in function list_to_binary/1 called as list_to_binary([60,63,120,109,108,32,118,101,114,115,105,111, 110,61,34,49,46,48,34,32,101,110,99,111,100, 105,110,103|...]) 10> file:write_file("data.txt", L). {error,badarg} Why list_to_binary/1 and write_file/2 fail? Best regards, Martin From eriksoe@REDACTED Wed Sep 5 09:07:46 2012 From: eriksoe@REDACTED (=?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?=) Date: Wed, 5 Sep 2012 09:07:46 +0200 Subject: [erlang-questions] list manipulation In-Reply-To: <5046F7AE.9020109@gmail.com> References: <5046F7AE.9020109@gmail.com> Message-ID: Does the list contain non-bytes - ie, values > 255 (or <0)? Is the list pure (ie, ends with [])? What you're probably looking for is the encoding functions in the 'unicode' module. /Erik Den 05/09/2012 08.57 skrev "Martin Dimitrov" : > Hello, > > I have a list, representing a UTF8 string, containing more than 225000 > elements. I have load it in var L: > > 8> lists:flatten(L). > [60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49, > 46,48,34,32,101,110,99,111,100,105,110,103,61|...] > 9> list_to_binary(L). > ** exception error: bad argument > in function list_to_binary/1 > called as > list_to_binary([60,63,120,109,108,32,118,101,114,115,105,111, > > 110,61,34,49,46,48,34,32,101,110,99,111,100, > 105,110,103|...]) > 10> file:write_file("data.txt", L). > {error,badarg} > > Why list_to_binary/1 and write_file/2 fail? > > Best regards, > > Martin > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrtndimitrov@REDACTED Wed Sep 5 10:27:01 2012 From: mrtndimitrov@REDACTED (Martin Dimitrov) Date: Wed, 05 Sep 2012 11:27:01 +0300 Subject: [erlang-questions] list manipulation In-Reply-To: References: <5046F7AE.9020109@gmail.com> Message-ID: <50470CD5.5080901@gmail.com> Thanks for the clue. I see some vals > 255. That must be the problem. Martin On 9/5/2012 10:07 AM, Erik S?e S?rensen wrote: > Does the list contain non-bytes - ie, values > 255 (or <0)? > Is the list pure (ie, ends with [])? > > What you're probably looking for is the encoding functions in the 'unicode' > module. > > /Erik > Den 05/09/2012 08.57 skrev "Martin Dimitrov" : > >> Hello, >> >> I have a list, representing a UTF8 string, containing more than 225000 >> elements. I have load it in var L: >> >> 8> lists:flatten(L). >> [60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49, >> 46,48,34,32,101,110,99,111,100,105,110,103,61|...] >> 9> list_to_binary(L). >> ** exception error: bad argument >> in function list_to_binary/1 >> called as >> list_to_binary([60,63,120,109,108,32,118,101,114,115,105,111, >> >> 110,61,34,49,46,48,34,32,101,110,99,111,100, >> 105,110,103|...]) >> 10> file:write_file("data.txt", L). >> {error,badarg} >> >> Why list_to_binary/1 and write_file/2 fail? >> >> Best regards, >> >> Martin >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> From dangud@REDACTED Wed Sep 5 10:33:40 2012 From: dangud@REDACTED (Dan Gudmundsson) Date: Wed, 5 Sep 2012 10:33:40 +0200 Subject: [erlang-questions] Mnesia slow down system performance when table size reaches a certain value In-Reply-To: References: Message-ID: Is it a bag table, If so how unique are your keys? Do you have an index on table, if so how unique are the secondary keys? Insertion time in bags are linear, (and indices are bag tables). /Dan On Wed, Sep 5, 2012 at 8:02 AM, Solomon wrote: > I set up a web server with erlang and use mnesia to save the session. > I test server, at beginning, system run well and cpu load were about 90%. > Whe session table size reached a certain value, most web requests were > failure, and cpu were idle. I delete some records in session table, but it > were not worked, then I used mnesia:clear_table/1 to clear session, system > run normal again. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From kenneth.lundin@REDACTED Wed Sep 5 12:55:59 2012 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Wed, 5 Sep 2012 12:55:59 +0200 Subject: [erlang-questions] Erlang/OTP R15B02 has been released Message-ID: Erlang/OTP R15B02 has been released. This release mainly contains a number of bug fixes as well as smaller user contributions (but as usual there are some new functionality as well). *Highlights: * - Dialyzer: - The type analysis tool Dialyzer is optimized to be generally faster. - It can now also run in parallel (default) on SMP systems and by this perform the analysis significantly faster (Thanks to Stavros Aronis and Kostis Sagonas) - The SSL application now has experimental support for the TLS 1.1 and 1.2 standards as well (Thanks to Andreas Schultz). - CommonTest: - It is now possible to sort the generated html tables. - A Netconf client (ct_netconf) which support basic netconf over ssh is added - Diameter: Statistics counters related to Diameter messages can now be retrieved by calling the diameter:service_info/2 function. - Various smaller optimizations in the Erlang VM - This release contains 66 contributions from users outside the Ericsson team You can find the README file with more detailed info at http://www.erlang.org/download/otp_src_R15B02.readme You can download the full source distribution from http://www.erlang.org/download/otp_src_R15B02.tar.gz http://www.erlang.org/download/otp_src_R15B02.readme (this file) Note: To unpack the TAR archive you need a GNU TAR compatible program. For installation instructions please read the README that is part of the distribution. You can also find this release at the official Erlang/OTP Git-repository at Github here: https://github.com/erlang/otp/tree/OTP_R15B02 (i.e. on the maint branch tag= OTP_R15B02) The Windows binary distribution can be downloaded from http://www.erlang.org/download/otp_win32_R15B02.exe http://www.erlang.org/download/otp_win64_R15B02.exe On-line documentation can be found at http://www.erlang.org/doc/. You can also download the complete HTML documentation or the Unix manual files http://www.erlang.org/download/otp_doc_html_R15B02.tar.gz http://www.erlang.org/download/otp_doc_man_R15B02.tar.gz We also want to thank those that sent us patches, suggestions and bug reports, The Erlang/OTP Team at Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Wed Sep 5 13:22:37 2012 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Wed, 05 Sep 2012 13:22:37 +0200 Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: References: Message-ID: <504735FD.30109@ninenines.eu> Congratulations! On 09/05/2012 12:55 PM, Kenneth Lundin wrote: > Erlang/OTP R15B02 has been released. > > This release mainly contains a number of bug fixes as well as smaller > user contributions (but as > usual there are some new functionality as well). > > *Highlights: > * > > * Dialyzer: > o The type analysis tool Dialyzer is optimized to be generally > faster. > o It can now also run in parallel (default) on SMP systems and by > this perform the analysis significantly faster (Thanks to > Stavros Aronis and Kostis Sagonas) > * The SSL application now has experimental support for the TLS 1.1 and > 1.2 standards as well (Thanks to Andreas Schultz). > * CommonTest: > o It is now possible to sort the generated html tables. > o A Netconf client (ct_netconf) which support basic netconf over > ssh is added > * Diameter: Statistics counters related to Diameter messages can now > be retrieved by calling the diameter:service_info/2 function. > * Various smaller optimizations in the Erlang VM > * This release contains 66 contributions from users outside the > Ericsson team > > > You can find the README file with more detailed info at > > http://www.erlang.org/download/otp_src_R15B02.readme > > You can download the full source distribution from > http://www.erlang.org/download/otp_src_R15B02.tar.gz > http://www.erlang.org/download/otp_src_R15B02.readme (this file) > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > > For installation instructions please read the README that is part of > the distribution. > > You can also find this release at the official Erlang/OTP Git-repository > at Github here: > https://github.com/erlang/otp/tree/OTP_R15B02 (i.e. on the maint branch > tag= OTP_R15B02) > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_R15B02.exe > http://www.erlang.org/download/otp_win64_R15B02.exe > > > On-line documentation can be found at http://www.erlang.org/doc/. > You can also download the complete HTML documentation or the Unix manual > files > > http://www.erlang.org/download/otp_doc_html_R15B02.tar.gz > http://www.erlang.org/download/otp_doc_man_R15B02.tar.gz > > We also want to thank those that sent us patches, suggestions and bug > reports, > > The Erlang/OTP Team at Ericsson > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From michael.eugene.turner@REDACTED Wed Sep 5 13:52:26 2012 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Wed, 5 Sep 2012 20:52:26 +0900 Subject: [erlang-questions] Mnesia slow down system performance when table size reaches a certain value In-Reply-To: References: Message-ID: On Wed, Sep 5, 2012 at 5:33 PM, Dan Gudmundsson wrote: > Is it a bag table, If so how unique are your keys? > > Do you have an index on table, if so how unique are the secondary keys? > > Insertion time in bags are linear, (and indices are bag tables). Dan, that would explain a relatively smooth degradation in performance, as size goes up. What's being reported here doesn't sound like that. Quantum leaps in execution time are often caused by a level of the memory hierarchy getting maxed out, by something that's doing a comprehensive scan of data that, up to a point, fits in that level of the hierarchy. With CPU load going to (near-) zero, sounds like the level is that of virtual memory: thrashing, I/O bound through page-replacement. Even if that's the case here, the mystery is why deleting some records doesn't "fix" the problem. -michael turner > On Wed, Sep 5, 2012 at 8:02 AM, Solomon wrote: >> I set up a web server with erlang and use mnesia to save the session. >> I test server, at beginning, system run well and cpu load were about 90%. >> Whe session table size reached a certain value, most web requests were >> failure, and cpu were idle. I delete some records in session table, but it >> were not worked, then I used mnesia:clear_table/1 to clear session, system >> run normal again. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From mononcqc@REDACTED Wed Sep 5 14:03:25 2012 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 05 Sep 2012 08:03:25 -0400 Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: References: Message-ID: <50473F8D.1020508@ferd.ca> I have a question about OTP-9743: OTP-9743 A new sys level configuration parameter {excl_lib,otp_root} is added. When this is set, the target system will not contain anything from $OTP_ROOT. It will only contain a releases directory with rel, script and boot files, and a lib directory with applications found outside of $OTP_ROOT (i.e. "your own" applications). I'm not sure I understand it. Is this in place to allow people to make restrictive releases without a restrictive {incl_cond, ...} system-wide option (and then having {incl_cond, ...} overload it at an app level?) Does that end up giving users releases that have no stdlib or kernel with them? On 12-09-05 6:55 AM, Kenneth Lundin wrote: > Erlang/OTP R15B02 has been released. > > This release mainly contains a number of bug fixes as well as smaller > user contributions (but as > usual there are some new functionality as well). > > *Highlights: > * > > * Dialyzer: > o The type analysis tool Dialyzer is optimized to be generally > faster. > o It can now also run in parallel (default) on SMP systems and > by this perform the analysis significantly faster (Thanks to > Stavros Aronis and Kostis Sagonas) > * The SSL application now has experimental support for the TLS 1.1 > and 1.2 standards as well (Thanks to Andreas Schultz). > * CommonTest: > o It is now possible to sort the generated html tables. > o A Netconf client (ct_netconf) which support basic netconf over > ssh is added > * Diameter: Statistics counters related to Diameter messages can now > be retrieved by calling the diameter:service_info/2 function. > * Various smaller optimizations in the Erlang VM > * This release contains 66 contributions from users outside the > Ericsson team > > > You can find the README file with more detailed info at > > http://www.erlang.org/download/otp_src_R15B02.readme > > You can download the full source distribution from > http://www.erlang.org/download/otp_src_R15B02.tar.gz > http://www.erlang.org/download/otp_src_R15B02.readme (this file) > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > > For installation instructions please read the README that is part of > the distribution. > > You can also find this release at the official Erlang/OTP > Git-repository at Github here: > https://github.com/erlang/otp/tree/OTP_R15B02 (i.e. on the maint > branch tag= OTP_R15B02) > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_R15B02.exe > http://www.erlang.org/download/otp_win64_R15B02.exe > > > On-line documentation can be found at http://www.erlang.org/doc/. > You can also download the complete HTML documentation or the Unix > manual files > > http://www.erlang.org/download/otp_doc_html_R15B02.tar.gz > http://www.erlang.org/download/otp_doc_man_R15B02.tar.gz > > We also want to thank those that sent us patches, suggestions and bug > reports, > > The Erlang/OTP Team at Ericsson > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangsiri@REDACTED Wed Sep 5 14:11:38 2012 From: erlangsiri@REDACTED (Siri Hansen) Date: Wed, 5 Sep 2012 14:11:38 +0200 Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: <50473F8D.1020508@ferd.ca> References: <50473F8D.1020508@ferd.ca> Message-ID: Fred, the new option is there to allow to build a target structure which only contains "your" applications, intended to run with an existing erlang/OTP installation. You should specify your incl_cond options as before. The resulting target structure will contain a lib directory with applications not found under $OTP_ROOT, and a releases directory with rel, script and boot files. No erts, kernel, stdlib, etc... Note that the option is experimental in R15B02. Regards /siri 2012/9/5 Fred Hebert > I have a question about OTP-9743: > > OTP-9743 A new sys level configuration parameter {excl_lib,otp_root} > is added. When this is set, the target system will not > contain anything from $OTP_ROOT. It will only contain a > releases directory with rel, script and boot files, and a lib > directory with applications found outside of $OTP_ROOT (i.e. > "your own" applications). > > I'm not sure I understand it. Is this in place to allow people to make > restrictive releases without a restrictive {incl_cond, ...} system-wide > option (and then having {incl_cond, ...} overload it at an app level?) > > Does that end up giving users releases that have no stdlib or kernel with > them? > > > On 12-09-05 6:55 AM, Kenneth Lundin wrote: > > Erlang/OTP R15B02 has been released. > > This release mainly contains a number of bug fixes as well as smaller > user contributions (but as > usual there are some new functionality as well). > > *Highlights: > * > > - Dialyzer: > - The type analysis tool Dialyzer is optimized to be generally > faster. > - It can now also run in parallel (default) on SMP systems and by > this perform the analysis significantly faster (Thanks to Stavros Aronis > and Kostis Sagonas) > - The SSL application now has experimental support for the TLS 1.1 and > 1.2 standards as well (Thanks to Andreas Schultz). > - CommonTest: > - It is now possible to sort the generated html tables. > - A Netconf client (ct_netconf) which support basic netconf over > ssh is added > - Diameter: Statistics counters related to Diameter messages can now > be retrieved by calling the diameter:service_info/2 function. > - Various smaller optimizations in the Erlang VM > - This release contains 66 contributions from users outside the > Ericsson team > > > You can find the README file with more detailed info at > http://www.erlang.org/download/otp_src_R15B02.readme > > You can download the full source distribution from > > http://www.erlang.org/download/otp_src_R15B02.tar.gz > http://www.erlang.org/download/otp_src_R15B02.readme (this file) > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > > For installation instructions please read the README that is part of > the distribution. > > You can also find this release at the official Erlang/OTP Git-repository > at Github here: > https://github.com/erlang/otp/tree/OTP_R15B02 (i.e. on the maint branch > tag= OTP_R15B02) > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_R15B02.exe > http://www.erlang.org/download/otp_win64_R15B02.exe > > > On-line documentation can be found at http://www.erlang.org/doc/. > You can also download the complete HTML documentation or the Unix manual > files > > http://www.erlang.org/download/otp_doc_html_R15B02.tar.gz > http://www.erlang.org/download/otp_doc_man_R15B02.tar.gz > > We also want to thank those that sent us patches, suggestions and bug > reports, > > The Erlang/OTP Team at Ericsson > > > _______________________________________________ > erlang-questions mailing listerlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Wed Sep 5 14:49:47 2012 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 05 Sep 2012 08:49:47 -0400 Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: References: Message-ID: <50474A6B.4090605@ferd.ca> I'll post this here as it's related. For those who were using my erlang-history patch to get shell history in Erlang, the repo has been updated to support R15B02. Repo at https://github.com/ferd/erlang-history Thanks, Fred. On 12-09-05 6:55 AM, Kenneth Lundin wrote: > Erlang/OTP R15B02 has been released. > > This release mainly contains a number of bug fixes as well as smaller > user contributions (but as > usual there are some new functionality as well). > > *Highlights: > * > > * Dialyzer: > o The type analysis tool Dialyzer is optimized to be generally > faster. > o It can now also run in parallel (default) on SMP systems and > by this perform the analysis significantly faster (Thanks to > Stavros Aronis and Kostis Sagonas) > * The SSL application now has experimental support for the TLS 1.1 > and 1.2 standards as well (Thanks to Andreas Schultz). > * CommonTest: > o It is now possible to sort the generated html tables. > o A Netconf client (ct_netconf) which support basic netconf over > ssh is added > * Diameter: Statistics counters related to Diameter messages can now > be retrieved by calling the diameter:service_info/2 function. > * Various smaller optimizations in the Erlang VM > * This release contains 66 contributions from users outside the > Ericsson team > > > You can find the README file with more detailed info at > > http://www.erlang.org/download/otp_src_R15B02.readme > > You can download the full source distribution from > http://www.erlang.org/download/otp_src_R15B02.tar.gz > http://www.erlang.org/download/otp_src_R15B02.readme (this file) > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > > For installation instructions please read the README that is part of > the distribution. > > You can also find this release at the official Erlang/OTP > Git-repository at Github here: > https://github.com/erlang/otp/tree/OTP_R15B02 (i.e. on the maint > branch tag= OTP_R15B02) > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_R15B02.exe > http://www.erlang.org/download/otp_win64_R15B02.exe > > > On-line documentation can be found at http://www.erlang.org/doc/. > You can also download the complete HTML documentation or the Unix > manual files > > http://www.erlang.org/download/otp_doc_html_R15B02.tar.gz > http://www.erlang.org/download/otp_doc_man_R15B02.tar.gz > > We also want to thank those that sent us patches, suggestions and bug > reports, > > The Erlang/OTP Team at Ericsson > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From xramtsov@REDACTED Wed Sep 5 14:58:15 2012 From: xramtsov@REDACTED (Evgeniy Khramtsov) Date: Wed, 05 Sep 2012 22:58:15 +1000 Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: References: Message-ID: <50474C67.3070402@gmail.com> On 05.09.2012 20:55, Kenneth Lundin wrote: > - Dialyzer: > - The type analysis tool Dialyzer is optimized to be generally > faster. > - It can now also run in parallel (default) on SMP systems and by > this perform the analysis significantly faster (Thanks to Stavros Aronis > and Kostis Sagonas) Just have tried to build the whole erlang plt: $ time dialyzer --build_plt --output_plt erlang.plt --apps ... .... done in 7m9.90s This is on Phenom II X4 955. Very impressive!!! -- Regards, Evgeniy Khramtsov, ProcessOne. xmpp:xram@REDACTED From matthewlmcclure@REDACTED Wed Sep 5 15:30:39 2012 From: matthewlmcclure@REDACTED (Matt McClure) Date: Wed, 5 Sep 2012 09:30:39 -0400 Subject: [erlang-questions] EPEL Erlang RPM dependencies Message-ID: I just enabled the EPEL erlang repo and I was suprised to see the next `yum -y upgrade` install a slew of audio and video related packages. It looks like erlang-wx and possibly others require them, and that erlang requires all of the erlang-* packages. Is there a way to install a leaner erlang via the RPMs? Thanks, Matt *** [root@REDACTED rabbitmq]# rpm -e libtheora error: Failed dependencies: libtheora.so.0()(64bit) is needed by (installed) gstreamer-plugins-base-0.10.20-3.0.1.el5_3.x86_64 libtheora.so.0(libtheora.so.1.0)(64bit) is needed by (installed) gstreamer-plugins-base-0.10.20-3.0.1.el5_3.x86_64 [root@REDACTED rabbitmq]# rpm -e gstreamer error: Failed dependencies: libgstbase-0.10.so.0()(64bit) is needed by (installed) gstreamer-plugins-base-0.10.20-3.0.1.el5_3.x86_64 libgstcontroller-0.10.so.0()(64bit) is needed by (installed) gstreamer-plugins-base-0.10.20-3.0.1.el5_3.x86_64 libgstdataprotocol-0.10.so.0()(64bit) is needed by (installed) gstreamer-plugins-base-0.10.20-3.0.1.el5_3.x86_64 libgstreamer-0.10.so.0()(64bit) is needed by (installed) gstreamer-plugins-base-0.10.20-3.0.1.el5_3.x86_64 libgstreamer-0.10.so.0()(64bit) is needed by (installed) wxGTK-2.8.12-1.el5.x86_64 gstreamer >= 0.10.20 is needed by (installed) gstreamer-plugins-base-0.10.20-3.0.1.el5_3.x86_64 [root@REDACTED rabbitmq]# rpm -e wxGTK error: Failed dependencies: libwx_gtk2u_adv-2.8.so.0()(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 libwx_gtk2u_adv-2.8.so.0(WXU_2.8)(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 libwx_gtk2u_aui-2.8.so.0()(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 libwx_gtk2u_aui-2.8.so.0(WXU_2.8)(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 libwx_gtk2u_aui-2.8.so.0(WXU_2.8.5)(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 libwx_gtk2u_core-2.8.so.0()(64bit) is needed by (installed) wxGTK-gl-2.8.12-1.el5.x86_64 libwx_gtk2u_core-2.8.so.0()(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 libwx_gtk2u_core-2.8.so.0(WXU_2.8)(64bit) is needed by (installed) wxGTK-gl-2.8.12-1.el5.x86_64 libwx_gtk2u_core-2.8.so.0(WXU_2.8)(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 libwx_gtk2u_html-2.8.so.0()(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 libwx_gtk2u_html-2.8.so.0(WXU_2.8)(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 libwx_gtk2u_stc-2.8.so.0()(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 libwx_gtk2u_stc-2.8.so.0(WXU_2.8)(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 libwx_gtk2u_xrc-2.8.so.0()(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 libwx_gtk2u_xrc-2.8.so.0(WXU_2.8)(64bit) is needed by (installed) erlang-wx-R14B-04.1.el5.x86_64 wxGTK = 2.8.12-1.el5 is needed by (installed) wxGTK-gl-2.8.12-1.el5.x86_64 -- Matt McClure http://www.matthewlmcclure.com http://www.mapmyfitness.com/profile/matthewlmcclure From lemenkov@REDACTED Wed Sep 5 15:34:24 2012 From: lemenkov@REDACTED (Peter Lemenkov) Date: Wed, 5 Sep 2012 17:34:24 +0400 Subject: [erlang-questions] EPEL Erlang RPM dependencies In-Reply-To: References: Message-ID: 2012/9/5 Matt McClure : > I just enabled the EPEL erlang repo > > and I was suprised to see the next `yum -y upgrade` install a slew of > audio and video related packages. It looks like erlang-wx and possibly > others require them, and that erlang requires all of the erlang-* > packages. Is there a way to install a leaner erlang via the RPMs? Recompile it with wx module disabled. Btw what's wrong with a few more dependencies? I mean I don't feel much pain while installing them. Unless you have a really very constrained resources on a target machine of course. -- With best regards, Peter Lemenkov. From esente@REDACTED Wed Sep 5 15:35:45 2012 From: esente@REDACTED (Son Tran-Nguyen) Date: Wed, 5 Sep 2012 08:35:45 -0500 Subject: [erlang-questions] Maximum number of children for simple_one_for_one supervisor? In-Reply-To: References: Message-ID: Just want to add another detail is that the children will be transient, and only be restarted when crashed. Other than that, the supervisor does not need to do anything, besides providing the children info. Each children process' weight is mainly determined by the data contained in the handlers the process is added. Some may only have few handlers with small state data, while other may be doing heavy computation. Looking at Dmitry's numbers, it may be preferable to split those processes into zones to be managed by different supervisors. Maybe adding more supervison layers on top of it. Son Tran -------------- next part -------------- An HTML attachment was scrubbed... URL: From sasa555@REDACTED Wed Sep 5 15:40:36 2012 From: sasa555@REDACTED (sasa) Date: Wed, 5 Sep 2012 15:40:36 +0200 Subject: [erlang-questions] fprof ets table Message-ID: Hello, I am using fprof to profile production running system. Each minute, I issue following statements: fprof:apply(...) fprof:profile(...) fprof:analyse(...) I have noticed that this creates one ets table which doesn't get deleted. I tried issuing those statements from a spawned process, but it didn't help. How can I prevent this from happening? One way is to iterate over each fprof table and delete it manually. I have tried this, and it seemed to work. Could this impose some problem? Is there some cleaner way? Best regards, Sasa -------------- next part -------------- An HTML attachment was scrubbed... URL: From michal.niec@REDACTED Wed Sep 5 16:08:37 2012 From: michal.niec@REDACTED (=?utf-8?Q?Micha=C5=82_Nie=C4=87?=) Date: Wed, 5 Sep 2012 16:08:37 +0200 Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: References: Message-ID: <7FDFAF27-2FE6-4A41-ABCE-307ADD980C2F@erlang-solutions.com> Hi, You can find our Erlang R15B02 packages for 32 and 64 bit versions of Mac OS X, CentOS, Debian, Ubuntu at https://www.erlang-solutions.com/downloads/download-erlang-otp . Best Regards, Michal Niec Erlang Solutions Ltd. On Sep 5, 2012, at 12:55 PM, Kenneth Lundin wrote: > Erlang/OTP R15B02 has been released. > > This release mainly contains a number of bug fixes as well as smaller user contributions (but as > usual there are some new functionality as well). > Highlights: > > > > Dialyzer: > The type analysis tool Dialyzer is optimized to be generally faster. > It can now also run in parallel (default) on SMP systems and by this perform the analysis significantly faster (Thanks to Stavros Aronis and Kostis Sagonas) > The SSL application now has experimental support for the TLS 1.1 and 1.2 standards as well (Thanks to Andreas Schultz). > CommonTest: > It is now possible to sort the generated html tables. > A Netconf client (ct_netconf) which support basic netconf over ssh is added > Diameter: Statistics counters related to Diameter messages can now be retrieved by calling the diameter:service_info/2 function. > Various smaller optimizations in the Erlang VM > This release contains 66 contributions from users outside the Ericsson team > > > > You can find the README file with more detailed info at > > http://www.erlang.org/download/otp_src_R15B02.readme > > You can download the full source distribution from > > http://www.erlang.org/download/otp_src_R15B02.tar.gz > http://www.erlang.org/download/otp_src_R15B02.readme (this file) > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > > For installation instructions please read the README that is part of > the distribution. > > You can also find this release at the official Erlang/OTP Git-repository at Github here: > https://github.com/erlang/otp/tree/OTP_R15B02 (i.e. on the maint branch tag= OTP_R15B02) > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_R15B02.exe > http://www.erlang.org/download/otp_win64_R15B02.exe > > > On-line documentation can be found at http://www.erlang.org/doc/. > You can also download the complete HTML documentation or the Unix manual files > > http://www.erlang.org/download/otp_doc_html_R15B02.tar.gz > http://www.erlang.org/download/otp_doc_man_R15B02.tar.gz > > We also want to thank those that sent us patches, suggestions and bug reports, > > The Erlang/OTP Team at Ericsson > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomon.wzs@REDACTED Wed Sep 5 16:17:01 2012 From: solomon.wzs@REDACTED (Solomon) Date: Wed, 5 Sep 2012 22:17:01 +0800 Subject: [erlang-questions] Mnesia slow down system performance when table size reaches a certain value In-Reply-To: References: Message-ID: My system has enough memory, is there memory limit of erlang vm? (I run the server at 32bit os with pae patch, and the problem did not arise at 64bit os) 2012/9/5 Michael Turner > On Wed, Sep 5, 2012 at 5:33 PM, Dan Gudmundsson wrote: > > Is it a bag table, If so how unique are your keys? > > > > Do you have an index on table, if so how unique are the secondary keys? > > > > Insertion time in bags are linear, (and indices are bag tables). > > Dan, that would explain a relatively smooth degradation in > performance, as size goes up. What's being reported here doesn't sound > like that. Quantum leaps in execution time are often caused by a level > of the memory hierarchy getting maxed out, by something that's doing a > comprehensive scan of data that, up to a point, fits in that level of > the hierarchy. With CPU load going to (near-) zero, sounds like the > level is that of virtual memory: thrashing, I/O bound through > page-replacement. Even if that's the case here, the mystery is why > deleting some records doesn't "fix" the problem. > > -michael turner > > > > On Wed, Sep 5, 2012 at 8:02 AM, Solomon wrote: > >> I set up a web server with erlang and use mnesia to save the session. > >> I test server, at beginning, system run well and cpu load were about > 90%. > >> Whe session table size reached a certain value, most web requests were > >> failure, and cpu were idle. I delete some records in session table, but > it > >> were not worked, then I used mnesia:clear_table/1 to clear session, > system > >> run normal again. > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > >> > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anders.nygren@REDACTED Wed Sep 5 16:17:16 2012 From: anders.nygren@REDACTED (Anders Nygren) Date: Wed, 5 Sep 2012 09:17:16 -0500 Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: <7FDFAF27-2FE6-4A41-ABCE-307ADD980C2F@erlang-solutions.com> References: <7FDFAF27-2FE6-4A41-ABCE-307ADD980C2F@erlang-solutions.com> Message-ID: When will You make the Raspbian package? /Anders On Wed, Sep 5, 2012 at 9:08 AM, Micha? Nie? wrote: > Hi, > > You can find our Erlang R15B02 packages for 32 and 64 bit versions of Mac OS > X, CentOS, Debian, Ubuntu at > https://www.erlang-solutions.com/downloads/download-erlang-otp . > > Best Regards, > Michal Niec > > Erlang Solutions Ltd. > > On Sep 5, 2012, at 12:55 PM, Kenneth Lundin > wrote: > > Erlang/OTP R15B02 has been released. > > This release mainly contains a number of bug fixes as well as smaller user > contributions (but as > usual there are some new functionality as well). > > Highlights: > > > > Dialyzer: > > The type analysis tool Dialyzer is optimized to be generally faster. > It can now also run in parallel (default) on SMP systems and by this perform > the analysis significantly faster (Thanks to Stavros Aronis and Kostis > Sagonas) > > The SSL application now has experimental support for the TLS 1.1 and 1.2 > standards as well (Thanks to Andreas Schultz). > CommonTest: > > It is now possible to sort the generated html tables. > A Netconf client (ct_netconf) which support basic netconf over ssh is added > > Diameter: Statistics counters related to Diameter messages can now be > retrieved by calling the diameter:service_info/2 function. > Various smaller optimizations in the Erlang VM > This release contains 66 contributions from users outside the Ericsson team > > > > You can find the README file with more detailed info at > > http://www.erlang.org/download/otp_src_R15B02.readme > > You can download the full source distribution from > > http://www.erlang.org/download/otp_src_R15B02.tar.gz > http://www.erlang.org/download/otp_src_R15B02.readme (this file) > > Note: To unpack the TAR archive you need a GNU TAR compatible program. > > For installation instructions please read the README that is part of > the distribution. > > You can also find this release at the official Erlang/OTP Git-repository at > Github here: > https://github.com/erlang/otp/tree/OTP_R15B02 (i.e. on the maint branch tag= > OTP_R15B02) > > The Windows binary distribution can be downloaded from > > http://www.erlang.org/download/otp_win32_R15B02.exe > http://www.erlang.org/download/otp_win64_R15B02.exe > > > On-line documentation can be found at http://www.erlang.org/doc/. > You can also download the complete HTML documentation or the Unix manual > files > > http://www.erlang.org/download/otp_doc_html_R15B02.tar.gz > http://www.erlang.org/download/otp_doc_man_R15B02.tar.gz > > We also want to thank those that sent us patches, suggestions and bug > reports, > > The Erlang/OTP Team at Ericsson > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From michal.niec@REDACTED Wed Sep 5 16:21:53 2012 From: michal.niec@REDACTED (=?utf-8?Q?Micha=C5=82_Nie=C4=87?=) Date: Wed, 5 Sep 2012 16:21:53 +0200 Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: References: <7FDFAF27-2FE6-4A41-ABCE-307ADD980C2F@erlang-solutions.com> Message-ID: Hi, It has been already added to deb repo. It should appear on the website in minutes. Best Regards, Michal Niec Erlang Solutions Ltd. On Sep 5, 2012, at 4:17 PM, Anders Nygren wrote: > When will You make the Raspbian package? > > /Anders > > On Wed, Sep 5, 2012 at 9:08 AM, Micha? Nie? > wrote: >> Hi, >> >> You can find our Erlang R15B02 packages for 32 and 64 bit versions of Mac OS >> X, CentOS, Debian, Ubuntu at >> https://www.erlang-solutions.com/downloads/download-erlang-otp . >> >> Best Regards, >> Michal Niec >> >> Erlang Solutions Ltd. >> >> On Sep 5, 2012, at 12:55 PM, Kenneth Lundin >> wrote: >> >> Erlang/OTP R15B02 has been released. >> >> This release mainly contains a number of bug fixes as well as smaller user >> contributions (but as >> usual there are some new functionality as well). >> >> Highlights: >> >> >> >> Dialyzer: >> >> The type analysis tool Dialyzer is optimized to be generally faster. >> It can now also run in parallel (default) on SMP systems and by this perform >> the analysis significantly faster (Thanks to Stavros Aronis and Kostis >> Sagonas) >> >> The SSL application now has experimental support for the TLS 1.1 and 1.2 >> standards as well (Thanks to Andreas Schultz). >> CommonTest: >> >> It is now possible to sort the generated html tables. >> A Netconf client (ct_netconf) which support basic netconf over ssh is added >> >> Diameter: Statistics counters related to Diameter messages can now be >> retrieved by calling the diameter:service_info/2 function. >> Various smaller optimizations in the Erlang VM >> This release contains 66 contributions from users outside the Ericsson team >> >> >> >> You can find the README file with more detailed info at >> >> http://www.erlang.org/download/otp_src_R15B02.readme >> >> You can download the full source distribution from >> >> http://www.erlang.org/download/otp_src_R15B02.tar.gz >> http://www.erlang.org/download/otp_src_R15B02.readme (this file) >> >> Note: To unpack the TAR archive you need a GNU TAR compatible program. >> >> For installation instructions please read the README that is part of >> the distribution. >> >> You can also find this release at the official Erlang/OTP Git-repository at >> Github here: >> https://github.com/erlang/otp/tree/OTP_R15B02 (i.e. on the maint branch tag= >> OTP_R15B02) >> >> The Windows binary distribution can be downloaded from >> >> http://www.erlang.org/download/otp_win32_R15B02.exe >> http://www.erlang.org/download/otp_win64_R15B02.exe >> >> >> On-line documentation can be found at http://www.erlang.org/doc/. >> You can also download the complete HTML documentation or the Unix manual >> files >> >> http://www.erlang.org/download/otp_doc_html_R15B02.tar.gz >> http://www.erlang.org/download/otp_doc_man_R15B02.tar.gz >> >> We also want to thank those that sent us patches, suggestions and bug >> reports, >> >> The Erlang/OTP Team at Ericsson >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> From anders.nygren@REDACTED Wed Sep 5 16:35:46 2012 From: anders.nygren@REDACTED (Anders Nygren) Date: Wed, 5 Sep 2012 09:35:46 -0500 Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: References: <7FDFAF27-2FE6-4A41-ABCE-307ADD980C2F@erlang-solutions.com> Message-ID: Great, thanks /Anders On Wed, Sep 5, 2012 at 9:21 AM, Micha? Nie? wrote: > Hi, > > It has been already added to deb repo. It should appear on the website in minutes. > > Best Regards, > Michal Niec > > Erlang Solutions Ltd. > On Sep 5, 2012, at 4:17 PM, Anders Nygren wrote: > >> When will You make the Raspbian package? >> >> /Anders >> >> On Wed, Sep 5, 2012 at 9:08 AM, Micha? Nie? >> wrote: >>> Hi, >>> >>> You can find our Erlang R15B02 packages for 32 and 64 bit versions of Mac OS >>> X, CentOS, Debian, Ubuntu at >>> https://www.erlang-solutions.com/downloads/download-erlang-otp . >>> >>> Best Regards, >>> Michal Niec >>> >>> Erlang Solutions Ltd. >>> >>> On Sep 5, 2012, at 12:55 PM, Kenneth Lundin >>> wrote: >>> >>> Erlang/OTP R15B02 has been released. >>> >>> This release mainly contains a number of bug fixes as well as smaller user >>> contributions (but as >>> usual there are some new functionality as well). >>> >>> Highlights: >>> >>> >>> >>> Dialyzer: >>> >>> The type analysis tool Dialyzer is optimized to be generally faster. >>> It can now also run in parallel (default) on SMP systems and by this perform >>> the analysis significantly faster (Thanks to Stavros Aronis and Kostis >>> Sagonas) >>> >>> The SSL application now has experimental support for the TLS 1.1 and 1.2 >>> standards as well (Thanks to Andreas Schultz). >>> CommonTest: >>> >>> It is now possible to sort the generated html tables. >>> A Netconf client (ct_netconf) which support basic netconf over ssh is added >>> >>> Diameter: Statistics counters related to Diameter messages can now be >>> retrieved by calling the diameter:service_info/2 function. >>> Various smaller optimizations in the Erlang VM >>> This release contains 66 contributions from users outside the Ericsson team >>> >>> >>> >>> You can find the README file with more detailed info at >>> >>> http://www.erlang.org/download/otp_src_R15B02.readme >>> >>> You can download the full source distribution from >>> >>> http://www.erlang.org/download/otp_src_R15B02.tar.gz >>> http://www.erlang.org/download/otp_src_R15B02.readme (this file) >>> >>> Note: To unpack the TAR archive you need a GNU TAR compatible program. >>> >>> For installation instructions please read the README that is part of >>> the distribution. >>> >>> You can also find this release at the official Erlang/OTP Git-repository at >>> Github here: >>> https://github.com/erlang/otp/tree/OTP_R15B02 (i.e. on the maint branch tag= >>> OTP_R15B02) >>> >>> The Windows binary distribution can be downloaded from >>> >>> http://www.erlang.org/download/otp_win32_R15B02.exe >>> http://www.erlang.org/download/otp_win64_R15B02.exe >>> >>> >>> On-line documentation can be found at http://www.erlang.org/doc/. >>> You can also download the complete HTML documentation or the Unix manual >>> files >>> >>> http://www.erlang.org/download/otp_doc_html_R15B02.tar.gz >>> http://www.erlang.org/download/otp_doc_man_R15B02.tar.gz >>> >>> We also want to thank those that sent us patches, suggestions and bug >>> reports, >>> >>> The Erlang/OTP Team at Ericsson >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> > From Sergey_Zhemzhitsky@REDACTED Wed Sep 5 17:18:37 2012 From: Sergey_Zhemzhitsky@REDACTED (Zhemzhitsky Sergey) Date: Wed, 5 Sep 2012 15:18:37 +0000 Subject: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? Message-ID: <06139A918ACCA041BF46A0F36940C7FA4FE3CFBE@exch-mbx1.msk.trd.ru> Hi erlang gurus, We?re developing erlang port driver that will send different terms to some processes from the separate threads using driver_send_term. Each native thread started in the port driver (by means of erl_drv_thread_create) will be associated with only one erlang process and will send messages only to it. As a rule the documentation for driver_send_term says that it?s not thread-safe when smp is disabled, so we have tested the driver with disabled smp support and found that from time to time it leads to segfaults. So, the question is what is the proper way to make calls to driver_send_term (and driver_output_term) thread-safe? Will driver_pdl_lock, driver_pdl_unlock help? Will wrapping all the calls to driver_send_term (and driver_output_term) with erl_drv_mutex_lock and erl_drv_mutex_unlock help? Best Regards, Sergey _______________________________________________________ The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. If you need assistance please contact our Contact Center (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp -------------- next part -------------- An HTML attachment was scrubbed... URL: From mlortiz@REDACTED Wed Sep 5 17:33:05 2012 From: mlortiz@REDACTED (Marcos Ortiz) Date: Wed, 05 Sep 2012 11:33:05 -0400 Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: <7FDFAF27-2FE6-4A41-ABCE-307ADD980C2F@erlang-solutions.com> References: <7FDFAF27-2FE6-4A41-ABCE-307ADD980C2F@erlang-solutions.com> Message-ID: <504770B1.6070507@uci.cu> Thanks for the info, Michal, I will change the blog post for this, and I will add it. I let you the link to share it: http://marcosluis2186.posterous.com/erlangotp-r15b02-has-been-released Best wishes On 09/05/2012 10:08 AM, Micha? Nie? wrote: > Hi, > > You can find our Erlang R15B02 packages for 32 and 64 bit versions of > Mac OS X, CentOS, Debian, Ubuntu at > https://www.erlang-solutions.com/downloads/download-erlang-otp . > > Best Regards, > Michal Niec > > Erlang Solutions Ltd. > > On Sep 5, 2012, at 12:55 PM, Kenneth Lundin > wrote: > >> Erlang/OTP R15B02 has been released. >> >> This release mainly contains a number of bug fixes as well as smaller >> user contributions (but as >> usual there are some new functionality as well). >> >> *Highlights: >> * >> >> >> >> * Dialyzer: >> o The type analysis tool Dialyzer is optimized to be generally >> faster. >> o It can now also run in parallel (default) on SMP systems and >> by this perform the analysis significantly faster (Thanks to >> Stavros Aronis and Kostis Sagonas) >> * The SSL application now has experimental support for the TLS 1.1 >> and 1.2 standards as well (Thanks to Andreas Schultz). >> * CommonTest: >> o It is now possible to sort the generated html tables. >> o A Netconf client (ct_netconf) which support basic netconf >> over ssh is added >> * Diameter: Statistics counters related to Diameter messages can >> now be retrieved by calling the diameter:service_info/2 function. >> * Various smaller optimizations in the Erlang VM >> * This release contains 66 contributions from users outside the >> Ericsson team >> >> >> >> You can find the README file with more detailed info at >> >> http://www.erlang.org/download/otp_src_R15B02.readme >> >> You can download the full source distribution from >> http://www.erlang.org/download/otp_src_R15B02.tar.gz >> http://www.erlang.org/download/otp_src_R15B02.readme (this file) >> >> Note: To unpack the TAR archive you need a GNU TAR compatible program. >> >> For installation instructions please read the README that is part of >> the distribution. >> >> You can also find this release at the official Erlang/OTP >> Git-repository at Github here: >> https://github.com/erlang/otp/tree/OTP_R15B02 (i.e. on the maint >> branch tag= OTP_R15B02) >> >> The Windows binary distribution can be downloaded from >> >> http://www.erlang.org/download/otp_win32_R15B02.exe >> http://www.erlang.org/download/otp_win64_R15B02.exe >> >> >> On-line documentation can be found at http://www.erlang.org/doc/. >> You can also download the complete HTML documentation or the Unix >> manual files >> >> http://www.erlang.org/download/otp_doc_html_R15B02.tar.gz >> http://www.erlang.org/download/otp_doc_man_R15B02.tar.gz >> >> We also want to thank those that sent us patches, suggestions and bug >> reports, >> >> The Erlang/OTP Team at Ericsson >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Marcos Luis Ort?z Valmaseda *Data Engineer && Sr. System Administrator at UCI* about.me/marcosortiz My Blog @marcosluis2186 10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS... CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION http://www.uci.cu http://www.facebook.com/universidad.uci http://www.flickr.com/photos/universidad_uci -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji.rikitake@REDACTED Wed Sep 5 17:34:49 2012 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Thu, 6 Sep 2012 00:34:49 +0900 Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: References: Message-ID: <20120905153449.GA50794@k2r.org> FreeBSD (unofficial) port for R15B02 is available at: https://github.com/jj1bdx/erlang-freebsd-port Note: for 9.1-PRERELEASE/amd64, the stock cc (gcc 4.2.1) does not exit from compiling erts/emulator/beam/erl_nif.c. Using gcc46 (gcc 4.6.3) in the Ports library will solve this problem. I've reported this to Jimmy Olgeni, the maintainer of FreeBSD Erlang Port. Regards and kudos to the OTP Team, Kenji Rikitake ++> Kenneth Lundin [2012-09-05 12:55:59 +0200]: > Erlang/OTP R15B02 has been released. From lukas@REDACTED Wed Sep 5 18:37:26 2012 From: lukas@REDACTED (Lukas Larsson) Date: Wed, 5 Sep 2012 18:37:26 +0200 Subject: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? In-Reply-To: <06139A918ACCA041BF46A0F36940C7FA4FE3CFBE@exch-mbx1.msk.trd.ru> References: <06139A918ACCA041BF46A0F36940C7FA4FE3CFBE@exch-mbx1.msk.trd.ru> Message-ID: Hello, I do not think[1] this is a problem which you can solve in your driver. It is probably the internals of the Erlang VM which are not threadsafe, i.e. if there are no locks around message queues to processes in the non-smp emulator. So while sending data to a process, that same process could be reading data from the queue, and voila you get a segfault. So in order to fix this I think you would have to patch the emulator it self. Lukas [1]: Note that I haven't actually checked the relevant code, I have divined this from what I know of the emulator. On Wed, Sep 5, 2012 at 5:18 PM, Zhemzhitsky Sergey wrote: > Hi erlang gurus, > > > > We?re developing erlang port driver that will send different terms to some > processes from the separate threads using driver_send_term. > > Each native thread started in the port driver (by means of > erl_drv_thread_create) will be associated with only one erlang process and > will send messages only to it. > > > > As a rule the documentation for driver_send_term says that it?s not > thread-safe when smp is disabled, so we have tested the driver with disabled > smp support and found that from time to time it leads to segfaults. > > > > So, the question is what is the proper way to make calls to driver_send_term > (and driver_output_term) thread-safe? > > Will driver_pdl_lock, driver_pdl_unlock help? > > Will wrapping all the calls to driver_send_term (and driver_output_term) > with erl_drv_mutex_lock and erl_drv_mutex_unlock help? > > > > > > Best Regards, > > Sergey > > > > _______________________________________________________ > > > > The information contained in this message may be privileged and conf > idential and protected from disclosure. If you are not the original intended > recipient, you are hereby notified that any review, retransmission, > dissemination, or other use of, or taking of any action in reliance upon, > this information is prohibited. If you have received this communication in > error, please notify the sender immediately by replying to this message and > delete it from your computer. Thank you for your cooperation. Troika Dialog, > Russia. > > If you need assistance please contact our Contact Center (+7495) 258 0500 or > go to www.troika.ru/eng/Contacts/system.wbp > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From matthewlmcclure@REDACTED Wed Sep 5 21:09:44 2012 From: matthewlmcclure@REDACTED (Matt McClure) Date: Wed, 5 Sep 2012 15:09:44 -0400 Subject: [erlang-questions] EPEL Erlang RPM dependencies In-Reply-To: References: Message-ID: <-1795843509600206596@unknownmsgid> On Sep 5, 2012, at 9:34 AM, Peter Lemenkov wrote: > Recompile it with wx module disabled. > > Btw what's wrong with a few more dependencies? I mean I don't feel > much pain while installing them. Unless you have a really very > constrained resources on a target machine of course. Hi Peter, I'm automating provisioning a VM image, and I'm trying to keep the image as small as reasonably possible. Best, Matt From rickard@REDACTED Wed Sep 5 22:32:08 2012 From: rickard@REDACTED (Rickard Green) Date: Wed, 5 Sep 2012 22:32:08 +0200 Subject: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? In-Reply-To: References: <06139A918ACCA041BF46A0F36940C7FA4FE3CFBE@exch-mbx1.msk.trd.ru> Message-ID: <21274336-0343-485A-B0FB-61EC08E66F6A@erlang.org> As Lukas said, this is not something you can solve in your driver. It would require changes in the emulator. driver_send_term() can of course be made thread safe also in the non-smp emulator. Initially we also planned on doing so, but after looking closer at it we dropped that idea. This since it would pull in too much stuff from the smp emulator. One way to do it could be to replace "erl -smp disable" with "erl -smp enable +S1" :-) The way to send information from threads to Erlang processes in the non-smp case is something like the following using a thread safe queue and a pipe. Create a pipe and call driver_select(port, fd, ERL_DRV_READ, 1) to show your interest in the read end of the pipe. When a thread has enqueued an element on the queue it should also write a byte on the write end of the pipe (note that it is important that this is done *after* the enqueue operation). This will trigger a call to the ready_input(drv_data, fd) callback by the scheduler thread. In the ready_input() callback you read away the byte written on the pipe and then dequeue the element, create a message and send it to the process using driver_[send|output]_term(). In the windows case you need to use an event instead of a pipe. Also, note that even though driver_send_term() is thread safe in the smp case, driver_output_term() is *not*. Regards, Rickard Green, Erlang/OTP, Ericsson AB On Sep 5, 2012, at 6:37 PM, Lukas Larsson wrote: > Hello, > > I do not think[1] this is a problem which you can solve in your > driver. It is probably the internals of the Erlang VM which are not > threadsafe, i.e. if there are no locks around message queues to > processes in the non-smp emulator. So while sending data to a process, > that same process could be reading data from the queue, and voila you > get a segfault. So in order to fix this I think you would have to > patch the emulator it self. > > Lukas > > [1]: Note that I haven't actually checked the relevant code, I have > divined this from what I know of the emulator. > > On Wed, Sep 5, 2012 at 5:18 PM, Zhemzhitsky Sergey > wrote: >> Hi erlang gurus, >> >> >> >> We?re developing erlang port driver that will send different terms to some >> processes from the separate threads using driver_send_term. >> >> Each native thread started in the port driver (by means of >> erl_drv_thread_create) will be associated with only one erlang process and >> will send messages only to it. >> >> >> >> As a rule the documentation for driver_send_term says that it?s not >> thread-safe when smp is disabled, so we have tested the driver with disabled >> smp support and found that from time to time it leads to segfaults. >> >> >> >> So, the question is what is the proper way to make calls to driver_send_term >> (and driver_output_term) thread-safe? >> >> Will driver_pdl_lock, driver_pdl_unlock help? >> >> Will wrapping all the calls to driver_send_term (and driver_output_term) >> with erl_drv_mutex_lock and erl_drv_mutex_unlock help? >> >> >> >> >> >> Best Regards, >> >> Sergey >> >> >> >> _______________________________________________________ >> >> >> >> The information contained in this message may be privileged and conf >> idential and protected from disclosure. If you are not the original intended >> recipient, you are hereby notified that any review, retransmission, >> dissemination, or other use of, or taking of any action in reliance upon, >> this information is prohibited. If you have received this communication in >> error, please notify the sender immediately by replying to this message and >> delete it from your computer. Thank you for your cooperation. Troika Dialog, >> Russia. >> >> If you need assistance please contact our Contact Center (+7495) 258 0500 or >> go to www.troika.ru/eng/Contacts/system.wbp >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From ok@REDACTED Thu Sep 6 00:51:59 2012 From: ok@REDACTED (Richard O'Keefe) Date: Thu, 6 Sep 2012 10:51:59 +1200 Subject: [erlang-questions] http://www.erlang.org/ : appealing or appalling? Message-ID: <6148046F-0CAD-4404-A616-57F903339921@cs.otago.ac.nz> The subject line is a node to Adlai Stevenson's quip that he found [St] Paul appealing and [Norman Vincent] Peale appalling. I happened to visit www.erlang.org this morning, and while I found much good stuff there, I found the entry page unappealing. The quote from Joe Armstrong is in dark grey on a black background and is *very* hard to read. The "bleached" Erlang "e" on the right looked a bit dead, and the way such colour as existed at the top "faded into the black" for some reason made me think of the dying Emperor Julian. On the Downloads page, the word "courtesy" is spelled "curtesy". (And "OS X" is normally written that way, not "Os X".) From ok@REDACTED Thu Sep 6 00:54:19 2012 From: ok@REDACTED (Richard O'Keefe) Date: Thu, 6 Sep 2012 10:54:19 +1200 Subject: [erlang-questions] http://www.erlang.org/ : appealing or appalling? In-Reply-To: <6148046F-0CAD-4404-A616-57F903339921@cs.otago.ac.nz> References: <6148046F-0CAD-4404-A616-57F903339921@cs.otago.ac.nz> Message-ID: <823443AE-3CAD-40D4-92F4-D9EA00D88684@cs.otago.ac.nz> On 6/09/2012, at 10:51 AM, Richard O'Keefe wrote: > The subject line is a node to Adlai Stevenson's quip that he s/node/nod/ There are two equal and opposite errors concerning spelling checkers: (A) forgetting to use them and (B) relying on them. From rich.neswold@REDACTED Thu Sep 6 07:28:13 2012 From: rich.neswold@REDACTED (Rich Neswold) Date: Thu, 6 Sep 2012 00:28:13 -0500 Subject: [erlang-questions] Understanding a record generated by fprof:analyse/* Message-ID: Hello, I'm running the fprof profiler on our newly developed system and found a record in the profiler output that I don't understand. The record in question is: {[{{gen_server,loop,6}, 1630, 84.765, 26.450}], { {gen_server,decode_msg,8}, 1630, 84.765, 26.450}, [{{gen_server,handle_msg,5}, 1630, 0.018, 25.549}]}. The second column of numbers is the accumulated time used by the function and the last column is the time taken in the function itself (not functions it has called.) In 99% of the records, the accumulated time is greater than the function's time, which makes sense. In the case of genserver:handle_msg/5, however, the accumulated time is 18 uS (!) and the function took 25 mS. How can this be? Is anyone familiar enough with fprof to know what this is telling me? Thank you! -- Rich From Sergey_Zhemzhitsky@REDACTED Thu Sep 6 08:25:37 2012 From: Sergey_Zhemzhitsky@REDACTED (Zhemzhitsky Sergey) Date: Thu, 6 Sep 2012 06:25:37 +0000 Subject: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? In-Reply-To: <21274336-0343-485A-B0FB-61EC08E66F6A@erlang.org> References: <06139A918ACCA041BF46A0F36940C7FA4FE3CFBE@exch-mbx1.msk.trd.ru> <21274336-0343-485A-B0FB-61EC08E66F6A@erlang.org> Message-ID: <06139A918ACCA041BF46A0F36940C7FA4FE3D1D5@exch-mbx1.msk.trd.ru> Hello Rickard, Thanks a lot for the idea with pipes. >> driver_send_term() is thread safe in the smp case, driver_output_term() is *not*. Does it mean that it's dangerous to use driver_send_term() from an arbitrary detached thread and driver_output_term from one of the driver callbacks at the same time in the case when smp is enabled? Best Regards, Sergey -----Original Message----- From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Rickard Green Sent: Thursday, September 06, 2012 12:32 AM To: Erlang-Questions Questions Subject: Re: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? As Lukas said, this is not something you can solve in your driver. It would require changes in the emulator. driver_send_term() can of course be made thread safe also in the non-smp emulator. Initially we also planned on doing so, but after looking closer at it we dropped that idea. This since it would pull in too much stuff from the smp emulator. One way to do it could be to replace "erl -smp disable" with "erl -smp enable +S1" :-) The way to send information from threads to Erlang processes in the non-smp case is something like the following using a thread safe queue and a pipe. Create a pipe and call driver_select(port, fd, ERL_DRV_READ, 1) to show your interest in the read end of the pipe. When a thread has enqueued an element on the queue it should also write a byte on the write end of the pipe (note that it is important that this is done *after* the enqueue operation). This will trigger a call to the ready_input(drv_data, fd) callback by the scheduler thread. In the ready_input() callback you read away the byte written on the pipe and then dequeue the element, create a message and send it to the process using driver_[send|output]_term(). In the windows case you need to use an event instead of a pipe. Also, note that even though driver_send_term() is thread safe in the smp case, driver_output_term() is *not*. Regards, Rickard Green, Erlang/OTP, Ericsson AB On Sep 5, 2012, at 6:37 PM, Lukas Larsson wrote: > Hello, > > I do not think[1] this is a problem which you can solve in your > driver. It is probably the internals of the Erlang VM which are not > threadsafe, i.e. if there are no locks around message queues to > processes in the non-smp emulator. So while sending data to a process, > that same process could be reading data from the queue, and voila you > get a segfault. So in order to fix this I think you would have to > patch the emulator it self. > > Lukas > > [1]: Note that I haven't actually checked the relevant code, I have > divined this from what I know of the emulator. > > On Wed, Sep 5, 2012 at 5:18 PM, Zhemzhitsky Sergey > wrote: >> Hi erlang gurus, >> >> >> >> We?re developing erlang port driver that will send different terms to >> some processes from the separate threads using driver_send_term. >> >> Each native thread started in the port driver (by means of >> erl_drv_thread_create) will be associated with only one erlang >> process and will send messages only to it. >> >> >> >> As a rule the documentation for driver_send_term says that it?s not >> thread-safe when smp is disabled, so we have tested the driver with >> disabled smp support and found that from time to time it leads to segfaults. >> >> >> >> So, the question is what is the proper way to make calls to >> driver_send_term (and driver_output_term) thread-safe? >> >> Will driver_pdl_lock, driver_pdl_unlock help? >> >> Will wrapping all the calls to driver_send_term (and >> driver_output_term) with erl_drv_mutex_lock and erl_drv_mutex_unlock help? >> >> >> >> >> >> Best Regards, >> >> Sergey >> >> >> >> _______________________________________________________ >> >> >> >> The information contained in this message may be privileged and conf >> idential and protected from disclosure. If you are not the original >> intended recipient, you are hereby notified that any review, >> retransmission, dissemination, or other use of, or taking of any >> action in reliance upon, this information is prohibited. If you have >> received this communication in error, please notify the sender >> immediately by replying to this message and delete it from your >> computer. Thank you for your cooperation. Troika Dialog, Russia. >> >> If you need assistance please contact our Contact Center (+7495) 258 >> 0500 or go to www.troika.ru/eng/Contacts/system.wbp >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions From rickard@REDACTED Thu Sep 6 08:49:27 2012 From: rickard@REDACTED (Rickard Green) Date: Thu, 6 Sep 2012 08:49:27 +0200 Subject: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? In-Reply-To: <06139A918ACCA041BF46A0F36940C7FA4FE3D1D5@exch-mbx1.msk.trd.ru> References: <06139A918ACCA041BF46A0F36940C7FA4FE3CFBE@exch-mbx1.msk.trd.ru> <21274336-0343-485A-B0FB-61EC08E66F6A@erlang.org> <06139A918ACCA041BF46A0F36940C7FA4FE3D1D5@exch-mbx1.msk.trd.ru> Message-ID: <50484777.9050304@erlang.org> No, that is safe to do. Regards, Rickard On 09/06/2012 08:25 AM, Zhemzhitsky Sergey wrote: > Hello Rickard, > > Thanks a lot for the idea with pipes. > >>> driver_send_term() is thread safe in the smp case, driver_output_term() is *not*. > Does it mean that it's dangerous to use driver_send_term() from an arbitrary detached thread and driver_output_term from one of the driver callbacks at the same time in the case when smp is enabled? > > Best Regards, > Sergey > > -----Original Message----- > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Rickard Green > Sent: Thursday, September 06, 2012 12:32 AM > To: Erlang-Questions Questions > Subject: Re: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? > > As Lukas said, this is not something you can solve in your driver. It would require changes in the emulator. > > driver_send_term() can of course be made thread safe also in the non-smp emulator. Initially we also planned on doing so, but after looking closer at it we dropped that idea. This since it would pull in too much stuff from the smp emulator. One way to do it could be to replace "erl -smp disable" with "erl -smp enable +S1" :-) > > The way to send information from threads to Erlang processes in the non-smp case is something like the following using a thread safe queue and a pipe. Create a pipe and call driver_select(port, fd, ERL_DRV_READ, 1) to show your interest in the read end of the pipe. When a thread has enqueued an element on the queue it should also write a byte on the write end of the pipe (note that it is important that this is done *after* the enqueue operation). This will trigger a call to the ready_input(drv_data, fd) callback by the scheduler thread. In the ready_input() callback you read away the byte written on the pipe and then dequeue the element, create a message and send it to the process using driver_[send|output]_term(). In the windows case you need to use an event instead of a pipe. > > Also, note that even though driver_send_term() is thread safe in the smp case, driver_output_term() is *not*. > > Regards, > Rickard Green, Erlang/OTP, Ericsson AB > > On Sep 5, 2012, at 6:37 PM, Lukas Larsson wrote: > >> Hello, >> >> I do not think[1] this is a problem which you can solve in your >> driver. It is probably the internals of the Erlang VM which are not >> threadsafe, i.e. if there are no locks around message queues to >> processes in the non-smp emulator. So while sending data to a process, >> that same process could be reading data from the queue, and voila you >> get a segfault. So in order to fix this I think you would have to >> patch the emulator it self. >> >> Lukas >> >> [1]: Note that I haven't actually checked the relevant code, I have >> divined this from what I know of the emulator. >> >> On Wed, Sep 5, 2012 at 5:18 PM, Zhemzhitsky Sergey >> wrote: >>> Hi erlang gurus, >>> >>> >>> >>> We?re developing erlang port driver that will send different terms to >>> some processes from the separate threads using driver_send_term. >>> >>> Each native thread started in the port driver (by means of >>> erl_drv_thread_create) will be associated with only one erlang >>> process and will send messages only to it. >>> >>> >>> >>> As a rule the documentation for driver_send_term says that it?s not >>> thread-safe when smp is disabled, so we have tested the driver with >>> disabled smp support and found that from time to time it leads to segfaults. >>> >>> >>> >>> So, the question is what is the proper way to make calls to >>> driver_send_term (and driver_output_term) thread-safe? >>> >>> Will driver_pdl_lock, driver_pdl_unlock help? >>> >>> Will wrapping all the calls to driver_send_term (and >>> driver_output_term) with erl_drv_mutex_lock and erl_drv_mutex_unlock help? >>> >>> >>> >>> >>> >>> Best Regards, >>> >>> Sergey >>> >>> >>> >>> _______________________________________________________ >>> >>> >>> >>> The information contained in this message may be privileged and conf >>> idential and protected from disclosure. If you are not the original >>> intended recipient, you are hereby notified that any review, >>> retransmission, dissemination, or other use of, or taking of any >>> action in reliance upon, this information is prohibited. If you have >>> received this communication in error, please notify the sender >>> immediately by replying to this message and delete it from your >>> computer. Thank you for your cooperation. Troika Dialog, Russia. >>> >>> If you need assistance please contact our Contact Center (+7495) 258 >>> 0500 or go to www.troika.ru/eng/Contacts/system.wbp >>> >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Rickard Green, Erlang/OTP, Ericsson AB. From Sergey_Zhemzhitsky@REDACTED Thu Sep 6 09:13:25 2012 From: Sergey_Zhemzhitsky@REDACTED (Zhemzhitsky Sergey) Date: Thu, 6 Sep 2012 07:13:25 +0000 Subject: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? In-Reply-To: <50484777.9050304@erlang.org> References: <06139A918ACCA041BF46A0F36940C7FA4FE3CFBE@exch-mbx1.msk.trd.ru> <21274336-0343-485A-B0FB-61EC08E66F6A@erlang.org> <06139A918ACCA041BF46A0F36940C7FA4FE3D1D5@exch-mbx1.msk.trd.ru> <50484777.9050304@erlang.org> Message-ID: <06139A918ACCA041BF46A0F36940C7FA4FE3D249@exch-mbx1.msk.trd.ru> Glad to see, that in case of detached threads driver_send_term is still safe to use. Thanks a bunch for the help. Best Regards, Sergey -----Original Message----- From: Rickard Green [mailto:rickard@REDACTED] Sent: Thursday, September 06, 2012 10:49 AM To: Zhemzhitsky Sergey Cc: Erlang-Questions Questions Subject: Re: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? No, that is safe to do. Regards, Rickard On 09/06/2012 08:25 AM, Zhemzhitsky Sergey wrote: > Hello Rickard, > > Thanks a lot for the idea with pipes. > >>> driver_send_term() is thread safe in the smp case, driver_output_term() is *not*. > Does it mean that it's dangerous to use driver_send_term() from an arbitrary detached thread and driver_output_term from one of the driver callbacks at the same time in the case when smp is enabled? > > Best Regards, > Sergey > > -----Original Message----- > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Rickard > Green > Sent: Thursday, September 06, 2012 12:32 AM > To: Erlang-Questions Questions > Subject: Re: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? > > As Lukas said, this is not something you can solve in your driver. It would require changes in the emulator. > > driver_send_term() can of course be made thread safe also in the > non-smp emulator. Initially we also planned on doing so, but after > looking closer at it we dropped that idea. This since it would pull in > too much stuff from the smp emulator. One way to do it could be to > replace "erl -smp disable" with "erl -smp enable +S1" :-) > > The way to send information from threads to Erlang processes in the non-smp case is something like the following using a thread safe queue and a pipe. Create a pipe and call driver_select(port, fd, ERL_DRV_READ, 1) to show your interest in the read end of the pipe. When a thread has enqueued an element on the queue it should also write a byte on the write end of the pipe (note that it is important that this is done *after* the enqueue operation). This will trigger a call to the ready_input(drv_data, fd) callback by the scheduler thread. In the ready_input() callback you read away the byte written on the pipe and then dequeue the element, create a message and send it to the process using driver_[send|output]_term(). In the windows case you need to use an event instead of a pipe. > > Also, note that even though driver_send_term() is thread safe in the smp case, driver_output_term() is *not*. > > Regards, > Rickard Green, Erlang/OTP, Ericsson AB > > On Sep 5, 2012, at 6:37 PM, Lukas Larsson wrote: > >> Hello, >> >> I do not think[1] this is a problem which you can solve in your >> driver. It is probably the internals of the Erlang VM which are not >> threadsafe, i.e. if there are no locks around message queues to >> processes in the non-smp emulator. So while sending data to a >> process, that same process could be reading data from the queue, and >> voila you get a segfault. So in order to fix this I think you would >> have to patch the emulator it self. >> >> Lukas >> >> [1]: Note that I haven't actually checked the relevant code, I have >> divined this from what I know of the emulator. >> >> On Wed, Sep 5, 2012 at 5:18 PM, Zhemzhitsky Sergey >> wrote: >>> Hi erlang gurus, >>> >>> >>> >>> We?re developing erlang port driver that will send different terms >>> to some processes from the separate threads using driver_send_term. >>> >>> Each native thread started in the port driver (by means of >>> erl_drv_thread_create) will be associated with only one erlang >>> process and will send messages only to it. >>> >>> >>> >>> As a rule the documentation for driver_send_term says that it?s not >>> thread-safe when smp is disabled, so we have tested the driver with >>> disabled smp support and found that from time to time it leads to segfaults. >>> >>> >>> >>> So, the question is what is the proper way to make calls to >>> driver_send_term (and driver_output_term) thread-safe? >>> >>> Will driver_pdl_lock, driver_pdl_unlock help? >>> >>> Will wrapping all the calls to driver_send_term (and >>> driver_output_term) with erl_drv_mutex_lock and erl_drv_mutex_unlock help? >>> >>> >>> >>> >>> >>> Best Regards, >>> >>> Sergey >>> >>> >>> >>> _______________________________________________________ >>> >>> >>> >>> The information contained in this message may be privileged and conf >>> idential and protected from disclosure. If you are not the original >>> intended recipient, you are hereby notified that any review, >>> retransmission, dissemination, or other use of, or taking of any >>> action in reliance upon, this information is prohibited. If you have >>> received this communication in error, please notify the sender >>> immediately by replying to this message and delete it from your >>> computer. Thank you for your cooperation. Troika Dialog, Russia. >>> >>> If you need assistance please contact our Contact Center (+7495) 258 >>> 0500 or go to www.troika.ru/eng/Contacts/system.wbp >>> >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Rickard Green, Erlang/OTP, Ericsson AB. From rickard@REDACTED Thu Sep 6 10:15:08 2012 From: rickard@REDACTED (Rickard Green) Date: Thu, 6 Sep 2012 10:15:08 +0200 Subject: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? In-Reply-To: <06139A918ACCA041BF46A0F36940C7FA4FE3D249@exch-mbx1.msk.trd.ru> References: <06139A918ACCA041BF46A0F36940C7FA4FE3CFBE@exch-mbx1.msk.trd.ru> <21274336-0343-485A-B0FB-61EC08E66F6A@erlang.org> <06139A918ACCA041BF46A0F36940C7FA4FE3D1D5@exch-mbx1.msk.trd.ru> <50484777.9050304@erlang.org> <06139A918ACCA041BF46A0F36940C7FA4FE3D249@exch-mbx1.msk.trd.ru> Message-ID: <50485B8C.2000008@erlang.org> I suspect that we put different meanings into the expression "detached thread". However, just so that there are no misunderstandings I want to point out that you cannot create detached threads, i.e. threads that cannot be joined, using the erl_driver api. This since unloading of a driver cannot be made safe if the driver doesn't join all of its threads before it is unloaded. Regards, Rickard On 09/06/2012 09:13 AM, Zhemzhitsky Sergey wrote: > Glad to see, that in case of detached threads driver_send_term is still safe to use. > > Thanks a bunch for the help. > > Best Regards, > Sergey > > > -----Original Message----- > From: Rickard Green [mailto:rickard@REDACTED] > Sent: Thursday, September 06, 2012 10:49 AM > To: Zhemzhitsky Sergey > Cc: Erlang-Questions Questions > Subject: Re: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? > > No, that is safe to do. > > Regards, > Rickard > > On 09/06/2012 08:25 AM, Zhemzhitsky Sergey wrote: >> Hello Rickard, >> >> Thanks a lot for the idea with pipes. >> >>>> driver_send_term() is thread safe in the smp case, driver_output_term() is *not*. >> Does it mean that it's dangerous to use driver_send_term() from an arbitrary detached thread and driver_output_term from one of the driver callbacks at the same time in the case when smp is enabled? >> >> Best Regards, >> Sergey >> >> -----Original Message----- >> From: erlang-questions-bounces@REDACTED >> [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Rickard >> Green >> Sent: Thursday, September 06, 2012 12:32 AM >> To: Erlang-Questions Questions >> Subject: Re: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? >> >> As Lukas said, this is not something you can solve in your driver. It would require changes in the emulator. >> >> driver_send_term() can of course be made thread safe also in the >> non-smp emulator. Initially we also planned on doing so, but after >> looking closer at it we dropped that idea. This since it would pull in >> too much stuff from the smp emulator. One way to do it could be to >> replace "erl -smp disable" with "erl -smp enable +S1" :-) >> >> The way to send information from threads to Erlang processes in the non-smp case is something like the following using a thread safe queue and a pipe. Create a pipe and call driver_select(port, fd, ERL_DRV_READ, 1) to show your interest in the read end of the pipe. When a thread has enqueued an element on the queue it should also write a byte on the write end of the pipe (note that it is important that this is done *after* the enqueue operation). This will trigger a call to the ready_input(drv_data, fd) callback by the scheduler thread. In the ready_input() callback you read away the byte written on the pipe and then dequeue the element, create a message and send it to the process using driver_[send|output]_term(). In the windows case you need to use an event instead of a pipe. >> >> Also, note that even though driver_send_term() is thread safe in the smp case, driver_output_term() is *not*. >> >> Regards, >> Rickard Green, Erlang/OTP, Ericsson AB >> >> On Sep 5, 2012, at 6:37 PM, Lukas Larsson wrote: >> >>> Hello, >>> >>> I do not think[1] this is a problem which you can solve in your >>> driver. It is probably the internals of the Erlang VM which are not >>> threadsafe, i.e. if there are no locks around message queues to >>> processes in the non-smp emulator. So while sending data to a >>> process, that same process could be reading data from the queue, and >>> voila you get a segfault. So in order to fix this I think you would >>> have to patch the emulator it self. >>> >>> Lukas >>> >>> [1]: Note that I haven't actually checked the relevant code, I have >>> divined this from what I know of the emulator. >>> >>> On Wed, Sep 5, 2012 at 5:18 PM, Zhemzhitsky Sergey >>> wrote: >>>> Hi erlang gurus, >>>> >>>> >>>> >>>> We?re developing erlang port driver that will send different terms >>>> to some processes from the separate threads using driver_send_term. >>>> >>>> Each native thread started in the port driver (by means of >>>> erl_drv_thread_create) will be associated with only one erlang >>>> process and will send messages only to it. >>>> >>>> >>>> >>>> As a rule the documentation for driver_send_term says that it?s not >>>> thread-safe when smp is disabled, so we have tested the driver with >>>> disabled smp support and found that from time to time it leads to segfaults. >>>> >>>> >>>> >>>> So, the question is what is the proper way to make calls to >>>> driver_send_term (and driver_output_term) thread-safe? >>>> >>>> Will driver_pdl_lock, driver_pdl_unlock help? >>>> >>>> Will wrapping all the calls to driver_send_term (and >>>> driver_output_term) with erl_drv_mutex_lock and erl_drv_mutex_unlock help? >>>> >>>> >>>> >>>> >>>> >>>> Best Regards, >>>> >>>> Sergey >>>> >>>> >>>> >>>> _______________________________________________________ >>>> >>>> >>>> >>>> The information contained in this message may be privileged and conf >>>> idential and protected from disclosure. If you are not the original >>>> intended recipient, you are hereby notified that any review, >>>> retransmission, dissemination, or other use of, or taking of any >>>> action in reliance upon, this information is prohibited. If you have >>>> received this communication in error, please notify the sender >>>> immediately by replying to this message and delete it from your >>>> computer. Thank you for your cooperation. Troika Dialog, Russia. >>>> >>>> If you need assistance please contact our Contact Center (+7495) 258 >>>> 0500 or go to www.troika.ru/eng/Contacts/system.wbp >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > -- > Rickard Green, Erlang/OTP, Ericsson AB. > -- Rickard Green, Erlang/OTP, Ericsson AB. From Sergey_Zhemzhitsky@REDACTED Thu Sep 6 10:24:53 2012 From: Sergey_Zhemzhitsky@REDACTED (Zhemzhitsky Sergey) Date: Thu, 6 Sep 2012 08:24:53 +0000 Subject: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? In-Reply-To: <50485B8C.2000008@erlang.org> References: <06139A918ACCA041BF46A0F36940C7FA4FE3CFBE@exch-mbx1.msk.trd.ru> <21274336-0343-485A-B0FB-61EC08E66F6A@erlang.org> <06139A918ACCA041BF46A0F36940C7FA4FE3D1D5@exch-mbx1.msk.trd.ru> <50484777.9050304@erlang.org> <06139A918ACCA041BF46A0F36940C7FA4FE3D249@exch-mbx1.msk.trd.ru> <50485B8C.2000008@erlang.org> Message-ID: <06139A918ACCA041BF46A0F36940C7FA4FE3D2C8@exch-mbx1.msk.trd.ru> Thanks for the tip. By the "detached thread" I mean the thread that was created by means of erl_drv_thread_create or native api and that works in parallel with the scheduler threads (i.e. you can do something useful outside of the driver callbacks). As erl_driver documentation warns us for several times that all manually created threads has to be joined I join them in the port close callback. Best Regards, Sergey -----Original Message----- From: Rickard Green [mailto:rickard@REDACTED] Sent: Thursday, September 06, 2012 12:15 PM To: Zhemzhitsky Sergey Cc: Erlang-Questions Questions Subject: Re: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? I suspect that we put different meanings into the expression "detached thread". However, just so that there are no misunderstandings I want to point out that you cannot create detached threads, i.e. threads that cannot be joined, using the erl_driver api. This since unloading of a driver cannot be made safe if the driver doesn't join all of its threads before it is unloaded. Regards, Rickard On 09/06/2012 09:13 AM, Zhemzhitsky Sergey wrote: > Glad to see, that in case of detached threads driver_send_term is still safe to use. > > Thanks a bunch for the help. > > Best Regards, > Sergey > > > -----Original Message----- > From: Rickard Green [mailto:rickard@REDACTED] > Sent: Thursday, September 06, 2012 10:49 AM > To: Zhemzhitsky Sergey > Cc: Erlang-Questions Questions > Subject: Re: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? > > No, that is safe to do. > > Regards, > Rickard > > On 09/06/2012 08:25 AM, Zhemzhitsky Sergey wrote: >> Hello Rickard, >> >> Thanks a lot for the idea with pipes. >> >>>> driver_send_term() is thread safe in the smp case, driver_output_term() is *not*. >> Does it mean that it's dangerous to use driver_send_term() from an arbitrary detached thread and driver_output_term from one of the driver callbacks at the same time in the case when smp is enabled? >> >> Best Regards, >> Sergey >> >> -----Original Message----- >> From: erlang-questions-bounces@REDACTED >> [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Rickard >> Green >> Sent: Thursday, September 06, 2012 12:32 AM >> To: Erlang-Questions Questions >> Subject: Re: [erlang-questions] What API should be used in port-drivers to guarantee thread-safety of driver_send_term and driver_output_term? >> >> As Lukas said, this is not something you can solve in your driver. It would require changes in the emulator. >> >> driver_send_term() can of course be made thread safe also in the >> non-smp emulator. Initially we also planned on doing so, but after >> looking closer at it we dropped that idea. This since it would pull >> in too much stuff from the smp emulator. One way to do it could be to >> replace "erl -smp disable" with "erl -smp enable +S1" :-) >> >> The way to send information from threads to Erlang processes in the non-smp case is something like the following using a thread safe queue and a pipe. Create a pipe and call driver_select(port, fd, ERL_DRV_READ, 1) to show your interest in the read end of the pipe. When a thread has enqueued an element on the queue it should also write a byte on the write end of the pipe (note that it is important that this is done *after* the enqueue operation). This will trigger a call to the ready_input(drv_data, fd) callback by the scheduler thread. In the ready_input() callback you read away the byte written on the pipe and then dequeue the element, create a message and send it to the process using driver_[send|output]_term(). In the windows case you need to use an event instead of a pipe. >> >> Also, note that even though driver_send_term() is thread safe in the smp case, driver_output_term() is *not*. >> >> Regards, >> Rickard Green, Erlang/OTP, Ericsson AB >> >> On Sep 5, 2012, at 6:37 PM, Lukas Larsson wrote: >> >>> Hello, >>> >>> I do not think[1] this is a problem which you can solve in your >>> driver. It is probably the internals of the Erlang VM which are not >>> threadsafe, i.e. if there are no locks around message queues to >>> processes in the non-smp emulator. So while sending data to a >>> process, that same process could be reading data from the queue, and >>> voila you get a segfault. So in order to fix this I think you would >>> have to patch the emulator it self. >>> >>> Lukas >>> >>> [1]: Note that I haven't actually checked the relevant code, I have >>> divined this from what I know of the emulator. >>> >>> On Wed, Sep 5, 2012 at 5:18 PM, Zhemzhitsky Sergey >>> wrote: >>>> Hi erlang gurus, >>>> >>>> >>>> >>>> We?re developing erlang port driver that will send different terms >>>> to some processes from the separate threads using driver_send_term. >>>> >>>> Each native thread started in the port driver (by means of >>>> erl_drv_thread_create) will be associated with only one erlang >>>> process and will send messages only to it. >>>> >>>> >>>> >>>> As a rule the documentation for driver_send_term says that it?s not >>>> thread-safe when smp is disabled, so we have tested the driver with >>>> disabled smp support and found that from time to time it leads to segfaults. >>>> >>>> >>>> >>>> So, the question is what is the proper way to make calls to >>>> driver_send_term (and driver_output_term) thread-safe? >>>> >>>> Will driver_pdl_lock, driver_pdl_unlock help? >>>> >>>> Will wrapping all the calls to driver_send_term (and >>>> driver_output_term) with erl_drv_mutex_lock and erl_drv_mutex_unlock help? >>>> >>>> >>>> >>>> >>>> >>>> Best Regards, >>>> >>>> Sergey >>>> >>>> >>>> >>>> _______________________________________________________ >>>> >>>> >>>> >>>> The information contained in this message may be privileged and >>>> conf idential and protected from disclosure. If you are not the >>>> original intended recipient, you are hereby notified that any >>>> review, retransmission, dissemination, or other use of, or taking >>>> of any action in reliance upon, this information is prohibited. If >>>> you have received this communication in error, please notify the >>>> sender immediately by replying to this message and delete it from >>>> your computer. Thank you for your cooperation. Troika Dialog, Russia. >>>> >>>> If you need assistance please contact our Contact Center (+7495) >>>> 258 >>>> 0500 or go to www.troika.ru/eng/Contacts/system.wbp >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > -- > Rickard Green, Erlang/OTP, Ericsson AB. > -- Rickard Green, Erlang/OTP, Ericsson AB. From ngocdaothanh@REDACTED Thu Sep 6 12:52:34 2012 From: ngocdaothanh@REDACTED (ngocdaothanh) Date: Thu, 6 Sep 2012 03:52:34 -0700 (PDT) Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: <20120905153449.GA50794@k2r.org> References: <20120905153449.GA50794@k2r.org> Message-ID: Just to make sure. Does this version work with wxWidgets 2.9 64 bit on Mac? From dangud@REDACTED Thu Sep 6 14:17:09 2012 From: dangud@REDACTED (Dan Gudmundsson) Date: Thu, 6 Sep 2012 14:17:09 +0200 Subject: [erlang-questions] Erlang/OTP R15B02 has been released In-Reply-To: References: <20120905153449.GA50794@k2r.org> Message-ID: On Thu, Sep 6, 2012 at 12:52 PM, ngocdaothanh wrote: > Just to make sure. > Does this version work with wxWidgets 2.9 64 bit on Mac? No it doesn't, 2.9 is not backward compatible with 2.8.* which is what the wx API is a port for. Also wxWidgets-2.9 have not frozen the api yet, so I don't want to port it to that before it is stable. /Dan From mek@REDACTED Thu Sep 6 15:27:06 2012 From: mek@REDACTED (Max Kuznecov) Date: Thu, 6 Sep 2012 16:27:06 +0300 Subject: [erlang-questions] erl_syntax:revert with binary arg Message-ID: Hi I'm creating some dynamic module generation stuff and I found a strange behavior, erl_syntax:revert doesn't seem to work with binaries: It works with strings (and other types) > erl_syntax:revert(erl_syntax:string("DATA")). {string,0,"DATA"} but > erl_syntax:revert(erl_syntax:binary(<<"DATA">>)). ** exception error: no function clause matching erl_syntax:'-revert/1-lc$^1/1-1-'(<<"DATA">>) (erl_syntax.erl, line 6508) in function erl_syntax:'-revert/1-lc$^0/1-0-'/1 (erl_syntax.erl, line 6508) in call from erl_syntax:revert/1 (erl_syntax.erl, line 6508) Is there any special trick to handle binaries in revert()? Thanks. -- ~syhpoon From magnus.henoch@REDACTED Thu Sep 6 15:41:26 2012 From: magnus.henoch@REDACTED (Magnus Henoch) Date: Thu, 06 Sep 2012 14:41:26 +0100 Subject: [erlang-questions] erl_syntax:revert with binary arg In-Reply-To: (Max Kuznecov's message of "Thu, 6 Sep 2012 16:27:06 +0300") References: Message-ID: Max Kuznecov writes: > I'm creating some dynamic module generation stuff and I found a > strange behavior, > erl_syntax:revert doesn't seem to work with binaries: > > It works with strings (and other types) > >> erl_syntax:revert(erl_syntax:string("DATA")). > {string,0,"DATA"} > > but > >> erl_syntax:revert(erl_syntax:binary(<<"DATA">>)). > ** exception error: no function clause matching > erl_syntax:'-revert/1-lc$^1/1-1-'(<<"DATA">>) > (erl_syntax.erl, line 6508) > in function erl_syntax:'-revert/1-lc$^0/1-0-'/1 (erl_syntax.erl, > line 6508) > in call from erl_syntax:revert/1 (erl_syntax.erl, line 6508) > > Is there any special trick to handle binaries in revert()? It seems like erl_syntax:binary(<<"DATA">>) is not the right way to create an abstract representation of a binary literal - it's different from what erl_syntax:abstract returns: 1> erl_syntax:abstract(<<"DATA">>). {tree,binary, {attr,0,[],none}, [{tree,binary_field, {attr,0,[],none}, {binary_field,{tree,integer,{attr,0,[],none},68},[]}}, {tree,binary_field, {attr,0,[],none}, {binary_field,{tree,integer,{attr,0,[],none},65},[]}}, {tree,binary_field, {attr,0,[],none}, {binary_field,{tree,integer,{attr,0,[],none},84},[]}}, {tree,binary_field, {attr,0,[],none}, {binary_field,{tree,integer,{attr,0,[],none},65},[]}}]} 2> erl_syntax:binary(<<"DATA">>). {tree,binary,{attr,0,[],none},<<"DATA">>} 3> erl_syntax:revert(v(1)). {bin,0, [{bin_element,0,{integer,0,68},default,default}, {bin_element,0,{integer,0,65},default,default}, {bin_element,0,{integer,0,84},default,default}, {bin_element,0,{integer,0,65},default,default}]} Regards, Magnus From mek@REDACTED Thu Sep 6 16:53:18 2012 From: mek@REDACTED (Max Kuznecov) Date: Thu, 6 Sep 2012 17:53:18 +0300 Subject: [erlang-questions] erl_syntax:revert with binary arg In-Reply-To: References: Message-ID: Indeed, with abstract() it works just fine. Thank you 2012/9/6 Magnus Henoch : > Max Kuznecov writes: > >> I'm creating some dynamic module generation stuff and I found a >> strange behavior, >> erl_syntax:revert doesn't seem to work with binaries: >> >> It works with strings (and other types) >> >>> erl_syntax:revert(erl_syntax:string("DATA")). >> {string,0,"DATA"} >> >> but >> >>> erl_syntax:revert(erl_syntax:binary(<<"DATA">>)). >> ** exception error: no function clause matching >> erl_syntax:'-revert/1-lc$^1/1-1-'(<<"DATA">>) >> (erl_syntax.erl, line 6508) >> in function erl_syntax:'-revert/1-lc$^0/1-0-'/1 (erl_syntax.erl, >> line 6508) >> in call from erl_syntax:revert/1 (erl_syntax.erl, line 6508) >> >> Is there any special trick to handle binaries in revert()? > > It seems like erl_syntax:binary(<<"DATA">>) is not the right way to > create an abstract representation of a binary literal - it's different > from what erl_syntax:abstract returns: > > 1> erl_syntax:abstract(<<"DATA">>). > {tree,binary, > {attr,0,[],none}, > [{tree,binary_field, > {attr,0,[],none}, > {binary_field,{tree,integer,{attr,0,[],none},68},[]}}, > {tree,binary_field, > {attr,0,[],none}, > {binary_field,{tree,integer,{attr,0,[],none},65},[]}}, > {tree,binary_field, > {attr,0,[],none}, > {binary_field,{tree,integer,{attr,0,[],none},84},[]}}, > {tree,binary_field, > {attr,0,[],none}, > {binary_field,{tree,integer,{attr,0,[],none},65},[]}}]} > 2> erl_syntax:binary(<<"DATA">>). > {tree,binary,{attr,0,[],none},<<"DATA">>} > 3> erl_syntax:revert(v(1)). > {bin,0, > [{bin_element,0,{integer,0,68},default,default}, > {bin_element,0,{integer,0,65},default,default}, > {bin_element,0,{integer,0,84},default,default}, > {bin_element,0,{integer,0,65},default,default}]} > > Regards, > Magnus -- ~syhpoon From stfairy@REDACTED Thu Sep 6 17:02:00 2012 From: stfairy@REDACTED (Xiao Jia) Date: Thu, 6 Sep 2012 23:02:00 +0800 Subject: [erlang-questions] How to fork/clone a process in Erlang? Message-ID: Hi, How can I fork/clone a process in Erlang, just as the fork in Unix? I have searched a lot but just got nothing related to that. I suppose the usage may look like this: case fork() of {parent, Pid} -> in_parent_process_now(); {child, Pid} -> in_child_process_now(); end. Any ideas? Thanks, Xiao Jia -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus.henoch@REDACTED Thu Sep 6 17:10:32 2012 From: magnus.henoch@REDACTED (Magnus Henoch) Date: Thu, 06 Sep 2012 16:10:32 +0100 Subject: [erlang-questions] How to fork/clone a process in Erlang? In-Reply-To: (Xiao Jia's message of "Thu, 6 Sep 2012 23:02:00 +0800") References: Message-ID: Xiao Jia writes: > How can I fork/clone a process in Erlang, just as the fork in Unix? > > I have searched a lot but just got nothing related to that. I suppose the > usage may look like this: > > case fork() of > {parent, Pid} -> in_parent_process_now(); > {child, Pid} -> in_child_process_now(); > end. > > Any ideas? There is nothing called "fork" in Erlang, but you can achieve pretty much the same effect using 'spawn'. For example, your example could be written as: ParentPid = self(), ChildPid = spawn(fun() -> in_child_process_now(ParentPid) end), in_parent_process_now(ChildPid). That is, the child process starts executing in the function passed to 'spawn', and the parent process keeps executing after the call to 'spawn'. Hope this helps, Magnus From bengt.kleberg@REDACTED Thu Sep 6 17:10:51 2012 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 6 Sep 2012 17:10:51 +0200 Subject: [erlang-questions] How to fork/clone a process in Erlang? In-Reply-To: References: Message-ID: <1346944252.24683.13.camel@seasc0057> Greetings, Suppose that you have a process running like this: loop( State ) -> receive normal -> New_state = new_state( State ), loop( New_state ) _ -> ok end. You could add a forking like this: loop( State ) -> receive normal -> loop( State ) fork -> spawn( fun() -> loop(State) end ), loop( State ) _ -> ok end. bengt On Thu, 2012-09-06 at 17:02 +0200, Xiao Jia wrote: > Hi, > > > How can I fork/clone a process in Erlang, just as the fork in Unix? > > > I have searched a lot but just got nothing related to that. I suppose > the usage may look like this: > > > case fork() of > {parent, Pid} -> in_parent_process_now(); > {child, Pid} -> in_child_process_now(); > end. > > > Any ideas? > > > > > Thanks, > > > Xiao Jia From jesper.louis.andersen@REDACTED Thu Sep 6 17:26:30 2012 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 6 Sep 2012 17:26:30 +0200 Subject: [erlang-questions] How to fork/clone a process in Erlang? In-Reply-To: <1346944252.24683.13.camel@seasc0057> References: <1346944252.24683.13.camel@seasc0057> Message-ID: <5FFDB41B-535C-4772-A007-70F57B9AF90B@erlang-solutions.com> On Sep 6, 2012, at 5:10 PM, Bengt Kleberg wrote: > You could add a forking like this: Do note, however that you don't get the copy-on-write semantics of the memory space, so this may not be a too good idea if State is quite large. From daniel.goertzen@REDACTED Thu Sep 6 21:18:16 2012 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Thu, 6 Sep 2012 14:18:16 -0500 Subject: [erlang-questions] Which EEP would you pick as the most important one to implement next? In-Reply-To: References: Message-ID: Not an EEP, but I've always wished gproc was part of the standard Erlang distro. https://github.com/uwiger/gproc Dan. On Fri, Aug 31, 2012 at 4:18 AM, Michael Turner < michael.eugene.turner@REDACTED> wrote: > Since it seems to A Time for Big Questions on this mailing list. > > -michael turner > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stfairy@REDACTED Fri Sep 7 03:31:32 2012 From: stfairy@REDACTED (Xiao Jia) Date: Fri, 7 Sep 2012 09:31:32 +0800 Subject: [erlang-questions] How to fork/clone a process in Erlang? In-Reply-To: <1346944252.24683.13.camel@seasc0057> References: <1346944252.24683.13.camel@seasc0057> Message-ID: Well, this approach can solve much of the problem. Do you know if there's any approach which can clone the control flow as well as the states? Of course in your example the control flow is cloned as you also loop in the spawn fun. But what I want is a more general case. Take the following C code as an example. f(); fork(); g(); Here the return value of fork() is ignored, so the next steps of both the parent and the child process are the same, which is to execute g(). Can I achieve this in Erlang? 2012/9/6 Bengt Kleberg > > Greetings, > > Suppose that you have a process running like this: > loop( State ) -> > receive > normal -> > New_state = new_state( State ), > loop( New_state ) > _ -> ok > end. > > You could add a forking like this: > loop( State ) -> > receive > normal -> > loop( State ) > fork -> > spawn( fun() -> loop(State) end ), > loop( State ) > _ -> ok > end. > > > bengt > > On Thu, 2012-09-06 at 17:02 +0200, Xiao Jia wrote: > > Hi, > > > > > > How can I fork/clone a process in Erlang, just as the fork in Unix? > > > > > > I have searched a lot but just got nothing related to that. I suppose > > the usage may look like this: > > > > > > case fork() of > > {parent, Pid} -> in_parent_process_now(); > > {child, Pid} -> in_child_process_now(); > > end. > > > > > > Any ideas? > > > > > > > > > > Thanks, > > > > > > Xiao Jia > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.neswold@REDACTED Fri Sep 7 05:24:56 2012 From: rich.neswold@REDACTED (Rich Neswold) Date: Thu, 6 Sep 2012 22:24:56 -0500 Subject: [erlang-questions] How to fork/clone a process in Erlang? In-Reply-To: References: <1346944252.24683.13.camel@seasc0057> Message-ID: On Thu, Sep 6, 2012 at 8:31 PM, Xiao Jia wrote: > Of course in your example the control flow is cloned as you also loop in the > spawn fun. > But what I want is a more general case. Take the following C code as an > example. > > f(); > fork(); > g(); > > Here the return value of fork() is ignored, so the next steps of both the > parent and the child > process are the same, which is to execute g(). Can I achieve this in Erlang? How about: f(), spawn(g), g(). -- Rich From dmkolesnikov@REDACTED Fri Sep 7 05:30:44 2012 From: dmkolesnikov@REDACTED (dmitry kolesnikov) Date: Fri, 7 Sep 2012 06:30:44 +0300 Subject: [erlang-questions] How to fork/clone a process in Erlang? In-Reply-To: References: <1346944252.24683.13.camel@seasc0057> Message-ID: <2297291027254010502@unknownmsgid> Hello, At general level this is f(), spawn(fun g/0), g() The major concern here is supervision of forked processes, forking of gen_server and making OTP compliment application. Best Regards, Dmitry >-|-|-*> On 7.9.2012, at 4.31, Xiao Jia wrote: Well, this approach can solve much of the problem. Do you know if there's any approach which can clone the control flow as well as the states? Of course in your example the control flow is cloned as you also loop in the spawn fun. But what I want is a more general case. Take the following C code as an example. f(); fork(); g(); Here the return value of fork() is ignored, so the next steps of both the parent and the child process are the same, which is to execute g(). Can I achieve this in Erlang? 2012/9/6 Bengt Kleberg > > Greetings, > > Suppose that you have a process running like this: > loop( State ) -> > receive > normal -> > New_state = new_state( State ), > loop( New_state ) > _ -> ok > end. > > You could add a forking like this: > loop( State ) -> > receive > normal -> > loop( State ) > fork -> > spawn( fun() -> loop(State) end ), > loop( State ) > _ -> ok > end. > > > bengt > > On Thu, 2012-09-06 at 17:02 +0200, Xiao Jia wrote: > > Hi, > > > > > > How can I fork/clone a process in Erlang, just as the fork in Unix? > > > > > > I have searched a lot but just got nothing related to that. I suppose > > the usage may look like this: > > > > > > case fork() of > > {parent, Pid} -> in_parent_process_now(); > > {child, Pid} -> in_child_process_now(); > > end. > > > > > > Any ideas? > > > > > > > > > > Thanks, > > > > > > Xiao Jia > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From stfairy@REDACTED Fri Sep 7 06:10:35 2012 From: stfairy@REDACTED (Xiao Jia) Date: Fri, 7 Sep 2012 12:10:35 +0800 Subject: [erlang-questions] How to fork/clone a process in Erlang? In-Reply-To: References: <1346944252.24683.13.camel@seasc0057> Message-ID: Well, this is kind of different from what I'm thinking about. The function g() here is just a symbolic stuff, standing for the remaining control flows. Suppose we want to implement a function, split(), which is to create two identical processes on invocation. We may use fork() inside split(). But from the user's perspective, he just calls split(). As we write the split()function, we cannot assume (actually we are unable to know) what is g(). 2012/9/7 Rich Neswold > On Thu, Sep 6, 2012 at 8:31 PM, Xiao Jia wrote: > > Of course in your example the control flow is cloned as you also loop in > the > > spawn fun. > > But what I want is a more general case. Take the following C code as an > > example. > > > > f(); > > fork(); > > g(); > > > > Here the return value of fork() is ignored, so the next steps of both the > > parent and the child > > process are the same, which is to execute g(). Can I achieve this in > Erlang? > > How about: > > f(), > spawn(g), > g(). > > -- > Rich > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stfairy@REDACTED Fri Sep 7 06:12:42 2012 From: stfairy@REDACTED (Xiao Jia) Date: Fri, 7 Sep 2012 12:12:42 +0800 Subject: [erlang-questions] How to fork/clone a process in Erlang? In-Reply-To: References: <1346944252.24683.13.camel@seasc0057> Message-ID: In other words, for ` f(); fork(); g(); ` , I wonder if it is possible to implement fork() just as is used here, i.e. without passing any parameters/arguments to fork(). 2012/9/7 Xiao Jia > Well, this is kind of different from what I'm thinking about. > > The function g() here is just a symbolic stuff, standing for the > remaining control flows. > > Suppose we want to implement a function, split(), which is to create two > identical processes on invocation. We may use fork() inside split(). But > from the user's perspective, he just calls split(). As we write the > split() function, we cannot assume (actually we are unable to know) what > is g(). > > 2012/9/7 Rich Neswold > >> On Thu, Sep 6, 2012 at 8:31 PM, Xiao Jia wrote: >> > Of course in your example the control flow is cloned as you also loop >> in the >> > spawn fun. >> > But what I want is a more general case. Take the following C code as an >> > example. >> > >> > f(); >> > fork(); >> > g(); >> > >> > Here the return value of fork() is ignored, so the next steps of both >> the >> > parent and the child >> > process are the same, which is to execute g(). Can I achieve this in >> Erlang? >> >> How about: >> >> f(), >> spawn(g), >> g(). >> >> -- >> Rich >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.eugene.turner@REDACTED Fri Sep 7 06:16:18 2012 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Fri, 7 Sep 2012 13:16:18 +0900 Subject: [erlang-questions] How to fork/clone a process in Erlang? In-Reply-To: References: <1346944252.24683.13.camel@seasc0057> Message-ID: On Fri, Sep 7, 2012 at 1:10 PM, Xiao Jia wrote: > Well, this is kind of different from what I'm thinking about. > > The function g() here is just a symbolic stuff, standing for the remaining > control flows. > > Suppose we want to implement a function, split(), which is to create two > identical processes on invocation. I'm actually having a little trouble with that supposition. Even basic UNIX split doesn't produce "identical processes" - for example, one process has knowledge that it's the designated parent, the other that it's the designated child. What actual real-world problem are you trying to solve? Maybe Erlang already does it in a better way. -michael turner > 2012/9/7 Rich Neswold >> >> On Thu, Sep 6, 2012 at 8:31 PM, Xiao Jia wrote: >> > Of course in your example the control flow is cloned as you also loop in >> > the >> > spawn fun. >> > But what I want is a more general case. Take the following C code as an >> > example. >> > >> > f(); >> > fork(); >> > g(); >> > >> > Here the return value of fork() is ignored, so the next steps of both >> > the >> > parent and the child >> > process are the same, which is to execute g(). Can I achieve this in >> > Erlang? >> >> How about: >> >> f(), >> spawn(g), >> g(). >> >> -- >> Rich > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Regards, Michael Turner Project Persephone 1-25-33 Takadanobaba Shinjuku-ku Tokyo 169-0075 (+81) 90-5203-8682 turner@REDACTED http://www.projectpersephone.org/ "Love does not consist in gazing at each other, but in looking outward together in the same direction." -- Antoine de Saint-Exup?ry From stfairy@REDACTED Fri Sep 7 06:21:48 2012 From: stfairy@REDACTED (Xiao Jia) Date: Fri, 7 Sep 2012 12:21:48 +0800 Subject: [erlang-questions] How to fork/clone a process in Erlang? In-Reply-To: References: <1346944252.24683.13.camel@seasc0057> Message-ID: 2012/9/7 Michael Turner > On Fri, Sep 7, 2012 at 1:10 PM, Xiao Jia wrote: > > Well, this is kind of different from what I'm thinking about. > > > > The function g() here is just a symbolic stuff, standing for the > remaining > > control flows. > > > > Suppose we want to implement a function, split(), which is to create two > > identical processes on invocation. > > I'm actually having a little trouble with that supposition. Even basic > UNIX split doesn't produce "identical processes" - for example, one > process has knowledge that it's the designated parent, the other that > it's the designated child. > Then forget my "identical" thing :-) What I meant is just to implement a split() without any knowledge of subsequent control flows. > > What actual real-world problem are you trying to solve? Maybe Erlang > already does it in a better way. > I'm just playing around Erlang and wondering if it is possible to have this functionality. It's kind of trying to dig out more stuffs inside Erlang, instead of using Erlang in the outside world. :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Fri Sep 7 06:31:32 2012 From: ok@REDACTED (ok@REDACTED) Date: Fri, 7 Sep 2012 16:31:32 +1200 Subject: [erlang-questions] How to fork/clone a process in Erlang? In-Reply-To: References: <1346944252.24683.13.camel@seasc0057> Message-ID: <0aad6d7ee3a5603f1d46bebb209c2e9f.squirrel@chasm.otago.ac.nz> Erlang processes offer isolation like UNIX processes (as long as you don't link in any C code, which could do arbitrary damage), but they are more like threads. In fact they are more like threads than threads are, being smaller, cheaper to create, and safe (no more *having* to guess how big to make the stack and being at the mercy of Cthulhu if you guess wrong!). There isn't any 'fork()' to copy the current process because *not* copying a whole lot of stuff you'll never want is part of what Erlang processes are all about. Having said this, it would be tedious rather than difficult to provide a continuation-passing transformer for Erlang: f(a, Y, b) -> Y; f(X, Y, Z) -> P = g(X, Y), h(P, Z). => f(a, Y, b, K) -> K(Y); f(X, Y, Z, K) -> g(X, Y, fun (P) -> h(P, Z, K) end). and then your fork() isn't that hard: fork(K) -> K(spawn(fun () -> K(child) end)). in the library for the continuation passing level, then at the normal level Which = fork() would return 'child' in the child and the child's Pid in the parent. But I am having a really hard time figuring out what you would want this for. I've been using UNIX since October 1979 and I've personally never had any use for a fork() that wasn't followed by an exec(). I'm aware that people did this to create workers in a process that listens for connections and then forks, but these days people seem to prefer using threads for that. So what is it you *really* want to do that makes fork() seem like a good way to go? From michael.eugene.turner@REDACTED Fri Sep 7 07:26:07 2012 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Fri, 7 Sep 2012 14:26:07 +0900 Subject: [erlang-questions] How to fork/clone a process in Erlang? In-Reply-To: <0aad6d7ee3a5603f1d46bebb209c2e9f.squirrel@chasm.otago.ac.nz> References: <1346944252.24683.13.camel@seasc0057> <0aad6d7ee3a5603f1d46bebb209c2e9f.squirrel@chasm.otago.ac.nz> Message-ID: "I'm just playing around Erlang and wondering if it is possible to have this functionality." Since Erlang is Turing-complete, the answer to any such question is always going to be "yes." -michael turner On Fri, Sep 7, 2012 at 1:31 PM, wrote: > Erlang processes offer isolation like UNIX processes (as long > as you don't link in any C code, which could do arbitrary damage), > but they are more like threads. In fact they are more like threads > than threads are, being smaller, cheaper to create, and safe (no > more *having* to guess how big to make the stack and being at the > mercy of Cthulhu if you guess wrong!). > > There isn't any 'fork()' to copy the current process because > *not* copying a whole lot of stuff you'll never want is part > of what Erlang processes are all about. > > Having said this, it would be tedious rather than difficult to > provide a continuation-passing transformer for Erlang: > > f(a, Y, b) -> Y; > f(X, Y, Z) -> P = g(X, Y), h(P, Z). > > => > > f(a, Y, b, K) -> K(Y); > f(X, Y, Z, K) -> g(X, Y, fun (P) -> h(P, Z, K) end). > > and then your fork() isn't that hard: > > fork(K) -> K(spawn(fun () -> K(child) end)). > > in the library for the continuation passing level, then > at the normal level > Which = fork() > would return 'child' in the child and the child's Pid in the parent. > > But I am having a really hard time figuring out what you would > want this for. I've been using UNIX since October 1979 and I've > personally never had any use for a fork() that wasn't followed > by an exec(). I'm aware that people did this to create workers > in a process that listens for connections and then forks, but > these days people seem to prefer using threads for that. > > So what is it you *really* want to do that makes fork() > seem like a good way to go? > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Regards, Michael Turner Project Persephone 1-25-33 Takadanobaba Shinjuku-ku Tokyo 169-0075 (+81) 90-5203-8682 turner@REDACTED http://www.projectpersephone.org/ "Love does not consist in gazing at each other, but in looking outward together in the same direction." -- Antoine de Saint-Exup?ry From henrik@REDACTED Fri Sep 7 11:01:59 2012 From: henrik@REDACTED (Henrik Nord) Date: Fri, 7 Sep 2012 11:01:59 +0200 Subject: [erlang-questions] http://www.erlang.org/ : appealing or appalling? In-Reply-To: <6148046F-0CAD-4404-A616-57F903339921@cs.otago.ac.nz> References: <6148046F-0CAD-4404-A616-57F903339921@cs.otago.ac.nz> Message-ID: <5049B807.1060407@erlang.org> On 09/06/2012 12:51 AM, Richard O'Keefe wrote: > The subject line is a node to Adlai Stevenson's quip that he > found [St] Paul appealing and [Norman Vincent] Peale appalling. > I happened to visit www.erlang.org this morning, and while I > found much good stuff there, I found the entry page unappealing. > The quote from Joe Armstrong is in dark grey on a black background > and is *very* hard to read. The "bleached" Erlang "e" on the > right looked a bit dead, and the way such colour as existed at > the top "faded into the black" for some reason made me think of > the dying Emperor Julian. > > On the Downloads page, the word "courtesy" is spelled "curtesy". > (And "OS X" is normally written that way, not "Os X".) Thank you for pointing this out. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- /Henrik Nord Erlang/OTP From raimo+erlang-questions@REDACTED Fri Sep 7 12:00:59 2012 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 7 Sep 2012 12:00:59 +0200 Subject: [erlang-questions] Understanding a record generated by fprof:analyse/* In-Reply-To: References: Message-ID: <20120907100059.GA16059@erix.ericsson.se> On Thu, Sep 06, 2012 at 12:28:13AM -0500, Rich Neswold wrote: > Hello, > > I'm running the fprof profiler on our newly developed system and found > a record in the profiler output that I don't understand. The record in > question is: > > {[{{gen_server,loop,6}, 1630, 84.765, 26.450}], > { {gen_server,decode_msg,8}, 1630, 84.765, 26.450}, > [{{gen_server,handle_msg,5}, 1630, 0.018, 25.549}]}. > > The second column of numbers is the accumulated time used by the > function and the last column is the time taken in the function itself > (not functions it has called.) In 99% of the records, the accumulated > time is greater than the function's time, which makes sense. In the > case of genserver:handle_msg/5, however, the accumulated time is 18 uS > (!) and the function took 25 mS. How can this be? Sometimes fprof can not figure out which way functions are called and hence fails to charge the right caller with accumulated time. In this case I see handle_msg() calls loop() that calls decode_msg() that calls handle_msg(); it is an infinite loop and when fprof sees cykles in the call stack it tries to collaps them before charging the caller, thus a guilty function might evade charging. What does the record for gen_server:handle_msg/5 say? > > Is anyone familiar enough with fprof to know what this is telling me? > > Thank you! > > -- > Rich > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From qoocku@REDACTED Fri Sep 7 12:33:47 2012 From: qoocku@REDACTED (=?UTF-8?B?RGFtaWFuIERvYnJvY3p5xYRza2k=?=) Date: Fri, 07 Sep 2012 12:33:47 +0200 Subject: [erlang-questions] Jinterface receiveRPC bug? Message-ID: <5049CD8B.9060907@gmail.com> Hi list! We've found irritating problem with jinterface (R15B01): from time to time "receiveRPC()" method returns "null" instead of sensible value. After short digging we've found such scenario: ... sendRPC/receiveRPC [java] erlang Jinterface says: I got: '{rex,['node102@REDACTED ']}' ... sendRPC/receiveRPC [java] erlang Jinterface says: I got: '{rex,{jpg,#Bin<32162>}}' ... sendRPC/receiveRPC [java] erlang Jinterface says: I got: '{rex,['node102@REDACTED ']}' ... sendRPC/receiveRPC [java] erlang Jinterface says: I got: '{'$gen_call',{#Pid,#Ref},{is_auth,'node106@REDACTED '}}' ... (we've changed "receiveRPC" method to produce log entries) "{rex, ...} messages are OK. The last one is suprising. Is it proper behavior? I mean, does a Java node receive occasionally "is_auth" messages (I think they are related somehow to net_kernel module) ? "node6" IS the node we're connected to. -- D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.neswold@REDACTED Fri Sep 7 17:18:54 2012 From: rich.neswold@REDACTED (Rich Neswold) Date: Fri, 7 Sep 2012 10:18:54 -0500 Subject: [erlang-questions] Understanding a record generated by fprof:analyse/* In-Reply-To: <20120907100059.GA16059@erix.ericsson.se> References: <20120907100059.GA16059@erix.ericsson.se> Message-ID: On Fri, Sep 7, 2012 at 5:00 AM, Raimo Niskanen wrote: > > On Thu, Sep 06, 2012 at 12:28:13AM -0500, Rich Neswold wrote: > > I'm running the fprof profiler on our newly developed system and found > > a record in the profiler output that I don't understand. The record in > > question is: > > > > {[{{gen_server,loop,6}, 1630, 84.765, 26.450}], > > { {gen_server,decode_msg,8}, 1630, 84.765, 26.450}, > > [{{gen_server,handle_msg,5}, 1630, 0.018, 25.549}]}. > > > > The second column of numbers is the accumulated time used by the > > function and the last column is the time taken in the function itself > > (not functions it has called.) In 99% of the records, the accumulated > > time is greater than the function's time, which makes sense. In the > > case of genserver:handle_msg/5, however, the accumulated time is 18 uS > > (!) and the function took 25 mS. How can this be? > > Sometimes fprof can not figure out which way functions are called and > hence fails to charge the right caller with accumulated time. > > In this case I see handle_msg() calls loop() that calls decode_msg() > that calls handle_msg(); it is an infinite loop and when fprof > sees cykles in the call stack it tries to collaps them > before charging the caller, thus a guilty function might evade charging. > > What does the record for gen_server:handle_msg/5 say? Thanks for your reply! The entry for gen_server:handle_msg/5 shows this: {[{{proc_lib,init_p_do_apply,3}, 0,100977.905, 27.831}, {undefined, 0, 0.247, 0.000}, {{gen_server,decode_msg,8}, 1630, 0.018, 25.549}], { {gen_server,handle_msg,5}, 1630,100978.170, 53.380}, % [{{gen_server,handle_common_reply,6}, 1624,100890.803, 26.477}, {{gen_server,loop,6}, 6, 59.271, 0.168}, {{gen_server,dispatch,3}, 1624, 31.442, 30.702}, {{gen_server,reply,2}, 6, 0.284, 0.284}]}. When I built the run-time, I chose the "native-libs" option so all the libraries are native (with which, I found, fprof doesn't do well.) Maybe fprof is getting confused because there's not enough information to do a proper analysis. I rebuilt our project without native code because, with native code enabled, very few of our functions showed up in the report. Thanks for your help. -- Rich From stephane.pamelard@REDACTED Fri Sep 7 18:59:19 2012 From: stephane.pamelard@REDACTED (Stephane Pamelard) Date: Fri, 7 Sep 2012 18:59:19 +0200 Subject: [erlang-questions] percept application packaging issue Message-ID: <504A27E7.4030602@myriadgroup.com> Hi, I'm trying to package percept application in my own product RPM. I added percept application reference in the rel.src and built boot file and the release package by using systools:make_script/1 and systools:make_tar/1 The problem is that egd module is not part of this release package. I checked percept.app and I did not find it in percept module list. (only [percept,percept_db,percept_html,percept_graph,percept_analyzer]). I understood from the doc that the modules to be packaged are deduced from this app parameter: / The release resource file Name.rel is read to find out which applications are included in the release. Then the relevant application resource files App.app are read to find out which modules should be loaded and if and how the application should be started. (Keys modules and mod, see app(4)). / Is there something I'm doing wrong? Thanks for your help OTP version: R15B1 St?phane *** DISCLAIMER *** This message, including attachments, is intended solely for the addressee indicated in this message and is strictly confidential or otherwise privileged. If you are not the intended recipient (or responsible for delivery of the message to such person) : - (1) please immediately (i) notify the sender by reply email and (ii) delete this message and attachments, - (2) any use, copy or dissemination of this transmission is strictly prohibited. If you or your employer does not consent to Internet email messages of this kind, please advise Myriad Group AG by reply e-mail immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by Myriad Group AG unless otherwise indicated by an authorized representative independent of this message. From andrew@REDACTED Fri Sep 7 21:03:29 2012 From: andrew@REDACTED (Andrew Thompson) Date: Fri, 7 Sep 2012 15:03:29 -0400 Subject: [erlang-questions] io_lib format inconsistancies Message-ID: <20120907190329.GU5837@hijacked.us> I wrote a quickcheck test for lager to compare its formatting to io_lib, and I found a bunch of dissimilarities. However, a couple of the things I found didn't make a lot of sense, so I figured I'd ask here for an explanation. First one: 1> io:format("~P", [<<>>, 1]). <<>>ok 2> io:format("~W", [<<>>, 1]). <<...>>ok 3> io:format("~P", [<<1>>, 1]). <<...>>ok 4> io:format("~W", [<<1>>, 1]). <<...>>ok As you can see, ~P and ~W behave differently on the empty binary, but behave the same when the binary isn't empty. Seems a bit weird. The other one that bothers me: 16> io:format("~P", ['hello world', 2]). 'hello world'ok 17> io:format("~P", ["hello world", 2]). "hello world"ok 18> io:format("~P", [<<"hello world">>, 2]). <<"hell"...>>ok 19> io:format("~W", ['hello world', 2]). 'hello world'ok 20> io:format("~W", ["hello world", 2]). [104|...]ok 21> io:format("~W", [<<"hello world">>, 2]). <<104,...>>ok Why does a 'depth' of 2 mean we print the <<>> and the first *four* characters of a binary? ~W behaves much more logically. Also why does depth not apply to printable lists, but it does to binaries? I've got a branch now for lager to be compatible with this madness, but I wondered if anyone knows *why* things are like this? https://github.com/basho/lager/pull/77 Andrew From wallentin.dahlberg@REDACTED Fri Sep 7 21:41:07 2012 From: wallentin.dahlberg@REDACTED (=?ISO-8859-1?Q?Bj=F6rn=2DEgil_Dahlberg?=) Date: Fri, 7 Sep 2012 21:41:07 +0200 Subject: [erlang-questions] percept application packaging issue In-Reply-To: <504A27E7.4030602@myriadgroup.com> References: <504A27E7.4030602@myriadgroup.com> Message-ID: Hi St?phane, It seems like this issue has been overlooked. percept, and i think the tools application, are the odd ones out in the application sense. They are not strictly applications. Instead they are more or less a collection of modules. percept also has a second "application" egd in its directory. percept.app.src is obviously missing modules in its file. I think it should be: {modules, [ egd, egd_font, egd_png, egd_primitives, egd_render, percept, percept_analyzer, percept_db, percept_graph, percept_html, percept_image ]}, // Bj?rn-Egil 2012/9/7 Stephane Pamelard > Hi, > > I'm trying to package percept application in my own product RPM. > I added percept application reference in the rel.src and built boot file > and the release package by using systools:make_script/1 and > systools:make_tar/1 > > The problem is that egd module is not part of this release package. I > checked percept.app and I did not find it in percept module list. (only > [percept,percept_db,percept_**html,percept_graph,percept_**analyzer]). > > I understood from the doc that the modules to be packaged are deduced > from this app parameter: > / > The release resource file Name.rel is read to find out which > applications are included in the release. Then the relevant application > resource files App.app are read to find out which modules should be > loaded and if and how the application should be started. (Keys modules > and mod, see app(4)). > / > Is there something I'm doing wrong? > > Thanks for your help > > OTP version: R15B1 > > St?phane > *** DISCLAIMER *** > > This message, including attachments, is intended solely for the addressee > indicated in this message and is strictly confidential or otherwise > privileged. If you are not the intended recipient (or responsible for > delivery of the message to such person) : - (1) please immediately (i) > notify the sender by reply email and (ii) delete this message and > attachments, - (2) any use, copy or dissemination of this transmission is > strictly prohibited. If you or your employer does not consent to Internet > email messages of this kind, please advise Myriad Group AG by reply e-mail > immediately. Opinions, conclusions and other information expressed in this > message are not given or endorsed by Myriad Group AG unless otherwise > indicated by an authorized representative independent of this message. > ______________________________**_________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/**listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zabrane3@REDACTED Sat Sep 8 09:57:20 2012 From: zabrane3@REDACTED (Zabrane Mikael) Date: Sat, 8 Sep 2012 09:57:20 +0200 Subject: [erlang-questions] Dialyzer R15B02 crash Message-ID: Hi guys, Hi Kostis, Just tried Dialyzer R15B02 and got this: Proceeding with analysis... =ERROR REPORT==== 8-Sep-2012::09:51:45 === Error in process <0.475.0> with exit value: {badarg,[{ets,insert,[73757,[{{out,{pimco,passed,2}},{{pimco,passed,2},{pimco,handle_call,3}}},{{in,{pimco,handle_call,3}},{{pimco,passed,2},{pimco,handle_call,3}}}]],[]},{digraph,do_insert_edge... dialyzer: Analysis failed with error: {badarg,[{ets,insert,[73757,[{{out,...},{...}},{{...},...}]],[]}, {digraph,do_insert_edge,5,[{file,[...]},{line,...}]}, {dialyzer_callgraph,digraph_add_edge,3,[{file,...},{...}]}, {dialyzer_callgraph,digraph_add_edges,2,[{...}|...]}, {dialyzer_behaviours,translate_callgraph,3,[...]}, {dialyzer_dataflow,analyze_module,5,...}, {dialyzer_dataflow,get_warnings,...}, {dialyzer_succ_typings,...}]} Last messages in the log cache: Reading files and computing callgraph... done in 0.99 secs Removing edges... done in 0.01 secs =ERROR REPORT==== 8-Sep-2012::09:51:45 === Error in process <0.477.0> with exit value: {badarg,[{ets,lookup,[73757,{in,5786}],[]},{digraph,in_neighbours,2,[{file,"digraph.erl"},{line,228}]},{dialyzer_callgraph,digraph_in_neighbours,2,[{file,"dialyzer_callgraph.erl"},{line,551}]},{dialyzer_dataflow,state__add_work_from_fun... make: *** [dialyzer] Error 1 Note: Dialyzer R15B01 didn't crash while analyzing this module. Thanks -- Regards Zabrane From kostis@REDACTED Sat Sep 8 10:08:43 2012 From: kostis@REDACTED (Kostis Sagonas) Date: Sat, 08 Sep 2012 10:08:43 +0200 Subject: [erlang-questions] Dialyzer R15B02 crash In-Reply-To: References: Message-ID: <504AFD0B.5090907@cs.ntua.gr> On 09/08/2012 09:57 AM, Zabrane Mikael wrote: > Hi guys, Hi Kostis, > > Just tried Dialyzer R15B02 and got this: > > Proceeding with analysis... > =ERROR REPORT==== 8-Sep-2012::09:51:45 === > Error in process<0.475.0> with exit value: > {badarg,[{ets,insert,[73757,[{{out,{pimco,passed,2}},{{pimco,passed,2},{pimco,handle_call,3}}},{{in,{pimco,handle_call,3}},{{pimco,passed,2},{pimco,handle_call,3}}}]],[]},{digraph,do_insert_edge... > > > dialyzer: Analysis failed with error: > {badarg,[{ets,insert,[73757,[{{out,...},{...}},{{...},...}]],[]}, > {digraph,do_insert_edge,5,[{file,[...]},{line,...}]}, As I wrote in the erlang-bugs mailing list: "The race condition detection in dialyzer in R15B02 unfortunately has a problem in many cases (at least in all cases where behaviours are also involved). We already have a patch for this, which we are testing in large code bases to make sure there are no issues left, and we will notify this thread for its existence when it gets ready." So, in case you are using the option -Wrace_conditions, which is off by default, then most probably the crash is due to this. If not, then this is news to us, so please send (privately) the offending module to me in order to investigate. Kostis From demeshchuk@REDACTED Sat Sep 8 18:37:59 2012 From: demeshchuk@REDACTED (Dmitry Demeshchuk) Date: Sat, 8 Sep 2012 20:37:59 +0400 Subject: [erlang-questions] Release handler seems to be not starting some applications Message-ID: Hi, everyone. I've been checking rebar and releases mechanisms and noticed an odd thing. First, I created a dummy release and started it. After that, I added some applications to it, generated a release upgrade and installed it. Surprisingly, some applications haven't started, compiler and lager to be precise. Basically, here was the initial list of applications in reltool.config: kernel, stdlib, rels and here's the one after my upgrade: kernel, stdlib, riak_err, compiler, syntax_tools, lager, rels No errors, no warnings, compiler and lager just silently fail to start, though their starting instructions do exist in relup. Tried to start them manually ? works like a charm. Here's a short exapmle: https://github.com/doubleyou/rels To reproduce, switch to the initial commit, build, generate release. Then switch to the second commit, build, generate release upgrade, install. Any suggestions? -- Best regards, Dmitry Demeshchuk -------------- next part -------------- An HTML attachment was scrubbed... URL: From demeshchuk@REDACTED Sat Sep 8 18:47:17 2012 From: demeshchuk@REDACTED (Dmitry Demeshchuk) Date: Sat, 8 Sep 2012 20:47:17 +0400 Subject: [erlang-questions] Release handler seems to be not starting some applications In-Reply-To: References: Message-ID: Okay, that seems like a lager problem, it just doesn't start even after starting compiler. Moreover, it doesn't start using lager:start() and whatever else. No idea why compiler isn't started though. On Sat, Sep 8, 2012 at 8:37 PM, Dmitry Demeshchuk wrote: > Hi, everyone. > > I've been checking rebar and releases mechanisms and noticed an odd thing. > > First, I created a dummy release and started it. After that, I added some > applications to it, generated a release upgrade and installed it. > Surprisingly, some applications haven't started, compiler and lager to be > precise. > > Basically, here was the initial list of applications in reltool.config: > > kernel, > stdlib, > rels > > and here's the one after my upgrade: > > kernel, > stdlib, > riak_err, > compiler, > syntax_tools, > lager, > rels > > No errors, no warnings, compiler and lager just silently fail to start, > though their starting instructions do exist in relup. Tried to start them > manually ? works like a charm. > > Here's a short exapmle: https://github.com/doubleyou/rels > To reproduce, switch to the initial commit, build, generate release. Then > switch to the second commit, build, generate release upgrade, install. > > > Any suggestions? > > -- > Best regards, > Dmitry Demeshchuk > -- Best regards, Dmitry Demeshchuk -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.pamelard@REDACTED Sun Sep 9 08:59:41 2012 From: stephane.pamelard@REDACTED (Stephane Pamelard) Date: Sun, 9 Sep 2012 08:59:41 +0200 Subject: [erlang-questions] percept application packaging issue In-Reply-To: References: <504A27E7.4030602@myriadgroup.com> Message-ID: <504C3E5D.9000201@myriadgroup.com> Thanks Bj?rn-Egil for your inputs, I agree with you that percept.app.src should be patched to contain missing egd modules. St?phane Bj?rn-Egil Dahlberg wrote: > Hi St?phane, > > It seems like this issue has been overlooked. > > percept, and i think the tools application, are the odd ones out in > the application sense. They are not strictly applications. > Instead they are more or less a collection of modules. percept also > has a second "application" egd in its directory. > > percept.app.src is obviously missing modules in its file. > > I think it should be: > > {modules, [ > egd, > egd_font, > egd_png, > egd_primitives, > egd_render, > percept, > percept_analyzer, > percept_db, > percept_graph, > percept_html, > percept_image > ]}, > > // Bj?rn-Egil > > > 2012/9/7 Stephane Pamelard > > > Hi, > > I'm trying to package percept application in my own product RPM. > I added percept application reference in the rel.src and built > boot file > and the release package by using systools:make_script/1 and > systools:make_tar/1 > > The problem is that egd module is not part of this release package. I > checked percept.app and I did not find it in percept module list. > (only > [percept,percept_db,percept_html,percept_graph,percept_analyzer]). > > I understood from the doc that the modules to be packaged are deduced > from this app parameter: > / > The release resource file Name.rel is read to find out which > applications are included in the release. Then the relevant > application > resource files App.app are read to find out which modules should be > loaded and if and how the application should be started. (Keys modules > and mod, see app(4)). > / > Is there something I'm doing wrong? > > Thanks for your help > > OTP version: R15B1 > > St?phane > *** DISCLAIMER *** > > This message, including attachments, is intended solely for the > addressee indicated in this message and is strictly confidential > or otherwise privileged. If you are not the intended recipient (or > responsible for delivery of the message to such person) : - (1) > please immediately (i) notify the sender by reply email and (ii) > delete this message and attachments, - (2) any use, copy or > dissemination of this transmission is strictly prohibited. If you > or your employer does not consent to Internet email messages of > this kind, please advise Myriad Group AG by reply e-mail > immediately. Opinions, conclusions and other information expressed > in this message are not given or endorsed by Myriad Group AG > unless otherwise indicated by an authorized representative > independent of this message. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > *** DISCLAIMER *** This message, including attachments, is intended solely for the addressee indicated in this message and is strictly confidential or otherwise privileged. If you are not the intended recipient (or responsible for delivery of the message to such person) : - (1) please immediately (i) notify the sender by reply email and (ii) delete this message and attachments, - (2) any use, copy or dissemination of this transmission is strictly prohibited. If you or your employer does not consent to Internet email messages of this kind, please advise Myriad Group AG by reply e-mail immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by Myriad Group AG unless otherwise indicated by an authorized representative independent of this message. From tristan.sloughter@REDACTED Sun Sep 9 16:35:03 2012 From: tristan.sloughter@REDACTED (Tristan Sloughter) Date: Sun, 9 Sep 2012 09:35:03 -0500 Subject: [erlang-questions] http://www.erlang.org/ : appealing or appalling? In-Reply-To: <5049B807.1060407@erlang.org> References: <6148046F-0CAD-4404-A616-57F903339921@cs.otago.ac.nz> <5049B807.1060407@erlang.org> Message-ID: I find it funny that it seems Haskell (well Haskell Platform) has the most appealing landing page for any programming language : http://hackage.haskell.org/platform/ Would be awesome to have something like that, and linking to Erlang Solutions binary packages of Erlang/OTP. On Fri, Sep 7, 2012 at 4:01 AM, Henrik Nord wrote: > > On 09/06/2012 12:51 AM, Richard O'Keefe wrote: > >> The subject line is a node to Adlai Stevenson's quip that he >> found [St] Paul appealing and [Norman Vincent] Peale appalling. >> I happened to visit www.erlang.org this morning, and while I >> found much good stuff there, I found the entry page unappealing. >> The quote from Joe Armstrong is in dark grey on a black background >> and is *very* hard to read. The "bleached" Erlang "e" on the >> right looked a bit dead, and the way such colour as existed at >> the top "faded into the black" for some reason made me think of >> the dying Emperor Julian. >> >> On the Downloads page, the word "courtesy" is spelled "curtesy". >> (And "OS X" is normally written that way, not "Os X".) >> > Thank you for pointing this out. > > ______________________________**_________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/**listinfo/erlang-questions >> > > -- > /Henrik Nord Erlang/OTP > > > ______________________________**_________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/**listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From olav@REDACTED Sun Sep 9 16:55:25 2012 From: olav@REDACTED (Olav Frengstad) Date: Sun, 9 Sep 2012 16:55:25 +0200 Subject: [erlang-questions] http://www.erlang.org/ : appealing or appalling? In-Reply-To: References: <6148046F-0CAD-4404-A616-57F903339921@cs.otago.ac.nz> <5049B807.1060407@erlang.org> Message-ID: The Haskell landing page is very nice. Just improving the general styles would make a big different and it's not that big job, creating an equally appealing landing page would require a bit more effort tho. Does anyone know what content management system is used for the site, and if the sources are available anywhere? Olav 2012/9/9 Tristan Sloughter : > I find it funny that it seems Haskell (well Haskell Platform) has the most > appealing landing page for any programming language : > http://hackage.haskell.org/platform/ > > Would be awesome to have something like that, and linking to Erlang > Solutions binary packages of Erlang/OTP. > > On Fri, Sep 7, 2012 at 4:01 AM, Henrik Nord wrote: >> >> >> On 09/06/2012 12:51 AM, Richard O'Keefe wrote: >>> >>> The subject line is a node to Adlai Stevenson's quip that he >>> found [St] Paul appealing and [Norman Vincent] Peale appalling. >>> I happened to visit www.erlang.org this morning, and while I >>> found much good stuff there, I found the entry page unappealing. >>> The quote from Joe Armstrong is in dark grey on a black background >>> and is *very* hard to read. The "bleached" Erlang "e" on the >>> right looked a bit dead, and the way such colour as existed at >>> the top "faded into the black" for some reason made me think of >>> the dying Emperor Julian. >>> >>> On the Downloads page, the word "courtesy" is spelled "curtesy". >>> (And "OS X" is normally written that way, not "Os X".) >> >> Thank you for pointing this out. >> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> -- >> /Henrik Nord Erlang/OTP >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Med Vennlig Hilsen Olav Frengstad Systemutvikler // FWT +47 920 42 090 From max.lapshin@REDACTED Sun Sep 9 18:11:19 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Sun, 9 Sep 2012 20:11:19 +0400 Subject: [erlang-questions] Please, change link to packages on erlang-solutions.com Message-ID: Currently you have: This makes very inconvenient downloading on server, because it is required to edit link by hand. If change to this, it will be better: From tony@REDACTED Sun Sep 9 22:44:04 2012 From: tony@REDACTED (Tony Rogvall) Date: Sun, 9 Sep 2012 22:44:04 +0200 Subject: [erlang-questions] native Message-ID: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> Hi list. I started playing with a simple implementation of MD5 (basically straight from the wiki page) When the implementation produce the correct output, I did some timing for fun and also tried to native compile it. To my astonishment I discovered that the code was slower when native compiled. I am using R15B01 on mac. Can this be true? And in this case why? Note that I do not care to optimize the implementation it self! I am more interested why the native compiler produce slower code on this example. Thanks Tony %%%%%%% -module(md5). -compile(export_all). k(I) when I >= 0, I < 64 -> %% may construct table! trunc(abs(math:sin(I+1)) * (1 bsl 32)). r(I) when I >= 0, I < 64 -> element(I+1, {7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21}). hex(Bin) -> [ element(H+1,{$0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$a,$b,$c,$d,$e,$f}) || <> <= Bin ]. md5_test(Input) -> {hex(md5(Input)), hex(erlang:md5(Input))}. md5(List) when is_list(List) -> md5(list_to_binary(List)); md5(Bits) when is_bitstring(Bits) -> Length = bit_size(Bits), Pad = (512 - (Length+1+64) rem 512) rem 512, Bits1 = <>, md5(Bits1,16#67452301,16#efcdab89,16#98badcfe,16#10325476). md5(<<>>, H0,H1,H2,H3) -> <>; md5(Bits,H0,H1,H2,H3) -> <> = Bits, W = list_to_tuple([ X || <> <= Chunk ]), {A,B,C,D} = md5_(0, W, H0, H1, H2, H3), md5(Rest, H0+A,H1+B,H2+C,H3+D). md5_(I, W, A, B, C, D) when I < 16 -> F = (B band C) bor ((bnot B) band D), G = I, R = rotate(A+F+k(I)+element(G+1,W), r(I)), md5_(I+1,W,D,B+R,B,C); md5_(I, W, A, B, C, D) when I < 32 -> F = (D band B) bor ((bnot D) band C), G = (5*I + 1) rem 16, R = rotate(A+F+k(I)+element(G+1,W), r(I)), md5_(I+1,W,D,B+R,B,C); md5_(I, W, A, B, C, D) when I < 48 -> F = (B bxor C) bxor D, G = (3*I+5) rem 16, R = rotate(A+F+k(I)+element(G+1,W), r(I)), md5_(I+1,W,D,B+R,B,C); md5_(I, W, A, B, C, D) when I < 64 -> F = C bxor (B bor (bnot D)), G = (7*I) rem 16, R = rotate(A+F+k(I)+element(G+1,W), r(I)), md5_(I+1,W,D,B+R,B,C); md5_(64, _W, A, B, C, D) -> {A,B,C,D}. rotate(X0, C) -> X = X0 band 16#ffffffff, ((X bsl C) bor (X bsr (32-C))) band 16#ffffffff. %%%%%%% "Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix" -------------- next part -------------- An HTML attachment was scrubbed... URL: From oj@REDACTED Sun Sep 9 23:42:43 2012 From: oj@REDACTED (OJ Reeves) Date: Mon, 10 Sep 2012 07:42:43 +1000 Subject: [erlang-questions] http://www.erlang.org/ : appealing or appalling? In-Reply-To: References: <6148046F-0CAD-4404-A616-57F903339921@cs.otago.ac.nz> <5049B807.1060407@erlang.org> Message-ID: Hi all, I also feel the landing page and overall feel of the site could do with a bit of work. As a member of the community I'd be happy to pitch in some cash to pay for a nice design that would be a bit easier on the eye. The download speed is also a killer. Lots of the buzz on the web around Erlang revolves around how well it can handle web traffic and yet downloading anything off erlang.org takes forever (at least four me and a fair few other people I've spoken to) and I haven't be able to find working torrents for the last few releases. I think basic site design and faster downloads would have a noticeable impact on the first impression. Cheers! OJ On Sep 10, 2012 12:55 AM, "Olav Frengstad" wrote: > The Haskell landing page is very nice. > > Just improving the general styles would make a big different and it's > not that big job, creating an equally appealing landing page would > require a bit more effort tho. > > > Does anyone know what content management system is used for the site, > and if the sources are available anywhere? > > Olav > > 2012/9/9 Tristan Sloughter : > > I find it funny that it seems Haskell (well Haskell Platform) has the > most > > appealing landing page for any programming language : > > http://hackage.haskell.org/platform/ > > > > Would be awesome to have something like that, and linking to Erlang > > Solutions binary packages of Erlang/OTP. > > > > On Fri, Sep 7, 2012 at 4:01 AM, Henrik Nord wrote: > >> > >> > >> On 09/06/2012 12:51 AM, Richard O'Keefe wrote: > >>> > >>> The subject line is a node to Adlai Stevenson's quip that he > >>> found [St] Paul appealing and [Norman Vincent] Peale appalling. > >>> I happened to visit www.erlang.org this morning, and while I > >>> found much good stuff there, I found the entry page unappealing. > >>> The quote from Joe Armstrong is in dark grey on a black background > >>> and is *very* hard to read. The "bleached" Erlang "e" on the > >>> right looked a bit dead, and the way such colour as existed at > >>> the top "faded into the black" for some reason made me think of > >>> the dying Emperor Julian. > >>> > >>> On the Downloads page, the word "courtesy" is spelled "curtesy". > >>> (And "OS X" is normally written that way, not "Os X".) > >> > >> Thank you for pointing this out. > >> > >>> _______________________________________________ > >>> erlang-questions mailing list > >>> erlang-questions@REDACTED > >>> http://erlang.org/mailman/listinfo/erlang-questions > >> > >> > >> -- > >> /Henrik Nord Erlang/OTP > >> > >> > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > Med Vennlig Hilsen > Olav Frengstad > > Systemutvikler // FWT > +47 920 42 090 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rapsey@REDACTED Mon Sep 10 09:15:30 2012 From: rapsey@REDACTED (Rapsey) Date: Mon, 10 Sep 2012 09:15:30 +0200 Subject: [erlang-questions] http://www.erlang.org/ : appealing or appalling? In-Reply-To: References: <6148046F-0CAD-4404-A616-57F903339921@cs.otago.ac.nz> <5049B807.1060407@erlang.org> Message-ID: Is design really that important? Plenty of very successful open source projects have ugly sites. What is important is the information on the site, which is the area that really could be improved. What I think would be great is a list of open source projects/libraries that are erlang based. Sergej On Sun, Sep 9, 2012 at 11:42 PM, OJ Reeves wrote: > Hi all, > > I also feel the landing page and overall feel of the site could do with a > bit of work. > > As a member of the community I'd be happy to pitch in some cash to pay for > a nice design that would be a bit easier on the eye. > > The download speed is also a killer. Lots of the buzz on the web around > Erlang revolves around how well it can handle web traffic and yet > downloading anything off erlang.org takes forever (at least four me and a > fair few other people I've spoken to) and I haven't be able to find working > torrents for the last few releases. > > I think basic site design and faster downloads would have a noticeable > impact on the first impression. > > Cheers! > OJ > On Sep 10, 2012 12:55 AM, "Olav Frengstad" wrote: > >> The Haskell landing page is very nice. >> >> Just improving the general styles would make a big different and it's >> not that big job, creating an equally appealing landing page would >> require a bit more effort tho. >> >> >> Does anyone know what content management system is used for the site, >> and if the sources are available anywhere? >> >> Olav >> >> 2012/9/9 Tristan Sloughter : >> > I find it funny that it seems Haskell (well Haskell Platform) has the >> most >> > appealing landing page for any programming language : >> > http://hackage.haskell.org/platform/ >> > >> > Would be awesome to have something like that, and linking to Erlang >> > Solutions binary packages of Erlang/OTP. >> > >> > On Fri, Sep 7, 2012 at 4:01 AM, Henrik Nord wrote: >> >> >> >> >> >> On 09/06/2012 12:51 AM, Richard O'Keefe wrote: >> >>> >> >>> The subject line is a node to Adlai Stevenson's quip that he >> >>> found [St] Paul appealing and [Norman Vincent] Peale appalling. >> >>> I happened to visit www.erlang.org this morning, and while I >> >>> found much good stuff there, I found the entry page unappealing. >> >>> The quote from Joe Armstrong is in dark grey on a black background >> >>> and is *very* hard to read. The "bleached" Erlang "e" on the >> >>> right looked a bit dead, and the way such colour as existed at >> >>> the top "faded into the black" for some reason made me think of >> >>> the dying Emperor Julian. >> >>> >> >>> On the Downloads page, the word "courtesy" is spelled "curtesy". >> >>> (And "OS X" is normally written that way, not "Os X".) >> >> >> >> Thank you for pointing this out. >> >> >> >>> _______________________________________________ >> >>> erlang-questions mailing list >> >>> erlang-questions@REDACTED >> >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> >> >> -- >> >> /Henrik Nord Erlang/OTP >> >> >> >> >> >> _______________________________________________ >> >> erlang-questions mailing list >> >> erlang-questions@REDACTED >> >> http://erlang.org/mailman/listinfo/erlang-questions >> > >> > >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> >> >> >> -- >> Med Vennlig Hilsen >> Olav Frengstad >> >> Systemutvikler // FWT >> +47 920 42 090 >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From oj@REDACTED Mon Sep 10 09:18:35 2012 From: oj@REDACTED (OJ Reeves) Date: Mon, 10 Sep 2012 17:18:35 +1000 Subject: [erlang-questions] http://www.erlang.org/ : appealing or appalling? In-Reply-To: References: <6148046F-0CAD-4404-A616-57F903339921@cs.otago.ac.nz> <5049B807.1060407@erlang.org> Message-ID: Short answer: yes. I do think it is, along with many other things. Imho of course :) On Sep 10, 2012 3:15 PM, "Rapsey" wrote: > Is design really that important? Plenty of very successful open source > projects have ugly sites. What is important is the information on the site, > which is the area that really could be improved. What I think would be > great is a list of open source projects/libraries that are erlang based. > > > Sergej > > On Sun, Sep 9, 2012 at 11:42 PM, OJ Reeves wrote: > >> Hi all, >> >> I also feel the landing page and overall feel of the site could do with a >> bit of work. >> >> As a member of the community I'd be happy to pitch in some cash to pay >> for a nice design that would be a bit easier on the eye. >> >> The download speed is also a killer. Lots of the buzz on the web around >> Erlang revolves around how well it can handle web traffic and yet >> downloading anything off erlang.org takes forever (at least four me and >> a fair few other people I've spoken to) and I haven't be able to find >> working torrents for the last few releases. >> >> I think basic site design and faster downloads would have a noticeable >> impact on the first impression. >> >> Cheers! >> OJ >> On Sep 10, 2012 12:55 AM, "Olav Frengstad" wrote: >> >>> The Haskell landing page is very nice. >>> >>> Just improving the general styles would make a big different and it's >>> not that big job, creating an equally appealing landing page would >>> require a bit more effort tho. >>> >>> >>> Does anyone know what content management system is used for the site, >>> and if the sources are available anywhere? >>> >>> Olav >>> >>> 2012/9/9 Tristan Sloughter : >>> > I find it funny that it seems Haskell (well Haskell Platform) has the >>> most >>> > appealing landing page for any programming language : >>> > http://hackage.haskell.org/platform/ >>> > >>> > Would be awesome to have something like that, and linking to Erlang >>> > Solutions binary packages of Erlang/OTP. >>> > >>> > On Fri, Sep 7, 2012 at 4:01 AM, Henrik Nord wrote: >>> >> >>> >> >>> >> On 09/06/2012 12:51 AM, Richard O'Keefe wrote: >>> >>> >>> >>> The subject line is a node to Adlai Stevenson's quip that he >>> >>> found [St] Paul appealing and [Norman Vincent] Peale appalling. >>> >>> I happened to visit www.erlang.org this morning, and while I >>> >>> found much good stuff there, I found the entry page unappealing. >>> >>> The quote from Joe Armstrong is in dark grey on a black background >>> >>> and is *very* hard to read. The "bleached" Erlang "e" on the >>> >>> right looked a bit dead, and the way such colour as existed at >>> >>> the top "faded into the black" for some reason made me think of >>> >>> the dying Emperor Julian. >>> >>> >>> >>> On the Downloads page, the word "courtesy" is spelled "curtesy". >>> >>> (And "OS X" is normally written that way, not "Os X".) >>> >> >>> >> Thank you for pointing this out. >>> >> >>> >>> _______________________________________________ >>> >>> erlang-questions mailing list >>> >>> erlang-questions@REDACTED >>> >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> >>> >> >>> >> -- >>> >> /Henrik Nord Erlang/OTP >>> >> >>> >> >>> >> _______________________________________________ >>> >> erlang-questions mailing list >>> >> erlang-questions@REDACTED >>> >> http://erlang.org/mailman/listinfo/erlang-questions >>> > >>> > >>> > >>> > _______________________________________________ >>> > erlang-questions mailing list >>> > erlang-questions@REDACTED >>> > http://erlang.org/mailman/listinfo/erlang-questions >>> > >>> >>> >>> >>> -- >>> Med Vennlig Hilsen >>> Olav Frengstad >>> >>> Systemutvikler // FWT >>> +47 920 42 090 >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.eugene.turner@REDACTED Mon Sep 10 09:25:47 2012 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Mon, 10 Sep 2012 16:25:47 +0900 Subject: [erlang-questions] http://www.erlang.org/ : appealing or appalling? In-Reply-To: References: <6148046F-0CAD-4404-A616-57F903339921@cs.otago.ac.nz> <5049B807.1060407@erlang.org> Message-ID: On Mon, Sep 10, 2012 at 4:15 PM, Rapsey wrote: > Is design really that important? Plenty of very successful open source > projects have ugly sites. What is important is the information on the site, > which is the area that really could be improved. What I think would be great > is a list of open source projects/libraries that are erlang based. Information AND navigability. -michael turner > On Sun, Sep 9, 2012 at 11:42 PM, OJ Reeves wrote: >> >> Hi all, >> >> I also feel the landing page and overall feel of the site could do with a >> bit of work. >> >> As a member of the community I'd be happy to pitch in some cash to pay for >> a nice design that would be a bit easier on the eye. >> >> The download speed is also a killer. Lots of the buzz on the web around >> Erlang revolves around how well it can handle web traffic and yet >> downloading anything off erlang.org takes forever (at least four me and a >> fair few other people I've spoken to) and I haven't be able to find working >> torrents for the last few releases. >> >> I think basic site design and faster downloads would have a noticeable >> impact on the first impression. >> >> Cheers! >> OJ >> >> On Sep 10, 2012 12:55 AM, "Olav Frengstad" wrote: >>> >>> The Haskell landing page is very nice. >>> >>> Just improving the general styles would make a big different and it's >>> not that big job, creating an equally appealing landing page would >>> require a bit more effort tho. >>> >>> >>> Does anyone know what content management system is used for the site, >>> and if the sources are available anywhere? >>> >>> Olav >>> >>> 2012/9/9 Tristan Sloughter : >>> > I find it funny that it seems Haskell (well Haskell Platform) has the >>> > most >>> > appealing landing page for any programming language : >>> > http://hackage.haskell.org/platform/ >>> > >>> > Would be awesome to have something like that, and linking to Erlang >>> > Solutions binary packages of Erlang/OTP. >>> > >>> > On Fri, Sep 7, 2012 at 4:01 AM, Henrik Nord wrote: >>> >> >>> >> >>> >> On 09/06/2012 12:51 AM, Richard O'Keefe wrote: >>> >>> >>> >>> The subject line is a node to Adlai Stevenson's quip that he >>> >>> found [St] Paul appealing and [Norman Vincent] Peale appalling. >>> >>> I happened to visit www.erlang.org this morning, and while I >>> >>> found much good stuff there, I found the entry page unappealing. >>> >>> The quote from Joe Armstrong is in dark grey on a black background >>> >>> and is *very* hard to read. The "bleached" Erlang "e" on the >>> >>> right looked a bit dead, and the way such colour as existed at >>> >>> the top "faded into the black" for some reason made me think of >>> >>> the dying Emperor Julian. >>> >>> >>> >>> On the Downloads page, the word "courtesy" is spelled "curtesy". >>> >>> (And "OS X" is normally written that way, not "Os X".) >>> >> >>> >> Thank you for pointing this out. >>> >> >>> >>> _______________________________________________ >>> >>> erlang-questions mailing list >>> >>> erlang-questions@REDACTED >>> >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> >>> >> >>> >> -- >>> >> /Henrik Nord Erlang/OTP >>> >> >>> >> >>> >> _______________________________________________ >>> >> erlang-questions mailing list >>> >> erlang-questions@REDACTED >>> >> http://erlang.org/mailman/listinfo/erlang-questions >>> > >>> > >>> > >>> > _______________________________________________ >>> > erlang-questions mailing list >>> > erlang-questions@REDACTED >>> > http://erlang.org/mailman/listinfo/erlang-questions >>> > >>> >>> >>> >>> -- >>> Med Vennlig Hilsen >>> Olav Frengstad >>> >>> Systemutvikler // FWT >>> +47 920 42 090 >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From michal.niec@REDACTED Mon Sep 10 09:35:20 2012 From: michal.niec@REDACTED (=?utf-8?Q?Micha=C5=82_Nie=C4=87?=) Date: Mon, 10 Sep 2012 09:35:20 +0200 Subject: [erlang-questions] Please, change link to packages on erlang-solutions.com In-Reply-To: References: Message-ID: <739E0216-FFD4-4733-92D2-905D64D75AC1@erlang-solutions.com> Hi Max, Thanks for feedback on our packages website. We use javascript instead direct links to get more accurate stats. We will probably introduce onclick event which shows the the link. Notice that you can add our repo to your system and make your package manager do the downloading for you. Best Regards, Micha? Nie? On Sep 9, 2012, at 6:11 PM, Max Lapshin wrote: > Currently you have: > > href="javascript:downloadFile('https://elearning.erlang-solutions.com/couchdb/rbingen/package_R15B02_precise64_1346752637/esl-erlang_15.b.2-1~ubuntu~precise_amd64.deb','Packages','R15B02','Ubuntu','64')"> > > > This makes very inconvenient downloading on server, because it is > required to edit link by hand. > > If change to this, it will be better: > > onclick="downloadFile(this.href,'Packages','R15B02','Ubuntu','64'); > return false;" > href="https://elearning.erlang-solutions.com/couchdb/rbingen/package_R15B02_precise64_1346752637/esl-erlang_15.b.2-1~ubuntu~precise_amd64.deb"> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From max.lapshin@REDACTED Mon Sep 10 09:48:08 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 10 Sep 2012 11:48:08 +0400 Subject: [erlang-questions] Please, change link to packages on erlang-solutions.com In-Reply-To: <739E0216-FFD4-4733-92D2-905D64D75AC1@erlang-solutions.com> References: <739E0216-FFD4-4733-92D2-905D64D75AC1@erlang-solutions.com> Message-ID: On Mon, Sep 10, 2012 at 11:35 AM, Micha? Nie? wrote: > Hi Max, > > Thanks for feedback on our packages website. We use javascript instead direct links to get more accurate stats. We will probably introduce onclick event which shows the the link. > > Notice that you can add our repo to your system and make your package manager do the downloading for you. > Yes, I know. But sometimes just copy-paste link is faster. From erlangsiri@REDACTED Mon Sep 10 09:58:44 2012 From: erlangsiri@REDACTED (Siri Hansen) Date: Mon, 10 Sep 2012 09:58:44 +0200 Subject: [erlang-questions] Release handler seems to be not starting some applications In-Reply-To: References: Message-ID: Hi Dmitry! I didn't look very closely at this, but I wonder where sasl is? If you are using the release_handler for upgrade, you need to include sasl in your releases. /siri 2012/9/8 Dmitry Demeshchuk > Okay, that seems like a lager problem, it just doesn't start even after > starting compiler. > > Moreover, it doesn't start using lager:start() and whatever else. No idea > why compiler isn't started though. > > > On Sat, Sep 8, 2012 at 8:37 PM, Dmitry Demeshchuk wrote: > >> Hi, everyone. >> >> I've been checking rebar and releases mechanisms and noticed an odd thing. >> >> First, I created a dummy release and started it. After that, I added some >> applications to it, generated a release upgrade and installed it. >> Surprisingly, some applications haven't started, compiler and lager to be >> precise. >> >> Basically, here was the initial list of applications in reltool.config: >> >> kernel, >> stdlib, >> rels >> >> and here's the one after my upgrade: >> >> kernel, >> stdlib, >> riak_err, >> compiler, >> syntax_tools, >> lager, >> rels >> >> No errors, no warnings, compiler and lager just silently fail to start, >> though their starting instructions do exist in relup. Tried to start them >> manually ? works like a charm. >> >> Here's a short exapmle: https://github.com/doubleyou/rels >> To reproduce, switch to the initial commit, build, generate release. Then >> switch to the second commit, build, generate release upgrade, install. >> >> >> Any suggestions? >> >> -- >> Best regards, >> Dmitry Demeshchuk >> > > > > -- > Best regards, > Dmitry Demeshchuk > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zabrane3@REDACTED Mon Sep 10 11:56:12 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Mon, 10 Sep 2012 11:56:12 +0200 Subject: [erlang-questions] rpc:call without being connected? Message-ID: Hi guys, Is there any equivalent way (documented or not) to execute a remote function (like "rpc:call") but without being connected to the remote node? Regards, Zabrane From vladdu55@REDACTED Mon Sep 10 12:12:40 2012 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 10 Sep 2012 12:12:40 +0200 Subject: [erlang-questions] rpc:call without being connected? In-Reply-To: References: Message-ID: Hi, On Mon, Sep 10, 2012 at 11:56 AM, Zabrane Mickael wrote: > Is there any equivalent way (documented or not) to execute a remote function (like "rpc:call") but > without being connected to the remote node? Well, if you're not connected (somehow) to that node, how would you let it know it has to execute something? So the question becomes, what kind of alternative connections can there be? One is a "communication conduit" (i.e. a tcp socket, a unix pipe, even a file) that both parts can use to communicate. This is basically the same as having a connection via distribution, except you have to do it from scratch. Both parts need to have supporting code for this. Another option that i can think of and that doesn't require the other node to be aware of us, is to start an erl shell to it (with -remshell) and feed it the code to be executed. This only works for things that can be serialized to source code, though. I can't come up with others. regards, Vlad From attila.r.nohl@REDACTED Mon Sep 10 12:23:57 2012 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Mon, 10 Sep 2012 12:23:57 +0200 Subject: [erlang-questions] rpc:call without being connected? In-Reply-To: References: Message-ID: 2012/9/10 Zabrane Mickael : > Hi guys, > > Is there any equivalent way (documented or not) to execute a remote function (like "rpc:call") but > without being connected to the remote node? You could start an ssh daemon on the server side, then use ssh_connection:exec/4 on the client side... From zabrane3@REDACTED Mon Sep 10 14:21:25 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Mon, 10 Sep 2012 14:21:25 +0200 Subject: [erlang-questions] rpc:call without being connected? In-Reply-To: <20120910113635.GA5113@evax.fr> References: <20120910113635.GA5113@evax.fr> Message-ID: Motiejus, Vlad, Attila, and Thomas ... thanks for the feedbacks/links. Regards, Zabrane On Sep 10, 2012, at 1:36 PM, Thomas wrote: > Hi Zabrane, > > I wrote this for this purpose a little while back: > https://github.com/thomasc/sslrpc > > Regards, > Thomas > > On Mon, Sep 10, 2012 at 11:56:12AM +0200, Zabrane Mickael wrote: >> Hi guys, >> >> Is there any equivalent way (documented or not) to execute a remote function (like "rpc:call") but >> without being connected to the remote node? >> >> Regards, >> Zabrane >> > From thomasl_erlang@REDACTED Mon Sep 10 14:41:29 2012 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Mon, 10 Sep 2012 05:41:29 -0700 (PDT) Subject: [erlang-questions] native In-Reply-To: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> Message-ID: <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> >I started playing with a simple implementation of MD5 (basically straight from the wiki page)? >When the implementation produce the correct output, I did some timing for fun and also >tried to native compile it.? >To my astonishment I discovered that the code was slower when native compiled. >I am using?R15B01 on mac. ?Can this be true? And in this case why?? > >Note that I do not care to optimize the implementation it self! I am more interested why >the native compiler produce slower code on this example. On my Mac, the best native result 7% is faster than the best beam result. But the timing varies by 20% from run to run, so I think the proper claim is they are about the same. (I also think Hipe ought to comfortably beat Beam on this sort of code.) Unfortunately, 'pp_native' gave broken/confusing output so it's hard to trace what happens. The arithmetic looks like it's being inlined, which ought to provide a boost. There are calls to r/1 and rotate/2 in the inner loop (md5_/6) which possibly should have been inlined. Best, Thomas From gtsiour@REDACTED Mon Sep 10 15:13:16 2012 From: gtsiour@REDACTED (Yiannis Tsiouris) Date: Mon, 10 Sep 2012 16:13:16 +0300 Subject: [erlang-questions] native In-Reply-To: <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> Message-ID: <504DE76C.9090605@softlab.ntua.gr> On 09/10/2012 03:41 PM, Thomas Lindgren wrote: >> I started playing with a simple implementation of MD5 (basically straight from the wiki page) >> When the implementation produce the correct output, I did some timing for fun and also >> tried to native compile it. >> To my astonishment I discovered that the code was slower when native compiled. >> I am using R15B01 on mac. Can this be true? And in this case why? >> >> Note that I do not care to optimize the implementation it self! I am more interested why >> the native compiler produce slower code on this example. > > > On my Mac, the best native result 7% is faster than the best beam result. But the timing varies by 20% from run to run, so I think the proper claim is they are about the same. (I also think Hipe ought to comfortably beat Beam on this sort of code.) > > Unfortunately, 'pp_native' gave broken/confusing output so it's hard to trace what happens. The arithmetic looks like it's being inlined, which ought to provide a boost. There are calls to r/1 and rotate/2 in the inner loop (md5_/6) which possibly should have been inlined. Hi, Could you post the testcase that you 're timing? Best, Yiannis -- Yiannis Tsiouris Ph.D. student, Software Engineering Laboratory, National Technical University of Athens WWW: http://www.softlab.ntua.gr/~gtsiour -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.j.thompson@REDACTED Mon Sep 10 15:16:08 2012 From: s.j.thompson@REDACTED (Simon Thompson) Date: Mon, 10 Sep 2012 14:16:08 +0100 Subject: [erlang-questions] Failure in compiling R15B-2 on mac os x 10.8 (mountain lion) Message-ID: <976A27E7-E008-4F0C-A4E4-FF85C29BCD78@kent.ac.uk> Can anyone help? I get this error on compiling erlang on mac os x 10.8 (mountain lion) with makefile built from ./configure --enable-darwin-64bit Regards, Simon Here's the error and context ... === Entering application parsetools erlc -W +debug_info +warn_obsolete_guard -I/Users/simonthompson/Desktop/otp_src_R15B02/lib/stdlib/include -o../ebin leex.erl erlc -W +debug_info +warn_obsolete_guard -I/Users/simonthompson/Desktop/otp_src_R15B02/lib/stdlib/include -o../ebin yecc.erl Function: count_nl/1 ./yecc.erl:none: internal error in kernel_module; crash reason: {function_clause, [{eval_bits,match_bits, [[{bin_element,0, {integer,0,10}, {integer,0,8}, [{unit,1},unsigned,big]}], <<"\n">>,[],[],#Fun, #Fun], [{file,"eval_bits.erl"},{line,210}]}, {v3_kernel,select_assert_match_possible,3,[]}, {v3_kernel,select_bin_int,1,[]}, {v3_kernel,select_bin_con_1,1,[]}, {v3_kernel,match_con_1,4,[]}, {v3_kernel,match_clause,4,[]}, {lists,mapfoldl,3,[{file,"lists.erl"},{line,1278}]}, {v3_kernel,'-match_con_1/4-anonymous-0-',3,[]}]} make[3]: *** [../ebin/yecc.beam] Error 1 make[2]: *** [opt] Error 2 make[1]: *** [opt] Error 2 make: *** [secondary_bootstrap_build] Error 2 Simon Thompson | Professor of Logic and Computation School of Computing | University of Kent | Canterbury, CT2 7NF, UK s.j.thompson@REDACTED | M +44 7986 085754 | W www.cs.kent.ac.uk/~sjt From kostis@REDACTED Mon Sep 10 16:06:47 2012 From: kostis@REDACTED (Kostis Sagonas) Date: Mon, 10 Sep 2012 16:06:47 +0200 Subject: [erlang-questions] native In-Reply-To: <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> Message-ID: <504DF3F7.8010108@cs.ntua.gr> On 09/10/2012 02:41 PM, Thomas Lindgren wrote: > >> I started playing with a simple implementation of MD5 (basically straight from the wiki page) >> When the implementation produce the correct output, I did some timing for fun and also >> tried to native compile it. >> To my astonishment I discovered that the code was slower when native compiled. >> I am using R15B01 on mac. Can this be true? And in this case why? >> >> Note that I do not care to optimize the implementation it self! I am more interested why >> the native compiler produce slower code on this example. Aside: I contacted Tony privately and he is creating a 1MB binary and this is what I am using below: Bin = << <> || X <- lists:seq(1, 1024*1024) >>. > On my Mac, the best native result 7% is faster than the best beam result. But the timing varies by 20% from run to run, so I think the proper claim is they are about the same. (I also think Hipe ought to comfortably beat Beam on this sort of code.) I do not have a Mac, but on my i7-desktop, using vanilla R15B01 configured with --enable-native-libs (I do not think this matters here) I get: Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:8:8] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.9.1 (abort with ^G) 1> Bin = << <> || X <- lists:seq(1, 1024*1024) >>. <<1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21, 22,23,24,25,26,27,28,29,...>> 2> f(T), c(md5), {T, _} = timer:tc(md5, md5, [Bin]), T. 2050951 3> f(T), c(md5), {T, _} = timer:tc(md5, md5, [Bin]), T. 2061353 4> f(T), c(md5), {T, _} = timer:tc(md5, md5, [Bin]), T. 2086817 5> f(T), c(md5, [native]), {T, _} = timer:tc(md5, md5, [Bin]), T. 1889809 6> f(T), c(md5, [native]), {T, _} = timer:tc(md5, md5, [Bin]), T. 1865581 7> f(T), c(md5, [native]), {T, _} = timer:tc(md5, md5, [Bin]), T. 1927650 So indeed there is some fluctuation in the results, but native code execution does not appear to be slower in this test. (Many other runs on the same platform basically confirm the results above...) I do not know why Thomas thinks that HiPE should be able to confortably beat BEAM on this sort of code (care to elaborate?). From a brief glance it seems to me that the code spends a lot of time in BIFs written in C (most notably list_to_tuple/1 and element/2, but also trunc/1, abs/1 and math:sin/1. All of these are outside the reach of the native code compiler. > Unfortunately, 'pp_native' gave broken/confusing output so it's hard to trace what happens. Well, this happens because the HiPE compiler compiles in parallel by default (!). If you want to see the native code in the non-scrambled version use: c(md5, [native, {hipe, [no_concurrent_comp, pp_native]}]). Kostis From max.lapshin@REDACTED Mon Sep 10 16:27:20 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 10 Sep 2012 18:27:20 +0400 Subject: [erlang-questions] Question about implementation Message-ID: For example I have such gen_server: -record(state, field1, field2, field3, counter = 0 }. handle_info(incr, #state{counter = Counter} = State) -> {noreply, State#state{counter = Counter + 1}}; Will here whole #state{} be deep-copied with new Counter +1 field, or it is possible to guess, that here optimization is possible and just "edit" counter field in existing tuple? Is it possible to understand by erlang source code, that State is no longer referenced anywhere to avod large allocation and free? From jesper.louis.andersen@REDACTED Mon Sep 10 16:35:35 2012 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 10 Sep 2012 16:35:35 +0200 Subject: [erlang-questions] native In-Reply-To: <504DF3F7.8010108@cs.ntua.gr> References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> <504DF3F7.8010108@cs.ntua.gr> Message-ID: <9EDDC5DE-F35C-4BED-BF94-A94DC5A7A511@erlang-solutions.com> On Sep 10, 2012, at 4:06 PM, Kostis Sagonas wrote: > > I do not have a Mac, but on my i7-desktop, using vanilla R15B01 configured with --enable-native-libs (I do not think this matters here) I get: > Perhaps you are really not measuring the CPU at full speed because it only changed frequency when there is something to do. A guess is that the CPU speed should be locked at a certain rate for this test to be fair. Or at least that is a shot in the dark, you may utilize. From kostis@REDACTED Mon Sep 10 17:02:52 2012 From: kostis@REDACTED (Kostis Sagonas) Date: Mon, 10 Sep 2012 17:02:52 +0200 Subject: [erlang-questions] native In-Reply-To: <9EDDC5DE-F35C-4BED-BF94-A94DC5A7A511@erlang-solutions.com> References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> <504DF3F7.8010108@cs.ntua.gr> <9EDDC5DE-F35C-4BED-BF94-A94DC5A7A511@erlang-solutions.com> Message-ID: <504E011C.6070500@cs.ntua.gr> On 09/10/2012 04:35 PM, Jesper Louis Andersen wrote: > On Sep 10, 2012, at 4:06 PM, Kostis Sagonas wrote: > >> >> I do not have a Mac, but on my i7-desktop, using vanilla R15B01 configured with --enable-native-libs (I do not think this matters here) I get: >> > > Perhaps you are really not measuring the CPU at full speed because it only changed frequency when there is something to do. A guess is that the CPU speed should be locked at a certain rate for this test to be fair. > > Or at least that is a shot in the dark, you may utilize. Does not appear to be the case: Eshell V5.9.1 (abort with ^G) 1> Bin = << <> || X <- lists:seq(1, 1024*1024) >>. <<1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21, 22,23,24,25,26,27,28,29,...>> 2> c(md5). {ok,md5} 3> [begin {T, _} = timer:tc(md5, md5, [Bin]), T end || _ <- lists:seq(1,10)]. [2069001,2036776,2043727,2042717,2041177,2053276,2037912, 2050634,2045248,2044197] 4> c(md5, [native]). {ok,md5} 5> [begin {T, _} = timer:tc(md5, md5, [Bin]), T end || _ <- lists:seq(1,10)]. [1920904,1884088,1883944,1888162,1886673,1889737,1878162, 1883588,1892836,1879735] Not much variance in the results, but clearly in at least the last three runs of the bench the CPU should be at a higher frequency... Kostis From rich.neswold@REDACTED Mon Sep 10 16:53:43 2012 From: rich.neswold@REDACTED (Rich Neswold) Date: Mon, 10 Sep 2012 09:53:43 -0500 Subject: [erlang-questions] native In-Reply-To: <504E011C.6070500@cs.ntua.gr> References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> <504DF3F7.8010108@cs.ntua.gr> <9EDDC5DE-F35C-4BED-BF94-A94DC5A7A511@erlang-solutions.com> <504E011C.6070500@cs.ntua.gr> Message-ID: On Mon, Sep 10, 2012 at 10:02 AM, Kostis Sagonas wrote: > Does not appear to be the case: > > Eshell V5.9.1 (abort with ^G) > 1> Bin = << <> || X <- lists:seq(1, 1024*1024) >>. > <<1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21, > 22,23,24,25,26,27,28,29,...>> > 2> c(md5). > {ok,md5} > 3> [begin {T, _} = timer:tc(md5, md5, [Bin]), T end || _ <- > lists:seq(1,10)]. > [2069001,2036776,2043727,2042717,2041177,2053276,2037912, > 2050634,2045248,2044197] > 4> c(md5, [native]). > {ok,md5} > 5> [begin {T, _} = timer:tc(md5, md5, [Bin]), T end || _ <- > lists:seq(1,10)]. > [1920904,1884088,1883944,1888162,1886673,1889737,1878162, > 1883588,1892836,1879735] > > Not much variance in the results, but clearly in at least the last three > runs of the bench the CPU should be at a higher frequency... What about: c(md5, [native, inline]). -- Rich From michal.niec@REDACTED Mon Sep 10 17:19:01 2012 From: michal.niec@REDACTED (=?utf-8?Q?Micha=C5=82_Nie=C4=87?=) Date: Mon, 10 Sep 2012 17:19:01 +0200 Subject: [erlang-questions] Please, change link to packages on erlang-solutions.com In-Reply-To: References: <739E0216-FFD4-4733-92D2-905D64D75AC1@erlang-solutions.com> Message-ID: I agree that redirection would be the simplest solution. However the website is powered by CMS engine and script and packages data are dynamically loaded from another server. Such configuration doesn't allow for many things. We will try to make it more "manual-download" friendly. Best Regards, Michal Niec On Sep 10, 2012, at 9:53 AM, Robert Melton wrote: >>> Thanks for feedback on our packages website. We use javascript instead direct links to get more accurate stats. We will probably introduce onclick event which shows the the link. >> But sometimes just copy-paste link is faster. > > Couldn't you use redirection to do the stat counting? That would be > more accurate than javascript and wouldn't need the onclick escape > hatch. Both wget and curl can trivially follow redirects which > maintains easy downloading from console (copy-paste), and you get > stats that include all those people from consoles doing the downloads. > > -- > Robert Melton From lukas@REDACTED Mon Sep 10 18:08:26 2012 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 10 Sep 2012 18:08:26 +0200 Subject: [erlang-questions] Question about implementation In-Reply-To: References: Message-ID: Hello, Only the tuple which is the record and the immidiates (i.e. small int, atom, pid, ref etc) will be copied. All other parts use pointers internally and the same pointers will be copied into the correct places within the tuple. So in this case a new 6 word memory block will be created and filled with the atom undefined and finally the new counter. I think that the compiler does some optimization based on updating tuples within the same function body, though I've forgotten what it is it does. Hope that makes sense. Lukas On Mon, Sep 10, 2012 at 4:27 PM, Max Lapshin wrote: > For example I have such gen_server: > > -record(state, > field1, > field2, > field3, > counter = 0 > }. > > > > handle_info(incr, #state{counter = Counter} = State) -> > {noreply, State#state{counter = Counter + 1}}; > > > Will here whole #state{} be deep-copied with new Counter +1 field, or > it is possible to guess, that here optimization is possible and just > "edit" counter field in existing tuple? > > Is it possible to understand by erlang source code, that State is no > longer referenced anywhere to avod large allocation and free? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From max.lapshin@REDACTED Mon Sep 10 18:14:22 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 10 Sep 2012 20:14:22 +0400 Subject: [erlang-questions] Question about implementation In-Reply-To: References: Message-ID: On Mon, Sep 10, 2012 at 8:08 PM, Lukas Larsson wrote: > Hello, > > Only the tuple which is the record and the immidiates (i.e. small int, > atom, pid, ref etc) will be copied. All other parts use pointers > internally and the same pointers will be copied into the correct > places within the tuple. So in this case a new 6 word memory block > will be created and filled with the atom undefined and finally the new > counter. > Thank you! It is right what I wanted to hear. No deep copy, only reallocation of top-level tuple. From thomasl_erlang@REDACTED Mon Sep 10 19:03:25 2012 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Mon, 10 Sep 2012 10:03:25 -0700 (PDT) Subject: [erlang-questions] native In-Reply-To: <504DF3F7.8010108@cs.ntua.gr> References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> <504DF3F7.8010108@cs.ntua.gr> Message-ID: <1347296605.69107.YahooMailNeo@web111410.mail.gq1.yahoo.com> >________________________________ > From: Kostis Sagonas > > >I do not know why Thomas thinks that HiPE should be able to confortably beat BEAM on this sort of code (care to elaborate?).? From a brief glance it seems to me that the code spends a lot of time in BIFs written in C (most notably list_to_tuple/1 and element/2, but also trunc/1, abs/1 and math:sin/1. All of these are outside the reach of the native code compiler. The regular MD5 algorithm is basically a loop doing lots of integer arithmetic and bit operations as well as accessing a few arrays. This ought on the face of it to be quite amenable to native code compilation. I'm amazed that the implementation Tony used managed?to get trunc/abs/sin into the inner loop, but that might as you say well explain the problem. > >> Unfortunately, 'pp_native' gave broken/confusing output so it's hard to trace what happens. > >Well, this happens because the HiPE compiler compiles in parallel by default (!).? If you want to see the native code in the non-scrambled version use: > >? ? c(md5, [native, {hipe, [no_concurrent_comp, pp_native]}]). Well well, you learn something new every day. Best, Thomas From dan@REDACTED Mon Sep 10 19:35:18 2012 From: dan@REDACTED (Daniel Dormont) Date: Mon, 10 Sep 2012 13:35:18 -0400 Subject: [erlang-questions] Question about implementation In-Reply-To: References: Message-ID: On Mon, Sep 10, 2012 at 12:08 PM, Lukas Larsson wrote: > Hello, > > Only the tuple which is the record and the immidiates (i.e. small int, > atom, pid, ref etc) will be copied. All other parts use pointers > internally and the same pointers will be copied into the correct > places within the tuple. So in this case a new 6 word memory block > will be created and filled with the atom undefined and finally the new > counter. > > I think that the compiler does some optimization based on updating > tuples within the same function body, though I've forgotten what it is > it does. > > This bit? http://www.erlang.org/doc/efficiency_guide/commoncaveats.html#id61731 > Hope that makes sense. > > Lukas > > On Mon, Sep 10, 2012 at 4:27 PM, Max Lapshin > wrote: > > For example I have such gen_server: > > > > -record(state, > > field1, > > field2, > > field3, > > counter = 0 > > }. > > > > > > > > handle_info(incr, #state{counter = Counter} = State) -> > > {noreply, State#state{counter = Counter + 1}}; > > > > > > Will here whole #state{} be deep-copied with new Counter +1 field, or > > it is possible to guess, that here optimization is possible and just > > "edit" counter field in existing tuple? > > > > Is it possible to understand by erlang source code, that State is no > > longer referenced anywhere to avod large allocation and free? > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Mon Sep 10 19:36:06 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 10 Sep 2012 21:36:06 +0400 Subject: [erlang-questions] Question about implementation In-Reply-To: References: Message-ID: > > This bit? > http://www.erlang.org/doc/efficiency_guide/commoncaveats.html#id61731 > Exactly! Thanks. From thomasl_erlang@REDACTED Mon Sep 10 22:44:23 2012 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Mon, 10 Sep 2012 13:44:23 -0700 (PDT) Subject: [erlang-questions] native In-Reply-To: <1347296605.69107.YahooMailNeo@web111410.mail.gq1.yahoo.com> References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> <504DF3F7.8010108@cs.ntua.gr> <1347296605.69107.YahooMailNeo@web111410.mail.gq1.yahoo.com> Message-ID: <1347309863.90165.YahooMailNeo@web111409.mail.gq1.yahoo.com> ----- Original Message ----- > From: Thomas Lindgren > >> From: Kostis Sagonas >> >> >> I do not know why Thomas thinks that HiPE should be able to confortably beat > BEAM on this sort of code (care to elaborate?).? From a brief glance it seems to > me that the code spends a lot of time in BIFs written in C (most notably > list_to_tuple/1 and element/2, but also trunc/1, abs/1 and math:sin/1. All of > these are outside the reach of the native code compiler. > > > The regular MD5 algorithm is basically a loop doing lots of integer arithmetic > and bit operations as well as accessing a few arrays. This ought on the face of > it to be quite amenable to native code compilation. I'm amazed that the > implementation Tony used managed?to get trunc/abs/sin into the inner loop, but > that might as you say well explain the problem. After some thinking, it might also be interesting to see the effect of more BIFs getting optimized in Hipe. The result in this case would of course still be unlikely to be competitive with an efficient MD5, but doing so might gain some performance. So, list_to_tuple/1 could expand to an RTL loop, trunc/1 and abs/1 could be expanded to simple code (esp. with a float argument), etc.?(Element/2 already gets optimizer attention but it seems not to help here.) Give the compiler more to work with. Best, Thomas From demeshchuk@REDACTED Mon Sep 10 22:49:08 2012 From: demeshchuk@REDACTED (Dmitry Demeshchuk) Date: Tue, 11 Sep 2012 00:49:08 +0400 Subject: [erlang-questions] Release handler seems to be not starting some applications In-Reply-To: References: Message-ID: Hi, Siri! I figured out that it's not important to start sasl, and it's sufficient just to load it (see the included applications below the started ones). Just to be sure, tried to make an upgrade that doesn't stop or unload sasl, and the system still behaves in the same way. For what it's worth, the occurring error with lager is related to dynamic code compiling (it's basically a copied mochiglobal module). Will try to use the latest Erlang, I've been testing this stuff in R14B04. On Mon, Sep 10, 2012 at 11:58 AM, Siri Hansen wrote: > Hi Dmitry! > I didn't look very closely at this, but I wonder where sasl is? If you are > using the release_handler for upgrade, you need to include sasl in your > releases. > /siri > > 2012/9/8 Dmitry Demeshchuk > >> Okay, that seems like a lager problem, it just doesn't start even after >> starting compiler. >> >> Moreover, it doesn't start using lager:start() and whatever else. No idea >> why compiler isn't started though. >> >> >> On Sat, Sep 8, 2012 at 8:37 PM, Dmitry Demeshchuk wrote: >> >>> Hi, everyone. >>> >>> I've been checking rebar and releases mechanisms and noticed an odd >>> thing. >>> >>> First, I created a dummy release and started it. After that, I added >>> some applications to it, generated a release upgrade and installed it. >>> Surprisingly, some applications haven't started, compiler and lager to be >>> precise. >>> >>> Basically, here was the initial list of applications in reltool.config: >>> >>> kernel, >>> stdlib, >>> rels >>> >>> and here's the one after my upgrade: >>> >>> kernel, >>> stdlib, >>> riak_err, >>> compiler, >>> syntax_tools, >>> lager, >>> rels >>> >>> No errors, no warnings, compiler and lager just silently fail to start, >>> though their starting instructions do exist in relup. Tried to start them >>> manually ? works like a charm. >>> >>> Here's a short exapmle: https://github.com/doubleyou/rels >>> To reproduce, switch to the initial commit, build, generate release. >>> Then switch to the second commit, build, generate release upgrade, install. >>> >>> >>> Any suggestions? >>> >>> -- >>> Best regards, >>> Dmitry Demeshchuk >>> >> >> >> >> -- >> Best regards, >> Dmitry Demeshchuk >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- Best regards, Dmitry Demeshchuk -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Mon Sep 10 23:53:41 2012 From: ok@REDACTED (Richard O'Keefe) Date: Tue, 11 Sep 2012 09:53:41 +1200 Subject: [erlang-questions] Question about implementation In-Reply-To: References: Message-ID: <8D60199A-0F28-4AD3-9394-C63192D22A6A@cs.otago.ac.nz> On 11/09/2012, at 2:27 AM, Max Lapshin wrote: > Will here whole #state{} be deep-copied with new Counter +1 field, No it will be *shallow*-copied. You get a new #state term, but any fields that are not changed will not themselves be copied. > or > it is possible to guess, that here optimization is possible and just > "edit" counter field in existing tuple? > > Is it possible to understand by erlang source code, that State is no > longer referenced anywhere to avod large allocation and free? For the special case of states passed around loops of private functions it ought to be possible to infer that a function argument is not shared but for exported functions it is not possible because it depends on the callers. From emofine@REDACTED Tue Sep 11 02:43:32 2012 From: emofine@REDACTED (Edwin Fine) Date: Mon, 10 Sep 2012 20:43:32 -0400 Subject: [erlang-questions] Release handler seems to be not starting some applications In-Reply-To: References: Message-ID: <504E8934.7070701@gmail.com> I had the same issue. I believe it's due to reltool.config, which you probably generated using rebar create-node. By default rebar generates a reltool config that uses embedded mode and only copies directly-referenced beam files to the release. Since the compiler is never directly referenced, it never copies most of the compiler beams so dynamic compilation gets screwed up. I think I changed it to have {erts, [{mod_cond, all}, {app_file, strip}]} ... {mod_cond, all} You could also consider changing it to use {profile, development}. HTH Ed On 09/10/2012 04:49 PM, Dmitry Demeshchuk wrote: > Hi, Siri! > > I figured out that it's not important to start sasl, and it's > sufficient just to load it (see the included applications below the > started ones). Just to be sure, tried to make an upgrade that doesn't > stop or unload sasl, and the system still behaves in the same way. > > For what it's worth, the occurring error with lager is related to > dynamic code compiling (it's basically a copied mochiglobal module). > > Will try to use the latest Erlang, I've been testing this stuff in R14B04. > > On Mon, Sep 10, 2012 at 11:58 AM, Siri Hansen > wrote: > > Hi Dmitry! > I didn't look very closely at this, but I wonder where sasl is? If > you are using the release_handler for upgrade, you need to include > sasl in your releases. > /siri > > 2012/9/8 Dmitry Demeshchuk > > > Okay, that seems like a lager problem, it just doesn't start > even after starting compiler. > > Moreover, it doesn't start using lager:start() and whatever > else. No idea why compiler isn't started though. > > > On Sat, Sep 8, 2012 at 8:37 PM, Dmitry Demeshchuk > > wrote: > > Hi, everyone. > > I've been checking rebar and releases mechanisms and > noticed an odd thing. > > First, I created a dummy release and started it. After > that, I added some applications to it, generated a release > upgrade and installed it. Surprisingly, some applications > haven't started, compiler and lager to be precise. > > Basically, here was the initial list of applications in > reltool.config: > > kernel, > stdlib, > rels > > and here's the one after my upgrade: > > kernel, > stdlib, > riak_err, > compiler, > syntax_tools, > lager, > rels > > No errors, no warnings, compiler and lager just silently > fail to start, though their starting instructions do exist > in relup. Tried to start them manually -- works like a charm. > > Here's a short exapmle: https://github.com/doubleyou/rels > To reproduce, switch to the initial commit, build, > generate release. Then switch to the second commit, build, > generate release upgrade, install. > > > Any suggestions? > > -- > Best regards, > Dmitry Demeshchuk > > > > > -- > Best regards, > Dmitry Demeshchuk > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > Best regards, > Dmitry Demeshchuk > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony@REDACTED Tue Sep 11 08:57:20 2012 From: tony@REDACTED (Tony Rogvall) Date: Tue, 11 Sep 2012 08:57:20 +0200 Subject: [erlang-questions] native In-Reply-To: <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> Message-ID: <4315172D-A53C-4076-9185-039E238170CB@rogvall.se> On 10 sep 2012, at 14:41, Thomas Lindgren wrote: > >> I started playing with a simple implementation of MD5 (basically straight from the wiki page) >> When the implementation produce the correct output, I did some timing for fun and also >> tried to native compile it. >> To my astonishment I discovered that the code was slower when native compiled. >> I am using R15B01 on mac. Can this be true? And in this case why? >> >> Note that I do not care to optimize the implementation it self! I am more interested why >> the native compiler produce slower code on this example. > > > On my Mac, the best native result 7% is faster than the best beam result. But the timing varies by 20% from run to run, so I think the proper claim is they are about the same. (I also think Hipe ought to comfortably beat Beam on this sort of code.) > Good to know. On my computer all runs I have tried so far has been slower in native compile. I could not believe my eyes. So, everything is good then ? ;-) /Tony > Unfortunately, 'pp_native' gave broken/confusing output so it's hard to trace what happens. The arithmetic looks like it's being inlined, which ought to provide a boost. There are calls to r/1 and rotate/2 in the inner loop (md5_/6) which possibly should have been inlined. > > Best, > Thomas "Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix" -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony@REDACTED Tue Sep 11 09:06:19 2012 From: tony@REDACTED (Tony Rogvall) Date: Tue, 11 Sep 2012 09:06:19 +0200 Subject: [erlang-questions] native In-Reply-To: <1347296605.69107.YahooMailNeo@web111410.mail.gq1.yahoo.com> References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> <504DF3F7.8010108@cs.ntua.gr> <1347296605.69107.YahooMailNeo@web111410.mail.gq1.yahoo.com> Message-ID: On 10 sep 2012, at 19:03, Thomas Lindgren wrote: > > > > > >> ________________________________ >> From: Kostis Sagonas >> >> >> I do not know why Thomas thinks that HiPE should be able to confortably beat BEAM on this sort of code (care to elaborate?). From a brief glance it seems to me that the code spends a lot of time in BIFs written in C (most notably list_to_tuple/1 and element/2, but also trunc/1, abs/1 and math:sin/1. All of these are outside the reach of the native code compiler. > > > The regular MD5 algorithm is basically a loop doing lots of integer arithmetic and bit operations as well as accessing a few arrays. This ought on the face of it to be quite amenable to native code compilation. I'm amazed that the implementation Tony used managed to get trunc/abs/sin into the inner loop, but that might as you say well explain the problem. My goal with this implementation was not speed. I really wanted something simple to look at. erlang:md5 already exists, and there is no point competing with that. I just compiled it native for fun. So do not be amazed! :-) But as shown by kostis and others it looks like it is my computer that behaves badly, I will have a look. Thanks /Tony > >> >>> Unfortunately, 'pp_native' gave broken/confusing output so it's hard to trace what happens. >> >> Well, this happens because the HiPE compiler compiles in parallel by default (!). If you want to see the native code in the non-scrambled version use: >> >> c(md5, [native, {hipe, [no_concurrent_comp, pp_native]}]). > > > Well well, you learn something new every day. > > Best, > Thomas "Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix" -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Tue Sep 11 10:29:34 2012 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Tue, 11 Sep 2012 01:29:34 -0700 (PDT) Subject: [erlang-questions] native In-Reply-To: References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> <504DF3F7.8010108@cs.ntua.gr> <1347296605.69107.YahooMailNeo@web111410.mail.gq1.yahoo.com> Message-ID: <1347352174.36569.YahooMailNeo@web111406.mail.gq1.yahoo.com> >________________________________ > From: Tony Rogvall > >My goal with this implementation was not speed. I really wanted something simple to look at. erlang:md5 already exists, and >there is no point competing with that. I just compiled it native for fun. So do not be amazed! :-) >But as shown by kostis and others it looks like it is my computer that behaves badly, I will have a look. Yeah, so perhaps the right word is not "amazed" but "fooled" :-) Best of luck with your experiments. Best, Thomas From zabrane3@REDACTED Tue Sep 11 10:47:49 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Tue, 11 Sep 2012 10:47:49 +0200 Subject: [erlang-questions] RPC module and erlang:group_leader/0/2 usage Message-ID: <119009DE-E628-42EB-8FAA-83643AF7C205@gmail.com> Hi guys, I'm digging a bit inside the "rpc.erl" module. I found calls to "group_leader/0/2" almost everywhere (rpc:call, rpc:cast, rpc:eval_everywhere etc). What's the purpose of using "group_leader" in this module? Thanks in advance. Regards, Zabrane From bgustavsson@REDACTED Tue Sep 11 12:23:30 2012 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Tue, 11 Sep 2012 12:23:30 +0200 Subject: [erlang-questions] Failure in compiling R15B-2 on mac os x 10.8 (mountain lion) In-Reply-To: <976A27E7-E008-4F0C-A4E4-FF85C29BCD78@kent.ac.uk> References: <976A27E7-E008-4F0C-A4E4-FF85C29BCD78@kent.ac.uk> Message-ID: On Mon, Sep 10, 2012 at 3:16 PM, Simon Thompson wrote: > > Can anyone help? I get this error on compiling erlang on mac os x 10.8 (mountain lion) with makefile built from > > ./configure --enable-darwin-64bit > Works fine for me. One thing that may cause problems is if ERL_TOP is set, but not set to the current working directory, but to some other directory. If that is not the problem, you will have to provide more information. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From s.j.thompson@REDACTED Tue Sep 11 12:38:39 2012 From: s.j.thompson@REDACTED (Simon Thompson) Date: Tue, 11 Sep 2012 11:38:39 +0100 Subject: [erlang-questions] Failure in compiling R15B-2 on mac os x 10.8 (mountain lion) In-Reply-To: References: <976A27E7-E008-4F0C-A4E4-FF85C29BCD78@kent.ac.uk> Message-ID: <15711C13-94EB-410F-83BC-3EC79E028246@kent.ac.uk> Bj?rn, thanks. ERL_TOP isn't set, but ERL_LIBS is (to /usr/local/lib/erlang/lib). I have upgraded to Mountain Lion, and consequently upgraded XCode (and command line utilities) and also macports, so all of those are up to date. I succeeded later with using the Erlang Solutions pkg, so I have a running system, but not one that I can tweak. Thanks for your help. Simon On 11 Sep 2012, at 11:23, Bj?rn Gustavsson wrote: > On Mon, Sep 10, 2012 at 3:16 PM, Simon Thompson wrote: >> >> Can anyone help? I get this error on compiling erlang on mac os x 10.8 (mountain lion) with makefile built from >> >> ./configure --enable-darwin-64bit >> > > Works fine for me. > > One thing that may cause problems is if ERL_TOP is set, > but not set to the current working directory, but to some other > directory. If that is not the problem, you will have to provide > more information. > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB Simon Thompson | Professor of Logic and Computation School of Computing | University of Kent | Canterbury, CT2 7NF, UK s.j.thompson@REDACTED | M +44 7986 085754 | W www.cs.kent.ac.uk/~sjt From desired.mta@REDACTED Tue Sep 11 16:06:56 2012 From: desired.mta@REDACTED (=?UTF-8?Q?Motiejus_Jak=C5=A1tys?=) Date: Tue, 11 Sep 2012 16:06:56 +0200 Subject: [erlang-questions] Cannot make PropEr bitstring(B, U) generator to work Message-ID: Hi, I cannot get bitstring(B, U) to work. Here is a test case: ?FORALL( B, bitstring(8, 1), true ). I get this error when trying to execute it: Error: The typeserver encountered an error: {missing_type,demobucket_prop_eunit,{type,bitstring,2}}. What am I doing wrong? Tested on PropEr v1.0 and v1.0-62-g80c2c73 (latest master). Thanks, Motiejus Jak?tys From kostis@REDACTED Tue Sep 11 16:22:11 2012 From: kostis@REDACTED (Kostis Sagonas) Date: Tue, 11 Sep 2012 16:22:11 +0200 Subject: [erlang-questions] native In-Reply-To: References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> <504DF3F7.8010108@cs.ntua.gr> <1347296605.69107.YahooMailNeo@web111410.mail.gq1.yahoo.com> Message-ID: <504F4913.6020703@cs.ntua.gr> On 09/11/2012 09:06 AM, Tony Rogvall wrote: > > On 10 sep 2012, at 19:03, Thomas Lindgren > wrote: > >>> ________________________________ >>> From: Kostis Sagonas > >>> >>> >>> I do not know why Thomas thinks that HiPE should be able to >>> confortably beat BEAM on this sort of code (care to elaborate?). From >>> a brief glance it seems to me that the code spends a lot of time in >>> BIFs written in C (most notably list_to_tuple/1 and element/2, but >>> also trunc/1, abs/1 and math:sin/1. All of these are outside the >>> reach of the native code compiler. >> >> >> The regular MD5 algorithm is basically a loop doing lots of integer >> arithmetic and bit operations as well as accessing a few arrays. This >> ought on the face of it to be quite amenable to native code >> compilation. I'm amazed that the implementation Tony used managed to >> get trunc/abs/sin into the inner loop, but that might as you say well >> explain the problem. > > My goal with this implementation was not speed. I really wanted > something simple to look at. erlang:md5 already exists, and > there is no point competing with that. I just compiled it native for > fun. So do not be amazed! :-) > But as shown by kostis and others it looks like it is my computer that > behaves badly, I will have a look. I investigated this further. Can it be that your computer runs in 32-bit mode? If so, I can explain what is happening. Kostis From tony@REDACTED Tue Sep 11 16:19:47 2012 From: tony@REDACTED (Tony Rogvall) Date: Tue, 11 Sep 2012 16:19:47 +0200 Subject: [erlang-questions] native In-Reply-To: <504F4913.6020703@cs.ntua.gr> References: <9E30A374-D24D-4AA7-9018-EBDB27F75B57@rogvall.se> <1347280889.75433.YahooMailNeo@web111404.mail.gq1.yahoo.com> <504DF3F7.8010108@cs.ntua.gr> <1347296605.69107.YahooMailNeo@web111410.mail.gq1.yahoo.com> <504F4913.6020703@cs.ntua.gr> Message-ID: <292FAC63-D9C0-49A8-AD0C-E5664E64A375@rogvall.se> On 11 sep 2012, at 16:22, Kostis Sagonas wrote: > On 09/11/2012 09:06 AM, Tony Rogvall wrote: >> >> On 10 sep 2012, at 19:03, Thomas Lindgren > > wrote: >> >>>> ________________________________ >>>> From: Kostis Sagonas > >>>> >>>> >>>> I do not know why Thomas thinks that HiPE should be able to >>>> confortably beat BEAM on this sort of code (care to elaborate?). From >>>> a brief glance it seems to me that the code spends a lot of time in >>>> BIFs written in C (most notably list_to_tuple/1 and element/2, but >>>> also trunc/1, abs/1 and math:sin/1. All of these are outside the >>>> reach of the native code compiler. >>> >>> >>> The regular MD5 algorithm is basically a loop doing lots of integer >>> arithmetic and bit operations as well as accessing a few arrays. This >>> ought on the face of it to be quite amenable to native code >>> compilation. I'm amazed that the implementation Tony used managed to >>> get trunc/abs/sin into the inner loop, but that might as you say well >>> explain the problem. >> >> My goal with this implementation was not speed. I really wanted >> something simple to look at. erlang:md5 already exists, and >> there is no point competing with that. I just compiled it native for >> fun. So do not be amazed! :-) >> But as shown by kostis and others it looks like it is my computer that >> behaves badly, I will have a look. > > I investigated this further. Can it be that your computer runs in 32-bit mode? If so, I can explain what is happening. > Yes. /Tony > Kostis "Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix" -------------- next part -------------- An HTML attachment was scrubbed... URL: From manopapad@REDACTED Tue Sep 11 16:40:41 2012 From: manopapad@REDACTED (Manolis Papadakis) Date: Tue, 11 Sep 2012 17:40:41 +0300 Subject: [erlang-questions] Cannot make PropEr bitstring(B, U) generator to work In-Reply-To: References: Message-ID: <504F4D69.6020901@gmail.com> PropEr first tries to resolve the expression "bitstring(8, 1)" to a generator, but that fails, because bitstring/2 is not a predefined generator, and there's no custom generator with that signature declared inside the module. PropEr then tries to find a type with that name, but that fails as well: bitstring/2 is not a predifined type (the way to express the same thing in the type language is <<_:8,_:_*1>>), and there's no local type with that signature. Quick fix: If you're OK with using only unit values of either 8 or 1, then you can use the predefined generator binary(Base) or bitstring(Base) respectively. If you need other unit values, you'll have to write a custom generator. One might have expected something like the following to work: -type my_bitstring() :: <<_:16, _:_*3>>. prop_foo() -> ?FORALL(B, my_bitstring(), true). But PropEr will currently reject this for unit values other than 1 and 8, because I suck at predicting what features people will want to use, and thought this was a safe one to skip. On 09/11/2012 05:06 PM, Motiejus Jak?tys wrote: > Hi, > > I cannot get bitstring(B, U) to work. Here is a test case: > > ?FORALL( > B, > bitstring(8, 1), > true > ). > > I get this error when trying to execute it: > > Error: The typeserver encountered an error: > {missing_type,demobucket_prop_eunit,{type,bitstring,2}}. > > What am I doing wrong? > > Tested on PropEr v1.0 and v1.0-62-g80c2c73 (latest master). > > Thanks, > Motiejus Jak?tys > From desired.mta@REDACTED Tue Sep 11 17:36:58 2012 From: desired.mta@REDACTED (=?UTF-8?Q?Motiejus_Jak=C5=A1tys?=) Date: Tue, 11 Sep 2012 17:36:58 +0200 Subject: [erlang-questions] Cannot make PropEr bitstring(B, U) generator to work In-Reply-To: <504F4D69.6020901@gmail.com> References: <504F4D69.6020901@gmail.com> Message-ID: On Tue, Sep 11, 2012 at 4:40 PM, Manolis Papadakis wrote: > PropEr first tries to resolve the expression "bitstring(8, 1)" to a > generator, but that fails, because bitstring/2 is not a predefined > generator, and there's no custom generator with that signature declared > inside the module. But... According to the Book of Wisdom[1], bitstring(B, U) is there. And binary(S) is not. I haven't seen it before. > PropEr then tries to find a type with that name, but that fails as well: > bitstring/2 is not a predifined type (the way to express the same thing in > the type language is <<_:8,_:_*1>>), and there's no local type with that > signature. Eh.. That would kinda do, but it raises a syntax error when used in ?FORALL context. > Quick fix: If you're OK with using only unit values of either 8 or 1, then > you can use the predefined generator binary(Base) or bitstring(Base) > respectively. If you need other unit values, you'll have to write a custom > generator. Actually, I want binaries with length 0..1MiB-1: ?LET( Len, ?LET(Len, integer(0, 1 bsl 20 - 1), Len), {binary(Len), Len} ) So for this, binary(Number) is sufficient. > One might have expected something like the following to work: > -type my_bitstring() :: <<_:16, _:_*3>>. > prop_foo() -> ?FORALL(B, my_bitstring(), true). > But PropEr will currently reject this for unit values other than 1 and 8, > because I suck at predicting what features people will want to use, and > thought this was a safe one to skip. As said, I am only interested in full-byte binaries. So it was indeed safe for this case. Until 15 minutes ago how PropEr creates type instances was truly magic for me. Now Eureka! For ones that are curious how it works: x() -> ?FORALL(S, integer(0, 1023), S < 100). translates to: x() -> proper:forall(S, fun(S) -> integer(0, 1023) end)). So we have a closure which tries to execute the nonsense (that's what I thought for more than a year). After a lot of tracing I found out that this closure is executed in context of `proper_types` moduke, which *has* a function integer(Low, High). That's it. That function returnsa a nothing-magic tuple, and is able to proceed. And now answering my question. binary/1 is defined in proper_types. :) All makes sense now. [1]: http://proper.softlab.ntua.gr/papers/proper_types.pdf Regards, Motiejus Jak?tys From manopapad@REDACTED Tue Sep 11 17:57:00 2012 From: manopapad@REDACTED (Manolis Papadakis) Date: Tue, 11 Sep 2012 18:57:00 +0300 Subject: [erlang-questions] Cannot make PropEr bitstring(B, U) generator to work In-Reply-To: References: <504F4D69.6020901@gmail.com> Message-ID: <504F5F4C.8000002@gmail.com> On 09/11/2012 06:36 PM, Motiejus Jak?tys wrote: > On Tue, Sep 11, 2012 at 4:40 PM, Manolis Papadakis wrote: >> PropEr first tries to resolve the expression "bitstring(8, 1)" to a >> generator, but that fails, because bitstring/2 is not a predefined >> generator, and there's no custom generator with that signature declared >> inside the module. > > But... According to the Book of Wisdom[1], bitstring(B, U) is there. You're right, that should be there. Thanks for pointing it out. Crap, now I'll have to find where I've put that code. > And binary(S) is not. I haven't seen it before. Yeah, there's lots of other stuff on the API, mostly convenience functions and the like. You can find them all on the API documentation page [1]. >> PropEr then tries to find a type with that name, but that fails as well: >> bitstring/2 is not a predifined type (the way to express the same thing in >> the type language is <<_:8,_:_*1>>), and there's no local type with that >> signature. > > Eh.. That would kinda do, but it raises a syntax error when used in > ?FORALL context. Unfortunately, many expressions that are valid in a type expression context are invalid Erlang terms, so there's no straightforward way to use them in ?FORALLs directly (that's why my example below uses a custom type as a thin wrapper for the binary type expression). The types-in-place-of-generators feature is definitely a leaky abstraction [2]. >> Quick fix: If you're OK with using only unit values of either 8 or 1, then >> you can use the predefined generator binary(Base) or bitstring(Base) >> respectively. If you need other unit values, you'll have to write a custom >> generator. > > Actually, I want binaries with length 0..1MiB-1: > > ?LET( > Len, > ?LET(Len, integer(0, 1 bsl 20 - 1), Len), > {binary(Len), Len} > ) > > So for this, binary(Number) is sufficient. > >> One might have expected something like the following to work: >> -type my_bitstring() :: <<_:16, _:_*3>>. >> prop_foo() -> ?FORALL(B, my_bitstring(), true). >> But PropEr will currently reject this for unit values other than 1 and 8, >> because I suck at predicting what features people will want to use, and >> thought this was a safe one to skip. > > As said, I am only interested in full-byte binaries. So it was indeed > safe for this case. > > Until 15 minutes ago how PropEr creates type instances was truly magic > for me. Now Eureka! For ones that are curious how it works: > > x() -> > ?FORALL(S, integer(0, 1023), S < 100). > > translates to: > x() -> > proper:forall(S, fun(S) -> integer(0, 1023) end)). > > So we have a closure which tries to execute the nonsense (that's what > I thought for more than a year). > > After a lot of tracing I found out that this closure is executed in > context of `proper_types` moduke, which *has* a function integer(Low, > High). That's it. That function returnsa a nothing-magic tuple, and is > able to proceed. > > And now answering my question. binary/1 is defined in proper_types. :) > All makes sense now. > > [1]: http://proper.softlab.ntua.gr/papers/proper_types.pdf > > Regards, > Motiejus Jak?tys [1] http://proper.softlab.ntua.gr/doc/ [2] http://www.joelonsoftware.com/articles/LeakyAbstractions.html From gugugugu2006@REDACTED Tue Sep 11 18:50:14 2012 From: gugugugu2006@REDACTED (gugu Gugug) Date: Tue, 11 Sep 2012 09:50:14 -0700 (PDT) Subject: [erlang-questions] Creating a license Message-ID: <1347382214.93180.YahooMailClassic@web142403.mail.bf1.yahoo.com> Hi, I would like to create a license option for an application written in Erlang. This license should expire after a certain time and should block the access to the application. How can I do this? Thank you! Ursu -------------- next part -------------- An HTML attachment was scrubbed... URL: From roland.koelbel@REDACTED Tue Sep 11 23:45:18 2012 From: roland.koelbel@REDACTED (Roland) Date: Tue, 11 Sep 2012 23:45:18 +0200 Subject: [erlang-questions] moving process state - copy on write - heap memory increase Message-ID: <504FB0EE.6010208@student.tuwien.ac.at> Hello! I want to move the state of my process to another process. Unfortunately this is not possible without a huge increase in memory consumption as by copying the state the "copy on write semantics" are lost. This behaviour is demonstrated in my attached simplified t_process module. -> {ok, Pid} = t_process:start_link(). -> t_process:bloat(Pid). --> memory consumption of the process is at 6657256 after "bloat" is finished -> t_process:reload_bag(P1). --> memory consumption is at 26295176 (4 times as much) No data has not been modified in any way, the data stays the same. My question is: Despite what i want to do with this state transfer, is there any way to copy the state of a process without losing the "copy on write semantics", so that the target process has the same memory footprint as the original one? Can someone point me to any direction/documentation on how i can get arround this issue? Thank you! -module(t_process). -behaviour(gen_server). -export([start_link/0, init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3, bloat/1, reload_bag/1]). -record(process, {bag = []}). start_link() -> gen_server:start_link(?MODULE, [], []). bloat(Pid) -> gen_server:cast(Pid, bloat). reload_bag(Pid) -> gen_server:call(Pid, reload_bag). init([]) -> {ok, #process{}}. handle_call(reload_bag, _From, State) -> BinaryBag = erlang:term_to_binary(State#process.bag), % simulate state transfer / loss of semantics io:format("Bag size is ~w.", [erlang:size(BinaryBag)]), {reply, ok, State#process{bag = erlang:binary_to_term(BinaryBag)}}; handle_call(_Call, _From, State) -> {reply, ok, State}. handle_cast(bloat, State) -> NewBag = lists:concat([State#process.bag, lists:foldl(fun(_C, List) -> List ++ [{"ABCDEFGHIJKLMNOPQRSTUVWXYZ"}] end, [], lists:seq(1, 50000))]), io:format("Bloating finished."), {noreply, State#process{bag = NewBag}}; handle_cast(_Cast, State) -> {noreply, State}. handle_info(_Info, State) -> {noreply, State}. terminate(_Reason, _State) -> ok. code_change(_OldVsn, State, _Extra) -> {ok, State}. From wallentin.dahlberg@REDACTED Wed Sep 12 03:10:39 2012 From: wallentin.dahlberg@REDACTED (=?ISO-8859-1?Q?Bj=F6rn=2DEgil_Dahlberg?=) Date: Wed, 12 Sep 2012 03:10:39 +0200 Subject: [erlang-questions] moving process state - copy on write - heap memory increase In-Reply-To: <504FB0EE.6010208@student.tuwien.ac.at> References: <504FB0EE.6010208@student.tuwien.ac.at> Message-ID: <8731473372978738325@unknownmsgid> Hi, Sharing within a compounded data term is not preserved on send nor in term to binary. One way to reinstate sharing is to walk through the compounded term and look for sharing (Wind3d uses this trick). Ex. Ls = , {Sh,_} = lists:mapfold(fun(I, T) -> case gb_trees:lookup(I,T) of none -> {I, gb_trees:enter(I,I,T)}; {value, V} -> {V, T} end end, gb_trees:empty(), Ls), Sh. (disclaimer: I am writing code when sleepy and I always forget the mapfold syntax. But you get the idea.) This approach requires some knowledge about the structure of the data to be reshared. It will also temporary increase the total memory while performing the resharing. I'm sure there are other, perhaps much better, approaches as well to this problem. There exists several proposals on preserved sharing on send, but none are currently implemented in the vm. // Bj?rn-Egil Skickat fr?n min iPad 11 sep 2012 kl. 23:45 skrev Roland : > Hello! > > I want to move the state of my process to another process. Unfortunately this is not possible without a huge increase in memory consumption as by copying the state the "copy on write semantics" are lost. > > This behaviour is demonstrated in my attached simplified t_process module. > > -> {ok, Pid} = t_process:start_link(). > -> t_process:bloat(Pid). --> memory consumption of the process is at 6657256 after "bloat" is finished > -> t_process:reload_bag(P1). --> memory consumption is at 26295176 (4 times as much) > > No data has not been modified in any way, the data stays the same. > > My question is: Despite what i want to do with this state transfer, is there any way to copy the state of a process without losing the "copy on write semantics", so that the target process has the same memory footprint as the original one? > > Can someone point me to any direction/documentation on how i can get arround this issue? > > Thank you! > > -module(t_process). > > -behaviour(gen_server). > > -export([start_link/0, init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3, bloat/1, reload_bag/1]). > > -record(process, {bag = []}). > > start_link() -> > gen_server:start_link(?MODULE, [], []). > > bloat(Pid) -> > gen_server:cast(Pid, bloat). > > reload_bag(Pid) -> > gen_server:call(Pid, reload_bag). > > init([]) -> > {ok, #process{}}. > > handle_call(reload_bag, _From, State) -> > BinaryBag = erlang:term_to_binary(State#process.bag), % simulate state transfer / loss of semantics > io:format("Bag size is ~w.", [erlang:size(BinaryBag)]), > {reply, ok, State#process{bag = erlang:binary_to_term(BinaryBag)}}; > > handle_call(_Call, _From, State) -> > {reply, ok, State}. > > handle_cast(bloat, State) -> > NewBag = lists:concat([State#process.bag, lists:foldl(fun(_C, List) -> List ++ [{"ABCDEFGHIJKLMNOPQRSTUVWXYZ"}] end, [], lists:seq(1, 50000))]), > io:format("Bloating finished."), > {noreply, State#process{bag = NewBag}}; > > handle_cast(_Cast, State) -> > {noreply, State}. > > handle_info(_Info, State) -> > {noreply, State}. > > terminate(_Reason, _State) -> > ok. > > code_change(_OldVsn, State, _Extra) -> > {ok, State}. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From gtsiour@REDACTED Wed Sep 12 09:11:48 2012 From: gtsiour@REDACTED (Yiannis Tsiouris) Date: Wed, 12 Sep 2012 10:11:48 +0300 Subject: [erlang-questions] moving process state - copy on write - heap memory increase In-Reply-To: <8731473372978738325@unknownmsgid> References: <504FB0EE.6010208@student.tuwien.ac.at> <8731473372978738325@unknownmsgid> Message-ID: <505035B4.6070400@softlab.ntua.gr> On 09/12/2012 04:10 AM, Bj?rn-Egil Dahlberg wrote: > Hi, > > Sharing within a compounded data term is not preserved on send nor > in term to binary. > > One way to reinstate sharing is to walk through the compounded term > and look for sharing (Wind3d uses this trick). > > Ex. Ls = , {Sh,_} = lists:mapfold(fun(I, T) -> case > gb_trees:lookup(I,T) of none -> {I, gb_trees:enter(I,I,T)}; {value, > V} -> {V, T} end end, gb_trees:empty(), Ls), Sh. > > (disclaimer: I am writing code when sleepy and I always forget the > mapfold syntax. But you get the idea.) > > This approach requires some knowledge about the structure of the > data to be reshared. It will also temporary increase the total memory > while performing the resharing. > > I'm sure there are other, perhaps much better, approaches as well to > this problem. > > There exists several proposals on preserved sharing on send, but > none are currently implemented in the vm. > > // Bj?rn-Egil > > Skickat fr?n min iPad > > 11 sep 2012 kl. 23:45 skrev Roland > : > >> Hello! >> >> I want to move the state of my process to another process. >> Unfortunately this is not possible without a huge increase in >> memory consumption as by copying the state the "copy on write >> semantics" are lost. >> >> This behaviour is demonstrated in my attached simplified t_process >> module. >> >> -> {ok, Pid} = t_process:start_link(). -> t_process:bloat(Pid). --> >> memory consumption of the process is at 6657256 after "bloat" is >> finished -> t_process:reload_bag(P1). --> memory consumption is at >> 26295176 (4 times as much) >> >> No data has not been modified in any way, the data stays the same. >> >> My question is: Despite what i want to do with this state transfer, >> is there any way to copy the state of a process without losing the >> "copy on write semantics", so that the target process has the same >> memory footprint as the original one? >> >> Can someone point me to any direction/documentation on how i can >> get arround this issue? Hi, Actually that's funny because there is some work [1] by Nikos Papaspyrou and Kostis Sagonas that will be presented on Friday the 14th on the Erlang Workshop in Copenhagen! It's an (experimental) implementation of a copy that preserves sharing... Maybe you could take a look at the code in that repo. :-) Best regards, Yiannis [1]: https://github.com/nickie/otp -- Yiannis Tsiouris Ph.D. student, Software Engineering Laboratory, National Technical University of Athens WWW: http://www.softlab.ntua.gr/~gtsiour -------------- next part -------------- An HTML attachment was scrubbed... URL: From olgeni@REDACTED Wed Sep 12 09:24:32 2012 From: olgeni@REDACTED (Jimmy Olgeni) Date: Wed, 12 Sep 2012 09:24:32 +0200 Subject: [erlang-questions] [ANN] elib_gd: Erlang bindings for the GD graphics library In-Reply-To: References: Message-ID: Hi, If you would like to generate graphics from Yaws / WX / etc, you can find some GD bindings here: https://github.com/olgeni/elib_gd Feel free to comment, fork, and contribute :) -- jimmy From ok@REDACTED Wed Sep 12 09:38:14 2012 From: ok@REDACTED (Richard O'Keefe) Date: Wed, 12 Sep 2012 19:38:14 +1200 Subject: [erlang-questions] moving process state - copy on write - heap memory increase In-Reply-To: <504FB0EE.6010208@student.tuwien.ac.at> References: <504FB0EE.6010208@student.tuwien.ac.at> Message-ID: On 12/09/2012, at 9:45 AM, Roland wrote that creating a term with a very great deal of shared subterms and then sending it to another process "unshared" the subterms. There's a comment in his code, "% simulate state transfer / loss of semantics". The problem is that there are *two* levels of semantics for a language like Erlang: - a "value" semantics - a "cost" semantics and subterm sharing is part of the cost semantics but it is NOT part of the value semantics. For example, copy_pairs([{K,V}|Pairs]) -> [{K,V}|copy_pairs(Pairs)]; copy_pairs([]) -> []. is allowed by the value semantics *either* to create new {K,V} pairs *or* to share the old ones, even though they have different cost semantics. (Yes, I know this is a restriction of the identity function.) This is one place where the divergence between the value semantics and the cost semantics is observable. There are more than just stylistic reasons to write copy_pairs([P={_,_}|Pairs]) -> [P|copy_pairs(Pairs)]; copy_pairs([]) -> []. term_to_binary and message sending are additional places where the value and cost semantics diverge. I thought it had always been clear from the Erlang documentation that these things linearise the term they are given. There's a close connection between term copying and (some forms of) garbage collection. Indeed, the first interpreter I ever wrote for a Lisp-like language reused some of the GC code in the copier. I imagine most of us would be very happy with term_to_binary and message sending preserving sharing as long as it didn't slow existing code down more than a percent or two. Not because we _want_ to pass terms with lots of sharing but because it's so much nicer not to have to worry about that. From rapsey@REDACTED Wed Sep 12 09:55:56 2012 From: rapsey@REDACTED (Rapsey) Date: Wed, 12 Sep 2012 09:55:56 +0200 Subject: [erlang-questions] [ANN] elib_gd: Erlang bindings for the GD graphics library In-Reply-To: References: Message-ID: So all processing is done inside the output function, which means it blocks erlang vm. A bit dangerous to run this on a server. Sergej On Wed, Sep 12, 2012 at 9:24 AM, Jimmy Olgeni wrote: > Hi, > > If you would like to generate graphics from Yaws / WX / etc, you can > find some GD bindings here: > > https://github.com/olgeni/elib_gd > > Feel free to comment, fork, and contribute :) > > -- > jimmy > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Wed Sep 12 09:56:19 2012 From: ok@REDACTED (Richard O'Keefe) Date: Wed, 12 Sep 2012 19:56:19 +1200 Subject: [erlang-questions] Style wars: junk comments Message-ID: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> I was looking at some Erlang code today, and it had comments like % Include files % External exports % Internal exports % Macros % Records % External functions % Internal functions only bulked up, and present even when the sections were empty. I take the definition of a "junk comment" to be "a comment that repeats something immediately obvious from the adjacent code". I can tell an include because it starts with -include an export because it starts with -export a macro because it starts with -defined a record because it starts with -record a function because it does not start with - so most of these are technically junk comments. In fact they remind most unpleasantly of COBOL (IDENTIFICATION DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic Pascal's rigid (label; const; type; var; procedure; begin) ordering. In fact this ordering strikes me as pernicious in a very very similar way. Suppose for example I have a sliding window module in which there is %------------------------ % Purging %------------------------ purge(Window) -> ... and this function uses a number of helper functions and macros that are not used in other parts of the file. I want to put them *here*, close by the function(s) needing them, not to rip them away from their context just because some boilerplate comment says so. In fact I had been thinking about proposing a conventional use of an attribute: -section(creating). -section(adding). -section(purging). -section(testing). -section(formatting). This is something that is already allowed by Erlang syntax, so there is no actual language change. The proposal is to use _this_ attribute for _this_ purpose: *semantic* sectioning. Yes, the debt to the Smalltalk 4-pane browser and its "method categories" *is* pretty obvious, isn't it? The function of the -section attribute is to provide something a text editor can set automatic bookmarks from or at least let you search for, that _cannot_ be trivially determined from the source code. Have I missed an important benefit of the rigid syntactic ordering? While I'm at it, why don't other people sort their export lists into alphabetic order? function and its supporte From daniel@REDACTED Wed Sep 12 10:26:12 2012 From: daniel@REDACTED (Daniel Eliasson) Date: Wed, 12 Sep 2012 10:26:12 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> Message-ID: I've seen comments beginning with %%%_* that I believe are used as a tag for some kind of text folding mode in Emacs. I also don't get why people wouldn't sort their export lists alphabetically. On 12 September 2012 09:56, Richard O'Keefe wrote: > I was looking at some Erlang code today, > and it had comments like > > % Include files > % External exports > % Internal exports > % Macros > % Records > % External functions > % Internal functions > > only bulked up, and present even when the sections were empty. > > I take the definition of a "junk comment" to be > "a comment that repeats something immediately obvious > from the adjacent code". > > I can tell > an include because it starts with -include > an export because it starts with -export > a macro because it starts with -defined > a record because it starts with -record > a function because it does not start with - > so most of these are technically junk comments. > > In fact they remind most unpleasantly of COBOL (IDENTIFICATION > DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic Pascal's > rigid (label; const; type; var; procedure; begin) ordering. > > In fact this ordering strikes me as pernicious in a very very > similar way. Suppose for example I have a sliding window module > in which there is > > %------------------------ > % Purging > %------------------------ > > purge(Window) -> ... > > and this function uses a number of helper functions and macros > that are not used in other parts of the file. I want to put > them *here*, close by the function(s) needing them, not to rip > them away from their context just because some boilerplate comment > says so. > > In fact I had been thinking about proposing a conventional use > of an attribute: > > -section(creating). > -section(adding). > -section(purging). > -section(testing). > -section(formatting). > > This is something that is already allowed by Erlang syntax, so there > is no actual language change. The proposal is to use _this_ attribute > for _this_ purpose: *semantic* sectioning. > > Yes, the debt to the Smalltalk 4-pane browser and its "method > categories" *is* pretty obvious, isn't it? > > The function of the -section attribute is to provide something a > text editor can set automatic bookmarks from or at least let you > search for, that _cannot_ be trivially determined from the source > code. > > Have I missed an important benefit of the rigid syntactic ordering? > > While I'm at it, why don't other people sort their export lists into > alphabetic order? > > function and its supporte > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From desired.mta@REDACTED Wed Sep 12 10:27:21 2012 From: desired.mta@REDACTED (=?UTF-8?Q?Motiejus_Jak=C5=A1tys?=) Date: Wed, 12 Sep 2012 10:27:21 +0200 Subject: [erlang-questions] PropEr: integer/2 not generating numbers uniformly Message-ID: Hi, ?FORALL( I, integer(- 1 bsl 100, 1 bsl 100), begin Pid ! {instance, I}, true end ). collect() -> collects all numbers, computes min/max and displays them. I am expecting numbers distributed between -1267650600228229401496703205376 to 1267650600228229401496703205376. For 10k tests: Min: -1135, Max: 761 Min: -2254, Max: 2506 Min: -1510, Max: 734 Min: -955, Max: 1669 Min: -1531, Max: 902 For 100k tests: Min: -2895, Max: 5668 Min: -2479, Max: 5553 Min: -6423, Max: 2378 Is there a fundamental reason for this behaviour? What would be best way to create a generator that spans much wider ranges? Thanks, Motiejus Jak?tys From ivan@REDACTED Wed Sep 12 10:33:36 2012 From: ivan@REDACTED (Ivan Uemlianin) Date: Wed, 12 Sep 2012 09:33:36 +0100 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> Message-ID: <505048E0.2070304@llaisdy.com> I agree. The emacs gen_server skeleton has things like: %%%=================================================================== %%% API %%%=================================================================== ... %%%=================================================================== %%% Internal functions %%%=================================================================== (note 70 chars wide) It's as if they're section headings at the top of a page in a book. > -section(creating). > ... > The function of the -section attribute is to provide something a > text editor can set automatic bookmarks from or at least let you > search for, that _cannot_ be trivially determined from the source > code. A section attribute would be perfect. If required emacs erlang-mode could give it a (70 char wide) tastefully coloured highlight. Ivan On 12/09/2012 08:56, Richard O'Keefe wrote: > I was looking at some Erlang code today, > and it had comments like > > % Include files > % External exports > % Internal exports > % Macros > % Records > % External functions > % Internal functions > > only bulked up, and present even when the sections were empty. > > I take the definition of a "junk comment" to be > "a comment that repeats something immediately obvious > from the adjacent code". > > I can tell > an include because it starts with -include > an export because it starts with -export > a macro because it starts with -defined > a record because it starts with -record > a function because it does not start with - > so most of these are technically junk comments. > > In fact they remind most unpleasantly of COBOL (IDENTIFICATION > DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic Pascal's > rigid (label; const; type; var; procedure; begin) ordering. > > In fact this ordering strikes me as pernicious in a very very > similar way. Suppose for example I have a sliding window module > in which there is > > %------------------------ > % Purging > %------------------------ > > purge(Window) -> ... > > and this function uses a number of helper functions and macros > that are not used in other parts of the file. I want to put > them *here*, close by the function(s) needing them, not to rip > them away from their context just because some boilerplate comment > says so. > > In fact I had been thinking about proposing a conventional use > of an attribute: > > -section(creating). > -section(adding). > -section(purging). > -section(testing). > -section(formatting). > > This is something that is already allowed by Erlang syntax, so there > is no actual language change. The proposal is to use _this_ attribute > for _this_ purpose: *semantic* sectioning. > > Yes, the debt to the Smalltalk 4-pane browser and its "method > categories" *is* pretty obvious, isn't it? > > The function of the -section attribute is to provide something a > text editor can set automatic bookmarks from or at least let you > search for, that _cannot_ be trivially determined from the source > code. > > Have I missed an important benefit of the rigid syntactic ordering? > > While I'm at it, why don't other people sort their export lists into > alphabetic order? > > function and its supporte > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- ============================================================ Ivan A. Uemlianin PhD Llaisdy Speech Technology Research and Development ivan@REDACTED www.llaisdy.com llaisdy.wordpress.com github.com/llaisdy www.linkedin.com/in/ivanuemlianin "hilaritas excessum habere nequit" (Spinoza, Ethica, IV, XLII) ============================================================ From bengt.kleberg@REDACTED Wed Sep 12 10:42:08 2012 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 12 Sep 2012 10:42:08 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> Message-ID: <1347439329.5588.21.camel@seasc0057> If you expect your code to be read/reviewed when printed, you should have the functions alphabetically ordered. Grouping exported/internal functions also help the reviewers. bengt On Wed, 2012-09-12 at 10:26 +0200, Daniel Eliasson wrote: > I've seen comments beginning with %%%_* that I believe are used as a > tag for some kind of text folding mode in Emacs. > > I also don't get why people wouldn't sort their export lists alphabetically. > > On 12 September 2012 09:56, Richard O'Keefe wrote: > > I was looking at some Erlang code today, > > and it had comments like > > > > % Include files > > % External exports > > % Internal exports > > % Macros > > % Records > > % External functions > > % Internal functions > > > > only bulked up, and present even when the sections were empty. > > > > I take the definition of a "junk comment" to be > > "a comment that repeats something immediately obvious > > from the adjacent code". > > > > I can tell > > an include because it starts with -include > > an export because it starts with -export > > a macro because it starts with -defined > > a record because it starts with -record > > a function because it does not start with - > > so most of these are technically junk comments. > > > > In fact they remind most unpleasantly of COBOL (IDENTIFICATION > > DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic Pascal's > > rigid (label; const; type; var; procedure; begin) ordering. > > > > In fact this ordering strikes me as pernicious in a very very > > similar way. Suppose for example I have a sliding window module > > in which there is > > > > %------------------------ > > % Purging > > %------------------------ > > > > purge(Window) -> ... > > > > and this function uses a number of helper functions and macros > > that are not used in other parts of the file. I want to put > > them *here*, close by the function(s) needing them, not to rip > > them away from their context just because some boilerplate comment > > says so. > > > > In fact I had been thinking about proposing a conventional use > > of an attribute: > > > > -section(creating). > > -section(adding). > > -section(purging). > > -section(testing). > > -section(formatting). > > > > This is something that is already allowed by Erlang syntax, so there > > is no actual language change. The proposal is to use _this_ attribute > > for _this_ purpose: *semantic* sectioning. > > > > Yes, the debt to the Smalltalk 4-pane browser and its "method > > categories" *is* pretty obvious, isn't it? > > > > The function of the -section attribute is to provide something a > > text editor can set automatic bookmarks from or at least let you > > search for, that _cannot_ be trivially determined from the source > > code. > > > > Have I missed an important benefit of the rigid syntactic ordering? > > > > While I'm at it, why don't other people sort their export lists into > > alphabetic order? > > > > function and its supporte > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From nick@REDACTED Wed Sep 12 10:45:59 2012 From: nick@REDACTED (Niclas Eklund) Date: Wed, 12 Sep 2012 10:45:59 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <505048E0.2070304@llaisdy.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <505048E0.2070304@llaisdy.com> Message-ID: <50504BC7.4040303@tail-f.com> On 09/12/2012 10:33 AM, Ivan Uemlianin wrote: > I agree. > > The emacs gen_server skeleton has things like: > > %%%=================================================================== > %%% Internal functions > %%%=================================================================== > > (note 70 chars wide) > > It's as if they're section headings at the top of a page in a book. > Would you prefer 80 chars? Must the IBM punch card still haunt us?! ;-) http://programmers.stackexchange.com/questions/148677/why-is-80-characters-the-standard-limit-for-code-width /Nick From ttmrichter@REDACTED Wed Sep 12 10:57:11 2012 From: ttmrichter@REDACTED (Michael Richter) Date: Wed, 12 Sep 2012 16:57:11 +0800 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> Message-ID: On 12 September 2012 15:56, Richard O'Keefe wrote: > % Include files > % External exports > % Internal exports > % Macros > % Records > % External functions > % Internal functions > > only bulked up, and present even when the sections were empty. > ? > I can tell > an include because it starts with -include > an export because it starts with -export > a macro because it starts with -defined > a record because it starts with -record > a function because it does not start with - > Can you tell this while quickly scanning over the code? Can you tell this while page-flipping like a madman in your text editor because you're looking for a particular section of your code? The "bulked up" section that you omitted is, if I guess correctly, something like this: %================================================== And the fact, if I'm correct, that you think of this as "bulking up" is you gloriously missing the entire *point* of heading-style comments: they help you quickly locate particular sections of code, or particular functions or whatnot by calling attention to themselves. Personally, when I'm handed code to maintain that has no such navigation aids, I grit my teeth, say a few very unpleasant things about the parentage of the person who wrote it under my breath and then spend the next little while adding those navigation aids myself. -- "Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot." --Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anders@REDACTED Wed Sep 12 10:58:05 2012 From: anders@REDACTED (Anders Dahlin) Date: Wed, 12 Sep 2012 10:58:05 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <50504BC7.4040303@tail-f.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <505048E0.2070304@llaisdy.com> <50504BC7.4040303@tail-f.com> Message-ID: <50504E9D.40508@dahlinenergy.se> On 2012-09-12 10:45, Niclas Eklund wrote: > On 09/12/2012 10:33 AM, Ivan Uemlianin wrote: >> I agree. >> >> The emacs gen_server skeleton has things like: >> >> %%%=================================================================== >> %%% Internal functions >> %%%=================================================================== >> >> (note 70 chars wide) >> >> It's as if they're section headings at the top of a page in a book. >> > > Would you prefer 80 chars? Must the IBM punch card still haunt us?! ;-) > > http://programmers.stackexchange.com/questions/148677/why-is-80-characters-the-standard-limit-for-code-width ;; Set the length of the skeleton separators. (setq erlang-skel-separator-length 42) /A From ivan@REDACTED Wed Sep 12 11:01:30 2012 From: ivan@REDACTED (Ivan Uemlianin) Date: Wed, 12 Sep 2012 10:01:30 +0100 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <50504E9D.40508@dahlinenergy.se> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <505048E0.2070304@llaisdy.com> <50504BC7.4040303@tail-f.com> <50504E9D.40508@dahlinenergy.se> Message-ID: <50504F6A.3070009@llaisdy.com> On 12/09/2012 09:58, Anders Dahlin wrote: > On 2012-09-12 10:45, Niclas Eklund wrote: >> On 09/12/2012 10:33 AM, Ivan Uemlianin wrote: >>> I agree. >>> >>> The emacs gen_server skeleton has things like: >>> >>> %%%=================================================================== >>> %%% Internal functions >>> %%%=================================================================== >>> >>> (note 70 chars wide) >>> >>> It's as if they're section headings at the top of a page in a book. >>> >> >> Would you prefer 80 chars? Must the IBM punch card still haunt us?! ;-) >> >> http://programmers.stackexchange.com/questions/148677/why-is-80-characters-the-standard-limit-for-code-width > > ;; Set the length of the skeleton separators. > (setq erlang-skel-separator-length 42) > > /A Ha! I should have known. -- ============================================================ Ivan A. Uemlianin PhD Llaisdy Speech Technology Research and Development ivan@REDACTED www.llaisdy.com llaisdy.wordpress.com github.com/llaisdy www.linkedin.com/in/ivanuemlianin "hilaritas excessum habere nequit" (Spinoza, Ethica, IV, XLII) ============================================================ From valentin@REDACTED Wed Sep 12 11:00:26 2012 From: valentin@REDACTED (Valentin Micic) Date: Wed, 12 Sep 2012 11:00:26 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <1347439329.5588.21.camel@seasc0057> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> Message-ID: I can understand that if you know what you're looking for (and just want to check, say, function signature), then the alphabetic ordering may help. However, if one wants to find out what is particular module doing/responsible for, I would really like to learn how can alphabetic ordering help. And if this turns to be useful, well, why not go the whole hog and order code alphabetically as well ;-) V/ On 12 Sep 2012, at 10:42 AM, Bengt Kleberg wrote: > If you expect your code to be read/reviewed when printed, you should > have the functions alphabetically ordered. > Grouping exported/internal functions also help the reviewers. > > > bengt > > On Wed, 2012-09-12 at 10:26 +0200, Daniel Eliasson wrote: >> I've seen comments beginning with %%%_* that I believe are used as a >> tag for some kind of text folding mode in Emacs. >> >> I also don't get why people wouldn't sort their export lists alphabetically. >> >> On 12 September 2012 09:56, Richard O'Keefe wrote: >>> I was looking at some Erlang code today, >>> and it had comments like >>> >>> % Include files >>> % External exports >>> % Internal exports >>> % Macros >>> % Records >>> % External functions >>> % Internal functions >>> >>> only bulked up, and present even when the sections were empty. >>> >>> I take the definition of a "junk comment" to be >>> "a comment that repeats something immediately obvious >>> from the adjacent code". >>> >>> I can tell >>> an include because it starts with -include >>> an export because it starts with -export >>> a macro because it starts with -defined >>> a record because it starts with -record >>> a function because it does not start with - >>> so most of these are technically junk comments. >>> >>> In fact they remind most unpleasantly of COBOL (IDENTIFICATION >>> DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic Pascal's >>> rigid (label; const; type; var; procedure; begin) ordering. >>> >>> In fact this ordering strikes me as pernicious in a very very >>> similar way. Suppose for example I have a sliding window module >>> in which there is >>> >>> %------------------------ >>> % Purging >>> %------------------------ >>> >>> purge(Window) -> ... >>> >>> and this function uses a number of helper functions and macros >>> that are not used in other parts of the file. I want to put >>> them *here*, close by the function(s) needing them, not to rip >>> them away from their context just because some boilerplate comment >>> says so. >>> >>> In fact I had been thinking about proposing a conventional use >>> of an attribute: >>> >>> -section(creating). >>> -section(adding). >>> -section(purging). >>> -section(testing). >>> -section(formatting). >>> >>> This is something that is already allowed by Erlang syntax, so there >>> is no actual language change. The proposal is to use _this_ attribute >>> for _this_ purpose: *semantic* sectioning. >>> >>> Yes, the debt to the Smalltalk 4-pane browser and its "method >>> categories" *is* pretty obvious, isn't it? >>> >>> The function of the -section attribute is to provide something a >>> text editor can set automatic bookmarks from or at least let you >>> search for, that _cannot_ be trivially determined from the source >>> code. >>> >>> Have I missed an important benefit of the rigid syntactic ordering? >>> >>> While I'm at it, why don't other people sort their export lists into >>> alphabetic order? >>> >>> function and its supporte >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From ivan@REDACTED Wed Sep 12 11:12:09 2012 From: ivan@REDACTED (Ivan Uemlianin) Date: Wed, 12 Sep 2012 10:12:09 +0100 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> Message-ID: <505051E9.1090206@llaisdy.com> If you are reading code on paper, it helps if functions are positioned predictably in the stack of paper. Alphabetic ordering of functions and grouping functions into sections are two good ways of doing this. > ... if one wants to find out what is particular module > doing/responsible for, ... In this case all you should need to do is read the api or exported functions section. On 12/09/2012 10:00, Valentin Micic wrote: > I can understand that if you know what you're looking for (and just want to check, say, function signature), then the alphabetic ordering may help. > However, if one wants to find out what is particular module doing/responsible for, I would really like to learn how can alphabetic ordering help. > And if this turns to be useful, well, why not go the whole hog and order code alphabetically as well ;-) > > V/ > > On 12 Sep 2012, at 10:42 AM, Bengt Kleberg wrote: > >> If you expect your code to be read/reviewed when printed, you should >> have the functions alphabetically ordered. >> Grouping exported/internal functions also help the reviewers. >> >> >> bengt >> >> On Wed, 2012-09-12 at 10:26 +0200, Daniel Eliasson wrote: >>> I've seen comments beginning with %%%_* that I believe are used as a >>> tag for some kind of text folding mode in Emacs. >>> >>> I also don't get why people wouldn't sort their export lists alphabetically. >>> >>> On 12 September 2012 09:56, Richard O'Keefe wrote: >>>> I was looking at some Erlang code today, >>>> and it had comments like >>>> >>>> % Include files >>>> % External exports >>>> % Internal exports >>>> % Macros >>>> % Records >>>> % External functions >>>> % Internal functions >>>> >>>> only bulked up, and present even when the sections were empty. >>>> >>>> I take the definition of a "junk comment" to be >>>> "a comment that repeats something immediately obvious >>>> from the adjacent code". >>>> >>>> I can tell >>>> an include because it starts with -include >>>> an export because it starts with -export >>>> a macro because it starts with -defined >>>> a record because it starts with -record >>>> a function because it does not start with - >>>> so most of these are technically junk comments. >>>> >>>> In fact they remind most unpleasantly of COBOL (IDENTIFICATION >>>> DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic Pascal's >>>> rigid (label; const; type; var; procedure; begin) ordering. >>>> >>>> In fact this ordering strikes me as pernicious in a very very >>>> similar way. Suppose for example I have a sliding window module >>>> in which there is >>>> >>>> %------------------------ >>>> % Purging >>>> %------------------------ >>>> >>>> purge(Window) -> ... >>>> >>>> and this function uses a number of helper functions and macros >>>> that are not used in other parts of the file. I want to put >>>> them *here*, close by the function(s) needing them, not to rip >>>> them away from their context just because some boilerplate comment >>>> says so. >>>> >>>> In fact I had been thinking about proposing a conventional use >>>> of an attribute: >>>> >>>> -section(creating). >>>> -section(adding). >>>> -section(purging). >>>> -section(testing). >>>> -section(formatting). >>>> >>>> This is something that is already allowed by Erlang syntax, so there >>>> is no actual language change. The proposal is to use _this_ attribute >>>> for _this_ purpose: *semantic* sectioning. >>>> >>>> Yes, the debt to the Smalltalk 4-pane browser and its "method >>>> categories" *is* pretty obvious, isn't it? >>>> >>>> The function of the -section attribute is to provide something a >>>> text editor can set automatic bookmarks from or at least let you >>>> search for, that _cannot_ be trivially determined from the source >>>> code. >>>> >>>> Have I missed an important benefit of the rigid syntactic ordering? >>>> >>>> While I'm at it, why don't other people sort their export lists into >>>> alphabetic order? >>>> >>>> function and its supporte >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- ============================================================ Ivan A. Uemlianin PhD Llaisdy Speech Technology Research and Development ivan@REDACTED www.llaisdy.com llaisdy.wordpress.com github.com/llaisdy www.linkedin.com/in/ivanuemlianin "hilaritas excessum habere nequit" (Spinoza, Ethica, IV, XLII) ============================================================ From bengt.kleberg@REDACTED Wed Sep 12 11:14:05 2012 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 12 Sep 2012 11:14:05 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> Message-ID: <1347441245.5588.30.camel@seasc0057> When trying to "find out what is particular module doing/responsible for", on paper, it helps if you can find things. When reading on paper it is easier to find things when they are alphabetically ordered. OK? Not OK? bengt On Wed, 2012-09-12 at 11:00 +0200, Valentin Micic wrote: > I can understand that if you know what you're looking for (and just want to check, say, function signature), then the alphabetic ordering may help. > However, if one wants to find out what is particular module doing/responsible for, I would really like to learn how can alphabetic ordering help. > And if this turns to be useful, well, why not go the whole hog and order code alphabetically as well ;-) > > V/ > > On 12 Sep 2012, at 10:42 AM, Bengt Kleberg wrote: > > > If you expect your code to be read/reviewed when printed, you should > > have the functions alphabetically ordered. > > Grouping exported/internal functions also help the reviewers. > > > > > > bengt > > > > On Wed, 2012-09-12 at 10:26 +0200, Daniel Eliasson wrote: > >> I've seen comments beginning with %%%_* that I believe are used as a > >> tag for some kind of text folding mode in Emacs. > >> > >> I also don't get why people wouldn't sort their export lists alphabetically. > >> > >> On 12 September 2012 09:56, Richard O'Keefe wrote: > >>> I was looking at some Erlang code today, > >>> and it had comments like > >>> > >>> % Include files > >>> % External exports > >>> % Internal exports > >>> % Macros > >>> % Records > >>> % External functions > >>> % Internal functions > >>> > >>> only bulked up, and present even when the sections were empty. > >>> > >>> I take the definition of a "junk comment" to be > >>> "a comment that repeats something immediately obvious > >>> from the adjacent code". > >>> > >>> I can tell > >>> an include because it starts with -include > >>> an export because it starts with -export > >>> a macro because it starts with -defined > >>> a record because it starts with -record > >>> a function because it does not start with - > >>> so most of these are technically junk comments. > >>> > >>> In fact they remind most unpleasantly of COBOL (IDENTIFICATION > >>> DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic Pascal's > >>> rigid (label; const; type; var; procedure; begin) ordering. > >>> > >>> In fact this ordering strikes me as pernicious in a very very > >>> similar way. Suppose for example I have a sliding window module > >>> in which there is > >>> > >>> %------------------------ > >>> % Purging > >>> %------------------------ > >>> > >>> purge(Window) -> ... > >>> > >>> and this function uses a number of helper functions and macros > >>> that are not used in other parts of the file. I want to put > >>> them *here*, close by the function(s) needing them, not to rip > >>> them away from their context just because some boilerplate comment > >>> says so. > >>> > >>> In fact I had been thinking about proposing a conventional use > >>> of an attribute: > >>> > >>> -section(creating). > >>> -section(adding). > >>> -section(purging). > >>> -section(testing). > >>> -section(formatting). > >>> > >>> This is something that is already allowed by Erlang syntax, so there > >>> is no actual language change. The proposal is to use _this_ attribute > >>> for _this_ purpose: *semantic* sectioning. > >>> > >>> Yes, the debt to the Smalltalk 4-pane browser and its "method > >>> categories" *is* pretty obvious, isn't it? > >>> > >>> The function of the -section attribute is to provide something a > >>> text editor can set automatic bookmarks from or at least let you > >>> search for, that _cannot_ be trivially determined from the source > >>> code. > >>> > >>> Have I missed an important benefit of the rigid syntactic ordering? > >>> > >>> While I'm at it, why don't other people sort their export lists into > >>> alphabetic order? > >>> > >>> function and its supporte > >>> > >>> _______________________________________________ > >>> erlang-questions mailing list > >>> erlang-questions@REDACTED > >>> http://erlang.org/mailman/listinfo/erlang-questions > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > From n.oxyde@REDACTED Wed Sep 12 11:14:02 2012 From: n.oxyde@REDACTED (Anthony Ramine) Date: Wed, 12 Sep 2012 11:14:02 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> Message-ID: <90E5CF3F-321D-4A0A-8ADF-964A1F82705D@gmail.com> Hi, Unfortunately, attributes other than -record, -opaque, -type and -spec are forbidden after the first function form. See erl_lint:function_state/2. Regards, -- Anthony Ramine Le 12 sept. 2012 ? 09:56, "Richard O'Keefe" a ?crit : > This is something that is already allowed by Erlang syntax, so there > is no actual language change. The proposal is to use _this_ attribute > for _this_ purpose: *semantic* sectioning. From yousuke.hara@REDACTED Wed Sep 12 11:16:40 2012 From: yousuke.hara@REDACTED (Yousuke Hara) Date: Wed, 12 Sep 2012 18:16:40 +0900 Subject: [erlang-questions] [ANN] LeoFS v0.10.1 (S3 Compatible Storage) Message-ID: Hello, We have released LeoFS v0.10.1. In this version, LeoFS's performance improved 20% up. LeoFS is S3-compatible cloud storage system (Object Storage) with Erlang. LeoFS's Web pages: - LeoFS Site - - LeoFS Repository: libs: - LeoFS Document - LeoFS v0.10.1 was improved and fixed as follows: * Improve leo_hex performances * "binary_to_hex" function * Related libs: * leo_gateway * leo_object_storage * leo_redundant_manager * By these correspondences, LeoFS's performance improved 20% up. * Improve leo_manager * Format of output from manager-console * Commands: * "status" * "whereis" * Improve performance of "storage-stats" in manager-console * Fix bugs * A handling error in "S3-libs" if you are interested in our project, Please feel free to contact me (or us) anytime. Thank you, LeoFS lead developer Yosuke Hara (Tokyo, Japan) From ok@REDACTED Wed Sep 12 11:18:27 2012 From: ok@REDACTED (ok@REDACTED) Date: Wed, 12 Sep 2012 21:18:27 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <50504BC7.4040303@tail-f.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <505048E0.2070304@llaisdy.com> <50504BC7.4040303@tail-f.com> Message-ID: > On 09/12/2012 10:33 AM, Ivan Uemlianin wrote: > Would you prefer 80 chars? Must the IBM punch card still haunt us?! ;-) You're right. 80 characters is too wide for readability. We should probably take 72 or 65 as the default. I would point out that I have actually used an IBM 96-column keypunch that produced these cute little 96-column cards. Just because it's an IBM punched card never did mean it's 80 columns. (The really amusing thing, considering these came from IBM, is that they used the ASCII code.) However, it's worth asking why the 80 column card became a standard, and what the standard actually was. The actual standard for programming commonly involved an 8 character sequence number on the right (or a differently sized sequence number on the left for COBOL) so the *actual* text width was typically 72 characters, which was rather better for readability. (I have a colleague who thinks there is nothing wrong with 300-character lines. Needless to say, I have never been able to read his otherwise superb code.) From olopierpa@REDACTED Wed Sep 12 11:18:39 2012 From: olopierpa@REDACTED (Pierpaolo Bernardi) Date: Wed, 12 Sep 2012 11:18:39 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <505051E9.1090206@llaisdy.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <505051E9.1090206@llaisdy.com> Message-ID: On Wed, Sep 12, 2012 at 11:12 AM, Ivan Uemlianin wrote: > If you are reading code on paper, it helps if functions are positioned > predictably in the stack of paper. Alphabetic ordering of functions and > grouping functions into sections are two good ways of doing this. "Reading code on paper" has already been mentioned some times in this thread. But really people read code on paper, nowadays? (Except illustrative code in books, of course). P. From michael.eugene.turner@REDACTED Wed Sep 12 11:20:24 2012 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Wed, 12 Sep 2012 18:20:24 +0900 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <505051E9.1090206@llaisdy.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <505051E9.1090206@llaisdy.com> Message-ID: On Wed, Sep 12, 2012 at 6:12 PM, Ivan Uemlianin wrote: > If you are reading code on paper, it helps if functions are positioned > predictably in the stack of paper. [snip] And COBOL's DIVISIONs made sense when you could get color-coded pre-punched DIVISION cards in the keypunch rooms, to save time typing and to help you see, from the top of the deck, which division was which. Also good back when a COBOL compiler might have five-to-eight passes, on a machine with 4K instruction space: you could write a customer parser for each pass. Just saying. ^_~ -michael turner > On 12/09/2012 10:00, Valentin Micic wrote: >> >> I can understand that if you know what you're looking for (and just want >> to check, say, function signature), then the alphabetic ordering may help. >> However, if one wants to find out what is particular module >> doing/responsible for, I would really like to learn how can alphabetic >> ordering help. >> And if this turns to be useful, well, why not go the whole hog and order >> code alphabetically as well ;-) >> >> V/ >> >> On 12 Sep 2012, at 10:42 AM, Bengt Kleberg wrote: >> >>> If you expect your code to be read/reviewed when printed, you should >>> have the functions alphabetically ordered. >>> Grouping exported/internal functions also help the reviewers. >>> >>> >>> bengt >>> >>> On Wed, 2012-09-12 at 10:26 +0200, Daniel Eliasson wrote: >>>> >>>> I've seen comments beginning with %%%_* that I believe are used as a >>>> tag for some kind of text folding mode in Emacs. >>>> >>>> I also don't get why people wouldn't sort their export lists >>>> alphabetically. >>>> >>>> On 12 September 2012 09:56, Richard O'Keefe wrote: >>>>> >>>>> I was looking at some Erlang code today, >>>>> and it had comments like >>>>> >>>>> % Include files >>>>> % External exports >>>>> % Internal exports >>>>> % Macros >>>>> % Records >>>>> % External functions >>>>> % Internal functions >>>>> >>>>> only bulked up, and present even when the sections were empty. >>>>> >>>>> I take the definition of a "junk comment" to be >>>>> "a comment that repeats something immediately obvious >>>>> from the adjacent code". >>>>> >>>>> I can tell >>>>> an include because it starts with -include >>>>> an export because it starts with -export >>>>> a macro because it starts with -defined >>>>> a record because it starts with -record >>>>> a function because it does not start with - >>>>> so most of these are technically junk comments. >>>>> >>>>> In fact they remind most unpleasantly of COBOL (IDENTIFICATION >>>>> DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic Pascal's >>>>> rigid (label; const; type; var; procedure; begin) ordering. >>>>> >>>>> In fact this ordering strikes me as pernicious in a very very >>>>> similar way. Suppose for example I have a sliding window module >>>>> in which there is >>>>> >>>>> %------------------------ >>>>> % Purging >>>>> %------------------------ >>>>> >>>>> purge(Window) -> ... >>>>> >>>>> and this function uses a number of helper functions and macros >>>>> that are not used in other parts of the file. I want to put >>>>> them *here*, close by the function(s) needing them, not to rip >>>>> them away from their context just because some boilerplate comment >>>>> says so. >>>>> >>>>> In fact I had been thinking about proposing a conventional use >>>>> of an attribute: >>>>> >>>>> -section(creating). >>>>> -section(adding). >>>>> -section(purging). >>>>> -section(testing). >>>>> -section(formatting). >>>>> >>>>> This is something that is already allowed by Erlang syntax, so there >>>>> is no actual language change. The proposal is to use _this_ attribute >>>>> for _this_ purpose: *semantic* sectioning. >>>>> >>>>> Yes, the debt to the Smalltalk 4-pane browser and its "method >>>>> categories" *is* pretty obvious, isn't it? >>>>> >>>>> The function of the -section attribute is to provide something a >>>>> text editor can set automatic bookmarks from or at least let you >>>>> search for, that _cannot_ be trivially determined from the source >>>>> code. >>>>> >>>>> Have I missed an important benefit of the rigid syntactic ordering? >>>>> >>>>> While I'm at it, why don't other people sort their export lists into >>>>> alphabetic order? >>>>> >>>>> function and its supporte >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > -- > ============================================================ > Ivan A. Uemlianin PhD > Llaisdy > Speech Technology Research and Development > > ivan@REDACTED > www.llaisdy.com > llaisdy.wordpress.com > github.com/llaisdy > www.linkedin.com/in/ivanuemlianin > > "hilaritas excessum habere nequit" > (Spinoza, Ethica, IV, XLII) > ============================================================ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Regards, Michael Turner Project Persephone 1-25-33 Takadanobaba Shinjuku-ku Tokyo 169-0075 (+81) 90-5203-8682 turner@REDACTED http://www.projectpersephone.org/ "Love does not consist in gazing at each other, but in looking outward together in the same direction." -- Antoine de Saint-Exup?ry From ivan@REDACTED Wed Sep 12 11:24:21 2012 From: ivan@REDACTED (Ivan Uemlianin) Date: Wed, 12 Sep 2012 10:24:21 +0100 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <505051E9.1090206@llaisdy.com> Message-ID: <505054C5.60801@llaisdy.com> On 12/09/2012 10:18, Pierpaolo Bernardi wrote: > On Wed, Sep 12, 2012 at 11:12 AM, Ivan Uemlianin wrote: >> If you are reading code on paper, it helps if functions are positioned >> predictably in the stack of paper. Alphabetic ordering of functions and >> grouping functions into sections are two good ways of doing this. > > "Reading code on paper" has already been mentioned some times in this thread. > But really people read code on paper, nowadays? Yes. Presumably at least the people who have mentioned it already. It is very easy to underestimate the convenience, reliability, and power of paper and pencil (and perhaps crayons). Ivan -- ============================================================ Ivan A. Uemlianin PhD Llaisdy Speech Technology Research and Development ivan@REDACTED www.llaisdy.com llaisdy.wordpress.com github.com/llaisdy www.linkedin.com/in/ivanuemlianin "hilaritas excessum habere nequit" (Spinoza, Ethica, IV, XLII) ============================================================ From zabrane3@REDACTED Wed Sep 12 11:32:37 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Wed, 12 Sep 2012 11:32:37 +0200 Subject: [erlang-questions] [ANN] LeoFS v0.10.1 (S3 Compatible Storage) In-Reply-To: References: Message-ID: <8BDCBF70-3CFF-48C1-A060-C17AAE8D0DBB@gmail.com> Congrats to the new release Yousuke. > We have released LeoFS v0.10.1. In this version, LeoFS's performance > improved 20% up. How? Compared to what (previous version)? What change did you introduced in this release? Regards, Zabrane From desired.mta@REDACTED Wed Sep 12 11:37:42 2012 From: desired.mta@REDACTED (=?UTF-8?Q?Motiejus_Jak=C5=A1tys?=) Date: Wed, 12 Sep 2012 11:37:42 +0200 Subject: [erlang-questions] PropEr: integer/2 not generating numbers uniformly In-Reply-To: References: Message-ID: On Wed, Sep 12, 2012 at 10:27 AM, Motiejus Jak?tys wrote: > Is there a fundamental reason for this behaviour? What would be best > way to create a generator that spans much wider ranges? > Seems like a bug in random number generator in PropEr. I submitted a pull request: https://github.com/manopapad/proper/pull/46 -- Motiejus Jak?tys From ok@REDACTED Wed Sep 12 11:52:23 2012 From: ok@REDACTED (ok@REDACTED) Date: Wed, 12 Sep 2012 21:52:23 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> Message-ID: <972c75c1ad9f59d6ae4005ed2c43fe69.squirrel@chasm.otago.ac.nz> > On 12 September 2012 15:56, Richard O'Keefe wrote: > >> % Include files >> % External exports >> % Internal exports >> % Macros >> % Records >> % External functions >> % Internal functions >> >> only bulked up, and present even when the sections were empty. >> > > ??? > > >> I can tell >> an include because it starts with -include >> an export because it starts with -export >> a macro because it starts with -defined >> a record because it starts with -record >> a function because it does not start with - > > Can you tell this while quickly scanning over the code? (A) Yes of course I can. It's right at the xxxxing left margin! It's the very easiest most obvious place to find stuff. (B) I have no *reason* to because it is nothing I find useful to know. > Can you tell this > while page-flipping like a madman in your text editor because you're > looking for a particular section of your code? I have *NEVER*, not in nearly 40 years of programming, found it useful to "go where the macros are". Putting all your macros in front of all your functions makes about as much sense as putting all the nouns in your sentences ahead of all the verbs and adjectives. >From time to time I try to tell people that COBOL isn't all that bad, and then I remember my intense frustration at being unable to place data near the paragraphs that needed them. Syntactic sectioning (put all the files in one place, put all the variables in another place, put all the code in a third place) did not *solve* the page flipping problem, it *caused* the page flipping problem. I actually have a free COBOL compiler on my machine, and for this reason above all others, have never been able to bring myself to use it. Indeed, this has driven me to wonder whether Ada-style 'child' modules (which are very different from Java-style 'packages') might be a good thing in Erlang. Haskell programmers seem to use semantic sectioning in cutting modules into lots of submodules, although I feel they take it to an extreme which also hurts readability. Over and over and over again I have found it amazingly useful to use SEMANTIC sectioning. In C code, for example, I actively and positively want NOT to know whether attribute_name() -- to take an example from my DVM2 library for handing XML in C -- is a macro or an exported function or an internal function, but I want very much to "find the stuff that handles attributes", and I want to find it *there* whichever of the three it is. In any case, you may find it hard to believe, but it is literally true that when I stripped the junk comments out of the code I was looking at, the page count of nearly all the files halved. Junk comments don't *solve* the page flipping problem, they *exacerbate* it. > > The "bulked up" section that you omitted is, if I guess correctly, > something like this: > > %================================================== It includes but is not limited to such things, yes. > > And the fact, if I'm correct, that you think of this as "bulking up" is > you > gloriously missing the entire *point* of heading-style comments: they help > you quickly locate particular sections of code, or particular functions or > whatnot by calling attention to themselves. No, they don't. * They really do not help me find anything when using a text editor. If I *did* want to search for one of these sections, I'd be searching for '% Includes', not for '==='. * When looking at a printed listing, they don't help nearly as much as a page break, they only need one line of fat dashes, not two or more, and they don't help nearly as much as an Interlisp technique I'll return to * I was not talking about function headers, not one word about those. I have nothing against devices that help me find particular functions. However, even then there's something much better than lines of dashes, the Interlisp thing I'll get back to. * The most important point is that these bulked out junk comments I'm talking about are utterly useless for locating particular sections of code, quickly or otherwise, because of their content. They are SYNTACTIC sections, which cleave asunder that which should be kept together and unnaturally conjoin that which should be kept apart. The includes, types, macros, exported functions, and internal functions that work tightly coupled to achieve a particular task are scattered across many syntactic sections. Unrelated functions are placed together merely because none of them are exported. If someone wants to mark *SEMANTIC* sections up with bulked out comments, fair play to them, it's not me that will complain. Indeed, I'll say "thank'ee kindly." OK, what did Interlisp do? When you asked Interlisp to make a listing of a file, it understood which functions and macros defined things, and where the name being defined could be found. So it displayed those names in a larger font. Looking at an Interlisp listing, you could see which functions were defined where from the other side of the table. > code to maintain that has no such navigation aids, I grit my teeth, say a > few very unpleasant things about the parentage of the person who wrote it > under my breath and then spend the next little while adding those > navigation aids myself. Imagine "navigation aids" in the form of signposts that say things like "signpost", "a street somewhere", "here", "these are letters". That's the kind of junk comment "navigation aid" I am complaining about. From valentin@REDACTED Wed Sep 12 11:52:28 2012 From: valentin@REDACTED (Valentin Micic) Date: Wed, 12 Sep 2012 11:52:28 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <1347441245.5588.30.camel@seasc0057> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <1347441245.5588.30.camel@seasc0057> Message-ID: <173E0F31-1680-49CF-9EC0-C02DFBC48104@pixie.co.za> Hmmm?. maybe it's about time to go green? (Just kidding, of course? or am I?). V/ On 12 Sep 2012, at 11:14 AM, Bengt Kleberg wrote: > When trying to "find out what is particular module doing/responsible > for", on paper, it helps if you can find things. When reading on paper > it is easier to find things when they are alphabetically ordered. > > OK? Not OK? > > > bengt > > On Wed, 2012-09-12 at 11:00 +0200, Valentin Micic wrote: >> I can understand that if you know what you're looking for (and just want to check, say, function signature), then the alphabetic ordering may help. >> However, if one wants to find out what is particular module doing/responsible for, I would really like to learn how can alphabetic ordering help. >> And if this turns to be useful, well, why not go the whole hog and order code alphabetically as well ;-) >> >> V/ >> >> On 12 Sep 2012, at 10:42 AM, Bengt Kleberg wrote: >> >>> If you expect your code to be read/reviewed when printed, you should >>> have the functions alphabetically ordered. >>> Grouping exported/internal functions also help the reviewers. >>> >>> >>> bengt >>> >>> On Wed, 2012-09-12 at 10:26 +0200, Daniel Eliasson wrote: >>>> I've seen comments beginning with %%%_* that I believe are used as a >>>> tag for some kind of text folding mode in Emacs. >>>> >>>> I also don't get why people wouldn't sort their export lists alphabetically. >>>> >>>> On 12 September 2012 09:56, Richard O'Keefe wrote: >>>>> I was looking at some Erlang code today, >>>>> and it had comments like >>>>> >>>>> % Include files >>>>> % External exports >>>>> % Internal exports >>>>> % Macros >>>>> % Records >>>>> % External functions >>>>> % Internal functions >>>>> >>>>> only bulked up, and present even when the sections were empty. >>>>> >>>>> I take the definition of a "junk comment" to be >>>>> "a comment that repeats something immediately obvious >>>>> from the adjacent code". >>>>> >>>>> I can tell >>>>> an include because it starts with -include >>>>> an export because it starts with -export >>>>> a macro because it starts with -defined >>>>> a record because it starts with -record >>>>> a function because it does not start with - >>>>> so most of these are technically junk comments. >>>>> >>>>> In fact they remind most unpleasantly of COBOL (IDENTIFICATION >>>>> DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic Pascal's >>>>> rigid (label; const; type; var; procedure; begin) ordering. >>>>> >>>>> In fact this ordering strikes me as pernicious in a very very >>>>> similar way. Suppose for example I have a sliding window module >>>>> in which there is >>>>> >>>>> %------------------------ >>>>> % Purging >>>>> %------------------------ >>>>> >>>>> purge(Window) -> ... >>>>> >>>>> and this function uses a number of helper functions and macros >>>>> that are not used in other parts of the file. I want to put >>>>> them *here*, close by the function(s) needing them, not to rip >>>>> them away from their context just because some boilerplate comment >>>>> says so. >>>>> >>>>> In fact I had been thinking about proposing a conventional use >>>>> of an attribute: >>>>> >>>>> -section(creating). >>>>> -section(adding). >>>>> -section(purging). >>>>> -section(testing). >>>>> -section(formatting). >>>>> >>>>> This is something that is already allowed by Erlang syntax, so there >>>>> is no actual language change. The proposal is to use _this_ attribute >>>>> for _this_ purpose: *semantic* sectioning. >>>>> >>>>> Yes, the debt to the Smalltalk 4-pane browser and its "method >>>>> categories" *is* pretty obvious, isn't it? >>>>> >>>>> The function of the -section attribute is to provide something a >>>>> text editor can set automatic bookmarks from or at least let you >>>>> search for, that _cannot_ be trivially determined from the source >>>>> code. >>>>> >>>>> Have I missed an important benefit of the rigid syntactic ordering? >>>>> >>>>> While I'm at it, why don't other people sort their export lists into >>>>> alphabetic order? >>>>> >>>>> function and its supporte >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From odo@REDACTED Wed Sep 12 11:58:41 2012 From: odo@REDACTED (Florian Odronitz) Date: Wed, 12 Sep 2012 11:58:41 +0200 Subject: [erlang-questions] How to make a supervisor wait before restarting children Message-ID: <76B208BD-9035-41FD-B9D9-DE288239AA6B@mac.com> Hi List, I am writing an application to talk to a database server. The supervisor starts a bunch of workers which connect to the db. When the db is not available, the workers crash and are restarted by the backend. If the workers crash too often, the supervisor dies according to the restart strategy. When the db comes up again after a couple of minutes, the supervisor is long dead. What I would like to achieve is a (super)supervisor that waits for a couple of seconds before restarting workers (or supervisor). The restart strategy does not offer such an option. Do you have any idea how to do this? Thanks, Florian From ok@REDACTED Wed Sep 12 12:10:20 2012 From: ok@REDACTED (ok@REDACTED) Date: Wed, 12 Sep 2012 22:10:20 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> Message-ID: > I can understand that if you know what you're looking for (and just want > to check, say, function signature), then the alphabetic ordering may help. > However, if one wants to find out what is particular module > doing/responsible for, I would really like to learn how can alphabetic > ordering help. Just to make it clear, I was advocating that the list of function names in an -export directive should be sorted, while the function definitions should be grouped into semantic categories. Two historic comparisons: * the Burroughs Extended Algol compiler had a long list of forward procedure declarations near the front, each with an associated sequence number. Then the actual procedure definitions were grouped semantically. One typically kept a couple of punched cards stuck in the six-inch listing as bookmarks, one or more of them in the index. You could find your way around in this huge listing with astonishing ease. * the Smalltalk 5-pane browser (yes, I know I said 4-pane in a previous essage, but I'm typing with a laptop on my chest and am not catching all my typos). Top, left to right: class categories (think 'applications'), alphabetically classes within current category, alphabetically method categories within class (semantic sections), alphabetically methods within category, alphabetically Bottom: Edit window for class definition, class comment, or method definition. Add in the 'find definition' 'find callers' and other single keystroke operations, and you can really *fly* in that interface. Oh, guess what? No junk comments! If you want to find out what a module is doing or responsible for, you should be reading the module comment, not looking at the functions. And there should BE one that TELLS you. Note that if you have semantic -sections, then egrep '^-(module|section)' foobar.erl would tell you quite a bit about what the module is up to. From essen@REDACTED Wed Sep 12 12:11:33 2012 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Wed, 12 Sep 2012 12:11:33 +0200 Subject: [erlang-questions] How to make a supervisor wait before restarting children In-Reply-To: <76B208BD-9035-41FD-B9D9-DE288239AA6B@mac.com> References: <76B208BD-9035-41FD-B9D9-DE288239AA6B@mac.com> Message-ID: <50505FD5.6050408@ninenines.eu> On 09/12/2012 11:58 AM, Florian Odronitz wrote: > Hi List, > > I am writing an application to talk to a database server. The supervisor starts a bunch of workers which connect to the db. > When the db is not available, the workers crash and are restarted by the backend. If the workers crash too often, the supervisor dies according to the restart strategy. When the db comes up again after a couple of minutes, the supervisor is long dead. What I do is that if it fails when connecting, the worker sends itself a message to try to connect again a few seconds later. -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From nick@REDACTED Wed Sep 12 12:11:41 2012 From: nick@REDACTED (Niclas Eklund) Date: Wed, 12 Sep 2012 12:11:41 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <505048E0.2070304@llaisdy.com> <50504BC7.4040303@tail-f.com> Message-ID: <50505FDD.2020205@tail-f.com> On 09/12/2012 11:18 AM, ok@REDACTED wrote: >> On 09/12/2012 10:33 AM, Ivan Uemlianin wrote: >> Would you prefer 80 chars? Must the IBM punch card still haunt us?! ;-) > You're right. 80 characters is too wide for readability. > We should probably take 72 or 65 as the default. > > I would point out that I have actually used an > IBM 96-column keypunch that produced these cute little > 96-column cards. Just because it's an IBM punched card > never did mean it's 80 columns. (The really amusing > thing, considering these came from IBM, is that they > used the ASCII code.) > > However, it's worth asking why the 80 column card became > a standard, and what the standard actually was. > > The actual standard for programming commonly involved an > 8 character sequence number on the right (or a differently > sized sequence number on the left for COBOL) so the > *actual* text width was typically 72 characters, which was > rather better for readability. > > (I have a colleague who thinks there is nothing wrong with > 300-character lines. Needless to say, I have never been > able to read his otherwise superb code.) > Another historical influence is the U.S. standard railroad gauge - http://www.straightdope.com/columns/read/2538/was-standard-railroad-gauge-48-determined-by-roman-chariot-ruts /Nick From ok@REDACTED Wed Sep 12 12:27:04 2012 From: ok@REDACTED (ok@REDACTED) Date: Wed, 12 Sep 2012 22:27:04 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <505051E9.1090206@llaisdy.com> Message-ID: <3b0ce5bec9693ca852f366c9caf036e3.squirrel@chasm.otago.ac.nz> > On Wed, Sep 12, 2012 at 11:12 AM, Ivan Uemlianin wrote: >> If you are reading code on paper, it helps if functions are positioned >> predictably in the stack of paper. Alphabetic ordering of functions and >> grouping functions into sections are two good ways of doing this. > > "Reading code on paper" has already been mentioned some times in this > thread. > But really people read code on paper, nowadays? Yes, me, lots. Let me offer you a paradox, half fun and full earnest.' Fancy text editors and IDEs are tools for NOT reading code. If you actually want to read code, paper (ideally augmented with literate-programming-style automatically generated indices) is way better. If you don't know what I'm talking about, look at Knuth's "The Stanford GraphBase". Just today, I found a bug in a Smalltalk class that had defeated me for a day because using an IDE is too much like tunnel vision. Given a printed listing, it took me half an hour to read the whole class, and the bug practically jumped up and down and shouted to get my attention. (In fact there were two copies of it.) And another bug that I hadn't tested for yet also demanded and got my attention; working with the code in the IDE my attention was constantly directed *away* from stuff I wasn't currently working on or currently testing. When you are coping with over 100,000 lines of code, tools that help you *NOT* read are desperately valuable. From yousuke.hara@REDACTED Wed Sep 12 12:26:55 2012 From: yousuke.hara@REDACTED (Yousuke Hara) Date: Wed, 12 Sep 2012 19:26:55 +0900 Subject: [erlang-questions] [ANN] LeoFS v0.10.1 (S3 Compatible Storage) In-Reply-To: <8BDCBF70-3CFF-48C1-A060-C17AAE8D0DBB@gmail.com> References: <8BDCBF70-3CFF-48C1-A060-C17AAE8D0DBB@gmail.com> Message-ID: Hi, >> We have released LeoFS v0.10.1. In this version, LeoFS's performance >> improved 20% up. > > How? Compared to what (previous version)? Yes, I compared v0.10.0 (prev-version) with v0.10.1 when I used basho_bench. I confirmed latency and operation/sec between prev-version and v0.10.1. * basho_bench > What change did you introduced in this release? Change-log is here: Best regards, Yosuke Hara From ulf@REDACTED Wed Sep 12 12:28:04 2012 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 12 Sep 2012 12:28:04 +0200 Subject: [erlang-questions] moving process state - copy on write - heap memory increase In-Reply-To: References: <504FB0EE.6010208@student.tuwien.ac.at> Message-ID: On 12 Sep 2012, at 09:38, Richard O'Keefe wrote: > I imagine most of us would be very happy with term_to_binary > and message sending preserving sharing as long as it didn't > slow existing code down more than a percent or two. Not > because we _want_ to pass terms with lots of sharing but > because it's so much nicer not to have to worry about that. Indeed. The list archives also contain examples of where the loss of sharing has proven fatal (only to the program, thankfully). http://erlang.org/pipermail/erlang-bugs/2007-November/000488.html http://erlang.org/pipermail/erlang-questions/2005-November/017926.html Admittedly, the cases where preserved sharing is really needed, and the lack of it is very hard to work around, are few. In the first example above, it was difficult to overcome; in the second example, it was accidental, easy to fix, but not that easy to debug*. BR, Ulf W * The memory explosion occurred in a process that ran embarrassingly trivial code, so it took a while before it occurred to me that it might be gobbling up memory, but of course the penalty (in terms of increased memory footprint) for the flattening is paid by the _receiving_ process, and not the sending one. Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com From ok@REDACTED Wed Sep 12 12:33:18 2012 From: ok@REDACTED (ok@REDACTED) Date: Wed, 12 Sep 2012 22:33:18 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <505051E9.1090206@llaisdy.com> Message-ID: <770ce203f7f5745a5cc15ba6179bbfea.squirrel@chasm.otago.ac.nz> > And COBOL's DIVISIONs made sense when you could get color-coded > pre-punched DIVISION cards in the keypunch rooms, to save time typing > and to help you see, from the top of the deck, which division was > which. Also good back when a COBOL compiler might have five-to-eight > passes, on a machine with 4K instruction space: you could write a > customer parser for each pass. COBOL doesn't have _that_ many DIVISIONs. IDENTIFICATION, ENVIRONMENT, DATA, and PROCEDURE, in COBOL 85. In a program with a couple of hundred lines, having those cards pre-punched saved practically no time. Using the colour-coded stock to punch semantically-named SECTIONs made a lot more sense. From f@REDACTED Wed Sep 12 12:36:38 2012 From: f@REDACTED (Francesco Mazzoli) Date: Wed, 12 Sep 2012 11:36:38 +0100 Subject: [erlang-questions] How to make a supervisor wait before restarting children In-Reply-To: <76B208BD-9035-41FD-B9D9-DE288239AA6B@mac.com> References: <76B208BD-9035-41FD-B9D9-DE288239AA6B@mac.com> Message-ID: <871ui7zfwp.wl%f@mazzo.li> At Wed, 12 Sep 2012 11:58:41 +0200, Florian Odronitz wrote: > What I would like to achieve is a (super)supervisor that waits for a couple of > seconds before restarting workers (or supervisor). The restart strategy does > not offer such an option. > Do you have any idea how to do this? If you feel adventurous, you can try to use our version of supervisor, which includes that feature: . The additional feature are listed at the top. -- Francesco * Often in error, never in doubt From ulf@REDACTED Wed Sep 12 12:36:15 2012 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 12 Sep 2012 12:36:15 +0200 Subject: [erlang-questions] How to make a supervisor wait before restarting children In-Reply-To: <76B208BD-9035-41FD-B9D9-DE288239AA6B@mac.com> References: <76B208BD-9035-41FD-B9D9-DE288239AA6B@mac.com> Message-ID: <2116F446-9016-43E6-A906-CABD897DA2F0@feuerlabs.com> I agree with Loic's advice. Lobbying for a change of the supervisor semantics is not likely to produce tangible (esp. short-term) results, and for good reason. The supervisor behaviour is so central, that even subtle changes in semantics can have serious unintended consequences. FWIW, I have lobbied for changes myself in the past, see e.g. ftp://ftp.it.su.se/pub/mirrors/www.erlang.org/ml-archive/erlang-questions/200311/msg00247.html BR, Ulf W On 12 Sep 2012, at 11:58, Florian Odronitz wrote: > Hi List, > > I am writing an application to talk to a database server. The supervisor starts a bunch of workers which connect to the db. > When the db is not available, the workers crash and are restarted by the backend. If the workers crash too often, the supervisor dies according to the restart strategy. When the db comes up again after a couple of minutes, the supervisor is long dead. > > What I would like to achieve is a (super)supervisor that waits for a couple of seconds before restarting workers (or supervisor). The restart strategy does not offer such an option. > Do you have any idea how to do this? > > Thanks, > Florian > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com From bengt.kleberg@REDACTED Wed Sep 12 12:41:30 2012 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 12 Sep 2012 12:41:30 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> Message-ID: <1347446490.5588.38.camel@seasc0057> Just in case that semantic categories means that functions that belong together are placed together, I solve that kind of problem by having the same prefix on functions that deal with the same thing. bengt On Wed, 2012-09-12 at 12:10 +0200, ok@REDACTED wrote: > > I can understand that if you know what you're looking for (and just want > > to check, say, function signature), then the alphabetic ordering may help. > > However, if one wants to find out what is particular module > > doing/responsible for, I would really like to learn how can alphabetic > > ordering help. > > Just to make it clear, I was advocating that the list of > function names in an -export directive should be sorted, > while the function definitions should be grouped into > semantic categories. > > Two historic comparisons: > * the Burroughs Extended Algol compiler had a long list > of forward procedure declarations near the front, each > with an associated sequence number. Then the actual > procedure definitions were grouped semantically. One > typically kept a couple of punched cards stuck in the > six-inch listing as bookmarks, one or more of them in > the index. You could find your way around in this > huge listing with astonishing ease. > * the Smalltalk 5-pane browser (yes, I know I said 4-pane > in a previous essage, but I'm typing with a laptop on > my chest and am not catching all my typos). > Top, left to right: > class categories (think 'applications'), alphabetically > classes within current category, alphabetically > method categories within class (semantic sections), alphabetically > methods within category, alphabetically > Bottom: > Edit window for class definition, class comment, > or method definition. > Add in the 'find definition' 'find callers' and other > single keystroke operations, and you can really *fly* > in that interface. Oh, guess what? No junk comments! > > If you want to find out what a module is doing or responsible > for, you should be reading the module comment, not looking at > the functions. And there should BE one that TELLS you. > > Note that if you have semantic -sections, then > > egrep '^-(module|section)' foobar.erl > > would tell you quite a bit about what the module is up to. > > From ok@REDACTED Wed Sep 12 12:45:39 2012 From: ok@REDACTED (ok@REDACTED) Date: Wed, 12 Sep 2012 22:45:39 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <1347441245.5588.30.camel@seasc0057> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <1347441245.5588.30.camel@seasc0057> Message-ID: <823ad9b351449a4e73019a65b0040483.squirrel@chasm.otago.ac.nz> > When trying to "find out what is particular module doing/responsible > for", on paper, it helps if you can find things. When reading on paper > it is easier to find things when they are alphabetically ordered. I suggest that a listing generator that appends a table of contents mapping each function name to a page number is another way to do this. I really don't care for any syntactic ordering principle. For example, separating the exported functions from the private ones is a bad idea, because I might want to conceal something that used to be exported, or vice versa, and suddenly what *should* be a one-line change is a big change. With alphabetic ordering, again, what *should* be a small change to the name of a function -- with corresponding changes to callers -- becomes a violent change of place. I agree 100% that being able to find things alphabetically is very useful. If it comes to that, being able to find functions by who last edited them, or when they were last edited, or how many bugs have been found in them, &c &c can be convenient. That doesn't mean that any of these, or any other extrinsic ordering, is a good way to organise a group of definitions that need to be comprehended together. Let's put it this way: for things that do NOT have to be comprehended together, alphabetic ordering is great; for things that DO having to be comprehended together, any extrinsic ordering is bad. Let me give an example. It's really simple one just to make a point. -export([ ... sum/1 ...]). sum(Xs) -> add_up(Xs, 0). add_up([X|Xs], S) -> add_sup(Xs, S+X); add_up([], S) -> S. If the comment on sum/1 is not enough, you have to read them *together*. But if you separate exported functions from internal ones, these two functions are on different pages. If you order function definitions alphabetically, these two functions are on different pages. From ulf@REDACTED Wed Sep 12 12:51:33 2012 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 12 Sep 2012 12:51:33 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <3b0ce5bec9693ca852f366c9caf036e3.squirrel@chasm.otago.ac.nz> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <505051E9.1090206@llaisdy.com> <3b0ce5bec9693ca852f366c9caf036e3.squirrel@chasm.otago.ac.nz> Message-ID: On 12 Sep 2012, at 12:27, ok@REDACTED wrote: >> "Reading code on paper" has already been mentioned some times in this >> thread. >> But really people read code on paper, nowadays? > > Yes, me, lots. The problem is often the same when reading code in a tty (which typically defaults to 80x25). If I need to browse code from a command line, on a laptop with a 15" screen, I do tend to mutter a few curses in the direction of programmers who seem to think that everyone is sitting in front of a lineup of >27" screens, just because they happen to. ;-) This is hardly a new problem. In my first serious project, I recall an incident where the coders of a UI had become too enamored with their new 17" screens, and completely forgot that the most important users were using Mac SE30s (with a 9" screen), for the simple reason that they had to jump out of airplanes with them. A spicy brew of fighter-pilot language was hurled at the developers when it was discovered that the new decision support system was unusable on anything but the very latest, sexiest monitors that only the developers had.* BR, Ulf W * As you can guess, this was in the 90s, when a 17" monitor was indeed sexy. Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com From robert.virding@REDACTED Wed Sep 12 13:11:21 2012 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 12 Sep 2012 12:11:21 +0100 (BST) Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <1347441245.5588.30.camel@seasc0057> Message-ID: No! I find it much easier to understand what is going on if I group the main function together with its "helper" functions. They are working together as one unit and often the helper functions only have meaning within the context of the main function. It also makes it easier to comment the whole unit and have local comments where necessary. The comment to the main functions describes what this functions does and how it does it, while comments for the helper functions just describe features of that function. In many cases this is the erlang alternative to having local functions. The only problem is when helper functions are shared between main functions in which case I usually put them together with the first function. I never order my API functions alphabetically but prefer to group them according to what they do. For example if there is a server I will have the start/start_link/stop functions together as they managed the server as a whole. I will group API functions after what they do, so I will put functions that access one property together. I will also group my export declarations in a similar way, sometimes commented, just to make it easier to see which exported functions belong together. Robert ----- Original Message ----- > From: "Bengt Kleberg" > Cc: "Erlang-Questions Questions" > Sent: Wednesday, 12 September, 2012 11:14:05 AM > Subject: Re: [erlang-questions] Style wars: junk comments > > When trying to "find out what is particular module doing/responsible > for", on paper, it helps if you can find things. When reading on > paper > it is easier to find things when they are alphabetically ordered. > > OK? Not OK? > > > bengt > > On Wed, 2012-09-12 at 11:00 +0200, Valentin Micic wrote: > > I can understand that if you know what you're looking for (and just > > want to check, say, function signature), then the alphabetic > > ordering may help. > > However, if one wants to find out what is particular module > > doing/responsible for, I would really like to learn how can > > alphabetic ordering help. > > And if this turns to be useful, well, why not go the whole hog and > > order code alphabetically as well ;-) > > > > V/ > > > > On 12 Sep 2012, at 10:42 AM, Bengt Kleberg wrote: > > > > > If you expect your code to be read/reviewed when printed, you > > > should > > > have the functions alphabetically ordered. > > > Grouping exported/internal functions also help the reviewers. > > > > > > > > > bengt > > > > > > On Wed, 2012-09-12 at 10:26 +0200, Daniel Eliasson wrote: > > >> I've seen comments beginning with %%%_* that I believe are used > > >> as a > > >> tag for some kind of text folding mode in Emacs. > > >> > > >> I also don't get why people wouldn't sort their export lists > > >> alphabetically. > > >> > > >> On 12 September 2012 09:56, Richard O'Keefe > > >> wrote: > > >>> I was looking at some Erlang code today, > > >>> and it had comments like > > >>> > > >>> % Include files > > >>> % External exports > > >>> % Internal exports > > >>> % Macros > > >>> % Records > > >>> % External functions > > >>> % Internal functions > > >>> > > >>> only bulked up, and present even when the sections were empty. > > >>> > > >>> I take the definition of a "junk comment" to be > > >>> "a comment that repeats something immediately obvious > > >>> from the adjacent code". > > >>> > > >>> I can tell > > >>> an include because it starts with -include > > >>> an export because it starts with -export > > >>> a macro because it starts with -defined > > >>> a record because it starts with -record > > >>> a function because it does not start with - > > >>> so most of these are technically junk comments. > > >>> > > >>> In fact they remind most unpleasantly of COBOL (IDENTIFICATION > > >>> DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic > > >>> Pascal's > > >>> rigid (label; const; type; var; procedure; begin) ordering. > > >>> > > >>> In fact this ordering strikes me as pernicious in a very very > > >>> similar way. Suppose for example I have a sliding window > > >>> module > > >>> in which there is > > >>> > > >>> %------------------------ > > >>> % Purging > > >>> %------------------------ > > >>> > > >>> purge(Window) -> ... > > >>> > > >>> and this function uses a number of helper functions and macros > > >>> that are not used in other parts of the file. I want to put > > >>> them *here*, close by the function(s) needing them, not to rip > > >>> them away from their context just because some boilerplate > > >>> comment > > >>> says so. > > >>> > > >>> In fact I had been thinking about proposing a conventional use > > >>> of an attribute: > > >>> > > >>> -section(creating). > > >>> -section(adding). > > >>> -section(purging). > > >>> -section(testing). > > >>> -section(formatting). > > >>> > > >>> This is something that is already allowed by Erlang syntax, so > > >>> there > > >>> is no actual language change. The proposal is to use _this_ > > >>> attribute > > >>> for _this_ purpose: *semantic* sectioning. > > >>> > > >>> Yes, the debt to the Smalltalk 4-pane browser and its "method > > >>> categories" *is* pretty obvious, isn't it? > > >>> > > >>> The function of the -section attribute is to provide something > > >>> a > > >>> text editor can set automatic bookmarks from or at least let > > >>> you > > >>> search for, that _cannot_ be trivially determined from the > > >>> source > > >>> code. > > >>> > > >>> Have I missed an important benefit of the rigid syntactic > > >>> ordering? > > >>> > > >>> While I'm at it, why don't other people sort their export lists > > >>> into > > >>> alphabetic order? > > >>> > > >>> function and its supporte > > >>> > > >>> _______________________________________________ > > >>> erlang-questions mailing list > > >>> erlang-questions@REDACTED > > >>> http://erlang.org/mailman/listinfo/erlang-questions > > >> _______________________________________________ > > >> erlang-questions mailing list > > >> erlang-questions@REDACTED > > >> http://erlang.org/mailman/listinfo/erlang-questions > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From f@REDACTED Wed Sep 12 13:14:04 2012 From: f@REDACTED (Francesco Mazzoli) Date: Wed, 12 Sep 2012 12:14:04 +0100 Subject: [erlang-questions] How to make a supervisor wait before restarting children In-Reply-To: <2116F446-9016-43E6-A906-CABD897DA2F0@feuerlabs.com> References: <76B208BD-9035-41FD-B9D9-DE288239AA6B@mac.com> <2116F446-9016-43E6-A906-CABD897DA2F0@feuerlabs.com> Message-ID: <87ipbjijcz.wl%f@mazzo.li> At Wed, 12 Sep 2012 12:36:15 +0200, Ulf Wiger wrote: > Lobbying for a change of the supervisor semantics is not likely > to produce tangible (esp. short-term) results, and for good reason. > The supervisor behaviour is so central, that even subtle changes > in semantics can have serious unintended consequences. I can agree with that, but I thought our code might be helpful/interesting/relevant. One little thing that I really miss in the vanilla supervisor is to be able to restart from the process without logging errors... -- Francesco * Often in error, never in doubt From olopierpa@REDACTED Wed Sep 12 13:19:29 2012 From: olopierpa@REDACTED (Pierpaolo Bernardi) Date: Wed, 12 Sep 2012 13:19:29 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <3b0ce5bec9693ca852f366c9caf036e3.squirrel@chasm.otago.ac.nz> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <505051E9.1090206@llaisdy.com> <3b0ce5bec9693ca852f366c9caf036e3.squirrel@chasm.otago.ac.nz> Message-ID: On Wed, Sep 12, 2012 at 12:27 PM, wrote: >> On Wed, Sep 12, 2012 at 11:12 AM, Ivan Uemlianin wrote: >>> If you are reading code on paper, it helps if functions are positioned >>> predictably in the stack of paper. Alphabetic ordering of functions and >>> grouping functions into sections are two good ways of doing this. >> >> "Reading code on paper" has already been mentioned some times in this >> thread. >> But really people read code on paper, nowadays? > > Yes, me, lots. > > Let me offer you a paradox, half fun and full earnest.' > > Fancy text editors and IDEs are tools for NOT reading code. > > If you actually want to read code, paper (ideally augmented > with literate-programming-style automatically generated > indices) is way better. If you don't know what I'm talking > about, look at Knuth's "The Stanford GraphBase". I have this book. Love the content. Hate how it's presented. (And I wish Knuth had abstained from using the ignoble, hackish, sometimes not complying to C of any standard, tricks, which makes the code presented hard to reuse, and instead had concentrated on a higher level view.) > Just today, I found a bug in a Smalltalk class that had > defeated me for a day because using an IDE is too much > like tunnel vision. Given a printed listing, it took me > half an hour to read the whole class, and the bug practically > jumped up and down and shouted to get my attention. I have little experiences with Smalltalk, but when I tried it, it's usual IDEs gave me the impression of looking at the code through a keyhole. So I understand that in this case printed source is liberating. P. From ok@REDACTED Wed Sep 12 13:25:40 2012 From: ok@REDACTED (ok@REDACTED) Date: Wed, 12 Sep 2012 23:25:40 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <1347446490.5588.38.camel@seasc0057> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <1347446490.5588.38.camel@seasc0057> Message-ID: <0eb7ceb8cd7d4991f87c4a927b81d911.squirrel@chasm.otago.ac.nz> > Just in case that semantic categories means that functions that belong > together are placed together, I solve that kind of problem by having the > same prefix on functions that deal with the same thing. Squeak 4.1: 'Collections-Unordered' "A group of related classes" Dictionary "A particular class" enumerating "A group of methods that all iterate" #associationsDo: "iterate over (key->values) pairs" #associationsSelect: "select subset of (key->value) pairs" #collect: "map, function applied to values only" #do: "iterate over values" #keysAndValuesDo: "iterate over keys and values" #keysDo: "iterate over keys" #select: "select maplets looking just at values" #valuesDo: "another name for #do:, at least here" Giving these methods a common prefix would very definitely reduce readability. Take a look at lists.erl some time. keysort/2 is in one place. It calls keysort_1/5 and keysplit_1/8. Now keysort_1/5 follows right after; it calls keysplit_1/8 and keysplit_2/8, which are 1000 lines and 1030 lines away respectively. That kind of nonsense is why I want tightly coupled functions close together, regardless of name, if that is possible. This is actually a place where I would do one of two things: split keysort/2 and its support functions into a separate module, and re-export it, or split keysort/2 and its support functions into a separate file, and -include it. From mononcqc@REDACTED Wed Sep 12 13:48:15 2012 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 12 Sep 2012 07:48:15 -0400 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: Message-ID: <5050767F.6040901@ferd.ca> This is the approach I like the most. It's something I picked up when working with Scheme, where functions can contain the definitions of their helpers within them, which made the code much clearer to me. I rarely read code on paper anymore, so while I understand the concern, grouping alphabetically tends to be more useless to me than: 1. reading around the current unit I'm in is to get all its context 2. using my editor's quick jumping function when I need to skip around Same with grouping export declarations. Most of the time, an action has an opposite (add -> remove, start -> stop, push -> pop, etc) and it makes sense to me to put these together. But really, to me, grouping things related together is just a way to make related code more compact, and easy to remember at once, as one unit. Peter Norvig mentioned at some point that what he found important was to be able to fit a problem in its entirety in his head so that he can think about it more effectively. On 12-09-12 7:11 AM, Robert Virding wrote: > No! > > I find it much easier to understand what is going on if I group the main function together with its "helper" functions. They are working together as one unit and often the helper functions only have meaning within the context of the main function. It also makes it easier to comment the whole unit and have local comments where necessary. The comment to the main functions describes what this functions does and how it does it, while comments for the helper functions just describe features of that function. In many cases this is the erlang alternative to having local functions. The only problem is when helper functions are shared between main functions in which case I usually put them together with the first function. > > I never order my API functions alphabetically but prefer to group them according to what they do. For example if there is a server I will have the start/start_link/stop functions together as they managed the server as a whole. I will group API functions after what they do, so I will put functions that access one property together. > > I will also group my export declarations in a similar way, sometimes commented, just to make it easier to see which exported functions belong together. > > Robert > > ----- Original Message ----- >> From: "Bengt Kleberg" >> Cc: "Erlang-Questions Questions" >> Sent: Wednesday, 12 September, 2012 11:14:05 AM >> Subject: Re: [erlang-questions] Style wars: junk comments >> >> When trying to "find out what is particular module doing/responsible >> for", on paper, it helps if you can find things. When reading on >> paper >> it is easier to find things when they are alphabetically ordered. >> >> OK? Not OK? >> >> >> bengt >> >> On Wed, 2012-09-12 at 11:00 +0200, Valentin Micic wrote: >>> I can understand that if you know what you're looking for (and just >>> want to check, say, function signature), then the alphabetic >>> ordering may help. >>> However, if one wants to find out what is particular module >>> doing/responsible for, I would really like to learn how can >>> alphabetic ordering help. >>> And if this turns to be useful, well, why not go the whole hog and >>> order code alphabetically as well ;-) >>> >>> V/ >>> >>> On 12 Sep 2012, at 10:42 AM, Bengt Kleberg wrote: >>> >>>> If you expect your code to be read/reviewed when printed, you >>>> should >>>> have the functions alphabetically ordered. >>>> Grouping exported/internal functions also help the reviewers. >>>> >>>> >>>> bengt >>>> >>>> On Wed, 2012-09-12 at 10:26 +0200, Daniel Eliasson wrote: >>>>> I've seen comments beginning with %%%_* that I believe are used >>>>> as a >>>>> tag for some kind of text folding mode in Emacs. >>>>> >>>>> I also don't get why people wouldn't sort their export lists >>>>> alphabetically. >>>>> >>>>> On 12 September 2012 09:56, Richard O'Keefe >>>>> wrote: >>>>>> I was looking at some Erlang code today, >>>>>> and it had comments like >>>>>> >>>>>> % Include files >>>>>> % External exports >>>>>> % Internal exports >>>>>> % Macros >>>>>> % Records >>>>>> % External functions >>>>>> % Internal functions >>>>>> >>>>>> only bulked up, and present even when the sections were empty. >>>>>> >>>>>> I take the definition of a "junk comment" to be >>>>>> "a comment that repeats something immediately obvious >>>>>> from the adjacent code". >>>>>> >>>>>> I can tell >>>>>> an include because it starts with -include >>>>>> an export because it starts with -export >>>>>> a macro because it starts with -defined >>>>>> a record because it starts with -record >>>>>> a function because it does not start with - >>>>>> so most of these are technically junk comments. >>>>>> >>>>>> In fact they remind most unpleasantly of COBOL (IDENTIFICATION >>>>>> DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic >>>>>> Pascal's >>>>>> rigid (label; const; type; var; procedure; begin) ordering. >>>>>> >>>>>> In fact this ordering strikes me as pernicious in a very very >>>>>> similar way. Suppose for example I have a sliding window >>>>>> module >>>>>> in which there is >>>>>> >>>>>> %------------------------ >>>>>> % Purging >>>>>> %------------------------ >>>>>> >>>>>> purge(Window) -> ... >>>>>> >>>>>> and this function uses a number of helper functions and macros >>>>>> that are not used in other parts of the file. I want to put >>>>>> them *here*, close by the function(s) needing them, not to rip >>>>>> them away from their context just because some boilerplate >>>>>> comment >>>>>> says so. >>>>>> >>>>>> In fact I had been thinking about proposing a conventional use >>>>>> of an attribute: >>>>>> >>>>>> -section(creating). >>>>>> -section(adding). >>>>>> -section(purging). >>>>>> -section(testing). >>>>>> -section(formatting). >>>>>> >>>>>> This is something that is already allowed by Erlang syntax, so >>>>>> there >>>>>> is no actual language change. The proposal is to use _this_ >>>>>> attribute >>>>>> for _this_ purpose: *semantic* sectioning. >>>>>> >>>>>> Yes, the debt to the Smalltalk 4-pane browser and its "method >>>>>> categories" *is* pretty obvious, isn't it? >>>>>> >>>>>> The function of the -section attribute is to provide something >>>>>> a >>>>>> text editor can set automatic bookmarks from or at least let >>>>>> you >>>>>> search for, that _cannot_ be trivially determined from the >>>>>> source >>>>>> code. >>>>>> >>>>>> Have I missed an important benefit of the rigid syntactic >>>>>> ordering? >>>>>> >>>>>> While I'm at it, why don't other people sort their export lists >>>>>> into >>>>>> alphabetic order? >>>>>> >>>>>> function and its supporte >>>>>> >>>>>> _______________________________________________ >>>>>> erlang-questions mailing list >>>>>> erlang-questions@REDACTED >>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From odo@REDACTED Wed Sep 12 14:00:29 2012 From: odo@REDACTED (Florian Odronitz) Date: Wed, 12 Sep 2012 14:00:29 +0200 Subject: [erlang-questions] How to make a supervisor wait before restarting children In-Reply-To: <2116F446-9016-43E6-A906-CABD897DA2F0@feuerlabs.com> References: <76B208BD-9035-41FD-B9D9-DE288239AA6B@mac.com> <2116F446-9016-43E6-A906-CABD897DA2F0@feuerlabs.com> Message-ID: <6BE3043B-7460-4724-BF7F-082E762E7EA2@mac.com> > I agree with Loic's advice. Yes, it makes perfect sense. > Lobbying for a change of the supervisor semantics is not likely > to produce tangible (esp. short-term) results I didn't even mean to lobby 8) > > On 12 Sep 2012, at 11:58, Florian Odronitz wrote: > >> Hi List, >> >> I am writing an application to talk to a database server. The supervisor starts a bunch of workers which connect to the db. >> When the db is not available, the workers crash and are restarted by the backend. If the workers crash too often, the supervisor dies according to the restart strategy. When the db comes up again after a couple of minutes, the supervisor is long dead. >> >> What I would like to achieve is a (super)supervisor that waits for a couple of seconds before restarting workers (or supervisor). The restart strategy does not offer such an option. >> Do you have any idea how to do this? >> >> Thanks, >> Florian >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > From mabrek@REDACTED Wed Sep 12 14:05:15 2012 From: mabrek@REDACTED (Anton Lebedevich) Date: Wed, 12 Sep 2012 16:05:15 +0400 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <1347439329.5588.21.camel@seasc0057> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> Message-ID: <50507A7B.2070007@gmail.com> Distel helps a lot for reviewing code on screen. It has function erl-find-source-under-point, which is bound to M-. This function allows to jump to the source code that defines the function being called at point. erl-find-source-unwind bound to M-, allows to return back after reading the function. On 09/12/2012 12:42 PM, Bengt Kleberg wrote: > If you expect your code to be read/reviewed when printed, you should > have the functions alphabetically ordered. > Grouping exported/internal functions also help the reviewers. > > > bengt > > On Wed, 2012-09-12 at 10:26 +0200, Daniel Eliasson wrote: >> I've seen comments beginning with %%%_* that I believe are used as a >> tag for some kind of text folding mode in Emacs. >> >> I also don't get why people wouldn't sort their export lists alphabetically. >> >> On 12 September 2012 09:56, Richard O'Keefe wrote: >>> I was looking at some Erlang code today, >>> and it had comments like >>> >>> % Include files >>> % External exports >>> % Internal exports >>> % Macros >>> % Records >>> % External functions >>> % Internal functions >>> >>> only bulked up, and present even when the sections were empty. >>> >>> I take the definition of a "junk comment" to be >>> "a comment that repeats something immediately obvious >>> from the adjacent code". >>> >>> I can tell >>> an include because it starts with -include >>> an export because it starts with -export >>> a macro because it starts with -defined >>> a record because it starts with -record >>> a function because it does not start with - >>> so most of these are technically junk comments. >>> >>> In fact they remind most unpleasantly of COBOL (IDENTIFICATION >>> DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic Pascal's >>> rigid (label; const; type; var; procedure; begin) ordering. >>> >>> In fact this ordering strikes me as pernicious in a very very >>> similar way. Suppose for example I have a sliding window module >>> in which there is >>> >>> %------------------------ >>> % Purging >>> %------------------------ >>> >>> purge(Window) -> ... >>> >>> and this function uses a number of helper functions and macros >>> that are not used in other parts of the file. I want to put >>> them *here*, close by the function(s) needing them, not to rip >>> them away from their context just because some boilerplate comment >>> says so. >>> >>> In fact I had been thinking about proposing a conventional use >>> of an attribute: >>> >>> -section(creating). >>> -section(adding). >>> -section(purging). >>> -section(testing). >>> -section(formatting). >>> >>> This is something that is already allowed by Erlang syntax, so there >>> is no actual language change. The proposal is to use _this_ attribute >>> for _this_ purpose: *semantic* sectioning. >>> >>> Yes, the debt to the Smalltalk 4-pane browser and its "method >>> categories" *is* pretty obvious, isn't it? >>> >>> The function of the -section attribute is to provide something a >>> text editor can set automatic bookmarks from or at least let you >>> search for, that _cannot_ be trivially determined from the source >>> code. >>> >>> Have I missed an important benefit of the rigid syntactic ordering? >>> >>> While I'm at it, why don't other people sort their export lists into >>> alphabetic order? >>> >>> function and its supporte >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From vladdu55@REDACTED Wed Sep 12 14:15:58 2012 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 12 Sep 2012 14:15:58 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <50507A7B.2070007@gmail.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <50507A7B.2070007@gmail.com> Message-ID: This is slightly the wrong crowd to mention erlide to :-) but it can also navigate to the definition of things. This discussion also prompted me to create a ticket for an feature where the related functions can be shown together in the editor, regardless of where they are located in the file. Also we could group and arrange the source code too, using topological sort based on the dependencies. regards, vlad On Wed, Sep 12, 2012 at 2:05 PM, Anton Lebedevich wrote: > Distel helps a lot for reviewing code on screen. It has function > erl-find-source-under-point, which is bound to M-. This function allows > to jump to the source code that defines the function being called at > point. erl-find-source-unwind bound to M-, allows to return back after > reading the function. > > On 09/12/2012 12:42 PM, Bengt Kleberg wrote: >> If you expect your code to be read/reviewed when printed, you should >> have the functions alphabetically ordered. >> Grouping exported/internal functions also help the reviewers. >> >> >> bengt >> >> On Wed, 2012-09-12 at 10:26 +0200, Daniel Eliasson wrote: >>> I've seen comments beginning with %%%_* that I believe are used as a >>> tag for some kind of text folding mode in Emacs. >>> >>> I also don't get why people wouldn't sort their export lists alphabetically. >>> >>> On 12 September 2012 09:56, Richard O'Keefe wrote: >>>> I was looking at some Erlang code today, >>>> and it had comments like >>>> >>>> % Include files >>>> % External exports >>>> % Internal exports >>>> % Macros >>>> % Records >>>> % External functions >>>> % Internal functions >>>> >>>> only bulked up, and present even when the sections were empty. >>>> >>>> I take the definition of a "junk comment" to be >>>> "a comment that repeats something immediately obvious >>>> from the adjacent code". >>>> >>>> I can tell >>>> an include because it starts with -include >>>> an export because it starts with -export >>>> a macro because it starts with -defined >>>> a record because it starts with -record >>>> a function because it does not start with - >>>> so most of these are technically junk comments. >>>> >>>> In fact they remind most unpleasantly of COBOL (IDENTIFICATION >>>> DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic Pascal's >>>> rigid (label; const; type; var; procedure; begin) ordering. >>>> >>>> In fact this ordering strikes me as pernicious in a very very >>>> similar way. Suppose for example I have a sliding window module >>>> in which there is >>>> >>>> %------------------------ >>>> % Purging >>>> %------------------------ >>>> >>>> purge(Window) -> ... >>>> >>>> and this function uses a number of helper functions and macros >>>> that are not used in other parts of the file. I want to put >>>> them *here*, close by the function(s) needing them, not to rip >>>> them away from their context just because some boilerplate comment >>>> says so. >>>> >>>> In fact I had been thinking about proposing a conventional use >>>> of an attribute: >>>> >>>> -section(creating). >>>> -section(adding). >>>> -section(purging). >>>> -section(testing). >>>> -section(formatting). >>>> >>>> This is something that is already allowed by Erlang syntax, so there >>>> is no actual language change. The proposal is to use _this_ attribute >>>> for _this_ purpose: *semantic* sectioning. >>>> >>>> Yes, the debt to the Smalltalk 4-pane browser and its "method >>>> categories" *is* pretty obvious, isn't it? >>>> >>>> The function of the -section attribute is to provide something a >>>> text editor can set automatic bookmarks from or at least let you >>>> search for, that _cannot_ be trivially determined from the source >>>> code. >>>> >>>> Have I missed an important benefit of the rigid syntactic ordering? >>>> >>>> While I'm at it, why don't other people sort their export lists into >>>> alphabetic order? >>>> >>>> function and its supporte >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From asaguiar@REDACTED Wed Sep 12 15:47:05 2012 From: asaguiar@REDACTED (Alexandre Aguiar) Date: Wed, 12 Sep 2012 10:47:05 -0300 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <1347439329.5588.21.camel@seasc0057> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> Message-ID: <1363496b-422d-4082-80fe-cd844042de25@email.android.com> Hi. As far as I am not an Erlang expert, some ideas discussed here are not peculiar to Erlang. Bengt Kleberg escreveu: >If you expect your code to be read/reviewed when printed, you should >have the functions alphabetically ordered. >Grouping exported/internal functions also help the reviewers. Alphabetical order may or may not help. Modular code produces modules with small number of objects that can be efficiently visually navigated. The relationship between how efficiently and the number of objects, AFAIK, is undetermined. Some convention to ease navigation accross different modules would be more sensible and worthwhile, IMVVVHO, of course. >> On 12 September 2012 09:56, Richard O'Keefe >> that repeats something immediately obvious Obviousness is a function of familiarity. I often see this in software documentation that is obvious for the author. :-) Style is not about aesthetics. It is about discipline. And discipline is about standards. Navigating a module with a previously known internal organization is far more efficient. Several languages have (or had) structural rules for their codings. Some tags and comments work as markups that can ease learning and navigating by working as coding standards. Besides, disk space is not expensive today. :-) Not to mention that such standard markups will be essential for future implementation of cross module indexing systems and other indexing mechanisms. My 2 cents. -- Alexandre -- Sent from my tablet. Please, excuse my brevity. Enviado do tablet. Por favor, perdoe a brevidade. Publi? de le tablet. S'il vous pla?t pardonnez la bri?vet?. Ver?ffentlicht aus dem Tablet. Bitte verzeihen Sie die K?rze. Enviado desde mi tablet. Por favor, disculpen mi brevedad. Inviato dal mio tablet. Per favore, scusate la mia brevit?. From zabrane3@REDACTED Wed Sep 12 15:58:37 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Wed, 12 Sep 2012 15:58:37 +0200 Subject: [erlang-questions] Dialyzer: how to ignore some warnings? Message-ID: Hi guys, Hi Kostis, Dialyzer (R15B02, OSX 10.7.4) returns this: pimco_net.erl:146: Call to missing or unexported function prim_inet:async_acceptor/2 Is there a way to tell Dialyzer to simply ignore this warning (and any other one coming from "prim_inet") ? Thanks Regards, Zabrane From bengt.kleberg@REDACTED Wed Sep 12 16:09:09 2012 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 12 Sep 2012 16:09:09 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <1363496b-422d-4082-80fe-cd844042de25@email.android.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <1363496b-422d-4082-80fe-cd844042de25@email.android.com> Message-ID: <1347458949.5588.45.camel@seasc0057> It would surprise me if a module with a small number of objects is more difficult to navigate if the objects are in alphabetical order. The idea of having a visual convention to help navigate across modules sound very interesting. Any examples? bengt On Wed, 2012-09-12 at 15:47 +0200, Alexandre Aguiar wrote: > Hi. > > As far as I am not an Erlang expert, some ideas discussed here are not peculiar to Erlang. > > Bengt Kleberg escreveu: > >If you expect your code to be read/reviewed when printed, you should > >have the functions alphabetically ordered. > >Grouping exported/internal functions also help the reviewers. > > Alphabetical order may or may not help. Modular code produces modules with small number of objects that can be efficiently visually navigated. The relationship between how efficiently and the number of objects, AFAIK, is undetermined. > > Some convention to ease navigation accross different modules would be more sensible and worthwhile, IMVVVHO, of course. > > >> On 12 September 2012 09:56, Richard O'Keefe > >> that repeats something immediately obvious > > Obviousness is a function of familiarity. I often see this in software documentation that is obvious for the author. :-) > > Style is not about aesthetics. It is about discipline. And discipline is about standards. Navigating a module with a previously known internal organization is far more efficient. Several languages have (or had) structural rules for their codings. > > Some tags and comments work as markups that can ease learning and navigating by working as coding standards. Besides, disk space is not expensive today. :-) Not to mention that such standard markups will be essential for future implementation of cross module indexing systems and other indexing mechanisms. > > My 2 cents. > > > -- > > Alexandre > From asaguiar@REDACTED Wed Sep 12 16:13:28 2012 From: asaguiar@REDACTED (Alexandre Aguiar) Date: Wed, 12 Sep 2012 11:13:28 -0300 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <3b0ce5bec9693ca852f366c9caf036e3.squirrel@chasm.otago.ac.nz> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <505051E9.1090206@llaisdy.com> <3b0ce5bec9693ca852f366c9caf036e3.squirrel@chasm.otago.ac.nz> Message-ID: <4b2c4820-6d46-4171-9a6b-708d69e0374b@email.android.com> ok@REDACTED escreveu: >When you are coping with over 100,000 lines of code, >tools that help you *NOT* read are desperately valuable. Note that your case report is perfect to demonstrate that printing should *not* be routine. Printing selected limited portions is what helped you. At a 100 lines per page, handling a 1,000 pages (probably unindexed) is a hard task. :-) And, of course, a waste. But, of course, each one knows how high piles of paper can handle and afford. -- Alexandre -- Sent from my tablet. Please, excuse my brevity. Enviado do tablet. Por favor, perdoe a brevidade. Publi? de le tablet. S'il vous pla?t pardonnez la bri?vet?. Ver?ffentlicht aus dem Tablet. Bitte verzeihen Sie die K?rze. Enviado desde mi tablet. Por favor, disculpen mi brevedad. Inviato dal mio tablet. Per favore, scusate la mia brevit?. From robert.virding@REDACTED Wed Sep 12 16:14:36 2012 From: robert.virding@REDACTED (Robert Virding) Date: Wed, 12 Sep 2012 15:14:36 +0100 (BST) Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <50504BC7.4040303@tail-f.com> Message-ID: <97f0a454-0d25-495b-89b3-ce69afaf1f12@knuth> Computers speak ASCII and lines are 80 chars long, that's just the way it is. Robert ----- Original Message ----- > From: "Niclas Eklund" > To: erlang-questions@REDACTED > Sent: Wednesday, 12 September, 2012 10:45:59 AM > Subject: Re: [erlang-questions] Style wars: junk comments > > On 09/12/2012 10:33 AM, Ivan Uemlianin wrote: > > I agree. > > > > The emacs gen_server skeleton has things like: > > > > %%%=================================================================== > > %%% Internal functions > > %%%=================================================================== > > > > (note 70 chars wide) > > > > It's as if they're section headings at the top of a page in a book. > > > > Would you prefer 80 chars? Must the IBM punch card still haunt us?! > ;-) > > http://programmers.stackexchange.com/questions/148677/why-is-80-characters-the-standard-limit-for-code-width > > /Nick > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From aronisstav@REDACTED Wed Sep 12 17:48:18 2012 From: aronisstav@REDACTED (Stavros Aronis) Date: Wed, 12 Sep 2012 08:48:18 -0700 (PDT) Subject: [erlang-questions] Dialyzer: how to ignore some warnings? In-Reply-To: References: Message-ID: <3151c84c-b338-4f54-9964-1520883bc1fb@googlegroups.com> Not really. For the particular case, if I understand correctly, it used to be the case that any functions that are implemented as NIFs have a stub in the .erl source file that throws an exception (if that code was really executed instead of the low level implementation). Is prim_inet:async_acceptor a NIF without such a stub? Regards, Stavros On Wednesday, September 12, 2012 3:59:23 PM UTC+2, Zabrane Mickael wrote: > > Hi guys, Hi Kostis, > > Dialyzer (R15B02, OSX 10.7.4) returns this: > pimco_net.erl:146: Call to missing or unexported function > prim_inet:async_acceptor/2 > > Is there a way to tell Dialyzer to simply ignore this warning (and any > other one coming from "prim_inet") ? > Thanks > > Regards, > Zabrane > > _______________________________________________ > erlang-questions mailing list > erlang-q...@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From asaguiar@REDACTED Wed Sep 12 18:01:54 2012 From: asaguiar@REDACTED (Alexandre Aguiar) Date: Wed, 12 Sep 2012 13:01:54 -0300 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <1347458949.5588.45.camel@seasc0057> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <1363496b-422d-4082-80fe-cd844042de25@email.android.com> <1347458949.5588.45.camel@seasc0057> Message-ID: Bengt Kleberg escreveu: >It would surprise me if a module with a small number of objects is more >difficult to navigate if the objects are in alphabetical order. The smaller the number of objects the lesser the need for indexing. And with larger numbers of objects the need for indexing will depend on the use of the source code. I do not remember any effort to sort source code content. And also do not know of any tools that build static indexes of code objects. Compilers do it at compile time, OO languages have virtual tables that, as in C++ for instance, are indexed at runtime. But nothing on source code. >The idea of having a visual convention to help navigate across modules >sound very interesting. Any examples? I do not know any. It is interesting that other people have expressed the need for that within this thread (that, btw, has long abandoned the 'junk comments' discussion). :-) Indexing may or may not be useful. Sorting has a cost that is not always effective. -- Alexandre -- Sent from my tablet. Please, excuse my brevity. Enviado do tablet. Por favor, perdoe a brevidade. Publi? de le tablet. S'il vous pla?t pardonnez la bri?vet?. Ver?ffentlicht aus dem Tablet. Bitte verzeihen Sie die K?rze. Enviado desde mi tablet. Por favor, disculpen mi brevedad. Inviato dal mio tablet. Per favore, scusate la mia brevit?. From zabrane3@REDACTED Wed Sep 12 18:03:28 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Wed, 12 Sep 2012 18:03:28 +0200 Subject: [erlang-questions] Dialyzer: how to ignore some warnings? In-Reply-To: <3151c84c-b338-4f54-9964-1520883bc1fb@googlegroups.com> References: <3151c84c-b338-4f54-9964-1520883bc1fb@googlegroups.com> Message-ID: <6D5F121E-0450-46BD-B7F7-4A2F526C28A5@gmail.com> On Sep 12, 2012, at 5:48 PM, Stavros Aronis wrote: > Not really. > > For the particular case, if I understand correctly, it used to be the case that any functions that are implemented as NIFs have a stub in the .erl source file that throws an exception (if that code was really executed instead of the low level implementation). Is prim_inet:async_acceptor a NIF without such a stub? OTP guys? Regards, Zabrane > > Regards, > Stavros > > On Wednesday, September 12, 2012 3:59:23 PM UTC+2, Zabrane Mickael wrote: > Hi guys, Hi Kostis, > > Dialyzer (R15B02, OSX 10.7.4) returns this: > pimco_net.erl:146: Call to missing or unexported function prim_inet:async_acceptor/2 > > Is there a way to tell Dialyzer to simply ignore this warning (and any other one coming from "prim_inet") ? > Thanks > > Regards, > Zabrane > > _______________________________________________ > erlang-questions mailing list > erlang-q...@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From garazdawi@REDACTED Wed Sep 12 18:28:03 2012 From: garazdawi@REDACTED (Lukas Larsson) Date: Wed, 12 Sep 2012 18:28:03 +0200 Subject: [erlang-questions] Dialyzer: how to ignore some warnings? In-Reply-To: <6D5F121E-0450-46BD-B7F7-4A2F526C28A5@gmail.com> References: <3151c84c-b338-4f54-9964-1520883bc1fb@googlegroups.com> <6D5F121E-0450-46BD-B7F7-4A2F526C28A5@gmail.com> Message-ID: Have you misspelled prim_inet:async_accept/2 in the mail or also in the source? Lukas On Wed, Sep 12, 2012 at 6:03 PM, Zabrane Mickael wrote: > > On Sep 12, 2012, at 5:48 PM, Stavros Aronis wrote: > > Not really. > > For the particular case, if I understand correctly, it used to be the case > that any functions that are implemented as NIFs have a stub in the .erl > source file that throws an exception (if that code was really executed > instead of the low level implementation). Is prim_inet:async_acceptor a NIF > without such a stub? > > > OTP guys? > > Regards, > Zabrane > > > > Regards, > Stavros > > On Wednesday, September 12, 2012 3:59:23 PM UTC+2, Zabrane Mickael wrote: >> >> Hi guys, Hi Kostis, >> >> Dialyzer (R15B02, OSX 10.7.4) returns this: >> pimco_net.erl:146: Call to missing or unexported function >> prim_inet:async_acceptor/2 >> >> Is there a way to tell Dialyzer to simply ignore this warning (and any >> other one coming from "prim_inet") ? >> Thanks >> >> Regards, >> Zabrane >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-q...@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From zabrane3@REDACTED Wed Sep 12 18:48:23 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Wed, 12 Sep 2012 18:48:23 +0200 Subject: [erlang-questions] Dialyzer: how to ignore some warnings? In-Reply-To: References: <3151c84c-b338-4f54-9964-1520883bc1fb@googlegroups.com> <6D5F121E-0450-46BD-B7F7-4A2F526C28A5@gmail.com> Message-ID: Good catch Lukas. You should read: prim_inet:async_accept/2 Regards, Zabrane On Sep 12, 2012, at 6:28 PM, Lukas Larsson wrote: > Have you misspelled prim_inet:async_accept/2 in the mail or also in the source? > > Lukas > > On Wed, Sep 12, 2012 at 6:03 PM, Zabrane Mickael wrote: >> >> On Sep 12, 2012, at 5:48 PM, Stavros Aronis wrote: >> >> Not really. >> >> For the particular case, if I understand correctly, it used to be the case >> that any functions that are implemented as NIFs have a stub in the .erl >> source file that throws an exception (if that code was really executed >> instead of the low level implementation). Is prim_inet:async_acceptor a NIF >> without such a stub? >> >> >> OTP guys? >> >> Regards, >> Zabrane >> >> >> >> Regards, >> Stavros >> >> On Wednesday, September 12, 2012 3:59:23 PM UTC+2, Zabrane Mickael wrote: >>> >>> Hi guys, Hi Kostis, >>> >>> Dialyzer (R15B02, OSX 10.7.4) returns this: >>> pimco_net.erl:146: Call to missing or unexported function >>> prim_inet:async_acceptor/2 >>> >>> Is there a way to tell Dialyzer to simply ignore this warning (and any >>> other one coming from "prim_inet") ? >>> Thanks >>> >>> Regards, >>> Zabrane >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-q...@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> From olgeni@REDACTED Wed Sep 12 18:57:03 2012 From: olgeni@REDACTED (Jimmy Olgeni) Date: Wed, 12 Sep 2012 18:57:03 +0200 Subject: [erlang-questions] [ANN] elib_gd: Erlang bindings for the GD graphics library In-Reply-To: References: Message-ID: Very good point - there is definitely room for improvement on that side. I'll look into that. On Wed, Sep 12, 2012 at 9:55 AM, Rapsey wrote: > So all processing is done inside the output function, which means it blocks > erlang vm. A bit dangerous to run this on a server. > > > Sergej From dmercer@REDACTED Wed Sep 12 18:58:05 2012 From: dmercer@REDACTED (David Mercer) Date: Wed, 12 Sep 2012 11:58:05 -0500 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <50507A7B.2070007@gmail.com> Message-ID: <00a201cd9107$c82f15e0$588d41a0$@com> On Wednesday, September 12, 2012, Vlad Dumitrescu wrote: > This is slightly the wrong crowd to mention erlide to :-) but it can > also navigate to the definition of things. This discussion also > prompted me to create a ticket for an feature where the related > functions can be shown together in the editor, regardless of where > they are located in the file. Also we could group and arrange the > source code too, using topological sort based on the dependencies. Interesting idea for a source code transform that can compute the directed graph of function dependencies and serialize them in an intelligent order, grouping connected function close to each other. (1) Anyone know of any good directed graph clustering and serialization algorithm that might be appropriate for this? (2) How would we handle semantically related but dependency unrelated functions, such as start & stop, push & pop, add & remove, etc.? Cheers, DBM From wallentin.dahlberg@REDACTED Wed Sep 12 19:11:56 2012 From: wallentin.dahlberg@REDACTED (=?ISO-8859-1?Q?Bj=F6rn=2DEgil_Dahlberg?=) Date: Wed, 12 Sep 2012 19:11:56 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <97f0a454-0d25-495b-89b3-ce69afaf1f12@knuth> References: <97f0a454-0d25-495b-89b3-ce69afaf1f12@knuth> Message-ID: <3221998729116387331@unknownmsgid> 12 sep 2012 kl. 16:14 skrev Robert Virding : > Computers speak ASCII and lines are 80 chars long, that's just the way it is. The only good thing about a 80 char limit is that it forces developers to structure their code in more functions. That increases readability imho. Not a big fan otherwise. I think I have suppressed memories of a fortran compiler hurling fatal errors at me for using more than 80 chars some time in the past. Horrible experience. // Bj?rn-Egil > > Robert > > ----- Original Message ----- >> From: "Niclas Eklund" >> To: erlang-questions@REDACTED >> Sent: Wednesday, 12 September, 2012 10:45:59 AM >> Subject: Re: [erlang-questions] Style wars: junk comments >> >> On 09/12/2012 10:33 AM, Ivan Uemlianin wrote: >>> I agree. >>> >>> The emacs gen_server skeleton has things like: >>> >>> %%%=================================================================== >>> %%% Internal functions >>> %%%=================================================================== >>> >>> (note 70 chars wide) >>> >>> It's as if they're section headings at the top of a page in a book. >>> >> >> Would you prefer 80 chars? Must the IBM punch card still haunt us?! >> ;-) >> >> http://programmers.stackexchange.com/questions/148677/why-is-80-characters-the-standard-limit-for-code-width >> >> /Nick >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From vladdu55@REDACTED Wed Sep 12 21:25:21 2012 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 12 Sep 2012 21:25:21 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <00a201cd9107$c82f15e0$588d41a0$@com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <50507A7B.2070007@gmail.com> <00a201cd9107$c82f15e0$588d41a0$@com> Message-ID: On Wed, Sep 12, 2012 at 6:58 PM, David Mercer wrote: > On Wednesday, September 12, 2012, Vlad Dumitrescu wrote: >> a feature where the related >> functions can be shown together in the editor, regardless of where >> they are located in the file. Also we could group and arrange the >> source code too, using topological sort based on the dependencies. > > (1) Anyone know of any good directed graph clustering and serialization > algorithm that might be appropriate for this? > (2) How would we handle semantically related but dependency unrelated > functions, such as start & stop, push & pop, add & remove, etc.? I think that generic algorithms would not work well enough because, as #2 above asks, there are specific constraints for this use case. Some of these will be up to the developer's taste, so the algorithm needs to be configurable in this respect. There may be such algorithms, but I couldn't find any that wouldn't need heavy customization. One simple idea about #2 is to use multiple -export declarations to do the grouping. In many cases this is something that people already do. But then we come to the "taste"-related questions: do you want 'start' and 'stop' together and both their helpers right after, or do you want 'start', its helpers, 'stop', its helpers? It could become a mess trying to satisfy all these conflicting requirements, though. regards, Vlad From ok@REDACTED Wed Sep 12 23:59:15 2012 From: ok@REDACTED (Richard O'Keefe) Date: Thu, 13 Sep 2012 09:59:15 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <5050767F.6040901@ferd.ca> References: <5050767F.6040901@ferd.ca> Message-ID: <963BB99B-1335-446D-B4FE-878213A2B780@cs.otago.ac.nz> On 12/09/2012, at 11:48 PM, Fred Hebert wrote: > This is the approach I like the most. > > It's something I picked up when working with Scheme, where functions can contain the definitions of their helpers within them, which made the code much clearer to me. Scheme and ML have features that make this rather more useful than it is in languages like Clean and Haskell. In ML you can write local in end and this has the effect that the things defined in are visible in , but not outside, while the things defined in are visible outside. For example, you might have local fun rebalance t = ... in fun add k v t = ... fun del k t = ... end Scheme lets you hack this by doing (define add) (define del) (letrec ((rebalance (lambda (t) ...)) (set! add (lambda (k v t) ...)) (set! del (lambda (k t) ...)) 'ok) I see this quite a lot in Scheme. If Joe's still thinking about Erlang 2, I hope he'll consider the functionality of local-in-end. From zabrane3@REDACTED Thu Sep 13 00:20:40 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Thu, 13 Sep 2012 00:20:40 +0200 Subject: [erlang-questions] Compiling Erlang with "Intel icc" on Linux Message-ID: <18D4FF6F-8E71-4633-AF42-F10B943C4E15@gmail.com> Hi guys, Does anyone succeed to compile Erlang with icc v11+ or v12+ on Linux? If yes, what are the steps to follow? Thanks in advance. Regards, Zabrane From ok@REDACTED Thu Sep 13 01:59:53 2012 From: ok@REDACTED (Richard O'Keefe) Date: Thu, 13 Sep 2012 11:59:53 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <1363496b-422d-4082-80fe-cd844042de25@email.android.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <1363496b-422d-4082-80fe-cd844042de25@email.android.com> Message-ID: <474995FE-4180-4958-A271-923165B447F4@cs.otago.ac.nz> On 13/09/2012, at 1:47 AM, Alexandre Aguiar wrote: > >>> On 12 September 2012 09:56, Richard O'Keefe >>> that repeats something immediately obvious > > Obviousness is a function of familiarity. I am talking about things like %%=================================== %% Macros %%=================================== -define(FOO, bar). ... where the two immediately following tokens ("-" and "define") tell you "hey, this is a macro"! If you don't understand enough Erlang to know what -define is, you don't understand enough Erlang to know what a macro is either. I did not *just* say obvious, but referred to repeating information in adjacent tokens, so that a trivial computer program could derive the comment from the code in constant time. I've also seen code like %% %% fred %% fred(X, Y) -> jim({a, X, Y}). where the entire text of the comment just repeats the next token. It would be a very strange programmer who did not find *that* obvious. And please, don't waste any time telling me comments like that are useful for navigation. Even in vi I can do /^fred( to find fred. Admittedly, an Emacs user might find it easier to do Ctrl-S % % f r e d RET . That's why in my own otherwise emacs-like editor it would be Ctrl-S RET fred ( ESC. I do agree that somehow highlighting the first line of a function definition could be useful, but honestly, that's a simple syntax colouring task. Here's a highlighter in AWK that I whipped up in a few minutes. For a -module, -define, or -record line, it highlights the word immediately after the left parenthesis. For any other -xxx line, it highlights xxx. For function definition lines, it highlights the quoted or unquoted atom that begins in column 1 if and only the last function definition line did not begin with the same word. awk -vhtml=0 -f hle.awk foo.erl Uses ANSI terminal escapes for bolding and unbolding. awk -vhtml=1 -f hle.awk foo.erl Generates HTML with for bolding. #!/bin/awk # Script : hle.awk # Author : Richard A. O'Keefe # SCCS : "@(#)2012/09/13 hle.awk 1.1" # Purpose: HighLight Erlang for finding functions &c quickly. # Usage : awk -vhtml=0 hle.awk foobar.erl >foobar.txt # : copies the input adding ANS terminal escapes for bolding; # : awk -vhtml=1 hle.awk foobarerl >foobar.htm # : adds HTML markup using for bolding. function escape(s) { if (html) { gsub(/&/, "&", s) gsub(/" unbold = "" print "Highlighted Erlang Source" print "
"
    } else {
        bold   = "\033[1m"
        unbold = "\033[0m"
    }
    last = ""
}

END {
    if (html) {
        print "
" } } /^- *(define|module|record) *\( *[a-zA-Z][a-zA-Z0-9_]*/ { # Highlight the word after the left parenthesis. match($0, /\( */) n = RSTART+RLENGTH match(substr($0, n), /[a-zA-Z][a-zA-Z0-9_]*/) RSTART += n - 1 print_with_bold() next } /^- *[a-z]+ *[(]/ { # Highlight the annotation name. match($0, /[a-z]+/) print_with_bold() next } /^([a-z][a-zA-Z0-9_]*|'([^']|\\.)*')/ { # Highlight the function name if it's not the same as the last one. if (match($0, /[^ (%]*/)) { name = substr($0, RSTART, RLENGTH) if (name != last) { last = name print_with_bold() next } } } { # Don't highlight anything. print_sans_bold() } # End of hle.awk Combine that with html2ps, and you have a neat little .erl -> .ps listing generator. It's easy to tweak. For example, we could make -section(X). turn into

X

quite easily. It is also easy to generate a cross reference table, (1) > Style is not about aesthetics. It is about discipline. (2) > And discipline is about standards. (3) > Navigating a module with a previously known internal organization > is far more efficient. (4) > Several languages have (or had) structural rules for their codings. Ad (4), I have already mentioned COBOL and Pascal and what an *imperial* pain in the arse their non-semantic ordering (imposed not for the benefit of the programmer but for the benefit of the compiler; I know that to be the case for Pascal and I believe it to be so for COBOL) was. Practically everyone who wrote a compiler relaxed that order as pretty much the first extension they added, and Pascal's successor languages dropped it as if it were red hot. Ad (3), that claim is obviously untrue in general. A known internal organisation helps navigation only if it is *RELEVANT* to navigation, and my claim is that *syntactic* sectioning is *NOT* relevant to navigation. It is quite certainly irrelevant to any kind of navigation I have ever tried to do. I never want to ask "where are the includes?" because I can find them with a trivial Ctrl-R RET -include ESC or ?^-include. I might well want to ask "which include file did _this_ come from", pointing, but syntactic sectioning is no help whatever in answering that question. I might well want to find a particular function, but that's what tag files are for (or automatically produced tables of contents). Ad (2), discipline and standards are a means to an end. Casabianca http://sniff.numachi.com/pages/tiBOYDECK.html was disciplined and faithfully followed the standard set him, but the result was a useless death. The purpose of coding standards is working maintainable software. A commenting convention that bloats the text (and I am prompted here by actual *measured* factors of 2 and even more) thus *creating* a navigation problem that would not otherwise have existed is not a standard that *ought* to be followed. A commenting convention that results in syntactic section headers being left in when there is *nothing* for them to comment on is a standard that *impairs* navigation by falsely suggesting that there is a landing point when there is none. Ad (1), no, style is not primarily about discipline, it is primarily about COMMUNICATION. A whole bunch of things converged at the same time: - Talking to some people about how to present information in graphs, about simplifying, about not depending on the red-green distinction two of my colleagues here cannot perceive, &c. I like the way Crothers said it in "On the graphical presentation of quantitative data": The graph is never an end in itself, it is not the "result", and it is important to assess the Usefulness of a presentation as well as such criteria as Clarity, Accuracy, Space, and SPeed when deciding which techniques to employ. - Slogging through some web standards (which follow a regular structure quite faithfully) and discovering at the end that the syntax had no semantics. - Reading an education report whose title was " students in : identifying the barriers" and realising at the end that while it had all the conventional structure and paraphernalia of an eduational report, it had not in fact identified any barriers. - Working through the ethics approval paperwork for an educational experiment I'm 3rd investigator on and seeing a rigid conventional structure followed perfectly but the actual forms to be given to the subjects were in heavily bureaucratic and somewhat garbled language. (Lots of passives, nobody doing anything but things mysteriously happening, comments removing themselves...) - Encountering this particular body of Erlang code with a rigid structure that was WORSE THAN USELESS FOR ACTUAL COMPREHENSION. We use TOOLS to aid NAVIGATION; we use STYLE to aid COMPREHENSION. Because the purpose of style is to help the reader understand, rigidly following any rule is likely to be a bad idea. Not because rules are bad as such, but because our finite mental capacity means that we can never envisage all the situations that may arise, so that we are likely to meet situations where following the letter of the rule will violate the intent of the rule. One of the wisest things in the Ada Quality and Style Guidelines is that they offer a rationale for every guideline, and make it clear that the expected benefits of following style rules are what really matter, not the rules as such. > Some tags and comments work as markups that can ease learning None of the examples I have complained of can credibly be said to ease learning. > and navigating None of the examples I have complained of can credibly be said to aid navigation in any realistic sense. > by working as coding standards. Besides, disk space is not expensive today. :-) Disc space is not the issue. But SCREEN space is limited. A style that bloats the code with junk comments reduces the amount of *useful* text I can see at one time and thereby reduces my ability to understand the code. For the life of me, I cannot see this as a good thing. > Not to mention that such standard markups will be essential for future implementation of cross module indexing systems and other indexing mehanisms. You will have to provide more detail. The junk comments I am talking about are ones that are trivially automatically derivable from at most the first two tokens of the next code line. It is hard to see how those can be essential for any indexing system. Be really clear and explicit: in what way is a comment %%======================================%% %% Macros %% %%======================================%% (which might not in fact be followed by any macros at all) essential to a cross module or other indexing system, given that it is actually the presence of '-define' that creates the condition "a macro is here". From ok@REDACTED Thu Sep 13 02:11:49 2012 From: ok@REDACTED (Richard O'Keefe) Date: Thu, 13 Sep 2012 12:11:49 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <4b2c4820-6d46-4171-9a6b-708d69e0374b@email.android.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <505051E9.1090206@llaisdy.com> <3b0ce5bec9693ca852f366c9caf036e3.squirrel@chasm.otago.ac.nz> <4b2c4820-6d46-4171-9a6b-708d69e0374b@email.android.com> Message-ID: <05FFA12B-C462-433A-9745-51E353240C2F@cs.otago.ac.nz> On 13/09/2012, at 2:13 AM, Alexandre Aguiar wrote: > ok@REDACTED escreveu: >> When you are coping with over 100,000 lines of code, >> tools that help you *NOT* read are desperately valuable. > > Note that your case report is perfect to demonstrate that printing should *not* be routine. Bad logic. Yes, printing the *whole* thing should not be routine. It does *NOT* follow that you should not print a small number of modules. > Printing selected limited portions is what helped you. Exactly so, but we are talking about - the entirety of a 'module' - up to 100 pages. > At a 100 lines per page, handling a 1,000 pages (probably unindexed) is a hard task. 50 to 60 lines per page would be more realistic. Why on earth do you say "probably unindexed"? Part of the point of printing is to use listing programs that generate aids to navigation, like headers that identify module and function, tables of contents, and indices. The 2009-08-23 draft of the COBOL standard is 910 pages. I have in fact been reading it on an iPad, but the whole time I've been wishing I had a paper copy. The SQL standard dwarfs it. > :-) And, of course, a waste. Why "of course"? Printing something is a waste if and only if the cost in time, paper, toner, environmental effects, &c exceeds the benefits. If it gets read, especially if it gets read more than once, it is not a waste. If you can read it more comfortably than you can on screen, it is not a waste. The iPad 3 has a lovely screen, but even that is still not as good as paper. If printing saves eyestrain (and for me it often does), it's not a waste. In the case of the 100,000 lines of code I mentioned, every line has been printed at least once, and it has _always_ paid off *for me*. The relevant factor here is probably how much you can read before it gets out of date From ok@REDACTED Thu Sep 13 02:15:36 2012 From: ok@REDACTED (Richard O'Keefe) Date: Thu, 13 Sep 2012 12:15:36 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <00a201cd9107$c82f15e0$588d41a0$@com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1347439329.5588.21.camel@seasc0057> <50507A7B.2070007@gmail.com> <00a201cd9107$c82f15e0$588d41a0$@com> Message-ID: <8036B03C-5896-4FCC-BE2B-E5D86E06F4FE@cs.otago.ac.nz> On 13/09/2012, at 4:58 AM, David Mercer wrote: > (2) How would we handle semantically related but dependency unrelated > functions, such as start & stop, push & pop, add & remove, etc.? Eiffel-style controlled vocabulary and manual SEE-ALSO links, possibly pattern-specified. From yousuke.hara@REDACTED Thu Sep 13 03:00:25 2012 From: yousuke.hara@REDACTED (Yousuke Hara) Date: Thu, 13 Sep 2012 10:00:25 +0900 Subject: [erlang-questions] [ANN] LeoFS v0.10.1 (S3 Compatible Storage) In-Reply-To: References: <8BDCBF70-3CFF-48C1-A060-C17AAE8D0DBB@gmail.com> Message-ID: Hi Kunthar, I will release "LeoTamer" as Web Console at the middle of October. LeoFS's milestones are here: As LeoTamer's initial release on October, I will provide log-analysis and log-search function. Also, Regarding LeoFS's system console function, I will provide on November. LeoTamer's screenshots: Best regards, Yosuke Hara > On Wed, Sep 12, 2012 at 11:32 PM, Kunthar wrote: >> Hi Yousuke, >> >> Do you have any plans to put frontend web console to see and manage overall >> operations of LeoFS? >> >> BR, >> Kunthar >> >> >> On Wed, Sep 12, 2012 at 1:26 PM, Yousuke Hara wrote: >>> Hi, >>> >>>>> We have released LeoFS v0.10.1. In this version, LeoFS's performance >>>>> improved 20% up. >>>> >>>> How? Compared to what (previous version)? >>> >>> Yes, I compared v0.10.0 (prev-version) with v0.10.1 when I used basho_bench. >>> I confirmed latency and operation/sec between prev-version and v0.10.1. >>> >>> * basho_bench >>> >>> >>>> What change did you introduced in this release? >>> Change-log is here: >>> >>> >>> >>> Best regards, >>> Yosuke Hara >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> -- >> BR, >> \|/ Kunthar > > > > -- > Yosuke Hara -- Yosuke Hara From mononcqc@REDACTED Thu Sep 13 03:38:57 2012 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 12 Sep 2012 21:38:57 -0400 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <963BB99B-1335-446D-B4FE-878213A2B780@cs.otago.ac.nz> References: <5050767F.6040901@ferd.ca> <963BB99B-1335-446D-B4FE-878213A2B780@cs.otago.ac.nz> Message-ID: <50513931.6060406@ferd.ca> Some Schemes also allow things like: (define (fib x) (define (fib-rec n a b) (cond [(= n 0) b] [true (fib-rec (- n 1) b (+ a b))])) (fib-rec x 0 1)) which can be called as(fib 4). This allows to define private or helper functions within the context of their main function, without needing destructive assignment or whatever, and then later on executing it. Python allows something similar: def fib(x): def fib_rec(x, a, b): if x == 0: return b else: return fib_rec(x-1, b, a+b) return fib_rec(x, 0, 1) though it would be nicer if Python indeed had tail recursion ;) Whether the functions come before or after the final higher-level call doesn't especially matter to me, but code becomes way nicer to read to me when described that way. You can separate one-use helpers from module-wide helpers that way, too. Nothing would keep us from doing something similar in Erlang iff anonymous functions were not so anonymous (and if self-recursion in anonymous function wasn't that annoying to read). On 12-09-12 5:59 PM, Richard O'Keefe wrote: > On 12/09/2012, at 11:48 PM, Fred Hebert wrote: > >> This is the approach I like the most. >> >> It's something I picked up when working with Scheme, where functions can contain the definitions of their helpers within them, which made the code much clearer to me. > Scheme and ML have features that make this rather more useful > than it is in languages like Clean and Haskell. In ML you can > write > local > > in > > end > > and this has the effect that the things defined in > are visible in definitions>, but not outside, while the things > defined in are visible outside. > For example, you might have > > local > fun rebalance t = ... > in > fun add k v t = ... > fun del k t = ... > end > > Scheme lets you hack this by doing > (define add) > (define del) > (letrec ((rebalance (lambda (t) ...)) > (set! add (lambda (k v t) ...)) > (set! del (lambda (k t) ...)) > 'ok) > > I see this quite a lot in Scheme. > If Joe's still thinking about Erlang 2, I hope he'll consider > the functionality of local-in-end. > > From ok@REDACTED Thu Sep 13 04:38:23 2012 From: ok@REDACTED (Richard O'Keefe) Date: Thu, 13 Sep 2012 14:38:23 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <50513931.6060406@ferd.ca> References: <5050767F.6040901@ferd.ca> <963BB99B-1335-446D-B4FE-878213A2B780@cs.otago.ac.nz> <50513931.6060406@ferd.ca> Message-ID: <525A6A1D-28EF-4FE9-94B6-559E5DF5834C@cs.otago.ac.nz> On 13/09/2012, at 1:38 PM, Fred Hebert wrote: > Some Schemes also allow things like: > > (define (fib x) > (define (fib-rec n a b) > (cond [(= n 0) b] > [true (fib-rec (- n 1) b (+ a b))])) > (fib-rec x 0 1)) > > which can be called as(fib 4). I think you missed the point. Except for the use of square brackets, this is absolutely standard RnRS Scheme for at least n = 2..5. It is also trivial and in this context unhelpful, because a helper function defined this way is necessarily private to its client. You can do _this_ much in practically every functional language but Erlang. Defining one function inside another is just plain not interesting; we've been able to do _that_ since 1960. Only languages in the BCPL->C->C++->Java lineage think there is anything unusual or tricky about *that*. (Even Fortran and COBOL let you defined nested procedures.) Heck, even in Erlang you can do fib(X) -> F = fun (_, 0, _, B) -> B ; (G, N, A, B) -> G(G, N-1, B, A+B) end, F(F, X, 0, 1). > This allows to define private or helper functions within the context of their main function, without needing destructive assignment or whatever, and then later on executing it. Even Scheme doesn't _really_ need destructive assignment; you can manage without it by introducing an auxiliary name: (define add-and-del (letrec ((rebalance (lambda (t) ...)) (list (lambda (k v t) ...)) ;add (lambda (k t) ...)))) ;del (define add (car add-and-del)) (define del (cadr add-and-del)) Common Lisp lets you get the multiple-private-helpers- shared-by-multiple-clients effect by bending the scope rules rather horribly: (labels ((rebalance (t) ...)) (defun add (k v t) ...) (defun del (k t) ...)) DEFUN always "Defines a new function ... in the global environment." The mechanics are of no great interest, what is of interest is the ability by _some_ mechanism to have one or more helper functions that are *outside* their clients (so they do *not* have access to the clients' internal data) and are accessible to one or *more* clients without being accessible to _all_ the top-level functions in the module. Defining a function inside another function does NOT allow - private helper functions used by two or more functions (which was the point of what I was talking about) - private helper functions used in more than one clause of the same function, a very important issue in Erlang. > Python allows something similar: > > def fib(x): > def fib_rec(x, a, b): > if x == 0: > return b > else: > return fib_rec(x-1, b, a+b) > return fib_rec(x, 0, 1) Yawn. So Python has caught up with 1960. This *still* cannot handle the non-trivial case of a helper function shared by more than one function. > > You can separate one-use helpers from module-wide helpers that way, too. Yes, that's been pretty much obvious since 1960. The issue is helpers that are NEITHER one-use NOR module-wide. Non-functional languages usually go for nested modules for that. Like I said, I don't care about the mechanics. > > Nothing would keep us from doing something similar in Erlang iff anonymous functions were not so anonymous (and if self-recursion in anonymous function wasn't that annoying to read). I don't see anything *annoying* in F = fun (_, 0, _, B) -> B ; (G, N, A, B) -> G(G, N-1, B, A+B) end, Mildly irritating, yes; annoying, no. I seem to recall suggesting a small syntax extension where fun F(X, Y, Z) -> ... F(...) ... ; F(...) ... F ... end would turn into F = (fun (G) -> fun (X, Y, Z) -> G(G, X, Y, Z) end end) (fun (F, X, Y, Z) -> ... F(F,...) ... ; (F, ...) ... fun (X, Y, Z) -> G(G, X, Y, Z) end ... end) but on the whole, perhaps not. From mononcqc@REDACTED Thu Sep 13 04:48:43 2012 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 12 Sep 2012 22:48:43 -0400 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <525A6A1D-28EF-4FE9-94B6-559E5DF5834C@cs.otago.ac.nz> References: <5050767F.6040901@ferd.ca> <963BB99B-1335-446D-B4FE-878213A2B780@cs.otago.ac.nz> <50513931.6060406@ferd.ca> <525A6A1D-28EF-4FE9-94B6-559E5DF5834C@cs.otago.ac.nz> Message-ID: <5051498B.7060606@ferd.ca> I was agreeing with you, just showing an alternative form from the one you showed. I don't know what you're trying to convince me of there. On Wed Sep 12 22:38:23 2012, Richard O'Keefe wrote: > > On 13/09/2012, at 1:38 PM, Fred Hebert wrote: > >> Some Schemes also allow things like: >> >> (define (fib x) >> (define (fib-rec n a b) >> (cond [(= n 0) b] >> [true (fib-rec (- n 1) b (+ a b))])) >> (fib-rec x 0 1)) >> >> which can be called as(fib 4). > > I think you missed the point. Except for the use of square brackets, > this is absolutely standard RnRS Scheme for at least n = 2..5. It is > also trivial and in this context unhelpful, because a helper function > defined this way is necessarily private to its client. You can do > _this_ much in practically every functional language but Erlang. > > Defining one function inside another is just plain not interesting; > we've been able to do _that_ since 1960. Only languages in the > BCPL->C->C++->Java lineage think there is anything unusual or > tricky about *that*. (Even Fortran and COBOL let you defined > nested procedures.) > > Heck, even in Erlang you can do > > fib(X) -> > F = fun (_, 0, _, B) -> B > ; (G, N, A, B) -> G(G, N-1, B, A+B) > end, > F(F, X, 0, 1). > > >> This allows to define private or helper functions within the context of their main function, without needing destructive assignment or whatever, and then later on executing it. > > Even Scheme doesn't _really_ need destructive assignment; > you can manage without it by introducing an auxiliary name: > > (define add-and-del > (letrec ((rebalance (lambda (t) ...)) > (list (lambda (k v t) ...)) ;add > (lambda (k t) ...)))) ;del > (define add (car add-and-del)) > (define del (cadr add-and-del)) > > Common Lisp lets you get the multiple-private-helpers- > shared-by-multiple-clients effect by bending the > scope rules rather horribly: > > (labels ((rebalance (t) ...)) > (defun add (k v t) ...) > (defun del (k t) ...)) > > DEFUN always "Defines a new function ... in the global environment." > > The mechanics are of no great interest, > what is of interest is the ability by _some_ mechanism > to have one or more helper functions that are > *outside* their clients (so they do *not* have access to > the clients' internal data) and are accessible to one or > *more* clients without being accessible to _all_ the > top-level functions in the module. > > Defining a function inside another function does NOT allow > - private helper functions used by two or more functions > (which was the point of what I was talking about) > - private helper functions used in more than one clause > of the same function, a very important issue in Erlang. > >> Python allows something similar: >> >> def fib(x): >> def fib_rec(x, a, b): >> if x == 0: >> return b >> else: >> return fib_rec(x-1, b, a+b) >> return fib_rec(x, 0, 1) > > Yawn. So Python has caught up with 1960. This *still* cannot > handle the non-trivial case of a helper function shared by more > than one function. >> >> You can separate one-use helpers from module-wide helpers that way, too. > > Yes, that's been pretty much obvious since 1960. > The issue is helpers that are NEITHER one-use NOR module-wide. > > Non-functional languages usually go for nested modules for that. > Like I said, I don't care about the mechanics. >> >> Nothing would keep us from doing something similar in Erlang iff anonymous functions were not so anonymous (and if self-recursion in anonymous function wasn't that annoying to read). > > I don't see anything *annoying* in > F = fun (_, 0, _, B) -> B > ; (G, N, A, B) -> G(G, N-1, B, A+B) > end, > Mildly irritating, yes; annoying, no. > I seem to recall suggesting a small syntax > extension where > > fun F(X, Y, Z) -> ... F(...) ... > ; F(...) ... F ... > end > > would turn into > > F = (fun (G) -> fun (X, Y, Z) -> G(G, X, Y, Z) end end) > (fun (F, X, Y, Z) -> ... F(F,...) ... > ; (F, ...) ... fun (X, Y, Z) -> G(G, X, Y, Z) end ... > end) > > but on the whole, perhaps not. > From gianfranco.alongi@REDACTED Thu Sep 13 07:39:36 2012 From: gianfranco.alongi@REDACTED (Gianfranco Alongi) Date: Thu, 13 Sep 2012 07:39:36 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <963BB99B-1335-446D-B4FE-878213A2B780@cs.otago.ac.nz> References: <5050767F.6040901@ferd.ca> <963BB99B-1335-446D-B4FE-878213A2B780@cs.otago.ac.nz> Message-ID: I've been following this whole thread with mild amusement and I am siding with Richard on this. I would go the extra mile to and say, documentation that is not executable to test for correctness is sure to rot. So, on top of the mind-cycle-wasting comments which section the source file in obvious ways, we have these others which just state the obvious and then go bad when the code changes. In general I get a strong feeling that people who don't feel comfortable with the language, riddle it with sectioning comments in order to feel some form of control. I can't be the only one who read The Pragmatic Programmer: From Journeyman to Master, Clean Code and The Clean Coder. /G On Wed, Sep 12, 2012 at 11:59 PM, Richard O'Keefe wrote: > > On 12/09/2012, at 11:48 PM, Fred Hebert wrote: > >> This is the approach I like the most. >> >> It's something I picked up when working with Scheme, where functions can contain the definitions of their helpers within them, which made the code much clearer to me. > > Scheme and ML have features that make this rather more useful > than it is in languages like Clean and Haskell. In ML you can > write > local > > in > > end > > and this has the effect that the things defined in > are visible in definitions>, but not outside, while the things > defined in are visible outside. > For example, you might have > > local > fun rebalance t = ... > in > fun add k v t = ... > fun del k t = ... > end > > Scheme lets you hack this by doing > (define add) > (define del) > (letrec ((rebalance (lambda (t) ...)) > (set! add (lambda (k v t) ...)) > (set! del (lambda (k t) ...)) > 'ok) > > I see this quite a lot in Scheme. > If Joe's still thinking about Erlang 2, I hope he'll consider > the functionality of local-in-end. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From zabrane3@REDACTED Thu Sep 13 07:43:42 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Thu, 13 Sep 2012 07:43:42 +0200 Subject: [erlang-questions] Compiling Erlang with "Intel icc" on Linux In-Reply-To: References: <18D4FF6F-8E71-4633-AF42-F10B943C4E15@gmail.com> Message-ID: <7CE74B08-F90E-4A4E-9F93-21BF07C50C69@gmail.com> Hi Olivier, Could you share your (old) notes? Regards, Zabrane On Sep 13, 2012, at 2:34 AM, Olivier Girondel wrote: > I did once, but a long time ago, in another galaxy... I'd be interested to know how things are in 2012 :) > > On Thursday, September 13, 2012, Zabrane Mickael wrote: > Hi guys, > > Does anyone succeed to compile Erlang with icc v11+ or v12+ on Linux? > If yes, what are the steps to follow? > > Thanks in advance. > > Regards, > Zabrane > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -- > Olivier -------------- next part -------------- An HTML attachment was scrubbed... URL: From zabrane3@REDACTED Thu Sep 13 07:45:17 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Thu, 13 Sep 2012 07:45:17 +0200 Subject: [erlang-questions] Compiling Erlang with "Intel icc" on Linux In-Reply-To: References: <18D4FF6F-8E71-4633-AF42-F10B943C4E15@gmail.com> Message-ID: <08ECF4DF-4429-496F-8D1A-4F0CDFC1BDE2@gmail.com> Hi Anders, This is related to MSVC (not "Intel icc"), right? Regards, Zabrane On Sep 13, 2012, at 12:47 AM, Anders Nygren wrote: > The erlang documentation about building on Windows says this, about > using gcc for one file. > > http://www.erlang.org/doc/installation_guide/INSTALL-WIN32.html#id74682 > > "It's because that particular file, beam_emu.c benefits immensely from > being able to use the GCC labels-as-values extension, which boosts > emulator performance by up to 50%." > > /Anders > > On Wed, Sep 12, 2012 at 5:20 PM, Zabrane Mickael wrote: >> Hi guys, >> >> Does anyone succeed to compile Erlang with icc v11+ or v12+ on Linux? >> If yes, what are the steps to follow? >> >> Thanks in advance. >> >> Regards, >> Zabrane >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From yrashk@REDACTED Thu Sep 13 08:50:14 2012 From: yrashk@REDACTED (Yurii Rashkovskii) Date: Wed, 12 Sep 2012 23:50:14 -0700 Subject: [erlang-questions] "What's Elixir?" Webinar Message-ID: Hi, Elixir (http://elixir-lang.org) is a functional meta-programming aware language built on top of the Erlang VM. It is a dynamic language with flexible and homoiconic syntax that leverages Erlang's abilities to build concurrent, distributed, fault-tolerant applications with hot code upgrades. Some say Elixir is like CoffeeScript for Erlang. To extent, this is true. But it is much more than that that ? it combines the raw power of Erlang VM with Lisp-like macros, more familiar kind of syntax, some features from Clojure and a strong focus on usability... not to mention its own evolving standard library (which is quite nice!) I am going to run a webinar next month (Oct 13), explaining the basics of the language and going through creating a test application in it. Register at http://wexw12.eventbrite.com/ and see you next month! Yurii. From janburse@REDACTED Thu Sep 13 10:37:38 2012 From: janburse@REDACTED (Jan Burse) Date: Thu, 13 Sep 2012 10:37:38 +0200 Subject: [erlang-questions] Mini-Erlang for Android In-Reply-To: <4F855B03.6060103@fastmail.fm> References: <4F7CDE52.6030903@fastmail.fm> <4F7D5D9B.9030806@fastmail.fm> <4F7D5F75.8020200@fastmail.fm> <4F7D92F1.3070507@meetinghouse.net> <4F7DD587.4000805@fastmail.fm> <4F7DE780.1020703@meetinghouse.net> <4F7E0194.9030902@fastmail.fm> <723E18E1-FB6A-4794-81BA-F6E9DC5707E2@cs.otago.ac.nz> <4F855B03.6060103@fastmail.fm> Message-ID: <50519B52.2040306@fastmail.fm> Dear All, I just gave it a try whether the Mini-Erlang interpreter also runs on Android. Since release 0.9.5 the Jekejeke Runtime also features a console and this is also available for Android. It worked fine. So before I went into lengths using Bluetooth, SD-Cards, USB, E-mail whatever to move the Prolog text erlang.p to my phone, I simply pointed an URL to the Prolog text and consulted this URL. The session run as follows: Jekejeke Prolog, Runtime Library 0.9.5 (c) 1985-2012, XLOG Technologies GmbH, Switzerland ?- ['http://www.xlog.ch/jekejeke/perpetual/erlang.p']. Yes ?- erlang. > X=1. 1 > X. 1 > (Screenshot can be seen here: http://plus.google.com/u/0/103259555581227445618/posts/ETumkLpHVXE) To abort the session one can use the menu item abort. The Jekejeke Runtime doesn't have a debugger and is free, currently available from Google Play and Amazone Appstore (U.S. only). Enjoy! Jan Burse, 13. Sept 2012 P.S.: One can of course put his preferred Prolog text on a web server of his choice, consult this and play. But sys_add_path/1 doesn't currently work for URL archives in release 0.9.5 for Android. Jan Burse schrieb: > General Questions: > > - Would it be allowed to make a Erlang language realization? > - Any legal problems with copyright or so? > - Any ways to certify it, i.e. test suite etc.? > > Bye > > Richard O'Keefe schrieb: >> >> On 6/04/2012, at 8:33 AM, Jan Burse wrote: >>> BTW: One can easily build and run code >>> written in the Erlang language with other >>> tool-sets and runtimes. Here is a very small >>> experiment: >>> https://plus.google.com/u/0/b/103259555581227445618/103259555581227445618/posts/KQrBA5yECpq >>> >> >> Follow the links to >> http://www.xlog.ch/jekejeke/perpetual/erlang.p >> and you find something with >> - no concurrency >> - no hot loading >> - no modules >> - no functions >> - no conditionals >> ... >> It's so mini it's Zero. >> >> As an experiment, it's a dud. >> >> "Precise Garbage Collection in Prolog" is an interesting paper, though. >> >> >> >> > From bourinov@REDACTED Thu Sep 13 11:34:57 2012 From: bourinov@REDACTED (Max Bourinov) Date: Thu, 13 Sep 2012 13:34:57 +0400 Subject: [erlang-questions] Erlang nodes monitoring Message-ID: Hello Erlangers, Looking for a tool/library that I can integrate into my Erlang apps to do the following: - collect stats from running nodes - collect all crash reports - send them to the central repo (would be good to use RabbitMQ as transport and PostgreSQL are DB) - optionally: accept user defined metrics (those I will define) - optionally send alert emails in some cases (for certain crashes for example)... Motivation: I have many Erlang nodes running. I want to monitor them in one place. Best regards, Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Thu Sep 13 16:20:10 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 13 Sep 2012 18:20:10 +0400 Subject: [erlang-questions] What is the proper way to use alarm_handler + memsup? Message-ID: Some users say that erlyvideo is leaking memory under some suspicious circumstances and crashes with OOM. I want to add alarm_handler that catches {set_alarm,{process_memory_high_watermark,<0.1837.0>}} dumps full information about system state and kills this process. Is it a right way to go? From juzejian@REDACTED Thu Sep 13 17:10:27 2012 From: juzejian@REDACTED (zejian ju) Date: Thu, 13 Sep 2012 23:10:27 +0800 Subject: [erlang-questions] erlang source code browser Message-ID: hi all, i need one tool to convert erlang source code file into html web page, so that i can browse them by my web browser. there's example for other languages, just like this for scala: http://xuwei-k.github.com/play-sxr/play-2.9.1-2.0/play/play/Application.java.html after a google search, i only find one project at google code: erl-escobar, it only has source code highlighted, no cross reference, and no update from 2007. who can give me some hint about this? any response will be appreciated. zenk From zabrane3@REDACTED Thu Sep 13 17:16:22 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Thu, 13 Sep 2012 17:16:22 +0200 Subject: [erlang-questions] erlang source code browser In-Reply-To: References: Message-ID: <83FAFBF3-F852-46C0-92AE-0672582CD736@gmail.com> Give Pablo a try: http://code.google.com/p/erl-escobar/ Regards, Zabrane On Sep 13, 2012, at 5:10 PM, zejian ju wrote: > hi all, > > i need one tool to convert erlang source code file into html web page, > so that i can browse them by my web browser. there's example for other > languages, just like this for scala: > http://xuwei-k.github.com/play-sxr/play-2.9.1-2.0/play/play/Application.java.html > > after a google search, i only find one project at google code: > erl-escobar, it only has source code highlighted, no cross reference, > and no update from 2007. who can give me some hint about this? > > any response will be appreciated. > > zenk > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From toby@REDACTED Thu Sep 13 17:33:49 2012 From: toby@REDACTED (Toby Thain) Date: Thu, 13 Sep 2012 11:33:49 -0400 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <5050767F.6040901@ferd.ca> <963BB99B-1335-446D-B4FE-878213A2B780@cs.otago.ac.nz> Message-ID: <5051FCDD.1030808@telegraphics.com.au> On 13/09/12 1:39 AM, Gianfranco Alongi wrote: > ... > I can't be the only one who read The Pragmatic Programmer: From > Journeyman to Master, Clean Code and The Clean Coder. Don't miss "The Elements of Programming Style", Kernighan & Plauger. --Toby > > /G > From zabrane3@REDACTED Thu Sep 13 17:41:18 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Thu, 13 Sep 2012 17:41:18 +0200 Subject: [erlang-questions] erlang source code browser In-Reply-To: References: Message-ID: <84A3D33B-CE9A-4676-8F07-070C99DC53AB@gmail.com> Also, have a look to Ejabber devdoc. It uses Escobar with cross-reference: http://www.process-one.net/docs/ejabberd/devdoc/trunk/ Regards, Zabrane On Sep 13, 2012, at 5:10 PM, zejian ju wrote: > hi all, > > i need one tool to convert erlang source code file into html web page, > so that i can browse them by my web browser. there's example for other > languages, just like this for scala: > http://xuwei-k.github.com/play-sxr/play-2.9.1-2.0/play/play/Application.java.html > > after a google search, i only find one project at google code: > erl-escobar, it only has source code highlighted, no cross reference, > and no update from 2007. who can give me some hint about this? > > any response will be appreciated. > > zenk > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From juzejian@REDACTED Thu Sep 13 18:51:21 2012 From: juzejian@REDACTED (zejian ju) Date: Fri, 14 Sep 2012 00:51:21 +0800 Subject: [erlang-questions] erlang source code browser In-Reply-To: <83FAFBF3-F852-46C0-92AE-0672582CD736@gmail.com> References: <83FAFBF3-F852-46C0-92AE-0672582CD736@gmail.com> Message-ID: thanks for your reply. i noticed this google code project, and have contacted the author, he told me till now, only the highlight is finished. i checked ejabber's doc too, in fact it has no cross reference for the function reference. 2012/9/13, Zabrane Mickael :. > Give Pablo a try: > http://code.google.com/p/erl-escobar/ > > Regards, > Zabrane > > On Sep 13, 2012, at 5:10 PM, zejian ju wrote: > >> hi all, >> >> i need one tool to convert erlang source code file into html web page, >> so that i can browse them by my web browser. there's example for other >> languages, just like this for scala: >> http://xuwei-k.github.com/play-sxr/play-2.9.1-2.0/play/play/Application.java.html >> >> after a google search, i only find one project at google code: >> erl-escobar, it only has source code highlighted, no cross reference, >> and no update from 2007. who can give me some hint about this? >> >> any response will be appreciated. >> >> zenk >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > > From juzejian@REDACTED Fri Sep 14 01:33:41 2012 From: juzejian@REDACTED (zejian ju) Date: Fri, 14 Sep 2012 07:33:41 +0800 Subject: [erlang-questions] erlang source code browser In-Reply-To: <55F1C61D-1E38-4F0E-9E22-FD706CCA9BF3@jtendo.com> References: <55F1C61D-1E38-4F0E-9E22-FD706CCA9BF3@jtendo.com> Message-ID: you mean vim's erlang syntax file? but i need a html version 2012/9/13, Adam Rutkowski : > > On 13 Sep 2012, at 17:10, zejian ju wrote: > >> hi all, >> >> i need one tool to convert erlang source code file into html web page, >> so that i can browse them by my web browser. there's example for other >> languages, just like this for scala: >> http://xuwei-k.github.com/play-sxr/play-2.9.1-2.0/play/play/Application.java.html >> >> after a google search, i only find one project at google code: >> erl-escobar, it only has source code highlighted, no cross reference, >> and no update from 2007. who can give me some hint about this? > > vim's :TOhtml plus a couple of macros dealing with linking, perhaps? > (macros would have to use regexps though) > > -- > AR > > > > > > > > > > From steven.charles.davis@REDACTED Fri Sep 14 01:56:40 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Thu, 13 Sep 2012 16:56:40 -0700 (PDT) Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> Message-ID: <10dd1cd8-419a-4432-8344-9924b7d3b0c7@googlegroups.com> Yes, to me that stuff seems to be obvious and distracting BS. e.g. anything "internal" isn't exported by definition, right? There *is* an issue between making a distinction between -export for API use and -export needed for use only within the app or library. Anything else is not a weakness of erlang syntax IMHO. /s On Wednesday, September 12, 2012 2:56:31 AM UTC-5, Richard O'Keefe wrote: > > I was looking at some Erlang code today, > and it had comments like > > % Include files > % External exports > % Internal exports > % Macros > % Records > % External functions > % Internal functions > > only bulked up, and present even when the sections were empty. > > I take the definition of a "junk comment" to be > "a comment that repeats something immediately obvious > from the adjacent code". > > I can tell > an include because it starts with -include > an export because it starts with -export > a macro because it starts with -defined > a record because it starts with -record > a function because it does not start with - > so most of these are technically junk comments. > > In fact they remind most unpleasantly of COBOL (IDENTIFICATION > DIVISION, DATA DIVISION, PROCEDURE DIVISION) and Classic Pascal's > rigid (label; const; type; var; procedure; begin) ordering. > > In fact this ordering strikes me as pernicious in a very very > similar way. Suppose for example I have a sliding window module > in which there is > > %------------------------ > % Purging > %------------------------ > > purge(Window) -> ... > > and this function uses a number of helper functions and macros > that are not used in other parts of the file. I want to put > them *here*, close by the function(s) needing them, not to rip > them away from their context just because some boilerplate comment > says so. > > In fact I had been thinking about proposing a conventional use > of an attribute: > > -section(creating). > -section(adding). > -section(purging). > -section(testing). > -section(formatting). > > This is something that is already allowed by Erlang syntax, so there > is no actual language change. The proposal is to use _this_ attribute > for _this_ purpose: *semantic* sectioning. > > Yes, the debt to the Smalltalk 4-pane browser and its "method > categories" *is* pretty obvious, isn't it? > > The function of the -section attribute is to provide something a > text editor can set automatic bookmarks from or at least let you > search for, that _cannot_ be trivially determined from the source > code. > > Have I missed an important benefit of the rigid syntactic ordering? > > While I'm at it, why don't other people sort their export lists into > alphabetic order? > > function and its supporte > > _______________________________________________ > erlang-questions mailing list > erlang-q...@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From siraaj@REDACTED Fri Sep 14 02:13:32 2012 From: siraaj@REDACTED (Siraaj Khandkar) Date: Thu, 13 Sep 2012 20:13:32 -0400 Subject: [erlang-questions] erlang source code browser In-Reply-To: References: <55F1C61D-1E38-4F0E-9E22-FD706CCA9BF3@jtendo.com> Message-ID: <67720F85-1471-474C-821C-450B1FCD4511@khandkar.net> This: vim -c TOhtml mymodule.erl -c wqa Gives you this: mymodule.erl.html On Sep 13, 2012, at 7:33 PM, zejian ju wrote: > you mean vim's erlang syntax file? but i need a html version > > 2012/9/13, Adam Rutkowski : >> >> On 13 Sep 2012, at 17:10, zejian ju wrote: >> >>> hi all, >>> >>> i need one tool to convert erlang source code file into html web page, >>> so that i can browse them by my web browser. there's example for other >>> languages, just like this for scala: >>> http://xuwei-k.github.com/play-sxr/play-2.9.1-2.0/play/play/Application.java.html >>> >>> after a google search, i only find one project at google code: >>> erl-escobar, it only has source code highlighted, no cross reference, >>> and no update from 2007. who can give me some hint about this? >> >> vim's :TOhtml plus a couple of macros dealing with linking, perhaps? >> (macros would have to use regexps though) -- Siraaj Khandkar .o. ..o ooo From goofan.su@REDACTED Fri Sep 14 04:55:31 2012 From: goofan.su@REDACTED (goofansu) Date: Thu, 13 Sep 2012 19:55:31 -0700 (PDT) Subject: [erlang-questions] Compile with flag --with-dynamic-trace=systemtap failed Message-ID: <1347591331599-4655144.post@n4.nabble.com> dtrace: failed to compile script emulator/beam/erlang_dtrace.d: Preprocessor not found configure: error: Could not precompile erlang_dtrace.d: dtrace -h failed configure: error: /root/otp/erts/configure failed for erts OS: fedora17 I've installed systemtap. Shall I install dtrace? -- View this message in context: http://erlang.2086793.n4.nabble.com/Compile-with-flag-with-dynamic-trace-systemtap-failed-tp4655144.html Sent from the Erlang Questions mailing list archive at Nabble.com. From ok@REDACTED Fri Sep 14 06:30:28 2012 From: ok@REDACTED (Richard O'Keefe) Date: Fri, 14 Sep 2012 16:30:28 +1200 Subject: [erlang-questions] erlang source code browser In-Reply-To: References: <83FAFBF3-F852-46C0-92AE-0672582CD736@gmail.com> Message-ID: <838F3B71-B0DF-4C3D-8599-6AECE2D9D0F1@cs.otago.ac.nz> I have my own multi-programming-language => multiple markup language program, and it does handle Erlang, but it doesn't do cross-references. There are three reasons for this: (a) it started as a program for transforming code snippets to LaTeX for inclusion in books, papers, handouts; (b) because it handles so many languages, some of them with dynamic syntax, it does no actual parsing, so cannot determine arity of functions; (c) thanks to the Erlang preprocessor, and the ability to plug transformation modules in, you can't actually parse Erlang source code without *being* Erlang. Consider this little gem: -module(ouzo). -export([pine/1]). -define(PINE, cone). -define(BARK, ?PINE(2, (?PINE(1), 3))). pine(1) -> ?PINE(1); pine(2) -> ?PINE(2, 3); pine(3) -> ?BARK. ?PINE(1) -> ok. ?PINE(2, 3) -> ok. Suppose you have your cursor ?PINE(1) and you want there to be a link that will take you to the definition of the function being called. It's easy enough to get to the -define line, but getting to cone/1 is another matter. Or suppose you have your cursor ?BARK and you want to link to "the" function. Is it cone/1 or cone/2? Is it any wonder that I jumped up and down shouting "Delenda est preprocessor!" until I realised I was never going to get anywhere? (The best C to HTML tool I know of hooks into a C preprocessor. I had a bit of a struggle with the installation process because of that.) From ok@REDACTED Fri Sep 14 06:42:52 2012 From: ok@REDACTED (Richard O'Keefe) Date: Fri, 14 Sep 2012 16:42:52 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <10dd1cd8-419a-4432-8344-9924b7d3b0c7@googlegroups.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <10dd1cd8-419a-4432-8344-9924b7d3b0c7@googlegroups.com> Message-ID: <3F036646-8198-407A-B8C7-D291F13A419F@cs.otago.ac.nz> On 14/09/2012, at 11:56 AM, Steve Davis wrote: > There *is* an issue between making a distinction between -export for API use and -export needed for use only within the app or library. That is what -export_to was invented for. It's not just that you want to >say< that something is exported for very specific reasons, you want to >enforce< that it's only usable by things you mean to export it to. It is also more precise than "internal exports", which I used to think only meant functions exported back to the module itself for use with 'apply'. The intellectual debt to Eiffel's {targeting} of feature availability seems obvious, but if memory serves me correctly, I thought of -export_to before I learned Eiffel. From gumm@REDACTED Fri Sep 14 06:46:22 2012 From: gumm@REDACTED (Jesse Gumm) Date: Thu, 13 Sep 2012 23:46:22 -0500 Subject: [erlang-questions] Third party comment systems that natively support Erlang for codeblocks? Message-ID: Hello Erlangers! Does anyone know of any third-party comment systems (similar to Disqus) that natively support Erlang syntax-highlighting as a language for code-blocks? Disqus currently supports a handful of the more popular languages, but does not currently support Erlang. I'm a fan of Disqus, but the lack of Erlang support puts a roadblock in my path here. The main criteria is that I'd like to be able to just add a simple script to an HTML page and have it do all the magic. Any thoughts on this? -Jesse -- Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm From pprogstudy@REDACTED Fri Sep 14 08:54:31 2012 From: pprogstudy@REDACTED (Sebastian Nanz) Date: Fri, 14 Sep 2012 08:54:31 +0200 Subject: [erlang-questions] Comparative study involving Erlang Message-ID: Hi All, At ETH Zurich, we are conducting a comparative study of diverse programming approaches to concurrency and parallelism regarding both usability and performance. To ensure that the selected approaches (Erlang is one of them) are represented accurately, we are dependent on feedback from experts. We are looking for a volunteer to help us by reviewing some code written in Erlang. We implemented a suite of 6 problems in each of the languages surveyed. You would be asked to briefly comment on how the Erlang solutions could be improved in terms of performance and style. For an experienced Erlang developer, we would expect that this takes only a few hours. By contributing you can ensure that Erlang is represented accurately in the study; we would of course also acknowledge your help in the resulting publication. If you are interested, please email me directly with a short note about your Erlang expertise. Many thanks & best wishes, Sebastian -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.eugene.turner@REDACTED Fri Sep 14 09:00:54 2012 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Fri, 14 Sep 2012 16:00:54 +0900 Subject: [erlang-questions] Comparative study involving Erlang In-Reply-To: References: Message-ID: "You would be asked to briefly comment on how the Erlang solutions could be improved in terms of performance and style." What a nice antidote this could become, to the tendency outside the community to shoot first and ask questions later. My only concen is your requirement that the experts "briefly" comment. I see no reason to rule out Richard O'Keefe at this stage of recruitment. ^_~ -michael turner On Fri, Sep 14, 2012 at 3:54 PM, Sebastian Nanz wrote: > Hi All, > > At ETH Zurich, we are conducting a comparative study of diverse programming > approaches to concurrency and parallelism regarding both usability and > performance. To ensure that the selected approaches (Erlang is one of them) > are represented accurately, we are dependent on feedback from experts. > > We are looking for a volunteer to help us by reviewing some code written in > Erlang. We implemented a suite of 6 problems in each of the languages > surveyed. You would be asked to briefly comment on how the Erlang solutions > could be improved in terms of performance and style. For an experienced > Erlang developer, we would expect that this takes only a few hours. By > contributing you can ensure that Erlang is represented accurately in the > study; we would of course also acknowledge your help in the resulting > publication. > > If you are interested, please email me directly with a short note about your > Erlang expertise. > > Many thanks & best wishes, > Sebastian > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From burobjorn@REDACTED Fri Sep 14 13:45:54 2012 From: burobjorn@REDACTED (BjornW) Date: Fri, 14 Sep 2012 13:45:54 +0200 Subject: [erlang-questions] Presentation on Erlang in Utrecht the Netherlands, looking for speaker on 27th sept or 25th oct or 29 nov. Message-ID: <505318F2.1090401@gmail.com> Hi, I wasn't sure were to send this email, so please excuse me if this is the wrong place to ask these things and please point me in the right direction. My name is Bjorn Wijers and I'm organizing together with Jeroen Tietema a local informal grassroots technology oriented meetup in Utrecht the Netherlands called HackersNL* For our next few meetups we're looking for people to speak about certain topics. One of those topics is programming languages (previously we've had a speaker on Scala) and we'd like to invite a speaker on Erlang. Is there anyone on this list located in the Netherlands who would be interested in giving a talk on Erlang for free? Please let us know and send a mail to contact@REDACTED Alhtough our website and meetups are usually in Dutch we welcome English speakers as well. For those of you interested have a look at our website http://hackersnl.nl or send us an email: contact@REDACTED * it will soonish be renamed into BEEA which stands for Bits Electrons and Atoms in Dutch. grtz BjornW -- met vriendelijke groet, Bjorn Wijers * b u r o b j o r n .nl * digitaal vakmanschap | digital craftsmanship Werkdagen: Van maandag t/m donderdag vanaf 10:00 Vrijdag is voor experimenteren en eigen projecten. Postbus 14145 3508 SE Utrecht The Netherlands tel: +31 6 49 74 78 70 http://www.burobjorn.nl From lukas@REDACTED Fri Sep 14 15:05:14 2012 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 14 Sep 2012 15:05:14 +0200 Subject: [erlang-questions] Compile with flag --with-dynamic-trace=systemtap failed In-Reply-To: <1347591331599-4655144.post@n4.nabble.com> References: <1347591331599-4655144.post@n4.nabble.com> Message-ID: Hello, On our systemtap testmachine we have the dtrace command available: -bash-4.2$ dtrace --help Usage /usr/bin/dtrace [--help] [-h | -G] [-C [-I]] -s File.d [-o ] Where -h builds a systemtap header file from the .d file -C when used with -h, also run cpp preprocessor -o specifies an explicit output file name, the default for -G is file.o and -h is file.h -I when running cpp pass through this -I include Path -s specifies the name of the .d input file -G builds a stub file.o from file.d, which is required by some packages that use dtrace. I'm not the guy who has implemented/installed it for us, but I think that when you install systemtap you should also get a utility called dtrace. Lukas On Fri, Sep 14, 2012 at 4:55 AM, goofansu wrote: > dtrace: failed to compile script emulator/beam/erlang_dtrace.d: Preprocessor > not found > configure: error: Could not precompile erlang_dtrace.d: dtrace -h failed > configure: error: /root/otp/erts/configure failed for erts > > > OS: fedora17 > > I've installed systemtap. Shall I install dtrace? > > > > -- > View this message in context: http://erlang.2086793.n4.nabble.com/Compile-with-flag-with-dynamic-trace-systemtap-failed-tp4655144.html > Sent from the Erlang Questions mailing list archive at Nabble.com. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From asaguiar@REDACTED Fri Sep 14 15:05:06 2012 From: asaguiar@REDACTED (Alexandre Santos Aguiar) Date: Fri, 14 Sep 2012 10:05:06 -0300 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <474995FE-4180-4958-A271-923165B447F4@cs.otago.ac.nz> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <1363496b-422d-4082-80fe-cd844042de25@email.android.com> <474995FE-4180-4958-A271-923165B447F4@cs.otago.ac.nz> Message-ID: <201209141005.12179@spsconsultoria.com> Richard O'Keefe, Although my first impulse was simlpy ignore your message, I felt I could contribute some Physiology, Rhetorics and a little of IT on the discussion you yourself proposed about 'junk comments'. However, I noticed with extreme delay that the discussion under 'junk comments' really has nothing to do with 'junk comments' as further messages make it evident. Em Qua 12 Set 2012 ?s 20:59, fal?vamos sobre "Re: [erlang-questions] Style wars: junk comments", e voc? escreveu: > Ad (1), no, style is not primarily about discipline, it is > primarily about COMMUNICATION. Being *about* something is being *related to* something and not being something. Your statement does not contradict mine but actually adds that communication is related to standards and standards are related to discipline. > Style is not about aesthetics. This was incomplete: it shuold read 'style is not *only* about aesthetics'. Not a deadly omission, I guess. > we use STYLE to aid COMPREHENSION. STANDARDS (ouch, I am yelling too! :-D), as in my *full statement*, for communication. Every language, spoken or not, is (and it can't be otherwise) a *standard* or it won't be useful for communication if it is not a *standard*. Some can be more or less flexible. Spoken languages are flexible due to the very nature of our brains that are able to work fine in the presence of error or incomplete information. While computer programming languages are only written (not spoken) and computer work applies only to syntax, the portions of source code we call 'comments' are useless to the primary purpose (computer processing) and can simply be ignored by humans interested only on the syntax. Coments are used exclusively for (non verbal?) communication with other humans and, above all, in human fashion! As there are no rules for this communication through comments, that means there are no *standards*, comments may be neither effective nor efficient for communications. But as they can be effectively and efficiently ignored, there is no point in trying to impose the rigidity of computer language syntax (computers can't do their jobs in the presence even of minor errors in syntax) to human comments. Brains have neither the precision nor the consistency of computers. Human style won't meet machine standards no matter what you or anybody else may think about it. Comments in source code are free (both of freedom *and* of costs)! :-D This seeming uselessness of the topic you proposed might explain why nobody else cared about your points on 'junk comments' and went on to discuss syntax! I myself thought you had a point and really wanted to discuss issues on source code comments as this is unexplored subject and thus could result in some discovery provided some knowledge was applied to the problem. Sorry for taking you wrong. > > Note that your case report is perfect to demonstrate that printing > > should *not* be routine. > Bad logic. Yes, printing the *whole* thing should not be routine. > It does *NOT* follow that you should not print a small number of > modules. That, BTW, is *not* what is written in my message (this thing of small number of modules). You even agreed with what you called 'bad logic'. :-) > > At a 100 lines per page, handling a 1,000 pages (probably unindexed) > > is a hard task. > 50 to 60 lines per page would be more realistic. In Rhetoric it is a technique to use parameters against your argument when building a scenario. The proof of your point gets more effect. Is this explanation enough, sir? This is style, btw. :-) Using your *realistic* parameter would double the actual use of printing stuff. The factor 2 may not have been picked by chance, sir. :-) > Why on earth do you say "probably unindexed"? Because I have never seen an index in a printed listing of source code! Function X, page A, function Y, page B, etc. I guess this is not common practice and so, as I do not know but have limited (only personal) experience, I bayesianly stated 'probably'. My own prejudices are neither reality nor can be used to model reality. Is this reasoning ok for you, sir? > I've been wishing I had a paper copy. There is a reason for that: on screens humans read slower and retain less in memory. Human physiology sometimes is so limiting... :-) > > :-) And, of course, a waste. > Why "of course"? Printing something is a waste if and only if > the cost in time, paper, toner, environmental effects, &c > exceeds the benefits. If it gets read, especially if it gets > read more than once, *If* and only *if* it is read. That is not what happens according to studies in the 90's performed after it was learned that office computers doubled the consumption of paper. > But SCREEN space is limited. And the world should change the way people think because of screen space? If this is your point I regret having spent your time and very especially mine. However, if instead of yelling and pushing on personal prejudices you want to share and build some real knowledge, your messages will no longer be filtered out. Greetings, -- Alexandre Aguiar, MD, SCT -- People change and forget to tell each other. -- Lillian Hellman -- All messages from my addresses express my own (often obscure) opinions and have no relationship to the views of past|current|future places I work, their administrations, employees, my wife, my daughters, the nation, the world or the universe in general. Enough? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From watson.timothy@REDACTED Fri Sep 14 14:23:49 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Fri, 14 Sep 2012 13:23:49 +0100 Subject: [erlang-questions] Erlang nodes monitoring In-Reply-To: References: Message-ID: <41A3C3CE-343F-4A70-BB9B-B69E440C0C9A@gmail.com> On 13 Sep 2012, at 10:34, Max Bourinov wrote: > Hello Erlangers, > > Looking for a tool/library that I can integrate into my Erlang apps to do the following: > > - collect stats from running nodes > - collect all crash reports > - send them to the central repo (would be good to use RabbitMQ as transport and PostgreSQL are DB) > - optionally: accept user defined metrics (those I will define) > - optionally send alert emails in some cases (for certain crashes for example)... > > Motivation: I have many Erlang nodes running. I want to monitor them in one place. There are numerous libraries and tools for doing this. Basho have some monitoring/stats stuff that's worth looking at, as do some others on github including JacobVorreuter, heroku and a few others. If you decide to roll your own, especially in terms of user defined metrics, I personally like the way that eper handles things. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 235 bytes Desc: Message signed with OpenPGP using GPGMail URL: From bourinov@REDACTED Fri Sep 14 20:49:31 2012 From: bourinov@REDACTED (Max Bourinov) Date: Fri, 14 Sep 2012 22:49:31 +0400 Subject: [erlang-questions] Erlang nodes monitoring In-Reply-To: <41A3C3CE-343F-4A70-BB9B-B69E440C0C9A@gmail.com> References: <41A3C3CE-343F-4A70-BB9B-B69E440C0C9A@gmail.com> Message-ID: Does anybody know where to find docs for eper? Best regards, Max On Fri, Sep 14, 2012 at 4:23 PM, Tim Watson wrote: > > On 13 Sep 2012, at 10:34, Max Bourinov wrote: > > > Hello Erlangers, > > > > Looking for a tool/library that I can integrate into my Erlang apps to > do the following: > > > > - collect stats from running nodes > > - collect all crash reports > > - send them to the central repo (would be good to use RabbitMQ as > transport and PostgreSQL are DB) > > - optionally: accept user defined metrics (those I will define) > > - optionally send alert emails in some cases (for certain crashes for > example)... > > > > Motivation: I have many Erlang nodes running. I want to monitor them in > one place. > > There are numerous libraries and tools for doing this. Basho have some > monitoring/stats stuff that's worth looking at, as do some others on github > including JacobVorreuter, heroku and a few others. If you decide to roll > your own, especially in terms of user defined metrics, I personally like > the way that eper handles things. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cgsmcmlxxv@REDACTED Fri Sep 14 20:52:26 2012 From: cgsmcmlxxv@REDACTED (CGS) Date: Fri, 14 Sep 2012 20:52:26 +0200 Subject: [erlang-questions] Compile with flag --with-dynamic-trace=systemtap failed In-Reply-To: References: <1347591331599-4655144.post@n4.nabble.com> Message-ID: I got the same problem and I gave up. Systemtap package seems not to be recognized by Erlang. Instead, dtrace package works like a charm. CGS On Fri, Sep 14, 2012 at 3:05 PM, Lukas Larsson wrote: > Hello, > > On our systemtap testmachine we have the dtrace command available: > > -bash-4.2$ dtrace --help > Usage /usr/bin/dtrace [--help] [-h | -G] [-C [-I]] -s File.d [-o > ] > Where -h builds a systemtap header file from the .d file > -C when used with -h, also run cpp preprocessor > -o specifies an explicit output file name, > the default for -G is file.o and -h is file.h > -I when running cpp pass through this -I include Path > -s specifies the name of the .d input file > -G builds a stub file.o from file.d, > which is required by some packages that use dtrace. > > I'm not the guy who has implemented/installed it for us, but I think > that when you install systemtap you should also get a utility called > dtrace. > > Lukas > > On Fri, Sep 14, 2012 at 4:55 AM, goofansu wrote: > > dtrace: failed to compile script emulator/beam/erlang_dtrace.d: > Preprocessor > > not found > > configure: error: Could not precompile erlang_dtrace.d: dtrace -h failed > > configure: error: /root/otp/erts/configure failed for erts > > > > > > OS: fedora17 > > > > I've installed systemtap. Shall I install dtrace? > > > > > > > > -- > > View this message in context: > http://erlang.2086793.n4.nabble.com/Compile-with-flag-with-dynamic-trace-systemtap-failed-tp4655144.html > > Sent from the Erlang Questions mailing list archive at Nabble.com. > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto@REDACTED Sat Sep 15 00:27:17 2012 From: roberto@REDACTED (Roberto Ostinelli) Date: Fri, 14 Sep 2012 15:27:17 -0700 Subject: [erlang-questions] Fishing for best practices: distributed twin processes! Message-ID: Dear list, I have a 2-layer architecture where: - the first layer is handling the socket connections to the outside world clients - the second layer is performing computations related to the connected clients (i.e. the core application) It is built in this way so that we can make the socket handlers very stupid. Therefore, crashes on the first layer are less likely to occur, and in case of crashes of the second layer (the core application) we don't have all the clients trying to reconnect at the same time: they'll still be connected (even though receiving a 'service unavailable' message of some kind). For every single process handling a socket connection on the first layer I therefore need to have a 'twin' process on the second layer, strictly connected to its socket manager counterpart. I'm fishing for best practices here: - how can I assure that if the second layer goes down (VM crash, server hit by an angry sysadmin), the first layer socket processes know that their twin process is down (and the other way around)? - what is the best way to handle the creation of the twin processes? Any input welcome. ^^_ r. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Sat Sep 15 00:47:00 2012 From: mjtruog@REDACTED (Michael Truog) Date: Fri, 14 Sep 2012 15:47:00 -0700 Subject: [erlang-questions] Fishing for best practices: distributed twin processes! In-Reply-To: References: Message-ID: <5053B3E4.2080303@gmail.com> Assuming you have the 2 layers in separate Erlang VMs. You can have the Erlang VMs connected with distributed Erlang, and have the twin processes monitoring each other. If you wanted a simple process death if either died, you could consider using a link instead of 2 monitors. However, that seems like the simplest solution, to avoid unnecessary complexity. You might find strangeness if you start not using the default net tick time (i.e., with a process link inbetween nodes), with distributed Erlang, but you probably know it is best to not play with that. On 09/14/2012 03:27 PM, Roberto Ostinelli wrote: > Dear list, > > I have a 2-layer architecture where: > > * the first layer is handling the socket connections to the outside world clients > * the second layer is performing computations related to the connected clients (i.e. the core application) > > It is built in this way so that we can make the socket handlers very stupid. Therefore, crashes on the first layer are less likely to occur, and in case of crashes of the second layer (the core application) we don't have all the clients trying to reconnect at the same time: they'll still be connected (even though receiving a 'service unavailable' message of some kind). > > For every single process handling a socket connection on the first layer I therefore need to have a 'twin' process on the second layer, strictly connected to its socket manager counterpart. > > I'm fishing for best practices here: > > * how can I assure that if the second layer goes down (VM crash, server hit by an angry sysadmin), the first layer socket processes know that their twin process is down (and the other way around)? > * what is the best way to handle the creation of the twin processes? > > Any input welcome. ^^_ > > r. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Sat Sep 15 01:45:58 2012 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Sat, 15 Sep 2012 01:45:58 +0200 Subject: [erlang-questions] Question about implementation In-Reply-To: References: Message-ID: <5053C1B6.4050409@ninenines.eu> Hello, On 09/10/2012 07:35 PM, Daniel Dormont wrote: > > On Mon, Sep 10, 2012 at 12:08 PM, Lukas Larsson > > wrote: > > Hello, > > Only the tuple which is the record and the immidiates (i.e. small int, > atom, pid, ref etc) will be copied. All other parts use pointers > internally and the same pointers will be copied into the correct > places within the tuple. So in this case a new 6 word memory block > will be created and filled with the atom undefined and finally the new > counter. > > I think that the compiler does some optimization based on updating > tuples within the same function body, though I've forgotten what it is > it does. > > > This bit? > http://www.erlang.org/doc/efficiency_guide/commoncaveats.html#id61731 Is the optimization applied automatically to records? -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From roberto@REDACTED Sat Sep 15 03:46:23 2012 From: roberto@REDACTED (Roberto Ostinelli) Date: Fri, 14 Sep 2012 18:46:23 -0700 Subject: [erlang-questions] Fishing for best practices: distributed twin processes! In-Reply-To: <5053B3E4.2080303@gmail.com> References: <5053B3E4.2080303@gmail.com> Message-ID: hello Michael, you're assuming right (separate VM), I'm familiar with links and monitors, thank you. However I doubt that any message is sent from a dying process if the VM on which it runs actually blows up. That was my point. r. On Fri, Sep 14, 2012 at 3:47 PM, Michael Truog wrote: > ** > Assuming you have the 2 layers in separate Erlang VMs. You can have the > Erlang VMs connected with distributed Erlang, and have the twin processes > monitoring each other. If you wanted a simple process death if either > died, you could consider using a link instead of 2 monitors. However, that > seems like the simplest solution, to avoid unnecessary complexity. You > might find strangeness if you start not using the default net tick time > (i.e., with a process link inbetween nodes), with distributed Erlang, but > you probably know it is best to not play with that. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Sat Sep 15 03:55:04 2012 From: mjtruog@REDACTED (Michael Truog) Date: Fri, 14 Sep 2012 18:55:04 -0700 Subject: [erlang-questions] Fishing for best practices: distributed twin processes! In-Reply-To: References: <5053B3E4.2080303@gmail.com> Message-ID: <5053DFF8.6040700@gmail.com> Yes, you will get a message from a monitor or link to a process on a remote node, which requires that the nodes be connected, when the remote process dies. You can just have premature death if the net tick time is too long (not sure why, but it seemed like some internal assumption that is made, not controlled by the net tick time, saw in an older release but I assume it is the same still), so that is why it is best to stick with the default net tick time, unless you want to test that mechanism alot. On 09/14/2012 06:46 PM, Roberto Ostinelli wrote: > hello Michael, > > you're assuming right (separate VM), I'm familiar with links and monitors, thank you. However I doubt that any message is sent from a dying process if the VM on which it runs actually blows up. That was my point. > > r. > > > On Fri, Sep 14, 2012 at 3:47 PM, Michael Truog > wrote: > > Assuming you have the 2 layers in separate Erlang VMs. You can have the Erlang VMs connected with distributed Erlang, and have the twin processes monitoring each other. If you wanted a simple process death if either died, you could consider using a link instead of 2 monitors. However, that seems like the simplest solution, to avoid unnecessary complexity. You might find strangeness if you start not using the default net tick time (i.e., with a process link inbetween nodes), with distributed Erlang, but you probably know it is best to not play with that. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Sat Sep 15 03:57:48 2012 From: mjtruog@REDACTED (Michael Truog) Date: Fri, 14 Sep 2012 18:57:48 -0700 Subject: [erlang-questions] Fishing for best practices: distributed twin processes! In-Reply-To: <5053DFF8.6040700@gmail.com> References: <5053B3E4.2080303@gmail.com> <5053DFF8.6040700@gmail.com> Message-ID: <5053E09C.8020207@gmail.com> Just to be clear, the remote VM dieing helps initiate the death of the links or monitors, since the node is shown as down locally. You can catch that condition separately with node monitoring. On 09/14/2012 06:55 PM, Michael Truog wrote: > Yes, you will get a message from a monitor or link to a process on a remote node, which requires that the nodes be connected, when the remote process dies. You can just have premature death if the net tick time is too long (not sure why, but it seemed like some internal assumption that is made, not controlled by the net tick time, saw in an older release but I assume it is the same still), so that is why it is best to stick with the default net tick time, unless you want to test that mechanism alot. > > On 09/14/2012 06:46 PM, Roberto Ostinelli wrote: >> hello Michael, >> >> you're assuming right (separate VM), I'm familiar with links and monitors, thank you. However I doubt that any message is sent from a dying process if the VM on which it runs actually blows up. That was my point. >> >> r. >> >> >> On Fri, Sep 14, 2012 at 3:47 PM, Michael Truog > wrote: >> >> Assuming you have the 2 layers in separate Erlang VMs. You can have the Erlang VMs connected with distributed Erlang, and have the twin processes monitoring each other. If you wanted a simple process death if either died, you could consider using a link instead of 2 monitors. However, that seems like the simplest solution, to avoid unnecessary complexity. You might find strangeness if you start not using the default net tick time (i.e., with a process link inbetween nodes), with distributed Erlang, but you probably know it is best to not play with that. >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From torben.lehoff@REDACTED Sat Sep 15 08:21:49 2012 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Sat, 15 Sep 2012 08:21:49 +0200 Subject: [erlang-questions] Fishing for best practices: distributed twin processes! In-Reply-To: References: <5053B3E4.2080303@gmail.com> Message-ID: <50541E7D.1020707@gmail.com> Hi Roberto, Try contacting Laura Castro from Uni of Coru?a who presented at the Erlang Workshop 2012 yesterday regarding handling of netsplits and node crashes. Their team had to go through some investigations before they got the resilience they had promised the customer! The big question for you will actually be what to do when the layers thinks that the other node is down - will you assume a net split and buffer communication (if that is feasible for your application)? Or will you assume node down and do a major clean-up? Cheers, ___ /orben On 2012-09-15 03:46, Roberto Ostinelli wrote: > hello Michael, > > you're assuming right (separate VM), I'm familiar with links and > monitors, thank you. However I doubt that any message is sent from a > dying process if the VM on which it runs actually blows up. That was > my point. > > r. > > > On Fri, Sep 14, 2012 at 3:47 PM, Michael Truog > wrote: > > Assuming you have the 2 layers in separate Erlang VMs. You can > have the Erlang VMs connected with distributed Erlang, and have > the twin processes monitoring each other. If you wanted a simple > process death if either died, you could consider using a link > instead of 2 monitors. However, that seems like the simplest > solution, to avoid unnecessary complexity. You might find > strangeness if you start not using the default net tick time > (i.e., with a process link inbetween nodes), with distributed > Erlang, but you probably know it is best to not play with that. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- http://www.linkedin.com/in/torbenhoffmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From bourinov@REDACTED Sat Sep 15 08:46:08 2012 From: bourinov@REDACTED (Max Bourinov) Date: Sat, 15 Sep 2012 10:46:08 +0400 Subject: [erlang-questions] Fishing for best practices: distributed twin processes! In-Reply-To: <50541E7D.1020707@gmail.com> References: <5053B3E4.2080303@gmail.com> <50541E7D.1020707@gmail.com> Message-ID: I afraid that in same cases dying VM won't send anything. Additional technique that might help in this situation is a watchdog process, but it bring another level of abstraction/complexity. In our project we also need to monitor distributed systems and we will implement watchdogs. Sent from my iPad On 15.09.2012, at 10:21, Torben Hoffmann wrote: > Hi Roberto, > > Try contacting Laura Castro from Uni of Coru?a who presented at the Erlang Workshop 2012 yesterday regarding handling of netsplits and node crashes. > Their team had to go through some investigations before they got the resilience they had promised the customer! > > The big question for you will actually be what to do when the layers thinks that the other node is down - will you assume a net split and buffer communication (if that is feasible for your application)? Or will you assume node down and do a major clean-up? > > Cheers, > ___ > /orben > > > On 2012-09-15 03:46, Roberto Ostinelli wrote: >> hello Michael, >> >> you're assuming right (separate VM), I'm familiar with links and monitors, thank you. However I doubt that any message is sent from a dying process if the VM on which it runs actually blows up. That was my point. >> >> r. >> >> >> On Fri, Sep 14, 2012 at 3:47 PM, Michael Truog wrote: >> Assuming you have the 2 layers in separate Erlang VMs. You can have the Erlang VMs connected with distributed Erlang, and have the twin processes monitoring each other. If you wanted a simple process death if either died, you could consider using a link instead of 2 monitors. However, that seems like the simplest solution, to avoid unnecessary complexity. You might find strangeness if you start not using the default net tick time (i.e., with a process link inbetween nodes), with distributed Erlang, but you probably know it is best to not play with that. >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > -- > http://www.linkedin.com/in/torbenhoffmann > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From joelr1@REDACTED Sat Sep 15 21:56:06 2012 From: joelr1@REDACTED (Joel Reymont) Date: Sat, 15 Sep 2012 15:56:06 -0400 Subject: [erlang-questions] reading zero-terminated strings from a socket Message-ID: I need to read zero-terminated strings from a socket. What is the most efficient way of doing so? I wish there was a {packet, ...} option for this but, alas, {packet, line} only looks for newlines. Thanks, Joel -------------------------------------------------------------------------- - for hire: mac osx device driver ninja, kernel extensions and usb drivers ---------------------+------------+--------------------------------------- http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont ---------------------+------------+--------------------------------------- From essen@REDACTED Sat Sep 15 22:01:04 2012 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Sat, 15 Sep 2012 22:01:04 +0200 Subject: [erlang-questions] reading zero-terminated strings from a socket In-Reply-To: References: Message-ID: <5054DE80.5@ninenines.eu> * recv(Socket, _, Timeout) * binary:split(Bin, << 0 >>) * bufferize and try next: << Acc/binary, Bin/binary >> You'll most likely want to check your buffer before receiving again in case you have receiving many strings at once. On 09/15/2012 09:56 PM, Joel Reymont wrote: > I need to read zero-terminated strings from a socket. > > What is the most efficient way of doing so? > > I wish there was a {packet, ...} option for this but, alas, {packet, > line} only looks for newlines. > > Thanks, Joel > > -------------------------------------------------------------------------- > - for hire: mac osx device driver ninja, kernel extensions and usb drivers > ---------------------+------------+--------------------------------------- > http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont > ---------------------+------------+--------------------------------------- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From gumm@REDACTED Sun Sep 16 01:20:14 2012 From: gumm@REDACTED (Jesse Gumm) Date: Sat, 15 Sep 2012 18:20:14 -0500 Subject: [erlang-questions] Third party comment systems that natively support Erlang for codeblocks? In-Reply-To: References: Message-ID: Hi again, It has been a few days, so I thought I'd ask again: Does anyone know of any third party comment systems (like disqus) that happen to natively support Erlang syntax highlighting? -- Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm On Sep 13, 2012 11:46 PM, "Jesse Gumm" wrote: > Hello Erlangers! > > Does anyone know of any third-party comment systems (similar to > Disqus) that natively support Erlang syntax-highlighting as a language > for code-blocks? > > Disqus currently supports a handful of the more popular languages, but > does not currently support Erlang. I'm a fan of Disqus, but the lack > of Erlang support puts a roadblock in my path here. > > The main criteria is that I'd like to be able to just add a simple > script to an HTML page and have it do all the magic. > > Any thoughts on this? > > -Jesse > > -- > Jesse Gumm > Owner, Sigma Star Systems > 414.940.4866 || sigma-star.com || @jessegumm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay@REDACTED Sun Sep 16 02:10:31 2012 From: jay@REDACTED (Jay Nelson) Date: Sun, 16 Sep 2012 02:10:31 +0200 Subject: [erlang-questions] [ANN] Erlang/SP v0.0.1 Message-ID: <665FBADC-893A-45A4-9EA2-16205B439D00@duomark.com> Erlang Services Platform (Erlang/SP) debuted at the ICFP 2012 Erlang Workshop in Copenhagen on Friday. This is the first release which is intended as a proof of concept. Erlang/SP attempts to provide dataflow programming for OTP users. It creates a network of processes based on a digraph instance. The graph maps nodes to processes and edges to one-way message communication channels, each between two processes. A graph is called a Co-op, short for Co-operating Processes. There is some limited documentation about the library included in the repo, along with some materials presented at ICFP in the apps/coop/docs directory. The built in constructors provide pipeline and fan-out (optionally with fan-in) patterns. Good utilities for joining graphs into larger entities are not yet provided, but coops may receive from and feed to any normal erlang process including OTP processes. They also support sys functionality (e.g., trace, suspend, resume, etc) so will be full-fledged OTP citizens. It is available at https://github.com/duomark/erlangsp Comments, suggestions, issues and pull requests are all welcome. Jay Nelson DuoMark International, Inc. @duomark From mlortiz@REDACTED Sun Sep 16 02:47:29 2012 From: mlortiz@REDACTED (Marcos Ortiz) Date: Sat, 15 Sep 2012 20:47:29 -0400 Subject: [erlang-questions] Third party comment systems that natively support Erlang for codeblocks? In-Reply-To: References: Message-ID: <505521A1.5030104@uci.cu> Well, What can we do to help to Disqus's fellows to integrate Erlang to their platform? On 09/15/2012 07:20 PM, Jesse Gumm wrote: > > Hi again, > > It has been a few days, so I thought I'd ask again: Does anyone know > of any third party comment systems (like disqus) that happen to > natively support Erlang syntax highlighting? > > -- > Jesse Gumm > Owner, Sigma Star Systems > 414.940.4866 || sigma-star.com || @jessegumm > > On Sep 13, 2012 11:46 PM, "Jesse Gumm" > wrote: > > Hello Erlangers! > > Does anyone know of any third-party comment systems (similar to > Disqus) that natively support Erlang syntax-highlighting as a language > for code-blocks? > > Disqus currently supports a handful of the more popular languages, but > does not currently support Erlang. I'm a fan of Disqus, but the lack > of Erlang support puts a roadblock in my path here. > > The main criteria is that I'd like to be able to just add a simple > script to an HTML page and have it do all the magic. > > Any thoughts on this? > > -Jesse > > -- > Jesse Gumm > Owner, Sigma Star Systems > 414.940.4866 || sigma-star.com > || @jessegumm > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Marcos Luis Ort?z Valmaseda *Data Engineer && Sr. System Administrator at UCI* about.me/marcosortiz My Blog Tumblr's blog @marcosluis2186 10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS... CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION http://www.uci.cu http://www.facebook.com/universidad.uci http://www.flickr.com/photos/universidad_uci -------------- next part -------------- An HTML attachment was scrubbed... URL: From gumm@REDACTED Sun Sep 16 04:32:56 2012 From: gumm@REDACTED (Jesse Gumm) Date: Sat, 15 Sep 2012 21:32:56 -0500 Subject: [erlang-questions] Third party comment systems that natively support Erlang for codeblocks? In-Reply-To: <505521A1.5030104@uci.cu> References: <505521A1.5030104@uci.cu> Message-ID: I'm not sure. I've emailed their support abs gotten a response of the whole "I've forwarded this for consideration", and I've provided a basic list of syntax rules for Erlang them. I had also offered to write the parser for them myself, but their syntax highlighting stuff is not in any of their public github repos. Beyond that, I don't know what else we could do short of making many requests for it. Hence why I was asking about other third party systems. -- Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm On Sep 15, 2012 7:47 PM, "Marcos Ortiz" wrote: > Well, What can we do to help to Disqus's fellows to integrate Erlang to > their platform? > > On 09/15/2012 07:20 PM, Jesse Gumm wrote: > > Hi again, > > It has been a few days, so I thought I'd ask again: Does anyone know of > any third party comment systems (like disqus) that happen to natively > support Erlang syntax highlighting? > > -- > Jesse Gumm > Owner, Sigma Star Systems > 414.940.4866 || sigma-star.com || @jessegumm > On Sep 13, 2012 11:46 PM, "Jesse Gumm" wrote: > >> Hello Erlangers! >> >> Does anyone know of any third-party comment systems (similar to >> Disqus) that natively support Erlang syntax-highlighting as a language >> for code-blocks? >> >> Disqus currently supports a handful of the more popular languages, but >> does not currently support Erlang. I'm a fan of Disqus, but the lack >> of Erlang support puts a roadblock in my path here. >> >> The main criteria is that I'd like to be able to just add a simple >> script to an HTML page and have it do all the magic. >> >> Any thoughts on this? >> >> -Jesse >> >> -- >> Jesse Gumm >> Owner, Sigma Star Systems >> 414.940.4866 || sigma-star.com || @jessegumm >> > > > _______________________________________________ > erlang-questions mailing listerlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions > > > -- > ** > > Marcos Luis Ort?z Valmaseda > *Data Engineer && Sr. System Administrator at UCI* > about.me/marcosortiz > My Blog > Tumblr's blog > @marcosluis2186 > ** > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mlortiz@REDACTED Sun Sep 16 08:34:15 2012 From: mlortiz@REDACTED (Marcos Ortiz) Date: Sun, 16 Sep 2012 02:34:15 -0400 Subject: [erlang-questions] Third party comment systems that natively support Erlang for codeblocks? In-Reply-To: References: <505521A1.5030104@uci.cu> Message-ID: <505572E7.7080106@uci.cu> I think that the Python module pygments has support for Erlang, if my memory doesn?t fail me, El 15/09/2012 22:32, Jesse Gumm escribi?: > > I'm not sure. > > I've emailed their support abs gotten a response of the whole "I've > forwarded this for consideration", and I've provided a basic list of > syntax rules for Erlang them. > > I had also offered to write the parser for them myself, but their > syntax highlighting stuff is not in any of their public github repos. > > Beyond that, I don't know what else we could do short of making many > requests for it. Hence why I was asking about other third party systems. > > -- > Jesse Gumm > Owner, Sigma Star Systems > 414.940.4866 || sigma-star.com || @jessegumm > > On Sep 15, 2012 7:47 PM, "Marcos Ortiz" > wrote: > > Well, What can we do to help to Disqus's fellows to integrate > Erlang to their platform? > > On 09/15/2012 07:20 PM, Jesse Gumm wrote: >> >> Hi again, >> >> It has been a few days, so I thought I'd ask again: Does anyone >> know of any third party comment systems (like disqus) that happen >> to natively support Erlang syntax highlighting? >> >> -- >> Jesse Gumm >> Owner, Sigma Star Systems >> 414.940.4866 || sigma-star.com >> || @jessegumm >> >> On Sep 13, 2012 11:46 PM, "Jesse Gumm" > > wrote: >> >> Hello Erlangers! >> >> Does anyone know of any third-party comment systems (similar to >> Disqus) that natively support Erlang syntax-highlighting as a >> language >> for code-blocks? >> >> Disqus currently supports a handful of the more popular >> languages, but >> does not currently support Erlang. I'm a fan of Disqus, but >> the lack >> of Erlang support puts a roadblock in my path here. >> >> The main criteria is that I'd like to be able to just add a >> simple >> script to an HTML page and have it do all the magic. >> >> Any thoughts on this? >> >> -Jesse >> >> -- >> Jesse Gumm >> Owner, Sigma Star Systems >> 414.940.4866 || sigma-star.com >> || @jessegumm >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > -- > > Marcos Luis Ort?z Valmaseda > *Data Engineer && Sr. System Administrator at UCI* > about.me/marcosortiz > My Blog > Tumblr's blog > @marcosluis2186 > > > > -- Marcos Ortiz Valmaseda, Data Engineer && Senior System Administrator at UCI Blog: http://marcosluis2186.posterous.com Linkedin: http://www.linkedin.com/in/marcosluis2186 Twitter: @marcosluis2186 10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS... CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION http://www.uci.cu http://www.facebook.com/universidad.uci http://www.flickr.com/photos/universidad_uci -------------- next part -------------- An HTML attachment was scrubbed... URL: From zabrane3@REDACTED Sun Sep 16 10:18:05 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Sun, 16 Sep 2012 10:18:05 +0200 Subject: [erlang-questions] [ANN] Erlang/SP v0.0.1 In-Reply-To: <665FBADC-893A-45A4-9EA2-16205B439D00@duomark.com> References: <665FBADC-893A-45A4-9EA2-16205B439D00@duomark.com> Message-ID: <53CCFE0F-7C8C-4951-96B0-4554D4EAB6AB@gmail.com> Hi Jay, The co-op concept seems very interesting. Could you please provide us with a more real world examples that could be solved by Erlang/SP? Finally, what advantages the esp-cache (https://github.com/duomark/erlangsp/tree/master/apps/examples/esp_cache) offers compared to ordinary cache implementations? Regards, Zabrane On Sep 16, 2012, at 2:10 AM, Jay Nelson wrote: > Erlang Services Platform (Erlang/SP) debuted at the ICFP 2012 > Erlang Workshop in Copenhagen on Friday. This is the > first release which is intended as a proof of concept. > > Erlang/SP attempts to provide dataflow programming for OTP users. > It creates a network of processes based on a digraph instance. > The graph maps nodes to processes and edges to one-way message > communication channels, each between two processes. A graph > is called a Co-op, short for Co-operating Processes. There is some > limited documentation about the library included in the repo, > along with some materials presented at ICFP in the apps/coop/docs > directory. > > The built in constructors provide pipeline and fan-out (optionally > with fan-in) patterns. Good utilities for joining graphs into larger > entities are not yet provided, but coops may receive from and > feed to any normal erlang process including OTP processes. > They also support sys functionality (e.g., trace, suspend, resume, > etc) so will be full-fledged OTP citizens. > > It is available at https://github.com/duomark/erlangsp > > Comments, suggestions, issues and pull requests are all welcome. > > Jay Nelson > DuoMark International, Inc. > @duomark > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay@REDACTED Sun Sep 16 11:21:37 2012 From: jay@REDACTED (Jay Nelson) Date: Sun, 16 Sep 2012 11:21:37 +0200 Subject: [erlang-questions] [ANN] Erlang/SP v0.0.1 In-Reply-To: <53CCFE0F-7C8C-4951-96B0-4554D4EAB6AB@gmail.com> References: <665FBADC-893A-45A4-9EA2-16205B439D00@duomark.com> <53CCFE0F-7C8C-4951-96B0-4554D4EAB6AB@gmail.com> Message-ID: <13B9542B-8A79-4AF3-8675-10B7F1A0CAE6@duomark.com> On Sep 16, 2012, at 10:18 AM, Zabrane Mickael wrote: > > Could you please provide us with a more real world examples that could be solved by Erlang/SP? I plan to add a simple tutorial to show how to use the existing patterns, based on parsing an HTTP request sent by a browser. > > Finally, what advantages the esp-cache (https://github.com/duomark/erlangsp/tree/master/apps/examples/esp_cache) offers compared to ordinary cache implementations? > Flexibility, concurrency and a lesson that what works in imperative approaches is not necessarily the best approach for functional languages. I believe most people don't have the hardware to see an advantage of this type of cache in the general case yet. This was a proof-of-concept that exercised the library and tried to challenge the assumptions built in the initial API. It was based on https://github.com/mattsta/pcache which was in turn based on an earlier paper I had written for ICFP 2006 in response to an erlang list question of how to implement an LRU cache (my answer was don't, think in terms of erlang's preferences and make a concurrent cache with each datum implementing an idle timeout). The esp_cache implementation is not yet complete as it does not have the default timeout for expiration (this should be generated in the M:F(A) that generates the datum so that it has the opportunity to be based on the cost of the generation function and memory size and can be set independently for each datum). I chose this example to test co-ops because: 1) It has a fanout design 2) It can quickly use a lot of processes 3) It required both static nodes and dynamic nodes 4) It required a circular data path (inserting a new node to the directory) 5) It will be interesting to watch when visualization is available 6) It demonstrates simple concurrency control via a configurable number of workers 7) The directory is a serial bottleneck that can declaratively be made parallel in a future co-ops release 8) The release project (http://release.softlab.ntua.gr/bencherl/index.html) may provide insight to how it scales I'm not sure that this caching scheme is particular beneficial in a production environment, but it is flexible and allows for experimenting with the replacement policy and adaptiveness of the cache as well as completely separating the logic of managing the active data items from the logic of caching. I suspect it is invaluable as a teaching tool once visualization is available as students could make many easily isolated alterations and observe the resultant change in caching behavior. The use of a process for a cached entry allows more than just static data to be the target of caching. Some examples of lessons that can be taught: 1) The M:F(A) delay to generate a cached item is out of band from other requests 2) What happens when a new, slow to obtain datum spikes in requests and directory races arise? 3) How do different directory structures compare (a single process/function is all that is changed) 4) Replacement policy other than idle expiration is not provided, add external policy which injects events 5) Mirror request statistics in the population of cached items by replicating a datum process after N requests 6) Show how a requester of a cached item can asynchronously cause it to be handed to a different receiver 7) Implement a lookup API on the resulting delivered datum process, so that each cached item is a collection of data This approach _may_ be useful in production when most of the following are true: 1) You have many cores (at least 10% of the cache population?) 2) Extracting a datum is very expensive either in time or memory 3) The structure of each datum is large, complex or possibly is another entire data structure with its own lookup API or 3) The datum is a dynamically changing value with the latest value needed by multiple receivers 4) Communicating the datum via erlang messages is not too costly in terms of copying costs 5) The rate with which data is desired does not exceed the erlang messaging speed 6) Most concurrent requests route to different cached datum instances (use replicated processes to balance hotspots) Don't forget that co-ops can output to other co-ops, so you may cascade any of the above enhanced caches! jay From zabrane3@REDACTED Sun Sep 16 12:00:51 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Sun, 16 Sep 2012 12:00:51 +0200 Subject: [erlang-questions] OSX: binding schedulers to processor cores doesn't work Message-ID: Hi guys, Trying to bind schedulers to processor cores simply fail on my MacOSX (10.7.4) using R15B01 and R15B02: $ erl +sbt db setting scheduler bind type 'db' failed: not supported [...] All other binding options failed too. Why? How one can use "+sbt db", now that the call to "erlang:system_flag(scheduler_bind_type,default_bind)" is deprecated? Regards, Zabrane From tuncer.ayaz@REDACTED Sun Sep 16 18:59:22 2012 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sun, 16 Sep 2012 18:59:22 +0200 Subject: [erlang-questions] rebar.config debug_info/no_debug_info Message-ID: I'd like to inform all rebar users who may not be aware that as suggested by Kostis 'debug_info' has been enabled by default since March 29th 2011. It can be disabled by specifying 'no_debug_info'. {erl_opts, [debug_info, warn_foo]}. => compile:file(foo, [debug_info, debug_info, warn_foo]) {erl_opts, [warn_foo]}. => compile:file(foo, [debug_info, warn_foo]) {erl_opts, [debug_info]}. => compile:file(foo, [debug_info, debug_info]) {erl_opts, [no_debug_info, warn_foo]}. => compile:file(foo, [warn_foo]) From zabrane3@REDACTED Sun Sep 16 20:33:08 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Sun, 16 Sep 2012 20:33:08 +0200 Subject: [erlang-questions] [ANN] Erlang/SP v0.0.1 In-Reply-To: <13B9542B-8A79-4AF3-8675-10B7F1A0CAE6@duomark.com> References: <665FBADC-893A-45A4-9EA2-16205B439D00@duomark.com> <53CCFE0F-7C8C-4951-96B0-4554D4EAB6AB@gmail.com> <13B9542B-8A79-4AF3-8675-10B7F1A0CAE6@duomark.com> Message-ID: Hey Jay, > I plan to add a simple tutorial to show how to use the existing patterns, > based on parsing an HTTP request sent by a browser. That will be great. Parsing HTTP request is well know problem and we can compare Co-ops with other solutions. >> Finally, what advantages the esp-cache (https://github.com/duomark/erlangsp/tree/master/apps/examples/esp_cache) offers compared to ordinary cache implementations? >> > > Flexibility, concurrency and a lesson that what works in imperative > approaches is not necessarily the best approach for functional > languages. I believe most people don't have the hardware to see > an advantage of this type of cache in the general case yet. > > This was a proof-of-concept that exercised the library and tried to > challenge the assumptions built in the initial API. It was based > on https://github.com/mattsta/pcache which was in turn based on an > earlier paper I had written for ICFP 2006 in response to an erlang list > question of how to implement an LRU cache (my answer was don't, > think in terms of erlang's preferences and make a concurrent cache > with each datum implementing an idle timeout). > > The esp_cache implementation is not yet complete as it does not > have the default timeout for expiration (this should be generated in > the M:F(A) that generates the datum so that it has the opportunity > to be based on the cost of the generation function and memory size > and can be set independently for each datum). > > [...] Thanks for the useful explanation. > Some examples of lessons that can be taught: > > 1) The M:F(A) delay to generate a cached item is out of band from other requests > 2) What happens when a new, slow to obtain datum spikes in requests and directory races arise? > 3) How do different directory structures compare (a single process/function is all that is changed) > 4) Replacement policy other than idle expiration is not provided, add external policy which injects events > 5) Mirror request statistics in the population of cached items by replicating a datum process after N requests > 6) Show how a requester of a cached item can asynchronously cause it to be handed to a different receiver > 7) Implement a lookup API on the resulting delivered datum process, so that each cached item is a collection of data > > This approach _may_ be useful in production when most of the following are true: > > 1) You have many cores (at least 10% of the cache population?) > 2) Extracting a datum is very expensive either in time or memory > 3) The structure of each datum is large, complex or possibly is another entire data structure with its own lookup API > or 3) The datum is a dynamically changing value with the latest value needed by multiple receivers > 4) Communicating the datum via erlang messages is not too costly in terms of copying costs > 5) The rate with which data is desired does not exceed the erlang messaging speed > 6) Most concurrent requests route to different cached datum instances (use replicated processes to balance hotspots) > > Don't forget that co-ops can output to other co-ops, so you may cascade any of the above enhanced caches! Yum, that's the idea behind Flow-based programming. Regards, Zabrane From rickard@REDACTED Sun Sep 16 20:44:35 2012 From: rickard@REDACTED (Rickard Green) Date: Sun, 16 Sep 2012 20:44:35 +0200 Subject: [erlang-questions] OSX: binding schedulers to processor cores doesn't work In-Reply-To: References: Message-ID: Binding of schedulers has never been supported on MacOSX. I've not put much effort into it, but when I last looked into it (a long time ago) I couldn't find any functionality in MacOSX that could be used for this. This might have changed, thought. If you want to look into it, a patch implementing this is welcome. Regards, Rickard Green, Erlang/OTP, Ericsson AB On Sep 16, 2012, at 12:00 PM, Zabrane Mickael wrote: > Hi guys, > > Trying to bind schedulers to processor cores simply fail on my MacOSX (10.7.4) using R15B01 and R15B02: > $ erl +sbt db > setting scheduler bind type 'db' failed: not supported > [...] > > All other binding options failed too. Why? > > How one can use "+sbt db", now that the call to "erlang:system_flag(scheduler_bind_type,default_bind)" is deprecated? > > Regards, > Zabrane > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From steven.charles.davis@REDACTED Sun Sep 16 21:12:16 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Sun, 16 Sep 2012 14:12:16 -0500 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <3F036646-8198-407A-B8C7-D291F13A419F@cs.otago.ac.nz> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <10dd1cd8-419a-4432-8344-9924b7d3b0c7@googlegroups.com> <3F036646-8198-407A-B8C7-D291F13A419F@cs.otago.ac.nz> Message-ID: <7303670E-3243-494C-862E-872975E0C32D@gmail.com> Since you can invent attributes, I have played with: -api({{Name, Arity}, "Short Descriptive Usage Comment"}). ...as a means of compiling brief module self-documention that is visible in X:module_info(attributes). On Sep 13, 2012, at 11:42 PM, Richard O'Keefe wrote: > > On 14/09/2012, at 11:56 AM, Steve Davis wrote: >> There *is* an issue between making a distinction between -export for API use and -export needed for use only within the app or library. > > That is what -export_to was invented for. It's not just that you > want to >say< that something is exported for very specific reasons, > you want to >enforce< that it's only usable by things you mean to > export it to. It is also more precise than "internal exports", > which I used to think only meant functions exported back to the > module itself for use with 'apply'. > > The intellectual debt to Eiffel's {targeting} of feature availability > seems obvious, but if memory serves me correctly, I thought of > -export_to before I learned Eiffel. > From robert.virding@REDACTED Sun Sep 16 23:03:27 2012 From: robert.virding@REDACTED (Robert Virding) Date: Sun, 16 Sep 2012 22:03:27 +0100 (BST) Subject: [erlang-questions] Fishing for best practices: distributed twin processes! In-Reply-To: Message-ID: The dying VM will of course not send anything, it's dead. Your node, however, knows of all the links and monitors its processes has with other nodes. It will detect that it has lost contact with the other node and and then send the exit signals and monitor information to its local processes. This may take some time before it happens. Robert ----- Original Message ----- > From: "Max Bourinov" > To: "Torben Hoffmann" > Cc: "Erlang" , "Roberto Ostinelli" > > Sent: Saturday, 15 September, 2012 8:46:08 AM > Subject: Re: [erlang-questions] Fishing for best practices: > distributed twin processes! > I afraid that in same cases dying VM won't send anything. Additional > technique that might help in this situation is a watchdog process, > but it bring another level of abstraction/complexity. > In our project we also need to monitor distributed systems and we > will implement watchdogs. > Sent from my iPad > On 15.09.2012, at 10:21, Torben Hoffmann < torben.lehoff@REDACTED > > wrote: > > Hi Roberto, > > > Try contacting Laura Castro from Uni of Coru?a who presented at the > > Erlang Workshop 2012 yesterday regarding handling of netsplits and > > node crashes. > > > Their team had to go through some investigations before they got > > the > > resilience they had promised the customer! > > > The big question for you will actually be what to do when the > > layers > > thinks that the other node is down - will you assume a net split > > and > > buffer communication (if that is feasible for your application)? Or > > will you assume node down and do a major clean-up? > > > Cheers, > > > ___ > > > /orben > > > On 2012-09-15 03:46, Roberto Ostinelli wrote: > > > > hello Michael, > > > > > > you're assuming right (separate VM), I'm familiar with links and > > > monitors, thank you. However I doubt that any message is sent > > > from > > > a > > > dying process if the VM on which it runs actually blows up. That > > > was > > > my point. > > > > > > r. > > > > > > On Fri, Sep 14, 2012 at 3:47 PM, Michael Truog < > > > mjtruog@REDACTED > > > > > > > wrote: > > > > > > > Assuming you have the 2 layers in separate Erlang VMs. You can > > > > have > > > > the Erlang VMs connected with distributed Erlang, and have the > > > > twin > > > > processes monitoring each other. If you wanted a simple process > > > > death if either died, you could consider using a link instead > > > > of > > > > 2 > > > > monitors. However, that seems like the simplest solution, to > > > > avoid > > > > unnecessary complexity. You might find strangeness if you start > > > > not > > > > using the default net tick time (i.e., with a process link > > > > inbetween > > > > nodes), with distributed Erlang, but you probably know it is > > > > best > > > > to > > > > not play with that. > > > > > > > > > _______________________________________________ > > > > > > erlang-questions mailing list erlang-questions@REDACTED > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- http://www.linkedin.com/in/torbenhoffmann > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.virding@REDACTED Sun Sep 16 23:10:33 2012 From: robert.virding@REDACTED (Robert Virding) Date: Sun, 16 Sep 2012 22:10:33 +0100 (BST) Subject: [erlang-questions] Question about implementation In-Reply-To: <5053C1B6.4050409@ninenines.eu> Message-ID: <492f95b2-649c-4ace-aaa7-a676bacadddb@knuth> Yes. There are a few rules which need to be followed so that the compiler can safely do this optimisation, and generally doing multiple updates to a record *in one go* will satisfy these rules. So X1 = X0#r{a=foo(),b=bar(),c=baz()}, will be optimised, while X1 = X0#r{a=foo()}, X2 = X1#r{b=bar()}, X3 = X2#r{c=baz()}, will not. It always tries to do this optimisation but it is generally seldom safe to do it. Robert ----- Original Message ----- > From: "Lo?c Hoguin" > To: "Daniel Dormont" > Cc: "Lukas Larsson" , "Erlang-Questions Questions" > Sent: Saturday, 15 September, 2012 1:45:58 AM > Subject: Re: [erlang-questions] Question about implementation > > Hello, > > On 09/10/2012 07:35 PM, Daniel Dormont wrote: > > > > On Mon, Sep 10, 2012 at 12:08 PM, Lukas Larsson > > > > > wrote: > > > > Hello, > > > > Only the tuple which is the record and the immidiates (i.e. > > small int, > > atom, pid, ref etc) will be copied. All other parts use > > pointers > > internally and the same pointers will be copied into the > > correct > > places within the tuple. So in this case a new 6 word memory > > block > > will be created and filled with the atom undefined and finally > > the new > > counter. > > > > I think that the compiler does some optimization based on > > updating > > tuples within the same function body, though I've forgotten > > what it is > > it does. > > > > > > This bit? > > http://www.erlang.org/doc/efficiency_guide/commoncaveats.html#id61731 > > Is the optimization applied automatically to records? > > -- > Lo?c Hoguin > Erlang Cowboy > Nine Nines > http://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From ok@REDACTED Sun Sep 16 23:33:16 2012 From: ok@REDACTED (Richard O'Keefe) Date: Mon, 17 Sep 2012 09:33:16 +1200 Subject: [erlang-questions] Comparative study involving Erlang In-Reply-To: References: Message-ID: <96229FFE-7A50-475B-9844-03759AA9EFF9@cs.otago.ac.nz> On 14/09/2012, at 7:00 PM, Michael Turner wrote: > My only concen is your requirement that the experts "briefly" comment. > I see no reason to rule out Richard O'Keefe at this stage of > recruitment. That was so funny! I am supposed to be writing a couple of exam papers... From ok@REDACTED Mon Sep 17 00:26:27 2012 From: ok@REDACTED (Richard O'Keefe) Date: Mon, 17 Sep 2012 10:26:27 +1200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <7303670E-3243-494C-862E-872975E0C32D@gmail.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <10dd1cd8-419a-4432-8344-9924b7d3b0c7@googlegroups.com> <3F036646-8198-407A-B8C7-D291F13A419F@cs.otago.ac.nz> <7303670E-3243-494C-862E-872975E0C32D@gmail.com> Message-ID: <0091F031-C031-418B-B421-81B52FAFC694@cs.otago.ac.nz> On 17/09/2012, at 7:12 AM, Steve Davis wrote: > Since you can invent attributes, I have played with: > > -api({{Name, Arity}, "Short Descriptive Usage Comment"}). > > ...as a means of compiling brief module self-documention that is visible in X:module_info(attributes). That's a nice one. Except that I hate 'api'. It is still defined as "Application Programming Interface" and is the interface presented by a library layer such as an operating system or the X11 window system to application programs. Some people started using it to mean "function" apparently because "function" had too few syllables. How about "purpose" (two syllables instead of three) or even "for" (one)? EEP 24 suggested allowing Name/Arity anywhere in any attribute. -for({foo/1, "listing clowns"}). -for({bar/2, "telling a clown what routine to use"}). -for({ugh/3, "advising a clown which way to run and how fast"}). That EEP has R12B-5 written beside it, so it _should_ work... From watson.timothy@REDACTED Mon Sep 17 11:33:23 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Mon, 17 Sep 2012 10:33:23 +0100 Subject: [erlang-questions] Erlang nodes monitoring In-Reply-To: References: <41A3C3CE-343F-4A70-BB9B-B69E440C0C9A@gmail.com> Message-ID: On 14 September 2012 19:49, Max Bourinov wrote: > Does anybody know where to find docs for eper? I've never seen any. I ended up just reading the code. It's not OTP-esque but it's quite easy to follow once you get used to the conventions it uses. The bits to start with are prf, prfHost and prfTarg - once you've sussed what they're doing then the various stats collectors are easy enough to follow, and emulate if you wish to do your own thing with them. If you want to look at some example code, you could look at the dxkit app in https://github.com/hyperthunk/nodewatch (a *sample* project not a working solution) which uses eper to collect stats on remote nodes. From solomon.wzs@REDACTED Mon Sep 17 12:01:45 2012 From: solomon.wzs@REDACTED (Solomon) Date: Mon, 17 Sep 2012 18:01:45 +0800 Subject: [erlang-questions] Why reductions of supervisor is heigh? Message-ID: I test web server build with OTP, and I found reductions of supervisor was much heigher then gen_server, what was supervisor doing? -------------- next part -------------- An HTML attachment was scrubbed... URL: From prof3ta@REDACTED Mon Sep 17 12:25:08 2012 From: prof3ta@REDACTED (Roberto Aloi) Date: Mon, 17 Sep 2012 12:25:08 +0200 Subject: [erlang-questions] Why reductions of supervisor is heigh? In-Reply-To: References: Message-ID: Hi, > I test web server build with OTP, and I found reductions of supervisor was > much heigher then gen_server, what was supervisor doing? What kind of supervisor are we talking about? Does it have dynamic children? In OTP you can have different kinds of "supervisor". Assume you use a "simple_one_for_one" supervisor and you add children dynamically. In such a case, you would perform a call (or even more than one) to the supervisor process every time you append a child. That would affect the reductions counter. Roberto Aloi @robertoaloi From solomon.wzs@REDACTED Mon Sep 17 12:35:27 2012 From: solomon.wzs@REDACTED (Solomon) Date: Mon, 17 Sep 2012 18:35:27 +0800 Subject: [erlang-questions] Why reductions of supervisor is heigh? In-Reply-To: References: Message-ID: Hi, I generate the process like this code: *init([])-> Children={my_server, {my_server, start_link, []}, permanent, 5000, worker, [my_server]}, Processes=lists:flatten([Children]), Strategy={one_for_one, 100000, 1}, {ok, {Strategy, lists:flatten(Processes)}}.* The supervisor should append the children at the beginning. 2012/9/17 Roberto Aloi > Hi, > > > I test web server build with OTP, and I found reductions of supervisor > was > > much heigher then gen_server, what was supervisor doing? > > What kind of supervisor are we talking about? Does it have dynamic > children? > > In OTP you can have different kinds of "supervisor". Assume you use a > "simple_one_for_one" supervisor and you add children dynamically. In > such a case, you would perform a call (or even more than one) to the > supervisor process every time you append a child. That would affect > the reductions counter. > > Roberto Aloi > @robertoaloi > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomon.wzs@REDACTED Mon Sep 17 12:38:13 2012 From: solomon.wzs@REDACTED (Solomon) Date: Mon, 17 Sep 2012 18:38:13 +0800 Subject: [erlang-questions] Test the system bottlenecks Message-ID: I test a web server run on a 24-core server. When server get a message, it would read/write mnesia and return a message to client. All of the mnesia tables are ram_copies and disc_copies. I do a stress test and found that the heighest value of cpu load is only 900%, I get I/O load by iostat and it is idle, so I guess the system bottleneck is mnesia, but I found the reductions counter of mnesia's process are low. Is my guess right? -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon@REDACTED Mon Sep 17 12:43:41 2012 From: simon@REDACTED (Simon MacMullen) Date: Mon, 17 Sep 2012 11:43:41 +0100 Subject: [erlang-questions] C:\Program Files\erlx.x.x\bin - yes or no? Message-ID: <5056FEDD.6070700@rabbitmq.com> When I install the 32 bit version of R15B02 on Windows, I get two directories: C:\Program Files\erl5.9.2\bin C:\Program Files\erl5.9.2\erts-5.9.2\bin both containing erl.exe, etc. However, when I install the 64 bit version, I only get the latter one. This is somewhat annoying, since the registry key: HKLM\SOFTWARE\Ericsson\Erlang\5.9.2 points to C:\Program Files\erl5.9.2. We've been assuming (in the RabbitMQ Windows installer) that we can just stick a "\bin" on the end of that and find erl.exe. So is this a mistake in the build of the 64 bit binary, is there some subtlety that I'm not understanding, or what? How should I locate erl.exe? Cheers, Simon -- Simon MacMullen RabbitMQ, VMware From essen@REDACTED Mon Sep 17 13:20:12 2012 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Mon, 17 Sep 2012 13:20:12 +0200 Subject: [erlang-questions] Fun type specifications Message-ID: <5057076C.2090404@ninenines.eu> Hey, I came across this limitation a few times now. Assuming this is a limitation because I didn't find a solution. For function specs you can do something like this: -spec my_fun(Req) -> Req when Req::req(). You can't do this however. -type my_fun_type() -> fun((Req) -> Req when Req::req()). This is a bit annoying as this makes the typing of the funs a little less precise than I hoped. Did I miss something and can you still do something like this? Or if not, can this be added eventually? Thanks. -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From lukas@REDACTED Mon Sep 17 13:22:56 2012 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 17 Sep 2012 13:22:56 +0200 Subject: [erlang-questions] C:\Program Files\erlx.x.x\bin - yes or no? In-Reply-To: <5056FEDD.6070700@rabbitmq.com> References: <5056FEDD.6070700@rabbitmq.com> Message-ID: hmm, I just did a test install on windows 7 of win64[1] and it correctly put an erl.exe in the C:\Program Files\erl5.9.2\bin folder. What version of Windows are you testing on? Lukas [1]: http://www.erlang.org/download/otp_win64_R15B02.exe On Mon, Sep 17, 2012 at 12:43 PM, Simon MacMullen wrote: > When I install the 32 bit version of R15B02 on Windows, I get two > directories: > > C:\Program Files\erl5.9.2\bin > C:\Program Files\erl5.9.2\erts-5.9.2\bin > > both containing erl.exe, etc. > > However, when I install the 64 bit version, I only get the latter one. This > is somewhat annoying, since the registry key: > > HKLM\SOFTWARE\Ericsson\Erlang\5.9.2 > > points to C:\Program Files\erl5.9.2. We've been assuming (in the RabbitMQ > Windows installer) that we can just stick a "\bin" on the end of that and > find erl.exe. > > So is this a mistake in the build of the 64 bit binary, is there some > subtlety that I'm not understanding, or what? How should I locate erl.exe? > > Cheers, Simon > > -- > Simon MacMullen > RabbitMQ, VMware > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From f@REDACTED Mon Sep 17 13:33:20 2012 From: f@REDACTED (Francesco Mazzoli) Date: Mon, 17 Sep 2012 12:33:20 +0100 Subject: [erlang-questions] Fun type specifications In-Reply-To: <5057076C.2090404@ninenines.eu> References: <5057076C.2090404@ninenines.eu> Message-ID: <87lig8riin.wl%f@mazzo.li> At Mon, 17 Sep 2012 13:20:12 +0200, Lo?c Hoguin wrote: > -type my_fun_type() -> fun((Req) -> Req when Req::req()). > > This is a bit annoying as this makes the typing of the funs a little > less precise than I hoped. > > Did I miss something and can you still do something like this? Or if > not, can this be added eventually? Well, can't you simply do -type my_fun_type() -> fun((req()) -> req()) | other_type. ? -- Francesco * Often in error, never in doubt From essen@REDACTED Mon Sep 17 13:33:38 2012 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 17 Sep 2012 13:33:38 +0200 Subject: [erlang-questions] Fun type specifications In-Reply-To: <87lig8riin.wl%f@mazzo.li> References: <5057076C.2090404@ninenines.eu> <87lig8riin.wl%f@mazzo.li> Message-ID: <50570A92.4080304@ninenines.eu> On 09/17/2012 01:33 PM, Francesco Mazzoli wrote: > At Mon, 17 Sep 2012 13:20:12 +0200, > Lo?c Hoguin wrote: >> -type my_fun_type() -> fun((Req) -> Req when Req::req()). >> >> This is a bit annoying as this makes the typing of the funs a little >> less precise than I hoped. >> >> Did I miss something and can you still do something like this? Or if >> not, can this be added eventually? > > Well, can't you simply do > > -type my_fun_type() -> fun((req()) -> req()) | other_type. This doesn't show the relationship between the input and output, and I get many warnings in one case if I do that (probably due to req() being an opaque type). -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From f@REDACTED Mon Sep 17 13:43:47 2012 From: f@REDACTED (Francesco Mazzoli) Date: Mon, 17 Sep 2012 12:43:47 +0100 Subject: [erlang-questions] Fun type specifications In-Reply-To: <50570A92.4080304@ninenines.eu> References: <5057076C.2090404@ninenines.eu> <87lig8riin.wl%f@mazzo.li> <50570A92.4080304@ninenines.eu> Message-ID: <87k3vsri18.wl%f@mazzo.li> At Mon, 17 Sep 2012 13:33:38 +0200, Lo?c Hoguin wrote: > This doesn't show the relationship between the input and output It definitely shows that the return type and the argument's type are the same. > and I get many warnings in one case if I do that (probably due to req() being > an opaque type). That is weird, which warnings? Do you mean when type checking your code or for the declaration? I would expect the two declaration to be equivalent, but maybe there are subtleties. -- Francesco * Often in error, never in doubt From matthias@REDACTED Mon Sep 17 14:50:44 2012 From: matthias@REDACTED (Matthias Lang) Date: Mon, 17 Sep 2012 14:50:44 +0200 Subject: [erlang-questions] translating random (?) erlang.org pages...is this a scam? Message-ID: <20120917125044.GA17516@corelatus.se> Hi, I got the mail below. Its style is faintly spammy. On the face of it, some student wants to translate part of the Erlang FAQ into Serbo-Croatian. No reason for me to say no (I wrote most of the FAQ), they seem to give proper attribution to the source. But...this makes no sense. Why is a computer science student translating seemingly random stuff? Some increasingly odd examples: http://science dot webhostinggeeks dot com/anglogold-ashanti http://science dot webhostinggeeks dot com/aaron-ova-pc-podrska http://science dot webhostinggeeks dot com/zasto-je-greengeeks-dobar-za-vas-po-trey-evim- the last one is a (faithful?) translation of an ad for a web hosting company. Huh? I feel like I'm looking at a scam. Can someone tell me how it works? I've slightly mangled the URLs and mail addresses. Matt ---------------------------------------------------------------------- Date: Mon, 17 Sep 2012 12:56:00 +0200 From: Jovana Milutinovich To: matthias@REDACTED Subject: Re: Permission to translate your article at http://www.erlang.org Dear Sir, I have sent you my request for permission to translate your article a week ago and it was unclear whether your organization had time to take a look at it. It would be highly appreciative for my objects towards connecting ex Yugoslavian people with your article and information in it, if your website can take into consideration my proposal. I hope that you will find the time to review it. Yours sincerely, Jovana Milutinovich On Tue, Sep 11, 2012 at 2:31 PM, Jovana Milutinovich < jovanam at webhostinggeeks.com> wrote: > > Dear Sir, > > My name is Jovana. I found your article extremely interesting and would > like to spread the word for people from Ex Yugoslavia. > > Here's the URL of your article: http://www.erlang.org/faq/** > introduction.html > > Would you mind if I translate your article to Serbo-Croatian language and > post it on our site? > My purpose is to help people from Ex Yugoslavia better understand some > very useful information about computer science. > > Some quick info about myself: > I was born in Yugoslavia, Europe. Former Yugoslavia consisted of now > totally independent states like Serbia, Montenegro, Croatia, Bosnia & > Hercezovina, Slovenia and Macedonia, which are all united by Serbo-Croatian > language. > I'm currently studying Computer Science at the University of > Belgrade,Serbia. > > > With Kind Regards, > > Jovana Milutinovich > http://science dot webhostinggeeks dot com From simon@REDACTED Mon Sep 17 15:34:02 2012 From: simon@REDACTED (Simon MacMullen) Date: Mon, 17 Sep 2012 14:34:02 +0100 Subject: [erlang-questions] C:\Program Files\erlx.x.x\bin - yes or no? In-Reply-To: References: <5056FEDD.6070700@rabbitmq.com> Message-ID: <505726CA.7070409@rabbitmq.com> On 17/09/12 12:22, Lukas Larsson wrote: > hmm, I just did a test install on windows 7 of win64[1] and it > correctly put an erl.exe in the C:\Program Files\erl5.9.2\bin folder. > > What version of Windows are you testing on? Windows 7. "Enterprise Edition", local Administrator user. I tried the win64 and win32 versions several times, and each time I did not get C:\Program Files\erl5.9.2\bin from win64. I swear I am not making this up. Cheers, Simon -- Simon MacMullen RabbitMQ, VMware From ulf@REDACTED Mon Sep 17 15:37:46 2012 From: ulf@REDACTED (Ulf Wiger) Date: Mon, 17 Sep 2012 15:37:46 +0200 Subject: [erlang-questions] translating random (?) erlang.org pages...is this a scam? In-Reply-To: <20120917125044.GA17516@corelatus.se> References: <20120917125044.GA17516@corelatus.se> Message-ID: Could it be Duolingo, as described in this TED talk? http://duolingo.com/ BR, Ulf W On 17 Sep 2012, at 14:50, Matthias Lang wrote: > Hi, > > I got the mail below. Its style is faintly spammy. On the face of it, > some student wants to translate part of the Erlang FAQ into > Serbo-Croatian. No reason for me to say no (I wrote most of the FAQ), > they seem to give proper attribution to the source. > > But...this makes no sense. Why is a computer science student translating > seemingly random stuff? Some increasingly odd examples: > > http://science dot webhostinggeeks dot com/anglogold-ashanti > http://science dot webhostinggeeks dot com/aaron-ova-pc-podrska > http://science dot webhostinggeeks dot com/zasto-je-greengeeks-dobar-za-vas-po-trey-evim- > > the last one is a (faithful?) translation of an ad for a web hosting > company. Huh? > > I feel like I'm looking at a scam. Can someone tell me how it works? > > I've slightly mangled the URLs and mail addresses. > > Matt > > ---------------------------------------------------------------------- > > Date: Mon, 17 Sep 2012 12:56:00 +0200 > From: Jovana Milutinovich > To: matthias@REDACTED > Subject: Re: Permission to translate your article at http://www.erlang.org > > Dear Sir, > > > I have sent you my request for permission to translate your article a week > ago and it was unclear whether your organization had time to take a look at > it. It would be highly appreciative for my objects towards connecting ex > Yugoslavian people with your article and information in it, if your website > can take into consideration my proposal. I hope that you will find the time > to review it. > > > Yours sincerely, > > Jovana Milutinovich > > On Tue, Sep 11, 2012 at 2:31 PM, Jovana Milutinovich < > jovanam at webhostinggeeks.com> wrote: > >> >> Dear Sir, >> >> My name is Jovana. I found your article extremely interesting and would >> like to spread the word for people from Ex Yugoslavia. >> >> Here's the URL of your article: http://www.erlang.org/faq/** >> introduction.html >> >> Would you mind if I translate your article to Serbo-Croatian language and >> post it on our site? >> My purpose is to help people from Ex Yugoslavia better understand some >> very useful information about computer science. >> >> Some quick info about myself: >> I was born in Yugoslavia, Europe. Former Yugoslavia consisted of now >> totally independent states like Serbia, Montenegro, Croatia, Bosnia & >> Hercezovina, Slovenia and Macedonia, which are all united by Serbo-Croatian >> language. >> I'm currently studying Computer Science at the University of >> Belgrade,Serbia. >> >> >> With Kind Regards, >> >> Jovana Milutinovich >> http://science dot webhostinggeeks dot com > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com From steven.charles.davis@REDACTED Mon Sep 17 15:43:19 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Mon, 17 Sep 2012 08:43:19 -0500 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <0091F031-C031-418B-B421-81B52FAFC694@cs.otago.ac.nz> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <10dd1cd8-419a-4432-8344-9924b7d3b0c7@googlegroups.com> <3F036646-8198-407A-B8C7-D291F13A419F@cs.otago.ac.nz> <7303670E-3243-494C-862E-872975E0C32D@gmail.com> <0091F031-C031-418B-B421-81B52FAFC694@cs.otago.ac.nz> Message-ID: <5E031677-CCA8-42FB-A732-0917B7D95BDB@gmail.com> Good naming is often the hardest game. I have also used "public" rather than "api"... but that too has overtones; but maybe it's better - and you could go further I guess: -public([ {foo, [term, list], number, "Finds number of terms in list"}, {bar, ....} ]). Just playing :) /s On Sep 16, 2012, at 5:26 PM, "Richard O'Keefe" wrote: > > On 17/09/2012, at 7:12 AM, Steve Davis wrote: > >> Since you can invent attributes, I have played with: >> >> -api({{Name, Arity}, "Short Descriptive Usage Comment"}). >> >> ...as a means of compiling brief module self-documention that is visible in X:module_info(attributes). > > That's a nice one. Except that I hate 'api'. It is still defined as > "Application Programming Interface" and is the interface presented by > a library layer such as an operating system or the X11 window system > to application programs. Some people started using it to mean > "function" apparently because "function" had too few syllables. > How about "purpose" (two syllables instead of three) or even "for" (one)? > > EEP 24 suggested allowing Name/Arity anywhere in any attribute. > > -for({foo/1, "listing clowns"}). > -for({bar/2, "telling a clown what routine to use"}). > -for({ugh/3, "advising a clown which way to run and how fast"}). > > That EEP has R12B-5 written beside it, so it _should_ work... > From vladdu55@REDACTED Mon Sep 17 15:53:59 2012 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 17 Sep 2012 15:53:59 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <5E031677-CCA8-42FB-A732-0917B7D95BDB@gmail.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <10dd1cd8-419a-4432-8344-9924b7d3b0c7@googlegroups.com> <3F036646-8198-407A-B8C7-D291F13A419F@cs.otago.ac.nz> <7303670E-3243-494C-862E-872975E0C32D@gmail.com> <0091F031-C031-418B-B421-81B52FAFC694@cs.otago.ac.nz> <5E031677-CCA8-42FB-A732-0917B7D95BDB@gmail.com> Message-ID: Hi, On Mon, Sep 17, 2012 at 3:43 PM, Steve Davis wrote: > Good naming is often the hardest game. > > I have also used "public" rather than "api"... but that too has overtones; but maybe it's better > > - and you could go further I guess: > > -public([ > {foo, [term, list], number, "Finds number of terms in list"}, > {bar, ....} > ]). When this kind of description grows in detail, why not use the edocs and the -specs? The edocs could be parsed and stored in an attribute available at runtime, and the -spec is more complete that the simple types above. A lot of Erlang code already has edoc comments and -specs. Why invent a new format that says the same thing? Just playing ;-) regards, Vlad From gleber.p@REDACTED Mon Sep 17 16:11:14 2012 From: gleber.p@REDACTED (Gleb Peregud) Date: Mon, 17 Sep 2012 16:11:14 +0200 Subject: [erlang-questions] Test the system bottlenecks In-Reply-To: References: Message-ID: It is hard to answer with so little information. Few notes: - Mnesia is a very complex piece of software - there is very many processes and ETS tables. Both of them might be a serial bottleneck. And some serializing process/ets can be short lived. - If you use transactions for reads and writes, you are doing serialization of all operations, hence low CPU usage is an obvious result of this - If you are doing dirty operations, there might be some other locks which are being contented. Try recompiling erlang with lock counter enabled and taking a look at results. On Mon, Sep 17, 2012 at 12:38 PM, Solomon wrote: > I test a web server run on a 24-core server. When server get a message, it > would read/write mnesia and return a message to client. All of the mnesia > tables are ram_copies and disc_copies. > I do a stress test and found that the heighest value of cpu load is only > 900%, I get I/O load by iostat and it is idle, so I guess the system > bottleneck is mnesia, but I found the reductions counter of mnesia's process > are low. > Is my guess right? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From dmercer@REDACTED Mon Sep 17 17:17:25 2012 From: dmercer@REDACTED (David Mercer) Date: Mon, 17 Sep 2012 10:17:25 -0500 Subject: [erlang-questions] Comparative study involving Erlang In-Reply-To: <96229FFE-7A50-475B-9844-03759AA9EFF9@cs.otago.ac.nz> References: <96229FFE-7A50-475B-9844-03759AA9EFF9@cs.otago.ac.nz> Message-ID: <000001cd94e7$8bf15e60$a3d41b20$@gmail.com> On Sunday, September 16, 2012, Richard O'Keefe wrote: > On 14/09/2012, at 7:00 PM, Michael Turner wrote: > > My only concen is your requirement that the experts "briefly" comment. > > I see no reason to rule out Richard O'Keefe at this stage of > > recruitment. > > That was so funny! I am supposed to be writing a couple of exam papers... I concur. That was the funniest thing posted to this list in a couple of months. Cheers, DBM From lukas@REDACTED Mon Sep 17 18:25:04 2012 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 17 Sep 2012 18:25:04 +0200 Subject: [erlang-questions] C:\Program Files\erlx.x.x\bin - yes or no? In-Reply-To: <505726CA.7070409@rabbitmq.com> References: <5056FEDD.6070700@rabbitmq.com> <505726CA.7070409@rabbitmq.com> Message-ID: Very strange, have you tried running Install.exe manually in cmd? It should be in the erlang root folder, if it isn't could you please send me (off list) the install log? Lukas On Mon, Sep 17, 2012 at 3:34 PM, Simon MacMullen wrote: > On 17/09/12 12:22, Lukas Larsson wrote: >> >> hmm, I just did a test install on windows 7 of win64[1] and it >> correctly put an erl.exe in the C:\Program Files\erl5.9.2\bin folder. >> >> What version of Windows are you testing on? > > > Windows 7. "Enterprise Edition", local Administrator user. I tried the win64 > and win32 versions several times, and each time I did not get C:\Program > Files\erl5.9.2\bin from win64. > > I swear I am not making this up. > > > Cheers, Simon > > -- > Simon MacMullen > RabbitMQ, VMware > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From parseerror@REDACTED Mon Sep 17 23:49:49 2012 From: parseerror@REDACTED (Ryan Flynn) Date: Mon, 17 Sep 2012 17:49:49 -0400 Subject: [erlang-questions] Best place to advertise an Erlang job? Message-ID: Hi guys, My team is hiring; my employer has tried their usual agencies but hasn't had much luck. Is posting to this list frowned upon? If so, any suggestions? From zabrane3@REDACTED Tue Sep 18 00:38:57 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Tue, 18 Sep 2012 00:38:57 +0200 Subject: [erlang-questions] OSX: binding schedulers to processor cores doesn't work In-Reply-To: References: Message-ID: <762BE68C-7874-484C-9B3E-FF053454C13B@gmail.com> Hi Richard, Spent time looking for "set_affinity" equivalent on OSX today. Referring to this (page 3) http://images.apple.com/media/us/osx/2012/docs/OSX_for_UNIX_Users_TB_July2011.pdf it looks like OSX' scheduler (Snow, Lion, Mountain) still doesn't implement processor affinity for processes nor threads. Grrrrrrr ! Regards, Zabrane On Sep 16, 2012, at 8:44 PM, Rickard Green wrote: > Binding of schedulers has never been supported on MacOSX. I've not put much effort into it, but when I last looked into it (a long time ago) I couldn't find any functionality in MacOSX that could be used for this. This might have changed, thought. If you want to look into it, a patch implementing this is welcome. > > Regards, > Rickard Green, Erlang/OTP, Ericsson AB > > On Sep 16, 2012, at 12:00 PM, Zabrane Mickael wrote: > >> Hi guys, >> >> Trying to bind schedulers to processor cores simply fail on my MacOSX (10.7.4) using R15B01 and R15B02: >> $ erl +sbt db >> setting scheduler bind type 'db' failed: not supported >> [...] >> >> All other binding options failed too. Why? >> >> How one can use "+sbt db", now that the call to "erlang:system_flag(scheduler_bind_type,default_bind)" is deprecated? >> >> Regards, >> Zabrane >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From steven.charles.davis@REDACTED Tue Sep 18 01:23:22 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Mon, 17 Sep 2012 18:23:22 -0500 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <10dd1cd8-419a-4432-8344-9924b7d3b0c7@googlegroups.com> <3F036646-8198-407A-B8C7-D291F13A419F@cs.otago.ac.nz> <7303670E-3243-494C-862E-872975E0C32D@gmail.com> <0091F031-C031-418B-B421-81B52FAFC694@cs.otago.ac.nz> <5E031677-CCA8-42FB-A732-0917B7D95BDB@gmail.com> Message-ID: <7F82E08C-EEEE-4894-8E2E-4600725E76F7@gmail.com> Well, I guess I was just playing... However, since you ask, what this approach does do that -spec and edoc do not, is make a module self-documenting even when compiled. What's often missing with docs is "what is important here" and "what is the intention". So a distillation, for me at least, is more useful than verbose documentation which does tend to get out of date with the source no matter how well-intentioned. Also, and again a personal observation, I find -spec confusing as it looks like code and I find myself *reading it as code* and not documentation all too often (maybe I'm just dumb). My preference is a source file without it. My 2c, /s On Sep 17, 2012, at 8:53 AM, Vlad Dumitrescu wrote: > Hi, > > On Mon, Sep 17, 2012 at 3:43 PM, Steve Davis > wrote: >> Good naming is often the hardest game. >> >> I have also used "public" rather than "api"... but that too has overtones; but maybe it's better >> >> - and you could go further I guess: >> >> -public([ >> {foo, [term, list], number, "Finds number of terms in list"}, >> {bar, ....} >> ]). > > When this kind of description grows in detail, why not use the edocs > and the -specs? The edocs could be parsed and stored in an attribute > available at runtime, and the -spec is more complete that the simple > types above. A lot of Erlang code already has edoc comments and > -specs. Why invent a new format that says the same thing? > > Just playing ;-) > > regards, > Vlad From steven.charles.davis@REDACTED Tue Sep 18 01:29:39 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Mon, 17 Sep 2012 18:29:39 -0500 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: <7F82E08C-EEEE-4894-8E2E-4600725E76F7@gmail.com> References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <10dd1cd8-419a-4432-8344-9924b7d3b0c7@googlegroups.com> <3F036646-8198-407A-B8C7-D291F13A419F@cs.otago.ac.nz> <7303670E-3243-494C-862E-872975E0C32D@gmail.com> <0091F031-C031-418B-B421-81B52FAFC694@cs.otago.ac.nz> <5E031677-CCA8-42FB-A732-0917B7D95BDB@gmail.com> <7F82E08C-EEEE-4894-8E2E-4600725E76F7@gmail.com> Message-ID: Also, in case the point got lost, it does let you know which functions are intended to be used outside the app, rather than just ones that must be exported for internal use within, say, the library itself. On Sep 17, 2012, at 6:23 PM, Steve Davis wrote: > Well, I guess I was just playing... > > However, since you ask, what this approach does do that -spec and edoc do not, is make a module self-documenting even when compiled. > > What's often missing with docs is "what is important here" and "what is the intention". So a distillation, for me at least, is more useful than verbose documentation which does tend to get out of date with the source no matter how well-intentioned. > > Also, and again a personal observation, I find -spec confusing as it looks like code and I find myself *reading it as code* and not documentation all too often (maybe I'm just dumb). My preference is a source file without it. > > My 2c, > /s > > On Sep 17, 2012, at 8:53 AM, Vlad Dumitrescu wrote: > >> Hi, >> >> On Mon, Sep 17, 2012 at 3:43 PM, Steve Davis >> wrote: >>> Good naming is often the hardest game. >>> >>> I have also used "public" rather than "api"... but that too has overtones; but maybe it's better >>> >>> - and you could go further I guess: >>> >>> -public([ >>> {foo, [term, list], number, "Finds number of terms in list"}, >>> {bar, ....} >>> ]). >> >> When this kind of description grows in detail, why not use the edocs >> and the -specs? The edocs could be parsed and stored in an attribute >> available at runtime, and the -spec is more complete that the simple >> types above. A lot of Erlang code already has edoc comments and >> -specs. Why invent a new format that says the same thing? >> >> Just playing ;-) >> >> regards, >> Vlad > From vladdu55@REDACTED Tue Sep 18 08:35:28 2012 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 18 Sep 2012 08:35:28 +0200 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <10dd1cd8-419a-4432-8344-9924b7d3b0c7@googlegroups.com> <3F036646-8198-407A-B8C7-D291F13A419F@cs.otago.ac.nz> <7303670E-3243-494C-862E-872975E0C32D@gmail.com> <0091F031-C031-418B-B421-81B52FAFC694@cs.otago.ac.nz> <5E031677-CCA8-42FB-A732-0917B7D95BDB@gmail.com> <7F82E08C-EEEE-4894-8E2E-4600725E76F7@gmail.com> Message-ID: Hi, On Tue, Sep 18, 2012 at 1:29 AM, Steve Davis wrote: > Also, in case the point got lost, it does let you know which functions are intended to be used outside the app, rather than just ones that must be exported for internal use within, say, the library itself. No, the point was not lost. There's nothing preventing edoc have another @tag with this meaning. The edoc+spec information can be kept at runtime too, inside a beam chunk, so that's not an issue. The full edoc comments are maybe too verbose, but by convention the first sentence should be exactly the succint description that you mentioned. Also, when presenting the doc/spec to the user at runtime, the spec could get simplified, if requested. What I mean is that I think that your suggestions can be implemented with tools that already exist and are in use, with the advantage that many modules already have this information in them. I am not very keen on having yet another annotation that in time will get out of sync with the code proper... regards, Vlad > On Sep 17, 2012, at 6:23 PM, Steve Davis wrote: > >> Well, I guess I was just playing... >> >> However, since you ask, what this approach does do that -spec and edoc do not, is make a module self-documenting even when compiled. >> >> What's often missing with docs is "what is important here" and "what is the intention". So a distillation, for me at least, is more useful than verbose documentation which does tend to get out of date with the source no matter how well-intentioned. >> >> Also, and again a personal observation, I find -spec confusing as it looks like code and I find myself *reading it as code* and not documentation all too often (maybe I'm just dumb). My preference is a source file without it. >> >> My 2c, >> /s >> >> On Sep 17, 2012, at 8:53 AM, Vlad Dumitrescu wrote: >> >>> Hi, >>> >>> On Mon, Sep 17, 2012 at 3:43 PM, Steve Davis >>> wrote: >>>> Good naming is often the hardest game. >>>> >>>> I have also used "public" rather than "api"... but that too has overtones; but maybe it's better >>>> >>>> - and you could go further I guess: >>>> >>>> -public([ >>>> {foo, [term, list], number, "Finds number of terms in list"}, >>>> {bar, ....} >>>> ]). >>> >>> When this kind of description grows in detail, why not use the edocs >>> and the -specs? The edocs could be parsed and stored in an attribute >>> available at runtime, and the -spec is more complete that the simple >>> types above. A lot of Erlang code already has edoc comments and >>> -specs. Why invent a new format that says the same thing? >>> >>> Just playing ;-) >>> >>> regards, >>> Vlad >> > From sedrik@REDACTED Tue Sep 18 08:48:09 2012 From: sedrik@REDACTED (Fredrik Andersson) Date: Tue, 18 Sep 2012 08:48:09 +0200 Subject: [erlang-questions] translating random (?) erlang.org pages...is this a scam? In-Reply-To: References: <20120917125044.GA17516@corelatus.se> Message-ID: I doubt it, duolingo is a cool system but it's only available for learning French, German and Spanish as of this moment. On Mon, Sep 17, 2012 at 3:37 PM, Ulf Wiger wrote: > > Could it be Duolingo, as described in this TED talk? > > http://duolingo.com/ > > BR, > Ulf W > > On 17 Sep 2012, at 14:50, Matthias Lang wrote: > >> Hi, >> >> I got the mail below. Its style is faintly spammy. On the face of it, >> some student wants to translate part of the Erlang FAQ into >> Serbo-Croatian. No reason for me to say no (I wrote most of the FAQ), >> they seem to give proper attribution to the source. >> >> But...this makes no sense. Why is a computer science student translating >> seemingly random stuff? Some increasingly odd examples: >> >> http://science dot webhostinggeeks dot com/anglogold-ashanti >> http://science dot webhostinggeeks dot com/aaron-ova-pc-podrska >> http://science dot webhostinggeeks dot com/zasto-je-greengeeks-dobar-za-vas-po-trey-evim- >> >> the last one is a (faithful?) translation of an ad for a web hosting >> company. Huh? >> >> I feel like I'm looking at a scam. Can someone tell me how it works? >> >> I've slightly mangled the URLs and mail addresses. >> >> Matt >> >> ---------------------------------------------------------------------- >> >> Date: Mon, 17 Sep 2012 12:56:00 +0200 >> From: Jovana Milutinovich >> To: matthias@REDACTED >> Subject: Re: Permission to translate your article at http://www.erlang.org >> >> Dear Sir, >> >> >> I have sent you my request for permission to translate your article a week >> ago and it was unclear whether your organization had time to take a look at >> it. It would be highly appreciative for my objects towards connecting ex >> Yugoslavian people with your article and information in it, if your website >> can take into consideration my proposal. I hope that you will find the time >> to review it. >> >> >> Yours sincerely, >> >> Jovana Milutinovich >> >> On Tue, Sep 11, 2012 at 2:31 PM, Jovana Milutinovich < >> jovanam at webhostinggeeks.com> wrote: >> >>> >>> Dear Sir, >>> >>> My name is Jovana. I found your article extremely interesting and would >>> like to spread the word for people from Ex Yugoslavia. >>> >>> Here's the URL of your article: http://www.erlang.org/faq/** >>> introduction.html >>> >>> Would you mind if I translate your article to Serbo-Croatian language and >>> post it on our site? >>> My purpose is to help people from Ex Yugoslavia better understand some >>> very useful information about computer science. >>> >>> Some quick info about myself: >>> I was born in Yugoslavia, Europe. Former Yugoslavia consisted of now >>> totally independent states like Serbia, Montenegro, Croatia, Bosnia & >>> Hercezovina, Slovenia and Macedonia, which are all united by Serbo-Croatian >>> language. >>> I'm currently studying Computer Science at the University of >>> Belgrade,Serbia. >>> >>> >>> With Kind Regards, >>> >>> Jovana Milutinovich >>> http://science dot webhostinggeeks dot com >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From prof3ta@REDACTED Tue Sep 18 09:37:30 2012 From: prof3ta@REDACTED (Roberto Aloi) Date: Tue, 18 Sep 2012 09:37:30 +0200 Subject: [erlang-questions] Best place to advertise an Erlang job? In-Reply-To: References: Message-ID: Where to post an Erlang job: * Totally Erlang: http://totally-erlang.com * One of the Erlang LinkedIn groups (Erlang developers, Erlang/OTP Professionals) Cheers, Roberto Aloi --- Website: http://roberto-aloi.com Twitter: @robertoaloi From erlang@REDACTED Tue Sep 18 09:56:26 2012 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 18 Sep 2012 09:56:26 +0200 Subject: [erlang-questions] Bug in code:lib_dir Message-ID: If I set ERL_LIBS as follows export ERL_LIBS=/home/joe/deps and deps is as follows /deps/a/src /include From erlang@REDACTED Tue Sep 18 10:14:53 2012 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 18 Sep 2012 10:14:53 +0200 Subject: [erlang-questions] bug in code:lib_dir Message-ID: > code:lib_dir(b) {error,bad_name} Fails if the b sub-directory does not contain an ebin directory. This means things like include_lib("b/include/foo.hrl") will fail even though the file b/include/foo.hrl exists. Suppose I have a directory structure like this: /home/joe/deps/a/src /include /ebin /b/src /include/foo.hrl a and b are Erlang applications - note that b has no ebin directory Then I say > export ERL_LIBS=/home/joe/deps > erl Then > code:lib_dir(a). "/home/joe/deps/a/" But > code:lib_dir(b) {error,bad_name} Now suppose a.erl contains the line -include_lib("b/include/foo.hrl") I'll now get an error. The code server calls lib_dib(b) to resolve the file name reference. This fails and the system concludes (incorrectly) that b/include/foo.hrl does not exist. If I add an empty ebin directory to b then the error goes away. If you create src, ebin, include directories by hand you will never see this error. But if you use rebar then the ebin directory is not created when you do > rebar create-app appid= The ebin directory is created when you first run rebar compile. So recursive includes (a includes b/include and b includes a/include) can possibly fail if no ebin directory is created. Cheers /Joe From simon@REDACTED Tue Sep 18 12:02:34 2012 From: simon@REDACTED (Simon MacMullen) Date: Tue, 18 Sep 2012 11:02:34 +0100 Subject: [erlang-questions] C:\Program Files\erlx.x.x\bin - yes or no? In-Reply-To: References: <5056FEDD.6070700@rabbitmq.com> <505726CA.7070409@rabbitmq.com> Message-ID: <505846BA.4000303@rabbitmq.com> On 17/09/12 17:25, Lukas Larsson wrote: > have you tried running Install.exe manually in cmd? "The program can't start because MSVCR100.dll is missing from your computer. Try reinstalling the program to fix this problem." So we have a culprit. I guess this is a shared library that can be installed by tons of things, but I was installing on a brand new system. Is it possible to distribute this library with Erlang? If not, is it possible to detect its absence in the installer and pop up an error message telling the user to download it? :-) BTW, I also get the same symptoms installing win64 on a win32 system. Yes, of course you shouldn't do that, but again the failure is unobvious - you just get a partial installation and no error message. Cheers, Simon -- Simon MacMullen RabbitMQ, VMware From lukas@REDACTED Tue Sep 18 12:34:04 2012 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 18 Sep 2012 12:34:04 +0200 Subject: [erlang-questions] C:\Program Files\erlx.x.x\bin - yes or no? In-Reply-To: <505846BA.4000303@rabbitmq.com> References: <5056FEDD.6070700@rabbitmq.com> <505726CA.7070409@rabbitmq.com> <505846BA.4000303@rabbitmq.com> Message-ID: Hi, The .dll should have been part of it, however when fixing something else we apparently broke this functionality. R15B01 works as it should, we'll build a new installer for R15B02 after lunch and get it to you as soon as we can. Thanks for reporting this error! Lukas On Tue, Sep 18, 2012 at 12:02 PM, Simon MacMullen wrote: > On 17/09/12 17:25, Lukas Larsson wrote: >> >> have you tried running Install.exe manually in cmd? > > > "The program can't start because MSVCR100.dll is missing from your computer. > Try reinstalling the program to fix this problem." > > So we have a culprit. > > I guess this is a shared library that can be installed by tons of things, > but I was installing on a brand new system. Is it possible to distribute > this library with Erlang? If not, is it possible to detect its absence in > the installer and pop up an error message telling the user to download it? > :-) > > BTW, I also get the same symptoms installing win64 on a win32 system. Yes, > of course you shouldn't do that, but again the failure is unobvious - you > just get a partial installation and no error message. > > > Cheers, Simon > > -- > Simon MacMullen > RabbitMQ, VMware > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From simon@REDACTED Tue Sep 18 12:44:04 2012 From: simon@REDACTED (Simon MacMullen) Date: Tue, 18 Sep 2012 11:44:04 +0100 Subject: [erlang-questions] C:\Program Files\erlx.x.x\bin - yes or no? In-Reply-To: References: <5056FEDD.6070700@rabbitmq.com> <505726CA.7070409@rabbitmq.com> <505846BA.4000303@rabbitmq.com> Message-ID: <50585074.9090607@rabbitmq.com> On 18/09/12 11:34, Lukas Larsson wrote: > The .dll should have been part of it, however when fixing something > else we apparently broke this functionality. R15B01 works as it > should, we'll build a new installer for R15B02 after lunch and get it > to you as soon as we can. Ah, fabulous, thank you! Cheers, Simon -- Simon MacMullen RabbitMQ, VMware From simon@REDACTED Tue Sep 18 12:48:01 2012 From: simon@REDACTED (Simon MacMullen) Date: Tue, 18 Sep 2012 11:48:01 +0100 Subject: [erlang-questions] C:\Program Files\erlx.x.x\bin - yes or no? In-Reply-To: References: <5056FEDD.6070700@rabbitmq.com> <505726CA.7070409@rabbitmq.com> <505846BA.4000303@rabbitmq.com> Message-ID: <50585161.7090706@rabbitmq.com> ...although there is still the installing-win64-on-win32 thing. You may very well say "user error", but it would be really nice if the installer didn't look like it had succeeded :-) Cheers, Simon On 18/09/12 11:34, Lukas Larsson wrote: > Hi, > > The .dll should have been part of it, however when fixing something > else we apparently broke this functionality. R15B01 works as it > should, we'll build a new installer for R15B02 after lunch and get it > to you as soon as we can. > > Thanks for reporting this error! > > Lukas > > On Tue, Sep 18, 2012 at 12:02 PM, Simon MacMullen wrote: >> On 17/09/12 17:25, Lukas Larsson wrote: >>> >>> have you tried running Install.exe manually in cmd? >> >> >> "The program can't start because MSVCR100.dll is missing from your computer. >> Try reinstalling the program to fix this problem." >> >> So we have a culprit. >> >> I guess this is a shared library that can be installed by tons of things, >> but I was installing on a brand new system. Is it possible to distribute >> this library with Erlang? If not, is it possible to detect its absence in >> the installer and pop up an error message telling the user to download it? >> :-) >> >> BTW, I also get the same symptoms installing win64 on a win32 system. Yes, >> of course you shouldn't do that, but again the failure is unobvious - you >> just get a partial installation and no error message. >> >> >> Cheers, Simon >> >> -- >> Simon MacMullen >> RabbitMQ, VMware >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions -- Simon MacMullen RabbitMQ, VMware From serge@REDACTED Tue Sep 18 13:57:32 2012 From: serge@REDACTED (Serge Aleynikov) Date: Tue, 18 Sep 2012 07:57:32 -0400 Subject: [erlang-questions] [erlang-bugs] bug in code:lib_dir In-Reply-To: References: Message-ID: <505861AC.9040102@aleynikov.org> Joe, When I wrote the code supporting ERL_LIBS that got included in the code server (*), it was explicitly designed to iteratively check for paths only containing "ebin" child directories (see the code_server:get_user_lib_dirs_1/0) before adding them to the loader path. Therefore I wouldn't consider the behavior you mentioned to be a bug but rather a feature. Initially I wrote it in a way that checked for directories containing "*.app" files, and included those. However, I found cases when certain libraries didn't come with "*.app" files, but merely contained "ebin/*.beam" bytecode files, so the ebin directory checking was more reliable and conventional. In your case, since 'b' application doesn't seem to have neither b.app nor b/ebin. Should it be considered a valid code path (there's nothing to load for the code server)? If so, what is the right selection criteria that would avoid bloating the loader's path? Serge (*) http://www-rohan.sdsu.edu/doc/R12B/lib/kernel-2.12.3/doc/html/notes.html On 9/18/2012 4:14 AM, Joe Armstrong wrote: > > code:lib_dir(b) > {error,bad_name} > > Fails if the b sub-directory does not contain an ebin directory. > This means things like include_lib("b/include/foo.hrl") will fail > even though the file b/include/foo.hrl exists. > > > Suppose I have a directory structure like this: > > /home/joe/deps/a/src > /include > /ebin > /b/src > /include/foo.hrl > > > a and b are Erlang applications - note that b has no ebin directory > > Then I say > > > export ERL_LIBS=/home/joe/deps > > erl > > Then > > > code:lib_dir(a). > "/home/joe/deps/a/" > > But > > > code:lib_dir(b) > {error,bad_name} > > Now suppose a.erl contains the line > > -include_lib("b/include/foo.hrl") > > I'll now get an error. The code server calls lib_dib(b) to resolve > the file name > reference. This fails and the system concludes (incorrectly) that > b/include/foo.hrl does not > exist. > > If I add an empty ebin directory to b then the error goes away. > > If you create src, ebin, include directories by hand you will never > see this error. > > But if you use rebar then the ebin directory is not created when you do > > rebar create-app appid= > > The ebin directory is created when you first run rebar compile. > > So recursive includes (a includes b/include and b includes > a/include) can possibly > fail if no ebin directory is created. > > Cheers > > /Joe > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs > From steven.charles.davis@REDACTED Tue Sep 18 14:20:56 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Tue, 18 Sep 2012 07:20:56 -0500 Subject: [erlang-questions] Style wars: junk comments In-Reply-To: References: <033F5A3A-C60B-4E7B-8A65-A37A8D55DE74@cs.otago.ac.nz> <10dd1cd8-419a-4432-8344-9924b7d3b0c7@googlegroups.com> <3F036646-8198-407A-B8C7-D291F13A419F@cs.otago.ac.nz> <7303670E-3243-494C-862E-872975E0C32D@gmail.com> <0091F031-C031-418B-B421-81B52FAFC694@cs.otago.ac.nz> <5E031677-CCA8-42FB-A732-0917B7D95BDB@gmail.com> <7F82E08C-EEEE-4894-8E2E-4600725E76F7@gmail.com> Message-ID: <17416A1D-7599-4035-93A0-2C3B3275184E@gmail.com> Both good points. Perhaps some standard way of making this distinction should be provided. Best, /s On Sep 18, 2012, at 1:35 AM, Vlad Dumitrescu wrote: > Hi, > > On Tue, Sep 18, 2012 at 1:29 AM, Steve Davis > wrote: >> Also, in case the point got lost, it does let you know which functions are intended to be used outside the app, rather than just ones that must be exported for internal use within, say, the library itself. > > No, the point was not lost. There's nothing preventing edoc have > another @tag with this meaning. The edoc+spec information can be kept > at runtime too, inside a beam chunk, so that's not an issue. The full > edoc comments are maybe too verbose, but by convention the first > sentence should be exactly the succint description that you mentioned. > Also, when presenting the doc/spec to the user at runtime, the spec > could get simplified, if requested. > > What I mean is that I think that your suggestions can be implemented > with tools that already exist and are in use, with the advantage that > many modules already have this information in them. I am not very keen > on having yet another annotation that in time will get out of sync > with the code proper... > > regards, > Vlad From lukas@REDACTED Tue Sep 18 15:13:04 2012 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 18 Sep 2012 15:13:04 +0200 Subject: [erlang-questions] C:\Program Files\erlx.x.x\bin - yes or no? In-Reply-To: <50585161.7090706@rabbitmq.com> References: <5056FEDD.6070700@rabbitmq.com> <505726CA.7070409@rabbitmq.com> <505846BA.4000303@rabbitmq.com> <50585161.7090706@rabbitmq.com> Message-ID: Hi, I've found the bug, however because of the way our build procedures work it will take me a day to build and test the new release, hope that is ok. You are absolutely right about installing win64 on win32, I'll put a ticket in our backlog to fix that issue. Lukas On Tue, Sep 18, 2012 at 12:48 PM, Simon MacMullen wrote: > ...although there is still the installing-win64-on-win32 thing. You may very > well say "user error", but it would be really nice if the installer didn't > look like it had succeeded :-) > > Cheers, Simon > > > On 18/09/12 11:34, Lukas Larsson wrote: >> >> Hi, >> >> The .dll should have been part of it, however when fixing something >> else we apparently broke this functionality. R15B01 works as it >> should, we'll build a new installer for R15B02 after lunch and get it >> to you as soon as we can. >> >> Thanks for reporting this error! >> >> Lukas >> >> On Tue, Sep 18, 2012 at 12:02 PM, Simon MacMullen >> wrote: >>> >>> On 17/09/12 17:25, Lukas Larsson wrote: >>>> >>>> >>>> have you tried running Install.exe manually in cmd? >>> >>> >>> >>> "The program can't start because MSVCR100.dll is missing from your >>> computer. >>> Try reinstalling the program to fix this problem." >>> >>> So we have a culprit. >>> >>> I guess this is a shared library that can be installed by tons of things, >>> but I was installing on a brand new system. Is it possible to distribute >>> this library with Erlang? If not, is it possible to detect its absence in >>> the installer and pop up an error message telling the user to download >>> it? >>> :-) >>> >>> BTW, I also get the same symptoms installing win64 on a win32 system. >>> Yes, >>> of course you shouldn't do that, but again the failure is unobvious - you >>> just get a partial installation and no error message. >>> >>> >>> Cheers, Simon >>> >>> -- >>> Simon MacMullen >>> RabbitMQ, VMware >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > Simon MacMullen > RabbitMQ, VMware > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From simon@REDACTED Tue Sep 18 15:58:20 2012 From: simon@REDACTED (Simon MacMullen) Date: Tue, 18 Sep 2012 14:58:20 +0100 Subject: [erlang-questions] C:\Program Files\erlx.x.x\bin - yes or no? In-Reply-To: References: <5056FEDD.6070700@rabbitmq.com> <505726CA.7070409@rabbitmq.com> <505846BA.4000303@rabbitmq.com> <50585161.7090706@rabbitmq.com> Message-ID: <50587DFC.8080606@rabbitmq.com> On 18/09/12 14:13, Lukas Larsson wrote: > I've found the bug, however because of the way our build procedures > work it will take me a day to build and test the new release, hope > that is ok. Oh, of course. I was wondering about adding something to the RabbitMQ installer to detect / warn about this state of affairs. But that would take longer than a day... Cheers, Simon -- Simon MacMullen RabbitMQ, VMware From andrew@REDACTED Tue Sep 18 18:14:19 2012 From: andrew@REDACTED (Andrew Thompson) Date: Tue, 18 Sep 2012 12:14:19 -0400 Subject: [erlang-questions] io_lib format inconsistancies In-Reply-To: <20120907190329.GU5837@hijacked.us> References: <20120907190329.GU5837@hijacked.us> Message-ID: <20120918161419.GB8089@hijacked.us> Politely bumping this in hopes of an answer. Andrew From dave@REDACTED Tue Sep 18 20:20:07 2012 From: dave@REDACTED (David Goehrig) Date: Tue, 18 Sep 2012 14:20:07 -0400 Subject: [erlang-questions] erl_tidy customization Message-ID: Recently I ran erl_tidy on a code base and found myself quickly backing out its changes. As I get older and my vision gets weaker, I find my ability to distinguish between indenting levels declining. Match that with wide screen displays and larger font sizes, erl_tidy's formatting leaves a good deal to be desired. I saw there was a discussion in 2010 about hacking new pretty printers, but didn't see any links with code. Does anyone know of a good non-emacs mode pretty printer they can share? I'd rather not start from scratch :) Dave -=-=- dave@REDACTED -=-=- From erlang@REDACTED Tue Sep 18 20:54:03 2012 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 18 Sep 2012 20:54:03 +0200 Subject: [erlang-questions] [erlang-bugs] bug in code:lib_dir In-Reply-To: <505861AC.9040102@aleynikov.org> References: <505861AC.9040102@aleynikov.org> Message-ID: On Tue, Sep 18, 2012 at 1:57 PM, Serge Aleynikov wrote: > Joe, > > When I wrote the code supporting ERL_LIBS that got included in the code > server (*), it was explicitly designed to iteratively check for paths > only containing "ebin" child directories (see the > code_server:get_user_lib_dirs_1/0) before adding them to the loader > path. Therefore I wouldn't consider the behavior you mentioned to be a > bug but rather a feature. > > Initially I wrote it in a way that checked for directories containing > "*.app" files, and included those. However, I found cases when certain > libraries didn't come with "*.app" files, but merely contained > "ebin/*.beam" bytecode files, so the ebin directory checking was more > reliable and conventional. > > In your case, since 'b' application doesn't seem to have neither b.app > nor b/ebin. Should it be considered a valid code path (there's nothing > to load for the code server)? If so, what is the right selection > criteria that would avoid bloating the loader's path? Well the problem is that code:lib_dir(a) is called when the compiler tries to compile a file containing an include_lib directive like -include_lib("a/include/foo.hrl"). If there really is a file called "a/include/foo.hrl" then it seems rather harsh to fail the compilation. rebar in particular only creates an ebin direction as a result of a compile - I googled a bit and found many cases where a missing include file message was worrying people - and I think this was the reason. In the project I was looking at this bug occurred and was fixed with a work-around. I'm not sure about "code loader path bloat" if you trust the LIB_DIRS env variable is correctly set. I'm not sure if you recursively scan all directories below the LIB_DIRS but I guess just one level would be ok. The problem also happens (I think) if git doesn't remake an empty ebin directory. The problem is in find_lib_dir (line 637) of epp.erl Actually the compile error message could be more helpful can't find include lib "aaa/include/d.yrl" It's true - but confused me for a hour - why could't it find this file - ERL_LIBS had aaa in it's path - if the message had been can't find include lib "aaa/include/d.yrl" (possible reason aaa/ebin is missing) I would have guessed what was going wrong. The root of the problem is that you can't identify app directories - sooner or later this must be fixed - I think there should be a proper manifest.json (or something) in top level of the app - this and only this would identify this as an app. Until then we need various work-arounds. Probably easiest to change epp so is calls something other than code:lib_dir when resolving the filename Cheers /Joe > > Serge > > (*) http://www-rohan.sdsu.edu/doc/R12B/lib/kernel-2.12.3/doc/html/notes.html > > On 9/18/2012 4:14 AM, Joe Armstrong wrote: >> > code:lib_dir(b) >> {error,bad_name} >> >> Fails if the b sub-directory does not contain an ebin directory. >> This means things like include_lib("b/include/foo.hrl") will fail >> even though the file b/include/foo.hrl exists. >> >> >> Suppose I have a directory structure like this: >> >> /home/joe/deps/a/src >> /include >> /ebin >> /b/src >> /include/foo.hrl >> >> >> a and b are Erlang applications - note that b has no ebin directory >> >> Then I say >> >> > export ERL_LIBS=/home/joe/deps >> > erl >> >> Then >> >> > code:lib_dir(a). >> "/home/joe/deps/a/" >> >> But >> >> > code:lib_dir(b) >> {error,bad_name} >> >> Now suppose a.erl contains the line >> >> -include_lib("b/include/foo.hrl") >> >> I'll now get an error. The code server calls lib_dib(b) to resolve >> the file name >> reference. This fails and the system concludes (incorrectly) that >> b/include/foo.hrl does not >> exist. >> >> If I add an empty ebin directory to b then the error goes away. >> >> If you create src, ebin, include directories by hand you will never >> see this error. >> >> But if you use rebar then the ebin directory is not created when you do >> > rebar create-app appid= >> >> The ebin directory is created when you first run rebar compile. >> >> So recursive includes (a includes b/include and b includes >> a/include) can possibly >> fail if no ebin directory is created. >> >> Cheers >> >> /Joe >> _______________________________________________ >> erlang-bugs mailing list >> erlang-bugs@REDACTED >> http://erlang.org/mailman/listinfo/erlang-bugs >> From ward@REDACTED Tue Sep 18 21:17:48 2012 From: ward@REDACTED (Ward Bekker (TTY)) Date: Tue, 18 Sep 2012 21:17:48 +0200 Subject: [erlang-questions] Presentation on Erlang in Utrecht the Netherlands, looking for speaker on 27th sept or 25th oct or 29 nov. In-Reply-To: <505318F2.1090401@gmail.com> References: <505318F2.1090401@gmail.com> Message-ID: <36B8163C-0C3A-40A3-8292-149708408C2D@tty.nl> Hi Bjorn, I've 'reposted' your request to Linked-In group of EUG-NL, the Dutch Erlang Usergroup. http://www.linkedin.com/groupItem?view=&gid=3917956&type=member&item=165383664&qid=b58591b7-74e7-4c63-bc76-d1e499036f01&trk=group_most_recent_rich-0-b-ttl&goback=%2Egmr_3917956 Met vriendelijke groet, Ward Bekker On 14 sep. 2012, at 13:45, BjornW wrote: > Hi, > > I wasn't sure were to send this email, so please excuse me if this is > the wrong place to ask these things and please point me in the right > direction. > > My name is Bjorn Wijers and I'm organizing together with Jeroen Tietema > a local informal grassroots technology oriented meetup in Utrecht the > Netherlands called HackersNL* > > For our next few meetups we're looking for people to speak about certain > topics. One of those topics is programming languages (previously we've > had a speaker on Scala) and we'd like to invite a speaker on Erlang. > > Is there anyone on this list located in the Netherlands who would be > interested in giving a talk on Erlang for free? > > Please let us know and send a mail to contact@REDACTED Alhtough our > website and meetups are usually in Dutch we welcome English speakers as > well. For those of you interested have a look at our website > http://hackersnl.nl or send us an email: contact@REDACTED > > * it will soonish be renamed into BEEA which stands for Bits Electrons > and Atoms in Dutch. > > grtz > BjornW > > -- > > met vriendelijke groet, > Bjorn Wijers > > * b u r o b j o r n .nl * > digitaal vakmanschap | digital craftsmanship > > Werkdagen: > Van maandag t/m donderdag vanaf 10:00 > Vrijdag is voor experimenteren en eigen projecten. > > Postbus 14145 > 3508 SE Utrecht > The Netherlands > > tel: +31 6 49 74 78 70 > http://www.burobjorn.nl > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Tue Sep 18 21:39:03 2012 From: mononcqc@REDACTED (Fred Hebert) Date: Tue, 18 Sep 2012 15:39:03 -0400 Subject: [erlang-questions] [erlang-bugs] bug in code:lib_dir In-Reply-To: References: <505861AC.9040102@aleynikov.org> Message-ID: <5058CDD7.80902@ferd.ca> It sounds like you could solve the problem quite easily by adding an app file to your directory, transforming it into a library application, assuming the following project structure: lib_dir/ebin/my_app.app lib_dir/include/my_app.hrl where my_app.app looks as follows: {application, my_app, [{description, "useful header files for Joe"}, {vsn, "1.0.0"}, {modules, []}]}. This should give you an entirely empty library application -- with no beam code, but a .app file is present. This makes it visible to ERL_LIBS, usable as a dependency with rebar, visible and manageable in releases, etc. On 12-09-18 2:54 PM, Joe Armstrong wrote: > On Tue, Sep 18, 2012 at 1:57 PM, Serge Aleynikov wrote: >> Joe, >> >> When I wrote the code supporting ERL_LIBS that got included in the code >> server (*), it was explicitly designed to iteratively check for paths >> only containing "ebin" child directories (see the >> code_server:get_user_lib_dirs_1/0) before adding them to the loader >> path. Therefore I wouldn't consider the behavior you mentioned to be a >> bug but rather a feature. >> >> Initially I wrote it in a way that checked for directories containing >> "*.app" files, and included those. However, I found cases when certain >> libraries didn't come with "*.app" files, but merely contained >> "ebin/*.beam" bytecode files, so the ebin directory checking was more >> reliable and conventional. >> >> In your case, since 'b' application doesn't seem to have neither b.app >> nor b/ebin. Should it be considered a valid code path (there's nothing >> to load for the code server)? If so, what is the right selection >> criteria that would avoid bloating the loader's path? > Well the problem is that code:lib_dir(a) is called when > the compiler tries to compile a file containing an include_lib > directive like > > -include_lib("a/include/foo.hrl"). > > If there really is a file called "a/include/foo.hrl" then it seems > rather harsh to fail the compilation. > > rebar in particular only creates an ebin direction as a result of a > compile - I googled a bit and found many cases where a > missing include file message was worrying people - and I think this > was the reason. In the project I was looking at > this bug occurred and was fixed with a work-around. > > I'm not sure about "code loader path bloat" if you trust > the LIB_DIRS env variable is correctly set. I'm not sure if > you recursively scan all directories below the LIB_DIRS > but I guess just one level would be ok. > > The problem also happens (I think) if git doesn't remake an > empty ebin directory. > > The problem is in find_lib_dir (line 637) of epp.erl > > Actually the compile error message could be more helpful > > can't find include lib "aaa/include/d.yrl" > > It's true - but confused me for a hour - why could't it find > this file - ERL_LIBS had aaa in it's path - if the message had been > > can't find include lib "aaa/include/d.yrl" > (possible reason aaa/ebin is missing) > > I would have guessed what was going wrong. > > The root of the problem is that you can't identify app directories - > sooner or later this must be fixed - I think > there should be a proper manifest.json (or something) in > top level of the app - this and only this would identify this as an app. > > Until then we need various work-arounds. Probably easiest > to change epp so is calls something other than code:lib_dir > when resolving the filename > > Cheers > > /Joe > > > > > >> Serge >> >> (*) http://www-rohan.sdsu.edu/doc/R12B/lib/kernel-2.12.3/doc/html/notes.html >> >> On 9/18/2012 4:14 AM, Joe Armstrong wrote: >>> > code:lib_dir(b) >>> {error,bad_name} >>> >>> Fails if the b sub-directory does not contain an ebin directory. >>> This means things like include_lib("b/include/foo.hrl") will fail >>> even though the file b/include/foo.hrl exists. >>> >>> >>> Suppose I have a directory structure like this: >>> >>> /home/joe/deps/a/src >>> /include >>> /ebin >>> /b/src >>> /include/foo.hrl >>> >>> >>> a and b are Erlang applications - note that b has no ebin directory >>> >>> Then I say >>> >>> > export ERL_LIBS=/home/joe/deps >>> > erl >>> >>> Then >>> >>> > code:lib_dir(a). >>> "/home/joe/deps/a/" >>> >>> But >>> >>> > code:lib_dir(b) >>> {error,bad_name} >>> >>> Now suppose a.erl contains the line >>> >>> -include_lib("b/include/foo.hrl") >>> >>> I'll now get an error. The code server calls lib_dib(b) to resolve >>> the file name >>> reference. This fails and the system concludes (incorrectly) that >>> b/include/foo.hrl does not >>> exist. >>> >>> If I add an empty ebin directory to b then the error goes away. >>> >>> If you create src, ebin, include directories by hand you will never >>> see this error. >>> >>> But if you use rebar then the ebin directory is not created when you do >>> > rebar create-app appid= >>> >>> The ebin directory is created when you first run rebar compile. >>> >>> So recursive includes (a includes b/include and b includes >>> a/include) can possibly >>> fail if no ebin directory is created. >>> >>> Cheers >>> >>> /Joe >>> _______________________________________________ >>> erlang-bugs mailing list >>> erlang-bugs@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-bugs >>> > _______________________________________________ > erlang-bugs mailing list > erlang-bugs@REDACTED > http://erlang.org/mailman/listinfo/erlang-bugs From serge@REDACTED Wed Sep 19 01:33:26 2012 From: serge@REDACTED (Serge Aleynikov) Date: Tue, 18 Sep 2012 19:33:26 -0400 Subject: [erlang-questions] [erlang-bugs] bug in code:lib_dir In-Reply-To: <5058CDD7.80902@ferd.ca> References: <505861AC.9040102@aleynikov.org> <5058CDD7.80902@ferd.ca> Message-ID: <505904C6.9020507@aleynikov.org> +1. On 9/18/2012 3:39 PM, Fred Hebert wrote: > It sounds like you could solve the problem quite easily by adding an app > file to your directory, transforming it into a library application, > assuming the following project structure: > > lib_dir/ebin/my_app.app > lib_dir/include/my_app.hrl > > where my_app.app looks as follows: > > {application, my_app, > [{description, "useful header files for Joe"}, > {vsn, "1.0.0"}, > {modules, []}]}. > > This should give you an entirely empty library application -- with no > beam code, but a .app file is present. This makes it visible to > ERL_LIBS, usable as a dependency with rebar, visible and manageable in > releases, etc. > > > On 12-09-18 2:54 PM, Joe Armstrong wrote: >> On Tue, Sep 18, 2012 at 1:57 PM, Serge Aleynikov >> wrote: >>> Joe, >>> >>> When I wrote the code supporting ERL_LIBS that got included in the code >>> server (*), it was explicitly designed to iteratively check for paths >>> only containing "ebin" child directories (see the >>> code_server:get_user_lib_dirs_1/0) before adding them to the loader >>> path. Therefore I wouldn't consider the behavior you mentioned to be a >>> bug but rather a feature. >>> >>> Initially I wrote it in a way that checked for directories containing >>> "*.app" files, and included those. However, I found cases when certain >>> libraries didn't come with "*.app" files, but merely contained >>> "ebin/*.beam" bytecode files, so the ebin directory checking was more >>> reliable and conventional. >>> >>> In your case, since 'b' application doesn't seem to have neither b.app >>> nor b/ebin. Should it be considered a valid code path (there's nothing >>> to load for the code server)? If so, what is the right selection >>> criteria that would avoid bloating the loader's path? >> Well the problem is that code:lib_dir(a) is called when >> the compiler tries to compile a file containing an include_lib >> directive like >> >> -include_lib("a/include/foo.hrl"). >> >> If there really is a file called "a/include/foo.hrl" then it seems >> rather harsh to fail the compilation. >> >> rebar in particular only creates an ebin direction as a result of a >> compile - I googled a bit and found many cases where a >> missing include file message was worrying people - and I think this >> was the reason. In the project I was looking at >> this bug occurred and was fixed with a work-around. >> >> I'm not sure about "code loader path bloat" if you trust >> the LIB_DIRS env variable is correctly set. I'm not sure if >> you recursively scan all directories below the LIB_DIRS >> but I guess just one level would be ok. >> >> The problem also happens (I think) if git doesn't remake an >> empty ebin directory. >> >> The problem is in find_lib_dir (line 637) of epp.erl >> >> Actually the compile error message could be more helpful >> >> can't find include lib "aaa/include/d.yrl" >> >> It's true - but confused me for a hour - why could't it find >> this file - ERL_LIBS had aaa in it's path - if the message had been >> >> can't find include lib "aaa/include/d.yrl" >> (possible reason aaa/ebin is missing) >> >> I would have guessed what was going wrong. >> >> The root of the problem is that you can't identify app directories - >> sooner or later this must be fixed - I think >> there should be a proper manifest.json (or something) in >> top level of the app - this and only this would identify this as an app. >> >> Until then we need various work-arounds. Probably easiest >> to change epp so is calls something other than code:lib_dir >> when resolving the filename >> >> Cheers >> >> /Joe >> >> >> >> >> >>> Serge >>> >>> (*) >>> http://www-rohan.sdsu.edu/doc/R12B/lib/kernel-2.12.3/doc/html/notes.html >>> >>> On 9/18/2012 4:14 AM, Joe Armstrong wrote: >>>> > code:lib_dir(b) >>>> {error,bad_name} >>>> >>>> Fails if the b sub-directory does not contain an ebin directory. >>>> This means things like include_lib("b/include/foo.hrl") will fail >>>> even though the file b/include/foo.hrl exists. >>>> >>>> >>>> Suppose I have a directory structure like this: >>>> >>>> /home/joe/deps/a/src >>>> /include >>>> /ebin >>>> /b/src >>>> /include/foo.hrl >>>> >>>> >>>> a and b are Erlang applications - note that b has no ebin directory >>>> >>>> Then I say >>>> >>>> > export ERL_LIBS=/home/joe/deps >>>> > erl >>>> >>>> Then >>>> >>>> > code:lib_dir(a). >>>> "/home/joe/deps/a/" >>>> >>>> But >>>> >>>> > code:lib_dir(b) >>>> {error,bad_name} >>>> >>>> Now suppose a.erl contains the line >>>> >>>> -include_lib("b/include/foo.hrl") >>>> >>>> I'll now get an error. The code server calls lib_dib(b) to resolve >>>> the file name >>>> reference. This fails and the system concludes (incorrectly) that >>>> b/include/foo.hrl does not >>>> exist. >>>> >>>> If I add an empty ebin directory to b then the error goes away. >>>> >>>> If you create src, ebin, include directories by hand you will never >>>> see this error. >>>> >>>> But if you use rebar then the ebin directory is not created when >>>> you do >>>> > rebar create-app appid= >>>> >>>> The ebin directory is created when you first run rebar compile. >>>> >>>> So recursive includes (a includes b/include and b includes >>>> a/include) can possibly >>>> fail if no ebin directory is created. >>>> >>>> Cheers >>>> >>>> /Joe >>>> _______________________________________________ >>>> erlang-bugs mailing list >>>> erlang-bugs@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-bugs >>>> >> _______________________________________________ >> erlang-bugs mailing list >> erlang-bugs@REDACTED >> http://erlang.org/mailman/listinfo/erlang-bugs > From torben.lehoff@REDACTED Wed Sep 19 11:35:39 2012 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Wed, 19 Sep 2012 11:35:39 +0200 Subject: [erlang-questions] Good examples of failures and restart Message-ID: <505991EB.3020104@gmail.com> Hi, My old professor is looking for some good examples of failures and restarts, so I was wondering if any of you could recommend a good project to look at. A bit of context: he has written a book on introduction to programming using F# (hold your horses) and is now trying to find some good examples of how to handle failures and restarts. His agenda is to show how one can do decent concurrent programming in F#. He is intensely smart despite being retired and will be able to read through Erlang without any issues. My thinking is that Erlang is the best solution for these things - it will not change his choice given his commitments - but then we should be able to give him some good examples of how this is handled in Erlang. Then he can experience the pain of implementing these things in F# and maybe start mixing Erlang and F# down the road. (Yes, I tend to have wishful thinking, but as an Erlang Priest I am obliged to think like that ;-) ). Thanks in advance, ___ /orben -- http://www.linkedin.com/in/torbenhoffmannH From alexhuang1984@REDACTED Wed Sep 19 15:08:58 2012 From: alexhuang1984@REDACTED (huang alex) Date: Wed, 19 Sep 2012 21:08:58 +0800 Subject: [erlang-questions] make from otp src error with `in6addr_any` `in6addr_loopback` Message-ID: Hi all: I used to build erlang from otp src, every thing was fine. This time I got this error gcc -g -O2 -I/home/huanghuang/otp/erts/x86_64-unknown-linux-gnu -fno-tree-copyrename -D_GNU_SOURCE -DERTS_SMP -DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -DLIBSCTP=libsctp.so.1 -Ix86_64-unknown-linux-gnu/opt/smp -Ibeam -Isys/unix -Isys/common -Ix86_64-unknown-linux-gnu -Izlib -Ipcre -Ihipe -I../include -I../include/x86_64-unknown-linux-gnu -I../include/internal -I../include/internal/x86_64-unknown-linux-gnu -Idrivers/common -Idrivers/unix -c drivers/common/inet_drv.c -o obj/x86_64-unknown-linux-gnu/opt/smp/inet_drv.o drivers/common/inet_drv.c:1236:30: error: static declaration of ?in6addr_any? follows non-static declaration /usr/include/netinet/in.h:215:30: note: previous declaration of ?in6addr_any? was here drivers/common/inet_drv.c:1246:30: error: static declaration of ?in6addr_loopback? follows non-static declaration /usr/include/netinet/in.h:216:30: note: previous declaration of ?in6addr_loopback? was here make[3]: *** [obj/x86_64-unknown-linux-gnu/opt/smp/inet_drv.o] Error 1 make[3]: Leaving directory `/home/huanghuang/otp/erts/emulator' make[2]: *** [opt] Error 2 make[2]: Leaving directory `/home/huanghuang/otp/erts/emulator' make[1]: *** [smp] Error 2 make[1]: Leaving directory `/home/huanghuang/otp/erts' Is it related to something about ipv6? Do I have to install any other depedencies? Thanks. ?? (Alex Huang) -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Wed Sep 19 15:38:42 2012 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 19 Sep 2012 15:38:42 +0200 Subject: [erlang-questions] io_lib format inconsistancies In-Reply-To: <20120907190329.GU5837@hijacked.us> References: <20120907190329.GU5837@hijacked.us> Message-ID: <20120919133842.GA32057@erix.ericsson.se> On Fri, Sep 07, 2012 at 03:03:29PM -0400, Andrew Thompson wrote: > I wrote a quickcheck test for lager to compare its formatting to io_lib, > and I found a bunch of dissimilarities. However, a couple of the things > I found didn't make a lot of sense, so I figured I'd ask here for an > explanation. > > First one: > > 1> io:format("~P", [<<>>, 1]). > <<>>ok > 2> io:format("~W", [<<>>, 1]). > <<...>>ok > 3> io:format("~P", [<<1>>, 1]). > <<...>>ok > 4> io:format("~W", [<<1>>, 1]). > <<...>>ok > > As you can see, ~P and ~W behave differently on the empty binary, but > behave the same when the binary isn't empty. Seems a bit weird. > > The other one that bothers me: > > 16> io:format("~P", ['hello world', 2]). > 'hello world'ok > 17> io:format("~P", ["hello world", 2]). > "hello world"ok > 18> io:format("~P", [<<"hello world">>, 2]). > <<"hell"...>>ok > 19> io:format("~W", ['hello world', 2]). > 'hello world'ok > 20> io:format("~W", ["hello world", 2]). > [104|...]ok > 21> io:format("~W", [<<"hello world">>, 2]). > <<104,...>>ok > > Why does a 'depth' of 2 mean we print the <<>> and the first *four* > characters of a binary? ~W behaves much more logically. Also why does > depth not apply to printable lists, but it does to binaries? > > I've got a branch now for lager to be compatible with this madness, but > I wondered if anyone knows *why* things are like this? I guess the awkward answer is that the different routines were implemented by different people at different times without hard specification... Examples 1> vs. 2> looks like an off-by-one bug where 2> must be wrong since it is misleading. Example 17> shows that the ~P thinks a printable string is one item only and hence has depth 1. This is dangerous since a very long string can hog the I/O server. There is however some sense in regarding a printable string as having no depth (depth one). Example 18> shows that the author of binary pretty-print thought a very long binary even with a printable string should have depth not to hog an I/O server. A value was chosen so that 4 characters are considered as depth 1. That looks like an arbitrary practical compromise; 4 characters are 1 word. These are the obvious flaws I see: * Something like ~P for printable binaries is needed for strings, but the value 4 characters for depth 1 seems low. An atom has max length 256 bytes (I think) giving depth 1. ~P for printable binaries should behave like for strings. * The discrepancy for ~P vs. ~W on <<>> should be fixed. > > https://github.com/basho/lager/pull/77 > > Andrew > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From tomas.abrahamsson@REDACTED Wed Sep 19 16:31:58 2012 From: tomas.abrahamsson@REDACTED (Tomas Abrahamsson) Date: Wed, 19 Sep 2012 16:31:58 +0200 Subject: [erlang-questions] make from otp src error with `in6addr_any` `in6addr_loopback` In-Reply-To: References: Message-ID: On Wed, Sep 19, 2012 at 3:08 PM, huang alex wrote: > Hi all: > > I used to build erlang from otp src, every thing was fine. > > This time I got this error > > gcc -g -O2 -I/home/huanghuang/otp/erts/x86_64-unknown-linux-gnu [...] > obj/x86_64-unknown-linux-gnu/opt/smp/inet_drv.o > drivers/common/inet_drv.c:1236:30: error: static declaration of ?in6addr_any? follows non-static declaration > /usr/include/netinet/in.h:215:30: note: previous declaration of ?in6addr_any? was here > drivers/common/inet_drv.c:1246:30: error: static declaration of ?in6addr_loopback? follows non-static declaration > /usr/include/netinet/in.h:216:30: note: previous declaration of ?in6addr_loopback? was here > make[3]: *** [obj/x86_64-unknown-linux-gnu/opt/smp/inet_drv.o] Error 1 > Is it related to something about ipv6? Do I have to install any other > depedencies? Hi, the change in inet_drv.c was due to my bugfixing of multihoming for sctp (for ipv6 on linux and both ipv4/ipv6 on some other platforms). However, the erts/configure.in is supposed to check for any such dependencies and define appropriate preprocessor symbols, it looks like that has failed in your case, for some reason. One thing to try is to build _completely_ from scratch (don't know if you've tried that already, or not). Also the output from the configure would be interesting to see? What linux platoform are you running on, what distro and version? You say you are building from source, if this means you're building from a git repo, then one (crude) way to ensure you're building from scratch, is to run git ls-files -o -z | xargs -0 /bin/rm -rf which will remove _all_ files not known to git. BRs Tomas From lukas@REDACTED Wed Sep 19 16:35:46 2012 From: lukas@REDACTED (Lukas Larsson) Date: Wed, 19 Sep 2012 16:35:46 +0200 Subject: [erlang-questions] New Windows installer for R15B02 Message-ID: Hello all Windows users, The windows installer for R15B02 did not contain the MSVCR100.dll which is needed when installing and running Erlang/OTP on most fresh windows systems. There is now a new version of the win32[1] and win64[2] installer with accompanying source[3] available at http://www.erlang.org/download/. So if you have had issues installing Erlang/OTP R15B02 on Windows, take the new installer at http://erlang.org/download and hopefully it will work for you. Lukas Erlang/OTP team [1]: http://www.erlang.org/download/otp_win32_R15B02_with_MSVCR100_installer_fix.exe [2]: http://www.erlang.org/download/otp_win64_R15B02_with_MSVCR100_installer_fix.exe [3]: http://www.erlang.org/download/otp_src_R15B02_with_MSVCR100_installer_fix.tar.gz From bgustavsson@REDACTED Wed Sep 19 17:13:10 2012 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Wed, 19 Sep 2012 17:13:10 +0200 Subject: [erlang-questions] make from otp src error with `in6addr_any` `in6addr_loopback` In-Reply-To: References: Message-ID: On Wed, Sep 19, 2012 at 4:31 PM, Tomas Abrahamsson wrote: > You say you are building from source, if this > means you're building from a git repo, then > one (crude) way to ensure you're building from > scratch, is to run git ls-files -o -z | xargs -0 /bin/rm -rf > which will remove _all_ files not known to git. Or git clean -dxfq, which is easier to remember and type. -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From andrew@REDACTED Wed Sep 19 21:39:15 2012 From: andrew@REDACTED (Andrew Thompson) Date: Wed, 19 Sep 2012 15:39:15 -0400 Subject: [erlang-questions] io_lib format inconsistancies In-Reply-To: <20120919133842.GA32057@erix.ericsson.se> References: <20120907190329.GU5837@hijacked.us> <20120919133842.GA32057@erix.ericsson.se> Message-ID: <20120919193915.GC8089@hijacked.us> On Wed, Sep 19, 2012 at 03:38:42PM +0200, Raimo Niskanen wrote: > These are the obvious flaws I see: > > * Something like ~P for printable binaries is needed for strings, > but the value 4 characters for depth 1 seems low. An atom has max length > 256 bytes (I think) giving depth 1. ~P for printable binaries should behave > like for strings. So what should the behaviour be? Print printable binaries completely, or up the depth from 4 to something larger and apply it to strings as well? If so, what should the limit be? > > * The discrepancy for ~P vs. ~W on <<>> should be fixed. Agreed, I'll make a patch. Thanks again for confirming my suspicions that these weren't really thought out behaviours. Andrew From rapsey@REDACTED Wed Sep 19 22:11:51 2012 From: rapsey@REDACTED (Rapsey) Date: Wed, 19 Sep 2012 22:11:51 +0200 Subject: [erlang-questions] is anyone else experiencing reliability issues with R15? Message-ID: We run a network of custom built streaming servers doing video streaming and transcoding of IPTV channels. On R14 everything runs great. But switching to R15, gen_servers inexplicably block and don't respond to messages, even the console blocks and does not respond to input for 30s or so, processes baloon taking up large amounts of memory for no reason. All at random times, but gets much worse once there are more users connected to the server doing a lot of req/s or receiving a lot of data. We're running ubuntu server and start erlang with these switches: erl +Bd +S 4 +P 1000000 -env ERL_MAX_PORTS 100000 +K true +A 32 Are we alone having problems with R15? We tried R15B01 and R15B02. Sergej -------------- next part -------------- An HTML attachment was scrubbed... URL: From zabrane3@REDACTED Wed Sep 19 22:18:39 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Wed, 19 Sep 2012 22:18:39 +0200 Subject: [erlang-questions] is anyone else experiencing reliability issues with R15? In-Reply-To: References: Message-ID: <4E2BEB89-6522-4E0E-B1E2-695857A40057@gmail.com> Hi Rapsey, I can confirm lower performances using R15B01/R15B02 compared to R14, but no reliability issue. Regards, Zabrane On Sep 19, 2012, at 10:11 PM, Rapsey wrote: > We run a network of custom built streaming servers doing video streaming and transcoding of IPTV channels. > On R14 everything runs great. But switching to R15, gen_servers inexplicably block and don't respond to messages, even the console blocks and does not respond to input for 30s or so, processes baloon taking up large amounts of memory for no reason. All at random times, but gets much worse once there are more users connected to the server doing a lot of req/s or receiving a lot of data. > We're running ubuntu server and start erlang with these switches: > erl +Bd +S 4 +P 1000000 -env ERL_MAX_PORTS 100000 +K true +A 32 > > Are we alone having problems with R15? We tried R15B01 and R15B02. > > > > Sergej > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From nem@REDACTED Thu Sep 20 00:40:23 2012 From: nem@REDACTED (Geoff Cant) Date: Wed, 19 Sep 2012 15:40:23 -0700 Subject: [erlang-questions] is anyone else experiencing reliability issues with R15? In-Reply-To: References: Message-ID: Gah, I'm just in the middle of upgrading production from R14B3 to R15B02. Do you have process_info(Pid, backtrace) or similar info for these blocked processes? One of the changes from R14 to R15 that I hazily recall was the 'don't scan the message queue if you're waiting on a reply with a ref that was just generated' thing that avoids examining long message queues. > ? receive statements that can only read out a newly created reference are now specially optimized so that it will execute in constant time regardless of the number of messages in the receive queue for the process. That optimization will benefit calls togen_server:call(). (See gen:do_call/4 for an example of a receive statement that will be optimized.) > > Own Id: OTP-8623 > -Geoff On 2012-09-19, at 13:11 , Rapsey wrote: > We run a network of custom built streaming servers doing video streaming > and transcoding of IPTV channels. > On R14 everything runs great. But switching to R15, gen_servers > inexplicably block and don't respond to messages, even the console blocks > and does not respond to input for 30s or so, processes baloon taking up > large amounts of memory for no reason. All at random times, but gets much > worse once there are more users connected to the server doing a lot of > req/s or receiving a lot of data. > We're running ubuntu server and start erlang with these switches: > erl +Bd +S 4 +P 1000000 -env ERL_MAX_PORTS 100000 +K true +A 32 > > Are we alone having problems with R15? We tried R15B01 and R15B02. > From mononcqc@REDACTED Thu Sep 20 03:02:04 2012 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 19 Sep 2012 21:02:04 -0400 Subject: [erlang-questions] is anyone else experiencing reliability issues with R15? In-Reply-To: References: Message-ID: <505A6B0C.1040903@ferd.ca> We've had problems in R15B01 with particular statistics functions related to schedulers, as described in http://erlang.org/pipermail/erlang-bugs/2012-July/002964.html To date there is no solution and we just stopped using these functions, going back to run queues. We also have seen a non-negligible increase in CPU usage from R14B* versions, easily around 20% or so during regular workload, although it didn't seem to affect heavy overload situations too negatively for us (no precise measurements were made for this, just casual observations). It remained high no matter what arguments we gave to the VM. We have noticed nodes getting locked-up in R15B01 from time to time when memory on the server is getting rare, taken by other applications -- it seemed we had a lot of contention on proc_tab mutexes, but nothing came out of it. We eventually reduced memory usage in other applications and things have been rather stable since then. Other than that, everything appeared normal, and none of the blocking incidents could be directly attributed to issues you appear to have. We haven't seen memory ballooning except in occasional error logger cases, but most of our processes are extremely short-lived (well under <150ms). On 12-09-19 4:11 PM, Rapsey wrote: > We run a network of custom built streaming servers doing video > streaming and transcoding of IPTV channels. > On R14 everything runs great. But switching to R15, gen_servers > inexplicably block and don't respond to messages, even the console > blocks and does not respond to input for 30s or so, processes baloon > taking up large amounts of memory for no reason. All at random times, > but gets much worse once there are more users connected to the server > doing a lot of req/s or receiving a lot of data. > We're running ubuntu server and start erlang with these switches: > erl +Bd +S 4 +P 1000000 -env ERL_MAX_PORTS 100000 +K true +A 32 > > Are we alone having problems with R15? We tried R15B01 and R15B02. > > > > Sergej > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexhuang1984@REDACTED Thu Sep 20 04:07:16 2012 From: alexhuang1984@REDACTED (alexhuang) Date: Wed, 19 Sep 2012 19:07:16 -0700 (PDT) Subject: [erlang-questions] make from otp src error with `in6addr_any` `in6addr_loopback` In-Reply-To: References: Message-ID: <92b052e2-77bf-4e8e-8c6b-5f87db2d8dc0@googlegroups.com> Thanks, Tomas and Bj?rn. Build completely from scratch really solving my problem. On Wednesday, September 19, 2012 11:13:21 PM UTC+8, Bj?rn Gustavsson wrote: > > On Wed, Sep 19, 2012 at 4:31 PM, Tomas Abrahamsson > > wrote: > > > You say you are building from source, if this > > means you're building from a git repo, then > > one (crude) way to ensure you're building from > > scratch, is to run git ls-files -o -z | xargs -0 /bin/rm -rf > > which will remove _all_ files not known to git. > > Or git clean -dxfq, which is easier to remember > and type. > > -- > Bj?rn Gustavsson, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-q...@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ali.sabil@REDACTED Thu Sep 20 08:43:31 2012 From: ali.sabil@REDACTED (Ali Sabil) Date: Thu, 20 Sep 2012 08:43:31 +0200 Subject: [erlang-questions] is anyone else experiencing reliability issues with R15? In-Reply-To: <505A6B0C.1040903@ferd.ca> References: <505A6B0C.1040903@ferd.ca> Message-ID: We have experienced similar issues with R15B01 where the I/O will get completely blocked, but we haven't really been able to track it down, the suspect we had was the usage of sendfile. On Thu, Sep 20, 2012 at 3:02 AM, Fred Hebert wrote: > We've had problems in R15B01 with particular statistics functions related to > schedulers, as described in > http://erlang.org/pipermail/erlang-bugs/2012-July/002964.html > > To date there is no solution and we just stopped using these functions, > going back to run queues. > > We also have seen a non-negligible increase in CPU usage from R14B* > versions, easily around 20% or so during regular workload, although it > didn't seem to affect heavy overload situations too negatively for us (no > precise measurements were made for this, just casual observations). It > remained high no matter what arguments we gave to the VM. > > We have noticed nodes getting locked-up in R15B01 from time to time when > memory on the server is getting rare, taken by other applications -- it > seemed we had a lot of contention on proc_tab mutexes, but nothing came out > of it. We eventually reduced memory usage in other applications and things > have been rather stable since then. > > Other than that, everything appeared normal, and none of the blocking > incidents could be directly attributed to issues you appear to have. We > haven't seen memory ballooning except in occasional error logger cases, but > most of our processes are extremely short-lived (well under <150ms). > > On 12-09-19 4:11 PM, Rapsey wrote: > > We run a network of custom built streaming servers doing video streaming and > transcoding of IPTV channels. > On R14 everything runs great. But switching to R15, gen_servers inexplicably > block and don't respond to messages, even the console blocks and does not > respond to input for 30s or so, processes baloon taking up large amounts of > memory for no reason. All at random times, but gets much worse once there > are more users connected to the server doing a lot of req/s or receiving a > lot of data. > We're running ubuntu server and start erlang with these switches: > erl +Bd +S 4 +P 1000000 -env ERL_MAX_PORTS 100000 +K true +A 32 > > Are we alone having problems with R15? We tried R15B01 and R15B02. > > > > Sergej > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From raimo+erlang-questions@REDACTED Thu Sep 20 09:18:04 2012 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 20 Sep 2012 09:18:04 +0200 Subject: [erlang-questions] io_lib format inconsistancies In-Reply-To: <20120919193915.GC8089@hijacked.us> References: <20120907190329.GU5837@hijacked.us> <20120919133842.GA32057@erix.ericsson.se> <20120919193915.GC8089@hijacked.us> Message-ID: <20120920071804.GA21134@erix.ericsson.se> On Wed, Sep 19, 2012 at 03:39:15PM -0400, Andrew Thompson wrote: > On Wed, Sep 19, 2012 at 03:38:42PM +0200, Raimo Niskanen wrote: > > These are the obvious flaws I see: > > > > * Something like ~P for printable binaries is needed for strings, > > but the value 4 characters for depth 1 seems low. An atom has max length > > 256 bytes (I think) giving depth 1. ~P for printable binaries should behave > > like for strings. > > So what should the behaviour be? Print printable binaries completely, or > up the depth from 4 to something larger and apply it to strings as well? > If so, what should the limit be? I'd say that since this is about printability it should also be about readability. An atom of some 10 chars is readable. Perhaps it is what fits in a line that is interesting. There is code in io_lib_pretty that does not like to print on a line when indentation exceeds half the line length, and default line length is 80. So a value below 40 seems reasonable. For a non-printable list or binary every depth prints an integer that occupies max 7 chars for the maximum unicode value. Somewhere between 7 and 40, then. The values 8, 16, 20 and 32 springs to mind. How about 16? That is: every 16 chars in a printable string or printable binary should count as a depth increase of 1 instead of today 4 chars for printable binary and unlimited for printable string. The value should just limit what conveniently fits as an item when printing a complex term, so 20 or 32 might be better values... Another option is to fill the current line. I do not know if that is doable in io_lib_pretty, or if the code requires a fixed size for all items to decide on line breaks... > > > > * The discrepancy for ~P vs. ~W on <<>> should be fixed. > > Agreed, I'll make a patch. > > Thanks again for confirming my suspicions that these weren't really > thought out behaviours. > > Andrew > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From lukas@REDACTED Thu Sep 20 12:34:06 2012 From: lukas@REDACTED (Lukas Larsson) Date: Thu, 20 Sep 2012 12:34:06 +0200 Subject: [erlang-questions] is anyone else experiencing reliability issues with R15? In-Reply-To: References: <505A6B0C.1040903@ferd.ca> Message-ID: Hello, If you ever suspect that the Erlang VM is blocking for some reason, first make sure that it is not something in Erlang space which is wrong. i.e. a process waiting for a message which never arrives or something like that. When you are sure it is the VM that is the problem the most informative thing to do (IMO) is to either attach with gdb to that process or dump a core using kill -ABRT. Once you have gdb attached do info threads or a core, do: (gdb) info threads and then for each thread do: (gdb) thread ${ThreadId} (gdb) bt This will give you a bunch of information about what the emulator is doing. There are also a couple of tools which can help you debug specific things within the emulator. For instance if you do (gdb) source $ERL_TOP/erts/etc/unix/etp-commands (gdb) etp-help you get a list of helpfull command which can print all sorts of interesting data. One example is etp-stacktrace, which given a Process * will print the stacktrace of that process. eg: (gdb) bt #0 0x00007ffff6aa19a8 in __GI___poll (fds=0x7ffff67bac08, nfds=2, timeout=) at ../sysdeps/unix/sysv/linux/poll.c:83 #1 0x000000000062c9b0 in check_fd_events (tv=0x7fffffffbf00, ps=0x7ffff67ba100, max_res=) at sys/common/erl_poll.c:1974 #2 erts_poll_wait_nkp (ps=0x7ffff67ba100, pr=0x7fffffffb700, len=0x7fffffffbf10, utvp=) at sys/common/erl_poll.c:2087 #3 0x000000000062f528 in erts_check_io_nkp (do_wait=) at sys/common/erl_check_io.c:1173 #4 0x00000000006259de in erl_sys_schedule (runnable=) at sys/unix/sys.c:2734 #5 0x0000000000551de5 in scheduler_wait (rq=0x7ffff687b080, esdp=0x7ffff687b2c0, fcalls=) at beam/erl_process.c:2195 #6 schedule (p=, calls=) at beam/erl_process.c:6377 #7 0x00000000005c8867 in process_main () at beam/beam_emu.c:1229 #8 0x000000000051334c in erl_start (argc=10, argv=) at beam/erl_init.c:1493 #9 0x00000000004f55f9 in main (argc=, argv=) at sys/unix/erl_main.c:29 (gdb) f 7 #7 0x00000000005c8867 in process_main () at beam/beam_emu.c:1229 (gdb) etp-stacktrace c_p % Stacktrace (22): . #Cp. #Cp. #Cp. #Cp. (gdb) p c_p $1 = (Process *) 0x7ffff7e87348 (gdb) If the VM seems to block for a while and then continues to run it could be because all schedulers are hitting the same lock at the same time. Use an emulator with --enable-lock-counter[1] to figure out which lock it is that is causing the issue. Also gprof and oprofile can be very useful when used correctly, though their output is at times quite hard to interpret. If when investigating you find something that seems fishy, try to limit the scope of the potential bug as much as you can. The more specific you are in the description of the (miss)behaviour you are experiencing, the more likely it will be that we can help you. Lukas [1]: http://www.erlang.org/doc/apps/tools/lcnt_chapter.html On Thu, Sep 20, 2012 at 8:43 AM, Ali Sabil wrote: > We have experienced similar issues with R15B01 where the I/O will get > completely blocked, but we haven't really been able to track it down, > the suspect we had was the usage of sendfile. > > On Thu, Sep 20, 2012 at 3:02 AM, Fred Hebert wrote: >> We've had problems in R15B01 with particular statistics functions related to >> schedulers, as described in >> http://erlang.org/pipermail/erlang-bugs/2012-July/002964.html >> >> To date there is no solution and we just stopped using these functions, >> going back to run queues. >> >> We also have seen a non-negligible increase in CPU usage from R14B* >> versions, easily around 20% or so during regular workload, although it >> didn't seem to affect heavy overload situations too negatively for us (no >> precise measurements were made for this, just casual observations). It >> remained high no matter what arguments we gave to the VM. >> >> We have noticed nodes getting locked-up in R15B01 from time to time when >> memory on the server is getting rare, taken by other applications -- it >> seemed we had a lot of contention on proc_tab mutexes, but nothing came out >> of it. We eventually reduced memory usage in other applications and things >> have been rather stable since then. >> >> Other than that, everything appeared normal, and none of the blocking >> incidents could be directly attributed to issues you appear to have. We >> haven't seen memory ballooning except in occasional error logger cases, but >> most of our processes are extremely short-lived (well under <150ms). >> >> On 12-09-19 4:11 PM, Rapsey wrote: >> >> We run a network of custom built streaming servers doing video streaming and >> transcoding of IPTV channels. >> On R14 everything runs great. But switching to R15, gen_servers inexplicably >> block and don't respond to messages, even the console blocks and does not >> respond to input for 30s or so, processes baloon taking up large amounts of >> memory for no reason. All at random times, but gets much worse once there >> are more users connected to the server doing a lot of req/s or receiving a >> lot of data. >> We're running ubuntu server and start erlang with these switches: >> erl +Bd +S 4 +P 1000000 -env ERL_MAX_PORTS 100000 +K true +A 32 >> >> Are we alone having problems with R15? We tried R15B01 and R15B02. >> >> >> >> Sergej >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From max.lapshin@REDACTED Thu Sep 20 13:08:55 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 20 Sep 2012 15:08:55 +0400 Subject: [erlang-questions] driver_select by tcp_inet driver failed Message-ID: driver_select(0x0000000000000220, 22, ERL_DRV_READ ERL_DRV_USE, 1) by tcp_inet driver #Port<0.20000> failed: fd=22 (re)selected before stop_select was called for driver efile I suppose, that it is somehow related to using sendfile with cowboy_http_static, but not sure yet. Has someone met with the same problem? From zabrane3@REDACTED Thu Sep 20 13:39:13 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Thu, 20 Sep 2012 13:39:13 +0200 Subject: [erlang-questions] driver_select by tcp_inet driver failed In-Reply-To: References: Message-ID: Hi Max, I faced a similar problem long time ago while using the 1st implementation of "sendfile" in Yaws: http://osdir.com/ml/erlang-questions-programming/2011-04/msg00380.html But the error was bit different: =ERROR REPORT==== 17-Apr-2011::20:49:18 === driver_select(0x0000000000000c31, 24, ERL_DRV_WRITE, 1) by sendfile_drv driver #Port<0.3121> stealing control of fd=24 from output driver tcp_inet #Port<0.10029> Regards, Zabrane On Sep 20, 2012, at 1:08 PM, Max Lapshin wrote: > driver_select(0x0000000000000220, 22, ERL_DRV_READ ERL_DRV_USE, 1) by > tcp_inet driver #Port<0.20000> failed: fd=22 (re)selected before > stop_select was called for driver efile > > I suppose, that it is somehow related to using sendfile with > cowboy_http_static, but not sure yet. > > Has someone met with the same problem? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From garazdawi@REDACTED Thu Sep 20 14:13:27 2012 From: garazdawi@REDACTED (Lukas Larsson) Date: Thu, 20 Sep 2012 14:13:27 +0200 Subject: [erlang-questions] driver_select by tcp_inet driver failed In-Reply-To: References: Message-ID: Hi, What OS and version of Erlang/OTP are you using? Lukas On Thu, Sep 20, 2012 at 1:08 PM, Max Lapshin wrote: > driver_select(0x0000000000000220, 22, ERL_DRV_READ ERL_DRV_USE, 1) by > tcp_inet driver #Port<0.20000> failed: fd=22 (re)selected before > stop_select was called for driver efile > > I suppose, that it is somehow related to using sendfile with > cowboy_http_static, but not sure yet. > > Has someone met with the same problem? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From max.lapshin@REDACTED Thu Sep 20 14:20:18 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 20 Sep 2012 16:20:18 +0400 Subject: [erlang-questions] driver_select by tcp_inet driver failed In-Reply-To: References: Message-ID: OS X, Erlang R15B On Thu, Sep 20, 2012 at 4:13 PM, Lukas Larsson wrote: > Hi, > > What OS and version of Erlang/OTP are you using? > > Lukas > > On Thu, Sep 20, 2012 at 1:08 PM, Max Lapshin wrote: >> driver_select(0x0000000000000220, 22, ERL_DRV_READ ERL_DRV_USE, 1) by >> tcp_inet driver #Port<0.20000> failed: fd=22 (re)selected before >> stop_select was called for driver efile >> >> I suppose, that it is somehow related to using sendfile with >> cowboy_http_static, but not sure yet. >> >> Has someone met with the same problem? >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From lukas@REDACTED Thu Sep 20 14:26:43 2012 From: lukas@REDACTED (Lukas Larsson) Date: Thu, 20 Sep 2012 14:26:43 +0200 Subject: [erlang-questions] driver_select by tcp_inet driver failed In-Reply-To: References: Message-ID: There have been a bunch of fixes for sendfile and OS X since R15, some of them could have caused the behaviour you are seeing. Could you verify that the issue is still present in the latest release? Lukas On Thu, Sep 20, 2012 at 2:20 PM, Max Lapshin wrote: > OS X, Erlang R15B > > > On Thu, Sep 20, 2012 at 4:13 PM, Lukas Larsson wrote: >> Hi, >> >> What OS and version of Erlang/OTP are you using? >> >> Lukas >> >> On Thu, Sep 20, 2012 at 1:08 PM, Max Lapshin wrote: >>> driver_select(0x0000000000000220, 22, ERL_DRV_READ ERL_DRV_USE, 1) by >>> tcp_inet driver #Port<0.20000> failed: fd=22 (re)selected before >>> stop_select was called for driver efile >>> >>> I suppose, that it is somehow related to using sendfile with >>> cowboy_http_static, but not sure yet. >>> >>> Has someone met with the same problem? >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions From max.lapshin@REDACTED Thu Sep 20 14:39:57 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 20 Sep 2012 16:39:57 +0400 Subject: [erlang-questions] driver_select by tcp_inet driver failed In-Reply-To: References: Message-ID: I'll update to R15B02 and check if it repeats. On Thu, Sep 20, 2012 at 4:26 PM, Lukas Larsson wrote: > There have been a bunch of fixes for sendfile and OS X since R15, some > of them could have caused the behaviour you are seeing. Could you > verify that the issue is still present in the latest release? > > Lukas > > On Thu, Sep 20, 2012 at 2:20 PM, Max Lapshin wrote: >> OS X, Erlang R15B >> >> >> On Thu, Sep 20, 2012 at 4:13 PM, Lukas Larsson wrote: >>> Hi, >>> >>> What OS and version of Erlang/OTP are you using? >>> >>> Lukas >>> >>> On Thu, Sep 20, 2012 at 1:08 PM, Max Lapshin wrote: >>>> driver_select(0x0000000000000220, 22, ERL_DRV_READ ERL_DRV_USE, 1) by >>>> tcp_inet driver #Port<0.20000> failed: fd=22 (re)selected before >>>> stop_select was called for driver efile >>>> >>>> I suppose, that it is somehow related to using sendfile with >>>> cowboy_http_static, but not sure yet. >>>> >>>> Has someone met with the same problem? >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions From matthias@REDACTED Thu Sep 20 15:12:49 2012 From: matthias@REDACTED (Matthias Lang) Date: Thu, 20 Sep 2012 15:12:49 +0200 Subject: [erlang-questions] Is inet_parse.erl deprecated? Message-ID: <20120920131249.GA7814@corelatus.se> I find these functions quite useful: inet_parse:address/1 inet_parse:ipv4_addr/1 inet_parse:ipv6_addr/1 inet_parse:ntoa/1 but inet_parse isn't documented at all. Is that an oversight, or are those functions available through something else? I'm not the only one using them; they're called the 'diameter', 'ssh' and 'public_key' applications as well as by a number of things in the kernel. Matt From jean.parpaillon@REDACTED Thu Sep 20 15:52:13 2012 From: jean.parpaillon@REDACTED (Jean Parpaillon) Date: Thu, 20 Sep 2012 15:52:13 +0200 Subject: [erlang-questions] Erlang application packaging Message-ID: <1348149133.7702.20.camel@malo.local> Hi all, I'm Jean Parpaillon, new erlang enthusiast and (soon) programmer. On 7 past years, I've workedon distributed systems, specially in HPC and cloud computing. I'm trying to develop an XMPP agent for system management, written in Erlang. This is the introduction, now the question :) What is your preferred packaging/deployment system for erlang ? I have a code running, from erlang shell, and want it to become a real world application the user can install from an archive and launch from its shell, eventually with some parameters. I've read about systools, and how to generated .app, .appup, .rel, .boot and so on. This looks fine but a lot to do by hand. When it comes to update a file, and release the whole stuff, one have to modify plenty of others. Or am I wrong ? I've looked to existing applications or 'helloworld's: some of them using autotools (ejabberd, ...), a lot of others using rebar, sometime a little a bit of both, iirc. rebar has a lot of magic, which makes debugging hard. autotools is not well designed for erlang, but putting some existing m4 files here and there seems to fit. At least, I know autotools well. I know how can I generate .app, .rel and so on with autotools, but I don't know what to put in it :/ At the end, for launching the application, I've seen many projects not using .boot files, but a shell script with tons of arguments to erl... I'm a little bit confused :( Any help ? Best regards, -- Jean Parpaillon Open Source Consultant Phone: +33 6 30 10 92 86 im: jean.parpaillon@REDACTED skype: jean.parpaillon linkedin: http://www.linkedin.com/in/jeanparpaillon/en -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From andre@REDACTED Thu Sep 20 16:06:42 2012 From: andre@REDACTED (=?ISO-8859-1?Q?Andr=E9_Graf?=) Date: Thu, 20 Sep 2012 16:06:42 +0200 Subject: [erlang-questions] Erlang application packaging In-Reply-To: <1348149133.7702.20.camel@malo.local> References: <1348149133.7702.20.camel@malo.local> Message-ID: Hi Jean I don't think that what rebar is doing is some sort of magic ;) they just do it very well! Analysing how Basho's Riak (https://github.com/basho/riak) can be built and packaged helped me a lot to understand the 'magic'. Cheers Andr? On 20 September 2012 15:52, Jean Parpaillon wrote: > Hi all, > I'm Jean Parpaillon, new erlang enthusiast and (soon) programmer. On 7 > past years, I've workedon distributed systems, specially in HPC and > cloud computing. I'm trying to develop an XMPP agent for system > management, written in Erlang. This is the introduction, now the > question :) > What is your preferred packaging/deployment system for erlang ? I have a > code running, from erlang shell, and want it to become a real world > application the user can install from an archive and launch from its > shell, eventually with some parameters. > > I've read about systools, and how to generated .app, .appup, .rel, .boot > and so on. This looks fine but a lot to do by hand. When it comes to > update a file, and release the whole stuff, one have to modify plenty of > others. Or am I wrong ? > I've looked to existing applications or 'helloworld's: some of them > using autotools (ejabberd, ...), a lot of others using rebar, sometime a > little a bit of both, iirc. > rebar has a lot of magic, which makes debugging hard. > autotools is not well designed for erlang, but putting some existing m4 > files here and there seems to fit. At least, I know autotools well. I > know how can I generate .app, .rel and so on with autotools, but I don't > know what to put in it :/ > At the end, for launching the application, I've seen many projects not > using .boot files, but a shell script with tons of arguments to erl... > > I'm a little bit confused :( Any help ? > > Best regards, > -- > Jean Parpaillon > Open Source Consultant > Phone: +33 6 30 10 92 86 > im: jean.parpaillon@REDACTED > skype: jean.parpaillon > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From ali.sabil@REDACTED Thu Sep 20 16:11:32 2012 From: ali.sabil@REDACTED (Ali Sabil) Date: Thu, 20 Sep 2012 16:11:32 +0200 Subject: [erlang-questions] Erlang application packaging In-Reply-To: <1348149133.7702.20.camel@malo.local> References: <1348149133.7702.20.camel@malo.local> Message-ID: Hi Jean, I don't know if you have come across this: http://learnyousomeerlang.com/release-is-the-word#am-i-an-executable-yet but it might be helpful? Best, Ali On Thu, Sep 20, 2012 at 3:52 PM, Jean Parpaillon wrote: > Hi all, > I'm Jean Parpaillon, new erlang enthusiast and (soon) programmer. On 7 > past years, I've workedon distributed systems, specially in HPC and > cloud computing. I'm trying to develop an XMPP agent for system > management, written in Erlang. This is the introduction, now the > question :) > What is your preferred packaging/deployment system for erlang ? I have a > code running, from erlang shell, and want it to become a real world > application the user can install from an archive and launch from its > shell, eventually with some parameters. > > I've read about systools, and how to generated .app, .appup, .rel, .boot > and so on. This looks fine but a lot to do by hand. When it comes to > update a file, and release the whole stuff, one have to modify plenty of > others. Or am I wrong ? > I've looked to existing applications or 'helloworld's: some of them > using autotools (ejabberd, ...), a lot of others using rebar, sometime a > little a bit of both, iirc. > rebar has a lot of magic, which makes debugging hard. > autotools is not well designed for erlang, but putting some existing m4 > files here and there seems to fit. At least, I know autotools well. I > know how can I generate .app, .rel and so on with autotools, but I don't > know what to put in it :/ > At the end, for launching the application, I've seen many projects not > using .boot files, but a shell script with tons of arguments to erl... > > I'm a little bit confused :( Any help ? > > Best regards, > -- > Jean Parpaillon > Open Source Consultant > Phone: +33 6 30 10 92 86 > im: jean.parpaillon@REDACTED > skype: jean.parpaillon > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From jean.parpaillon@REDACTED Thu Sep 20 16:33:15 2012 From: jean.parpaillon@REDACTED (Jean Parpaillon) Date: Thu, 20 Sep 2012 16:33:15 +0200 Subject: [erlang-questions] Erlang application packaging In-Reply-To: References: <1348149133.7702.20.camel@malo.local> Message-ID: <1348151595.7702.23.camel@malo.local> Hi Ali Thank you for your help. I've begun erlang with this tutorial but I have to admit I am still confused about the right tool to use. Just in learnyou..., reltool and systools are presented. Let's read again this chapter :) Regards, Jean Le jeudi 20 septembre 2012 ? 16:11 +0200, Ali Sabil a ?crit : > Hi Jean, > > I don't know if you have come across this: > http://learnyousomeerlang.com/release-is-the-word#am-i-an-executable-yet > but it might be helpful? > > Best, > Ali > > On Thu, Sep 20, 2012 at 3:52 PM, Jean Parpaillon > wrote: > > Hi all, > > I'm Jean Parpaillon, new erlang enthusiast and (soon) programmer. On 7 > > past years, I've workedon distributed systems, specially in HPC and > > cloud computing. I'm trying to develop an XMPP agent for system > > management, written in Erlang. This is the introduction, now the > > question :) > > What is your preferred packaging/deployment system for erlang ? I have a > > code running, from erlang shell, and want it to become a real world > > application the user can install from an archive and launch from its > > shell, eventually with some parameters. > > > > I've read about systools, and how to generated .app, .appup, .rel, .boot > > and so on. This looks fine but a lot to do by hand. When it comes to > > update a file, and release the whole stuff, one have to modify plenty of > > others. Or am I wrong ? > > I've looked to existing applications or 'helloworld's: some of them > > using autotools (ejabberd, ...), a lot of others using rebar, sometime a > > little a bit of both, iirc. > > rebar has a lot of magic, which makes debugging hard. > > autotools is not well designed for erlang, but putting some existing m4 > > files here and there seems to fit. At least, I know autotools well. I > > know how can I generate .app, .rel and so on with autotools, but I don't > > know what to put in it :/ > > At the end, for launching the application, I've seen many projects not > > using .boot files, but a shell script with tons of arguments to erl... > > > > I'm a little bit confused :( Any help ? > > > > Best regards, > > -- > > Jean Parpaillon > > Open Source Consultant > > Phone: +33 6 30 10 92 86 > > im: jean.parpaillon@REDACTED > > skype: jean.parpaillon > > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -- Jean Parpaillon Open Source Consultant Phone: +33 6 30 10 92 86 im: jean.parpaillon@REDACTED skype: jean.parpaillon linkedin: http://www.linkedin.com/in/jeanparpaillon/en -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From john.vanderpol@REDACTED Thu Sep 20 17:01:37 2012 From: john.vanderpol@REDACTED (John VanderPol) Date: Thu, 20 Sep 2012 10:01:37 -0500 Subject: [erlang-questions] Slow node replication Message-ID: In an application that I manage we are currently having issues discovering all of the other erlang nodes in a cluster. We start up our application and immediately run net_adm:ping/1 to a known node in order to discover all of the other nodes. The problem we are having is that although the initial ping command is successful the other nodes are not "discovered" by the new node until upwards of 10 minutes have gone by, when I say "discovered" i mean that when nodes() is called the only node returned is the initial node that was pinged. So for example if nodes A and B are currently running, we start up node C, node C pings node B, then it will take a substantially long period of time to discover node A. Some debugging nodes: When the application is initially started up on all of our nodes this is not a problem and nodes discover each other quickly, it only happens after the application has been running for a while. All other node communication seems to be performing reasonably fast. We are monitoring our applications with https://github.com/lethain/nagios_erlang which is a erlang plugin for nagios. It simply starts up an erlang node, pings all of our nodes to ensure they are up an running, and then shuts down. These test nodes end up in the known nodes list but are mostly never in the connected node list. Some information about the environment: Erlang release: R14B03 Number of nodes: ~40 OS: CentOS -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Thu Sep 20 17:04:06 2012 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 20 Sep 2012 11:04:06 -0400 Subject: [erlang-questions] erlang hosting Message-ID: <505B3066.4000806@aleynikov.org> I am considering to deploy some online Erlang applications. Can anyone recommend inexpensive reliable hosting providers for running erlang web applications? Thanks. Serge From essen@REDACTED Thu Sep 20 17:44:13 2012 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Thu, 20 Sep 2012 17:44:13 +0200 Subject: [erlang-questions] erlang hosting In-Reply-To: <505B3066.4000806@aleynikov.org> References: <505B3066.4000806@aleynikov.org> Message-ID: <505B39CD.5020906@ninenines.eu> On 09/20/2012 05:04 PM, Serge Aleynikov wrote: > I am considering to deploy some online Erlang applications. Can anyone > recommend inexpensive reliable hosting providers for running erlang web > applications? OVH has its kimsufi offering which gives you a small dedicated for 15 euros/month. You can run most distros on it, including Arch Linux. I'm not sure which countries it covers exactly though. -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From ali.sabil@REDACTED Thu Sep 20 17:49:21 2012 From: ali.sabil@REDACTED (Ali Sabil) Date: Thu, 20 Sep 2012 17:49:21 +0200 Subject: [erlang-questions] Erlang application packaging In-Reply-To: <1348151595.7702.23.camel@malo.local> References: <1348149133.7702.20.camel@malo.local> <1348151595.7702.23.camel@malo.local> Message-ID: Ok, sorry :) Basically in Erlang, the concept of release is pretty close to the concept of Linux distributions, a release allows you to package the erlang runtime and a set of applications together into a distribution. The easiest way to generate releases is probably by using rebar. Here is a small quickstart on how to generate a release using rebar: mkdir -p product && cd product wget http://cloud.github.com/downloads/basho/rebar/rebar && chmod u+x rebar mkdir rel && cd rel ../rebar create-node nodeid=product # edit the reltool.config file to remove the non-existing product application from the release # this is done by removing the product atom right after the sasl atom and the comma separating them # as well as {app, product, [{incl_cond, include}]} and the comma before it # this is to have a running release ../rebar generate ./product/bin/product console # this will start a node based on your release The applications you want to include are generally placed in apps/ and/or deps/ at the root and you just need to edit the reltool.config file and add {lib_dirs, ["../apps", "../deps"]} inside the sys section That said you might not really need to use a release to package your application, if you have an erlang runtime available on the target machine you could either turn your application into an escript (the escriptize command in rebar) or use a shell script. Hope this helps, Ali On Thu, Sep 20, 2012 at 4:33 PM, Jean Parpaillon wrote: > Hi Ali > Thank you for your help. > I've begun erlang with this tutorial but I have to admit I am still > confused about the right tool to use. Just in learnyou..., reltool and > systools are presented. > Let's read again this chapter :) > > Regards, > Jean > > Le jeudi 20 septembre 2012 ? 16:11 +0200, Ali Sabil a ?crit : >> Hi Jean, >> >> I don't know if you have come across this: >> http://learnyousomeerlang.com/release-is-the-word#am-i-an-executable-yet >> but it might be helpful? >> >> Best, >> Ali >> >> On Thu, Sep 20, 2012 at 3:52 PM, Jean Parpaillon >> wrote: >> > Hi all, >> > I'm Jean Parpaillon, new erlang enthusiast and (soon) programmer. On 7 >> > past years, I've workedon distributed systems, specially in HPC and >> > cloud computing. I'm trying to develop an XMPP agent for system >> > management, written in Erlang. This is the introduction, now the >> > question :) >> > What is your preferred packaging/deployment system for erlang ? I have a >> > code running, from erlang shell, and want it to become a real world >> > application the user can install from an archive and launch from its >> > shell, eventually with some parameters. >> > >> > I've read about systools, and how to generated .app, .appup, .rel, .boot >> > and so on. This looks fine but a lot to do by hand. When it comes to >> > update a file, and release the whole stuff, one have to modify plenty of >> > others. Or am I wrong ? >> > I've looked to existing applications or 'helloworld's: some of them >> > using autotools (ejabberd, ...), a lot of others using rebar, sometime a >> > little a bit of both, iirc. >> > rebar has a lot of magic, which makes debugging hard. >> > autotools is not well designed for erlang, but putting some existing m4 >> > files here and there seems to fit. At least, I know autotools well. I >> > know how can I generate .app, .rel and so on with autotools, but I don't >> > know what to put in it :/ >> > At the end, for launching the application, I've seen many projects not >> > using .boot files, but a shell script with tons of arguments to erl... >> > >> > I'm a little bit confused :( Any help ? >> > >> > Best regards, >> > -- >> > Jean Parpaillon >> > Open Source Consultant >> > Phone: +33 6 30 10 92 86 >> > im: jean.parpaillon@REDACTED >> > skype: jean.parpaillon >> > linkedin: http://www.linkedin.com/in/jeanparpaillon/en >> > >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > > > -- > Jean Parpaillon > Open Source Consultant > Phone: +33 6 30 10 92 86 > im: jean.parpaillon@REDACTED > skype: jean.parpaillon > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > From ulf@REDACTED Thu Sep 20 18:03:33 2012 From: ulf@REDACTED (Ulf Wiger) Date: Thu, 20 Sep 2012 18:03:33 +0200 Subject: [erlang-questions] erlang hosting In-Reply-To: <505B3066.4000806@aleynikov.org> References: <505B3066.4000806@aleynikov.org> Message-ID: Dreamhost offers VPSes at $15/month, for 300MB RAM, unmetered disk and BW, adding $5/month for each additional 100MB RAM. 50 GB backup space included. The OS is Debian. No choice there, but at least a decent OS. http://dreamhost.com/servers/vps/ They also have an uptime guarantee, and will reimburse you if you suffer downtime because of them. BR, Ulf W On 20 Sep 2012, at 17:04, Serge Aleynikov wrote: > I am considering to deploy some online Erlang applications. Can anyone > recommend inexpensive reliable hosting providers for running erlang web > applications? > > Thanks. > > Serge > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com From jean.parpaillon@REDACTED Thu Sep 20 18:05:08 2012 From: jean.parpaillon@REDACTED (Jean Parpaillon) Date: Thu, 20 Sep 2012 18:05:08 +0200 Subject: [erlang-questions] Erlang application packaging In-Reply-To: References: <1348149133.7702.20.camel@malo.local> <1348151595.7702.23.camel@malo.local> Message-ID: <1348157108.7702.27.camel@malo.local> Hi, Le jeudi 20 septembre 2012 ? 17:49 +0200, Ali Sabil a ?crit : > Ok, sorry :) > No harm, I was suggesting myself to reread it :) > Basically in Erlang, the concept of release is pretty close to the > concept of Linux distributions, a release allows you to package the > erlang runtime and a set of applications together into a distribution. > The easiest way to generate releases is probably by using rebar. Here > is a small quickstart on how to generate a release using rebar: > > mkdir -p product && cd product > wget http://cloud.github.com/downloads/basho/rebar/rebar && chmod u+x rebar > mkdir rel && cd rel > ../rebar create-node nodeid=product > # edit the reltool.config file to remove the non-existing product > application from the release > # this is done by removing the product atom right after the sasl > atom and the comma separating them > # as well as {app, product, [{incl_cond, include}]} and the comma before it > # this is to have a running release > ../rebar generate > ./product/bin/product console # this will start a node based on your release > > The applications you want to include are generally placed in apps/ > and/or deps/ at the root and you just need to edit the reltool.config > file and add > {lib_dirs, ["../apps", "../deps"]} > inside the sys section > > That said you might not really need to use a release to package your > application, if you have an erlang runtime available on the target > machine you could either turn your application into an escript (the > escriptize command in rebar) or use a shell script. > Ok, I think I got the different parts of the release process. Now, if I follow a rebar tutorial and try to launch the code: - If I do: $ erl -pa ebin then > application:start(myapp). My application is fine and running - If I do: $ erl -pa ebin -s myapp I got the following error: {"init terminating in do_boot",{undef,[{kernel,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} Any hints ? Thank you again for your time ! Jean > Hope this helps, > Ali > > > On Thu, Sep 20, 2012 at 4:33 PM, Jean Parpaillon > wrote: > > Hi Ali > > Thank you for your help. > > I've begun erlang with this tutorial but I have to admit I am still > > confused about the right tool to use. Just in learnyou..., reltool and > > systools are presented. > > Let's read again this chapter :) > > > > Regards, > > Jean > > > > Le jeudi 20 septembre 2012 ? 16:11 +0200, Ali Sabil a ?crit : > >> Hi Jean, > >> > >> I don't know if you have come across this: > >> http://learnyousomeerlang.com/release-is-the-word#am-i-an-executable-yet > >> but it might be helpful? > >> > >> Best, > >> Ali > >> > >> On Thu, Sep 20, 2012 at 3:52 PM, Jean Parpaillon > >> wrote: > >> > Hi all, > >> > I'm Jean Parpaillon, new erlang enthusiast and (soon) programmer. On 7 > >> > past years, I've workedon distributed systems, specially in HPC and > >> > cloud computing. I'm trying to develop an XMPP agent for system > >> > management, written in Erlang. This is the introduction, now the > >> > question :) > >> > What is your preferred packaging/deployment system for erlang ? I have a > >> > code running, from erlang shell, and want it to become a real world > >> > application the user can install from an archive and launch from its > >> > shell, eventually with some parameters. > >> > > >> > I've read about systools, and how to generated .app, .appup, .rel, .boot > >> > and so on. This looks fine but a lot to do by hand. When it comes to > >> > update a file, and release the whole stuff, one have to modify plenty of > >> > others. Or am I wrong ? > >> > I've looked to existing applications or 'helloworld's: some of them > >> > using autotools (ejabberd, ...), a lot of others using rebar, sometime a > >> > little a bit of both, iirc. > >> > rebar has a lot of magic, which makes debugging hard. > >> > autotools is not well designed for erlang, but putting some existing m4 > >> > files here and there seems to fit. At least, I know autotools well. I > >> > know how can I generate .app, .rel and so on with autotools, but I don't > >> > know what to put in it :/ > >> > At the end, for launching the application, I've seen many projects not > >> > using .boot files, but a shell script with tons of arguments to erl... > >> > > >> > I'm a little bit confused :( Any help ? > >> > > >> > Best regards, > >> > -- > >> > Jean Parpaillon > >> > Open Source Consultant > >> > Phone: +33 6 30 10 92 86 > >> > im: jean.parpaillon@REDACTED > >> > skype: jean.parpaillon > >> > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > >> > > >> > > >> > _______________________________________________ > >> > erlang-questions mailing list > >> > erlang-questions@REDACTED > >> > http://erlang.org/mailman/listinfo/erlang-questions > >> > > > > > -- > > Jean Parpaillon > > Open Source Consultant > > Phone: +33 6 30 10 92 86 > > im: jean.parpaillon@REDACTED > > skype: jean.parpaillon > > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > > -- Jean Parpaillon Open Source Consultant Phone: +33 6 30 10 92 86 im: jean.parpaillon@REDACTED skype: jean.parpaillon linkedin: http://www.linkedin.com/in/jeanparpaillon/en -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From acautin@REDACTED Thu Sep 20 18:22:03 2012 From: acautin@REDACTED (Agustin Cautin) Date: Thu, 20 Sep 2012 18:22:03 +0200 Subject: [erlang-questions] Erlang application packaging In-Reply-To: <1348157108.7702.27.camel@malo.local> References: <1348149133.7702.20.camel@malo.local> <1348151595.7702.23.camel@malo.local> <1348157108.7702.27.camel@malo.local> Message-ID: Hello, This is because the -s parameter calls the function "start" on the module given as a parameter, so in this case it would be called as myapp:start(), probably myapp.erl doesn't exist. The function name can be specified as a parameter so you can call the one is initializing your app. Take a look at the erl documentation on the -s parameter. Or you can just define the function start to call application:start(myapp). Regards. Agustin On Thu, Sep 20, 2012 at 6:05 PM, Jean Parpaillon wrote: > Hi, > > Le jeudi 20 septembre 2012 ? 17:49 +0200, Ali Sabil a ?crit : >> Ok, sorry :) >> > No harm, I was suggesting myself to reread it :) > >> Basically in Erlang, the concept of release is pretty close to the >> concept of Linux distributions, a release allows you to package the >> erlang runtime and a set of applications together into a distribution. >> The easiest way to generate releases is probably by using rebar. Here >> is a small quickstart on how to generate a release using rebar: >> >> mkdir -p product && cd product >> wget http://cloud.github.com/downloads/basho/rebar/rebar && chmod u+x rebar >> mkdir rel && cd rel >> ../rebar create-node nodeid=product >> # edit the reltool.config file to remove the non-existing product >> application from the release >> # this is done by removing the product atom right after the sasl >> atom and the comma separating them >> # as well as {app, product, [{incl_cond, include}]} and the comma before it >> # this is to have a running release >> ../rebar generate >> ./product/bin/product console # this will start a node based on your release >> >> The applications you want to include are generally placed in apps/ >> and/or deps/ at the root and you just need to edit the reltool.config >> file and add >> {lib_dirs, ["../apps", "../deps"]} >> inside the sys section >> >> That said you might not really need to use a release to package your >> application, if you have an erlang runtime available on the target >> machine you could either turn your application into an escript (the >> escriptize command in rebar) or use a shell script. >> > > Ok, I think I got the different parts of the release process. Now, if I > follow a rebar tutorial and try to launch the code: > - If I do: > $ erl -pa ebin > then >> application:start(myapp). > > My application is fine and running > > - If I do: > $ erl -pa ebin -s myapp > I got the following error: > {"init terminating in > do_boot",{undef,[{kernel,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} > > > Any hints ? > > Thank you again for your time ! > > Jean > >> Hope this helps, >> Ali >> >> >> On Thu, Sep 20, 2012 at 4:33 PM, Jean Parpaillon >> wrote: >> > Hi Ali >> > Thank you for your help. >> > I've begun erlang with this tutorial but I have to admit I am still >> > confused about the right tool to use. Just in learnyou..., reltool and >> > systools are presented. >> > Let's read again this chapter :) >> > >> > Regards, >> > Jean >> > >> > Le jeudi 20 septembre 2012 ? 16:11 +0200, Ali Sabil a ?crit : >> >> Hi Jean, >> >> >> >> I don't know if you have come across this: >> >> http://learnyousomeerlang.com/release-is-the-word#am-i-an-executable-yet >> >> but it might be helpful? >> >> >> >> Best, >> >> Ali >> >> >> >> On Thu, Sep 20, 2012 at 3:52 PM, Jean Parpaillon >> >> wrote: >> >> > Hi all, >> >> > I'm Jean Parpaillon, new erlang enthusiast and (soon) programmer. On 7 >> >> > past years, I've workedon distributed systems, specially in HPC and >> >> > cloud computing. I'm trying to develop an XMPP agent for system >> >> > management, written in Erlang. This is the introduction, now the >> >> > question :) >> >> > What is your preferred packaging/deployment system for erlang ? I have a >> >> > code running, from erlang shell, and want it to become a real world >> >> > application the user can install from an archive and launch from its >> >> > shell, eventually with some parameters. >> >> > >> >> > I've read about systools, and how to generated .app, .appup, .rel, .boot >> >> > and so on. This looks fine but a lot to do by hand. When it comes to >> >> > update a file, and release the whole stuff, one have to modify plenty of >> >> > others. Or am I wrong ? >> >> > I've looked to existing applications or 'helloworld's: some of them >> >> > using autotools (ejabberd, ...), a lot of others using rebar, sometime a >> >> > little a bit of both, iirc. >> >> > rebar has a lot of magic, which makes debugging hard. >> >> > autotools is not well designed for erlang, but putting some existing m4 >> >> > files here and there seems to fit. At least, I know autotools well. I >> >> > know how can I generate .app, .rel and so on with autotools, but I don't >> >> > know what to put in it :/ >> >> > At the end, for launching the application, I've seen many projects not >> >> > using .boot files, but a shell script with tons of arguments to erl... >> >> > >> >> > I'm a little bit confused :( Any help ? >> >> > >> >> > Best regards, >> >> > -- >> >> > Jean Parpaillon >> >> > Open Source Consultant >> >> > Phone: +33 6 30 10 92 86 >> >> > im: jean.parpaillon@REDACTED >> >> > skype: jean.parpaillon >> >> > linkedin: http://www.linkedin.com/in/jeanparpaillon/en >> >> > >> >> > >> >> > _______________________________________________ >> >> > erlang-questions mailing list >> >> > erlang-questions@REDACTED >> >> > http://erlang.org/mailman/listinfo/erlang-questions >> >> > >> > >> > -- >> > Jean Parpaillon >> > Open Source Consultant >> > Phone: +33 6 30 10 92 86 >> > im: jean.parpaillon@REDACTED >> > skype: jean.parpaillon >> > linkedin: http://www.linkedin.com/in/jeanparpaillon/en >> > > > -- > Jean Parpaillon > Open Source Consultant > Phone: +33 6 30 10 92 86 > im: jean.parpaillon@REDACTED > skype: jean.parpaillon > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From paperless@REDACTED Thu Sep 20 18:25:26 2012 From: paperless@REDACTED (Tim McNamara) Date: Fri, 21 Sep 2012 04:25:26 +1200 Subject: [erlang-questions] erlang hosting In-Reply-To: References: <505B3066.4000806@aleynikov.org> Message-ID: I've been using DigitalOcean (https://www.digitalocean.com/) recently, which doesn't charge for bandwidth and has VPS options from $5/month. Chicago Boss seems quite happy. On 21 September 2012 04:03, Ulf Wiger wrote: > > Dreamhost offers VPSes at $15/month, for 300MB RAM, unmetered disk and BW, > adding $5/month for each additional 100MB RAM. 50 GB backup space included. > > The OS is Debian. No choice there, but at least a decent OS. > > http://dreamhost.com/servers/vps/ > > They also have an uptime guarantee, and will reimburse you if you suffer > downtime because of them. > > BR, > Ulf W > > On 20 Sep 2012, at 17:04, Serge Aleynikov wrote: > >> I am considering to deploy some online Erlang applications. Can anyone >> recommend inexpensive reliable hosting providers for running erlang web >> applications? >> >> Thanks. >> >> Serge >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From jean.parpaillon@REDACTED Thu Sep 20 18:28:09 2012 From: jean.parpaillon@REDACTED (Jean Parpaillon) Date: Thu, 20 Sep 2012 18:28:09 +0200 Subject: [erlang-questions] Erlang application packaging In-Reply-To: References: <1348149133.7702.20.camel@malo.local> <1348151595.7702.23.camel@malo.local> <1348157108.7702.27.camel@malo.local> Message-ID: <1348158489.7702.28.camel@malo.local> Big problems have simple solutions though :) Le jeudi 20 septembre 2012 ? 18:22 +0200, Agustin Cautin a ?crit : > Hello, > > This is because the -s parameter calls the function "start" on the > module given as a parameter, so in this case it would be called as > myapp:start(), probably myapp.erl doesn't exist. > > The function name can be specified as a parameter so you can call the > one is initializing your app. > > Take a look at the erl documentation on the -s parameter. > > Or you can just define the function start to call application:start(myapp). > > Regards. > Agustin > > > On Thu, Sep 20, 2012 at 6:05 PM, Jean Parpaillon > wrote: > > Hi, > > > > Le jeudi 20 septembre 2012 ? 17:49 +0200, Ali Sabil a ?crit : > >> Ok, sorry :) > >> > > No harm, I was suggesting myself to reread it :) > > > >> Basically in Erlang, the concept of release is pretty close to the > >> concept of Linux distributions, a release allows you to package the > >> erlang runtime and a set of applications together into a distribution. > >> The easiest way to generate releases is probably by using rebar. Here > >> is a small quickstart on how to generate a release using rebar: > >> > >> mkdir -p product && cd product > >> wget http://cloud.github.com/downloads/basho/rebar/rebar && chmod u+x rebar > >> mkdir rel && cd rel > >> ../rebar create-node nodeid=product > >> # edit the reltool.config file to remove the non-existing product > >> application from the release > >> # this is done by removing the product atom right after the sasl > >> atom and the comma separating them > >> # as well as {app, product, [{incl_cond, include}]} and the comma before it > >> # this is to have a running release > >> ../rebar generate > >> ./product/bin/product console # this will start a node based on your release > >> > >> The applications you want to include are generally placed in apps/ > >> and/or deps/ at the root and you just need to edit the reltool.config > >> file and add > >> {lib_dirs, ["../apps", "../deps"]} > >> inside the sys section > >> > >> That said you might not really need to use a release to package your > >> application, if you have an erlang runtime available on the target > >> machine you could either turn your application into an escript (the > >> escriptize command in rebar) or use a shell script. > >> > > > > Ok, I think I got the different parts of the release process. Now, if I > > follow a rebar tutorial and try to launch the code: > > - If I do: > > $ erl -pa ebin > > then > >> application:start(myapp). > > > > My application is fine and running > > > > - If I do: > > $ erl -pa ebin -s myapp > > I got the following error: > > {"init terminating in > > do_boot",{undef,[{kernel,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} > > > > > > Any hints ? > > > > Thank you again for your time ! > > > > Jean > > > >> Hope this helps, > >> Ali > >> > >> > >> On Thu, Sep 20, 2012 at 4:33 PM, Jean Parpaillon > >> wrote: > >> > Hi Ali > >> > Thank you for your help. > >> > I've begun erlang with this tutorial but I have to admit I am still > >> > confused about the right tool to use. Just in learnyou..., reltool and > >> > systools are presented. > >> > Let's read again this chapter :) > >> > > >> > Regards, > >> > Jean > >> > > >> > Le jeudi 20 septembre 2012 ? 16:11 +0200, Ali Sabil a ?crit : > >> >> Hi Jean, > >> >> > >> >> I don't know if you have come across this: > >> >> http://learnyousomeerlang.com/release-is-the-word#am-i-an-executable-yet > >> >> but it might be helpful? > >> >> > >> >> Best, > >> >> Ali > >> >> > >> >> On Thu, Sep 20, 2012 at 3:52 PM, Jean Parpaillon > >> >> wrote: > >> >> > Hi all, > >> >> > I'm Jean Parpaillon, new erlang enthusiast and (soon) programmer. On 7 > >> >> > past years, I've workedon distributed systems, specially in HPC and > >> >> > cloud computing. I'm trying to develop an XMPP agent for system > >> >> > management, written in Erlang. This is the introduction, now the > >> >> > question :) > >> >> > What is your preferred packaging/deployment system for erlang ? I have a > >> >> > code running, from erlang shell, and want it to become a real world > >> >> > application the user can install from an archive and launch from its > >> >> > shell, eventually with some parameters. > >> >> > > >> >> > I've read about systools, and how to generated .app, .appup, .rel, .boot > >> >> > and so on. This looks fine but a lot to do by hand. When it comes to > >> >> > update a file, and release the whole stuff, one have to modify plenty of > >> >> > others. Or am I wrong ? > >> >> > I've looked to existing applications or 'helloworld's: some of them > >> >> > using autotools (ejabberd, ...), a lot of others using rebar, sometime a > >> >> > little a bit of both, iirc. > >> >> > rebar has a lot of magic, which makes debugging hard. > >> >> > autotools is not well designed for erlang, but putting some existing m4 > >> >> > files here and there seems to fit. At least, I know autotools well. I > >> >> > know how can I generate .app, .rel and so on with autotools, but I don't > >> >> > know what to put in it :/ > >> >> > At the end, for launching the application, I've seen many projects not > >> >> > using .boot files, but a shell script with tons of arguments to erl... > >> >> > > >> >> > I'm a little bit confused :( Any help ? > >> >> > > >> >> > Best regards, > >> >> > -- > >> >> > Jean Parpaillon > >> >> > Open Source Consultant > >> >> > Phone: +33 6 30 10 92 86 > >> >> > im: jean.parpaillon@REDACTED > >> >> > skype: jean.parpaillon > >> >> > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > >> >> > > >> >> > > >> >> > _______________________________________________ > >> >> > erlang-questions mailing list > >> >> > erlang-questions@REDACTED > >> >> > http://erlang.org/mailman/listinfo/erlang-questions > >> >> > > >> > > >> > -- > >> > Jean Parpaillon > >> > Open Source Consultant > >> > Phone: +33 6 30 10 92 86 > >> > im: jean.parpaillon@REDACTED > >> > skype: jean.parpaillon > >> > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > >> > > > > > -- > > Jean Parpaillon > > Open Source Consultant > > Phone: +33 6 30 10 92 86 > > im: jean.parpaillon@REDACTED > > skype: jean.parpaillon > > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -- Jean Parpaillon Open Source Consultant Phone: +33 6 30 10 92 86 im: jean.parpaillon@REDACTED skype: jean.parpaillon linkedin: http://www.linkedin.com/in/jeanparpaillon/en -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From rtrlists@REDACTED Thu Sep 20 18:33:06 2012 From: rtrlists@REDACTED (Robert Raschke) Date: Thu, 20 Sep 2012 17:33:06 +0100 Subject: [erlang-questions] Erlang application packaging In-Reply-To: <1348157108.7702.27.camel@malo.local> References: <1348149133.7702.20.camel@malo.local> <1348151595.7702.23.camel@malo.local> <1348157108.7702.27.camel@malo.local> Message-ID: It looks a bit like the generated rel file does not have the kernel module (and most likely stdlib) included. I'm not familiar with reltool, so don't know how that might happen. The error message points to kernel:start() function not being available. Which in turn means that the kernel module probably hasn't been loaded. That normally happens automatically when you run a shell, but not necessarily when you start an application directly. Robby On Sep 20, 2012 5:05 PM, "Jean Parpaillon" wrote: > Hi, > > Le jeudi 20 septembre 2012 ? 17:49 +0200, Ali Sabil a ?crit : > > Ok, sorry :) > > > No harm, I was suggesting myself to reread it :) > > > Basically in Erlang, the concept of release is pretty close to the > > concept of Linux distributions, a release allows you to package the > > erlang runtime and a set of applications together into a distribution. > > The easiest way to generate releases is probably by using rebar. Here > > is a small quickstart on how to generate a release using rebar: > > > > mkdir -p product && cd product > > wget http://cloud.github.com/downloads/basho/rebar/rebar && chmod u+x > rebar > > mkdir rel && cd rel > > ../rebar create-node nodeid=product > > # edit the reltool.config file to remove the non-existing product > > application from the release > > # this is done by removing the product atom right after the sasl > > atom and the comma separating them > > # as well as {app, product, [{incl_cond, include}]} and the comma > before it > > # this is to have a running release > > ../rebar generate > > ./product/bin/product console # this will start a node based on your > release > > > > The applications you want to include are generally placed in apps/ > > and/or deps/ at the root and you just need to edit the reltool.config > > file and add > > {lib_dirs, ["../apps", "../deps"]} > > inside the sys section > > > > That said you might not really need to use a release to package your > > application, if you have an erlang runtime available on the target > > machine you could either turn your application into an escript (the > > escriptize command in rebar) or use a shell script. > > > > Ok, I think I got the different parts of the release process. Now, if I > follow a rebar tutorial and try to launch the code: > - If I do: > $ erl -pa ebin > then > > application:start(myapp). > > My application is fine and running > > - If I do: > $ erl -pa ebin -s myapp > I got the following error: > {"init terminating in > > do_boot",{undef,[{kernel,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}} > > > Any hints ? > > Thank you again for your time ! > > Jean > > > Hope this helps, > > Ali > > > > > > On Thu, Sep 20, 2012 at 4:33 PM, Jean Parpaillon > > wrote: > > > Hi Ali > > > Thank you for your help. > > > I've begun erlang with this tutorial but I have to admit I am still > > > confused about the right tool to use. Just in learnyou..., reltool and > > > systools are presented. > > > Let's read again this chapter :) > > > > > > Regards, > > > Jean > > > > > > Le jeudi 20 septembre 2012 ? 16:11 +0200, Ali Sabil a ?crit : > > >> Hi Jean, > > >> > > >> I don't know if you have come across this: > > >> > http://learnyousomeerlang.com/release-is-the-word#am-i-an-executable-yet > > >> but it might be helpful? > > >> > > >> Best, > > >> Ali > > >> > > >> On Thu, Sep 20, 2012 at 3:52 PM, Jean Parpaillon > > >> wrote: > > >> > Hi all, > > >> > I'm Jean Parpaillon, new erlang enthusiast and (soon) programmer. > On 7 > > >> > past years, I've workedon distributed systems, specially in HPC and > > >> > cloud computing. I'm trying to develop an XMPP agent for system > > >> > management, written in Erlang. This is the introduction, now the > > >> > question :) > > >> > What is your preferred packaging/deployment system for erlang ? I > have a > > >> > code running, from erlang shell, and want it to become a real world > > >> > application the user can install from an archive and launch from its > > >> > shell, eventually with some parameters. > > >> > > > >> > I've read about systools, and how to generated .app, .appup, .rel, > .boot > > >> > and so on. This looks fine but a lot to do by hand. When it comes to > > >> > update a file, and release the whole stuff, one have to modify > plenty of > > >> > others. Or am I wrong ? > > >> > I've looked to existing applications or 'helloworld's: some of them > > >> > using autotools (ejabberd, ...), a lot of others using rebar, > sometime a > > >> > little a bit of both, iirc. > > >> > rebar has a lot of magic, which makes debugging hard. > > >> > autotools is not well designed for erlang, but putting some > existing m4 > > >> > files here and there seems to fit. At least, I know autotools well. > I > > >> > know how can I generate .app, .rel and so on with autotools, but I > don't > > >> > know what to put in it :/ > > >> > At the end, for launching the application, I've seen many projects > not > > >> > using .boot files, but a shell script with tons of arguments to > erl... > > >> > > > >> > I'm a little bit confused :( Any help ? > > >> > > > >> > Best regards, > > >> > -- > > >> > Jean Parpaillon > > >> > Open Source Consultant > > >> > Phone: +33 6 30 10 92 86 > > >> > im: jean.parpaillon@REDACTED > > >> > skype: jean.parpaillon > > >> > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > > >> > > > >> > > > >> > _______________________________________________ > > >> > erlang-questions mailing list > > >> > erlang-questions@REDACTED > > >> > http://erlang.org/mailman/listinfo/erlang-questions > > >> > > > > > > > -- > > > Jean Parpaillon > > > Open Source Consultant > > > Phone: +33 6 30 10 92 86 > > > im: jean.parpaillon@REDACTED > > > skype: jean.parpaillon > > > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > > > > > -- > Jean Parpaillon > Open Source Consultant > Phone: +33 6 30 10 92 86 > im: jean.parpaillon@REDACTED > skype: jean.parpaillon > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From romain.lenglet@REDACTED Thu Sep 20 19:04:09 2012 From: romain.lenglet@REDACTED (Romain Lenglet) Date: Thu, 20 Sep 2012 10:04:09 -0700 Subject: [erlang-questions] erlang hosting In-Reply-To: <505B39CD.5020906@ninenines.eu> References: <505B3066.4000806@aleynikov.org> <505B39CD.5020906@ninenines.eu> Message-ID: <512B159D-A97A-4F53-9DA6-E86A043767E9@berabera.info> You have to reside in France to use OVH's Kimsufi offer, unfortunately. -- Romain Lenglet On Sep 20, 2012, at 8:44 AM, Lo?c Hoguin wrote: > On 09/20/2012 05:04 PM, Serge Aleynikov wrote: >> I am considering to deploy some online Erlang applications. Can anyone >> recommend inexpensive reliable hosting providers for running erlang web >> applications? > > OVH has its kimsufi offering which gives you a small dedicated for 15 euros/month. You can run most distros on it, including Arch Linux. I'm not sure which countries it covers exactly though. > > -- > Lo?c Hoguin > Erlang Cowboy > Nine Nines > http://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From gleber.p@REDACTED Thu Sep 20 19:22:32 2012 From: gleber.p@REDACTED (Gleb Peregud) Date: Thu, 20 Sep 2012 19:22:32 +0200 Subject: [erlang-questions] erlang hosting In-Reply-To: <512B159D-A97A-4F53-9DA6-E86A043767E9@berabera.info> References: <505B3066.4000806@aleynikov.org> <505B39CD.5020906@ninenines.eu> <512B159D-A97A-4F53-9DA6-E86A043767E9@berabera.info> Message-ID: That's not accurate. I am using Kimsufi a lot and I am residing in Poland On Thursday, September 20, 2012, Romain Lenglet wrote: > You have to reside in France to use OVH's Kimsufi offer, unfortunately. > -- > Romain Lenglet > > On Sep 20, 2012, at 8:44 AM, Lo?c Hoguin > > wrote: > > > On 09/20/2012 05:04 PM, Serge Aleynikov wrote: > >> I am considering to deploy some online Erlang applications. Can anyone > >> recommend inexpensive reliable hosting providers for running erlang web > >> applications? > > > > OVH has its kimsufi offering which gives you a small dedicated for 15 > euros/month. You can run most distros on it, including Arch Linux. I'm not > sure which countries it covers exactly though. > > > > -- > > Lo?c Hoguin > > Erlang Cowboy > > Nine Nines > > http://ninenines.eu > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.burdick@REDACTED Thu Sep 20 21:17:15 2012 From: thomas.burdick@REDACTED (Tom Burdick) Date: Thu, 20 Sep 2012 14:17:15 -0500 Subject: [erlang-questions] erlang hosting In-Reply-To: References: <505B3066.4000806@aleynikov.org> <505B39CD.5020906@ninenines.eu> <512B159D-A97A-4F53-9DA6-E86A043767E9@berabera.info> Message-ID: I like using Linode for this sort of thing a lot. Tom On Thu, Sep 20, 2012 at 12:22 PM, Gleb Peregud wrote: > That's not accurate. I am using Kimsufi a lot and I am residing in Poland > > > On Thursday, September 20, 2012, Romain Lenglet wrote: >> >> You have to reside in France to use OVH's Kimsufi offer, unfortunately. >> -- >> Romain Lenglet >> >> On Sep 20, 2012, at 8:44 AM, Lo?c Hoguin wrote: >> >> > On 09/20/2012 05:04 PM, Serge Aleynikov wrote: >> >> I am considering to deploy some online Erlang applications. Can anyone >> >> recommend inexpensive reliable hosting providers for running erlang web >> >> applications? >> > >> > OVH has its kimsufi offering which gives you a small dedicated for 15 >> > euros/month. You can run most distros on it, including Arch Linux. I'm not >> > sure which countries it covers exactly though. >> > >> > -- >> > Lo?c Hoguin >> > Erlang Cowboy >> > Nine Nines >> > http://ninenines.eu >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From ghenry@REDACTED Thu Sep 20 21:30:30 2012 From: ghenry@REDACTED (Gavin Henry) Date: Thu, 20 Sep 2012 20:30:30 +0100 Subject: [erlang-questions] erlang hosting In-Reply-To: References: <505B3066.4000806@aleynikov.org> Message-ID: On 20 September 2012 17:25, Tim McNamara wrote: > I've been using DigitalOcean (https://www.digitalocean.com/) recently, > which doesn't charge for bandwidth and has VPS options from $5/month. > Chicago Boss seems quite happy. Oh dear: https://www.digitalocean.com/registrations/create Internal server error. Was going to sign up. -- Kind Regards, Gavin Henry. Managing Director. T +44 (0) 1224 279484 M +44 (0) 7930 323266 F +44 (0) 1224 824887 E ghenry@REDACTED Open Source. Open Solutions(tm). http://www.suretecsystems.com/ Suretec Systems is a limited company registered in Scotland. Registered number: SC258005. Registered office: 24 Cormack Park, Rothienorman, Inverurie, Aberdeenshire, AB51 8GL. Subject to disclaimer at http://www.suretecgroup.com/disclaimer.html Do you know we have our own VoIP provider called SureVoIP? See http://www.surevoip.co.uk Did you see our API? http://www.surevoip.co.uk/api From bourinov@REDACTED Fri Sep 21 07:02:19 2012 From: bourinov@REDACTED (Max Bourinov) Date: Fri, 21 Sep 2012 09:02:19 +0400 Subject: [erlang-questions] erlang hosting In-Reply-To: References: <505B3066.4000806@aleynikov.org> Message-ID: You also can try rackspace.com - very reasonable prices. But of course hardware servers are more cost effective. Best regards, Max On Thu, Sep 20, 2012 at 11:30 PM, Gavin Henry wrote: > On 20 September 2012 17:25, Tim McNamara > wrote: > > I've been using DigitalOcean (https://www.digitalocean.com/) recently, > > which doesn't charge for bandwidth and has VPS options from $5/month. > > Chicago Boss seems quite happy. > > Oh dear: > > https://www.digitalocean.com/registrations/create > > Internal server error. Was going to sign up. > > -- > Kind Regards, > > Gavin Henry. > Managing Director. > > T +44 (0) 1224 279484 > M +44 (0) 7930 323266 > F +44 (0) 1224 824887 > E ghenry@REDACTED > > Open Source. Open Solutions(tm). > > http://www.suretecsystems.com/ > > Suretec Systems is a limited company registered in Scotland. Registered > number: SC258005. Registered office: 24 Cormack Park, Rothienorman, > Inverurie, > Aberdeenshire, AB51 8GL. > > Subject to disclaimer at http://www.suretecgroup.com/disclaimer.html > > Do you know we have our own VoIP provider called SureVoIP? See > http://www.surevoip.co.uk > > Did you see our API? http://www.surevoip.co.uk/api > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Sep 21 07:29:44 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 21 Sep 2012 09:29:44 +0400 Subject: [erlang-questions] erlang hosting In-Reply-To: References: <505B3066.4000806@aleynikov.org> Message-ID: We can list here all VPS =) By the way, I prefer http://newservers.com/ if we speak about US, because they don't mess with this virtualization and give you cloud bare metal. From michael.eugene.turner@REDACTED Fri Sep 21 07:57:29 2012 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Fri, 21 Sep 2012 14:57:29 +0900 Subject: [erlang-questions] erlang hosting In-Reply-To: References: <505B3066.4000806@aleynikov.org> Message-ID: On Fri, Sep 21, 2012 at 2:29 PM, Max Lapshin wrote: > By the way, I prefer http://newservers.com/ if we speak about US, > because they don't mess with this virtualization and give you cloud > bare metal. Ha. That's what they *want* you to think. -michael turner From max.lapshin@REDACTED Fri Sep 21 08:24:00 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 21 Sep 2012 10:24:00 +0400 Subject: [erlang-questions] erlang hosting In-Reply-To: References: <505B3066.4000806@aleynikov.org> Message-ID: On Fri, Sep 21, 2012 at 9:57 AM, Michael Turner wrote: > > Ha. That's what they *want* you to think. > Are you sure? Is it ok in US to lie in advertisement? From mjtruog@REDACTED Fri Sep 21 08:25:30 2012 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 20 Sep 2012 23:25:30 -0700 Subject: [erlang-questions] erlang hosting In-Reply-To: References: <505B3066.4000806@aleynikov.org> Message-ID: <505C085A.2020207@gmail.com> On 09/20/2012 11:24 PM, Max Lapshin wrote: > On Fri, Sep 21, 2012 at 9:57 AM, Michael Turner > wrote: >> Ha. That's what they *want* you to think. >> > Are you sure? Is it ok in US to lie in advertisement? No, they never lie in the US. From michael.eugene.turner@REDACTED Fri Sep 21 09:39:02 2012 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Fri, 21 Sep 2012 16:39:02 +0900 Subject: [erlang-questions] erlang hosting In-Reply-To: <505C085A.2020207@gmail.com> References: <505B3066.4000806@aleynikov.org> <505C085A.2020207@gmail.com> Message-ID: On Fri, Sep 21, 2012 at 3:25 PM, Michael Truog wrote: > On 09/20/2012 11:24 PM, Max Lapshin wrote: >> On Fri, Sep 21, 2012 at 9:57 AM, Michael Turner >> wrote: >>> Ha. That's what they *want* you to think. >>> >> Are you sure? Is it ok in US to lie in advertisement? > > No, they never lie in the US. > *I* never lie in the U.S., anyway. But since I live in Japan now .... -michael turner -- Regards, Michael Turner Project Persephone 1-25-33 Takadanobaba Shinjuku-ku Tokyo 169-0075 (+81) 90-5203-8682 turner@REDACTED http://www.projectpersephone.org/ "Love does not consist in gazing at each other, but in looking outward together in the same direction." -- Antoine de Saint-Exup?ry From andre@REDACTED Fri Sep 21 09:45:22 2012 From: andre@REDACTED (=?ISO-8859-1?Q?Andr=E9_Graf?=) Date: Fri, 21 Sep 2012 09:45:22 +0200 Subject: [erlang-questions] erlang hosting In-Reply-To: <505C085A.2020207@gmail.com> References: <505B3066.4000806@aleynikov.org> <505C085A.2020207@gmail.com> Message-ID: Hi all, some of our services are hosted on a Hetzner rootserver (EX4 for 49 Euros/month), Intel Quad-Core i7-2600 processor, 16 GB DDR 3 RAM, 2 x 3 TB SATA 6 Gb/s hard disks. You can have it with a preinstalled Ubuntu, Fedora, CentOS, OpenSuse, Debian, FreeBSD, and for some extra money Windows. After 10TB outgoing traffic they'll charge you 6.90 Euro for every additional TB or they'll downgrade your network interface to 10MBit/s. For additional 39 Euros/month they'll upgrade your link to 1 GBit including additional 15TB traffic. So far we are very happy with Hetzner. Cheers Andr? On 21 September 2012 08:25, Michael Truog wrote: > On 09/20/2012 11:24 PM, Max Lapshin wrote: >> On Fri, Sep 21, 2012 at 9:57 AM, Michael Turner >> wrote: >>> Ha. That's what they *want* you to think. >>> >> Are you sure? Is it ok in US to lie in advertisement? > > No, they never lie in the US. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From rickard@REDACTED Fri Sep 21 11:41:47 2012 From: rickard@REDACTED (Rickard Green) Date: Fri, 21 Sep 2012 11:41:47 +0200 Subject: [erlang-questions] is anyone else experiencing reliability issues with R15? In-Reply-To: References: Message-ID: <1AF2D32E-B086-4C8E-A176-3913A5DF9E42@erlang.org> This mail isn't aimed at anyone specific, but more of a general statement. Loss of performance of an application or bad behavior of an application when going up to a newer release, do not imply that there is a problem with the new release. The only conclusion that can be made is that this combination doesn't work well. It might be a problem with the new release, but it might also be a problem with the application. As an example, any arbitrary optimization improving performance, may trigger a logical bug in the application due to different timing, or overwhelm a consumer due to faster producers in the absence of flow control, etc. Another example, if performance critical parts of the application makes use of functionality that we at OTP do not see as performance critical you may also end up in trouble. I don't know how big of an issue this later example is in reality, but I think I have to say some words about it. When optimizing the system we sometimes choose to degrade performance of functionality that is not performance critical in order to gain performance of performance critical functionality, or gain overall performance. If you've made use of such functionality in the critical path, you'll lose overall performance of your application. It may also cause memory issues. When working with scalability improvements this seems to be choices that we have to make more and more often. I suspect we need to be better at informing about such changes. One such change that I realized isn't mentioned anywhere is the implementation of erlang:memory(). In R15 this call is much more heavyweight from the callers perspective, but from an overall performance perspective much more lightweight. Preferably these kind of changes wont come as surprises. It is, however, hard to give an exhaustive answer to the question of what we do and do not consider as performance critical functionality, and I will not try to do that. I think common sense will get you far. We do consider core functionality of the language, such as for example message passing, as performance critical. Functionality that pulls out miscellaneous information about the internal state of something is typically not considered as performance critical. Apart from erlang:memory(), process_info() is a good example of such functionality. Anyhow, if you get into trouble when you upgrade to a new release, you need to find out why. It might be an issue with the release, but it might also very well be an issue with your application. In some cases we might be able to help, but in some cases not. We are not that many people working here at OTP. The more relevant information you provide, the better chance of getting help. We are also very interested in finding potential issues with OTP, but as I already said we have limited resources. Regarding increased CPU utilization in R15. When schedulers run out of work, they busy wait for a while before going to sleep. Waking up a busy waiting thread is much faster than waking up a sleeping thread. Due to the rewrites of memory allocation in R15, schedulers are more frequently woken, which cause more busy wait, which in turn cause an increase in CPU utilization when schedulers frequently run out of work (you will at least see some decrease of CPU utilization due to this in R16). When not running out of work there will be no busy wait at all. That is, the increase in CPU utilization does not translate into loss of performance. The busy waiting is there since it shortens the average time to wake up a scheduler, and by this reduces average communication latency between processes. Depending on application the reduced latency might also translate into improved throughput. If the increase in CPU utilization is unwanted, one can as of R15B02 shorten the busy wait threshold (+sbwt command line argument). Note that by shortening the busy wait threshold, there will be an increased average latency. Regards, Rickard Green, Erlang/OTP, Ericsson AB From fredrikelinder@REDACTED Fri Sep 21 12:01:21 2012 From: fredrikelinder@REDACTED (Fredrik Linder) Date: Fri, 21 Sep 2012 12:01:21 +0200 Subject: [erlang-questions] Date of First Release of Mnesia Message-ID: Hi folks, When was the first release of Mnesia with support for disc_copies (ram + disk)? In http://en.wikipedia.org/wiki/In-memory_database, under "Hybrids with on-disk databases", they claim that the first database engine to support both ram and disk tables did so in 2003. I remember using Mnesia with this feature year 2000. Thank you /Fredrik -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt@REDACTED Fri Sep 21 12:26:17 2012 From: pablo.platt@REDACTED (pablo platt) Date: Fri, 21 Sep 2012 13:26:17 +0300 Subject: [erlang-questions] erlang hosting In-Reply-To: References: <505B3066.4000806@aleynikov.org> <505C085A.2020207@gmail.com> Message-ID: Anyone tried Red Hat`s openshift? https://openshift.redhat.com/app/ It let you create 3 free apps, for example, erlang, postgresql and nginx. On Fri, Sep 21, 2012 at 10:45 AM, Andr? Graf wrote: > Hi all, > > some of our services are hosted on a Hetzner rootserver (EX4 for 49 > Euros/month), Intel Quad-Core i7-2600 processor, 16 GB DDR 3 RAM, 2 x > 3 TB SATA 6 Gb/s hard disks. You can have it with a preinstalled > Ubuntu, Fedora, CentOS, OpenSuse, Debian, FreeBSD, and for some extra > money Windows. After 10TB outgoing traffic they'll charge you 6.90 > Euro for every additional TB or they'll downgrade your network > interface to 10MBit/s. For additional 39 Euros/month they'll upgrade > your link to 1 GBit including additional 15TB traffic. > > So far we are very happy with Hetzner. > > Cheers > Andr? > > On 21 September 2012 08:25, Michael Truog wrote: > > On 09/20/2012 11:24 PM, Max Lapshin wrote: > >> On Fri, Sep 21, 2012 at 9:57 AM, Michael Turner > >> wrote: > >>> Ha. That's what they *want* you to think. > >>> > >> Are you sure? Is it ok in US to lie in advertisement? > > > > No, they never lie in the US. > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hm@REDACTED Fri Sep 21 13:01:44 2012 From: hm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Mattsson?=) Date: Fri, 21 Sep 2012 13:01:44 +0200 Subject: [erlang-questions] Date of First Release of Mnesia In-Reply-To: References: Message-ID: Mnesia had this feature from the very beginning. It was present in Erlang/OTP R1A which was released in june 1996. But Erlang/OTP did not reach the open source community until 1998. /H?kan On Fri, Sep 21, 2012 at 12:01 PM, Fredrik Linder wrote: > Hi folks, > > When was the first release of Mnesia with support for disc_copies (ram + > disk)? > > In http://en.wikipedia.org/wiki/In-memory_database, under "Hybrids with > on-disk databases", they claim that the first database engine to support > both ram and disk tables did so in 2003. I remember using Mnesia with this > feature year 2000. > > Thank you > /Fredrik > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From raimo+erlang-questions@REDACTED Fri Sep 21 14:53:57 2012 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 21 Sep 2012 14:53:57 +0200 Subject: [erlang-questions] Is inet_parse.erl deprecated? In-Reply-To: <20120920131249.GA7814@corelatus.se> References: <20120920131249.GA7814@corelatus.se> Message-ID: <20120921125357.GA21506@erix.ericsson.se> On Thu, Sep 20, 2012 at 03:12:49PM +0200, Matthias Lang wrote: > I find these functions quite useful: > > inet_parse:address/1 > inet_parse:ipv4_addr/1 > inet_parse:ipv6_addr/1 > inet_parse:ntoa/1 > > but inet_parse isn't documented at all. Is that an oversight, or are > those functions available through something else? It is an oversight, or rather it is on our ToDo list. But we have not decided if it is those we will document, or if it is better to create wrappers a'la inet:parse_address/1 to not expose the module inet_parse as an API module... There are too many using these so it is probably not possible to remove them without a deprecation cycle, even though they never have been supported. And they will not be deprecated until there are alternatives e.g in inet. > > I'm not the only one using them; they're called the 'diameter', 'ssh' > and 'public_key' applications as well as by a number of things in the kernel. > > Matt > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From bengt.kleberg@REDACTED Fri Sep 21 15:23:50 2012 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Fri, 21 Sep 2012 15:23:50 +0200 Subject: [erlang-questions] Is inet_parse.erl deprecated? Message-ID: Greetings If you care, I prefer adding them to the inet module. Bengt Sent from Moxier Mail (http://www.moxier.com) ----- Ursprungligt meddelande ----- Fr?n: Raimo Niskanen Till: "erlang-questions@REDACTED" Skickat: 21-09-2012 2:54 em ?mne: Re: [erlang-questions] Is inet_parse.erl deprecated? On Thu, Sep 20, 2012 at 03:12:49PM +0200, Matthias Lang wrote: > I find these functions quite useful: > > inet_parse:address/1 > inet_parse:ipv4_addr/1 > inet_parse:ipv6_addr/1 > inet_parse:ntoa/1 > > but inet_parse isn't documented at all. Is that an oversight, or are > those functions available through something else? It is an oversight, or rather it is on our ToDo list. But we have not decided if it is those we will document, or if it is better to create wrappers a'la inet:parse_address/1 to not expose the module inet_parse as an API module... There are too many using these so it is probably not possible to remove them without a deprecation cycle, even though they never have been supported. And they will not be deprecated until there are alternatives e.g in inet. > > I'm not the only one using them; they're called the 'diameter', 'ssh' > and 'public_key' applications as well as by a number of things in the kernel. > > Matt > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions From Sergey_Zhemzhitsky@REDACTED Fri Sep 21 15:29:08 2012 From: Sergey_Zhemzhitsky@REDACTED (Zhemzhitsky Sergey) Date: Fri, 21 Sep 2012 13:29:08 +0000 Subject: [erlang-questions] Large scale deployments testing Message-ID: <06139A918ACCA041BF46A0F36940C7FA4FE44CA9@exch-mbx1.msk.trd.ru> Hello gurus, We?re developing a riak-core application, that does not include any persistence and works in-memory, and are wondering what are the best use cases to test riak-core and erlang itself in large-scale deployments (>100 physical nodes). For example some of the map-reduce frameworks (like hadoop) have performance tests like terasort, etc., which can show to what extent the whole framework can be scaled. So could you share some ideas what are the best practices to test large-scale deployments of riak-core and erlang applications? What synthetic tests and benchmarks can be executed to answer the following questions: 1. Does the system scale well? 2. Can the system be considered as linearly scalable? 3. Is the system truly fault-tolerant? Best Regards, Sergey _______________________________________________________ The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. If you need assistance please contact our Contact Center (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp -------------- next part -------------- An HTML attachment was scrubbed... URL: From arthurbeall@REDACTED Fri Sep 21 17:18:21 2012 From: arthurbeall@REDACTED (Art Beall) Date: Fri, 21 Sep 2012 08:18:21 -0700 (PDT) Subject: [erlang-questions] Hey Message-ID: <1348240701.54076.BPMail_high_noncarrier@web39303.mail.mud.yahoo.com> wow can you look at this http://www.news15localeshw.net/work/?finance=26547 From arthurbeall@REDACTED Fri Sep 21 17:18:21 2012 From: arthurbeall@REDACTED (Art Beall) Date: Fri, 21 Sep 2012 08:18:21 -0700 (PDT) Subject: [erlang-questions] Hey Message-ID: <1348240701.54076.BPMail_high_noncarrier@web39303.mail.mud.yahoo.com> wow can you look at this http://www.news15localeshw.net/work/?finance=26547 From francesquini@REDACTED Fri Sep 21 18:40:30 2012 From: francesquini@REDACTED (Emilio De Camargo Francesquini) Date: Fri, 21 Sep 2012 18:40:30 +0200 Subject: [erlang-questions] Compile with flag --with-dynamic-trace=systemtap failed In-Reply-To: References: <1347591331599-4655144.post@n4.nabble.com> Message-ID: Systemtap already comes with a dtrace script preprocessor. No need to install both Systemtap and Dtrace. Have you installed the systemtap-sdt-devel package? It contains the dtrace preprocessor you need and the sys/sdt.h header needed to compile the VM with tracing enabled. sudo yum install systemtap-sdt-devel Emilio 2012/9/14 CGS : > I got the same problem and I gave up. Systemtap package seems not to be > recognized by Erlang. Instead, dtrace package works like a charm. > > CGS > > > > > On Fri, Sep 14, 2012 at 3:05 PM, Lukas Larsson wrote: >> >> Hello, >> >> On our systemtap testmachine we have the dtrace command available: >> >> -bash-4.2$ dtrace --help >> Usage /usr/bin/dtrace [--help] [-h | -G] [-C [-I]] -s File.d [-o >> ] >> Where -h builds a systemtap header file from the .d file >> -C when used with -h, also run cpp preprocessor >> -o specifies an explicit output file name, >> the default for -G is file.o and -h is file.h >> -I when running cpp pass through this -I include Path >> -s specifies the name of the .d input file >> -G builds a stub file.o from file.d, >> which is required by some packages that use dtrace. >> >> I'm not the guy who has implemented/installed it for us, but I think >> that when you install systemtap you should also get a utility called >> dtrace. >> >> Lukas >> >> On Fri, Sep 14, 2012 at 4:55 AM, goofansu wrote: >> > dtrace: failed to compile script emulator/beam/erlang_dtrace.d: >> > Preprocessor >> > not found >> > configure: error: Could not precompile erlang_dtrace.d: dtrace -h failed >> > configure: error: /root/otp/erts/configure failed for erts >> > >> > >> > OS: fedora17 >> > >> > I've installed systemtap. Shall I install dtrace? >> > >> > >> > >> > -- >> > View this message in context: >> > http://erlang.2086793.n4.nabble.com/Compile-with-flag-with-dynamic-trace-systemtap-failed-tp4655144.html >> > Sent from the Erlang Questions mailing list archive at Nabble.com. >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From simon@REDACTED Fri Sep 21 18:50:53 2012 From: simon@REDACTED (Simon MacMullen) Date: Fri, 21 Sep 2012 17:50:53 +0100 Subject: [erlang-questions] Relationship between erlang:memory/1, ets:info/2 and erlang:process_info/2 Message-ID: <505C9AED.5030005@rabbitmq.com> I'm trying to write something that will account for memory use on a RabbitMQ system. To do this I'm trying to match up the numbers I get out of erlang:memory(ets) and ets:info(T, memory), and erlang:memory(processes) and erlang:process_info/2. And it doesn't make a huge amount of sense to me. I don't expect things to match up perfectly, of course there will be some memory unaccounted for, but the ETS numbers in particular can be quite off: 1> erlang:memory(ets). 2120291872 2> lists:sum([ets:info(T, memory) || T <- ets:all()]) * erlang:system_info(wordsize). 1874292776 So I have ~2GB of ETS memory, and ~230MB unaccounted for. Should I expect these to match up closer? And then... 3> erlang:memory(processes). 1519425156 4> lists:sum([element(2, process_info(P, memory)) || P <- processes()]). 1552852008 So for processes there is less in total than if you add them all up. Is some memory shared? (Are we counting binaries and atoms in there as well?) Is there a way to get this sort of information in a more consistent manner? Cheers, Simon -- Simon MacMullen RabbitMQ, VMware From demeshchuk@REDACTED Fri Sep 21 22:38:02 2012 From: demeshchuk@REDACTED (Dmitry Demeshchuk) Date: Sat, 22 Sep 2012 00:38:02 +0400 Subject: [erlang-questions] erlang:send_after/3 questions Message-ID: Hello, list. It's time to reveal some erlang:send_after/3 mysteries I think :) 1. When is the message term stored? It's obviously not the callee process, and it doesn't seem to be the target process (I don't see a process part that could store it). Is it dangerous to pass large messages through it? 2. What happens when the target process dies before send_after/3 occurs? The returned ref makes me think that we actually spawn some sort of a monitor here, and we just stop waiting if the process died by whatever reason. Is that correct? 3. Is spawning a lot of send_after's or timers a dangerous idea? In case of using timer module, we'll just lose some started timers due to port restart. But something tells me that crash of erlang internal timers is a somewhat more dangerous thing that might even crash the VM. Any links or facts would be very appreciated. -- Best regards, Dmitry Demeshchuk -------------- next part -------------- An HTML attachment was scrubbed... URL: From joel.meyer@REDACTED Sat Sep 22 00:00:36 2012 From: joel.meyer@REDACTED (Joel Meyer) Date: Fri, 21 Sep 2012 15:00:36 -0700 Subject: [erlang-questions] Large scale deployments testing In-Reply-To: <06139A918ACCA041BF46A0F36940C7FA4FE44CA9@exch-mbx1.msk.trd.ru> References: <06139A918ACCA041BF46A0F36940C7FA4FE44CA9@exch-mbx1.msk.trd.ru> Message-ID: Hi Sergey, We (OpenX) have a riak_core based application that's running on a 125 node cluster (there are also other smaller clusters). We never really tested to see where it would fall over (and the cluster was much smaller when it started), but I see no indicators that it will fall over when we add the 126th node. FWIW, it's running riak_core 0.13.0, and I assume the newer versions of riak_core have only gotten better. Answers to some of your other questions (based solely on my experience) in-line below. On Fri, Sep 21, 2012 at 6:29 AM, Zhemzhitsky Sergey < Sergey_Zhemzhitsky@REDACTED> wrote: > Hello gurus,**** > > ** ** > > We?re developing a riak-core application, that does not include any > persistence and works in-memory, and are wondering what are the best use > cases to test riak-core and erlang itself in large-scale deployments (>100 > physical nodes).**** > > ** ** > > For example some of the map-reduce frameworks (like hadoop) have > performance tests like terasort, etc., which can show to what extent the > whole framework can be scaled. **** > > ** ** > > So could you share some ideas what are the best practices to test > large-scale deployments of riak-core and erlang applications? What > synthetic tests and benchmarks can be executed to answer the following > questions: **** > > ** ** > > **1. **Does the system scale well? > Yes, so far it has scaled well. > ** ** > > **2. **Can the system be considered as linearly scalable? > Yes, the riak_core portion can be considered linearly scalable. The overall behavior is largely dependent on what you're doing in your vnodes and how well you hash the things you want distributed. In theory, if you hash poorly you can get hot-spots that will prevent linear scalability, but I haven't seen that happen with our workload. > **** > > **3. **Is the system truly fault-tolerant? > For the most part, 'yes', but that again depends on how you implement your vnode. The problems that I've encountered were due to my own inexperience with erlang when implementing my vnode. In general I've been very happy with riak_core and we're definitely looking at using it more for places where it's the right solution. Cheers, Joel > **** > > ** ** > > Best Regards,**** > > Sergey **** > > ** ** > > _______________________________________________________ > > > > The information contained in this message may be privileged and conf > idential and protected from disclosure. If you are not the original > intended recipient, you are hereby notified that any review, > retransmission, dissemination, or other use of, or taking of any action in > reliance upon, this information is prohibited. If you have received this > communication in error, please notify the sender immediately by replying to > this message and delete it from your computer. Thank you for your > cooperation. Troika Dialog, Russia. > > If you need assistance please contact our Contact Center (+7495) 258 0500or go to > www.troika.ru/eng/Contacts/system.wbp > > > > _______________________________________________ > riak-users mailing list > riak-users@REDACTED > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From freza@REDACTED Sat Sep 22 00:15:10 2012 From: freza@REDACTED (freza@REDACTED) Date: Fri, 21 Sep 2012 18:15:10 -0400 Subject: [erlang-questions] erlang:send_after/3 questions In-Reply-To: References: Message-ID: <20120921221510.GB28464@circlewave.net> Hi, My understanding, but I'm not ERTS internals expert: On Sat, Sep 22, 2012 at 12:38:02AM +0400, Dmitry Demeshchuk wrote: > It's time to reveal some erlang:send_after/3 mysteries I think :) > > 1. When is the message term stored? It's obviously not the callee process, > and it doesn't seem to be the target process (I don't see a process part > that could store it). Is it dangerous to pass large messages through it? It's copied to a heap fragment -- roughly the same kind of C struct is used as for regular message passing. Except unlike regular message passing the copying seems to be done in a way that blocks invoking scheduler thread. So passing large structures this way is probably a bad idea (and, in my opinion, quite an exotic thing to want to do). But you could always use term_to_binary/1 first and cheat around this limitation. > 2. What happens when the target process dies before send_after/3 occurs? > The returned ref makes me think that we actually spawn some sort of a > monitor here, and we just stop waiting if the process died by whatever > reason. Is that correct? The returned Ref is precisely the same thing as if make_ref/1 were called. To each successfuly started timer there corresponds a small C structure. Timers are inserted into a list hanging off receiving process' structure if Pid is known and alive at the time send_after/3 is called. This list enables receiving process to release all pending timers on exit. Timers are additionally inserted into a global table of some sort. Otherwise, when receiving process is given by name, timer will presumably happily live in this global table and will be released upon expiry (the erlang(3) manpage agrees with this speculation). They can't be released any sooner than that, registered name may refer to different Pids over time and by passing name instead of a real Pid you're expressing the wish to deliver to the latest instance possible. If receiving process is a Pid but dead already when send_after/3 is called, send_after/3 degenerates into a sligtly slower variant of make_ref/1. ;-) > 3. Is spawning a lot of send_after's or timers a dangerous idea? In case of > using timer module, we'll just lose some started timers due to port > restart. But something tells me that crash of erlang internal timers is a > somewhat more dangerous thing that might even crash the VM. Not sure I understand you here. These timers are a facility built directly into ERTS. If there were a bug somewhere in the implementation, that could be as horribly nasty as any other bug in ERTS. Other than that, they are dead pieces of data interpreted in some conventional way by a bunch of C code, so as such they can't really "crash" in any obvious meaning of the word. > Any links or facts would be very appreciated. Just link to the implementation: https://github.com/erlang/otp/blob/maint/erts/emulator/beam/erl_bif_timer.c#L495 BR, -- Jachym From mjtruog@REDACTED Sat Sep 22 01:25:05 2012 From: mjtruog@REDACTED (Michael Truog) Date: Fri, 21 Sep 2012 16:25:05 -0700 Subject: [erlang-questions] erlang:send_after/3 questions In-Reply-To: <20120921221510.GB28464@circlewave.net> References: <20120921221510.GB28464@circlewave.net> Message-ID: <505CF751.5020508@gmail.com> On 09/21/2012 03:15 PM, freza@REDACTED wrote: >> 3. Is spawning a lot of send_after's or timers a dangerous idea? In case of >> using timer module, we'll just lose some started timers due to port >> restart. But something tells me that crash of erlang internal timers is a >> somewhat more dangerous thing that might even crash the VM. > Not sure I understand you here. > > These timers are a facility built directly into ERTS. If there were a > bug somewhere in the implementation, that could be as horribly nasty > as any other bug in ERTS. Other than that, they are dead pieces of > data interpreted in some conventional way by a bunch of C code, so > as such they can't really "crash" in any obvious meaning of the > word. I remember reading about problems using the timer module with a large number of timers because of excessive memory consumption, such that erlang:send_after/3 or erlang:start_timer/3 is generally the preferred approach. I don't have a link to the mailing list message(s) for instances of that problem, but I assume it is still an issue today, because of extra storage used by the timer module. From nem@REDACTED Sat Sep 22 01:34:42 2012 From: nem@REDACTED (Geoff Cant) Date: Fri, 21 Sep 2012 16:34:42 -0700 Subject: [erlang-questions] erlang hosting In-Reply-To: <505B3066.4000806@aleynikov.org> (Serge Aleynikov's message of "Thu, 20 Sep 2012 11:04:06 -0400") References: <505B3066.4000806@aleynikov.org> Message-ID: Serge Aleynikov writes: > I am considering to deploy some online Erlang applications. Can anyone > recommend inexpensive reliable hosting providers for running erlang web > applications? > > Thanks. > > Serge Hi Serge, if you have an Erlang web application that you want to deploy, Heroku has buildpack[1] support for a number of OTP versions. The big downside right now is that you can't do Erlang distribution - your web app would have to coordinate via a shared resource like a queue or a database as typical Rails/Java/... apps do. It's an unfortunate restriction of the platform right now. The upside is you get one free dyno[2] (linux container) for your app, and a catalogue of addons[3] that together with the platform take care of almost all your ops chores. Cheers, -- Geoff Cant (oblig: I work for Heroku and we love Erlang) [1] https://devcenter.heroku.com/articles/third-party-buildpacks [2] https://devcenter.heroku.com/articles/dynos [3] https://addons.heroku.com/ From mahesh@REDACTED Sat Sep 22 02:13:57 2012 From: mahesh@REDACTED (Mahesh Paolini-Subramanya) Date: Fri, 21 Sep 2012 20:13:57 -0400 Subject: [erlang-questions] erlang:send_after/3 questions In-Reply-To: <505CF751.5020508@gmail.com> References: <20120921221510.GB28464@circlewave.net> <505CF751.5020508@gmail.com> Message-ID: <4F20FEC3-2F43-4967-886A-5CAA89901544@dieswaytoofast.com> The timer module is basically a gen_server that is using timeouts to invoke a timer and an ordered_set ETS to store the timers The ordered_set is probably the cause of the memory issues you are referring to, and the gen_server/timeout implementation is, well, not exactly the most scalable way to do this... Cheers Mahesh Paolini-Subramanya That Tall Bald Indian Guy... Blog | Twitter | Google+ On Sep 21, 2012, at 7:25 PM, Michael Truog wrote: > On 09/21/2012 03:15 PM, freza@REDACTED wrote: >>> 3. Is spawning a lot of send_after's or timers a dangerous idea? In case of >>> using timer module, we'll just lose some started timers due to port >>> restart. But something tells me that crash of erlang internal timers is a >>> somewhat more dangerous thing that might even crash the VM. >> Not sure I understand you here. >> >> These timers are a facility built directly into ERTS. If there were a >> bug somewhere in the implementation, that could be as horribly nasty >> as any other bug in ERTS. Other than that, they are dead pieces of >> data interpreted in some conventional way by a bunch of C code, so >> as such they can't really "crash" in any obvious meaning of the >> word. > > I remember reading about problems using the timer module with a large number of timers because of excessive memory consumption, such that erlang:send_after/3 or erlang:start_timer/3 is generally the preferred approach. I don't have a link to the mailing list message(s) for instances of that problem, but I assume it is still an issue today, because of extra storage used by the timer module. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Sat Sep 22 03:58:01 2012 From: mjtruog@REDACTED (Michael Truog) Date: Fri, 21 Sep 2012 18:58:01 -0700 Subject: [erlang-questions] Large scale deployments testing In-Reply-To: References: <06139A918ACCA041BF46A0F36940C7FA4FE44CA9@exch-mbx1.msk.trd.ru> Message-ID: <505D1B29.7020603@gmail.com> On 09/21/2012 03:00 PM, Joel Meyer wrote: > Hi Sergey, > > We (OpenX) have a riak_core based application that's running on a 125 node cluster (there are also other smaller clusters). We never really tested to see where it would fall over (and the cluster was much smaller when it started), but I see no indicators that it will fall over when we add the 126th node. FWIW, it's running riak_core 0.13.0, and I assume the newer versions of riak_core have only gotten better. Answers to some of your other questions (based solely on my experience) in-line below. The riak list mentioned optimism about riak clusters of 200+ nodes in a thread here: http://riak-users.197444.n3.nabble.com/does-Riak-cluster-maintain-fully-connected-Erlang-network-td3695942.html However, as mentioned in the thread, a fully connected network of nodes (fully connected because of the usage of distributed Erlang) does have a natural limit (due to the network speed) on scalability with the net tick time. You can always increase the net tick time, but then failures will take longer to detect. So, your success may rely on your fault-tolerance requirements. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.brandish@REDACTED Sat Sep 22 05:30:02 2012 From: tom.brandish@REDACTED (Brandish, Tom) Date: Sat, 22 Sep 2012 03:30:02 +0000 Subject: [erlang-questions] Compile error: R15B01 on Solaris 10 64-bit Message-ID: <4EF820DB2B020C42A6AE6807469B524D0145A4A7@US-PLNO-EXM01-P.global.tektronix.net> Hi, I am trying to compile R15B01 on Solaris 10 64-bit. I have issued the following commands thus far: cd /uadev/internalbuilds/Erlang/otp_src_R15B01 PATH=$PATH:/usr/ccs/bin:/usr/sfw/bin ERL_TOP=`pwd` env CFLAGS="-O2 -g64" ./configure make I am getting the following error. Can anyone assist? make[2]: Entering directory `/uadev/internalbuilds/Erlang/otp_src_R15B01/erts/emulator' make -f sparc-sun-solaris2.10/Makefile TYPE=opt make[3]: Entering directory `/uadev/internalbuilds/Erlang/otp_src_R15B01/erts/emulator' gcc -O2 -g64 -L/uadev/internalbuilds/Erlang/otp_src_R15B01/lib -I/uadev/internalbuilds/Erlang/otp_src_R15B01/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 -DPOSIX_THREADS -D_POSIX_PTHREAD_SEMANTICS -Wa,-xarch=v8plusa -Isparc-sun-solaris2.10/opt/plain -Ibeam -Isys/unix -Isys/common -Isparc-sun-solaris2.10 -Izlib -Ipcre -Ihipe -I../include -I../include/sparc-sun-solaris2.10 -I../include/internal -I../include/internal/sparc-sun-solaris2.10 -c sys/unix/erl_main.c -o obj/sparc-sun-solaris2.10/opt/plain/erl_main.o cc1: warning: invalid debug level specification in option: `-g64' cc1: warning: no debugging information will be generated In file included from /opt/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/signal.h:15, from sys/unix/erl_unix_sys.h:47, from beam/sys.h:47, from sys/unix/erl_main.c:22: /opt/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/include/sys/signal.h:124: conflicting types for `sigset_t' /usr/include/sys/select.h:46: previous declaration of `sigset_t' make[3]: *** [obj/sparc-sun-solaris2.10/opt/plain/erl_main.o] Error 1 make[3]: Leaving directory `/uadev/internalbuilds/Erlang/otp_src_R15B01/erts/emulator' make[2]: *** [opt] Error 2 make[2]: Leaving directory `/uadev/internalbuilds/Erlang/otp_src_R15B01/erts/emulator' make[1]: *** [opt] Error 2 make[1]: Leaving directory `/uadev/internalbuilds/Erlang/otp_src_R15B01/erts' make: *** [emulator] Error 2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From rapsey@REDACTED Sat Sep 22 08:07:36 2012 From: rapsey@REDACTED (Rapsey) Date: Sat, 22 Sep 2012 08:07:36 +0200 Subject: [erlang-questions] erlang:send_after/3 questions In-Reply-To: References: Message-ID: > > > 3. Is spawning a lot of send_after's or timers a dangerous idea? In case > of using timer module, we'll just lose some started timers due to port > restart. But something tells me that crash of erlang internal timers is a > somewhat more dangerous thing that might even crash the VM. > > How much is a lot of send_afters? My server runs a lot of timers, but very rarely in more than one per process. But there can easily be thousands of timers running in different processes. I would advise against using timer module. Using the timer module in a few places turned out to be a big mistake. It sometimes just stops working completely. It may be a mistake on my part, but erlang:send_after generally does everything you need and is completely reliable. Sergej -------------- next part -------------- An HTML attachment was scrubbed... URL: From gleber.p@REDACTED Sat Sep 22 10:06:54 2012 From: gleber.p@REDACTED (Gleb Peregud) Date: Sat, 22 Sep 2012 10:06:54 +0200 Subject: [erlang-questions] erlang:send_after/3 questions In-Reply-To: References: Message-ID: In my experience, using excessive timers once bit me hard due to lock contention on global timers lock in Erts. Roughly it was about 3-5 timers created/expired for each of around 200k-500k processes at roughly the same moment (a big broadcast to all processes). Fortunately lcnt showed the problem which was slowing down the broadcast tenfold - lock conflicts was at 95% level on timers lock. On Sep 22, 2012 8:07 AM, "Rapsey" wrote: > >> 3. Is spawning a lot of send_after's or timers a dangerous idea? In case >> of using timer module, we'll just lose some started timers due to port >> restart. But something tells me that crash of erlang internal timers is a >> somewhat more dangerous thing that might even crash the VM. >> >> How much is a lot of send_afters? My server runs a lot of timers, but > very rarely in more than one per process. But there can easily be thousands > of timers running in different processes. > I would advise against using timer module. Using the timer module in a few > places turned out to be a big mistake. It sometimes just stops working > completely. It may be a mistake on my part, but erlang:send_after generally > does everything you need and is completely reliable. > > > Sergej > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mabrek@REDACTED Sat Sep 22 10:18:35 2012 From: mabrek@REDACTED (Anton Lebedevich) Date: Sat, 22 Sep 2012 12:18:35 +0400 Subject: [erlang-questions] Relationship between erlang:memory/1, ets:info/2 and erlang:process_info/2 In-Reply-To: <505C9AED.5030005@rabbitmq.com> References: <505C9AED.5030005@rabbitmq.com> Message-ID: There could be even more inconsistensies between memory consumed by erlang vm and statistics reported by memory(). top output PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 15863 root 20 0 721m 559m 3316 S 0 14.1 3:47.58 beam.smp (node@REDACTED)1> memory(). [{total,103534784}, {processes,18226104}, {processes_used,14971560}, {system,85308680}, {atom,2247985}, {atom_used,2227049}, {binary,33598272}, {code,25217445}, {ets,1857024}] Total in memory() output is about 100Mb but real memory usage of erlang vm (R14B04) is ~600Mb On Fri, Sep 21, 2012 at 8:50 PM, Simon MacMullen wrote: > I'm trying to write something that will account for memory use on a RabbitMQ > system. To do this I'm trying to match up the numbers I get out of > erlang:memory(ets) and ets:info(T, memory), and erlang:memory(processes) and > erlang:process_info/2. > > And it doesn't make a huge amount of sense to me. I don't expect things to > match up perfectly, of course there will be some memory unaccounted for, but > the ETS numbers in particular can be quite off: > > 1> erlang:memory(ets). > 2120291872 > > 2> lists:sum([ets:info(T, memory) || T <- ets:all()]) * > erlang:system_info(wordsize). > 1874292776 > > So I have ~2GB of ETS memory, and ~230MB unaccounted for. Should I expect > these to match up closer? > > And then... > > 3> erlang:memory(processes). > 1519425156 > > 4> lists:sum([element(2, process_info(P, memory)) || P <- processes()]). > 1552852008 > > So for processes there is less in total than if you add them all up. Is some > memory shared? (Are we counting binaries and atoms in there as well?) > > Is there a way to get this sort of information in a more consistent manner? > > Cheers, Simon > > -- > Simon MacMullen > RabbitMQ, VMware > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From jrosenblum@REDACTED Sun Sep 23 02:07:10 2012 From: jrosenblum@REDACTED (James Rosenblum) Date: Sat, 22 Sep 2012 17:07:10 -0700 (PDT) Subject: [erlang-questions] Efficiency is passing a functin Message-ID: <1348358830.31087.YahooMailNeo@web181201.mail.ne1.yahoo.com> Kind people, Is there an appreciable difference in these two ways of passing a function? F = fun(A,B) -> my_function(A,B) end. lists:map(F, Lst) vs. -export([my_function/2]). lists:map(fun my_function/2, Lst) Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Sun Sep 23 03:37:58 2012 From: mjtruog@REDACTED (Michael Truog) Date: Sat, 22 Sep 2012 18:37:58 -0700 Subject: [erlang-questions] Efficiency is passing a functin In-Reply-To: <1348358830.31087.YahooMailNeo@web181201.mail.ne1.yahoo.com> References: <1348358830.31087.YahooMailNeo@web181201.mail.ne1.yahoo.com> Message-ID: <505E67F6.8080205@gmail.com> On 09/22/2012 05:07 PM, James Rosenblum wrote: > Kind people, > > Is there an appreciable difference in these two ways of passing a function? > > F = fun(A,B) -> my_function(A,B) end. > lists:map(F, Lst) > > vs. > > -export([my_function/2]). > > lists:map(fun my_function/2, Lst) > >From http://www.erlang.org/doc/efficiency_guide/functions.html#id67199 "Calls to local or external functions are the fastest kind of calls." So, the second solution is best. -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.koener@REDACTED Sun Sep 23 08:17:36 2012 From: antoine.koener@REDACTED (Antoine Koener) Date: Sun, 23 Sep 2012 08:17:36 +0200 Subject: [erlang-questions] Efficiency is passing a functin In-Reply-To: <505E67F6.8080205@gmail.com> References: <1348358830.31087.YahooMailNeo@web181201.mail.ne1.yahoo.com> <505E67F6.8080205@gmail.com> Message-ID: You don't need to export it, if you use it in the same module... -- Was on the go On 23 sept. 2012, at 03:37, Michael Truog wrote: > On 09/22/2012 05:07 PM, James Rosenblum wrote: >> >> Kind people, >> >> Is there an appreciable difference in these two ways of passing a function? >> >> F = fun(A,B) -> my_function(A,B) end. >> lists:map(F, Lst) >> >> vs. >> >> -export([my_function/2]). >> >> lists:map(fun my_function/2, Lst) >> > From http://www.erlang.org/doc/efficiency_guide/functions.html#id67199 > "Calls to local or external functions are the fastest kind of calls." > So, the second solution is best. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From shahrdad1@REDACTED Sun Sep 23 14:55:52 2012 From: shahrdad1@REDACTED (Shahrdad Shadab) Date: Sun, 23 Sep 2012 08:55:52 -0400 Subject: [erlang-questions] [ANN] erserve Erlang/R (Rserve) connector - 3.0.0 In-Reply-To: <659E42BD-9812-461D-990D-E3665F8398A3@gmail.com> References: <659E42BD-9812-461D-990D-E3665F8398A3@gmail.com> Message-ID: Hi Daniel This is really good, I have been waiting for this for a long time. Thanks a lot Best Regards Shahrdad On Tue, Aug 28, 2012 at 10:40 AM, Zabrane Mickael wrote: > Hi Daniel, > > Extremely useful. > Thanks for sharing ... and thanks to Klarna too! > > Regards, > Zabrane > > On Aug 28, 2012, at 1:15 PM, Daniel Eliasson wrote: > > > Dear all, > > > > I announce to you the existence of erserve 3.0.0. It is available at > > https://github.com/del/erserve and a connection pool library for it at > > https://github.com/del/erserve_pool > > > > What is it? > > === > > erserve is an Erlang application that lets you easily connect to an R > > instance via Rserve ( http://rforge.net/Rserve/ ) over a binary > > protocol. > > You can send strings to R to be evaluated, and also upload data to > > variables in R via binary transport. > > > > Who is it for? > > === > > erserve should come in handy if you want to perform some kind of > > calculations that are tedious/difficult in Erlang, for instance > > running data through machine learning models. It can also shorten your > > deployment times by allowing you to model things in R, and then just > > use your results from Erlang, instead of porting them there. > > > > Is it fast? > > === > > It's not bad. With 10 workers and a pool of 10 erserve connections, my > > workstation (Core i7 2.93 Ghz, 16 GB RAM) could run 10 000 individual > > classifications through a random forest in 8 seconds. That's about > > 1250 calls per second in throughput, with each invidivual call taking > > about 3 ms round-trip. > > > > === > > If you have any questions, please let me know. If anyone has use for > > this, I would greatly appreciate feedback on improvements. > > > > I'd also like to thank my employer, Klarna AB, for letting me do some > > of the work on this open source software during work hours. > > > > Best, > > Daniel Eliasson > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Software Architect & Computer Scientist -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Sun Sep 23 14:55:49 2012 From: ulf@REDACTED (Ulf Wiger) Date: Sun, 23 Sep 2012 14:55:49 +0200 Subject: [erlang-questions] Efficiency is passing a functin In-Reply-To: <1348358830.31087.YahooMailNeo@web181201.mail.ne1.yahoo.com> References: <1348358830.31087.YahooMailNeo@web181201.mail.ne1.yahoo.com> Message-ID: To begin with, your example won't compile, but the question is still valid. Consider this program: ================= -module(foldtest). -export([f1/2, f2/2]). f1(Acc, Lst) -> F = fun(A,B) -> my_function(A,B) end, lists:foldl(F, Acc, Lst). f2(Acc, Lst) -> lists:foldl(fun my_function/2, Acc, Lst). my_function(X, Acc) -> [X|Acc]. ================= I believe this illustrates the question, but compiles and runs correctly. Eshell V5.9 (abort with ^G) 1> foldtest:f1([], [1,2,3]). [3,2,1] 2> foldtest:f2([], [1,2,3]). [3,2,1] Now, let's compile the code with `erlc -S foldtest.erl` (generating ASM code): {function, f1, 2, 2}. {label,1}. {line,[{location,"foldtest.erl",4}]}. {func_info,{atom,foldtest},{atom,f1},2}. {label,2}. {allocate,2,2}. {move,{x,1},{y,0}}. {move,{x,0},{y,1}}. {make_fun2,{f,14},0,0,0}. {move,{y,0},{x,2}}. {move,{y,1},{x,1}}. {line,[{location,"foldtest.erl",6}]}. {call_ext_last,3,{extfunc,lists,foldl,3},2}. {function, f2, 2, 4}. {label,3}. {line,[{location,"foldtest.erl",9}]}. {func_info,{atom,foldtest},{atom,f2},2}. {label,4}. {allocate,2,2}. {move,{x,1},{y,0}}. {move,{x,0},{y,1}}. {make_fun2,{f,12},0,0,0}. {move,{y,0},{x,2}}. {move,{y,1},{x,1}}. {line,[{location,"foldtest.erl",10}]}. {call_ext_last,3,{extfunc,lists,foldl,3},2}. As you can tell, the two alternatives generate identical code. The fun is compiled into a regular function, albeit with a funny name, and calling it carries the same cost as calling a hand-written function. Actually instantiating a fun context carries a slight overhead depending on the number of variables that need to be imported into the context (in this case, zero). There will be one level of indirection in both cases. BR, Ulf W On 23 Sep 2012, at 02:07, James Rosenblum wrote: > Is there an appreciable difference in these two ways of passing a function? > > F = fun(A,B) -> my_function(A,B) end. > lists:map(F, Lst) > > vs. > > -export([my_function/2]). > > lists:map(fun my_function/2, Lst) Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jrosenblum@REDACTED Sun Sep 23 15:45:02 2012 From: jrosenblum@REDACTED (Jim Rosenblum) Date: Sun, 23 Sep 2012 09:45:02 -0400 Subject: [erlang-questions] Efficiency is passing a functin In-Reply-To: References: <1348358830.31087.YahooMailNeo@web181201.mail.ne1.yahoo.com> Message-ID: <72FB0168-0BE9-40E4-9A42-78FDD1AEABBC@prodigy.net> Ulf, How do I reconcile your answer with the previous reference to: http://www.erlang.org/doc/efficiency_guide/functions.html#id67199 which seems to imply that Funs are significantly slower? On Sep 23, 2012, at 8:55 AM, Ulf Wiger wrote: > > To begin with, your example won't compile, but the question is still valid. > > Consider this program: > > ================= > -module(foldtest). > -export([f1/2, f2/2]). > > f1(Acc, Lst) -> > F = fun(A,B) -> my_function(A,B) end, > lists:foldl(F, Acc, Lst). > > f2(Acc, Lst) -> > lists:foldl(fun my_function/2, Acc, Lst). > > my_function(X, Acc) -> > [X|Acc]. > ================= > > I believe this illustrates the question, but compiles and runs correctly. > > Eshell V5.9 (abort with ^G) > 1> foldtest:f1([], [1,2,3]). > [3,2,1] > 2> foldtest:f2([], [1,2,3]). > [3,2,1] > > Now, let's compile the code with `erlc -S foldtest.erl` (generating ASM code): > > {function, f1, 2, 2}. > {label,1}. > {line,[{location,"foldtest.erl",4}]}. > {func_info,{atom,foldtest},{atom,f1},2}. > {label,2}. > {allocate,2,2}. > {move,{x,1},{y,0}}. > {move,{x,0},{y,1}}. > {make_fun2,{f,14},0,0,0}. > {move,{y,0},{x,2}}. > {move,{y,1},{x,1}}. > {line,[{location,"foldtest.erl",6}]}. > {call_ext_last,3,{extfunc,lists,foldl,3},2}. > > > {function, f2, 2, 4}. > {label,3}. > {line,[{location,"foldtest.erl",9}]}. > {func_info,{atom,foldtest},{atom,f2},2}. > {label,4}. > {allocate,2,2}. > {move,{x,1},{y,0}}. > {move,{x,0},{y,1}}. > {make_fun2,{f,12},0,0,0}. > {move,{y,0},{x,2}}. > {move,{y,1},{x,1}}. > {line,[{location,"foldtest.erl",10}]}. > {call_ext_last,3,{extfunc,lists,foldl,3},2}. > > As you can tell, the two alternatives generate identical code. > > The fun is compiled into a regular function, albeit with a funny name, and calling it carries the same cost as calling a hand-written function. Actually instantiating a fun context carries a slight overhead depending on the number of variables that need to be imported into the context (in this case, zero). There will be one level of indirection in both cases. > > BR, > Ulf W > > On 23 Sep 2012, at 02:07, James Rosenblum wrote: > >> Is there an appreciable difference in these two ways of passing a function? >> >> F = fun(A,B) -> my_function(A,B) end. >> lists:map(F, Lst) >> >> vs. >> >> -export([my_function/2]). >> >> lists:map(fun my_function/2, Lst) > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Sun Sep 23 16:11:45 2012 From: lukas@REDACTED (Lukas Larsson) Date: Sun, 23 Sep 2012 16:11:45 +0200 Subject: [erlang-questions] Efficiency is passing a functin In-Reply-To: <72FB0168-0BE9-40E4-9A42-78FDD1AEABBC@prodigy.net> References: <1348358830.31087.YahooMailNeo@web181201.mail.ne1.yahoo.com> <72FB0168-0BE9-40E4-9A42-78FDD1AEABBC@prodigy.net> Message-ID: When you do `fun myfunction` you are creating a fun which points to a named function. What that text is referencing is that doing F = fun myfunction/0, F() is slower that calling myfunction() directly. So if you want absolute super speed of your lists:fold you should write the loop yourself and call the function. The speed difference between the two alternatives is usually not big enough to warrant the extra code bloat for the minimal speed you gain. Lukas On Sun, Sep 23, 2012 at 3:45 PM, Jim Rosenblum wrote: > Ulf, > > How do I reconcile your answer with the previous reference to: > http://www.erlang.org/doc/efficiency_guide/functions.html#id67199 which > seems to imply that Funs are significantly slower? > > > On Sep 23, 2012, at 8:55 AM, Ulf Wiger wrote: > > > To begin with, your example won't compile, but the question is still valid. > > Consider this program: > > ================= > -module(foldtest). > -export([f1/2, f2/2]). > > f1(Acc, Lst) -> > F = fun(A,B) -> my_function(A,B) end, > lists:foldl(F, Acc, Lst). > > f2(Acc, Lst) -> > lists:foldl(fun my_function/2, Acc, Lst). > > my_function(X, Acc) -> > [X|Acc]. > ================= > > I believe this illustrates the question, but compiles and runs correctly. > > Eshell V5.9 (abort with ^G) > 1> foldtest:f1([], [1,2,3]). > [3,2,1] > 2> foldtest:f2([], [1,2,3]). > [3,2,1] > > Now, let's compile the code with `erlc -S foldtest.erl` (generating ASM > code): > > {function, f1, 2, 2}. > {label,1}. > {line,[{location,"foldtest.erl",4}]}. > {func_info,{atom,foldtest},{atom,f1},2}. > {label,2}. > {allocate,2,2}. > {move,{x,1},{y,0}}. > {move,{x,0},{y,1}}. > {make_fun2,{f,14},0,0,0}. > {move,{y,0},{x,2}}. > {move,{y,1},{x,1}}. > {line,[{location,"foldtest.erl",6}]}. > {call_ext_last,3,{extfunc,lists,foldl,3},2}. > > > {function, f2, 2, 4}. > {label,3}. > {line,[{location,"foldtest.erl",9}]}. > {func_info,{atom,foldtest},{atom,f2},2}. > {label,4}. > {allocate,2,2}. > {move,{x,1},{y,0}}. > {move,{x,0},{y,1}}. > {make_fun2,{f,12},0,0,0}. > {move,{y,0},{x,2}}. > {move,{y,1},{x,1}}. > {line,[{location,"foldtest.erl",10}]}. > {call_ext_last,3,{extfunc,lists,foldl,3},2}. > > As you can tell, the two alternatives generate identical code. > > The fun is compiled into a regular function, albeit with a funny name, and > calling it carries the same cost as calling a hand-written function. > Actually instantiating a fun context carries a slight overhead depending on > the number of variables that need to be imported into the context (in this > case, zero). There will be one level of indirection in both cases. > > BR, > Ulf W > > On 23 Sep 2012, at 02:07, James Rosenblum wrote: > > Is there an appreciable difference in these two ways of passing a function? > > F = fun(A,B) -> my_function(A,B) end. > lists:map(F, Lst) > > vs. > > -export([my_function/2]). > > lists:map(fun my_function/2, Lst) > > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From ok@REDACTED Sun Sep 23 23:56:32 2012 From: ok@REDACTED (Richard O'Keefe) Date: Mon, 24 Sep 2012 09:56:32 +1200 Subject: [erlang-questions] Efficiency is passing a functin In-Reply-To: <1348358830.31087.YahooMailNeo@web181201.mail.ne1.yahoo.com> References: <1348358830.31087.YahooMailNeo@web181201.mail.ne1.yahoo.com> Message-ID: On 23/09/2012, at 12:07 PM, James Rosenblum wrote: > Is there an appreciable difference in these two ways of passing a function? > > F = fun(A,B) -> my_function(A,B) end. > lists:map(F, Lst) > > vs > > -export([my_function/2]). > > lists:map(fun my_function/2, Lst) The two are not precisely semantically equivalent. - The second one exposes a function to external use; you should generally expose nothing that you don't mean to retain. + The second one will work nicely if you hot-reload the module. But there are two questions I have to ask: (1) Why not write [my_function(X) || X <- Lst] and get a direct local call to my_function without exporting anything extra? (2) Why not *measure* the three versions and see whether the difference is of any practical significance in the context of everything else going on in the real program? From rickard@REDACTED Mon Sep 24 01:34:45 2012 From: rickard@REDACTED (Rickard Green) Date: Mon, 24 Sep 2012 01:34:45 +0200 Subject: [erlang-questions] Relationship between erlang:memory/1, ets:info/2 and erlang:process_info/2 In-Reply-To: <505C9AED.5030005@rabbitmq.com> References: <505C9AED.5030005@rabbitmq.com> Message-ID: On Sep 21, 2012, at 6:50 PM, Simon MacMullen wrote: > I'm trying to write something that will account for memory use on a RabbitMQ system. To do this I'm trying to match up the numbers I get out of erlang:memory(ets) and ets:info(T, memory), and erlang:memory(processes) and erlang:process_info/2. > > And it doesn't make a huge amount of sense to me. I don't expect things to match up perfectly, of course there will be some memory unaccounted for, but the ETS numbers in particular can be quite off: > > 1> erlang:memory(ets). > 2120291872 > > 2> lists:sum([ets:info(T, memory) || T <- ets:all()]) * erlang:system_info(wordsize). > 1874292776 > > So I have ~2GB of ETS memory, and ~230MB unaccounted for. Should I expect these to match up closer? > The main structure of an ets table is erroneously accounted for twice in the erlang:memory(ets) case. :-( > And then... > > 3> erlang:memory(processes). > 1519425156 > > 4> lists:sum([element(2, process_info(P, memory)) || P <- processes()]). > 1552852008 > > So for processes there is less in total than if you add them all up. Is some memory shared? (Are we counting binaries and atoms in there as well?) > This can happen when there are a lot of outstanding messages. > Is there a way to get this sort of information in a more consistent manner? > The ets case above will be fixed. In the process case I haven't decided what to do, yet, but something will be done. erlang:memory/[0,1] use a very different (and cheaper) strategy than ets:info() and process_info(). The results will more or less always differ, and should since there are memory allocated that isn't for any specific process or ets-table in the erlang:memory() case. If you want to know memory used for all processes or all ets-tables use erlang:memory(). Much cheaper (both from the callers perspective, and especially from an overall performance perspective), as well as generally a more true value. Summing up results of process_info(), or ets:info() will, of course, not give you a consistent snapshot of the memory usage at one point in time. Note that the same is true in the erlang:memory() case. The result is the sum of memory usage in different allocator instances that have been read at different (but close) points in time. Regards, Rickard Green, Erlang/OTP, Ericsson AB > Cheers, Simon > > -- > Simon MacMullen > RabbitMQ, VMware > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From rickard@REDACTED Mon Sep 24 01:40:14 2012 From: rickard@REDACTED (Rickard Green) Date: Mon, 24 Sep 2012 01:40:14 +0200 Subject: [erlang-questions] Relationship between erlang:memory/1, ets:info/2 and erlang:process_info/2 In-Reply-To: References: <505C9AED.5030005@rabbitmq.com> Message-ID: <1FDAE9A1-F7D2-4459-8D4E-DB8E0A822826@erlang.org> erlang:memory() and 'top' reports information about two different things. erlang:memory() reports the amount of memory that the runtime system has dynamically requested from the erts internal memory allocators. Memory allocators will satisfy these request by placing memory blocks in larger memory areas which we call carriers. There will both be memory used for allocator internal data structures as well as free unused memory in these carriers which is not accounted for by erlang:memory(), and shouldn't be accounted for by erlang:memory(). 'top' reports all memory mapped by the emulator process. This includes the carriers used by the erts internal memory allocators, but also statically allocated memory, code of the emulator, etc... When the emulator has grown large, memory carriers will normally (but not necessarily always) make up the major part of the memory reported by 'top' and other similar tools. I've attached a module, called memory, that can be used in order to sum up the sizes of all used carriers. The memory allocators may however keep unused carriers a while in order to try to reuse them. These unused carriers are not accounted for by the memory-module. Also note that this is a sum of sub results acquired at different (but close) points in time. It should be possible to use the memory-module on R10B and upwards. Note that it is more or less untested. I've only smoke tested it on R15B02. Regards, Rickard Green, Erlang/OTP, Ericsson AB. On Sep 22, 2012, at 10:18 AM, Anton Lebedevich wrote: > There could be even more inconsistensies between memory consumed by > erlang vm and statistics reported by memory(). > > top output > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND > 15863 root 20 0 721m 559m 3316 S 0 14.1 3:47.58 beam.smp > > (node@REDACTED)1> memory(). > [{total,103534784}, > {processes,18226104}, > {processes_used,14971560}, > {system,85308680}, > {atom,2247985}, > {atom_used,2227049}, > {binary,33598272}, > {code,25217445}, > {ets,1857024}] > > Total in memory() output is about 100Mb but real memory usage of > erlang vm (R14B04) is ~600Mb > > On Fri, Sep 21, 2012 at 8:50 PM, Simon MacMullen wrote: >> I'm trying to write something that will account for memory use on a RabbitMQ >> system. To do this I'm trying to match up the numbers I get out of >> erlang:memory(ets) and ets:info(T, memory), and erlang:memory(processes) and >> erlang:process_info/2. >> >> And it doesn't make a huge amount of sense to me. I don't expect things to >> match up perfectly, of course there will be some memory unaccounted for, but >> the ETS numbers in particular can be quite off: >> >> 1> erlang:memory(ets). >> 2120291872 >> >> 2> lists:sum([ets:info(T, memory) || T <- ets:all()]) * >> erlang:system_info(wordsize). >> 1874292776 >> >> So I have ~2GB of ETS memory, and ~230MB unaccounted for. Should I expect >> these to match up closer? >> >> And then... >> >> 3> erlang:memory(processes). >> 1519425156 >> >> 4> lists:sum([element(2, process_info(P, memory)) || P <- processes()]). >> 1552852008 >> >> So for processes there is less in total than if you add them all up. Is some >> memory shared? (Are we counting binaries and atoms in there as well?) >> >> Is there a way to get this sort of information in a more consistent manner? >> >> Cheers, Simon >> >> -- >> Simon MacMullen >> RabbitMQ, VMware >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- A non-text attachment was scrubbed... Name: memory.erl Type: application/octet-stream Size: 2151 bytes Desc: not available URL: -------------- next part -------------- From rickard@REDACTED Mon Sep 24 02:13:36 2012 From: rickard@REDACTED (Rickard Green) Date: Mon, 24 Sep 2012 02:13:36 +0200 Subject: [erlang-questions] Relationship between erlang:memory/1, ets:info/2 and erlang:process_info/2 In-Reply-To: <1FDAE9A1-F7D2-4459-8D4E-DB8E0A822826@erlang.org> References: <505C9AED.5030005@rabbitmq.com> <1FDAE9A1-F7D2-4459-8D4E-DB8E0A822826@erlang.org> Message-ID: <8B286C64-E5B9-4187-ADA5-72C8DF5C740D@erlang.org> Untested code often do not work... This case was no different. I got a bug report almost immediately. Thanks Richard O'Keefe! I've attached a new version that hopefully will work on R12 too, but I haven't tested it, so... Regards, Rickard Green, Erlang/OTP, Ericsson AB On Sep 24, 2012, at 1:40 AM, Rickard Green wrote: > erlang:memory() and 'top' reports information about two different things. > > erlang:memory() reports the amount of memory that the runtime system has dynamically requested from the erts internal memory allocators. Memory allocators will satisfy these request by placing memory blocks in larger memory areas which we call carriers. There will both be memory used for allocator internal data structures as well as free unused memory in these carriers which is not accounted for by erlang:memory(), and shouldn't be accounted for by erlang:memory(). > > 'top' reports all memory mapped by the emulator process. This includes the carriers used by the erts internal memory allocators, but also statically allocated memory, code of the emulator, etc... > > When the emulator has grown large, memory carriers will normally (but not necessarily always) make up the major part of the memory reported by 'top' and other similar tools. I've attached a module, called memory, that can be used in order to sum up the sizes of all used carriers. The memory allocators may however keep unused carriers a while in order to try to reuse them. These unused carriers are not accounted for by the memory-module. Also note that this is a sum of sub results acquired at different (but close) points in time. > > It should be possible to use the memory-module on R10B and upwards. Note that it is more or less untested. I've only smoke tested it on R15B02. > > Regards, > Rickard Green, Erlang/OTP, Ericsson AB. > > On Sep 22, 2012, at 10:18 AM, Anton Lebedevich wrote: > >> There could be even more inconsistensies between memory consumed by >> erlang vm and statistics reported by memory(). >> >> top output >> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND >> 15863 root 20 0 721m 559m 3316 S 0 14.1 3:47.58 beam.smp >> >> (node@REDACTED)1> memory(). >> [{total,103534784}, >> {processes,18226104}, >> {processes_used,14971560}, >> {system,85308680}, >> {atom,2247985}, >> {atom_used,2227049}, >> {binary,33598272}, >> {code,25217445}, >> {ets,1857024}] >> >> Total in memory() output is about 100Mb but real memory usage of >> erlang vm (R14B04) is ~600Mb >> >> On Fri, Sep 21, 2012 at 8:50 PM, Simon MacMullen wrote: >>> I'm trying to write something that will account for memory use on a RabbitMQ >>> system. To do this I'm trying to match up the numbers I get out of >>> erlang:memory(ets) and ets:info(T, memory), and erlang:memory(processes) and >>> erlang:process_info/2. >>> >>> And it doesn't make a huge amount of sense to me. I don't expect things to >>> match up perfectly, of course there will be some memory unaccounted for, but >>> the ETS numbers in particular can be quite off: >>> >>> 1> erlang:memory(ets). >>> 2120291872 >>> >>> 2> lists:sum([ets:info(T, memory) || T <- ets:all()]) * >>> erlang:system_info(wordsize). >>> 1874292776 >>> >>> So I have ~2GB of ETS memory, and ~230MB unaccounted for. Should I expect >>> these to match up closer? >>> >>> And then... >>> >>> 3> erlang:memory(processes). >>> 1519425156 >>> >>> 4> lists:sum([element(2, process_info(P, memory)) || P <- processes()]). >>> 1552852008 >>> >>> So for processes there is less in total than if you add them all up. Is some >>> memory shared? (Are we counting binaries and atoms in there as well?) >>> >>> Is there a way to get this sort of information in a more consistent manner? >>> >>> Cheers, Simon >>> >>> -- >>> Simon MacMullen >>> RabbitMQ, VMware >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- A non-text attachment was scrubbed... Name: memory.erl Type: application/octet-stream Size: 2290 bytes Desc: not available URL: From roberto@REDACTED Mon Sep 24 03:01:46 2012 From: roberto@REDACTED (Roberto Ostinelli) Date: Sun, 23 Sep 2012 18:01:46 -0700 Subject: [erlang-questions] CT take a long time to warm up Message-ID: Hi all, a very simple CT test takes forever to boot. %%%%%% Module %%%%%%%%% -module(mymodule). -export([greetings/1]). greetings(Text) -> lists:flatten(io_lib:format("~s world!", [Text])). %%%%%%%%%%%%%%%%%%%%%%% %%%%%% CT test %%%%%%%% -module(mymodule_SUITE). -include_lib("common_test/include/ct.hrl"). -export([all/0]). -export([greetings_test/1]). all() -> [greetings_test]. greetings_test(_Config) -> "hello world!" = mymodule:greetings("hello"), "goodbye world!" = mymodule:greetings("goodbye"). %%%%%%%%%%%%%%%%%%%%%%% Here's the log: ================== === Suite started at 2012-09-23 17:22:24 === Starting test, 1 test cases =cases 1 =user roberto =host robertos-MacBook-Pro.local =hosts robertos-MacBook-Pro.local =emulator_vsn 5.9.1 =emulator beam =otp_release R15B01 =started 2012-09-23 17:22:*24* =case ct_framework:init_per_suite =logfile ct_framework.init_per_suite.html =group_props [{suite,mymodule_SUITE}] =started 2012-09-23 17:22:*44* =ended 2012-09-23 17:22:44 =result ok =elapsed 1.0e-6 =case mymodule_SUITE:greetings_test =logfile mymodule_suite.greetings_test.html =started 2012-09-23 17:22:44 =ended 2012-09-23 17:22:44 =result ok =elapsed 3.1e-4 =case ct_framework:end_per_suite =logfile ct_framework.end_per_suite.html =group_props [{suite,mymodule_SUITE}] =started 2012-09-23 17:22:44 =ended 2012-09-23 17:22:44 =result ok =elapsed 1.0e-6 =group_time 0.054s === TEST COMPLETE, 1 ok, 0 failed of 1 test cases =finished 2012-09-23 17:22:44 =failed 0 =successful 1 =user_skipped 0 =auto_skipped 0 ================== it literally takes 20 seconds before the first (and only) test is run. Any ideas why? Thank you, r. -------------- next part -------------- An HTML attachment was scrubbed... URL: From norton@REDACTED Mon Sep 24 03:45:36 2012 From: norton@REDACTED (Joseph Wayne Norton) Date: Mon, 24 Sep 2012 10:45:36 +0900 Subject: [erlang-questions] Erlang application packaging In-Reply-To: <1348149133.7702.20.camel@malo.local> References: <1348149133.7702.20.camel@malo.local> Message-ID: <5E4E1D42-69FE-4C94-99E3-3607A98924B3@lovely.email.ne.jp> Jean - Hello. I have been experimenting with a recipe to build, to package, to install and to boot an Erlang system. This recipe is based on Basho's rebar tool and Ulf Wiger's setup tool. I made a few modifications to the setup tool and to erts's systool make library that allow one to package, to install, and to boot easily from a single escript archive. Keep in mind this is a work in progress. If you are interested, please try the recipe out. If you have any questions, please contact me directly via e-mail. thanks, Joe Norton norton@REDACTED https://github.com/norton/setup-pkg = Setup Package This repository contains a prototype recipe for building an Erlang package and installation using rebar, setup, and make. Gproc is the Erlang application choosen for this recipe. The recipe below builds, packages, installs, and boots an interactive Erlang system. To understand this recipe, please check the following items: - Makefile - check compile, package, and boot targets - rebar.config - rebar's configuration file - rel/gprocpkg.config - setup_gen's configuration file used by systool make - src/setup_pkg.erl - escript wrapper over setup_gen == Quick Start Recipe To download, build, and boot the gproc package and installation in one shot, please follow this recipe: ------ $ mkdir working-directory-name $ cd working-directory-name $ git clone https://github.com/norton/setup-pkg.git setup-pkg $ cd setup-pkg $ ./rebar get-deps $ make clean $ make compile $ make boot ------ On Sep 20, 2012, at 10:52 PM, Jean Parpaillon wrote: > Hi all, > I'm Jean Parpaillon, new erlang enthusiast and (soon) programmer. On 7 > past years, I've workedon distributed systems, specially in HPC and > cloud computing. I'm trying to develop an XMPP agent for system > management, written in Erlang. This is the introduction, now the > question :) > What is your preferred packaging/deployment system for erlang ? I have a > code running, from erlang shell, and want it to become a real world > application the user can install from an archive and launch from its > shell, eventually with some parameters. > > I've read about systools, and how to generated .app, .appup, .rel, .boot > and so on. This looks fine but a lot to do by hand. When it comes to > update a file, and release the whole stuff, one have to modify plenty of > others. Or am I wrong ? > I've looked to existing applications or 'helloworld's: some of them > using autotools (ejabberd, ...), a lot of others using rebar, sometime a > little a bit of both, iirc. > rebar has a lot of magic, which makes debugging hard. > autotools is not well designed for erlang, but putting some existing m4 > files here and there seems to fit. At least, I know autotools well. I > know how can I generate .app, .rel and so on with autotools, but I don't > know what to put in it :/ > At the end, for launching the application, I've seen many projects not > using .boot files, but a shell script with tons of arguments to erl... > > I'm a little bit confused :( Any help ? > > Best regards, > -- > Jean Parpaillon > Open Source Consultant > Phone: +33 6 30 10 92 86 > im: jean.parpaillon@REDACTED > skype: jean.parpaillon > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From Sergey_Zhemzhitsky@REDACTED Mon Sep 24 08:15:24 2012 From: Sergey_Zhemzhitsky@REDACTED (Zhemzhitsky Sergey) Date: Mon, 24 Sep 2012 06:15:24 +0000 Subject: [erlang-questions] Large scale deployments testing In-Reply-To: <505D1B29.7020603@gmail.com> References: <06139A918ACCA041BF46A0F36940C7FA4FE44CA9@exch-mbx1.msk.trd.ru> <505D1B29.7020603@gmail.com> Message-ID: <06139A918ACCA041BF46A0F36940C7FA4FE453EC@exch-mbx1.msk.trd.ru> Hi guys, Thanks for the information and links! Best Regards, Sergey Zhemzhitsky Phone. +7 495 2580500 ext. 1246 From: Michael Truog [mailto:mjtruog@REDACTED] Sent: Saturday, September 22, 2012 5:58 AM To: Joel Meyer; Zhemzhitsky Sergey Cc: riak-users@REDACTED; erlang-questions Subject: Re: [erlang-questions] Large scale deployments testing On 09/21/2012 03:00 PM, Joel Meyer wrote: Hi Sergey, We (OpenX) have a riak_core based application that's running on a 125 node cluster (there are also other smaller clusters). We never really tested to see where it would fall over (and the cluster was much smaller when it started), but I see no indicators that it will fall over when we add the 126th node. FWIW, it's running riak_core 0.13.0, and I assume the newer versions of riak_core have only gotten better. Answers to some of your other questions (based solely on my experience) in-line below. The riak list mentioned optimism about riak clusters of 200+ nodes in a thread here: http://riak-users.197444.n3.nabble.com/does-Riak-cluster-maintain-fully-connected-Erlang-network-td3695942.html However, as mentioned in the thread, a fully connected network of nodes (fully connected because of the usage of distributed Erlang) does have a natural limit (due to the network speed) on scalability with the net tick time. You can always increase the net tick time, but then failures will take longer to detect. So, your success may rely on your fault-tolerance requirements. _______________________________________________________ The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. If you need assistance please contact our Contact Center (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp -------------- next part -------------- An HTML attachment was scrubbed... URL: From jean.parpaillon@REDACTED Mon Sep 24 09:14:24 2012 From: jean.parpaillon@REDACTED (Jean Parpaillon) Date: Mon, 24 Sep 2012 09:14:24 +0200 Subject: [erlang-questions] Erlang application packaging In-Reply-To: <5E4E1D42-69FE-4C94-99E3-3607A98924B3@lovely.email.ne.jp> References: <1348149133.7702.20.camel@malo.local> <5E4E1D42-69FE-4C94-99E3-3607A98924B3@lovely.email.ne.jp> Message-ID: <1348470864.10152.45.camel@malo.local> Hi, Thank you very much. For the moment, I fixed my application: I followed a rebar tutorial and forgot to rename a file, which was the cause of the error at boot ( product_app.erl -> product.erl). So for the moment, I can develop and quickly launch the app to test, which was step 0 :) Once I will enter the step for really delpoying, I will have a look at your script. Regards, Jean Le lundi 24 septembre 2012 ? 10:45 +0900, Joseph Wayne Norton a ?crit : > Jean - > > Hello. > > I have been experimenting with a recipe to build, to package, to install and to boot an Erlang system. This recipe is based on Basho's rebar tool and Ulf Wiger's setup tool. I made a few modifications to the setup tool and to erts's systool make library that allow one to package, to install, and to boot easily from a single escript archive. > > Keep in mind this is a work in progress. If you are interested, please try the recipe out. If you have any questions, please contact me directly via e-mail. > > thanks, > > Joe Norton > > norton@REDACTED > > > > > > https://github.com/norton/setup-pkg > > = Setup Package > > This repository contains a prototype recipe for building an Erlang package > and installation using rebar, setup, and make. Gproc is the > Erlang application choosen for this recipe. > > The recipe below builds, packages, installs, and boots an interactive Erlang > system. To understand this recipe, please check the following items: > > - Makefile - check compile, package, and boot targets > - rebar.config - rebar's configuration file > - rel/gprocpkg.config - setup_gen's configuration file used by systool make > - src/setup_pkg.erl - escript wrapper over setup_gen > > == Quick Start Recipe > > To download, build, and boot the gproc package and installation in one > shot, please follow this recipe: > > ------ > $ mkdir working-directory-name > > $ cd working-directory-name > > $ git clone https://github.com/norton/setup-pkg.git setup-pkg > > $ cd setup-pkg > > $ ./rebar get-deps > > $ make clean > > $ make compile > > $ make boot > ------ > > > > > On Sep 20, 2012, at 10:52 PM, Jean Parpaillon wrote: > > > Hi all, > > I'm Jean Parpaillon, new erlang enthusiast and (soon) programmer. On 7 > > past years, I've workedon distributed systems, specially in HPC and > > cloud computing. I'm trying to develop an XMPP agent for system > > management, written in Erlang. This is the introduction, now the > > question :) > > What is your preferred packaging/deployment system for erlang ? I have a > > code running, from erlang shell, and want it to become a real world > > application the user can install from an archive and launch from its > > shell, eventually with some parameters. > > > > I've read about systools, and how to generated .app, .appup, .rel, .boot > > and so on. This looks fine but a lot to do by hand. When it comes to > > update a file, and release the whole stuff, one have to modify plenty of > > others. Or am I wrong ? > > I've looked to existing applications or 'helloworld's: some of them > > using autotools (ejabberd, ...), a lot of others using rebar, sometime a > > little a bit of both, iirc. > > rebar has a lot of magic, which makes debugging hard. > > autotools is not well designed for erlang, but putting some existing m4 > > files here and there seems to fit. At least, I know autotools well. I > > know how can I generate .app, .rel and so on with autotools, but I don't > > know what to put in it :/ > > At the end, for launching the application, I've seen many projects not > > using .boot files, but a shell script with tons of arguments to erl... > > > > I'm a little bit confused :( Any help ? > > > > Best regards, > > -- > > Jean Parpaillon > > Open Source Consultant > > Phone: +33 6 30 10 92 86 > > im: jean.parpaillon@REDACTED > > skype: jean.parpaillon > > linkedin: http://www.linkedin.com/in/jeanparpaillon/en > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > -- Jean Parpaillon Open Source Consultant Phone: +33 6 30 10 92 86 im: jean.parpaillon@REDACTED skype: jean.parpaillon linkedin: http://www.linkedin.com/in/jeanparpaillon/en -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From watson.timothy@REDACTED Mon Sep 24 10:38:45 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Mon, 24 Sep 2012 09:38:45 +0100 Subject: [erlang-questions] CT take a long time to warm up In-Reply-To: References: Message-ID: <51E69ECE-7A83-4A91-9F2B-DB6EC47668F3@gmail.com> I find common test very slow to start as well, so I'd be interested to find out why. Have you tried running this via ct:run_test/1 with profiling turned on? On 24 Sep 2012, at 02:01, Roberto Ostinelli wrote: > Hi all, > > a very simple CT test takes forever to boot. > > > %%%%%% Module %%%%%%%%% > > -module(mymodule). > -export([greetings/1]). > > greetings(Text) -> > lists:flatten(io_lib:format("~s world!", [Text])). > > %%%%%%%%%%%%%%%%%%%%%%% > > > %%%%%% CT test %%%%%%%% > > -module(mymodule_SUITE). > -include_lib("common_test/include/ct.hrl"). > -export([all/0]). > -export([greetings_test/1]). > > all() -> > [greetings_test]. > > greetings_test(_Config) -> > "hello world!" = mymodule:greetings("hello"), > "goodbye world!" = mymodule:greetings("goodbye"). > > %%%%%%%%%%%%%%%%%%%%%%% > > > Here's the log: > > ================== > === Suite started at 2012-09-23 17:22:24 > === Starting test, 1 test cases > =cases 1 > =user roberto > =host robertos-MacBook-Pro.local > =hosts robertos-MacBook-Pro.local > =emulator_vsn 5.9.1 > =emulator beam > =otp_release R15B01 > =started 2012-09-23 17:22:24 > =case ct_framework:init_per_suite > =logfile ct_framework.init_per_suite.html > =group_props [{suite,mymodule_SUITE}] > =started 2012-09-23 17:22:44 > =ended 2012-09-23 17:22:44 > =result ok > =elapsed 1.0e-6 > =case mymodule_SUITE:greetings_test > =logfile mymodule_suite.greetings_test.html > =started 2012-09-23 17:22:44 > =ended 2012-09-23 17:22:44 > =result ok > =elapsed 3.1e-4 > =case ct_framework:end_per_suite > =logfile ct_framework.end_per_suite.html > =group_props [{suite,mymodule_SUITE}] > =started 2012-09-23 17:22:44 > =ended 2012-09-23 17:22:44 > =result ok > =elapsed 1.0e-6 > =group_time 0.054s > === TEST COMPLETE, 1 ok, 0 failed of 1 test cases > > =finished 2012-09-23 17:22:44 > =failed 0 > =successful 1 > =user_skipped 0 > =auto_skipped 0 > ================== > > it literally takes 20 seconds before the first (and only) test is run. Any ideas why? > > Thank you, > > r. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon@REDACTED Mon Sep 24 11:54:22 2012 From: simon@REDACTED (Simon MacMullen) Date: Mon, 24 Sep 2012 10:54:22 +0100 Subject: [erlang-questions] Relationship between erlang:memory/1, ets:info/2 and erlang:process_info/2 In-Reply-To: References: <505C9AED.5030005@rabbitmq.com> Message-ID: <50602DCE.1020007@rabbitmq.com> On 24/09/12 00:34, Rickard Green wrote: > The main structure of an ets table is erroneously accounted for > twice in the erlang:memory(ets) case. :-( Ah. Well, that certainly explains a lot :-) >> And then... >> >> 3> erlang:memory(processes). 1519425156 >> >> 4> lists:sum([element(2, process_info(P, memory)) || P<- >> processes()]). 1552852008 >> >> So for processes there is less in total than if you add them all >> up. Is some memory shared? (Are we counting binaries and atoms in >> there as well?) >> > > This can happen when there are a lot of outstanding messages. Not that I'm anything like as bothered about this case but for the record my system was near-idle when I invoked those... > The ets case above will be fixed. That's cool, that was my main worry. Thank you. > In the process case I haven't decided what to do, yet, but something > will be done. It's not too much of a bother for me, I just wanted to understand what was going on. > erlang:memory/[0,1] use a very different (and cheaper) strategy than > ets:info() and process_info(). The results will more or less always > differ, and should since there are memory allocated that isn't for > any specific process or ets-table in the erlang:memory() case. Oh, sure. I am not trying to get things to add up precisely, but to let my users get a plausible idea of what the biggest blocks of memory are. I'm only concerned when the discrepancies are hundreds of megabytes. Cheers, Simon -- Simon MacMullen RabbitMQ, VMware From barys_ilyushonak@REDACTED Mon Sep 24 13:27:00 2012 From: barys_ilyushonak@REDACTED (Ilyushonak Barys) Date: Mon, 24 Sep 2012 11:27:00 +0000 Subject: [erlang-questions] Supervisor maximum restart frequency under high load Message-ID: Hi, erlangers! I am kindly ask you to help me clarify the way I see the Erlang design pattern for the following issue. I have the server Erlang process called A, and many similar client processes, called B. The A process has two states ? ?ok? and ?recovery?. While it ?ok? ? client can use the A API and do the stuff. While the A at the ?recovery? the clients got the error and be restarted by the application supervisor. The my problem starts while I have a lot of B processes and ?recovery? state of A takes time. The supervisor of B got the ?Maximum Restart Frequency? and fails. While I am using application supervisor it brings me to restart my OTP application. What the best way to fix it? Use the separate supervisor for the B? Should I handle the reply from the A in ?recovery? state manually (what about fail early and often)? Best Regards, Barys Ilyushonak _______________________________________________________ The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. If you need assistance please contact our Contact Center (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Mon Sep 24 14:45:43 2012 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 24 Sep 2012 14:45:43 +0200 Subject: [erlang-questions] Supervisor maximum restart frequency under high load In-Reply-To: References: Message-ID: <265B98CC-CF59-4E26-ADCF-9156D08F4A4A@erlang-solutions.com> On Sep 24, 2012, at 1:27 PM, Ilyushonak Barys wrote: > I am kindly ask you to help me clarify the way I see the Erlang design pattern for the following issue. > I have the server Erlang process called A, and many similar client processes, called B. The A process has two states ? ?ok? and ?recovery?. While it ?ok? ? client can use the A API and do the stuff. While the A at the ?recovery? the clients got the error and be restarted by the application supervisor. > The my problem starts while I have a lot of B processes and ?recovery? state of A takes time. The supervisor of B got the ?Maximum Restart Frequency? and fails. > While I am using application supervisor it brings me to restart my OTP application. > > What the best way to fix it? Use the separate supervisor for the B? Should I handle the reply from the A in ?recovery? state manually (what about fail early and often)? In this case you should handle it, I think. You have an expected behaviour here, where A may say "in recovery". When A is recovering, the B processes act in a specific way. They may close down - but do so with a 'normal' exit and make them transient in the supervisor so it doesn't make the supervisor crash due to the maximum restart frequency. The key point about failing early and often is that you have a behaviour which is unexpected in the system. In the unexpected case, you have no way of knowing how to recover the process, so you are only able to crash and let restarts of the system handle the errornous case. But if the behaviour is expected, then you can choose to handle it explicitly. Say I have a tcp connection. These may fail in spectacular ways. I could just make the system crash whenever such a failure happens in the beginning when I am developing the program. Basically, I've only implemented the "good happy path" through the program. Then you see crashes in the crash-log and you can begin handling each of these crashes by closing down the socket and exiting gracefully, reconnecting and so on. The idea is that you had a deliberately underspecified system until you realize what kinds of errors are common. And then you can handle those to shut up your crash log. This is important going forward in order to be able to detect real errors in the log from errors which are benign. Jesper Louis Andersen Erlang Solutions Ltd., Copenhagen From barys_ilyushonak@REDACTED Mon Sep 24 15:38:16 2012 From: barys_ilyushonak@REDACTED (Ilyushonak Barys) Date: Mon, 24 Sep 2012 13:38:16 +0000 Subject: [erlang-questions] Supervisor maximum restart frequency under high load In-Reply-To: <265B98CC-CF59-4E26-ADCF-9156D08F4A4A@erlang-solutions.com> References: <265B98CC-CF59-4E26-ADCF-9156D08F4A4A@erlang-solutions.com> Message-ID: Thank you very much! The information you shared gives me strength to go further. -----Original Message----- From: Jesper Louis Andersen [mailto:jesper.louis.andersen@REDACTED] Sent: Monday, September 24, 2012 4:52 PM To: Ilyushonak Barys Cc: Erlang Questions Subject: Re: [erlang-questions] Supervisor maximum restart frequency under high load On Sep 24, 2012, at 1:27 PM, Ilyushonak Barys wrote: > I am kindly ask you to help me clarify the way I see the Erlang design pattern for the following issue. > I have the server Erlang process called A, and many similar client processes, called B. The A process has two states ? ?ok? and ?recovery?. While it ?ok? ? client can use the A API and do the stuff. While the A at the ?recovery? the clients got the error and be restarted by the application supervisor. > The my problem starts while I have a lot of B processes and ?recovery? state of A takes time. The supervisor of B got the ?Maximum Restart Frequency? and fails. > While I am using application supervisor it brings me to restart my OTP application. > > What the best way to fix it? Use the separate supervisor for the B? Should I handle the reply from the A in ?recovery? state manually (what about fail early and often)? In this case you should handle it, I think. You have an expected behaviour here, where A may say "in recovery". When A is recovering, the B processes act in a specific way. They may close down - but do so with a 'normal' exit and make them transient in the supervisor so it doesn't make the supervisor crash due to the maximum restart frequency. The key point about failing early and often is that you have a behaviour which is unexpected in the system. In the unexpected case, you have no way of knowing how to recover the process, so you are only able to crash and let restarts of the system handle the errornous case. But if the behaviour is expected, then you can choose to handle it explicitly. Say I have a tcp connection. These may fail in spectacular ways. I could just make the system crash whenever such a failure happens in the beginning when I am developing the program. Basically, I've only implemented the "good happy path" through the program. Then you see crashes in the crash-log and you can begin handling each of these crashes by closing down the socket and exiting gracefully, reconnecting and so on. The idea is that you had a deliberately underspecified system until you realize what kinds of errors are common. And then you can handle those to shut up your crash log. This is important going forward in order to be able to detect real errors in the log from errors which are benign. Jesper Louis Andersen Erlang Solutions Ltd., Copenhagen _______________________________________________________ The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. If you need assistance please contact our Contact Center (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp From max.lapshin@REDACTED Mon Sep 24 15:47:37 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 24 Sep 2012 17:47:37 +0400 Subject: [erlang-questions] SublimErl: how to lower amount of code completion? Message-ID: Code completion in SublimErl have some problems: it almost doesn't complete with local variable names, but offers me a lot of code from corba. Is it possible to setup it so, that local names are first and disable some folders for completion strings. I hope I will never ever do anything with corba again, so I don't need this completion =) From mattevans123@REDACTED Mon Sep 24 17:54:30 2012 From: mattevans123@REDACTED (Matthew Evans) Date: Mon, 24 Sep 2012 11:54:30 -0400 Subject: [erlang-questions] Application naming question Message-ID: Hi, I have an application (let's call it dev_mon) that is responsible for listening to, processing and emitting events on a hardware interface. This application contains 3 supervisors and many registered gen_server processes. Currently we have a single interface that requires supervision. Future hardware revisions will expose multiple interfaces that requires dev_mon to monitor. Obviously I can handle this in the code, however I believe a better solution would be to have multiple instances of dev_mon for each interface. In this case I would have application dev_mon_if1, dev_mon_if2, dev_mon_if3 etc. The only way I can think of to implement this is to write 3 separate application files (in their own directories) along with their associated Erlang app files. For example: dev_mon_if1/ebin/dev_mon_if1.erldev_mon_if1/ebin/dev_mon_if1.app dev_mon_if2/ebin/dev_mon_if2.erldev_mon_if2/ebin/dev_mon_if2.app dev_mon_if/ebin/..all the other beam files shared between all instances.. The ".app" file would contain an env property that ensures the registered supervisors and gen_servers are unique (e.g. if1, if2 etc). i.e. not do: start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). Instead to: start_link(RegName) -> gen_server:start_link({local, RegName}, ?MODULE, [], []). Where RegName is an atom like 'if1_monitorapp'. Question: Is there a better way to do this? Thanks Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From moxford@REDACTED Mon Sep 24 19:35:11 2012 From: moxford@REDACTED (Mike Oxford) Date: Mon, 24 Sep 2012 10:35:11 -0700 Subject: [erlang-questions] Application naming question In-Reply-To: References: Message-ID: You may consider writing a "generic" monitor, and then interface-specific callback handlers. eg, dev_mon and then you tell it "if1_event1 call handle_event_if1_event1" In this case you separate out the "handling logic" from the "monitoring logic." You will need to maintain multiple sets of handlers (one per interface) but then you're not duplicating the routing/monitoring parts. Also, and I've done this, is to have a "default handler" and all messages which don't match the specific handler get shunted to the default handler. eg, event received -> lookup/match to specific handler -> route to if1_handler -> no_match -> route to default_handler -> drop on floor/throw error/whatever for a no-match condition. This works well for putting in "global catchall handlers" and also works for "overriding handlers." (eg, if1_handler -> subclass_handler -> class_handler -> default_handler) -mox On Mon, Sep 24, 2012 at 8:54 AM, Matthew Evans wrote: > Hi, > > I have an application (let's call it dev_mon) that is responsible for > listening to, processing and emitting events on a hardware interface. This > application contains 3 supervisors and many registered gen_server > processes. Currently we have a single interface that requires supervision. > > Future hardware revisions will expose multiple interfaces that requires > dev_mon to monitor. Obviously I can handle this in the code, however I > believe a better solution would be to have multiple instances of dev_mon > for each interface. > > In this case I would have application dev_mon_if1, dev_mon_if2, > dev_mon_if3 etc. > > The only way I can think of to implement this is to write 3 separate > application files (in their own directories) along with their associated > Erlang app files. For example: > > dev_mon_if1/ebin/dev_mon_if1.erl > dev_mon_if1/ebin/dev_mon_if1.app > > dev_mon_if2/ebin/dev_mon_if2.erl > dev_mon_if2/ebin/dev_mon_if2.app > > dev_mon_if/ebin/..all the other beam files shared between all instances.. > > The ".app" file would contain an env property that ensures the registered > supervisors and gen_servers are unique (e.g. if1, if2 etc). > > i.e. not do: > > start_link() -> > > gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). > > > Instead to: > > > start_link(RegName) -> > > gen_server:start_link({local, RegName}, ?MODULE, [], []). > > > Where RegName is an atom like 'if1_monitorapp'. > > > Question: Is there a better way to do this? > > > Thanks > > > Matt > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tmr@REDACTED Mon Sep 24 23:58:18 2012 From: tmr@REDACTED (Tomas Morstein) Date: Mon, 24 Sep 2012 23:58:18 +0200 (CEST) Subject: [erlang-questions] [ANN] EGTM: embedded ACID compliant NoSQL engine for Erlang In-Reply-To: <8daf5b64-a52a-4e7b-9951-480ea3ca4010@googlegroups.com> Message-ID: Hi, there are several points: - IDEA EGTM depends on FIS GT.M which is under AGPLv3 for Linux/x86, Linux/x64, OpenVMS/Alpha and Tru64. GT.M is available for more platforms, but under commercial conditions directly from FIS; - IDEA EGTM is free (AGPLv3) and should work against all the GT.M versions on all the platforms where both Erlang and GT.M is available. - there is no commercial license for EGTM base. Only support and some non-public extensions are available on commercial contract basis; - we wanted to make licensing more permissive (for example, Evan Miller, author of ChicagoBoss, recommended us to go with MIT), but it seems to be pointless since the GT.M itself is under AGPLv3 in the best (= the most open) case (Linux) - EGTM is not only Erlang code, it's mixture of Erlang, C and M[UMPS]. So finally, you don't need to acquire any license neither from FIS nor from IDEA if you're on Linux/x86 or Linux/x64. That's also reason why there's no price list :-) If you already have a valid commercial license of FIS GT.M for any non-Linux platform, EGTM is still free, but we expect/recommend you to order EGTM support from IDEA too. ...well, that's our default policy. For interesting projects, we are flexible enough to discuss an individual conditions/exceptions. Dne pond?l?, 3. z??? 2012 21:12:19 UTC+2 Greg Burd napsal(a): Given that this project is AGPLv3 I assume that this is a dual-license commercial option product, correct? If so, does someone need to acquire a license from you and from the copyright holders of GT.M or do you have some commercial agreement with them? Where is the price list? Just curious given the prevalence of ASLv2 licensing for Erlang code, AGPLv3 is a highly infectious license. @gregburd On Thursday, August 23, 2012, Tomas Morstein wrote:
Dear Erlang community, It's finally here! We've just released first public version of IDEA EGTM. EGTM is an Erlang application built on the top of FIS GT.M engine what is a complete implementation of M[UMPS] technology. The main characteristics of M[UMPS] is that it is both language and database, so one can directly access persistent multidimensional arrays from M language. Main benefits of GT.M itself: - it's ANSI/ISO M[UMPS] compatible - fully ACID compliant - it's _very_ fast even if your data layout is not so well optimized - it's small and embedded - it has native replication - it can be distributed across multiple nodes (remote data may be treated as local) - it's mature -- as a heart of PROFILE core-banking system, it is used in hundreds of financial institutions around the world - its Linux version is free Main benefits of EGTM: - inherits all the properties of GT.M - allows Erlang to freely call MUMPS routines and share data with M[UMPS] applications without any limitations - can be used as a data-only storage for Erlang, without a single line of M[UMPS] code, so you don't have to learn M language that may not look so friendly (but in fact, is very simple and powerful!) - EGTM can be deployed on a private secondary GT.M replica instance just to make some data mining (web reporting via ChicagoBoss, for example) without affecting master database - can be used with any Erlang application as well as with ChicagoBoss or any other web framework - through layered software (from IDEA :) ) like IODB, it's possible to map EGTM tree structures to Erlang objects and optionally access them via SQL - IODB is not publicly available yet (coming soon!), but we use it in production and at the moment in conjunction with ChicagoBoss integration module, although the model compiler is ready to be used standalone - another layered software is EGTM HAC what is EGTM HighAvailibility Cluster extension -- the best of HA properties of native GT.M and Erlang distributed properties Even if the performance of any external binding will never be as good as native M code, it should be enough for many applications. If the performance is a primary requirement, it's possible to implement complex tasks with native M and simply call the native routine from EGTM. An example of application that is written in ChicagoBoss framework with pure EGTM (completely without IODB objects) is our website http://www.idea.cz . I am not able to do it immediately, but the source code may be released as a sample CB+EGTM reference project later. Some resources: - EGTM on GitHub: http://github.com/ztmr/egtm - EGTM "homepage": http://labs.idea.cz/egtm - GT.M documentation: http://www.mumps.cz/gtm/ - slides about GT.M: http://www.mumps.cz/gtm/misc/120730-1agtmasnosqldatabase.pdf - introduction to M-based systems for relational people: http://www.fooboo.org/~tmr/gtm/UniversalNoSQL.pdf In meantime of posting this message, there were started several discussions in another Erlang-related groups: - https://groups.google.com/forum/#!forum/chicagoboss - https://www.linkedin.com/groups/EGTM-embedded-ACID-compliant-NoSQL-90878.S.149660834 Enjoy and feel free to ask! Tom _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -- @gregburd Architect, Basho Technologies | http://basho.com | @basho
-------------- next part -------------- An HTML attachment was scrubbed... URL: From tmr@REDACTED Mon Sep 24 23:59:21 2012 From: tmr@REDACTED (Tomas Morstein) Date: Mon, 24 Sep 2012 23:59:21 +0200 (CEST) Subject: [erlang-questions] [ANN] EGTM: embedded ACID compliant NoSQL engine for Erlang In-Reply-To: <84a58bde-53d6-4a1b-a20b-056fe39ea74f@googlegroups.com> Message-ID: Hi Max, Thanks for your interest and sorry for my late reply! Honestly, it's not so easy to compare MUMPS with RDBMS as it's completely different approach even when compared to the rest of NoSQL world... I would really recommend you to take a look on http://www.fooboo.org/~tmr/gtm/UniversalNoSQL.pdf because it is "overview for relational people." M technology is an excellent choice for analytical applications, so if you're going to make a log aggregator and analyzer, you can benefit from hierarchic multidimensional indices as well as from powerful M language that can help you to process large amounts of existing records in speed of light :-) BTW, we have a product that does exactly the same -- it gets tons of log records, index them and the user analytics interface is done with EGTM+ChicagoBoss. Sure, PostgreSQL is great and in field of RDBMS it was always one of my preferred choices, but from some point in time, I prefer to use MUMPS for everything I can :-) The documentation is not so good because it was done quickly just to have something, and is primarily targetted to people with existing MUMPS experience... but if you're happy with it, we're happy too! :-) Best regards, Tom. PS: there's a new GT.M V6.0-000 release worth to check! Dne ?ter?, 4. z??? 2012 9:33:39 UTC+2 Max Bourinov napsal(a): Hi Tomas, Great news indeed. Before I dive into it, could you please tell me: ? What is a main advantages compare to traditional RDBMS? ? For what kind of data it is good? Is it good for keeping log entries or I better use traditional RDBMS (say PostgreSQL)? I am trying to understand how I can use IDEA EGTM in my projects. So far we live with PostgreSQL. It is very good (as we all know), but there are some natural limitations when I use it for Erlang - just because it is general purpose DB. Tomas, could you just gime me some ideas where and how IDEA EGTM will kick the a**? I think IDEA EGTM will perfectly match my needs, because at the very bottom my app. business logic is very similar to what banks do. p.s. I have found all docs and they looks superior. So, I see that IDEA EGTM is pretty well kept software. Best regards, Max On Mon, Sep 3, 2012 at 11:12 PM, Greg Burd < gr...@REDACTED > wrote:
Given that this project is AGPLv3 I assume that this is a dual-license commercial option product, correct? If so, does someone need to acquire a license from you and from the copyright holders of GT.M or do you have some commercial agreement with them? Where is the price list? Just curious given the prevalence of ASLv2 licensing for Erlang code, AGPLv3 is a highly infectious license. @gregburd On Thursday, August 23, 2012, Tomas Morstein wrote:
Dear Erlang community, It's finally here! We've just released first public version of IDEA EGTM. EGTM is an Erlang application built on the top of FIS GT.M engine what is a complete implementation of M[UMPS] technology. The main characteristics of M[UMPS] is that it is both language and database, so one can directly access persistent multidimensional arrays from M language. Main benefits of GT.M itself: - it's ANSI/ISO M[UMPS] compatible - fully ACID compliant - it's _very_ fast even if your data layout is not so well optimized - it's small and embedded - it has native replication - it can be distributed across multiple nodes (remote data may be treated as local) - it's mature -- as a heart of PROFILE core-banking system, it is used in hundreds of financial institutions around the world - its Linux version is free Main benefits of EGTM: - inherits all the properties of GT.M - allows Erlang to freely call MUMPS routines and share data with M[UMPS] applications without any limitations - can be used as a data-only storage for Erlang, without a single line of M[UMPS] code, so you don't have to learn M language that may not look so friendly (but in fact, is very simple and powerful!) - EGTM can be deployed on a private secondary GT.M replica instance just to make some data mining (web reporting via ChicagoBoss, for example) without affecting master database - can be used with any Erlang application as well as with ChicagoBoss or any other web framework - through layered software (from IDEA :) ) like IODB, it's possible to map EGTM tree structures to Erlang objects and optionally access them via SQL - IODB is not publicly available yet (coming soon!), but we use it in production and at the moment in conjunction with ChicagoBoss integration module, although the model compiler is ready to be used standalone - another layered software is EGTM HAC what is EGTM HighAvailibility Cluster extension -- the best of HA properties of native GT.M and Erlang distributed properties Even if the performance of any external binding will never be as good as native M code, it should be enough for many applications. If the performance is a primary requirement, it's possible to implement complex tasks with native M and simply call the native routine from EGTM. An example of application that is written in ChicagoBoss framework with pure EGTM (completely without IODB objects) is our website http://www.idea.cz . I am not able to do it immediately, but the source code may be released as a sample CB+EGTM reference project later. Some resources: - EGTM on GitHub: http://github.com/ztmr/egtm - EGTM "homepage": http://labs.idea.cz/egtm - GT.M documentation: http://www.mumps.cz/gtm/ - slides about GT.M: http://www.mumps.cz/gtm/misc/120730-1agtmasnosqldatabase.pdf - introduction to M-based systems for relational people: http://www.fooboo.org/~tmr/gtm/UniversalNoSQL.pdf In meantime of posting this message, there were started several discussions in another Erlang-related groups: - https://groups.google.com/forum/#!forum/chicagoboss - https://www.linkedin.com/groups/EGTM-embedded-ACID-compliant-NoSQL-90878.S.149660834 Enjoy and feel free to ask! Tom _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -- @gregburd Architect, Basho Technologies | http://basho.com | @basho _______________________________________________ erlang-questions mailing list erlang-q...@REDACTED http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part -------------- An HTML attachment was scrubbed... URL: From per@REDACTED Tue Sep 25 00:30:31 2012 From: per@REDACTED (Per Hedeland) Date: Tue, 25 Sep 2012 00:30:31 +0200 (CEST) Subject: [erlang-questions] code:which/1 return value Message-ID: <201209242230.q8OMUVXF012492@pluto.hedeland.org> This is a bug, right? Erlang R15B02 (erts-5.9.2) [source] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.9.2 (abort with ^G) 1> code:which(test). "./test.beam" <<<<<<<<<<<< 2> l(test). {module,test} 3> code:which(test). "/home/per/erl/test.beam" At least the documentation says "If the module is not loaded, this function searches the code path for the first file which contains object code for Module and returns the _absolute file name_." With the code path cache enabled, it's "almost" right: 1> code:rehash(). ok 2> code:which(test). "/home/per/erl/./test.beam" (That *is* an "absolute file name", but I think it's a reasonable expectation that it should agree with what filename:absname/1 would produce.) --Per Hedeland From roberto@REDACTED Tue Sep 25 05:52:31 2012 From: roberto@REDACTED (Roberto Ostinelli) Date: Mon, 24 Sep 2012 20:52:31 -0700 Subject: [erlang-questions] SublimErl: how to lower amount of code completion? In-Reply-To: References: Message-ID: On Mon, Sep 24, 2012 at 6:47 AM, Max Lapshin wrote: > Code completion in SublimErl have some problems: > it almost doesn't complete with local variable names, but offers me a > lot of code from corba. > Is it possible to setup it so, that local names are first and disable > some folders for completion strings. > I hope I will never ever do anything with corba again, so I don't need > this completion =) https://github.com/ostinelli/SublimErl/commit/b388f39b54231a712675b2c116949f1e9627bde3 as per the 'problems', please open an issue for any you might encounter, specifying exactly what you are referring to, how to reproduce them, and the intended behavior. may i suggest this list might not be the most appropriate for these questions ^^_ cheers, r. -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto@REDACTED Tue Sep 25 06:00:00 2012 From: roberto@REDACTED (Roberto Ostinelli) Date: Mon, 24 Sep 2012 21:00:00 -0700 Subject: [erlang-questions] prettypr and spec Message-ID: I have this code: %%%%%%%%%%%%%%%%%%%%%%%% -module(mymodule). -export([hello/0, goodbye/0, greetings/1]). -spec hello() -> string(). hello() -> greetings("hello"). -spec goodbye() -> string(). goodbye() -> greetings("goodbye"). -spec greetings(Text::string()) -> string(). greetings(Text) -> lists:flatten(io_lib:format("~s sublimerl", [Text])). -ifdef(TEST). -include_lib("eunit/include/eunit.hrl"). simple_test() -> ?assertEqual("hey sublimerl", greetings("hey")). greetings_test_() -> [?_assertEqual("hey sublimerl", greetings("hey"))]. -endif. %%%%%%%%%%%%%%%%%%%%%%%% when i convert it using this: %%%%%%%%%%%%%%%%%%%%%%%% Formatted = case epp_dodger:parse_file(FilePath) of {ok, Forms} -> case lists:keymember(error, 1, Forms) of false -> erl_prettypr:format(erl_recomment:recomment_forms(Forms, erl_comment_scan:file(FilePath))); true -> "" end; {error, _} -> "" end %%%%%%%%%%%%%%%%%%%%%%%% I get: %%%%%%%%%%%%%%%%%%%%%%%% -module(mymodule). -export([hello/0, goodbye/0, greetings/1]). -spec({{hello, 0}, [{type, 4, 'fun', [{type, 4, product, []}, {type, 4, string, []}]}]}). hello() -> greetings("hello"). -spec({{goodbye, 0}, [{type, 8, 'fun', [{type, 8, product, []}, {type, 8, string, []}]}]}). goodbye() -> greetings("goodbye"). -spec({{greetings, 1}, [{type, 12, 'fun', [{type, 12, product, [{ann_type, 12, [{var, 12, 'Text'}, {type, 12, string, []}]}]}, {type, 12, string, []}]}]}). greetings(Text) -> lists:flatten(io_lib:format("~s sublimerl", [Text])). -ifdef(TEST). -include_lib("eunit/include/eunit.hrl"). simple_test() -> ?assertEqual("hey sublimerl", (greetings("hey"))). greetings_test_() -> [?_assertEqual("hey sublimerl", (greetings("hey")))]. -endif. %%%%%%%%%%%%%%%%%%%%%%%% What happens to spec? What is the best way to use an erlang auto-formatter? Any input welcome. r. -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Tue Sep 25 10:26:21 2012 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 25 Sep 2012 10:26:21 +0200 Subject: [erlang-questions] prettypr and spec In-Reply-To: References: Message-ID: <34D3216B-34FC-44B0-83B1-4A69E2F7B39C@gmail.com> Though it doesn't support erl_syntax trees, erl_pp does support pretty-printing of specs and types. Regards, -- Anthony Ramine Le 25 sept. 2012 ? 06:00, Roberto Ostinelli a ?crit : > What happens to spec? What is the best way to use an erlang auto-formatter? > > Any input welcome. From ulf@REDACTED Tue Sep 25 10:34:15 2012 From: ulf@REDACTED (Ulf Wiger) Date: Tue, 25 Sep 2012 10:34:15 +0200 Subject: [erlang-questions] prettypr and spec In-Reply-To: References: Message-ID: <4D3E348D-70E1-4E00-97CB-1ED2F7D98E04@feuerlabs.com> Roberto, It appears as if erl_pp:form/1 does a much better job of formatting specs, but then, of course, you lose the comments. There is also an issue with typed record fields, which seems to affect erl_prettypr as well. It simply removes the types from record declarations. Take a look at parse_trans_pp:beam/1. It makes no effort to preserve comments (naturally, since it doesn't expect to find any), but handles specs and typed records correctly. https://github.com/uwiger/parse_trans/blob/master/src/parse_trans_pp.erl#L71 This module, BTW, is also made to be used as an escript, and I have the following convenient alias: alias pp='escript /Users/uwiger/git/parse_trans/ebin/parse_trans_pp.beam' Not that the last point was particularly relevant to your particular problem. :) BR, Ulf W On 25 Sep 2012, at 06:00, Roberto Ostinelli wrote: > I have this code: > > %%%%%%%%%%%%%%%%%%%%%%%% > -module(mymodule). > -export([hello/0, goodbye/0, greetings/1]). > > -spec hello() -> string(). > hello() -> > greetings("hello"). > > -spec goodbye() -> string(). > goodbye() -> > greetings("goodbye"). > > -spec greetings(Text::string()) -> string(). > greetings(Text) -> > lists:flatten(io_lib:format("~s sublimerl", [Text])). > > -ifdef(TEST). > -include_lib("eunit/include/eunit.hrl"). > > simple_test() -> > ?assertEqual("hey sublimerl", greetings("hey")). > > greetings_test_() -> > [?_assertEqual("hey sublimerl", greetings("hey"))]. > > -endif. > %%%%%%%%%%%%%%%%%%%%%%%% > > > when i convert it using this: > > > %%%%%%%%%%%%%%%%%%%%%%%% > Formatted = case epp_dodger:parse_file(FilePath) of > {ok, Forms} -> > case lists:keymember(error, 1, Forms) of > false -> > erl_prettypr:format(erl_recomment:recomment_forms(Forms, erl_comment_scan:file(FilePath))); > true -> > "" > end; > {error, _} -> > "" > end > %%%%%%%%%%%%%%%%%%%%%%%% > > > I get: > > %%%%%%%%%%%%%%%%%%%%%%%% > -module(mymodule). > > -export([hello/0, goodbye/0, greetings/1]). > > -spec({{hello, 0}, > [{type, 4, 'fun', > [{type, 4, product, []}, {type, 4, string, []}]}]}). > > hello() -> greetings("hello"). > > -spec({{goodbye, 0}, > [{type, 8, 'fun', > [{type, 8, product, []}, {type, 8, string, []}]}]}). > > goodbye() -> greetings("goodbye"). > > -spec({{greetings, 1}, > [{type, 12, 'fun', > [{type, 12, product, > [{ann_type, 12, > [{var, 12, 'Text'}, {type, 12, string, []}]}]}, > {type, 12, string, []}]}]}). > > greetings(Text) -> > lists:flatten(io_lib:format("~s sublimerl", [Text])). > > -ifdef(TEST). > > -include_lib("eunit/include/eunit.hrl"). > > simple_test() -> > ?assertEqual("hey sublimerl", (greetings("hey"))). > > greetings_test_() -> > [?_assertEqual("hey sublimerl", (greetings("hey")))]. > > -endif. > %%%%%%%%%%%%%%%%%%%%%%%% > > > What happens to spec? What is the best way to use an erlang auto-formatter? > > Any input welcome. > > r. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From klacke@REDACTED Tue Sep 25 18:19:59 2012 From: klacke@REDACTED (Claes Wikstrom) Date: Tue, 25 Sep 2012 18:19:59 +0200 Subject: [erlang-questions] RPC module and erlang:group_leader/0/2 usage In-Reply-To: <119009DE-E628-42EB-8FAA-83643AF7C205@gmail.com> References: <119009DE-E628-42EB-8FAA-83643AF7C205@gmail.com> Message-ID: <5061D9AF.4020500@hyber.org> On 9/11/12 10:47 AM, Zabrane Mickael wrote: > Hi guys, > > I'm digging a bit inside the "rpc.erl" module. > > I found calls to "group_leader/0/2" almost everywhere (rpc:call, rpc:cast, rpc:eval_everywhere etc). > > What's the purpose of using "group_leader" in this module? > Thanks in advance. It'll make io:formats show up on the calling node /klacke From roberto@REDACTED Tue Sep 25 18:25:15 2012 From: roberto@REDACTED (Roberto Ostinelli) Date: Tue, 25 Sep 2012 09:25:15 -0700 Subject: [erlang-questions] prettypr and spec In-Reply-To: <4D3E348D-70E1-4E00-97CB-1ED2F7D98E04@feuerlabs.com> References: <4D3E348D-70E1-4E00-97CB-1ED2F7D98E04@feuerlabs.com> Message-ID: Thank you Anthony, Ulf, I'll definitely look into that. I just felt curious when I saw -spec({{greetings, 1}, [{type, 12, 'fun', [{type, 12, product, [{ann_type, 12, [{var, 12, 'Text'}, {type, 12, string, []}]}]}, {type, 12, string, []}]}]}). hem... ^^_ r. On Tue, Sep 25, 2012 at 1:34 AM, Ulf Wiger wrote: > > Roberto, > > It appears as if erl_pp:form/1 does a much better job of formatting specs, > but then, of course, you lose the comments. > > There is also an issue with typed record fields, which seems to affect > erl_prettypr as well. It simply removes the types from record declarations. > > Take a look at parse_trans_pp:beam/1. It makes no effort to preserve > comments > (naturally, since it doesn't expect to find any), but handles specs and > typed > records correctly. > > > https://github.com/uwiger/parse_trans/blob/master/src/parse_trans_pp.erl#L71 > > This module, BTW, is also made to be used as an escript, and I have the > following convenient alias: > > alias pp='escript /Users/uwiger/git/parse_trans/ebin/parse_trans_pp.beam' > > Not that the last point was particularly relevant to your particular > problem. :) > > BR, > Ulf W > > On 25 Sep 2012, at 06:00, Roberto Ostinelli wrote: > > I have this code: > > %%%%%%%%%%%%%%%%%%%%%%%% > -module(mymodule). > -export([hello/0, goodbye/0, greetings/1]). > > -spec hello() -> string(). > hello() -> > greetings("hello"). > > -spec goodbye() -> string(). > goodbye() -> > greetings("goodbye"). > > -spec greetings(Text::string()) -> string(). > greetings(Text) -> > lists:flatten(io_lib:format("~s sublimerl", [Text])). > > -ifdef(TEST). > -include_lib("eunit/include/eunit.hrl"). > > simple_test() -> > ?assertEqual("hey sublimerl", greetings("hey")). > > greetings_test_() -> > [?_assertEqual("hey sublimerl", greetings("hey"))]. > > -endif. > %%%%%%%%%%%%%%%%%%%%%%%% > > > when i convert it using this: > > > %%%%%%%%%%%%%%%%%%%%%%%% > Formatted = case epp_dodger:parse_file(FilePath) of > {ok, Forms} -> > case lists:keymember(error, 1, Forms) of > false -> > erl_prettypr:format(erl_recomment:recomment_forms(Forms, > erl_comment_scan:file(FilePath))); > true -> > "" > end; > {error, _} -> > "" > end > %%%%%%%%%%%%%%%%%%%%%%%% > > > I get: > > %%%%%%%%%%%%%%%%%%%%%%%% > -module(mymodule). > > -export([hello/0, goodbye/0, greetings/1]). > > -spec({{hello, 0}, > [{type, 4, 'fun', > [{type, 4, product, []}, {type, 4, string, []}]}]}). > > hello() -> greetings("hello"). > > -spec({{goodbye, 0}, > [{type, 8, 'fun', > [{type, 8, product, []}, {type, 8, string, []}]}]}). > > goodbye() -> greetings("goodbye"). > > -spec({{greetings, 1}, > [{type, 12, 'fun', > [{type, 12, product, > [{ann_type, 12, > [{var, 12, 'Text'}, {type, 12, string, []}]}]}, > {type, 12, string, []}]}]}). > > greetings(Text) -> > lists:flatten(io_lib:format("~s sublimerl", [Text])). > > -ifdef(TEST). > > -include_lib("eunit/include/eunit.hrl"). > > simple_test() -> > ?assertEqual("hey sublimerl", (greetings("hey"))). > > greetings_test_() -> > [?_assertEqual("hey sublimerl", (greetings("hey")))]. > > -endif. > %%%%%%%%%%%%%%%%%%%%%%%% > > > What happens to spec? What is the best way to use an erlang auto-formatter? > > Any input welcome. > > r. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto@REDACTED Tue Sep 25 18:27:30 2012 From: roberto@REDACTED (Roberto Ostinelli) Date: Tue, 25 Sep 2012 09:27:30 -0700 Subject: [erlang-questions] Fishing for best practices: distributed twin processes! In-Reply-To: References: Message-ID: Thank you all for answers. The dying VM will of course not send anything, it's dead. Your node, > however, knows of all the links and monitors its processes has with other > nodes. It will detect that it has lost contact with the other node and and > then send the exit signals and monitor information to its local processes. > This may take some time before it happens. > Robert, could you please clarify what 'some time' may mean? I'm wondering if it's better: - to have all processes linked between nodes, and receive the failover signal (may be thousands of them) - to have a single 'node monitoring' process which will then deal with a node failure Any input welcome :) r. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zabrane3@REDACTED Tue Sep 25 20:02:06 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Tue, 25 Sep 2012 20:02:06 +0200 Subject: [erlang-questions] Unescape HTML text Message-ID: <25CD9E1B-32DE-4EC5-B36F-95069C7F3EB1@gmail.com> Hi huis, I want to convert an HTML escaped text (http://www.w3schools.com/tags/ref_entities.asp) like this one: bourgé Cop to: bourg? Cop Is there any Erlang library for this? Regards, Zabrane -------------- next part -------------- An HTML attachment was scrubbed... URL: From moxford@REDACTED Tue Sep 25 20:05:39 2012 From: moxford@REDACTED (Mike Oxford) Date: Tue, 25 Sep 2012 11:05:39 -0700 Subject: [erlang-questions] Fishing for best practices: distributed twin processes! In-Reply-To: References: Message-ID: "Some time" is the net-tick-time, which defaults to 15 seconds I believe. You can decrease that time by making it smaller (more frequent pings), at the cost of (a potentially much greater) increase in network traffic. The issue surrounds "half closed sockets" which is a general TCP problem and less of an Erlang-specific issue. (eg, it is a problem all networked applications have to deal with, including the upcoming Websockets stuff.) -mox On Tue, Sep 25, 2012 at 9:27 AM, Roberto Ostinelli wrote: > Thank you all for answers. > > > The dying VM will of course not send anything, it's dead. Your node, >> however, knows of all the links and monitors its processes has with other >> nodes. It will detect that it has lost contact with the other node and and >> then send the exit signals and monitor information to its local processes. >> This may take some time before it happens. >> > > Robert, could you please clarify what 'some time' may mean? I'm wondering > if it's better: > > > - to have all processes linked between nodes, and receive the failover > signal (may be thousands of them) > - to have a single 'node monitoring' process which will then deal with > a node failure > > Any input welcome :) > > r. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zabrane3@REDACTED Tue Sep 25 20:48:15 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Tue, 25 Sep 2012 20:48:15 +0200 Subject: [erlang-questions] Unescape HTML text In-Reply-To: <25CD9E1B-32DE-4EC5-B36F-95069C7F3EB1@gmail.com> References: <25CD9E1B-32DE-4EC5-B36F-95069C7F3EB1@gmail.com> Message-ID: answering my own question: unescape(<<>>) -> <<>>; unescape([]) -> <<>>; unescape(L) when is_list(L) -> unescape(list_to_binary(L)); unescape(B) when is_binary(B) -> unescape(B, <<>>). unescape(<<>>, Acc) -> Acc; unescape(<<" ", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"&", T/binary>>, Acc) -> unescape(T, <>); unescape(<<""", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"'", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"'", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"<", T/binary>>, Acc) -> unescape(T, <>); unescape(<<">", T/binary>>, Acc) -> unescape(T, <">>); unescape(<<"€", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"ç", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"à", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"â", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"ä", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"æ", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"è", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"é", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"ê", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"ë", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"î", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"ï", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"ö", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"ù", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"ú", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"û", T/binary>>, Acc) -> unescape(T, <>); unescape(<<"ü", T/binary>>, Acc) -> unescape(T, <>); unescape(<>, Acc) -> unescape(T, <>). Regards, Zabrane On Sep 25, 2012, at 8:02 PM, Zabrane Mickael wrote: > Hi huis, > > I want to convert an HTML escaped text (http://www.w3schools.com/tags/ref_entities.asp) like this one: > > bourgé Cop > > to: > > bourg? Cop > > Is there any Erlang library for this? > > Regards, > Zabrane > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob@REDACTED Tue Sep 25 21:31:37 2012 From: bob@REDACTED (Bob Ippolito) Date: Tue, 25 Sep 2012 12:31:37 -0700 Subject: [erlang-questions] Unescape HTML text In-Reply-To: References: <25CD9E1B-32DE-4EC5-B36F-95069C7F3EB1@gmail.com> Message-ID: That's a subset of possible inputs, you're better off using a library that's a bit more complete. This may be useful: https://github.com/mochi/mochiweb/blob/master/src/mochiweb_charref.erl On Tue, Sep 25, 2012 at 11:48 AM, Zabrane Mickael wrote: > answering my own question: > > unescape(<<>>) -> > <<>>; > unescape([]) -> > <<>>; > unescape(L) when is_list(L) -> > unescape(list_to_binary(L)); > unescape(B) when is_binary(B) -> > unescape(B, <<>>). > > unescape(<<>>, Acc) -> > Acc; > unescape(<<" ", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"&", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<""", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"'", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"'", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"<", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<">", T/binary>>, Acc) -> > unescape(T, <">>); > unescape(<<"€", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ç", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"à", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"â", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ä", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"æ", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"è", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"é", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ê", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ë", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"î", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ï", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ö", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ù", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ú", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"û", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ü", T/binary>>, Acc) -> > unescape(T, <>); > > unescape(<>, Acc) -> > unescape(T, <>). > > > Regards, > Zabrane > > On Sep 25, 2012, at 8:02 PM, Zabrane Mickael wrote: > > Hi huis, > > I want to convert an HTML escaped text ( > http://www.w3schools.com/tags/ref_entities.asp) like this one: > > bourgé Cop > > to: > > bourg? Cop > > Is there any Erlang library for this? > > Regards, > Zabrane > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zabrane3@REDACTED Tue Sep 25 21:33:09 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Tue, 25 Sep 2012 21:33:09 +0200 Subject: [erlang-questions] Unescape HTML text In-Reply-To: References: <25CD9E1B-32DE-4EC5-B36F-95069C7F3EB1@gmail.com> Message-ID: Thanks Bob. Exactly what I needed. Regards, Zabrane On Sep 25, 2012, at 9:31 PM, Bob Ippolito wrote: > That's a subset of possible inputs, you're better off using a library that's a bit more complete. This may be useful: https://github.com/mochi/mochiweb/blob/master/src/mochiweb_charref.erl > > On Tue, Sep 25, 2012 at 11:48 AM, Zabrane Mickael wrote: > answering my own question: > > unescape(<<>>) -> > <<>>; > unescape([]) -> > <<>>; > unescape(L) when is_list(L) -> > unescape(list_to_binary(L)); > unescape(B) when is_binary(B) -> > unescape(B, <<>>). > > unescape(<<>>, Acc) -> > Acc; > unescape(<<" ", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"&", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<""", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"'", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"'", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"<", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<">", T/binary>>, Acc) -> > unescape(T, <">>); > unescape(<<"€", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ç", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"à", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"â", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ä", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"æ", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"è", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"é", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ê", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ë", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"î", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ï", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ö", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ù", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ú", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"û", T/binary>>, Acc) -> > unescape(T, <>); > unescape(<<"ü", T/binary>>, Acc) -> > unescape(T, <>); > > unescape(<>, Acc) -> > unescape(T, <>). > > > Regards, > Zabrane > > On Sep 25, 2012, at 8:02 PM, Zabrane Mickael wrote: > >> Hi huis, >> >> I want to convert an HTML escaped text (http://www.w3schools.com/tags/ref_entities.asp) like this one: >> >> bourgé Cop >> >> to: >> >> bourg? Cop >> >> Is there any Erlang library for this? >> >> Regards, >> Zabrane >> > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto@REDACTED Tue Sep 25 22:31:00 2012 From: roberto@REDACTED (Roberto Ostinelli) Date: Tue, 25 Sep 2012 13:31:00 -0700 Subject: [erlang-questions] prettypr and spec In-Reply-To: <4D3E348D-70E1-4E00-97CB-1ED2F7D98E04@feuerlabs.com> References: <4D3E348D-70E1-4E00-97CB-1ED2F7D98E04@feuerlabs.com> Message-ID: Thank you Ulf, I've looked at this and it reads from .beam files. Same problem as before: as specified I need to parse string() code. Do I really have to write my own erlang indenter? That really seems weird. Isn't there such a thing like a DSL for indenters? On Tue, Sep 25, 2012 at 1:34 AM, Ulf Wiger wrote: > > Roberto, > > It appears as if erl_pp:form/1 does a much better job of formatting specs, > but then, of course, you lose the comments. > > There is also an issue with typed record fields, which seems to affect > erl_prettypr as well. It simply removes the types from record declarations. > > Take a look at parse_trans_pp:beam/1. It makes no effort to preserve > comments > (naturally, since it doesn't expect to find any), but handles specs and > typed > records correctly. > > > https://github.com/uwiger/parse_trans/blob/master/src/parse_trans_pp.erl#L71 > > This module, BTW, is also made to be used as an escript, and I have the > following convenient alias: > > alias pp='escript /Users/uwiger/git/parse_trans/ebin/parse_trans_pp.beam' > > Not that the last point was particularly relevant to your particular > problem. :) > > BR, > Ulf W > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Wed Sep 26 00:48:36 2012 From: ulf@REDACTED (Ulf Wiger) Date: Wed, 26 Sep 2012 00:48:36 +0200 Subject: [erlang-questions] prettypr and spec In-Reply-To: References: <4D3E348D-70E1-4E00-97CB-1ED2F7D98E04@feuerlabs.com> Message-ID: Someone really should fix the bugs in erl_prettypr. BR, Ulf W Ulf Wiger, Feuerlabs, Inc. http://www.feuerlabs.com 25 sep 2012 kl. 22:31 skrev Roberto Ostinelli : > Thank you Ulf, > > I've looked at this and it reads from .beam files. Same problem as before: as specified I need to parse string() code. > > Do I really have to write my own erlang indenter? That really seems weird. Isn't there such a thing like a DSL for indenters? > > > > On Tue, Sep 25, 2012 at 1:34 AM, Ulf Wiger wrote: >> >> Roberto, >> >> It appears as if erl_pp:form/1 does a much better job of formatting specs, >> but then, of course, you lose the comments. >> >> There is also an issue with typed record fields, which seems to affect >> erl_prettypr as well. It simply removes the types from record declarations. >> >> Take a look at parse_trans_pp:beam/1. It makes no effort to preserve comments >> (naturally, since it doesn't expect to find any), but handles specs and typed >> records correctly. >> >> https://github.com/uwiger/parse_trans/blob/master/src/parse_trans_pp.erl#L71 >> >> This module, BTW, is also made to be used as an escript, and I have the >> following convenient alias: >> >> alias pp='escript /Users/uwiger/git/parse_trans/ebin/parse_trans_pp.beam' >> >> Not that the last point was particularly relevant to your particular problem. :) >> >> BR, >> Ulf W > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Wed Sep 26 00:59:08 2012 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 26 Sep 2012 00:59:08 +0200 Subject: [erlang-questions] [ann] hackney 0.3.0 released Message-ID: Hi all, Just a quick mail to announce a new release of hackney, a simple HTTP client. New features and fixes are: - Added Multipart support - AddedHTTP Proxy tunneling support - Fixed Chuncked Response decoding Enjoy, - beno?t From steven.charles.davis@REDACTED Wed Sep 26 01:37:57 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Tue, 25 Sep 2012 18:37:57 -0500 Subject: [erlang-questions] Off Topic : coding font from adobe Message-ID: In case you haven't seen it, Adobe have released a coding font: http://blogs.adobe.com/typblography/2012/09/source-code-pro.html Better, I think (at 11pt), than other great fonts such as Liberation, Bitstream Vera, Consolas, etc. Just an FYI, /s From steven.charles.davis@REDACTED Wed Sep 26 01:41:11 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Tue, 25 Sep 2012 18:41:11 -0500 Subject: [erlang-questions] Off Topic : coding font from adobe In-Reply-To: References: Message-ID: <9FFC3A61-A8D9-4C11-9A2A-DA74483DD31A@gmail.com> Forgot to mention the most astounding thing: it's an "open source" font i.e. free. On Sep 25, 2012, at 6:37 PM, Steve Davis wrote: > In case you haven't seen it, Adobe have released a coding font: > > http://blogs.adobe.com/typblography/2012/09/source-code-pro.html > > Better, I think (at 11pt), than other great fonts such as Liberation, Bitstream Vera, Consolas, etc. > > Just an FYI, > /s From gumm@REDACTED Wed Sep 26 01:41:58 2012 From: gumm@REDACTED (Jesse Gumm) Date: Tue, 25 Sep 2012 18:41:58 -0500 Subject: [erlang-questions] Off Topic : coding font from adobe In-Reply-To: References: Message-ID: It looks pretty good. I'll definitely give it a shot and see if I prefer it over my current font (Mensch) Thanks for the heads up, -Jesse On Tue, Sep 25, 2012 at 6:37 PM, Steve Davis wrote: > In case you haven't seen it, Adobe have released a coding font: > > http://blogs.adobe.com/typblography/2012/09/source-code-pro.html > > Better, I think (at 11pt), than other great fonts such as Liberation, Bitstream Vera, Consolas, etc. > > Just an FYI, > /s > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm From steven.charles.davis@REDACTED Wed Sep 26 02:38:04 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Tue, 25 Sep 2012 19:38:04 -0500 Subject: [erlang-questions] Spec is diabolical IMHO Message-ID: Can someone who knows better explain how this evil child of -spec: %% @doc The gen_server code_change/3 callback, called when performing %% a hot code upgrade on the server. Currently unused. -spec code_change(OldVsn, State, Extra) -> {ok, State} | {error, Reason} when OldVsn :: Vsn | {down, Vsn}, Vsn :: term(), State :: #state{}, Extra :: term(), Reason :: term(). code_change(_OldVsn, State, _Extra) -> {ok, State}. ...is not a total waste of too many talented people's time over the more transparent: code_change(_OldVsn, State = #state{}, _Extra) -> {ok, State}. ...or is spec just a diabolical case of over-engineering that is at once both incredibly onerous and bug-prone justified in the cause of the weaknesses of some ill-designed test tool? My gut reaction is that if you feel that you NEED TO DO TDD style testing, you should take the time parse the source and not bloat it beyond readability by inflicting conventions on the development of the source that will simply distract and so *cause* the bugs you think that you are testing for. A better use of developer time would be to enforce documentation of the intention of the function. /s -------------- next part -------------- An HTML attachment was scrubbed... URL: From liyusheng2@REDACTED Wed Sep 26 04:31:59 2012 From: liyusheng2@REDACTED (LiYusheng) Date: Wed, 26 Sep 2012 10:31:59 +0800 Subject: [erlang-questions] [Ann] Javascript for client and server, in a unified webapp platform. Based on Erlang Cloud infrastructure. Message-ID: Qiyun Webapp platform is now online. You can visit http://qyapp.com/qiyun/website/quickstart-en.html to get an overview of how to use it to build webapp inside the web then directly publish it out. Or you can visit https://qyapp.com to have a try immediately, it is completely free. It includes a WYSIWYG IDE, smart editor, distributed version control, a virtual file system and a Data Platform Support accessible from Javascript code . Behind it is Erlang, almost all of the cloud side components except the db engine, which is c code. We also compile customer's server side Javascript into code that can be run inside Erlang VM, instead of using a javascript engine like V8. We will soon support people directly write Erlang code and run it in our cloud to implement their business logic then user Javascript to build their web UI. I plan to write some technical details about how Erlang is a crucial part of our platform. And I'd like to add acknowledge to the website soon for all wonderful Erlang tools we use, especially Yaws. I look forward to hearing from you. Thank you for your interest. -------------- next part -------------- An HTML attachment was scrubbed... URL: From toby@REDACTED Wed Sep 26 05:03:01 2012 From: toby@REDACTED (Toby Thain) Date: Tue, 25 Sep 2012 23:03:01 -0400 Subject: [erlang-questions] Off Topic : coding font from adobe In-Reply-To: References: Message-ID: <50627065.1090805@telegraphics.com.au> On 25/09/12 7:37 PM, Steve Davis wrote: > In case you haven't seen it, Adobe have released a coding font: > > http://blogs.adobe.com/typblography/2012/09/source-code-pro.html > > Better, I think (at 11pt), than other great fonts such as Liberation, Bitstream Vera, Consolas, etc. > I agree (though I use it at a somewhat larger size on OS X + LCD). Well worth trying out in my opinion. --Toby > Just an FYI, > /s > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From zabrane3@REDACTED Wed Sep 26 08:37:56 2012 From: zabrane3@REDACTED (Zabrane Mickael) Date: Wed, 26 Sep 2012 08:37:56 +0200 Subject: [erlang-questions] [ann] hackney 0.3.0 released In-Reply-To: References: Message-ID: <7B77FAB9-406B-4C4C-B17B-6537B2BCC61C@gmail.com> Congrats Beno?t. Don't forget the link next time ;-) https://github.com/benoitc/hackney Regards, Zabrane On Sep 26, 2012, at 12:59 AM, Benoit Chesneau wrote: > Hi all, > > Just a quick mail to announce a new release of hackney, a simple HTTP > client. New features and fixes are: > > - Added Multipart support > - AddedHTTP Proxy tunneling support > - Fixed Chuncked Response decoding > > Enjoy, > > - beno?t > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Wed Sep 26 09:24:30 2012 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 26 Sep 2012 09:24:30 +0200 Subject: [erlang-questions] [ann] hackney 0.3.0 released In-Reply-To: <7B77FAB9-406B-4C4C-B17B-6537B2BCC61C@gmail.com> References: <7B77FAB9-406B-4C4C-B17B-6537B2BCC61C@gmail.com> Message-ID: Heh. Indeed :) thanks! - beno?t On Wed, Sep 26, 2012 at 8:37 AM, Zabrane Mickael wrote: > Congrats Beno?t. > > Don't forget the link next time ;-) > https://github.com/benoitc/hackney > > Regards, > Zabrane > > > On Sep 26, 2012, at 12:59 AM, Benoit Chesneau wrote: > > Hi all, > > Just a quick mail to announce a new release of hackney, a simple HTTP > client. New features and fixes are: > > - Added Multipart support > - AddedHTTP Proxy tunneling support > - Fixed Chuncked Response decoding > > Enjoy, > > - beno?t > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > From roberto@REDACTED Wed Sep 26 18:14:53 2012 From: roberto@REDACTED (Roberto Ostinelli) Date: Wed, 26 Sep 2012 09:14:53 -0700 Subject: [erlang-questions] CT take a long time to warm up In-Reply-To: <51E69ECE-7A83-4A91-9F2B-DB6EC47668F3@gmail.com> References: <51E69ECE-7A83-4A91-9F2B-DB6EC47668F3@gmail.com> Message-ID: On Mon, Sep 24, 2012 at 1:38 AM, Tim Watson wrote: > I find common test very slow to start as well, so I'd be interested to > find out why. Have you tried running this via ct:run_test/1 with profiling > turned on? > haven't tried that. weird thing, 20 seconds is consistent. it is a fresh install on a mountain lion osx. any pointers? this kinda defeats the purpose of TDD. r. -------------- next part -------------- An HTML attachment was scrubbed... URL: From desired.mta@REDACTED Wed Sep 26 18:40:07 2012 From: desired.mta@REDACTED (Motiejus =?utf-8?Q?Jak=C5=A1tys?=) Date: Wed, 26 Sep 2012 17:40:07 +0100 Subject: [erlang-questions] CT take a long time to warm up In-Reply-To: References: <51E69ECE-7A83-4A91-9F2B-DB6EC47668F3@gmail.com> Message-ID: <20120926163945.GA8916@precise> On Wed, Sep 26, 2012 at 09:14:53AM -0700, Roberto Ostinelli wrote: > On Mon, Sep 24, 2012 at 1:38 AM, Tim Watson wrote: > > > I find common test very slow to start as well, so I'd be interested to > > find out why. Have you tried running this via ct:run_test/1 with profiling > > turned on? > > > > haven't tried that. weird thing, 20 seconds is consistent. > > it is a fresh install on a mountain lion osx. > > any pointers? How do you run it? Consistent 20 seconds sounds like a DNS timeout issue (stab in the dark). Motiejus -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From desired.mta@REDACTED Wed Sep 26 21:44:21 2012 From: desired.mta@REDACTED (=?UTF-8?Q?Motiejus_Jak=C5=A1tys?=) Date: Wed, 26 Sep 2012 20:44:21 +0100 Subject: [erlang-questions] CT take a long time to warm up In-Reply-To: References: <51E69ECE-7A83-4A91-9F2B-DB6EC47668F3@gmail.com> <20120926163945.GA8916@precise> Message-ID: On Wed, Sep 26, 2012 at 8:40 PM, Roberto Ostinelli wrote: >> How do you run it? Consistent 20 seconds sounds like a DNS timeout >> issue (stab in the dark). > > > rebar ct_suites=mymodule Hi, adding the list. Please do $TRACE_F rebar ct_suites=mymodule and replace $TRACE_F with Max OS C equivalent of "strace -f". Then see what it does just before the 20 second pause. -- Motiejus Jak?tys From dmercer@REDACTED Wed Sep 26 22:27:38 2012 From: dmercer@REDACTED (David Mercer) Date: Wed, 26 Sep 2012 15:27:38 -0500 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: Message-ID: <058201cd9c25$6000ca80$20025f80$@gmail.com> Since no-one else stepped into the breach, I?ll make a case. In my view, the ?spec is a contract, which (1) is usually written before the implementation as part of your design; and (2) as such, it serves as documentation regarding your intent and usage. In this case, programmers calling the function should be prepared for both an ok return value and an error. Without the ?spec, the programmer does not know this and may just do a match on {_, State} and then not notice any errors when the function changes. On the other side, when a maintainer comes along later wishing to modify this function, he understands (1) the function?s intent, and (2) how to signal errors. He can make whatever changes he wishes to effect new functionality so long as he obeys that contract. Cheers, DBM From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Steve Davis Sent: Tuesday, September 25, 2012 19:38 To: Erlang-Questions Questions Subject: [erlang-questions] Spec is diabolical IMHO Can someone who knows better explain how this evil child of -spec: %% @doc The gen_server code_change/3 callback, called when performing %% a hot code upgrade on the server. Currently unused. -spec code_change(OldVsn, State, Extra) -> {ok, State} | {error, Reason} when OldVsn :: Vsn | {down, Vsn}, Vsn :: term(), State :: #state{}, Extra :: term(), Reason :: term(). code_change(_OldVsn, State, _Extra) -> {ok, State}. ...is not a total waste of too many talented people's time over the more transparent: code_change(_OldVsn, State = #state{}, _Extra) -> {ok, State}. ...or is spec just a diabolical case of over-engineering that is at once both incredibly onerous and bug-prone justified in the cause of the weaknesses of some ill-designed test tool? My gut reaction is that if you feel that you NEED TO DO TDD style testing, you should take the time parse the source and not bloat it beyond readability by inflicting conventions on the development of the source that will simply distract and so *cause* the bugs you think that you are testing for. A better use of developer time would be to enforce documentation of the intention of the function. /s -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Wed Sep 26 22:38:18 2012 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 26 Sep 2012 22:38:18 +0200 Subject: [erlang-questions] CT take a long time to warm up In-Reply-To: References: <51E69ECE-7A83-4A91-9F2B-DB6EC47668F3@gmail.com> <20120926163945.GA8916@precise> Message-ID: On Wed, Sep 26, 2012 at 9:44 PM, Motiejus Jak?tys wrote: > On Wed, Sep 26, 2012 at 8:40 PM, Roberto Ostinelli wrote: > > > How do you run it? Consistent 20 seconds sounds like a DNS > > > timeout issue (stab in the dark). > > > > > > rebar ct_suites=mymodule > > Hi, > adding the list. > > Please do > > $TRACE_F rebar ct_suites=mymodule Make that $TRACE_F rebar suites=mymodule and also consider running rebar with fprof: $TRACE_F rebar -p suites=mymodule or $TRACE_F rebar --profile suites=mymodule , but make sure you update rebar first to avoid a faulty call to fprof:apply/2. If it's caused by name lookup, you can try a custom ERL_INETRC file: http://www.erlang.org/doc/apps/erts/inet_cfg.html > and replace $TRACE_F with Max OS C equivalent of "strace -f". > Then see what it does just before the 20 second pause. From watson.timothy@REDACTED Wed Sep 26 23:54:55 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Wed, 26 Sep 2012 22:54:55 +0100 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? Message-ID: I'm seeing this happen, and it's most confusing. The program is not launched using nohup/setsid or anything to send it to the background. The arguments passed to open_port/2 are thus: [{args, Args}, {env, Env}, exit_status, hide, stderr_to_stdout, use_stdio, {line, 16384}] The script that is being run essentially does this: # fiddle around with some environment variables, then exec erl \ -pa ${EBIN_ROOT} \ ${START_INSTRUCTION} \ -sname ${NODENAME} \ -boot start_sasl \ ${CONFIG_ARG} \ +W w \ ${SERVER_ERL_ARGS} \ ${LISTEN_ARG} \ "$@" After some tests are run, the port is closed (using close_port). The connected process for the port is a gen_server, so it's *possible* that this exits without cleanly shutting down, but I'm under the impression (from experimentation) that if the connected process dies, the port is closed anyway. Nevertheless, I'm seeing *stuck nodes* that survive the test run and are locked up because some code on the node (which should be dead after the port goes) is stuck in an io:format/2 call which will never return because stdout is not responding - hardly surprising under the circumstances. Can someone explain to me what's going on here? Is this an issue with the exec call, and if so what is the problem with it? I've got a minimal example using exec that doesn't behave like this, so I'm a bit bemused. What's really confusing is that the process the port is used to open should presumably be closed regardless of what some sub-process is doing, and I thought that exec returned the stdout of the subprocess anyway!? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 235 bytes Desc: Message signed with OpenPGP using GPGMail URL: From watson.timothy@REDACTED Wed Sep 26 23:57:12 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Wed, 26 Sep 2012 22:57:12 +0100 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: References: Message-ID: <649F5D7E-428B-48D2-A84D-FE05994F942C@gmail.com> On 26 Sep 2012, at 22:54, Tim Watson wrote: > > Can someone explain to me what's going on here? Is this an issue with the exec call, and if so what is the problem with it? I've got a minimal example using exec that doesn't behave like this, so I'm a bit bemused. What's really confusing is that the process the port is used to open should presumably be closed regardless of what some sub-process is doing, and I thought that exec returned the stdout of the subprocess anyway!? > Oh and I'm under the impression that there's no way for the connected process to block the stdout for the port program right? My reading of the bif is that we end up with erts_open_driver (is that right?) and that io between the port program and emulator will ultimately result in driver_output (or a similar friend) passing messages on to the connected process. Is that correct, and presumably under the smp emulator this is perfectly safe and so on? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 235 bytes Desc: Message signed with OpenPGP using GPGMail URL: From steven.charles.davis@REDACTED Thu Sep 27 01:21:34 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Wed, 26 Sep 2012 18:21:34 -0500 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: <058201cd9c25$6000ca80$20025f80$@gmail.com> References: <058201cd9c25$6000ca80$20025f80$@gmail.com> Message-ID: Hi David, I definitely understand and appreciate that rationale. I would pick a bit at the expectation of coding: {_, State} and not expecting the ignored data to be relevant :). My counter to that would be that if a function was too hard to understand with regard to return values, then the function itself is likely too big and complex -- and counter to any guideline I have seen. Rather than double (or more than double) the size of the code, and make no mistake, -spec IS CODE (although only used by test tools), it may be more effective to devise boundary contracts similar to JA's intention for UBF-C rather than plastering bug-prone "comments" into the raw source. Best regards, /s On Sep 26, 2012, at 3:27 PM, "David Mercer" wrote: > Since no-one else stepped into the breach, I?ll make a case. > > In my view, the ?spec is a contract, which (1) is usually written before the implementation as part of your design; and (2) as such, it serves as documentation regarding your intent and usage. > > In this case, programmers calling the function should be prepared for both an ok return value and an error. Without the ?spec, the programmer does not know this and may just do a match on {_, State} and then not notice any errors when the function changes. On the other side, when a maintainer comes along later wishing to modify this function, he understands (1) the function?s intent, and (2) how to signal errors. He can make whatever changes he wishes to effect new functionality so long as he obeys that contract. > > Cheers, > > DBM > > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Steve Davis > Sent: Tuesday, September 25, 2012 19:38 > To: Erlang-Questions Questions > Subject: [erlang-questions] Spec is diabolical IMHO > > > Can someone who knows better explain how this evil child of -spec: > > %% @doc The gen_server code_change/3 callback, called when performing > %% a hot code upgrade on the server. Currently unused. > -spec code_change(OldVsn, State, Extra) -> {ok, State} | {error, Reason} > when > OldVsn :: Vsn | {down, Vsn}, > Vsn :: term(), > State :: #state{}, > Extra :: term(), > Reason :: term(). > code_change(_OldVsn, State, _Extra) -> {ok, State}. > > ...is not a total waste of too many talented people's time over the more transparent: > > code_change(_OldVsn, State = #state{}, _Extra) -> {ok, State}. > > ...or is spec just a diabolical case of over-engineering that is at once both incredibly onerous and bug-prone justified in the cause of the weaknesses of some ill-designed test tool? > > My gut reaction is that if you feel that you NEED TO DO TDD style testing, you should take the time parse the source and not bloat it beyond readability by inflicting conventions on the development of the source that will simply distract and so *cause* the bugs you think that you are testing for. > > A better use of developer time would be to enforce documentation of the intention of the function. > > > /s > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From steven.charles.davis@REDACTED Thu Sep 27 02:44:52 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Wed, 26 Sep 2012 17:44:52 -0700 (PDT) Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: References: Message-ID: <69a95a29-15a3-4b4c-a217-dffab0dc7ce4@googlegroups.com> I believe I have had a similar issue with attempting to close then unloading a driver. I did not get to the bottom of it. So just left it loaded for that VM. This issue too was under smp. /s On Wednesday, September 26, 2012 4:55:14 PM UTC-5, Tim Watson wrote: > > I'm seeing this happen, and it's most confusing. The program is not > launched using nohup/setsid or anything to send it to the background. The > arguments passed to open_port/2 are thus: > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksoe@REDACTED Thu Sep 27 04:20:44 2012 From: eriksoe@REDACTED (=?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?=) Date: Thu, 27 Sep 2012 04:20:44 +0200 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: References: Message-ID: It is the responsibility of the port program to shut down when stdin reaches EOF. This behaviour/expectation confused me too at some point, but it probably has its merits: not all software is designed for "let it crash", so simply killing the port program might be too crude in some circumstances. Den 26/09/2012 23.55 skrev "Tim Watson" : > I'm seeing this happen, and it's most confusing. The program is not > launched using nohup/setsid or anything to send it to the background. The > arguments passed to open_port/2 are thus: > > [{args, Args}, {env, Env}, exit_status, hide, stderr_to_stdout, use_stdio, > {line, 16384}] > > The script that is being run essentially does this: > > # fiddle around with some environment variables, then > exec erl \ > -pa ${EBIN_ROOT} \ > ${START_INSTRUCTION} \ > -sname ${NODENAME} \ > -boot start_sasl \ > ${CONFIG_ARG} \ > +W w \ > ${SERVER_ERL_ARGS} \ > ${LISTEN_ARG} \ > "$@" > > > After some tests are run, the port is closed (using close_port). The > connected process for the port is a gen_server, so it's *possible* that > this exits without cleanly shutting down, but I'm under the impression > (from experimentation) that if the connected process dies, the port is > closed anyway. Nevertheless, I'm seeing *stuck nodes* that survive the test > run and are locked up because some code on the node (which should be dead > after the port goes) is stuck in an io:format/2 call which will never > return because stdout is not responding - hardly surprising under the > circumstances. > > Can someone explain to me what's going on here? Is this an issue with the > exec call, and if so what is the problem with it? I've got a minimal > example using exec that doesn't behave like this, so I'm a bit bemused. > What's really confusing is that the process the port is used to open should > presumably be closed regardless of what some sub-process is doing, and I > thought that exec returned the stdout of the subprocess anyway!? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Thu Sep 27 10:32:04 2012 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 27 Sep 2012 12:32:04 +0400 Subject: [erlang-questions] Gitty: raw git acces in pure erlang Message-ID: Hi, everyone. I've written simple pure erlang library https://github.com/maxlapshin/gitty that allows reading git repo. It can be used for a website that stores webpages in git backend. This library is a prototype, because it lacks important features such as caching repo index in a process, but it is already faster than forking for a git executable each request. From watson.timothy@REDACTED Thu Sep 27 11:10:15 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Thu, 27 Sep 2012 10:10:15 +0100 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: References: Message-ID: Hi Erik, On 27 Sep 2012, at 03:20, Erik S?e S?rensen wrote: > It is the responsibility of the port program to shut down when stdin reaches EOF. > This behaviour/expectation confused me too at some point, but it probably has its merits: not all software is designed for "let it crash", so simply killing the port program might be too crude in some circumstances. > Well that's fine, but it should be documented a bit more clearly IMHO. Also the port program, in this instance, is another beam emulator, so it's clearly *not* going to behave that way! Currently the connected process for the port has 3 shutdown modes: 1. rpc:call(Node, custom_app, stop, []) 2. close_port(Port) 3. open_port({spawn, "kill -9 " ++ OsPid, Opts) Item 3 is the least preferable as it is not portable (relies on 'kill' being a shell built-in, etc) and requires that the os process id is known. It sounds like (2) is not a workable solution unless the external program is hand written to deal with 'stdin reaches EOF'. This is less than ideal, as it means that open_port/2 is not much use for spawning (and monitoring thereafter) arbitrary programs unless you're willing to live with the fact that you're not able to shut them down by closing the port. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 235 bytes Desc: Message signed with OpenPGP using GPGMail URL: From jesper.louis.andersen@REDACTED Thu Sep 27 11:29:03 2012 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 27 Sep 2012 11:29:03 +0200 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: References: Message-ID: <386854ED-DCB7-4BFC-B586-ABBDCFD917C8@erlang-solutions.com> I remember this was something I had going. Let me dig code: ---- #!/bin/sh (cat && kill 0) | opentracker $* ---- So the trick is that the ? && kill 0 part sends a kill signal to all processes in the current process group. This lets you stop another process since cat(1) understands what happens when stdin is closed and handles it accordingly. I've only used it in tests though so it may need work for real programs Jesper Louis Andersen Erlang Solutions Ltd., Copenhagen On Sep 27, 2012, at 4:20 AM, Erik S?e S?rensen wrote: > It is the responsibility of the port program to shut down when stdin reaches EOF. > This behaviour/expectation confused me too at some point, but it probably has its merits: not all software is designed for "let it crash", so simply killing the port program might be too crude in some circumstances. > > Den 26/09/2012 23.55 skrev "Tim Watson" : > I'm seeing this happen, and it's most confusing. The program is not launched using nohup/setsid or anything to send it to the background. The arguments passed to open_port/2 are thus: > > [{args, Args}, {env, Env}, exit_status, hide, stderr_to_stdout, use_stdio, {line, 16384}] > > The script that is being run essentially does this: > > # fiddle around with some environment variables, then > exec erl \ > -pa ${EBIN_ROOT} \ > ${START_INSTRUCTION} \ > -sname ${NODENAME} \ > -boot start_sasl \ > ${CONFIG_ARG} \ > +W w \ > ${SERVER_ERL_ARGS} \ > ${LISTEN_ARG} \ > "$@" > > > After some tests are run, the port is closed (using close_port). The connected process for the port is a gen_server, so it's *possible* that this exits without cleanly shutting down, but I'm under the impression (from experimentation) that if the connected process dies, the port is closed anyway. Nevertheless, I'm seeing *stuck nodes* that survive the test run and are locked up because some code on the node (which should be dead after the port goes) is stuck in an io:format/2 call which will never return because stdout is not responding - hardly surprising under the circumstances. > > Can someone explain to me what's going on here? Is this an issue with the exec call, and if so what is the problem with it? I've got a minimal example using exec that doesn't behave like this, so I'm a bit bemused. What's really confusing is that the process the port is used to open should presumably be closed regardless of what some sub-process is doing, and I thought that exec returned the stdout of the subprocess anyway!? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From chaos.a.d88@REDACTED Thu Sep 27 12:32:42 2012 From: chaos.a.d88@REDACTED (Anatoly Kanivetskiy) Date: Thu, 27 Sep 2012 03:32:42 -0700 (PDT) Subject: [erlang-questions] Yet another Lua for Erlang library had been written. Meet the 'moon' library! Message-ID: Greetings, Erlangers! If you wanted to incorporate the power of erlang with the simplicity of Lua, but was not satisfied with existing libraries, you can try yet another one! It is written as NIF using C++ and a bit of a boost libraries, and wasn't yet heavily tested. But it should perform faster. In theory. I hope so. :-) It's still more a prototype, than a solid, production-ready library. It lacks some portability (only ubuntu 12.04 was tested). But I have an intention to make it buildable at least on recent versions of Scientific Linux. Also, it depends heavily on boost libraries. The header-only part can be bundled inside, like this repo does: https://github.com/basho/basho_metrics. And the boost thread library, which is definitely an overkill here, can be easily replaced with native enif_(mutex|cond)_* functions. At the moment, i'm happy with having boost as a dependency, but if it annoys you - you can remove it yourself of course :) Or, probably, I'll do it eventually. So, feel free to use/fork/patch/criticize it: https://github.com/chaos-ad/moon -------------- next part -------------- An HTML attachment was scrubbed... URL: From desired.mta@REDACTED Thu Sep 27 12:40:45 2012 From: desired.mta@REDACTED (Motiejus =?utf-8?Q?Jak=C5=A1tys?=) Date: Thu, 27 Sep 2012 11:40:45 +0100 Subject: [erlang-questions] Yet another Lua for Erlang library had been written. Meet the 'moon' library! In-Reply-To: References: Message-ID: <20120927104045.GA11590@precise> On Thu, Sep 27, 2012 at 03:32:42AM -0700, Anatoly Kanivetskiy wrote: > Greetings, Erlangers! > > If you wanted to incorporate the power of erlang with the simplicity of > Lua, but was not satisfied with existing libraries, you can try yet another > one! You did not mention the strongest part of your library: Library for calling Lua from Erlang, and *back*. As far as I know, there is no erlang-lua library which allows communicating from Lua to Erlang. > So, feel free to use/fork/patch/criticize it: > https://github.com/chaos-ad/moon Also, type conversion table in documentation needs some fresh air. :) Good work! Motiejus -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From daniel@REDACTED Thu Sep 27 13:35:26 2012 From: daniel@REDACTED (Daniel Eliasson) Date: Thu, 27 Sep 2012 13:35:26 +0200 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> Message-ID: In my experience, a lot of functions perform tail calls in such a way that it's not immediately clear which types will be returned. Without specs, it's frequently necessary to start following the code many levels deep in a branching tree. Exported functions should have specs; at the very least those intended as an API to other applications should. If I can't look at an API function and very quickly understand i) what type of values I am to pass as arguments, and ii) what type of values I get in return, then I have resort to archeology or empirical studies, both of which are unpleasant. /Daniel On 27 September 2012 01:21, Steve Davis wrote: > Hi David, > > I definitely understand and appreciate that rationale. I would pick a bit at > the expectation of coding: {_, State} and not expecting the ignored data to > be relevant :). > > My counter to that would be that if a function was too hard to understand > with regard to return values, then the function itself is likely too big and > complex -- and counter to any guideline I have seen. > > Rather than double (or more than double) the size of the code, and make no > mistake, -spec IS CODE (although only used by test tools), it may be more > effective to devise boundary contracts similar to JA's intention for UBF-C > rather than plastering bug-prone "comments" into the raw source. > > Best regards, > /s > > > On Sep 26, 2012, at 3:27 PM, "David Mercer" wrote: > > Since no-one else stepped into the breach, I?ll make a case. > > In my view, the ?spec is a contract, which (1) is usually written before the > implementation as part of your design; and (2) as such, it serves as > documentation regarding your intent and usage. > > In this case, programmers calling the function should be prepared for both > an ok return value and an error. Without the ?spec, the programmer does not > know this and may just do a match on {_, State} and then not notice any > errors when the function changes. On the other side, when a maintainer > comes along later wishing to modify this function, he understands (1) the > function?s intent, and (2) how to signal errors. He can make whatever > changes he wishes to effect new functionality so long as he obeys that > contract. > > Cheers, > > DBM > > From: erlang-questions-bounces@REDACTED > [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Steve Davis > Sent: Tuesday, September 25, 2012 19:38 > To: Erlang-Questions Questions > Subject: [erlang-questions] Spec is diabolical IMHO > > > > > Can someone who knows better explain how this evil child of -spec: > > > > %% @doc The gen_server code_change/3 callback, called when performing > > %% a hot code upgrade on the server. Currently unused. > > -spec code_change(OldVsn, State, Extra) -> {ok, State} | {error, Reason} > > when > > OldVsn :: Vsn | {down, Vsn}, > > Vsn :: term(), > > State :: #state{}, > > Extra :: term(), > > Reason :: term(). > > code_change(_OldVsn, State, _Extra) -> {ok, State}. > > > > ...is not a total waste of too many talented people's time over the more > transparent: > > > > code_change(_OldVsn, State = #state{}, _Extra) -> {ok, State}. > > > > ...or is spec just a diabolical case of over-engineering that is at once > both incredibly onerous and bug-prone justified in the cause of the > weaknesses of some ill-designed test tool? > > > > My gut reaction is that if you feel that you NEED TO DO TDD style testing, > you should take the time parse the source and not bloat it beyond > readability by inflicting conventions on the development of the source that > will simply distract and so *cause* the bugs you think that you are testing > for. > > > > A better use of developer time would be to enforce documentation of the > intention of the function. > > > > > > /s > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From eriksoe@REDACTED Thu Sep 27 14:18:30 2012 From: eriksoe@REDACTED (=?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?=) Date: Thu, 27 Sep 2012 14:18:30 +0200 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: <386854ED-DCB7-4BFC-B586-ABBDCFD917C8@erlang-solutions.com> References: <386854ED-DCB7-4BFC-B586-ABBDCFD917C8@erlang-solutions.com> Message-ID: 2012/9/27 Jesper Louis Andersen > I remember this was something I had going. Let me dig code: > > ---- > #!/bin/sh > > (cat && kill 0) | opentracker $* > Nice incantation. I was just about to suggest using a wrapper program, but I probably wouldn't have thought of that variation. > ---- > > So the trick is that the ? && kill 0 part sends a kill signal to all > processes in the current process group. This lets you stop another process > since cat(1) understands what happens when stdin is closed and handles it > accordingly. > > I've only used it in tests though so it may need work for real programs > Such as replacing "&&" with ";" ? :-) Just in case someone came along and killed the cat. (Can't at the moment imagine other scenarios where cat would exit with non-zero return values, but they probably exist.) Also, replace $* with "$@" (including the quotes), for proper handling of parameters with spaces in them and such. /Erik > > Jesper Louis Andersen > Erlang Solutions Ltd., Copenhagen > > > > On Sep 27, 2012, at 4:20 AM, Erik S?e S?rensen wrote: > > > It is the responsibility of the port program to shut down when stdin > reaches EOF. > > This behaviour/expectation confused me too at some point, but it > probably has its merits: not all software is designed for "let it crash", > so simply killing the port program might be too crude in some circumstances. > > > > Den 26/09/2012 23.55 skrev "Tim Watson" : > > I'm seeing this happen, and it's most confusing. The program is not > launched using nohup/setsid or anything to send it to the background. The > arguments passed to open_port/2 are thus: > > > > [{args, Args}, {env, Env}, exit_status, hide, stderr_to_stdout, > use_stdio, {line, 16384}] > > > > The script that is being run essentially does this: > > > > # fiddle around with some environment variables, then > > exec erl \ > > -pa ${EBIN_ROOT} \ > > ${START_INSTRUCTION} \ > > -sname ${NODENAME} \ > > -boot start_sasl \ > > ${CONFIG_ARG} \ > > +W w \ > > ${SERVER_ERL_ARGS} \ > > ${LISTEN_ARG} \ > > "$@" > > > > > > After some tests are run, the port is closed (using close_port). The > connected process for the port is a gen_server, so it's *possible* that > this exits without cleanly shutting down, but I'm under the impression > (from experimentation) that if the connected process dies, the port is > closed anyway. Nevertheless, I'm seeing *stuck nodes* that survive the test > run and are locked up because some code on the node (which should be dead > after the port goes) is stuck in an io:format/2 call which will never > return because stdout is not responding - hardly surprising under the > circumstances. > > > > Can someone explain to me what's going on here? Is this an issue with > the exec call, and if so what is the problem with it? I've got a minimal > example using exec that doesn't behave like this, so I'm a bit bemused. > What's really confusing is that the process the port is used to open should > presumably be closed regardless of what some sub-process is doing, and I > thought that exec returned the stdout of the subprocess anyway!? > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksoe@REDACTED Thu Sep 27 14:37:31 2012 From: eriksoe@REDACTED (=?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?=) Date: Thu, 27 Sep 2012 14:37:31 +0200 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: References: Message-ID: 2012/9/27 Tim Watson > Hi Erik, > > On 27 Sep 2012, at 03:20, Erik S?e S?rensen wrote: > > It is the responsibility of the port program to shut down when stdin > reaches EOF. > This behaviour/expectation confused me too at some point, but it probably > has its merits: not all software is designed for "let it crash", so simply > killing the port program might be too crude in some circumstances. > > Well that's fine, but it should be documented a bit more clearly IMHO. > It's not in the API docs for open_port(), but in the section in the manual which definesports ( http://www.erlang.org/doc/reference_manual/ports.html#id84207) it does say The external program resides in another OS process. By default, it should read from standard input (file descriptor 0) and write to standard output (file descriptor 1). *The external program should terminate when the port is closed.* > Also the port program, in this instance, is another beam emulator, so it's > clearly *not* going to behave that way! > Why not? - see below. > Currently the connected process for the port has 3 shutdown modes: > > 1. rpc:call(Node, custom_app, stop, []) > 2. close_port(Port) > 3. open_port({spawn, "kill -9 " ++ OsPid, Opts) > You could add 4. Ensure that the node runs a reading loop which detects EOF - e.g. using file:read_line(standard_io) or file:read(standard_io, SomeBlockSize). Example for detecting EOF: erl -noshell -eval 'F=fun(G)->X=file:read_line(standard_io), io:format("~p\n", [X]), X==eof orelse G(G) end, F(F), init:stop().' You can even do exactly this in practise: put the loop code on the command line. > > Item 3 is the least preferable as it is not portable (relies on 'kill' > being a shell built-in, etc) and requires that the os process id is known. > It sounds like (2) is not a workable solution unless the external program > is hand written to deal with 'stdin reaches EOF'. This is less than ideal, > as it means that open_port/2 is not much use for spawning (and monitoring > thereafter) arbitrary programs unless you're willing to live with the fact > that you're not able to shut them down by closing the port. > No, the port mechanism was apparently not meant for arbitrary slave programs. However, a little wrapping can often get you far, as Jesper demonstrated earlier. -------------- next part -------------- An HTML attachment was scrubbed... URL: From watson.timothy@REDACTED Thu Sep 27 14:41:21 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Thu, 27 Sep 2012 13:41:21 +0100 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: References: <386854ED-DCB7-4BFC-B586-ABBDCFD917C8@erlang-solutions.com> Message-ID: <19CFFB38-1448-4023-AFD7-AD390BEDB361@gmail.com> Guys, On 27 Sep 2012, at 13:18, Erik S?e S?rensen wrote: > 2012/9/27 Jesper Louis Andersen > I remember this was something I had going. Let me dig code: > > ---- > #!/bin/sh > > (cat && kill 0) | opentracker $* > Nice incantation. I was just about to suggest using a wrapper program, but I probably wouldn't have thought of that variation. > > ---- > > So the trick is that the ? && kill 0 part sends a kill signal to all processes in the current process group. This lets you stop another process since cat(1) understands what happens when stdin is closed and handles it accordingly. > > I've only used it in tests though so it may need work for real programs > Such as replacing "&&" with ";" ? :-) > Just in case someone came along and killed the cat. (Can't at the moment imagine other scenarios where cat would exit with non-zero return values, but they probably exist.) > > Also, replace $* with "$@" (including the quotes), for proper handling of parameters with spaces in them and such. Thanks both of you, I guess that I could drop this in in front of the required invocation, so you get the required behaviour. The tricky part here is that the code calling open_port/2 is kind of a generic 'run a script and monitor things' process, so I'll need to experiment with this a bit. Thanks for the suggestions anyway - I'll certainly give this a try. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 235 bytes Desc: Message signed with OpenPGP using GPGMail URL: From watson.timothy@REDACTED Thu Sep 27 14:50:57 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Thu, 27 Sep 2012 13:50:57 +0100 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: References: Message-ID: <2E1934C6-11D2-4AAE-BA72-8698CE0F9E6D@gmail.com> Hi Erik, On 27 Sep 2012, at 13:37, Erik S?e S?rensen wrote: > 2012/9/27 Tim Watson > Hi Erik, > > On 27 Sep 2012, at 03:20, Erik S?e S?rensen wrote: >> It is the responsibility of the port program to shut down when stdin reaches EOF. >> This behaviour/expectation confused me too at some point, but it probably has its merits: not all software is designed for "let it crash", so simply killing the port program might be too crude in some circumstances. >> > Well that's fine, but it should be documented a bit more clearly IMHO. > > It's not in the API docs for open_port(), but in the section in the manual which definesports (http://www.erlang.org/doc/reference_manual/ports.html#id84207) it does say > The external program resides in another OS process. By default, it should read from standard input (file descriptor 0) and write to standard output (file descriptor 1). The external program should terminate when the port is closed. > Ah yes, I see that now. I should've probably gone through that more carefully. > > Also the port program, in this instance, is another beam emulator, so it's clearly *not* going to behave that way! > Why not? - see below. > You could add > 4. Ensure that the node runs a reading loop which detects EOF - e.g. using file:read_line(standard_io) or file:read(standard_io, SomeBlockSize). > > Example for detecting EOF: > erl -noshell -eval 'F=fun(G)->X=file:read_line(standard_io), io:format("~p\n", [X]), X==eof orelse G(G) end, F(F), init:stop().' > > You can even do exactly this in practise: put the loop code on the command line. > This is excellent - I can actually provide that as a hook that can be set to run on each remote vm that is launched. Presumably this won't over-stress the io subsystem too much? > > Item 3 is the least preferable as it is not portable (relies on 'kill' being a shell built-in, etc) and requires that the os process id is known. It sounds like (2) is not a workable solution unless the external program is hand written to deal with 'stdin reaches EOF'. This is less than ideal, as it means that open_port/2 is not much use for spawning (and monitoring thereafter) arbitrary programs unless you're willing to live with the fact that you're not able to shut them down by closing the port. > > No, the port mechanism was apparently not meant for arbitrary slave programs. However, a little wrapping can often get you far, as Jesper demonstrated earlier. Yes, I'll probably look at both options to see which fits best. I'm actually finding launching and managing the vm via scripts quite cumbersome compared to using the slave module and a dose of rpc, but the primary goal is testing existing code and that code is normally launched and managed mainly via wrapper scripts, so it's probably the right thing to test them in the same way. Thanks again for your input, and I'll try to ponder the documentation a bit more carefully next time. I'm also more aware now of the constraint and will keep it in mind for the future. Cheers! Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 235 bytes Desc: Message signed with OpenPGP using GPGMail URL: From Sergey_Zhemzhitsky@REDACTED Thu Sep 27 18:09:56 2012 From: Sergey_Zhemzhitsky@REDACTED (Zhemzhitsky Sergey) Date: Thu, 27 Sep 2012 16:09:56 +0000 Subject: [erlang-questions] How to define non_neg_float() type specification? Message-ID: <06139A918ACCA041BF46A0F36940C7FA4FE4715D@exch-mbx1.msk.trd.ru> Hello erlangers, Is it possible to define non_neg_float() type specification somehow? Best Regards, Sergey _______________________________________________________ The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. If you need assistance please contact our Contact Center (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp -------------- next part -------------- An HTML attachment was scrubbed... URL: From aronisstav@REDACTED Thu Sep 27 18:32:47 2012 From: aronisstav@REDACTED (Stavros Aronis) Date: Thu, 27 Sep 2012 09:32:47 -0700 (PDT) Subject: [erlang-questions] How to define non_neg_float() type specification? In-Reply-To: <06139A918ACCA041BF46A0F36940C7FA4FE4715D@exch-mbx1.msk.trd.ru> References: <06139A918ACCA041BF46A0F36940C7FA4FE4715D@exch-mbx1.msk.trd.ru> Message-ID: <16fd01e4-7994-45a9-9a2b-9050c67ebe0f@googlegroups.com> Hello! Unfortunately Dialyzer does not support it (even constants are generalized to any float, typwise). Consequentially, the type language does tnot support it. You can maybe try: -type define non_neg_float() :: float(). This will help you documentation-wise and also (though in a somewhat limited way) Dialyzer-wise. If you use this type PropEr-wise however, you will get positive values, which you will need to filter... Stavros On Thursday, September 27, 2012 6:10:14 PM UTC+2, Zhemzhitsky Sergey wrote: > > Hello erlangers, > > > > Is it possible to define non_neg_float() type specification somehow? > > > > Best Regards, > > Sergey > > > > _______________________________________________________ > > > > The information contained in this message may be privileged and conf > idential and protected from disclosure. If you are not the original > intended recipient, you are hereby notified that any review, > retransmission, dissemination, or other use of, or taking of any action in > reliance upon, this information is prohibited. If you have received this > communication in error, please notify the sender immediately by replying to > this message and delete it from your computer. Thank you for your > cooperation. Troika Dialog, Russia. > > If you need assistance please contact our Contact Center (+7495) 258 0500 > or go to www.troika.ru/eng/Contacts/system.wbp > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aronisstav@REDACTED Thu Sep 27 18:47:09 2012 From: aronisstav@REDACTED (Stavros Aronis) Date: Thu, 27 Sep 2012 09:47:09 -0700 (PDT) Subject: [erlang-questions] How to define non_neg_float() type specification? In-Reply-To: <16fd01e4-7994-45a9-9a2b-9050c67ebe0f@googlegroups.com> References: <06139A918ACCA041BF46A0F36940C7FA4FE4715D@exch-mbx1.msk.trd.ru> <16fd01e4-7994-45a9-9a2b-9050c67ebe0f@googlegroups.com> Message-ID: Sorry, that was: -type non_neg_float() :: float(). Stavros On Thursday, September 27, 2012 6:32:47 PM UTC+2, Stavros Aronis wrote: > > Hello! > > Unfortunately Dialyzer does not support it (even constants are generalized > to any float, typwise). Consequentially, the type language does tnot > support it. > You can maybe try: > > -type define non_neg_float() :: float(). > > This will help you documentation-wise and also (though in a somewhat > limited way) Dialyzer-wise. If you use this type PropEr-wise however, you > will get positive values, which you will need to filter... > > Stavros > > On Thursday, September 27, 2012 6:10:14 PM UTC+2, Zhemzhitsky Sergey wrote: >> >> Hello erlangers, >> >> >> >> Is it possible to define non_neg_float() type specification somehow? >> >> >> >> Best Regards, >> >> Sergey >> >> >> >> _______________________________________________________ >> >> >> >> The information contained in this message may be privileged and conf >> idential and protected from disclosure. If you are not the original >> intended recipient, you are hereby notified that any review, >> retransmission, dissemination, or other use of, or taking of any action in >> reliance upon, this information is prohibited. If you have received this >> communication in error, please notify the sender immediately by replying to >> this message and delete it from your computer. Thank you for your >> cooperation. Troika Dialog, Russia. >> >> If you need assistance please contact our Contact Center (+7495) 258 0500 >> or go to www.troika.ru/eng/Contacts/system.wbp >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raould@REDACTED Thu Sep 27 19:29:24 2012 From: raould@REDACTED (Raoul Duke) Date: Thu, 27 Sep 2012 10:29:24 -0700 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> Message-ID: the real technical solution would be for somebody to port the ideas of Typed Racket over to Lisp Flavoured Erlang. :-) From freza@REDACTED Thu Sep 27 20:11:32 2012 From: freza@REDACTED (freza@REDACTED) Date: Thu, 27 Sep 2012 14:11:32 -0400 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> Message-ID: <20120927181132.GC522@circlewave.net> On Thu, Sep 27, 2012 at 10:29:24AM -0700, Raoul Duke wrote: > the real technical solution would be for somebody to port the ideas of > Typed Racket over to Lisp Flavoured Erlang. :-) It would perhaps help to move all typespecs to single section somewhere at the top of source file (this is probably possible even today?), or even better move them to a per-application .sig file that has all the annotations for all modules in that app... (I share the perception that they're distracting when scattered all around the place). Just my 2p. BR, -- Jachym From raould@REDACTED Thu Sep 27 20:34:30 2012 From: raould@REDACTED (Raoul Duke) Date: Thu, 27 Sep 2012 11:34:30 -0700 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: <20120927181132.GC522@circlewave.net> References: <058201cd9c25$6000ca80$20025f80$@gmail.com> <20120927181132.GC522@circlewave.net> Message-ID: On Thu, Sep 27, 2012 at 11:11 AM, wrote: > even better move them to a per-application .sig file that has all the > annotations for all modules in that app... (I share the perception that ah, yes, bring back c/++ style .h files and all their glory! ;-) From freza@REDACTED Thu Sep 27 20:18:44 2012 From: freza@REDACTED (freza@REDACTED) Date: Thu, 27 Sep 2012 14:18:44 -0400 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: <386854ED-DCB7-4BFC-B586-ABBDCFD917C8@erlang-solutions.com> References: <386854ED-DCB7-4BFC-B586-ABBDCFD917C8@erlang-solutions.com> Message-ID: <20120927181844.GD522@circlewave.net> On Thu, Sep 27, 2012 at 11:29:03AM +0200, Jesper Louis Andersen wrote: > I remember this was something I had going. Let me dig code: > > ---- > #!/bin/sh > > (cat && kill 0) | opentracker $* > ---- > > So the trick is that the ? && kill 0 part sends a kill signal to all processes in the current process group. This lets you stop another process since cat(1) understands what happens when stdin is closed and handles it accordingly. > > I've only used it in tests though so it may need work for real programs Haven't been following this thread closely, but it seems erlexec wasn't mentioned yet: http://code.google.com/p/erlexec/ BR, -- Jachym From freza@REDACTED Thu Sep 27 20:24:47 2012 From: freza@REDACTED (freza@REDACTED) Date: Thu, 27 Sep 2012 14:24:47 -0400 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> <20120927181132.GC522@circlewave.net> Message-ID: <20120927182447.GE522@circlewave.net> On Thu, Sep 27, 2012 at 11:34:30AM -0700, Raoul Duke wrote: > On Thu, Sep 27, 2012 at 11:11 AM, wrote: > > even better move them to a per-application .sig file that has all the > > annotations for all modules in that app... (I share the perception that > > ah, yes, bring back c/++ style .h files and all their glory! ;-) And I thought ".sig" would be recognized as obvious reference to Standard ML... :-) BR, -- Jachym From watson.timothy@REDACTED Thu Sep 27 20:47:37 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Thu, 27 Sep 2012 19:47:37 +0100 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: References: <386854ED-DCB7-4BFC-B586-ABBDCFD917C8@erlang-solutions.com> Message-ID: Guys, On 27 Sep 2012, at 13:18, Erik S?e S?rensen wrote: > 2012/9/27 Jesper Louis Andersen > I remember this was something I had going. Let me dig code: > > ---- > #!/bin/sh > > (cat && kill 0) | opentracker $* > Nice incantation. I was just about to suggest using a wrapper program, but I probably wouldn't have thought of that variation. > > ---- > > So the trick is that the ? && kill 0 part sends a kill signal to all processes in the current process group. This lets you stop another process since cat(1) understands what happens when stdin is closed and handles it accordingly. > > I've only used it in tests though so it may need work for real programs > Such as replacing "&&" with ";" ? :-) > Just in case someone came along and killed the cat. (Can't at the moment imagine other scenarios where cat would exit with non-zero return values, but they probably exist.) > > Also, replace $* with "$@" (including the quotes), for proper handling of parameters with spaces in them and such. This works a treat, with some minor modifications. Thanks for pointing it out! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 235 bytes Desc: Message signed with OpenPGP using GPGMail URL: From essen@REDACTED Thu Sep 27 20:49:51 2012 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Thu, 27 Sep 2012 20:49:51 +0200 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: <20120927181132.GC522@circlewave.net> References: <058201cd9c25$6000ca80$20025f80$@gmail.com> <20120927181132.GC522@circlewave.net> Message-ID: <50649FCF.1000506@ninenines.eu> On 09/27/2012 08:11 PM, freza@REDACTED wrote: > On Thu, Sep 27, 2012 at 10:29:24AM -0700, Raoul Duke wrote: >> the real technical solution would be for somebody to port the ideas of >> Typed Racket over to Lisp Flavoured Erlang. :-) > > It would perhaps help to move all typespecs to single section somewhere > at the top of source file (this is probably possible even today?), or > even better move them to a per-application .sig file that has all the > annotations for all modules in that app... (I share the perception that > they're distracting when scattered all around the place). I'm of the opposite opinion. It's annoying enough when you add a public function that you have to go to the top of the file to export it, I wouldn't want to have to open another file to add the specs too. -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From raould@REDACTED Thu Sep 27 20:50:54 2012 From: raould@REDACTED (Raoul Duke) Date: Thu, 27 Sep 2012 11:50:54 -0700 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: <20120927182447.GE522@circlewave.net> References: <058201cd9c25$6000ca80$20025f80$@gmail.com> <20120927181132.GC522@circlewave.net> <20120927182447.GE522@circlewave.net> Message-ID: On Thu, Sep 27, 2012 at 11:24 AM, wrote: >> ah, yes, bring back c/++ style .h files and all their glory! ;-) > And I thought ".sig" would be recognized as obvious reference to > Standard ML... :-) i missed that, since i haven't had the good fortune of using SML for nigh 20 years now, and have only rarely done anything related like ocaml or f# or whatever else. more is the pity, sucks to be me. but look at it this way: some people, when faced with the problem of having a single source file that has embedded metadata (be it user docs or type annotations or whatever), say, "i know! i'll split it into 2 files!" of course, now they are faced with /two/ problems. that's why e.g. java tried to get away from that, and the go language was invented. i'm not saying 1 vs. 2 files has a clear best answer for everybody, just that both choices have problems. in the end, this feels to me like yet another concrete example of why 99.five9s% of our development ides are stupid crap that don't really help with the real problems. we should not have to worry what files they are in or if we do/not have to see them, the ide should magically take care of all that. but that's a pipe dream of course these days. From watson.timothy@REDACTED Thu Sep 27 21:11:10 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Thu, 27 Sep 2012 20:11:10 +0100 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: <20120927181844.GD522@circlewave.net> References: <386854ED-DCB7-4BFC-B586-ABBDCFD917C8@erlang-solutions.com> <20120927181844.GD522@circlewave.net> Message-ID: <5B7377BD-6DBB-4EDD-93F0-FB0A339EA990@gmail.com> On 27 Sep 2012, at 19:18, freza@REDACTED wrote: > Haven't been following this thread closely, but it seems erlexec wasn't > mentioned yet: > > http://code.google.com/p/erlexec/ Doesn't appear very well maintained. I might pick it apart and rewrite it when native processes get released - it is a cool idea. Anyway, for the time being it's not a great help as I'm writing a framework to help set up and tear down clusters for distributed testing (based largely on common test) so I want to minimise the number of dependencies as much as possible. Besides, I'm more interested in working on the remote/ssh runner+monitor next, rather than spending another age fiddling around with the script runner. But yes, erlexec does look interesting and has been on my radar since it popped up on this list a few months back, discussing the desire to do proper signal handling (such as sending SIGTERM, SIGHUP, etc to the external program) without resorting to os:cmd("kill -" ++ Code ++ " " ++ OsPid). Again, this is something that linked-in drivers *can* deal with to a limited extent, and therefore I suspect that native processes will make for a very nice foundation on which to build an alternative to open_port/2. Also, IIRC there was a cool command line testing framework open sourced in the last year which was announced on this list. I can't remember what it was called, but it has a port driver that handles the the external comms and so on - looked very nice, although that's not what I'm trying to do/be as my focus is on getting things in a consistent state and monitoring to make sure they stay that way through the test run, then tearing down nicely before the next phase kicks off. Cheers, Tim -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 235 bytes Desc: Message signed with OpenPGP using GPGMail URL: From moxford@REDACTED Thu Sep 27 21:20:16 2012 From: moxford@REDACTED (Mike Oxford) Date: Thu, 27 Sep 2012 12:20:16 -0700 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> <20120927181132.GC522@circlewave.net> <20120927182447.GE522@circlewave.net> Message-ID: I'm in the "I like C/C++ .h files," just like I like the concept of IDL files. I can very quickly scan through the file (just like Erlang -export areas) and see what's available and the parameters. Otherwise you're either bogged down going through the code or relying on a secondary toolpass to generate documentation which then has to be hosted somewhere. "What was the exact parameter list?" "Hold on, let me fire up a browser to get to the file/site." "Nevermind, I just opened up the header and I got it." Headers have downsides, to be sure, but they have a very nice usage pattern for figuring out WTF this object is, what it appears to do and maybe how it plays into the overall architecture of the system. Also, I can grep a header dir and not get slammed with a wall of implementation crap. -mox On Thu, Sep 27, 2012 at 11:50 AM, Raoul Duke wrote: > On Thu, Sep 27, 2012 at 11:24 AM, wrote: > >> ah, yes, bring back c/++ style .h files and all their glory! ;-) > > And I thought ".sig" would be recognized as obvious reference to > > Standard ML... :-) > > i missed that, since i haven't had the good fortune of using SML for > nigh 20 years now, and have only rarely done anything related like > ocaml or f# or whatever else. more is the pity, sucks to be me. > > but look at it this way: some people, when faced with the problem of > having a single source file that has embedded metadata (be it user > docs or type annotations or whatever), say, "i know! i'll split it > into 2 files!" of course, now they are faced with /two/ problems. > that's why e.g. java tried to get away from that, and the go language > was invented. > > i'm not saying 1 vs. 2 files has a clear best answer for everybody, > just that both choices have problems. in the end, this feels to me > like yet another concrete example of why 99.five9s% of our development > ides are stupid crap that don't really help with the real problems. we > should not have to worry what files they are in or if we do/not have > to see them, the ide should magically take care of all that. but > that's a pipe dream of course these days. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Thu Sep 27 21:47:04 2012 From: serge@REDACTED (Serge Aleynikov) Date: Thu, 27 Sep 2012 15:47:04 -0400 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: <20120927181844.GD522@circlewave.net> References: <386854ED-DCB7-4BFC-B586-ABBDCFD917C8@erlang-solutions.com> <20120927181844.GD522@circlewave.net> Message-ID: <5064AD38.7010004@aleynikov.org> Regarding the statement that "erlexec" hasn't been well maintained - if you submit a bug report, I'll be happy to look into it, but other than that I believe the project does well what it was designed to do - spawn OS processes, pass them signals, chain them with links/monitors and link them to Erlang PIDs, and kill them reliably by signals or custom commands. Hence I haven't had a need to evolve it beyond where it has been as of right now. My "wish list" included adding portability so that it works on Windows as well as it does on Linux, but I never really had a need for it, and if there's a volunteer for this task, I'd be glad to accept patches. Regards, Serge On 9/27/2012 3:11 PM, Tim Watson wrote:> On 27 Sep 2012, at 19:18, freza@REDACTED wrote: >> Haven't been following this thread closely, but it seems erlexec wasn't >> mentioned yet: >> >> http://code.google.com/p/erlexec/ > > Doesn't appear very well maintained. I might pick it apart and rewrite it when native processes get released - it is a cool idea. Anyway, for the time being it's not a great help as I'm writing a framework to help set up and tear down clusters for distributed testing (based largely on common test) so I want to minimise the number of dependencies as much as possible. Besides, I'm more interested in working on the remote/ssh runner+monitor next, rather than spending another age fiddling around with the script runner. > > But yes, erlexec does look interesting and has been on my radar since it popped up on this list a few months back, discussing the desire to do proper signal handling (such as sending SIGTERM, SIGHUP, etc to the external program) without resorting to os:cmd("kill -" ++ Code ++ " " ++ OsPid). Again, this is something that linked-in drivers *can* deal with to a limited extent, and therefore I suspect that native processes will make for a very nice foundation on which to build an alternative to open_port/2. > > Also, IIRC there was a cool command line testing framework open sourced in the last year which was announced on this list. I can't remember what it was called, but it has a port driver that handles the the external comms and so on - looked very nice, although that's not what I'm trying to do/be as my focus is on getting things in a consistent state and monitoring to make sure they stay that way through the test run, then tearing down nicely before the next phase kicks off. > > Cheers, > Tim > From ok@REDACTED Fri Sep 28 01:03:22 2012 From: ok@REDACTED (Richard O'Keefe) Date: Fri, 28 Sep 2012 11:03:22 +1200 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> <20120927181132.GC522@circlewave.net> <20120927182447.GE522@circlewave.net> Message-ID: <8F56246A-E0BD-407D-A255-3C900858D322@cs.otago.ac.nz> On 28/09/2012, at 7:20 AM, Mike Oxford wrote: > I'm in the "I like C/C++ .h files," just like I like the concept of IDL files. > > I can very quickly scan through the file (just like Erlang -export areas) and see what's available and the parameters. > Otherwise you're either bogged down going through the code or relying on a secondary toolpass to generate documentation which then has to be hosted somewhere. > > "What was the exact parameter list?" > "Hold on, let me fire up a browser to get to the file/site." > "Nevermind, I just opened up the header and I got it." > > Headers have downsides, to be sure, but they have a very nice usage pattern for figuring out WTF this object is, what it appears to do and maybe how it plays into the overall architecture of the system. > > Also, I can grep a header dir and not get slammed with a wall of implementation crap. Let me commend WYSINEYH. What You See is Not Everything You Have. I don't agree with Bertrand Meyer about everything, but there are a lot of really good ideas behind Eiffel. One of them is the tools that come with it. Recall that Eiffel has multiple inheritance and _lightweight_ embedded documentation. Eiffel comes with two helper programs: flat Takes an Eiffel class and gives you a listing with all the inheritance folded out, so you see *every* method in the class, not just the added ones. short Takes an Eiffel class and strips out the method bodies; it gives you a pretty-printed listing of the method interface and documentation. The combination short flat Gives you the interfaces and documentation for everything exported from a class. Come to think of it, JavaDoc, pldoc, Haddock, and erldoc try to do something a bit similar, but heavier weight. What I'm thinking of is an editor mode that (possibly temporarily) hides everything but the -specs and selected comments. That way you get the benefit of HAVING everything in the one file but not the cost of having to READ everything. From raould@REDACTED Fri Sep 28 01:35:30 2012 From: raould@REDACTED (Raoul Duke) Date: Thu, 27 Sep 2012 16:35:30 -0700 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: <8F56246A-E0BD-407D-A255-3C900858D322@cs.otago.ac.nz> References: <058201cd9c25$6000ca80$20025f80$@gmail.com> <20120927181132.GC522@circlewave.net> <20120927182447.GE522@circlewave.net> <8F56246A-E0BD-407D-A255-3C900858D322@cs.otago.ac.nz> Message-ID: On Thu, Sep 27, 2012 at 4:03 PM, Richard O'Keefe wrote: > That way you get the benefit of HAVING everything in the one file > but not the cost of having to READ everything. everybody here knows this already exists for every main-stream language+ide, yes? :-) even though i'm often an emacs user, i also use eclipse and jetbrains (and visual studio before). somebody oughtta write an erlang plug-in for one of those that people can contribute to. From steven.charles.davis@REDACTED Fri Sep 28 01:48:56 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Thu, 27 Sep 2012 18:48:56 -0500 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> Message-ID: Since it's not been picked up on, I hope that everyone noticed that in the original example that I posted, even that blatantly simple spec was... wrong. There is NO WAY that function could ever return {error, Reason}, and further wastes your valuable time in trying to convince you that it could. /s From raould@REDACTED Fri Sep 28 01:57:49 2012 From: raould@REDACTED (Raoul Duke) Date: Thu, 27 Sep 2012 16:57:49 -0700 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> Message-ID: hi, On Thu, Sep 27, 2012 at 4:48 PM, Steve Davis wrote: > There is NO WAY that function could ever return {error, Reason}, and further wastes your valuable time in trying to convince you that it could. sounds pretty funny, maybe somebody was trying to leave it as an exercise for the reader, or two different people worked on the spec vs. code. if you are complaining about getting that particular one fixed, that makes sense, and presumably you could open a bug or send a patch in for it somewhere? but if you are talking about the general problem of mismatches happening between spec+code, well, then you need to either move back to something w/out any specs at all, or you need to use stuff like quickcheck*, or move over to agda or epigram or ats or something crazy like that. (* and even then the proving-a-negative-thing is philosophically unsolvable in the general sense, no?) sincerely. From raould@REDACTED Fri Sep 28 01:59:11 2012 From: raould@REDACTED (Raoul Duke) Date: Thu, 27 Sep 2012 16:59:11 -0700 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> Message-ID: On Thu, Sep 27, 2012 at 4:57 PM, Raoul Duke wrote: > (* and even then the proving-a-negative-thing is philosophically > unsolvable in the general sense, no?) p.s. i'm not saying code coverage tools can't look into things like your specific example, just that in the widest sense of 'proving a negative' it sounds to me like the philosophical induction black swan issue. From ok@REDACTED Fri Sep 28 03:01:11 2012 From: ok@REDACTED (Richard O'Keefe) Date: Fri, 28 Sep 2012 13:01:11 +1200 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> Message-ID: <8B64D0BE-C236-410A-BF08-420116F09813@cs.otago.ac.nz> On 28/09/2012, at 11:59 AM, Raoul Duke wrote: > p.s. i'm not saying code coverage tools can't look into things like > your specific example, just that in the widest sense of 'proving a > negative' it sounds to me like the philosophical induction black swan > issue. It's a bit off topic, but I am really getting tired of people talking about black swans. I hold dual Australian/New Zealand citizenship, and in *both* my countries black swans are the only kind of swans you will see in the wild. Black swans are NORMAL. White swans are weird. (I leave you to draw the obvious parallel for yourselves...) From steven.charles.davis@REDACTED Fri Sep 28 03:11:41 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Thu, 27 Sep 2012 20:11:41 -0500 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> Message-ID: <7A39522B-F291-45D9-A5D0-60C4052F0F6E@gmail.com> Hi Michael, I suspect that if your code is beta quality then it would be fair to say that the contract is beta quality also, right? When you/the author get around to implementing it (if you/they ever do) then you/they may definitely find that the contract changes. I think it hubris to believe that you can predict that future without implementing it first. Meantime, this "api idea" in a spec is implicitly expected to be supported by all users - even though it is bogus. I'd say to that - just be honest about what _is_, not what you think things may be. WRT to dialyzer -> If dialyzer can see that, then what is the purpose of the spec (given that is it provably wrong). Should not dialyzer strive to look deeper rather than requesting/requiring that highly fault-prone specs should be written for every function? You'll perhaps also note that the comment on the example was also wrong. It stated "Currently unused", and that isn't true either - the function just doesn't do anything on a code change; But the function IS USED. *Everything* preceding the actual function is misleading. I'm saying we should all be aware of that, and dare to consider better solutions than spec. I would post-script the above with the following thought for those that have experienced it in other languages: The drive to clear definition of static typing leads to highly repetitive and confusing code that leads to high distraction and extremely suspect verbosity. => One of erlang's core syntax strengths is a low requirement on developer time to get an error tolerant, working system, and that aggressive approach is "saved" by coding to "let it crash". /s On Sep 27, 2012, at 7:43 PM, Michael Radford wrote: > At least the dialyzer won't let you get away with incorrect specs, if > that's what you're worried about. (I find this quite irritating when I > want to define an interface to support some future expansion that > callers should handle, but isn't fully implemented yet!) > > $ cat >> foo.erl > -module (foo). > -export ([foo/0]). > -spec foo () -> {ok, any()} | {error, any()}. > foo () -> {ok, now ()}. > > $ dialyzer --src -c foo.erl > Checking whether the PLT /home/notroot/.dialyzer_plt is up-to-date... yes > Proceeding with analysis... > foo.erl:3: The specification for foo:foo/0 states that the function > might also return {'error',_} but the inferred return is > {'ok',{non_neg_integer(),non_neg_integer(),non_neg_integer()}} > done in 0m0.34s > done (warnings were emitted) > > Mike > > On Thu, Sep 27, 2012 at 4:48 PM, Steve Davis > wrote: >> Since it's not been picked up on, I hope that everyone noticed that in the original example that I posted, even that blatantly simple spec was... wrong. >> >> There is NO WAY that function could ever return {error, Reason}, and further wastes your valuable time in trying to convince you that it could. >> >> /s >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From steven.charles.davis@REDACTED Fri Sep 28 03:48:35 2012 From: steven.charles.davis@REDACTED (Steve Davis) Date: Thu, 27 Sep 2012 18:48:35 -0700 (PDT) Subject: [erlang-questions] prettypr and spec In-Reply-To: References: Message-ID: <1c547415-4b65-4a17-8c95-1617477752d2@googlegroups.com> I'd say someone decided to waste your brain-time. i.e. in making an apparent requirement of the -spec part of the code (as per the other thread I started). > Any input welcome. > > r. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew@REDACTED Fri Sep 28 05:41:36 2012 From: andrew@REDACTED (Andrew Thompson) Date: Thu, 27 Sep 2012 23:41:36 -0400 Subject: [erlang-questions] [ANN] Lager 1.2.1 and backend API changes happening on master Message-ID: <20120928034136.GG15522@hijacked.us> I just tagged lager 1.2.1, the last 'stable' release for a while. I know I never actually *announced* 1.2.0 (or maybe even 1.0.0 for that matter) but this one is more important as it is probably the tag you want to track in your applications for a while. After tagging 1.2.1 I merged a branch to master that breaks the backend API that lager backends had been using, specifically the way log messages are sent to the backends. Any 3rd party backends (including lager_syslog) will currently be broken if you use them against master instead of 1.2.1. They will either need have their lager dep pinned to 1.2.1 or updated to reflect the new API. I apologize for the inconvienience, but it was necessary to allow some future feature development. Andrew From essen@REDACTED Fri Sep 28 06:33:48 2012 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Fri, 28 Sep 2012 06:33:48 +0200 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: <7A39522B-F291-45D9-A5D0-60C4052F0F6E@gmail.com> References: <058201cd9c25$6000ca80$20025f80$@gmail.com> <7A39522B-F291-45D9-A5D0-60C4052F0F6E@gmail.com> Message-ID: <506528AC.2040100@ninenines.eu> On 09/28/2012 03:11 AM, Steve Davis wrote: > Hi Michael, > > I suspect that if your code is beta quality then it would be fair to say that the contract is beta quality also, right? > > When you/the author get around to implementing it (if you/they ever do) then you/they may definitely find that the contract changes. I think it hubris to believe that you can predict that future without implementing it first. Meantime, this "api idea" in a spec is implicitly expected to be supported by all users - even though it is bogus. I'd say to that - just be honest about what _is_, not what you think things may be. > > WRT to dialyzer -> If dialyzer can see that, then what is the purpose of the spec (given that is it provably wrong). Should not dialyzer strive to look deeper rather than requesting/requiring that highly fault-prone specs should be written for every function? > > You'll perhaps also note that the comment on the example was also wrong. It stated "Currently unused", and that isn't true either - the function just doesn't do anything on a code change; But the function IS USED. *Everything* preceding the actual function is misleading. > > I'm saying we should all be aware of that, and dare to consider better solutions than spec. > > I would post-script the above with the following thought for those that have experienced it in other languages: The drive to clear definition of static typing leads to highly repetitive and confusing code that leads to high distraction and extremely suspect verbosity. => One of erlang's core syntax strengths is a low requirement on developer time to get an error tolerant, working system, and that aggressive approach is "saved" by coding to "let it crash". Specs are insanely useful to me by ensuring that my code changes do not have an unexpected impact, like unknowingly changing an interface, or creating some dead code by not seeing a match can't happen. Having them allows Dialyzer to help you a lot more than if it has to guess everything. Without them I'd probably introduce bugs all the time. They're an additional guarantee alongside tests. Specs ensure the intent is right, tests ensure the code is right. Plus specs are also documentation that I'd have to write somewhere anyway. -- Lo?c Hoguin Erlang Cowboy Nine Nines http://ninenines.eu From Sergey_Zhemzhitsky@REDACTED Fri Sep 28 08:47:21 2012 From: Sergey_Zhemzhitsky@REDACTED (Zhemzhitsky Sergey) Date: Fri, 28 Sep 2012 06:47:21 +0000 Subject: [erlang-questions] How to define non_neg_float() type specification? In-Reply-To: References: <06139A918ACCA041BF46A0F36940C7FA4FE4715D@exch-mbx1.msk.trd.ru> <16fd01e4-7994-45a9-9a2b-9050c67ebe0f@googlegroups.com> Message-ID: <06139A918ACCA041BF46A0F36940C7FA4FE473DB@exch-mbx1.msk.trd.ru> Hello Stavros, Thanks for suggestion! Best Regards, Sergey From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Stavros Aronis Sent: Thursday, September 27, 2012 8:47 PM To: erlang-programming@REDACTED Cc: Erlang-Questions Questions Subject: Re: [erlang-questions] How to define non_neg_float() type specification? Sorry, that was: -type non_neg_float() :: float(). Stavros On Thursday, September 27, 2012 6:32:47 PM UTC+2, Stavros Aronis wrote: Hello! Unfortunately Dialyzer does not support it (even constants are generalized to any float, typwise). Consequentially, the type language does tnot support it. You can maybe try: -type define non_neg_float() :: float(). This will help you documentation-wise and also (though in a somewhat limited way) Dialyzer-wise. If you use this type PropEr-wise however, you will get positive values, which you will need to filter... Stavros On Thursday, September 27, 2012 6:10:14 PM UTC+2, Zhemzhitsky Sergey wrote: Hello erlangers, Is it possible to define non_neg_float() type specification somehow? Best Regards, Sergey _______________________________________________________ The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. If you need assistance please contact our Contact Center (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp -------------- next part -------------- An HTML attachment was scrubbed... URL: From desired.mta@REDACTED Fri Sep 28 09:21:17 2012 From: desired.mta@REDACTED (Motiejus =?utf-8?Q?Jak=C5=A1tys?=) Date: Fri, 28 Sep 2012 08:21:17 +0100 Subject: [erlang-questions] How to define non_neg_float() type specification? In-Reply-To: <16fd01e4-7994-45a9-9a2b-9050c67ebe0f@googlegroups.com> References: <06139A918ACCA041BF46A0F36940C7FA4FE4715D@exch-mbx1.msk.trd.ru> <16fd01e4-7994-45a9-9a2b-9050c67ebe0f@googlegroups.com> Message-ID: <20120928072117.GA2731@precise> On Thu, Sep 27, 2012 at 09:32:47AM -0700, Stavros Aronis wrote: > Hello! > > Unfortunately Dialyzer does not support it (even constants are generalized > to any float, typwise). Consequentially, the type language does tnot > support it. Eh.. Erlang looks so close to having guards in type specs. Wouldn't that be cool? > This will help you documentation-wise and also (though in a somewhat > limited way) Dialyzer-wise. If you use this type PropEr-wise however, you > will get positive values, which you will need to filter... Even better, just abs(It) :) ?LET(It, float(), abs(It)). Regards, Motiejus -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From watson.timothy@REDACTED Fri Sep 28 10:00:22 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Fri, 28 Sep 2012 09:00:22 +0100 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: <5064AD38.7010004@aleynikov.org> References: <386854ED-DCB7-4BFC-B586-ABBDCFD917C8@erlang-solutions.com> <20120927181844.GD522@circlewave.net> <5064AD38.7010004@aleynikov.org> Message-ID: Hey Serge, I wasn't insinuating that erlexec isn't fit for purpose, just that it doesn't seem to be under active development. From the sounds of things, that's because it's relatively stable, which is cool. Thanks for piping up and pointing that out - I will look at it for some other projects I've got brewing. Cheers Tim On 27 Sep 2012, at 20:47, Serge Aleynikov wrote: > Regarding the statement that "erlexec" hasn't been well maintained - if > you submit a bug report, I'll be happy to look into it, but other than > that I believe the project does well what it was designed to do - spawn > OS processes, pass them signals, chain them with links/monitors and link > them to Erlang PIDs, and kill them reliably by signals or custom > commands. Hence I haven't had a need to evolve it beyond where it has > been as of right now. My "wish list" included adding portability so > that it works on Windows as well as it does on Linux, but I never really > had a need for it, and if there's a volunteer for this task, I'd be glad > to accept patches. > > Regards, > > Serge > > > On 9/27/2012 3:11 PM, Tim Watson wrote:> On 27 Sep 2012, at 19:18, > freza@REDACTED wrote: >>> Haven't been following this thread closely, but it seems erlexec wasn't >>> mentioned yet: >>> >>> http://code.google.com/p/erlexec/ >> >> Doesn't appear very well maintained. I might pick it apart and rewrite > it when native processes get released - it is a cool idea. Anyway, for > the time being it's not a great help as I'm writing a framework to help > set up and tear down clusters for distributed testing (based largely on > common test) so I want to minimise the number of dependencies as much as > possible. Besides, I'm more interested in working on the remote/ssh > runner+monitor next, rather than spending another age fiddling around > with the script runner. >> >> But yes, erlexec does look interesting and has been on my radar since > it popped up on this list a few months back, discussing the desire to do > proper signal handling (such as sending SIGTERM, SIGHUP, etc to the > external program) without resorting to os:cmd("kill -" ++ Code ++ " " ++ > OsPid). Again, this is something that linked-in drivers *can* deal with > to a limited extent, and therefore I suspect that native processes will > make for a very nice foundation on which to build an alternative to > open_port/2. >> >> Also, IIRC there was a cool command line testing framework open > sourced in the last year which was announced on this list. I can't > remember what it was called, but it has a port driver that handles the > the external comms and so on - looked very nice, although that's not > what I'm trying to do/be as my focus is on getting things in a > consistent state and monitoring to make sure they stay that way through > the test run, then tearing down nicely before the next phase kicks off. >> >> Cheers, >> Tim >> From watson.timothy@REDACTED Fri Sep 28 13:45:14 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Fri, 28 Sep 2012 12:45:14 +0100 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: <5B7377BD-6DBB-4EDD-93F0-FB0A339EA990@gmail.com> References: <386854ED-DCB7-4BFC-B586-ABBDCFD917C8@erlang-solutions.com> <20120927181844.GD522@circlewave.net> <5B7377BD-6DBB-4EDD-93F0-FB0A339EA990@gmail.com> Message-ID: <6C59BEC0-3D7A-461D-9671-363CC5035B7F@gmail.com> The project doesn't appear to build cleanly on mac os lion: t4@REDACTED:erlexec $ ./configure configure: error: cannot find install-sh, install.sh, or shtool in config "."/config t4@REDACTED:erlexec $ ./build Install dir: /usr/local/src/erlang/erlexec/install aclocal autoconf -i configure.ac:19: error: possibly undefined macro: AC_PROG_LIBTOOL If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. make: *** [configure] Error 1 t4@REDACTED:erlexec $ t4@REDACTED:erlexec $ autoconf -V autoconf (GNU Autoconf) 2.69 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+/Autoconf: GNU GPL version 3 or later , This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David J. MacKenzie and Akim Demaille. t4@REDACTED:erlexec $ Is there a specific version of autotools required to build and compile erlexec? On 27 Sep 2012, at 20:11, Tim Watson wrote: > On 27 Sep 2012, at 19:18, freza@REDACTED wrote: >> Haven't been following this thread closely, but it seems erlexec wasn't >> mentioned yet: >> >> http://code.google.com/p/erlexec/ > > Doesn't appear very well maintained. I might pick it apart and rewrite it when native processes get released - it is a cool idea. Anyway, for the time being it's not a great help as I'm writing a framework to help set up and tear down clusters for distributed testing (based largely on common test) so I want to minimise the number of dependencies as much as possible. Besides, I'm more interested in working on the remote/ssh runner+monitor next, rather than spending another age fiddling around with the script runner. > > But yes, erlexec does look interesting and has been on my radar since it popped up on this list a few months back, discussing the desire to do proper signal handling (such as sending SIGTERM, SIGHUP, etc to the external program) without resorting to os:cmd("kill -" ++ Code ++ " " ++ OsPid). Again, this is something that linked-in drivers *can* deal with to a limited extent, and therefore I suspect that native processes will make for a very nice foundation on which to build an alternative to open_port/2. > > Also, IIRC there was a cool command line testing framework open sourced in the last year which was announced on this list. I can't remember what it was called, but it has a port driver that handles the the external comms and so on - looked very nice, although that's not what I'm trying to do/be as my focus is on getting things in a consistent state and monitoring to make sure they stay that way through the test run, then tearing down nicely before the next phase kicks off. > > Cheers, > Tim -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 235 bytes Desc: Message signed with OpenPGP using GPGMail URL: From raould@REDACTED Fri Sep 28 18:02:42 2012 From: raould@REDACTED (Raoul Duke) Date: Fri, 28 Sep 2012 09:02:42 -0700 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> Message-ID: p.s. somebody who knows erlang please port shen-qi-lisp. On Thu, Sep 27, 2012 at 10:29 AM, Raoul Duke wrote: > the real technical solution would be for somebody to port the ideas of > Typed Racket over to Lisp Flavoured Erlang. :-) From liuyang124846@REDACTED Thu Sep 27 06:58:13 2012 From: liuyang124846@REDACTED (liuyang-google) Date: Thu, 27 Sep 2012 12:58:13 +0800 Subject: [erlang-questions] [Ann] Javascript for client and server, in a unified webapp platform. Based on Erlang Cloud infrastructure. In-Reply-To: References: Message-ID: <1348721893.2597.0.camel@ubuntu> On ?, 2012-09-26 at 10:31 +0800, LiYusheng wrote: > Qiyun Webapp platform is now online. You can visit > http://qyapp.com/qiyun/website/quickstart-en.html to get an overview > of how to use it to build webapp inside the web then directly publish > it out. Or you can visit https://qyapp.com to have a try immediately, > it is completely free. > > It includes a WYSIWYG IDE, smart editor, distributed version control, > a virtual file system and a Data Platform Support accessible from > Javascript code . > > Behind it is Erlang, almost all of the cloud side components except > the db engine, which is c code. We also compile customer's server side > Javascript into code that can be run inside Erlang VM, instead of > using a javascript engine like V8. We will soon support people > directly write Erlang code and run it in our cloud to implement their > business logic then user Javascript to build their web UI. > > I plan to write some technical details about how Erlang is a crucial > part of our platform. And I'd like to add acknowledge to the website > soon for all wonderful Erlang tools we use, especially Yaws. > > I look forward to hearing from you. Thank you for your interest. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions good job From serge@REDACTED Fri Sep 28 18:24:23 2012 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 28 Sep 2012 12:24:23 -0400 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? Message-ID: <5065CF37.9020307@aleynikov.org> Is it possible that you don't have libtool installed (missing AC_PROG_LIBTOOL)? I have the following on linux and everything builds fine: $ autoconf -V autoconf (GNU Autoconf) 2.68 $ libtool --version libtool (GNU libtool) 2.4 $ ./build $ make $ make install $ tree install install ??? exec-1.0 ??? ebin ? ??? exec.app ? ??? exec_app.beam ? ??? exec.beam ??? include ? ??? exec.hrl ??? priv ? ??? x86_64-unknown-linux-gnu ? ??? bin ? ??? exec-port ??? src ??? exec_app.erl ??? exec.erl On 9/28/2012 7:45 AM, Tim Watson wrote:> The project doesn't appear to build cleanly on mac os lion: > > t4@REDACTED:erlexec $ ./configure > configure: error: cannot find install-sh, install.sh, or shtool in config "."/config > t4@REDACTED:erlexec $ ./build > Install dir: /usr/local/src/erlang/erlexec/install > aclocal > autoconf -i > configure.ac:19: error: possibly undefined macro: AC_PROG_LIBTOOL > If this token and others are legitimate, please use m4_pattern_allow. > See the Autoconf documentation. > make: *** [configure] Error 1 > t4@REDACTED:erlexec $ > t4@REDACTED:erlexec $ autoconf -V > autoconf (GNU Autoconf) 2.69 > Copyright (C) 2012 Free Software Foundation, Inc. > License GPLv3+/Autoconf: GNU GPL version 3 or later > , > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. > > Written by David J. MacKenzie and Akim Demaille. > t4@REDACTED:erlexec $ > > > Is there a specific version of autotools required to build and compile erlexec? > > On 27 Sep 2012, at 20:11, Tim Watson wrote: > >> On 27 Sep 2012, at 19:18, freza@REDACTED wrote: >>> Haven't been following this thread closely, but it seems erlexec wasn't >>> mentioned yet: >>> >>> http://code.google.com/p/erlexec/ >> >> Doesn't appear very well maintained. I might pick it apart and rewrite it when native processes get released - it is a cool idea. Anyway, for the time being it's not a great help as I'm writing a framework to help set up and tear down clusters for distributed testing (based largely on common test) so I want to minimise the number of dependencies as much as possible. Besides, I'm more interested in working on the remote/ssh runner+monitor next, rather than spending another age fiddling around with the script runner. >> >> But yes, erlexec does look interesting and has been on my radar since it popped up on this list a few months back, discussing the desire to do proper signal handling (such as sending SIGTERM, SIGHUP, etc to the external program) without resorting to os:cmd("kill -" ++ Code ++ " " ++ OsPid). Again, this is something that linked-in drivers *can* deal with to a limited extent, and therefore I suspect that native processes will make for a very nice foundation on which to build an alternative to open_port/2. >> >> Also, IIRC there was a cool command line testing framework open sourced in the last year which was announced on this list. I can't remember what it was called, but it has a port driver that handles the the external comms and so on - looked very nice, although that's not what I'm trying to do/be as my focus is on getting things in a consistent state and monitoring to make sure they stay that way through the test run, then tearing down nicely before the next phase kicks off. >> >> Cheers, >> Tim > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From watson.timothy@REDACTED Fri Sep 28 23:16:48 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Fri, 28 Sep 2012 22:16:48 +0100 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: <5065CF37.9020307@aleynikov.org> References: <5065CF37.9020307@aleynikov.org> Message-ID: Well I do, but clearly not the same version as you? t4@REDACTED:erlexec $ which libtool /usr/bin/libtool t4@REDACTED:erlexec $ ls -la /usr/bin/ | grep libtool -r-xr-xr-x 1 root wheel 149216 22 May 15:30 libtool lrwxr-xr-x 1 root wheel 7 22 May 15:30 ranlib -> libtool t4@REDACTED:erlexec $ libtool --version libtool: unknown option character `-' in: --version Usage: libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] Usage: libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename ] [-all_load] [-noall_load] t4@REDACTED:erlexec $ Honestly the osx build tool chain drives me nuts sometimes. :/ On 28 Sep 2012, at 17:24, Serge Aleynikov wrote: > Is it possible that you don't have libtool installed (missing > AC_PROG_LIBTOOL)? > > I have the following on linux and everything builds fine: > $ autoconf -V > autoconf (GNU Autoconf) 2.68 > $ libtool --version > libtool (GNU libtool) 2.4 > $ ./build > $ make > $ make install > $ tree install > install > ??? exec-1.0 > ??? ebin > ? ??? exec.app > ? ??? exec_app.beam > ? ??? exec.beam > ??? include > ? ??? exec.hrl > ??? priv > ? ??? x86_64-unknown-linux-gnu > ? ??? bin > ? ??? exec-port > ??? src > ??? exec_app.erl > ??? exec.erl > > > On 9/28/2012 7:45 AM, Tim Watson wrote:> The project doesn't appear to > build cleanly on mac os lion: >> >> t4@REDACTED:erlexec $ ./configure >> configure: error: cannot find install-sh, install.sh, or shtool in > config "."/config >> t4@REDACTED:erlexec $ ./build >> Install dir: /usr/local/src/erlang/erlexec/install >> aclocal >> autoconf -i >> configure.ac:19: error: possibly undefined macro: AC_PROG_LIBTOOL >> If this token and others are legitimate, please use m4_pattern_allow. >> See the Autoconf documentation. >> make: *** [configure] Error 1 >> t4@REDACTED:erlexec $ >> t4@REDACTED:erlexec $ autoconf -V >> autoconf (GNU Autoconf) 2.69 >> Copyright (C) 2012 Free Software Foundation, Inc. >> License GPLv3+/Autoconf: GNU GPL version 3 or later >> , > >> This is free software: you are free to change and redistribute it. >> There is NO WARRANTY, to the extent permitted by law. >> >> Written by David J. MacKenzie and Akim Demaille. >> t4@REDACTED:erlexec $ >> >> >> Is there a specific version of autotools required to build and compile > erlexec? >> >> On 27 Sep 2012, at 20:11, Tim Watson wrote: >> >>> On 27 Sep 2012, at 19:18, freza@REDACTED wrote: >>>> Haven't been following this thread closely, but it seems erlexec wasn't >>>> mentioned yet: >>>> >>>> http://code.google.com/p/erlexec/ >>> >>> Doesn't appear very well maintained. I might pick it apart and > rewrite it when native processes get released - it is a cool idea. > Anyway, for the time being it's not a great help as I'm writing a > framework to help set up and tear down clusters for distributed testing > (based largely on common test) so I want to minimise the number of > dependencies as much as possible. Besides, I'm more interested in > working on the remote/ssh runner+monitor next, rather than spending > another age fiddling around with the script runner. >>> >>> But yes, erlexec does look interesting and has been on my radar since > it popped up on this list a few months back, discussing the desire to do > proper signal handling (such as sending SIGTERM, SIGHUP, etc to the > external program) without resorting to os:cmd("kill -" ++ Code ++ " " ++ > OsPid). Again, this is something that linked-in drivers *can* deal with > to a limited extent, and therefore I suspect that native processes will > make for a very nice foundation on which to build an alternative to > open_port/2. >>> >>> Also, IIRC there was a cool command line testing framework open > sourced in the last year which was announced on this list. I can't > remember what it was called, but it has a port driver that handles the > the external comms and so on - looked very nice, although that's not > what I'm trying to do/be as my focus is on getting things in a > consistent state and monitoring to make sure they stay that way through > the test run, then tearing down nicely before the next phase kicks off. >>> >>> Cheers, >>> Tim >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 235 bytes Desc: Message signed with OpenPGP using GPGMail URL: From serge@REDACTED Fri Sep 28 23:41:15 2012 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 28 Sep 2012 17:41:15 -0400 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? Message-ID: <5066197B.5020008@aleynikov.org> Unfortunately I don't have OSx to test this. I can't reproduce your problem on Linux. Perhaps you could check the libtool version this way: $ grep "^macro_version" /usr/bin/libtool macro_version=2.4 and if yours is different, try to upgrade it. In order to simplify the build process I'll try to convert erlexec to use rebar some time next week, which will eliminate autotools-based toolchain. Need to figure out with rebar how to test and optionally enable conditional defines based on presence of special C headers such as "sys/capability.h" when compiling a port program. On 9/28/2012 5:16 PM, Tim Watson wrote:> Well I do, but clearly not the same version as you? > > t4@REDACTED:erlexec $ which libtool > /usr/bin/libtool > t4@REDACTED:erlexec $ ls -la /usr/bin/ | grep libtool > -r-xr-xr-x 1 root wheel 149216 22 May 15:30 libtool > lrwxr-xr-x 1 root wheel 7 22 May 15:30 ranlib -> libtool > t4@REDACTED:erlexec $ libtool --version > libtool: unknown option character `-' in: --version > Usage: libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] > Usage: libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename ] [-all_load] [-noall_load] > t4@REDACTED:erlexec $ > > Honestly the osx build tool chain drives me nuts sometimes. :/ > > On 28 Sep 2012, at 17:24, Serge Aleynikov wrote: > >> Is it possible that you don't have libtool installed (missing >> AC_PROG_LIBTOOL)? >> >> I have the following on linux and everything builds fine: >> $ autoconf -V >> autoconf (GNU Autoconf) 2.68 >> $ libtool --version >> libtool (GNU libtool) 2.4 >> $ ./build >> $ make >> $ make install >> $ tree install >> install >> ??? exec-1.0 >> ??? ebin >> ? ??? exec.app >> ? ??? exec_app.beam >> ? ??? exec.beam >> ??? include >> ? ??? exec.hrl >> ??? priv >> ? ??? x86_64-unknown-linux-gnu >> ? ??? bin >> ? ??? exec-port >> ??? src >> ??? exec_app.erl >> ??? exec.erl >> >> >> On 9/28/2012 7:45 AM, Tim Watson wrote:> The project doesn't appear to >> build cleanly on mac os lion: >>> >>> t4@REDACTED:erlexec $ ./configure >>> configure: error: cannot find install-sh, install.sh, or shtool in >> config "."/config >>> t4@REDACTED:erlexec $ ./build >>> Install dir: /usr/local/src/erlang/erlexec/install >>> aclocal >>> autoconf -i >>> configure.ac:19: error: possibly undefined macro: AC_PROG_LIBTOOL >>> If this token and others are legitimate, please use m4_pattern_allow. >>> See the Autoconf documentation. >>> make: *** [configure] Error 1 >>> t4@REDACTED:erlexec $ >>> t4@REDACTED:erlexec $ autoconf -V >>> autoconf (GNU Autoconf) 2.69 >>> Copyright (C) 2012 Free Software Foundation, Inc. >>> License GPLv3+/Autoconf: GNU GPL version 3 or later >>> , >> >>> This is free software: you are free to change and redistribute it. >>> There is NO WARRANTY, to the extent permitted by law. >>> >>> Written by David J. MacKenzie and Akim Demaille. >>> t4@REDACTED:erlexec $ >>> >>> >>> Is there a specific version of autotools required to build and compile >> erlexec? >>> >>> On 27 Sep 2012, at 20:11, Tim Watson wrote: >>> >>>> On 27 Sep 2012, at 19:18, freza@REDACTED wrote: >>>>> Haven't been following this thread closely, but it seems erlexec wasn't >>>>> mentioned yet: >>>>> >>>>> http://code.google.com/p/erlexec/ >>>> >>>> Doesn't appear very well maintained. I might pick it apart and >> rewrite it when native processes get released - it is a cool idea. >> Anyway, for the time being it's not a great help as I'm writing a >> framework to help set up and tear down clusters for distributed testing >> (based largely on common test) so I want to minimise the number of >> dependencies as much as possible. Besides, I'm more interested in >> working on the remote/ssh runner+monitor next, rather than spending >> another age fiddling around with the script runner. >>>> >>>> But yes, erlexec does look interesting and has been on my radar since >> it popped up on this list a few months back, discussing the desire to do >> proper signal handling (such as sending SIGTERM, SIGHUP, etc to the >> external program) without resorting to os:cmd("kill -" ++ Code ++ " " ++ >> OsPid). Again, this is something that linked-in drivers *can* deal with >> to a limited extent, and therefore I suspect that native processes will >> make for a very nice foundation on which to build an alternative to >> open_port/2. >>>> >>>> Also, IIRC there was a cool command line testing framework open >> sourced in the last year which was announced on this list. I can't >> remember what it was called, but it has a port driver that handles the >> the external comms and so on - looked very nice, although that's not >> what I'm trying to do/be as my focus is on getting things in a >> consistent state and monitoring to make sure they stay that way through >> the test run, then tearing down nicely before the next phase kicks off. >>>> >>>> Cheers, >>>> Tim >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> > From liuyang124846@REDACTED Sat Sep 29 06:56:38 2012 From: liuyang124846@REDACTED (Yang Liu) Date: Sat, 29 Sep 2012 12:56:38 +0800 Subject: [erlang-questions] Yet another Lua for Erlang library had been written. Meet the 'moon' library! In-Reply-To: References: Message-ID: I am using it, i like it, it is fast and asyc, a new thread do the lua job, i using it with lua5.1, great job. ? 2012-9-27 ??6:33?"Anatoly Kanivetskiy" ??? > > Greetings, Erlangers! > > If you wanted to incorporate the power of erlang with the simplicity of Lua, but was not satisfied with existing libraries, you can try yet another one! > > It is written as NIF using C++ and a bit of a boost libraries, and wasn't yet heavily tested. But it should perform faster. In theory. I hope so. :-) > > It's still more a prototype, than a solid, production-ready library. > It lacks some portability (only ubuntu 12.04 was tested). > But I have an intention to make it buildable at least on recent versions of Scientific Linux. > > Also, it depends heavily on boost libraries. > The header-only part can be bundled inside, like this repo does: https://github.com/basho/basho_metrics. > And the boost thread library, which is definitely an overkill here, can be easily replaced with native enif_(mutex|cond)_* functions. > At the moment, i'm happy with having boost as a dependency, but if it annoys you - you can remove it yourself of course :) Or, probably, I'll do it eventually. > > So, feel free to use/fork/patch/criticize it: https://github.com/chaos-ad/moon > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From watson.timothy@REDACTED Sat Sep 29 11:23:03 2012 From: watson.timothy@REDACTED (Tim Watson) Date: Sat, 29 Sep 2012 10:23:03 +0100 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: <5066197B.5020008@aleynikov.org> References: <5066197B.5020008@aleynikov.org> Message-ID: <76CE4188-BC5E-4DA4-8016-39CD7CDC326D@gmail.com> I'm a heavy rebar user and have compiled ports with it before, so give me a shout if you need any assistance. I can also do testing on several unix platforms. On 28 Sep 2012, at 22:41, Serge Aleynikov wrote: > Unfortunately I don't have OSx to test this. I can't reproduce your > problem on Linux. Perhaps you could check the libtool version this way: > > $ grep "^macro_version" /usr/bin/libtool > macro_version=2.4 > > and if yours is different, try to upgrade it. > > In order to simplify the build process I'll try to convert erlexec to > use rebar some time next week, which will eliminate autotools-based > toolchain. Need to figure out with rebar how to test and optionally > enable conditional defines based on presence of special C headers such > as "sys/capability.h" when compiling a port program. > > On 9/28/2012 5:16 PM, Tim Watson wrote:> Well I do, but clearly not the > same version as you? >> >> t4@REDACTED:erlexec $ which libtool >> /usr/bin/libtool >> t4@REDACTED:erlexec $ ls -la /usr/bin/ | grep libtool >> -r-xr-xr-x 1 root wheel 149216 22 May 15:30 libtool >> lrwxr-xr-x 1 root wheel 7 22 May 15:30 ranlib -> libtool >> t4@REDACTED:erlexec $ libtool --version >> libtool: unknown option character `-' in: --version >> Usage: libtool -static [-] file [...] [-filelist listfile[,dirname]] > [-arch_only arch] [-sacLT] >> Usage: libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] > [-arch_only arch] [-o output] [-install_name name] > [-compatibility_version #] [-current_version #] [-seg1addr 0x#] > [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table > ] [-seg_addr_table_filename ] [-all_load] > [-noall_load] >> t4@REDACTED:erlexec $ >> >> Honestly the osx build tool chain drives me nuts sometimes. :/ >> >> On 28 Sep 2012, at 17:24, Serge Aleynikov wrote: >> >>> Is it possible that you don't have libtool installed (missing >>> AC_PROG_LIBTOOL)? >>> >>> I have the following on linux and everything builds fine: >>> $ autoconf -V >>> autoconf (GNU Autoconf) 2.68 >>> $ libtool --version >>> libtool (GNU libtool) 2.4 >>> $ ./build >>> $ make >>> $ make install >>> $ tree install >>> install >>> ??? exec-1.0 >>> ??? ebin >>> ? ??? exec.app >>> ? ??? exec_app.beam >>> ? ??? exec.beam >>> ??? include >>> ? ??? exec.hrl >>> ??? priv >>> ? ??? x86_64-unknown-linux-gnu >>> ? ??? bin >>> ? ??? exec-port >>> ??? src >>> ??? exec_app.erl >>> ??? exec.erl >>> >>> >>> On 9/28/2012 7:45 AM, Tim Watson wrote:> The project doesn't appear to >>> build cleanly on mac os lion: >>>> >>>> t4@REDACTED:erlexec $ ./configure >>>> configure: error: cannot find install-sh, install.sh, or shtool in >>> config "."/config >>>> t4@REDACTED:erlexec $ ./build >>>> Install dir: /usr/local/src/erlang/erlexec/install >>>> aclocal >>>> autoconf -i >>>> configure.ac:19: error: possibly undefined macro: AC_PROG_LIBTOOL >>>> If this token and others are legitimate, please use > m4_pattern_allow. >>>> See the Autoconf documentation. >>>> make: *** [configure] Error 1 >>>> t4@REDACTED:erlexec $ >>>> t4@REDACTED:erlexec $ autoconf -V >>>> autoconf (GNU Autoconf) 2.69 >>>> Copyright (C) 2012 Free Software Foundation, Inc. >>>> License GPLv3+/Autoconf: GNU GPL version 3 or later >>>> , >>> >>>> This is free software: you are free to change and redistribute it. >>>> There is NO WARRANTY, to the extent permitted by law. >>>> >>>> Written by David J. MacKenzie and Akim Demaille. >>>> t4@REDACTED:erlexec $ >>>> >>>> >>>> Is there a specific version of autotools required to build and compile >>> erlexec? >>>> >>>> On 27 Sep 2012, at 20:11, Tim Watson wrote: >>>> >>>>> On 27 Sep 2012, at 19:18, freza@REDACTED wrote: >>>>>> Haven't been following this thread closely, but it seems erlexec > wasn't >>>>>> mentioned yet: >>>>>> >>>>>> http://code.google.com/p/erlexec/ >>>>> >>>>> Doesn't appear very well maintained. I might pick it apart and >>> rewrite it when native processes get released - it is a cool idea. >>> Anyway, for the time being it's not a great help as I'm writing a >>> framework to help set up and tear down clusters for distributed testing >>> (based largely on common test) so I want to minimise the number of >>> dependencies as much as possible. Besides, I'm more interested in >>> working on the remote/ssh runner+monitor next, rather than spending >>> another age fiddling around with the script runner. >>>>> >>>>> But yes, erlexec does look interesting and has been on my radar since >>> it popped up on this list a few months back, discussing the desire to do >>> proper signal handling (such as sending SIGTERM, SIGHUP, etc to the >>> external program) without resorting to os:cmd("kill -" ++ Code ++ " " ++ >>> OsPid). Again, this is something that linked-in drivers *can* deal with >>> to a limited extent, and therefore I suspect that native processes will >>> make for a very nice foundation on which to build an alternative to >>> open_port/2. >>>>> >>>>> Also, IIRC there was a cool command line testing framework open >>> sourced in the last year which was announced on this list. I can't >>> remember what it was called, but it has a port driver that handles the >>> the external comms and so on - looked very nice, although that's not >>> what I'm trying to do/be as my focus is on getting things in a >>> consistent state and monitoring to make sure they stay that way through >>> the test run, then tearing down nicely before the next phase kicks off. >>>>> >>>>> Cheers, >>>>> Tim >>>> >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >> From bourinov@REDACTED Sat Sep 29 11:54:22 2012 From: bourinov@REDACTED (Max Bourinov) Date: Sat, 29 Sep 2012 13:54:22 +0400 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> Message-ID: Can you please point me to the good dialyzed docs where I can find detailed description of it syntax? Best regards, Max On Fri, Sep 28, 2012 at 8:02 PM, Raoul Duke wrote: > p.s. somebody who knows erlang please port shen-qi-lisp. > > On Thu, Sep 27, 2012 at 10:29 AM, Raoul Duke wrote: > > the real technical solution would be for somebody to port the ideas of > > Typed Racket over to Lisp Flavoured Erlang. :-) > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge@REDACTED Sat Sep 29 16:03:10 2012 From: serge@REDACTED (Serge Aleynikov) Date: Sat, 29 Sep 2012 10:03:10 -0400 Subject: [erlang-questions] rebar question In-Reply-To: <76CE4188-BC5E-4DA4-8016-39CD7CDC326D@gmail.com> References: <5066197B.5020008@aleynikov.org> <76CE4188-BC5E-4DA4-8016-39CD7CDC326D@gmail.com> Message-ID: <5066FF9E.5090000@aleynikov.org> In order to compile a port program using rebar, I need to place the resulting port program in the architecture-specific folder: priv/$ARCH/exec-port where $ARCH is the result of the call: erlang:system_info(system_architecture) I was thinking of setting ARCH in the pre-compile hook. However, it doesn't seem that the "port_specs" config clause allows expansion of environment variables, so if the "ARCH" variable has a value, the following won't work: {port_specs, [{"priv/$ARCH/exec-port", ["c_src/*.cpp"]}]}. Is there a work-around I could use to accomplish this? On 9/29/2012 5:23 AM, Tim Watson wrote: > I'm a heavy rebar user and have compiled ports with it before, so give me a shout if you need any assistance. I can also do testing on several unix platforms. > > On 28 Sep 2012, at 22:41, Serge Aleynikov wrote: > >> Unfortunately I don't have OSx to test this. I can't reproduce your >> problem on Linux. Perhaps you could check the libtool version this way: >> >> $ grep "^macro_version" /usr/bin/libtool >> macro_version=2.4 >> >> and if yours is different, try to upgrade it. >> >> In order to simplify the build process I'll try to convert erlexec to >> use rebar some time next week, which will eliminate autotools-based >> toolchain. Need to figure out with rebar how to test and optionally >> enable conditional defines based on presence of special C headers such >> as "sys/capability.h" when compiling a port program. >> >> On 9/28/2012 5:16 PM, Tim Watson wrote:> Well I do, but clearly not the >> same version as you? >>> >>> t4@REDACTED:erlexec $ which libtool >>> /usr/bin/libtool >>> t4@REDACTED:erlexec $ ls -la /usr/bin/ | grep libtool >>> -r-xr-xr-x 1 root wheel 149216 22 May 15:30 libtool >>> lrwxr-xr-x 1 root wheel 7 22 May 15:30 ranlib -> libtool >>> t4@REDACTED:erlexec $ libtool --version >>> libtool: unknown option character `-' in: --version >>> Usage: libtool -static [-] file [...] [-filelist listfile[,dirname]] >> [-arch_only arch] [-sacLT] >>> Usage: libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] >> [-arch_only arch] [-o output] [-install_name name] >> [-compatibility_version #] [-current_version #] [-seg1addr 0x#] >> [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table >> ] [-seg_addr_table_filename ] [-all_load] >> [-noall_load] >>> t4@REDACTED:erlexec $ >>> >>> Honestly the osx build tool chain drives me nuts sometimes. :/ >>> >>> On 28 Sep 2012, at 17:24, Serge Aleynikov wrote: >>> >>>> Is it possible that you don't have libtool installed (missing >>>> AC_PROG_LIBTOOL)? >>>> >>>> I have the following on linux and everything builds fine: >>>> $ autoconf -V >>>> autoconf (GNU Autoconf) 2.68 >>>> $ libtool --version >>>> libtool (GNU libtool) 2.4 >>>> $ ./build >>>> $ make >>>> $ make install >>>> $ tree install >>>> install >>>> ??? exec-1.0 >>>> ??? ebin >>>> ? ??? exec.app >>>> ? ??? exec_app.beam >>>> ? ??? exec.beam >>>> ??? include >>>> ? ??? exec.hrl >>>> ??? priv >>>> ? ??? x86_64-unknown-linux-gnu >>>> ? ??? bin >>>> ? ??? exec-port >>>> ??? src >>>> ??? exec_app.erl >>>> ??? exec.erl >>>> >>>> >>>> On 9/28/2012 7:45 AM, Tim Watson wrote:> The project doesn't appear to >>>> build cleanly on mac os lion: >>>>> >>>>> t4@REDACTED:erlexec $ ./configure >>>>> configure: error: cannot find install-sh, install.sh, or shtool in >>>> config "."/config >>>>> t4@REDACTED:erlexec $ ./build >>>>> Install dir: /usr/local/src/erlang/erlexec/install >>>>> aclocal >>>>> autoconf -i >>>>> configure.ac:19: error: possibly undefined macro: AC_PROG_LIBTOOL >>>>> If this token and others are legitimate, please use >> m4_pattern_allow. >>>>> See the Autoconf documentation. >>>>> make: *** [configure] Error 1 >>>>> t4@REDACTED:erlexec $ >>>>> t4@REDACTED:erlexec $ autoconf -V >>>>> autoconf (GNU Autoconf) 2.69 >>>>> Copyright (C) 2012 Free Software Foundation, Inc. >>>>> License GPLv3+/Autoconf: GNU GPL version 3 or later >>>>> , >>>> >>>>> This is free software: you are free to change and redistribute it. >>>>> There is NO WARRANTY, to the extent permitted by law. >>>>> >>>>> Written by David J. MacKenzie and Akim Demaille. >>>>> t4@REDACTED:erlexec $ >>>>> >>>>> >>>>> Is there a specific version of autotools required to build and compile >>>> erlexec? >>>>> >>>>> On 27 Sep 2012, at 20:11, Tim Watson wrote: >>>>> >>>>>> On 27 Sep 2012, at 19:18, freza@REDACTED wrote: >>>>>>> Haven't been following this thread closely, but it seems erlexec >> wasn't >>>>>>> mentioned yet: >>>>>>> >>>>>>> http://code.google.com/p/erlexec/ >>>>>> >>>>>> Doesn't appear very well maintained. I might pick it apart and >>>> rewrite it when native processes get released - it is a cool idea. >>>> Anyway, for the time being it's not a great help as I'm writing a >>>> framework to help set up and tear down clusters for distributed testing >>>> (based largely on common test) so I want to minimise the number of >>>> dependencies as much as possible. Besides, I'm more interested in >>>> working on the remote/ssh runner+monitor next, rather than spending >>>> another age fiddling around with the script runner. >>>>>> >>>>>> But yes, erlexec does look interesting and has been on my radar since >>>> it popped up on this list a few months back, discussing the desire to do >>>> proper signal handling (such as sending SIGTERM, SIGHUP, etc to the >>>> external program) without resorting to os:cmd("kill -" ++ Code ++ " " ++ >>>> OsPid). Again, this is something that linked-in drivers *can* deal with >>>> to a limited extent, and therefore I suspect that native processes will >>>> make for a very nice foundation on which to build an alternative to >>>> open_port/2. >>>>>> >>>>>> Also, IIRC there was a cool command line testing framework open >>>> sourced in the last year which was announced on this list. I can't >>>> remember what it was called, but it has a port driver that handles the >>>> the external comms and so on - looked very nice, although that's not >>>> what I'm trying to do/be as my focus is on getting things in a >>>> consistent state and monitoring to make sure they stay that way through >>>> the test run, then tearing down nicely before the next phase kicks off. >>>>>> >>>>>> Cheers, >>>>>> Tim >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>> From hrw7@REDACTED Sat Sep 29 23:18:39 2012 From: hrw7@REDACTED (Hollin Wilkins) Date: Sat, 29 Sep 2012 14:18:39 -0700 Subject: [erlang-questions] Erlang Distribution Message-ID: Hello everyone, I am new to the mailing list. I've written several small libraries and servers in Erlang, and I am interested in learning more about its internals. Mainly, I am wondering if there are any papers on the distribution protocol for forming clusters on Erlang nodes. I have tried looking at the net_kernel and related source files to figure out how it works. But this code is quite complex, and I would understand it better with some sort of paper or companion guide to explain the protocol at a higher level. Thank you all, Hollin Wilkins -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Sun Sep 30 01:20:51 2012 From: mjtruog@REDACTED (Michael Truog) Date: Sat, 29 Sep 2012 16:20:51 -0700 Subject: [erlang-questions] Erlang Distribution In-Reply-To: References: Message-ID: <50678253.80801@gmail.com> On 09/29/2012 02:18 PM, Hollin Wilkins wrote: > Hello everyone, > > I am new to the mailing list. I've written several small libraries and servers in Erlang, and I am interested in learning more about its internals. > Mainly, I am wondering if there are any papers on the distribution protocol for forming clusters on Erlang nodes. I have tried looking at the net_kernel and related source files to figure out how it works. But this code is quite complex, and I would understand it better with some sort of paper or companion guide to explain the protocol at a higher level. > I think these links within the Erlang documentation are the most relevant: http://www.erlang.org/doc/apps/erts/erl_dist_protocol.html#id89232 http://www.erlang.org/doc/apps/erts/erl_ext_dist.html http://www.erlang.org/doc/tutorial/cnode.html I am not sure about paper references that describe the protocol. However, the external term format changes enough that a paper would probably be outdated and inaccurate. I also would be interested in a paper that goes into the details (concerns/choices/decisions) of the protocol between connected nodes (probably includes EPMD details), since that protocol probably hasn't changed as much. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wallentin.dahlberg@REDACTED Sun Sep 30 01:31:26 2012 From: wallentin.dahlberg@REDACTED (=?ISO-8859-1?Q?Bj=F6rn=2DEgil_Dahlberg?=) Date: Sun, 30 Sep 2012 01:31:26 +0200 Subject: [erlang-questions] Erlang Distribution In-Reply-To: References: Message-ID: 2012/9/29 Hollin Wilkins > Hello everyone, > > I am new to the mailing list. I've written several small libraries and > servers in Erlang, and I am interested in learning more about its internals. > Mainly, I am wondering if there are any papers on the distribution > protocol for forming clusters on Erlang nodes. I have tried looking at the > net_kernel and related source files to figure out how it works. But this > code is quite complex, and I would understand it better with some sort of > paper or companion guide to explain the protocol at a higher level. > If your looking for internals and descriptions of the protocol I can give you a few pointers: * http://www.erlang.org/doc/apps/erts/erl_dist_protocol.html - Description of the distribution protocol * http://www.erlang.org/doc/apps/erts/erl_ext_dist.html - Description of the external format used by the protocol You can find a description of the handshake protocol for erlang distribution in a "internal_doc" folder in the source code. See https://github.com/erlang/otp/blob/maint/lib/kernel/internal_doc/distribution_handshake.txt An EU Project, called the Release project (http://www.release-project.eu/), has a work package focusing on Distributed Erlang. You can find the current research here http://www.release-project.eu/documents/D3.1.pdf // Bj?rn-Egil > Thank you all, > Hollin Wilkins > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raould@REDACTED Sun Sep 30 02:53:04 2012 From: raould@REDACTED (Raoul Duke) Date: Sat, 29 Sep 2012 17:53:04 -0700 Subject: [erlang-questions] Spec is diabolical IMHO In-Reply-To: References: <058201cd9c25$6000ca80$20025f80$@gmail.com> Message-ID: On Sat, Sep 29, 2012 at 2:54 AM, Max Bourinov wrote: > Can you please point me to the good dialyzed docs where I can find detailed > description of it syntax? if you mean lfe, please talk to the honorable Mr. Virding, i think. if you mean typed racket, look at http://docs.racket-lang.org/ts-guide/ if you mean shen, see http://www.shenlanguage.org/ :-) From ok@REDACTED Sun Sep 30 23:28:47 2012 From: ok@REDACTED (Richard O'Keefe) Date: Mon, 1 Oct 2012 10:28:47 +1300 Subject: [erlang-questions] can a program launched with open_port({spawn, Cmd}, Options) remain running after the port closes? In-Reply-To: <5066197B.5020008@aleynikov.org> References: <5066197B.5020008@aleynikov.org> Message-ID: <591884F5-3D29-449C-84EC-B65BA80D752A@cs.otago.ac.nz> On 29/09/2012, at 9:41 AM, Serge Aleynikov wrote: > Unfortunately I don't have OSx to test this. I can't reproduce your > problem on Linux. Perhaps you could check the libtool version this way: > > $ grep "^macro_version" /usr/bin/libtool > macro_version=2.4 > > and if yours is different, try to upgrade it. It's not a version issue. The Mac OS X libtool and the Linux libtool program are not versions of the same program. Gordon Matzigkeit's Linux libtool is a shell script. Apple's /Developer/usr/bin/libtool is a Mach-O universal binary. They don't do the same thing. The Apple is (waves hands vaguely) a replacement for ar+ranlib and also generates .dylib files. To find the version of Apple's libtool: m% libtool -V Apple Computer, Inc. version cctools-800 From serge@REDACTED Sun Sep 30 23:29:26 2012 From: serge@REDACTED (Serge Aleynikov) Date: Sun, 30 Sep 2012 17:29:26 -0400 Subject: [erlang-questions] Erlang http servers Message-ID: <5068B9B6.6070800@aleynikov.org> Haven't had a need for an HTTP server in Erlang for a while since I last used inets-based http server five years back, and now examining what exists in public domain. The results are quite surprising - everyone who seems comfortable coding in Erlang, feels compelled to implement an HTTP server. Previously we had only one contender to inets - yaws. Now the landscape is quite a mouthful - inets, yaws, cowboy, musultin, mochiweb, etc. As Steve Vinoski rightfully points out (*) this doesn't help to pull the blanket in all directions. From personal experience with inets, I recall that once I figured out how to use it, it happened to be a very helpful and powerful HTTP library for building an application server. So why don't all the authors of those wonderful alternative libraries just patch the inets to extend it with something they feel missing so that we only have one good and documented library to use as the common denominator? Serge (*) http://steve.vinoski.net/blog/2011/05/09/erlang-web-server-benchmarking