From yueyoum@REDACTED Mon Dec 1 06:25:08 2014 From: yueyoum@REDACTED (=?UTF-8?B?5pyI5b+n6IyX?=) Date: Mon, 1 Dec 2014 13:25:08 +0800 Subject: [erlang-questions] Protobuf library choosing? Message-ID: There is two libraries for using protobuf in erlang: https://github.com/basho/erlang_protobuffs https://github.com/tomas-abrahamsson/gpb Which one is easy to use? In my simple test, pgb is more easy to use, but why erlang_protobuffs is more popular ? -- My GitHub https://github.com/yueyoum -------------- next part -------------- An HTML attachment was scrubbed... URL: From liuyang124846@REDACTED Mon Dec 1 06:41:53 2014 From: liuyang124846@REDACTED (Yang Liu) Date: Mon, 1 Dec 2014 13:41:53 +0800 Subject: [erlang-questions] Protobuf library choosing? In-Reply-To: References: Message-ID: it must be basho erlang_protobuff,i use it in all my company's game, it is good and stable On Monday, December 1, 2014, ??? wrote: > > There is two libraries for using protobuf in erlang: > > > https://github.com/basho/erlang_protobuffs > > https://github.com/tomas-abrahamsson/gpb > > > Which one is easy to use? > > > In my simple test, pgb is more easy to use, > but why erlang_protobuffs is more popular ? > > -- > My GitHub > https://github.com/yueyoum > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yueyoum@REDACTED Mon Dec 1 06:49:31 2014 From: yueyoum@REDACTED (=?UTF-8?B?5pyI5b+n6IyX?=) Date: Mon, 1 Dec 2014 13:49:31 +0800 Subject: [erlang-questions] Protobuf library choosing? In-Reply-To: References: Message-ID: gpb auto cover messages to erlang record, gpb encode_msg encode record to binary, decode_msg decode binary to record this is very convenient. So, erlang_protobuff can do this? 2014-12-01 13:41 GMT+08:00 Yang Liu : > it must be basho erlang_protobuff,i use it in all my company's game, it is > good and stable > > > On Monday, December 1, 2014, ??? wrote: > > > > There is two libraries for using protobuf in erlang: > > > > > > https://github.com/basho/erlang_protobuffs > > > > https://github.com/tomas-abrahamsson/gpb > > > > > > Which one is easy to use? > > > > > > In my simple test, pgb is more easy to use, > > but why erlang_protobuffs is more popular ? > > > > -- > > My GitHub > > https://github.com/yueyoum > > > > > -- My GitHub https://github.com/yueyoum -------------- next part -------------- An HTML attachment was scrubbed... URL: From liuyang124846@REDACTED Mon Dec 1 06:35:50 2014 From: liuyang124846@REDACTED (ly) Date: Mon, 1 Dec 2014 13:35:50 +0800 Subject: [erlang-questions] Protobuf library choosing? In-Reply-To: References: Message-ID: it must be bash's erlang_protobuffs, i use it in all games in my company,it is really good and stable. ? 2014-12-1???1:25???? ??? > > There is two libraries for using protobuf in erlang: > > > https://github.com/basho/erlang_protobuffs > > https://github.com/tomas-abrahamsson/gpb > > > Which one is easy to use? > > > In my simple test, pgb is more easy to use, > but why erlang_protobuffs is more popular ? > > -- > My GitHub > https://github.com/yueyoum > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahe.sanath@REDACTED Mon Dec 1 11:49:27 2014 From: ahe.sanath@REDACTED (Sanath Prasanna) Date: Mon, 1 Dec 2014 16:19:27 +0530 Subject: [erlang-questions] replace Result error Message-ID: Hi, I used following & return wrong result. How can I correct that ? re:replace("stop Ads ? to 1111", "", "pair&lovely", [{return,list}, global]). Result => "stop Ads ? pairlovely to 1111" expected Result => "stop Ads ? pair&lovely to 1111" Br, Sanath Roberto -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgolovan@REDACTED Mon Dec 1 11:55:50 2014 From: sgolovan@REDACTED (Sergei Golovan) Date: Mon, 1 Dec 2014 13:55:50 +0300 Subject: [erlang-questions] replace Result error In-Reply-To: References: Message-ID: Hi Sanath, On Mon, Dec 1, 2014 at 1:49 PM, Sanath Prasanna wrote: > Hi, > I used following & return wrong result. How can I correct that ? > > > re:replace("stop Ads ? to 1111", > "", "pair&lovely", [{return,list}, global]). > Result => "stop Ads ? pairlovely to 1111" & in substitution pattern means "the matching string". To insert the literal & you'll have to escape it. Try re:replace("stop Ads ? to 1111","", "pair\\&lovely", [{return,list}, global]). (the second backslash is necessary because otherwise it escapes the following & and vanishes). Cheers! -- Sergei Golovan From zweicmu@REDACTED Mon Dec 1 12:18:52 2014 From: zweicmu@REDACTED (Zhibo Wei) Date: Mon, 1 Dec 2014 03:18:52 -0800 Subject: [erlang-questions] Protobuf library choosing? Message-ID: I've used both libraries, I'd say gpb would be a better choice at this point.It provides you better code quality where the pokemon stuff (in erlang_protobufs) cannot do. erlang_protobuffs is stable, but hasnt been updated for a long time. As the author of erlang_protobuffs mentioned in this thread https://github.com/basho/erlang_protobuffs/pull/69, it will probably get rewritten in the future, but for now, I'd stick with gpb. On Mon, Dec 1, 2014 at 3:00 AM, wrote: > > Message: 2 > Date: Mon, 1 Dec 2014 13:25:08 +0800 > From: ??? > To: Erlang Questions > Subject: [erlang-questions] Protobuf library choosing? > Message-ID: > iVJ2q8k2xyP+g@REDACTED> > Content-Type: text/plain; charset="utf-8" > > There is two libraries for using protobuf in erlang: > > > https://github.com/basho/erlang_protobuffs > > https://github.com/tomas-abrahamsson/gpb > > > Which one is easy to use? > > > In my simple test, pgb is more easy to use, > but why erlang_protobuffs is more popular ? > > -- > My GitHub > https://github.com/yueyoum > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://erlang.org/pipermail/erlang-questions/attachments/20141201/f9b7822b/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Mon, 1 Dec 2014 13:41:53 +0800 > From: Yang Liu > To: ??? > Cc: Erlang Questions > Subject: Re: [erlang-questions] Protobuf library choosing? > Message-ID: > twuOQztY-Toge_4g@REDACTED> > Content-Type: text/plain; charset="utf-8" > > it must be basho erlang_protobuff,i use it in all my company's game, it is > good and stable > > On Monday, December 1, 2014, ??? wrote: > > > > There is two libraries for using protobuf in erlang: > > > > > > https://github.com/basho/erlang_protobuffs > > > > https://github.com/tomas-abrahamsson/gpb > > > > > > Which one is easy to use? > > > > > > In my simple test, pgb is more easy to use, > > but why erlang_protobuffs is more popular ? > > > > -- > > My GitHub > > https://github.com/yueyoum > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://erlang.org/pipermail/erlang-questions/attachments/20141201/62519514/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Mon, 1 Dec 2014 13:49:31 +0800 > From: ??? > To: Yang Liu > Cc: Erlang Questions > Subject: Re: [erlang-questions] Protobuf library choosing? > Message-ID: > 8aaBVtYXKd4g@REDACTED> > Content-Type: text/plain; charset="utf-8" > > gpb auto cover messages to erlang record, > gpb encode_msg encode record to binary, decode_msg decode binary to record > this is very convenient. > > So, erlang_protobuff can do this? > > 2014-12-01 13:41 GMT+08:00 Yang Liu : > > > it must be basho erlang_protobuff,i use it in all my company's game, it > is > > good and stable > > > > > > On Monday, December 1, 2014, ??? wrote: > > > > > > There is two libraries for using protobuf in erlang: > > > > > > > > > https://github.com/basho/erlang_protobuffs > > > > > > https://github.com/tomas-abrahamsson/gpb > > > > > > > > > Which one is easy to use? > > > > > > > > > In my simple test, pgb is more easy to use, > > > but why erlang_protobuffs is more popular ? > > > > > > -- > > > My GitHub > > > https://github.com/yueyoum > > > > > > > > > > > > -- > My GitHub > https://github.com/yueyoum > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://erlang.org/pipermail/erlang-questions/attachments/20141201/33b4486f/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Mon, 1 Dec 2014 13:35:50 +0800 > From: ly > To: ??? > Cc: Erlang Questions > Subject: Re: [erlang-questions] Protobuf library choosing? > Message-ID: > Content-Type: text/plain; charset="gb2312" > > it must be bash's erlang_protobuffs, i use it in all games in my > company,it is really good and stable. > ? 2014-12-1???1:25???? ??? > > > > > There is two libraries for using protobuf in erlang: > > > > > > https://github.com/basho/erlang_protobuffs > > > > https://github.com/tomas-abrahamsson/gpb > > > > > > Which one is easy to use? > > > > > > In my simple test, pgb is more easy to use, > > but why erlang_protobuffs is more popular ? > > > > -- > > My GitHub > > https://github.com/yueyoum > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Mon Dec 1 16:39:08 2014 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 1 Dec 2014 15:39:08 +0000 Subject: [erlang-questions] Make application a dependency, but don't start it? Message-ID: I'm in need of a short-term hack where I have applications A and B. I need to make the beam files from B available to A when building my release, but I *don't* want to start B. I'm using relx. Unfortunately, B is a non-library application -- it has a {mod, {Mod, Args}} term in its .app file; I can't change this. If I add B to A.app.src, then relx includes it in the boot script and starts it. If I add B to A/relx.config as a goal of the release, the same happens. How can I make a release of A that includes B without application:start(B) being called? From t@REDACTED Mon Dec 1 16:43:53 2014 From: t@REDACTED (Tristan Sloughter) Date: Mon, 01 Dec 2014 09:43:53 -0600 Subject: [erlang-questions] Make application a dependency, but don't start it? In-Reply-To: References: Message-ID: <1417448633.2030666.197350665.58FEB361@webmail.messagingengine.com> In relx.config do: {release, {, }, [A, {B, load}]}. -- Tristan Sloughter t@REDACTED On Mon, Dec 1, 2014, at 09:39 AM, Roger Lipscombe wrote: > I'm in need of a short-term hack where I have applications A and B. I > need to make the beam files from B available to A when building my > release, but I *don't* want to start B. > > I'm using relx. > > Unfortunately, B is a non-library application -- it has a {mod, {Mod, > Args}} term in its .app file; I can't change this. > > If I add B to A.app.src, then relx includes it in the boot script and > starts it. > If I add B to A/relx.config as a goal of the release, the same happens. > > How can I make a release of A that includes B without > application:start(B) being called? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From davidnwelton@REDACTED Mon Dec 1 16:44:19 2014 From: davidnwelton@REDACTED (David Welton) Date: Mon, 1 Dec 2014 16:44:19 +0100 Subject: [erlang-questions] Make application a dependency, but don't start it? In-Reply-To: References: Message-ID: Does {mochiweb, load}, in relx.config work? Like: % Generated by update_version.sh from relx.config.in {release, {gsd_web, "0.6.2"}, %% A lot of these should probably be relocated to the .app.src %% "applications" section for whatever depends on them. [ cowboy, lager, lager_syslog, {mimetypes, load}, {mochiweb, load}, {observer, load}, ... On Mon, Dec 1, 2014 at 4:39 PM, Roger Lipscombe wrote: > I'm in need of a short-term hack where I have applications A and B. I > need to make the beam files from B available to A when building my > release, but I *don't* want to start B. > > I'm using relx. > > Unfortunately, B is a non-library application -- it has a {mod, {Mod, > Args}} term in its .app file; I can't change this. > > If I add B to A.app.src, then relx includes it in the boot script and starts it. > If I add B to A/relx.config as a goal of the release, the same happens. > > How can I make a release of A that includes B without > application:start(B) being called? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From roger@REDACTED Mon Dec 1 17:45:08 2014 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 1 Dec 2014 16:45:08 +0000 Subject: [erlang-questions] Make application a dependency, but don't start it? In-Reply-To: References: Message-ID: On 1 December 2014 at 15:44, David Welton wrote: > Does > > {mochiweb, load}, > > in relx.config work? Yes, it does. Thanks. From lukas@REDACTED Tue Dec 2 10:38:13 2014 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 2 Dec 2014 10:38:13 +0100 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: <20140418123352.GA68518@ferdair.local> Message-ID: Hello Max, Just wanted to let you know that I think that we have found the bug/behaviour that was creating the memory fragmentation and performance issues for you. You can read about the problem here: https://github.com/erlang/otp/blob/maint/erts/emulator/internal_doc/CarrierMigration.md#searching-the-pool A fix is merged into the maint branch on github and will be included in 17.4. Lukas On Fri, May 2, 2014 at 7:31 AM, Max Lapshin wrote: > Lukas, thank you a lot. > > > I've added +MBacul 0 and everything is very stable now. Memory > consumption back is normal, system is performing normally. > > Before I've added this problem was not only with memory usage. When server > allocated 12 GB RAM, it was performing very badly. > > Can I help somehow else to enhance it? > > > > _______________________________________________ > 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 Dec 2 11:13:31 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 2 Dec 2014 13:13:31 +0300 Subject: [erlang-questions] Possibly memory leak in R17 In-Reply-To: References: <20140418123352.GA68518@ferdair.local> Message-ID: Lukas, it is very, very, very good! Thank you a lot, I will update immediately as 17.4 ready. On Tue, Dec 2, 2014 at 12:38 PM, Lukas Larsson wrote: > Hello Max, > > Just wanted to let you know that I think that we have found the > bug/behaviour that was creating the memory fragmentation and performance > issues for you. You can read about the problem here: > https://github.com/erlang/otp/blob/maint/erts/emulator/internal_doc/CarrierMigration.md#searching-the-pool > > A fix is merged into the maint branch on github and will be included in > 17.4. > > Lukas > > On Fri, May 2, 2014 at 7:31 AM, Max Lapshin wrote: > >> Lukas, thank you a lot. >> >> >> I've added +MBacul 0 and everything is very stable now. Memory >> consumption back is normal, system is performing normally. >> >> Before I've added this problem was not only with memory usage. When >> server allocated 12 GB RAM, it was performing very badly. >> >> Can I help somehow else to enhance it? >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karol.urbanski@REDACTED Tue Dec 2 17:37:41 2014 From: karol.urbanski@REDACTED (Karol Urbanski) Date: Tue, 2 Dec 2014 17:37:41 +0100 Subject: [erlang-questions] New Erlang Solutions packages with bundled common apps - survey Message-ID: <20141202163741.GB670@dex.erlang-solutions.com> Hi, we're planning to create new custom Erlang packages that will be uploaded alongside our current, standard OTP offerings. We're aiming to add applications that many people use and love, while perhaps removing some of the apps deemed less useful. Please, take part in this survey: https://www.surveymonkey.com/r/customerlangpackages and let us know what you would like to see in the new package. Your input will be much appreciated, and will allow us to create packages that better fit your needs. If you have any additional opinions, ideas or suggestions, you can use the comment box or, of course, reply here/to me. Best regards, Karol Urbanski From mss@REDACTED Tue Dec 2 18:08:38 2014 From: mss@REDACTED (Mikhail Sobolev) Date: Tue, 2 Dec 2014 19:08:38 +0200 Subject: [erlang-questions] [ANN] enacl v0.9.0 - NaCl/libsodium encryption for Erlang In-Reply-To: References: Message-ID: <20141202170838.GA3870@mawhrin.net> On Sat, Nov 29, 2014 at 10:30:36PM +0100, Jesper Louis Andersen wrote: > I've decided to implement yet another set of bindings for NaCl for Erlang > as a set of C NIFs. > > https://github.com/jlouis/enacl > Thank you very much for this library. -- Misha From tty.erlang@REDACTED Tue Dec 2 19:08:27 2014 From: tty.erlang@REDACTED (T Ty) Date: Tue, 2 Dec 2014 18:08:27 +0000 Subject: [erlang-questions] [ANN] Map to/from Records Parse Transform Message-ID: Quick tutorial on Erlang Parse Transform with maps and records http://erlangcentral.org/wiki/index.php?title=Maprec_parse_transform -------------- next part -------------- An HTML attachment was scrubbed... URL: From joakim@REDACTED Wed Dec 3 00:32:22 2014 From: joakim@REDACTED (Joakim Hirsch) Date: Wed, 03 Dec 2014 00:32:22 +0100 Subject: [erlang-questions] wxDatePickerCtrl and invalid value Message-ID: <547E4C06.3040902@snookerhallen.se> Hi, I've run into a problem with the wxDatePickerCtrl when creating it with flag ?wxDP_ALLOWNONE. This flag allows the control to have an undefined/invalid value. The control is adorned with a checkbox, which is checked if the value is defined/valid. When the control is created, the checkbox is unchecked (invalid). Retrieving the value renders "the invalid value" {{1970, 1, 1}, {0, 59, 59}}. I need to be able to reset the value of the control to invalid sometimes, but the interface of wxDatePickerCtrl doesn't offer a reset or any way to affect the checkbox. One idea is to set the control value to the invalid value, but that doesn't do it. The control will return {{1970, 1, 1}, {0, 0, 0}} and the checkbox is checked (valid). It would perhaps have been possible to work around this by replacing the control with a new one. It would be necessary to get the parent and containing sizer and to copy name, size, style (and id but I'm not using it), and range -- all quite possible, except for the range. The function wxDatePickerCtrl:getRange(This, Dt1, Dt2) -> boolean() does not return the range. The wxWidgets method is defined as boolean GetRange(wxDateTime*dt1, wxDateTime* dt2) const and will fill the supplied parameters with the range values in a C way. So my next idea is to combine a checkbox and a date picker (without the allow-none style) myself. Maybe someone has a better suggestion, or can teach me how to work the date picker? I'm running Erlang/OTP 17 Here's a sample. All the interesting stuff is in do_init/1. Any help would be much appreciated. BR Joakim Hirsch -module(test_gui). -behaviour(wx_object). %% Client API -export([start/0]). %% wx_object callbacks -export([init/1, terminate/2, code_change/3, handle_info/2, handle_call/3, handle_cast/2, handle_event/2, handle_sync_event/3]). -include_lib("wx/include/wx.hrl"). -record(state, { parent }). start() -> Wx = wx:new(), Size = {size, {500, 500}}, Frame = wxFrame:new(Wx, ?wxID_ANY, "Title", [Size]), Config = [{parent, Frame}], wx_object:start_link(?MODULE, Config, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% init(Config) -> wx:batch(fun() -> do_init(Config) end). do_init(Config) -> Frame = proplists:get_value(parent, Config), Panel = wxPanel:new(Frame), Style = ?wxDP_DROPDOWN bor ?wxDP_ALLOWNONE, Ctrl = wxDatePickerCtrl:new(Panel, ?wxID_ANY, [{style, Style}, {size, {200, -1}}]), wxFrame:show(Frame), %% Ctrl displays todays date but the %% checkbox is unchecked <=> invalid value timer:sleep(5000), %% Value is "the invalid value". Invalid = {{1970, 1, 1}, {0, 59, 59}}, Invalid = wxDatePickerCtrl:getValue(Ctrl), wxDatePickerCtrl:setValue(Ctrl, Invalid), %% Ctrl displays {1970, 1, 1} %% Checkbox is now checked <=> valid value %% Value is not invalid anymore. Valid = {{1970, 1, 1}, {0, 0, 0}}, Valid = wxDatePickerCtrl:getValue(Ctrl), {Frame, #state{parent = Frame}}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Sync events i.e. from callbacks must return ok, it can not return a %% new state. Do the redrawing here. handle_sync_event(#wx{event = #wxPaint{}},_, #state{}) -> ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Callbacks handled as normal gen_server callbacks %% %% Unknown event. %% handle_event(Ev = #wx{}, State) -> io:format("Got event:~p\n", [Ev]), {noreply, State}. handle_info(Msg, State) -> io:format("Got Info ~p\n", [Msg]), {noreply, State}. handle_call(shutdown, _From, State=#state{parent=Frame}) -> io:format("Shutdown~n", []), wxFrame:destroy(Frame), {stop, normal, ok, State}; handle_call(Msg, _From, State) -> io:format("Got Call ~p\n", [Msg]), {reply, {error, unknown_call}, State}. handle_cast(Msg, State) -> io:format("Got cast ~p~n",[Msg]), {noreply, State}. code_change(_, _, State) -> {stop, ignore, State}. terminate(_Reason, _State) -> io:format("Stopping~n", []), wx:destroy(), ok. From ct.radu.001@REDACTED Wed Dec 3 14:03:17 2014 From: ct.radu.001@REDACTED (CT Radu) Date: Wed, 3 Dec 2014 15:03:17 +0200 Subject: [erlang-questions] Removing SSL v3 support from the ssl module In-Reply-To: References: <20141015091030.GA52663@k2r.org> <368069533.74861.1413365696097.JavaMail.zimbra@tpip.net> <16095605.Z2g7XaJzps@moltowork> <54760510.3030909@rabbitmq.com> Message-ID: Hi all, Thanks for all the advice. I've modified the header and also started the application with -ssl protocol_version [tlsv1, 'tlsv1.1', 'tlsv1.2'] and it seems to work ssl:versions(). [{ssl_app,"5.1.2"}, {supported,['tlsv1.2','tlsv1.1',tlsv1]}, {available,['tlsv1.2','tlsv1.1',tlsv1]}] However, it seems that I still get an SSLv3 openssl s_client -ssl3 -connect 127.0.0.1:8936 |grep "Protocol" Protocol : SSLv3 Cipher : DHE-RSA-AES256-SHA Any ideas what I may have missed ? Many thanks, Tiberiu 2014-11-26 23:07 GMT+02:00 Ingela Andin : > Hi! > > 2014-11-26 17:51 GMT+01:00 Simon MacMullen : > >> On 26/11/14 15:36, CT Radu wrote: >> >>> I am currently stuck with a R15 erlang release and I do want to disable >>> sslv3 on listening connections. >>> >> >> You can't. The bug OTP-10905 prevents setting SSL versions at all on >> older versions. You need at least R16B01. >> >> > No you can not do it cleanly, but you could always patch the ssl header > file which defines the system default and then recompile as a workaround. > > > Regards Ingela Erlang/OTP team - Ericsson AB > > > >> Sorry. >> >> Cheers, Simon >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From russelldb@REDACTED Wed Dec 3 15:16:26 2014 From: russelldb@REDACTED (Russell Brown) Date: Wed, 3 Dec 2014 14:16:26 +0000 Subject: [erlang-questions] orddict and dict and types Message-ID: <91296141-08F6-4B75-AAF9-E243142F604F@basho.com> Hi, I swapped orddict for dict in a module. When I used orddict I took advantage of the fact orddict was just a list to have some nice detailed types. I see that dict has the type dict(key, value) in the documentation, but it?s not exported. Now I seem to have lost all that richness I was able to express with orddict (or [{Key, Val}] anyway.) Is there anyway to keep the detailed type specs and use dict() you can think of? Why does dict.erl not export dict(K, V) ? Cheers Russell From kostis@REDACTED Wed Dec 3 15:23:40 2014 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 03 Dec 2014 15:23:40 +0100 Subject: [erlang-questions] orddict and dict and types In-Reply-To: <91296141-08F6-4B75-AAF9-E243142F604F@basho.com> References: <91296141-08F6-4B75-AAF9-E243142F604F@basho.com> Message-ID: <547F1CEC.4030604@cs.ntua.gr> On 12/03/2014 03:16 PM, Russell Brown wrote: > I swapped orddict for dict in a module. When I used orddict I took advantage of the fact orddict was just a list to have some nice detailed types. I see that dict has the type dict(key, value) in the documentation, but it?s not exported. Now I seem to have lost all that richness I was able to express with orddict (or [{Key, Val}] anyway.) > > Is there anyway to keep the detailed type specs and use dict() you can think of? Why does dict.erl not export dict(K, V) ? Your message makes no sense without mentioning the OTP release you are referring to. In e.g. OTP_17.0/lib/stdlib/src/dict.erl, in OTP 17.3, and the current maint branch I see the following line: -export_type([dict/0, dict/2]). Kostis From magnus@REDACTED Wed Dec 3 15:23:31 2014 From: magnus@REDACTED (Magnus Henoch) Date: Wed, 03 Dec 2014 14:23:31 +0000 Subject: [erlang-questions] orddict and dict and types In-Reply-To: <91296141-08F6-4B75-AAF9-E243142F604F@basho.com> (Russell Brown's message of "Wed, 3 Dec 2014 14:16:26 +0000") References: <91296141-08F6-4B75-AAF9-E243142F604F@basho.com> Message-ID: Russell Brown writes: > Hi, I swapped orddict for dict in a module. When I used orddict I took > advantage of the fact orddict was just a list to have some nice > detailed types. I see that dict has the type dict(key, value) in the > documentation, but it?s not exported. Now I seem to have lost all that > richness I was able to express with orddict (or [{Key, Val}] anyway.) > > Is there anyway to keep the detailed type specs and use dict() you can > think of? Why does dict.erl not export dict(K, V) ? In 17.0, the type dict:dict/2 is exported. Perhaps you're using an earlier version? Regards, Magnus From russelldb@REDACTED Wed Dec 3 15:25:55 2014 From: russelldb@REDACTED (Russell Brown) Date: Wed, 3 Dec 2014 14:25:55 +0000 Subject: [erlang-questions] orddict and dict and types In-Reply-To: References: <91296141-08F6-4B75-AAF9-E243142F604F@basho.com> Message-ID: On 3 Dec 2014, at 14:23, Magnus Henoch wrote: > Russell Brown writes: > >> Hi, I swapped orddict for dict in a module. When I used orddict I took >> advantage of the fact orddict was just a list to have some nice >> detailed types. I see that dict has the type dict(key, value) in the >> documentation, but it?s not exported. Now I seem to have lost all that >> richness I was able to express with orddict (or [{Key, Val}] anyway.) >> >> Is there anyway to keep the detailed type specs and use dict() you can >> think of? Why does dict.erl not export dict(K, V) ? > > In 17.0, the type dict:dict/2 is exported. Perhaps you're using an > earlier version? Yes! My mistake, I?m using r16, thanks. > > Regards, > Magnus From russelldb@REDACTED Wed Dec 3 15:27:19 2014 From: russelldb@REDACTED (Russell Brown) Date: Wed, 3 Dec 2014 14:27:19 +0000 Subject: [erlang-questions] orddict and dict and types In-Reply-To: <547F1CEC.4030604@cs.ntua.gr> References: <91296141-08F6-4B75-AAF9-E243142F604F@basho.com> <547F1CEC.4030604@cs.ntua.gr> Message-ID: On 3 Dec 2014, at 14:23, Kostis Sagonas wrote: > On 12/03/2014 03:16 PM, Russell Brown wrote: >> I swapped orddict for dict in a module. When I used orddict I took advantage of the fact orddict was just a list to have some nice detailed types. I see that dict has the type dict(key, value) in the documentation, but it?s not exported. Now I seem to have lost all that richness I was able to express with orddict (or [{Key, Val}] anyway.) >> >> Is there anyway to keep the detailed type specs and use dict() you can think of? Why does dict.erl not export dict(K, V) ? > > Your message makes no sense without mentioning the OTP release you are referring to. In e.g. OTP_17.0/lib/stdlib/src/dict.erl, in OTP 17.3, and the current maint branch I see the following line: Ha! No sense at all. I?m amazed you could read it, but thankfully you did! I didn?t think to look at version I wasn?t using. You are quite right, it is rectified in 17+. I will have to wait for riak to catch up. > > -export_type([dict/0, dict/2]). > > Kostis From bchesneau@REDACTED Wed Dec 3 22:14:41 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 3 Dec 2014 22:14:41 +0100 Subject: [erlang-questions] minor releases in Erlang? Message-ID: It has been probably answered before, but what is the reason to not make official release for minor updates? Ie. when a version is tagged a release could be made available to the community. Today that could be done using any CI tool so I guess the reason is other. I am asking because today an SSL issue was raised in hackney. I am generally using the latest tag, or recent version so I didn't noticed that the code I was using wasn't working for all certificates on previous version: https://github.com/benoitc/hackney/issues/141 I am not sure right now how to solve such issue. Is there a way to test the minor version available? On the other hand sometimes as a temporary workaround I could point someone to use the last release. But in this case that not simple, since it imply a build and in some infrastructure it would be impossible. How others do? - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Wed Dec 3 23:29:52 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 04 Dec 2014 00:29:52 +0200 Subject: [erlang-questions] minor releases in Erlang? In-Reply-To: References: Message-ID: <547F8EE0.3030308@ninenines.eu> I'd like to add my 2 cents. Many users are hit by this issue, and many users will be hit by this issue at least until 17.4 is released (and that's me hoping 17.4 will be an official release). A week ago I helped 2 users solve this issue on this very same mailing list (solution: using kerl git, or downgrade). Yesterday I helped a user by email that had this issue. Over just the past couple weeks I also had some tickets or answered IRC questions about this issue, both for my software, other third party software and software coming with OTP (httpc). It is my opinion that it was a terrible decision (if one was even considered) not to have made 17.3.2 be a full official release. This bug breaks several applications that come with OTP. All code that uses SSL as a client is broken. We can only hope that few users will decide to settle on 17.3, because otherwise we will have to "fix" this issue for a long time to come. It is a breaking bug the same way syntax_tools was broken before and a new release was issued. I am not sure why this didn't happen this time? There's probably more code that makes use of the client SSL code than syntax_tools... Hope this email does not sound too catastrophic... On 12/03/2014 11:14 PM, Benoit Chesneau wrote: > It has been probably answered before, but what is the reason to not make > official release for minor updates? Ie. when a version is tagged a > release could be made available to the community. Today that could be > done using any CI tool so I guess the reason is other. > > I am asking because today an SSL issue was raised in hackney. I am > generally using the latest tag, or recent version so I didn't noticed > that the code I was using wasn't working for all certificates on > previous version: > > https://github.com/benoitc/hackney/issues/141 > > I am not sure right now how to solve such issue. Is there a way to test > the minor version available? On the other hand sometimes as a temporary > workaround I could point someone to use the last release. But in this > case that not simple, since it imply a build and in some infrastructure > it would be impossible. How others do? > > - benoit > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From comptekki@REDACTED Thu Dec 4 04:26:49 2014 From: comptekki@REDACTED (Wes James) Date: Wed, 3 Dec 2014 20:26:49 -0700 Subject: [erlang-questions] minor releases in Erlang? In-Reply-To: <547F8EE0.3030308@ninenines.eu> References: <547F8EE0.3030308@ninenines.eu> Message-ID: And the help was very much appreciated! I installed kerl ran it as suggested. Went in to ~/.kerl/builds/17.3.4/otp_src_git and ran: sudo make install and I was on my way! Merci! -wes On Wed, Dec 3, 2014 at 3:29 PM, Lo?c Hoguin wrote: > I'd like to add my 2 cents. > > Many users are hit by this issue, and many users will be hit by this issue > at least until 17.4 is released (and that's me hoping 17.4 will be an > official release). > > A week ago I helped 2 users solve this issue on this very same mailing > list (solution: using kerl git, or downgrade). > > Yesterday I helped a user by email that had this issue. > > Over just the past couple weeks I also had some tickets or answered IRC > questions about this issue, both for my software, other third party > software and software coming with OTP (httpc). > > It is my opinion that it was a terrible decision (if one was even > considered) not to have made 17.3.2 be a full official release. This bug > breaks several applications that come with OTP. All code that uses SSL as a > client is broken. We can only hope that few users will decide to settle on > 17.3, because otherwise we will have to "fix" this issue for a long time to > come. > > It is a breaking bug the same way syntax_tools was broken before and a new > release was issued. I am not sure why this didn't happen this time? There's > probably more code that makes use of the client SSL code than > syntax_tools... > > Hope this email does not sound too catastrophic... > > > On 12/03/2014 11:14 PM, Benoit Chesneau wrote: > >> It has been probably answered before, but what is the reason to not make >> official release for minor updates? Ie. when a version is tagged a >> release could be made available to the community. Today that could be >> done using any CI tool so I guess the reason is other. >> >> I am asking because today an SSL issue was raised in hackney. I am >> generally using the latest tag, or recent version so I didn't noticed >> that the code I was using wasn't working for all certificates on >> previous version: >> >> https://github.com/benoitc/hackney/issues/141 >> >> I am not sure right now how to solve such issue. Is there a way to test >> the minor version available? On the other hand sometimes as a temporary >> workaround I could point someone to use the last release. But in this >> case that not simple, since it imply a build and in some infrastructure >> it would be impossible. How others do? >> >> - benoit >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- > Lo?c Hoguin > http://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dch@REDACTED Thu Dec 4 08:23:50 2014 From: dch@REDACTED (Dave Cottlehuber) Date: Thu, 4 Dec 2014 08:23:50 +0100 Subject: [erlang-questions] minor releases in Erlang? In-Reply-To: References: <547F8EE0.3030308@ninenines.eu> Message-ID: > On Wed, Dec 3, 2014 at 3:29 PM, Lo?c Hoguin wrote: > > > I'd like to add my 2 cents. > > > > Many users are hit by this issue, and many users will be hit by this issue > > at least until 17.4 is released (and that's me hoping 17.4 will be an > > official release). A+, Dave ? sent from my Couch +1 We?ve avoided this to a point on OSX & FreeBSD by getting the upstream patch included in homebrew and FreeBSD pkg promptly, pointing to the ?secret? 17.3.4 tarball or before that was available including the single patch. I am sure the OTP team has good reasons for not doing the full publicity run, but a simple announcement email of the new unofficial release tag on the ML would be a great compromise in ensuring distro packages are able to be updated, hopefully with minimising additional work on their side. Dave From mjtruog@REDACTED Thu Dec 4 09:14:27 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 04 Dec 2014 00:14:27 -0800 Subject: [erlang-questions] minor releases in Erlang? In-Reply-To: References: Message-ID: <548017E3.50601@gmail.com> Even just a simple announcement that a new tag exists could help it receive testing. That could make these minor updates more of a real "open source" release, due to public communication that encourages its use publicly. The extra testing would help us determine when an Erlang release will not fail in testing or production due to bugs. On 12/03/2014 01:14 PM, Benoit Chesneau wrote: > It has been probably answered before, but what is the reason to not make official release for minor updates? Ie. when a version is tagged a release could be made available to the community. Today that could be done using any CI tool so I guess the reason is other. > > I am asking because today an SSL issue was raised in hackney. I am generally using the latest tag, or recent version so I didn't noticed that the code I was using wasn't working for all certificates on previous version: > > https://github.com/benoitc/hackney/issues/141 > > I am not sure right now how to solve such issue. Is there a way to test the minor version available? On the other hand sometimes as a temporary workaround I could point someone to use the last release. But in this case that not simple, since it imply a build and in some infrastructure it would be impossible. How others do? > > - benoit > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Thu Dec 4 10:33:27 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 4 Dec 2014 10:33:27 +0100 Subject: [erlang-questions] make.erl vs ct_make.erl Message-ID: Hi, I just noticed that make.erl and ct_make.erl are almost identical. There are a few things in each that aren't in the other, but it looks like it should be possible to eliminate the duplication by merging everything to make.erl. One point to argue about is that the return value in case of error is 'error' for make and {error, Info} for ct_make. This could be addressed by extending the API, so that users of make won't be affected. Another point would be that the 'common_test' application now would depend on 'tools'. Can this be a problem? best regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidnwelton@REDACTED Thu Dec 4 15:18:17 2014 From: davidnwelton@REDACTED (David Welton) Date: Thu, 4 Dec 2014 15:18:17 +0100 Subject: [erlang-questions] minor releases in Erlang? In-Reply-To: <548017E3.50601@gmail.com> References: <548017E3.50601@gmail.com> Message-ID: On Thu, Dec 4, 2014 at 9:14 AM, Michael Truog wrote: > Even just a simple announcement that a new tag exists could help it receive > testing. That could make these minor updates more of a real "open source" > release, due to public communication that encourages its use publicly. The > extra testing would help us determine when an Erlang release will not fail > in testing or production due to bugs. +1 - although it would not be hard to automate that ourselves: https://api.github.com/repos/erlang/otp/tags -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From essen@REDACTED Thu Dec 4 15:31:53 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 04 Dec 2014 16:31:53 +0200 Subject: [erlang-questions] minor releases in Erlang? In-Reply-To: References: <548017E3.50601@gmail.com> Message-ID: <54807059.5030906@ninenines.eu> On 12/04/2014 04:18 PM, David Welton wrote: > On Thu, Dec 4, 2014 at 9:14 AM, Michael Truog wrote: >> Even just a simple announcement that a new tag exists could help it receive >> testing. That could make these minor updates more of a real "open source" >> release, due to public communication that encourages its use publicly. The >> extra testing would help us determine when an Erlang release will not fail >> in testing or production due to bugs. > > +1 - although it would not be hard to automate that ourselves: > > https://api.github.com/repos/erlang/otp/tags Well it also has to update this page: http://www.erlang.org/download.html And publish a news: http://www.erlang.org/news/79 Wikipedia for example uses the news as proof that the current version is 17.3 and is therefore advising readers that they should download a buggy release: http://en.wikipedia.org/wiki/Erlang_(programming_language) -- Lo?c Hoguin http://ninenines.eu From cabo@REDACTED Thu Dec 4 16:36:19 2014 From: cabo@REDACTED (Carsten Bormann) Date: Thu, 4 Dec 2014 16:36:19 +0100 Subject: [erlang-questions] minor releases in Erlang? In-Reply-To: References: <548017E3.50601@gmail.com> Message-ID: On 04 Dec 2014, at 15:18, David Welton wrote: > > it would not be hard to automate that ourselves: > > https://api.github.com/repos/erlang/otp/tags Done :-) http://page2rss.com/rss/a3a08c62d3cf37ffbc111d3f03ec43d4 Gr??e, Carsten From sam@REDACTED Thu Dec 4 18:54:07 2014 From: sam@REDACTED (Sam Tavakoli) Date: Thu, 4 Dec 2014 17:54:07 +0000 Subject: [erlang-questions] Non terminating Dialyzer invocation in R16B03-1 In-Reply-To: References: Message-ID: Hi I'm having an interesting issue with Dialyzer in R16B03-1 -module(barf). -record(rec, {version}). -opaque rec() :: #rec{version :: pos_integer()}. -export_type([rec/0]). -export([a/1]). a(#rec{version = 1} = A) -> A; a(A) when is_tuple(A) -> b(1, A). b(_, {rec, 1} =Rec) -> Rec. dialyzer --verbose --no_check_plt --no_native --plt mini_plt ~/slask/barf.erl This will never terminate and there is 100% CPU load. If I swap out opaque to type, it terminates or if I remove the pattern matching on Rec in b/2 it works. Any ideas why this is? Further more, Dialyzer can handle this in 17.3. /Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostis@REDACTED Thu Dec 4 19:43:33 2014 From: kostis@REDACTED (Kostis Sagonas) Date: Thu, 04 Dec 2014 20:43:33 +0200 Subject: [erlang-questions] Non terminating Dialyzer invocation in R16B03-1 In-Reply-To: References: Message-ID: <5480AB55.7010600@cs.ntua.gr> On 12/04/2014 07:54 PM, Sam Tavakoli wrote: > I'm having an interesting issue with Dialyzer in R16B03-1 > > This will never terminate and there is 100% CPU load. > > If I swap out opaque to type, it terminates or if I remove the pattern > matching on Rec in b/2 it works. > > Any ideas why this is? > > Further more, Dialyzer can handle this in 17.3. The handling of opaque types has improved considerably in Dialyzer starting with 17.0. Most probably you are running into a corner case which has been fixed and now it's properly handled. I suggest you update to some 17 release. Kostis From mjtruog@REDACTED Thu Dec 4 21:13:59 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 04 Dec 2014 12:13:59 -0800 Subject: [erlang-questions] minor releases in Erlang? In-Reply-To: References: <548017E3.50601@gmail.com> Message-ID: <5480C087.2080505@gmail.com> On 12/04/2014 06:18 AM, David Welton wrote: > On Thu, Dec 4, 2014 at 9:14 AM, Michael Truog wrote: >> Even just a simple announcement that a new tag exists could help it receive >> testing. That could make these minor updates more of a real "open source" >> release, due to public communication that encourages its use publicly. The >> extra testing would help us determine when an Erlang release will not fail >> in testing or production due to bugs. > +1 - although it would not be hard to automate that ourselves: > > https://api.github.com/repos/erlang/otp/tags > The problem with only trying to check if a new tag exists is not knowing all the changes that went into the new release. We can go through every commit message to determine all the changes since the source code changes are public. However, the erlang repository tags would be much easier to use if the changes were summarized in release notes. If we had a public bug/feature tracker that had a direct relationship with the final release notes (currently the README file, e.g., http://www.erlang.org/download/otp_src_17.3.readme), this would not be a problem. Many of the changes are not attached to github issues and no clear relationship between the release notes OTP-##### identifier and github issues is shown, so it makes tracking changes in the repository more difficult than you would expect from an open source project. I understand that OTP-##### identifiers are sometimes mentioned in the branch name with commit messages that describe what the changes relate to, though that is unable to clearly describe the impact of the change (its relationship to other OTP-##### identifiers, what requirements or expectations may have changed, and the larger impact to the system for the developer). From imantc@REDACTED Thu Dec 4 21:39:06 2014 From: imantc@REDACTED (Imants Cekusins) Date: Thu, 4 Dec 2014 21:39:06 +0100 Subject: [erlang-questions] minor releases in Erlang? In-Reply-To: <5480C087.2080505@gmail.com> References: <548017E3.50601@gmail.com> <5480C087.2080505@gmail.com> Message-ID: Isn't it a common dilemma: latest & greatest / bleeding edge vs tested / behind times? Maybe it makes sense to revert to 16._ for production? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.mcevoy@REDACTED Thu Dec 4 22:31:03 2014 From: sean.mcevoy@REDACTED (sean mcevoy) Date: Thu, 4 Dec 2014 21:31:03 +0000 Subject: [erlang-questions] TCP buffering Message-ID: Hi List, I need some TCP help and advice on how to manage buffer sizes from the gen_tcp api. We have a system made up of 4 basic node types, lets call the A, B, C & DB (all running R15B), each of which can have multiple instances. We also have a communications protocol that runs over tcp links between the different node types and works fine on the connections between A & B and B & C, but on the connections between B & DB we've been getting some strange behaviour. DB is a node that basically just runs mnesia and is the data store for the system, if that's relevant, and connections to it also work fine for a few days after it restarts. But after a few days we seem to get "chokes" in the TCP communications at very regular 7 minute intervals. The rest of the VM stays working but messages in the TCP link take up to 8 seconds to reach their destination, causing timeouts on the higher level protocol. These "chokes" are regular across peak & quiet times and cause a similar proportion of timeouts regardless of the traffic level. (Traffic comprises of simple non-blocking requests and responses) I've been investigating and have become focussed on the tcp buffer sizing, though I've no concrete evidence that this is actually the problem and my TCP knowledge before this investigation was more or less restricted to what's exposed through gen_tcp. So please advise if you think there may be another source. What I've found is that on initial connection both sndbuf & recbuf are set to 10MB, and after a few days when we see these problems TCP has resized them down to 49KB. On the other links where there are no problems the buffers still have their original sizes. But for some reason inet:setopts won't resize these 49KB buffers in the live site the way it will in my test environment. And just now I've discovered the separate buffer parameter that I didn't know about before, from the OTP docs this one should be larger than the larger of sndbuf & recbuf but on my problematic link I have these values: [{buffer,1460},{sndbuf,49152},{recbuf,49640}]. In my "good" links this is set to 10MB, just like sndbuf & recbuf, even though we didn't explicitly set it. So my questions are: - What governs this TCP resizing, I know it's in the protocol but what traffic patterns might cause this? - How can I resize my buffers once I'm in this state? - Are the buffer sizes the likely cause of the "chokes" I'm observing? Thanks in advance! //Sean. -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Fri Dec 5 06:18:31 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Fri, 05 Dec 2014 07:18:31 +0200 Subject: [erlang-questions] minor releases in Erlang? In-Reply-To: References: <548017E3.50601@gmail.com> <5480C087.2080505@gmail.com> Message-ID: <54814027.8030608@ninenines.eu> It's not really what happens though. Debian supposedly goes the "tested / behind times" way but had no problem using R14A before, which is at best a beta quality release. Because they like staying behind times it caused issues for many years. (This is why OTP doesn't build A releases anymore.) Debian or another could very well decide to use 17.3 as the Erlang for their next release and we're screwed again for years. Chances of that happening are lower if OTP Team releases a fix promptly. On 12/04/2014 10:39 PM, Imants Cekusins wrote: > Isn't it a common dilemma: > > latest & greatest / bleeding edge > vs > tested / behind times? > > Maybe it makes sense to revert to 16._ for production? > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From llbgurs@REDACTED Fri Dec 5 03:33:48 2014 From: llbgurs@REDACTED (linbo liao) Date: Fri, 5 Dec 2014 10:33:48 +0800 Subject: [erlang-questions] Rebar: Multi applications depend on same application, but different branchs Message-ID: Hi, For rebar dependency management, I have application A depend on application B, both A and B depend on application C. A require C's master branch, B require C's other branch. And A only use some library of B. When I execute "rebar get-deps" , it will use other branch defined in B, but not master branch defined in A. Is there any way to resolve this issue? Thanks in advance. Thanks, Linbo -------------- next part -------------- An HTML attachment was scrubbed... URL: From lhfcws@REDACTED Fri Dec 5 08:39:31 2014 From: lhfcws@REDACTED (Lhfcws GMail) Date: Fri, 5 Dec 2014 15:39:31 +0800 Subject: [erlang-questions] Questions about small message, big computation & SMP Message-ID: <0206129C-C31D-42D3-8C70-E619A9FF2994@gmail.com> I?ve read some books or blogs, i.e. , and they all encourage small message and big computation. However, if I want to make use of the concurrency or SMP, I have to spawn many processes to transform the serialized codes into parallelized codes, which may cause many message passing among these processes. It seems like a paradox. Actually I think I am not understanding the rule ?small message, big computation? well. Can anyone explain it more clearly? Thank you! From roger@REDACTED Fri Dec 5 09:14:49 2014 From: roger@REDACTED (Roger Lipscombe) Date: Fri, 5 Dec 2014 08:14:49 +0000 Subject: [erlang-questions] Rebar: Multi applications depend on same application, but different branchs In-Reply-To: References: Message-ID: On 5 December 2014 at 02:33, linbo liao wrote: > When I execute "rebar get-deps" , it will use other branch defined in B, > but not master branch defined in A. > > Is there any way to resolve this issue? Thanks in advance. Not easily, no[1]. There are several issues filed against rebar to do with the way it decides which dependencies to download. They're hopefully being resolved in rebar3, but -- in my testing at least -- it's not mature yet. The way I've done it is to have a rebar.deps.config at the top level which lists the dependencies that I'd like to force -- and lists nothing else. Then I "rebar -C rebar.deps.config get-deps && rebar get-deps"; this causes rebar to download the forced dependencies, and then to use its normal logic. Since the dependencies are already in the deps/ directory by this point, it doesn't download them again. Cheers, Roger. [1] At least, as far as I can figure out. If anyone has any better ideas...? From imantc@REDACTED Fri Dec 5 09:22:21 2014 From: imantc@REDACTED (Imants Cekusins) Date: Fri, 5 Dec 2014 09:22:21 +0100 Subject: [erlang-questions] minor releases in Erlang? In-Reply-To: <54814027.8030608@ninenines.eu> References: <548017E3.50601@gmail.com> <5480C087.2080505@gmail.com> <54814027.8030608@ninenines.eu> Message-ID: Well, a buggy release stays a buggy release: behind times does not automatically imply tested. Is this then about tagging releases as buggy or tested to help distro packagers, application developers and users? -------------- next part -------------- An HTML attachment was scrubbed... URL: From tobias.lindahl@REDACTED Fri Dec 5 09:22:58 2014 From: tobias.lindahl@REDACTED (Tobias Lindahl) Date: Fri, 5 Dec 2014 09:22:58 +0100 Subject: [erlang-questions] TCP buffering In-Reply-To: References: Message-ID: 2014-12-04 22:31 GMT+01:00 sean mcevoy : > Hi List, > > I need some TCP help and advice on how to manage buffer sizes from the > gen_tcp api. > > We have a system made up of 4 basic node types, lets call the A, B, C & DB > (all running R15B), each of which can have multiple instances. We also have > a communications protocol that runs over tcp links between the different > node types and works fine on the connections between A & B and B & C, but > on the connections between B & DB we've been getting some strange behaviour. > > DB is a node that basically just runs mnesia and is the data store for the > system, if that's relevant, and connections to it also work fine for a few > days after it restarts. But after a few days we seem to get "chokes" in the > TCP communications at very regular 7 minute intervals. The rest of the VM > stays working but messages in the TCP link take up to 8 seconds to reach > their destination, causing timeouts on the higher level protocol. > These "chokes" are regular across peak & quiet times and cause a similar > proportion of timeouts regardless of the traffic level. (Traffic comprises > of simple non-blocking requests and responses) > > I've been investigating and have become focussed on the tcp buffer sizing, > though I've no concrete evidence that this is actually the problem and my > TCP knowledge before this investigation was more or less restricted to > what's exposed through gen_tcp. So please advise if you think there may be > another source. > Since you are running mnesia on the node, I would look for correlation between mnesia table dumps and the chokes. It might not be the culprit of the problem, but it might be the trigger. Seven minutes sounds about right for mnesia dumps, and depending on the data in your disc_copies table, the dump can cause pretty bad behavior on schedulers and io, affecting seemingly unrelated processes. I've seen nodes behaving very badly because of this. If you find the correlation to mnesia dumps, you could try setting the scheduler wake up threshold (+swt) to low or very_low and the scheduler forced wake up interval (+sfwi) to some nice number (1000 ms has worked for me), to make sure you are not starving the processes receiving the tcp communication. I can't comment on the tcp buffers, but at least you have someting else to look for as well. > What I've found is that on initial connection both sndbuf & recbuf are set > to 10MB, and after a few days when we see these problems TCP has resized > them down to 49KB. On the other links where there are no problems the > buffers still have their original sizes. But for some reason inet:setopts > won't resize these 49KB buffers in the live site the way it will in my test > environment. > > And just now I've discovered the separate buffer parameter that I didn't > know about before, from the OTP docs this one should be larger than the > larger of sndbuf & recbuf but on my problematic link I have these values: > [{buffer,1460},{sndbuf,49152},{recbuf,49640}]. > In my "good" links this is set to 10MB, just like sndbuf & recbuf, even > though we didn't explicitly set it. > > So my questions are: > - What governs this TCP resizing, I know it's in the protocol but what > traffic patterns might cause this? > - How can I resize my buffers once I'm in this state? > - Are the buffer sizes the likely cause of the "chokes" I'm observing? > > Thanks in advance! > //Sean. > > > _______________________________________________ > 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 Fri Dec 5 09:25:57 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Fri, 5 Dec 2014 09:25:57 +0100 Subject: [erlang-questions] minor releases in Erlang? In-Reply-To: References: <548017E3.50601@gmail.com> <5480C087.2080505@gmail.com> <54814027.8030608@ninenines.eu> Message-ID: On Fri, Dec 5, 2014 at 9:22 AM, Imants Cekusins wrote: > Well, a buggy release stays a buggy release: behind times does not > automatically imply tested. > > Is this then about tagging releases as buggy or tested to help distro > packagers, application developers and users? > when a release is "buggy", you fix it and release a new one. In that case it will help any one, developers, because 17 contains some interesting features, users, because of the first one, distro packagers because they can have a stable releases containing interesting features for users and applications developers. That's is that simple. -------------- next part -------------- An HTML attachment was scrubbed... URL: From llbgurs@REDACTED Fri Dec 5 07:31:06 2014 From: llbgurs@REDACTED (linbo liao) Date: Fri, 5 Dec 2014 14:31:06 +0800 Subject: [erlang-questions] Rebar: Multi applications depend on same application, but different branchs In-Reply-To: References: Message-ID: Thanks, refer to this issue https://github.com/rebar/rebar/issues/76, I use raw deps and pre_hooks as a workaround. 2014-12-05 10:33 GMT+08:00 linbo liao : > Hi, > > For rebar dependency management, I have application A depend on > application B, both A and B depend on application C. > > A require C's master branch, B require C's other branch. And A only use > some library of B. > > When I execute "rebar get-deps" , it will use other branch defined in B, > but not master branch defined in A. > > Is there any way to resolve this issue? Thanks in advance. > > Thanks, > > Linbo > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sagun@REDACTED Fri Dec 5 11:45:09 2014 From: sagun@REDACTED (Sagun Garg) Date: Fri, 5 Dec 2014 16:15:09 +0530 Subject: [erlang-questions] Any experiments ? Erlang on Xen for Xen on ARM (LING VM) on Nexus Phone/Tablet | Request for Tutorial, Blog Links Message-ID: Hi Experts, Has anyone tried using *Erlang on Xen *& *Xen on ARM* on a Google Nexus Phone /Tablet to deploy their erlang application / release. I might have overstepped in assuming Erlang on Xen (LING VM people) have developed a port for the ARMv8 processor. Request you to share methodologies used, experiences or blog links with tutorials where I can run similar experiments for myself. I am new starter to this and would love to hear inputs, seek guidance of any form. Cheers Sagun www.nexchanges.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Fri Dec 5 17:01:53 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 5 Dec 2014 17:01:53 +0100 Subject: [erlang-questions] Rebar: Multi applications depend on same application, but different branchs In-Reply-To: References: Message-ID: On Fri, Dec 5, 2014 at 3:33 AM, linbo liao wrote: > Hi, > > For rebar dependency management, I have application A depend on > application B, both A and B depend on application C. > > A require C's master branch, B require C's other branch. And A only > use some library of B. > > When I execute "rebar get-deps" , it will use other branch defined > in B, but not master branch defined in A. > > Is there any way to resolve this issue? Thanks in advance. Replied in the original thread: http://lists.basho.com/pipermail/rebar_lists.basho.com/2014-December/002106.html From t@REDACTED Fri Dec 5 17:09:39 2014 From: t@REDACTED (Tristan Sloughter) Date: Fri, 05 Dec 2014 10:09:39 -0600 Subject: [erlang-questions] Rebar: Multi applications depend on same application, but different branchs In-Reply-To: References: Message-ID: <1417795779.4024917.199293077.595153A9@webmail.messagingengine.com> Correct on both rebar3 resolving this and not being mature yet :) -- Tristan Sloughter t@REDACTED On Fri, Dec 5, 2014, at 02:14 AM, Roger Lipscombe wrote: > On 5 December 2014 at 02:33, linbo liao wrote: > > When I execute "rebar get-deps" , it will use other branch defined in B, > > but not master branch defined in A. > > > > Is there any way to resolve this issue? Thanks in advance. > > Not easily, no[1]. There are several issues filed against rebar to do > with the way it decides which dependencies to download. They're > hopefully being resolved in rebar3, but -- in my testing at least -- > it's not mature yet. > > The way I've done it is to have a rebar.deps.config at the top level > which lists the dependencies that I'd like to force -- and lists > nothing else. Then I "rebar -C rebar.deps.config get-deps && rebar > get-deps"; this causes rebar to download the forced dependencies, and > then to use its normal logic. Since the dependencies are already in > the deps/ directory by this point, it doesn't download them again. > > Cheers, > Roger. > > [1] At least, as far as I can figure out. If anyone has any better > ideas...? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From davidnwelton@REDACTED Fri Dec 5 17:45:17 2014 From: davidnwelton@REDACTED (David Welton) Date: Fri, 5 Dec 2014 17:45:17 +0100 Subject: [erlang-questions] C interface, NaN and infinity Message-ID: Hi, One of our C++ guys was getting bad term errors from the Erlang VM when he was passing around a NaN. Would it make sense for the C library to error out on attempts to encode one of those? -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From egil@REDACTED Fri Dec 5 18:01:50 2014 From: egil@REDACTED (=?windows-1252?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Fri, 5 Dec 2014 18:01:50 +0100 Subject: [erlang-questions] C interface, NaN and infinity In-Reply-To: References: Message-ID: <5481E4FE.5010309@erlang.org> Explain more please. How did you send a NaN to the beam? NaN are not allowed as a float in erlang terms. // Bj?rn-Egil On 2014-12-05 17:45, David Welton wrote: > Hi, > > One of our C++ guys was getting bad term errors from the Erlang VM > when he was passing around a NaN. > > Would it make sense for the C library to error out on attempts to > encode one of those? > From davidnwelton@REDACTED Fri Dec 5 18:07:34 2014 From: davidnwelton@REDACTED (David Welton) Date: Fri, 5 Dec 2014 18:07:34 +0100 Subject: [erlang-questions] C interface, NaN and infinity In-Reply-To: <5481E4FE.5010309@erlang.org> References: <5481E4FE.5010309@erlang.org> Message-ID: Hi, > Explain more please. How did you send a NaN to the beam? Here's an example - it may have a problem or two because my C is rusty. For it to work, you have to have a registered process: erlang:register(someregisteredprocess, self()) from the shell, for instance. I get: 'erlangnode@REDACTED' got a corrupted external term from 'nukenode@REDACTED' on distribution channel 13686 <<...,131,99,45,110,97,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>> ATOM_CACHE_REF translations: none > NaN are not allowed as a float in erlang terms. As far as I can see, the C code in OTP does not disallow it, either. Should it? ---- #include #include #include #include #include #include #include #include #include #include "erl_interface.h" #include "ei.h" int main(int argc, char **argv) { int fd; /* fd to Erlang node */ int loop = 1; /* Loop flag */ int got; /* Result of receive */ erlang_msg emsg; /* Incoming message */ ETERM *tosend; int res; ei_x_buff recvbuf; int sendonce = 0; int nodenum = 0; ei_cnode ec; srand(time(NULL) + getpid()); erl_init(NULL, 0); nodenum = rand() % 100; fprintf(stderr, "nodenum %d\n", nodenum); if (ei_connect_init(&ec, "nukenode", "somecookie", nodenum) == -1) { erl_err_quit("erl_connect_init"); } if ((fd = ei_connect(&ec, "erlangnode@REDACTED")) < 0) { erl_err_quit("erl_connect"); } ei_x_new(&recvbuf); while (loop) { ei_receive_msg(fd, &emsg, &recvbuf); if (got == ERL_TICK) { /* ignore */ } else if (got == ERL_ERROR) { loop = 0; } if (sendonce == 0) { ETERM *tosend; tosend = erl_mk_float(0.0/0.0); erl_print_term(stderr, tosend); { ETERM *msg; ei_x_buff x; int r = 0; msg = tosend; ei_x_new_with_version(&x); if (ei_x_encode_term(&x, msg) < 0) { r = 0; } else { r = ei_reg_send(&ec, fd, "someregisteredprocess", x.buff, x.index - 10); } ei_x_free(&x); } erl_free_term(tosend); sendonce = 1; exit(0); } } } -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From egil@REDACTED Fri Dec 5 18:45:07 2014 From: egil@REDACTED (=?UTF-8?B?QmrDtnJuLUVnaWwgRGFobGJlcmc=?=) Date: Fri, 5 Dec 2014 18:45:07 +0100 Subject: [erlang-questions] C interface, NaN and infinity In-Reply-To: References: <5481E4FE.5010309@erlang.org> Message-ID: <5481EF23.6020706@erlang.org> Ok, so you are talking about distribution and erl_interface. If I'm understanding you correctly: You have a C-Node using legacy erl_interface, encoding a NaN double and sending it to the beam? It has nothing to do with beam? Did you actually manage to get a NaN to the beam or does beam always close the connection? Regarding erl_interface, i think neither erl_mk_float (old) or ei_encode_double (new) checks if it is a valid double. The easiest solution is probably to check the double yourself with isfinite() before encoding. Regardless, beam should drop the connection (the distribution channel) if it finds bad data on the wire. As it does in your example. // Bj?rn-Egil On 2014-12-05 18:07, David Welton wrote: > Hi, > >> Explain more please. How did you send a NaN to the beam? > Here's an example - it may have a problem or two because my C is rusty. > > For it to work, you have to have a registered process: > > erlang:register(someregisteredprocess, self()) from the shell, for instance. > > I get: > > 'erlangnode@REDACTED' got a corrupted external term from > 'nukenode@REDACTED' on distribution channel 13686 > <<...,131,99,45,110,97,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>> > ATOM_CACHE_REF translations: none > > >> NaN are not allowed as a float in erlang terms. > As far as I can see, the C code in OTP does not disallow it, either. Should it? > > ---- > #include > #include > > #include > #include > #include > #include > #include > #include > #include > #include "erl_interface.h" > #include "ei.h" > > int main(int argc, char **argv) { > int fd; /* fd to Erlang node */ > > int loop = 1; /* Loop flag */ > int got; /* Result of receive */ > erlang_msg emsg; /* Incoming message */ > > ETERM *tosend; > int res; > ei_x_buff recvbuf; > > int sendonce = 0; > int nodenum = 0; > > ei_cnode ec; > > srand(time(NULL) + getpid()); > > erl_init(NULL, 0); > > nodenum = rand() % 100; > > fprintf(stderr, "nodenum %d\n", nodenum); > if (ei_connect_init(&ec, "nukenode", "somecookie", nodenum) == -1) { > erl_err_quit("erl_connect_init"); > } > > if ((fd = ei_connect(&ec, "erlangnode@REDACTED")) < 0) { > erl_err_quit("erl_connect"); > } > > ei_x_new(&recvbuf); > while (loop) { > > ei_receive_msg(fd, &emsg, &recvbuf); > if (got == ERL_TICK) { > /* ignore */ > } else if (got == ERL_ERROR) { > loop = 0; > } > > if (sendonce == 0) { > ETERM *tosend; > tosend = erl_mk_float(0.0/0.0); > erl_print_term(stderr, tosend); > { > ETERM *msg; > ei_x_buff x; > int r = 0; > > msg = tosend; > ei_x_new_with_version(&x); > if (ei_x_encode_term(&x, msg) < 0) { > r = 0; > } else { > r = ei_reg_send(&ec, fd, "someregisteredprocess", > x.buff, x.index - 10); > } > ei_x_free(&x); > } > > erl_free_term(tosend); > > sendonce = 1; > exit(0); > } > } > } > > > From davidnwelton@REDACTED Fri Dec 5 22:17:55 2014 From: davidnwelton@REDACTED (David Welton) Date: Fri, 5 Dec 2014 22:17:55 +0100 Subject: [erlang-questions] C interface, NaN and infinity In-Reply-To: <5481EF23.6020706@erlang.org> References: <5481E4FE.5010309@erlang.org> <5481EF23.6020706@erlang.org> Message-ID: Hi, > Ok, so you are talking about distribution and erl_interface. > > If I'm understanding you correctly: You have a C-Node using legacy > erl_interface, encoding a NaN double and sending it to the beam? It has > nothing to do with beam? > Did you actually manage to get a NaN to the beam or does beam always close > the connection? It always rejected it as having a bad term. > Regarding erl_interface, i think neither erl_mk_float (old) or > ei_encode_double (new) checks if it is a valid double. The easiest solution > is probably to check the double yourself with isfinite() before encoding. > Regardless, beam should drop the connection (the distribution channel) if it > finds bad data on the wire. As it does in your example. Our C++ guy he was checking and double checking his code and wondering why it was causing an error on the Erlang side - an error that doesn't actually give you a lot of information on what went wrong unless you take apart the binary it shows, byte by byte. It would have been much simpler had the C code indicated that it was not possible to encode the value, which, from the C side of things, was a legitimate float. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From sean.mcevoy@REDACTED Fri Dec 5 23:47:19 2014 From: sean.mcevoy@REDACTED (sean mcevoy) Date: Fri, 5 Dec 2014 22:47:19 +0000 Subject: [erlang-questions] TCP buffering In-Reply-To: References: Message-ID: Hi Tobias, Thanks for the reply. Our DB has a few small & fairly static config disc tables but the main application data is in ram_copies and doesn't get dumped to disk. It's nice to investigate something else though, I think I'm getting tunnel vision with these buffer sizes! It's driving me mad :-P //Sean. On Fri, Dec 5, 2014 at 8:22 AM, Tobias Lindahl wrote: > > > 2014-12-04 22:31 GMT+01:00 sean mcevoy : > >> Hi List, >> >> I need some TCP help and advice on how to manage buffer sizes from the >> gen_tcp api. >> >> We have a system made up of 4 basic node types, lets call the A, B, C & >> DB (all running R15B), each of which can have multiple instances. We also >> have a communications protocol that runs over tcp links between the >> different node types and works fine on the connections between A & B and B >> & C, but on the connections between B & DB we've been getting some strange >> behaviour. >> >> DB is a node that basically just runs mnesia and is the data store for >> the system, if that's relevant, and connections to it also work fine for a >> few days after it restarts. But after a few days we seem to get "chokes" in >> the TCP communications at very regular 7 minute intervals. The rest of the >> VM stays working but messages in the TCP link take up to 8 seconds to reach >> their destination, causing timeouts on the higher level protocol. >> These "chokes" are regular across peak & quiet times and cause a similar >> proportion of timeouts regardless of the traffic level. (Traffic comprises >> of simple non-blocking requests and responses) >> >> I've been investigating and have become focussed on the tcp buffer >> sizing, though I've no concrete evidence that this is actually the problem >> and my TCP knowledge before this investigation was more or less restricted >> to what's exposed through gen_tcp. So please advise if you think there may >> be another source. >> > > Since you are running mnesia on the node, I would look for correlation > between mnesia table dumps and the chokes. It might not be the culprit of > the problem, but it might be the trigger. Seven minutes sounds about right > for mnesia dumps, and depending on the data in your disc_copies table, the > dump can cause pretty bad behavior on schedulers and io, affecting > seemingly unrelated processes. I've seen nodes behaving very badly because > of this. > > If you find the correlation to mnesia dumps, you could try setting the > scheduler wake up threshold (+swt) to low or very_low and the scheduler > forced wake up interval (+sfwi) to some nice number (1000 ms has worked for > me), to make sure you are not starving the processes receiving the tcp > communication. > > I can't comment on the tcp buffers, but at least you have someting else to > look for as well. > > >> What I've found is that on initial connection both sndbuf & recbuf are >> set to 10MB, and after a few days when we see these problems TCP has >> resized them down to 49KB. On the other links where there are no problems >> the buffers still have their original sizes. But for some reason >> inet:setopts won't resize these 49KB buffers in the live site the way it >> will in my test environment. >> >> And just now I've discovered the separate buffer parameter that I didn't >> know about before, from the OTP docs this one should be larger than the >> larger of sndbuf & recbuf but on my problematic link I have these values: >> [{buffer,1460},{sndbuf,49152},{recbuf,49640}]. >> In my "good" links this is set to 10MB, just like sndbuf & recbuf, even >> though we didn't explicitly set it. >> >> So my questions are: >> - What governs this TCP resizing, I know it's in the protocol but what >> traffic patterns might cause this? >> - How can I resize my buffers once I'm in this state? >> - Are the buffer sizes the likely cause of the "chokes" I'm observing? >> >> Thanks in advance! >> //Sean. >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Sat Dec 6 06:10:46 2014 From: comptekki@REDACTED (Wes James) Date: Fri, 5 Dec 2014 22:10:46 -0700 Subject: [erlang-questions] wx debugger not working now Message-ID: I upgraded to OTP 17.3.4 on xubuntu 14.04 and when I run: im(). ii(t). iaa([init]). t:test(). and I get this: =ERROR REPORT==== 5-Dec-2014::22:00:45 === Error in process <0.52.0> with exit value: {undef,[{dbg_ui_trace,start,[<0.33.0>],[]}]} Anyone know why? Thanks, -wes -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Sat Dec 6 06:33:34 2014 From: comptekki@REDACTED (Wes James) Date: Fri, 5 Dec 2014 22:33:34 -0700 Subject: [erlang-questions] wx debugger not working now In-Reply-To: References: Message-ID: Hmm. Must be something in xubuntu 14. I just kerl built 17.0 and installed it and I'm getting the same error. -wes On Fri, Dec 5, 2014 at 10:10 PM, Wes James wrote: > I upgraded to OTP 17.3.4 on xubuntu 14.04 and when I run: > > im(). > ii(t). > iaa([init]). > > > t:test(). > > and I get this: > > =ERROR REPORT==== 5-Dec-2014::22:00:45 === > Error in process <0.52.0> with exit value: > {undef,[{dbg_ui_trace,start,[<0.33.0>],[]}]} > > Anyone know why? > > Thanks, > > -wes > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Sat Dec 6 07:00:29 2014 From: comptekki@REDACTED (Wes James) Date: Fri, 5 Dec 2014 23:00:29 -0700 Subject: [erlang-questions] wx debugger not working now In-Reply-To: References: Message-ID: Same thing with installing esl-erlang .deb :( -wes On Fri, Dec 5, 2014 at 10:33 PM, Wes James wrote: > Hmm. Must be something in xubuntu 14. I just kerl built 17.0 and > installed it and I'm getting the same error. > > -wes > > On Fri, Dec 5, 2014 at 10:10 PM, Wes James wrote: > >> I upgraded to OTP 17.3.4 on xubuntu 14.04 and when I run: >> >> im(). >> ii(t). >> iaa([init]). >> >> >> t:test(). >> >> and I get this: >> >> =ERROR REPORT==== 5-Dec-2014::22:00:45 === >> Error in process <0.52.0> with exit value: >> {undef,[{dbg_ui_trace,start,[<0.33.0>],[]}]} >> >> Anyone know why? >> >> Thanks, >> >> -wes >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Sat Dec 6 13:44:49 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sat, 6 Dec 2014 13:44:49 +0100 Subject: [erlang-questions] TCP buffering In-Reply-To: References: Message-ID: On Thu, Dec 4, 2014 at 10:31 PM, sean mcevoy wrote: > These "chokes" are regular across peak & quiet times and cause a similar > proportion of timeouts regardless of the traffic level. (Traffic comprises > of simple non-blocking requests and responses) Start by checking if there are problems with the TCP connections themselves. It could be an Erlang-problem, but you need to investigate at a lower level first. Networks tend to be evil. Erlang usually operates quite okay without tuning of these settings. Which leads me to suspect there is something else going on somewhere. A simple 'netstat -s' can sometimes show something ugly as well. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay@REDACTED Sun Dec 7 01:06:48 2014 From: jay@REDACTED (Jay Nelson) Date: Sat, 6 Dec 2014 16:06:48 -0800 Subject: [erlang-questions] Dialyzer safe way to test failure Message-ID: The following tests in my common_test suite: true = try ?TM:reserve(atom_to_list(Cache_Name), Cache_Module) catch error:function_clause -> true end, true = try ?TM:reserve(Cache_Name, atom_to_list(Cache_Module)) catch error:function_clause -> true end, cause dialyzer to complain: cxy_cache_SUITE.erl:58: The call cxy_cache:reserve(string(),Cache_Module::atom()) will never return since the success typing is (atom(),atom()) -> atom() | {'error','already_exists'} and the contract is (Name,module()) -> Name | {'error','already_exists'} when is_subtype(Name,cache_name()) cxy_cache_SUITE.erl:59: The call cxy_cache:reserve(Cache_Name::atom(),string()) will never return since the success typing is (atom(),atom()) -> atom() | {'error','already_exists'} and the contract is (Name,module()) -> Name | {'error','already_exists'} when is_subtype(Name,cache_name()) Is there a better way to check for failure when a non-string is passed as an arg to a function that expects two atoms? jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Sun Dec 7 01:11:05 2014 From: comptekki@REDACTED (Wes James) Date: Sat, 6 Dec 2014 17:11:05 -0700 Subject: [erlang-questions] wx debugger not working now In-Reply-To: References: Message-ID: I just tried it with 1603-1 and it works there. I wonder whats up with 17.x?? Can someone try it on 17.x on xbuntu (or probably ubuntu would be the same). I.e. try this: put this in to t.erl: -module(t). -export([go/0]). go() -> io:format("test"). run erl: erl -smp then paste or type this in: c(t,[debug_info]). im(). ii(t). iaa([init]). t:go(). you should get testok in the shell, after stepping through the debugger, but I get an error. Here is the session in 17.3.4 (erl x64 on xubuntu): Eshell V6.2.1 (abort with ^G) 1> c(t,[debug_info]). {ok,t} 2> im(). <0.40.0> 3> ii(t). {module,t} 4> iaa([init]). true 5> t:go(). =ERROR REPORT==== 6-Dec-2014::17:09:10 === Error in process <0.51.0> with exit value: {undef,[{dbg_ui_trace,start,[<0.33.0>],[]}]} -wes On Fri, Dec 5, 2014 at 11:00 PM, Wes James wrote: > Same thing with installing esl-erlang .deb :( > > -wes > > On Fri, Dec 5, 2014 at 10:33 PM, Wes James wrote: > >> Hmm. Must be something in xubuntu 14. I just kerl built 17.0 and >> installed it and I'm getting the same error. >> >> -wes >> >> On Fri, Dec 5, 2014 at 10:10 PM, Wes James wrote: >> >>> I upgraded to OTP 17.3.4 on xubuntu 14.04 and when I run: >>> >>> im(). >>> ii(t). >>> iaa([init]). >>> >>> >>> t:test(). >>> >>> and I get this: >>> >>> =ERROR REPORT==== 5-Dec-2014::22:00:45 === >>> Error in process <0.52.0> with exit value: >>> {undef,[{dbg_ui_trace,start,[<0.33.0>],[]}]} >>> >>> Anyone know why? >>> >>> Thanks, >>> >>> -wes >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Sun Dec 7 01:29:48 2014 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sun, 07 Dec 2014 01:29:48 +0100 Subject: [erlang-questions] wx debugger not working now In-Reply-To: References: Message-ID: <54839F7C.6070204@wanadoo.fr> Hi, I get same error on Kubuntu (Ubuntu 14.04.1 LTS) i686 with : $> cat /usr/lib/erlang/releases/RELEASES [{release,"Erlang/OTP","17","6.2", [{kernel,"3.0.3","/usr/lib/erlang/lib/kernel-3.0.3"}, {stdlib,"2.2","/usr/lib/erlang/lib/stdlib-2.2"}, {sasl,"2.4.1","/usr/lib/erlang/lib/sasl-2.4.1"}], permanent}]. $> grep -rl dbg_ui_trace /usr/lib/erlang/lib /usr/lib/erlang/lib/debugger-4.0.1/ebin/dbg_wx_mon.beam /usr/lib/erlang/lib/debugger-4.0.1/src/i.erl /usr/lib/erlang/lib/debugger-4.0.1/src/dbg_wx_mon.erl looks linked to wx in debugger. $> wx-config --version-full 2.8.12.1 It is maybe due to a WX 3.0 driver feature used. But OTP team may better answer on this. Regards From achowdhury918@REDACTED Sun Dec 7 02:33:03 2014 From: achowdhury918@REDACTED (Akash Chowdhury) Date: Sat, 6 Dec 2014 20:33:03 -0500 Subject: [erlang-questions] Powermedia: pros and cons In-Reply-To: References: Message-ID: Hi, I didn't get single reply. Can any one reply? Thanks. - Akash On Sat, Nov 29, 2014 at 11:42 PM, Akash Chowdhury wrote: > Hi, > > Has anyone used powermedia for industrial purpose? I would like to know > its pros and cons for large scale system. Does it scale good? Any > information will be highly appreciated. > > > (Here is the link of powermedia : > > https://github.com/powermedia/pm_websphere_mq) > > Thanks. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Sun Dec 7 03:27:44 2014 From: g@REDACTED (Garrett Smith) Date: Sat, 6 Dec 2014 20:27:44 -0600 Subject: [erlang-questions] Powermedia: pros and cons In-Reply-To: References: Message-ID: My guess is that not many Erlang programmers have the pleasure of working with Websphere MQ. Your best bet is to dive in and try to library for yourself. The term "scalable" is of course the topic of much hilarity as it's only slightly more precise than asking if something is "super awesome". While Erlang is of course scalable (and super awesome) this library could have all sorts of issues. But they can probably be sorted out, provided the wire protocol isn't inherently broken (I have no idea). If you get something working and apply some stress, consistent with what you expect your app load to look like, you'll know soon enough how this library performs. Garrett On Sat, Dec 6, 2014 at 7:33 PM, Akash Chowdhury wrote: > Hi, > I didn't get single reply. Can any one reply? > Thanks. > - > Akash > > On Sat, Nov 29, 2014 at 11:42 PM, Akash Chowdhury > wrote: >> >> Hi, >> >> Has anyone used powermedia for industrial purpose? I would like to know >> its pros and cons for large scale system. Does it scale good? Any >> information will be highly appreciated. >> >> >> (Here is the link of powermedia : >> >> https://github.com/powermedia/pm_websphere_mq) >> >> Thanks. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Sun Dec 7 05:13:10 2014 From: comptekki@REDACTED (Wes James) Date: Sat, 6 Dec 2014 21:13:10 -0700 Subject: [erlang-questions] wx debugger not working now In-Reply-To: <54839F7C.6070204@wanadoo.fr> References: <54839F7C.6070204@wanadoo.fr> Message-ID: Thanks for checking. I installed wx 3 per these instructions: http://codelite.org/LiteEditor/WxWidgets30Binaries#toc2 and ran: $> wx-config --version-full 3.0.2.0 ran make clean and make and make install and still got the error. I apt-get purge'd the wx2.8 stuff I had just so it was not there. Did make clean, make and make install and I still get the error :( Any idea why (otp devs)? Thanks, -wes On Sat, Dec 6, 2014 at 5:29 PM, PAILLEAU Eric wrote: > Hi, > > I get same error on Kubuntu (Ubuntu 14.04.1 LTS) i686 > with : > $> cat /usr/lib/erlang/releases/RELEASES > [{release,"Erlang/OTP","17","6.2", > [{kernel,"3.0.3","/usr/lib/erlang/lib/kernel-3.0.3"}, > {stdlib,"2.2","/usr/lib/erlang/lib/stdlib-2.2"}, > {sasl,"2.4.1","/usr/lib/erlang/lib/sasl-2.4.1"}], > permanent}]. > > $> grep -rl dbg_ui_trace /usr/lib/erlang/lib > /usr/lib/erlang/lib/debugger-4.0.1/ebin/dbg_wx_mon.beam > /usr/lib/erlang/lib/debugger-4.0.1/src/i.erl > /usr/lib/erlang/lib/debugger-4.0.1/src/dbg_wx_mon.erl > > looks linked to wx in debugger. > > $> wx-config --version-full > 2.8.12.1 > > It is maybe due to a WX 3.0 driver feature used. But OTP team may better > answer on this. > > Regards > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Sun Dec 7 05:26:26 2014 From: comptekki@REDACTED (Wes James) Date: Sat, 6 Dec 2014 21:26:26 -0700 Subject: [erlang-questions] ssl error ugrading clients to erl 17.3 In-Reply-To: <54750254.1040100@ninenines.eu> References: <547501A0.8040602@ninenines.eu> <54750254.1040100@ninenines.eu> Message-ID: I see you can also get a zip or tar.gz from here: https://github.com/erlang/otp/releases if you wanted to. -wes On Tue, Nov 25, 2014 at 3:27 PM, Lo?c Hoguin wrote: > Try with kerl: > > kerl build git https://github.com/erlang/otp OTP-17.3.4 17.3.4 > > On 11/26/2014 12:26 AM, Wes James wrote: > >> OK Thanks. Do I git clone erlang and then compile the 17.3.2 branch? >> >> wes >> >> On Tue, Nov 25, 2014 at 3:24 PM, Lo?c Hoguin > > wrote: >> >> It was fixed in 17.3.2. >> >> >> On 11/26/2014 12:23 AM, Wes James wrote: >> >> I upgraded my esysman installation to use erlang 17.3 on >> xubuntu. That >> works fine with my clients with erlang 16b, but when I update the >> clients to 17.3, I'm getting an ssl error. >> >> https://gist.github.com/__comptekki/512cd7d2971062297a19 >> >> >> I googled and found a similar error here: >> >> https://gist.github.com/__asabil/1dd2b44bb527de97f325 >> >> >> Is there a solution to fix this? >> >> Thanks, >> >> Wes >> >> >> _________________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/__listinfo/erlang-questions >> >> >> >> -- >> Lo?c Hoguin >> http://ninenines.eu >> >> >> > -- > Lo?c Hoguin > http://ninenines.eu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dangud@REDACTED Sun Dec 7 10:03:37 2014 From: dangud@REDACTED (Dan Gudmundsson) Date: Sun, 7 Dec 2014 10:03:37 +0100 Subject: [erlang-questions] wx debugger not working now In-Reply-To: References: <54839F7C.6070204@wanadoo.fr> Message-ID: Seems I broke something when I removed the gs code from debugger. ia and iaa calls dbg_ui_trace which is removed from the code base now. Does the debugger window start at all? i.e. does im(), debugger:start() work? Will dig more to tomorrow. On Sun, Dec 7, 2014 at 5:13 AM, Wes James wrote: > Thanks for checking. I installed wx 3 per these instructions: > > http://codelite.org/LiteEditor/WxWidgets30Binaries#toc2 > > and ran: > > $> wx-config --version-full > 3.0.2.0 > > ran make clean and make and make install and still got the error. I > apt-get purge'd the wx2.8 stuff I had just so it was not there. Did make > clean, make and make install and I still get the error :( > > Any idea why (otp devs)? > > Thanks, > > -wes > > > > On Sat, Dec 6, 2014 at 5:29 PM, PAILLEAU Eric > wrote: > >> Hi, >> >> I get same error on Kubuntu (Ubuntu 14.04.1 LTS) i686 >> with : >> $> cat /usr/lib/erlang/releases/RELEASES >> [{release,"Erlang/OTP","17","6.2", >> [{kernel,"3.0.3","/usr/lib/erlang/lib/kernel-3.0.3"}, >> {stdlib,"2.2","/usr/lib/erlang/lib/stdlib-2.2"}, >> {sasl,"2.4.1","/usr/lib/erlang/lib/sasl-2.4.1"}], >> permanent}]. >> >> $> grep -rl dbg_ui_trace /usr/lib/erlang/lib >> /usr/lib/erlang/lib/debugger-4.0.1/ebin/dbg_wx_mon.beam >> /usr/lib/erlang/lib/debugger-4.0.1/src/i.erl >> /usr/lib/erlang/lib/debugger-4.0.1/src/dbg_wx_mon.erl >> >> looks linked to wx in debugger. >> >> $> wx-config --version-full >> 2.8.12.1 >> >> It is maybe due to a WX 3.0 driver feature used. But OTP team may better >> answer on this. >> >> Regards >> >> _______________________________________________ >> 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 eric.pailleau@REDACTED Sun Dec 7 10:34:03 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Sun, 07 Dec 2014 10:34:03 +0100 Subject: [erlang-questions] wx debugger not working now Message-ID: Hi Dan, BTW, is there any plan to move debugger in Observer ? regards ? Envoy? depuis mon mobile ? Eric Dan Gudmundsson a ?crit?: >Seems I broke something when I removed the gs code from debugger. > >ia and iaa calls dbg_ui_trace which is removed from the code base now. > >Does the debugger window start at all? >i.e. does im(), debugger:start() work? > >Will dig more to tomorrow. > >On Sun, Dec 7, 2014 at 5:13 AM, Wes James wrote: > >> Thanks for checking. I installed wx 3 per these instructions: >> >> http://codelite.org/LiteEditor/WxWidgets30Binaries#toc2 >> >> and ran: >> >> $> wx-config --version-full >> 3.0.2.0 >> >> ran make clean and make and make install and still got the error. I >> apt-get purge'd the wx2.8 stuff I had just so it was not there. Did make >> clean, make and make install and I still get the error :( >> >> Any idea why (otp devs)? >> >> Thanks, >> >> -wes >> >> >> >> On Sat, Dec 6, 2014 at 5:29 PM, PAILLEAU Eric >> wrote: >> >>> Hi, >>> >>> I get same error on Kubuntu (Ubuntu 14.04.1 LTS) i686 >>> with : >>> $> cat /usr/lib/erlang/releases/RELEASES >>> [{release,"Erlang/OTP","17","6.2", >>> [{kernel,"3.0.3","/usr/lib/erlang/lib/kernel-3.0.3"}, >>> {stdlib,"2.2","/usr/lib/erlang/lib/stdlib-2.2"}, >>> {sasl,"2.4.1","/usr/lib/erlang/lib/sasl-2.4.1"}], >>> permanent}]. >>> >>> $> grep -rl dbg_ui_trace /usr/lib/erlang/lib >>> /usr/lib/erlang/lib/debugger-4.0.1/ebin/dbg_wx_mon.beam >>> /usr/lib/erlang/lib/debugger-4.0.1/src/i.erl >>> /usr/lib/erlang/lib/debugger-4.0.1/src/dbg_wx_mon.erl >>> >>> looks linked to wx in debugger. >>> >>> $> wx-config --version-full >>> 2.8.12.1 >>> >>> It is maybe due to a WX 3.0 driver feature used. But OTP team may better >>> answer on this. >>> >>> Regards >>> >>> _______________________________________________ >>> 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 eric.pailleau@REDACTED Sun Dec 7 16:21:09 2014 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sun, 07 Dec 2014 16:21:09 +0100 Subject: [erlang-questions] wx debugger not working now In-Reply-To: References: <54839F7C.6070204@wanadoo.fr> Message-ID: <54847065.1050101@wanadoo.fr> > Does the debugger window start at all? > i.e. does im(), debugger:start() work? Yes, work for me. From andra.dinu@REDACTED Mon Dec 8 16:20:21 2014 From: andra.dinu@REDACTED (Andra Dinu) Date: Mon, 8 Dec 2014 16:20:21 +0100 (CET) Subject: [erlang-questions] Erlang Factory San Francisco 26-27 March 2015 - 50 VEB tickets released Message-ID: <1287425077.1819643.1418052021472.JavaMail.zimbra@erlang-solutions.com> Hi all, The first confirmed speakers for Erlang Factory SF Bay Area are Alan Kay, Joe Armstrong, Robert Virding and Jose Valim. http://www.erlang-factory.com/sfbay2015#home A limited batch of 50 Very Early Bird tickets were released today. The price for one ticket is $790.00 ($500 cheaper than the full price tickets). Cheers, Andra -- Andra Dinu Community & Social ERLANG SOLUTIONS LTD New Loom House 101 Back Church Lane London, E1 1LU United Kingdom Tel +44(0)2076550344 Mob +44(0)7983484387 www.erlang-solutions.com From sean@REDACTED Mon Dec 8 18:00:01 2014 From: sean@REDACTED (Functional Jobs) Date: Mon, 8 Dec 2014 12:00:01 -0500 Subject: [erlang-questions] New Functional Programming Job Opportunities Message-ID: <5485d919a98a5@functionaljobs.com> Here are some functional programming job opportunities that were posted recently: Senior Software Engineer at McGraw-Hill Education http://functionaljobs.com/jobs/8771-senior-software-engineer-at-mcgraw-hill-education Cheers, Sean Murphy FunctionalJobs.com From rvirding@REDACTED Tue Dec 9 03:44:27 2014 From: rvirding@REDACTED (Robert Virding) Date: Tue, 9 Dec 2014 03:44:27 +0100 Subject: [erlang-questions] Dialyzer safe way to test failure In-Reply-To: References: Message-ID: I have run into the same problem but I don't think there is anything you can do about it. Dialyzer is quite rightly informing you that you have a type error in your code, it is just unfortunate that that is what you are trying to test. Why are you checking your test suites? Robert On 7 December 2014 at 01:06, Jay Nelson wrote: > The following tests in my common_test suite: > > true = try ?TM:reserve(atom_to_list(Cache_Name), Cache_Module) catch > error:function_clause -> true end, > true = try ?TM:reserve(Cache_Name, atom_to_list(Cache_Module)) catch > error:function_clause -> true end, > > cause dialyzer to complain: > > cxy_cache_SUITE.erl:58: The call > cxy_cache:reserve(string(),Cache_Module::atom()) will never return since > the success typing is (atom(),atom()) -> atom() | > {'error','already_exists'} and the contract is (Name,module()) -> Name | > {'error','already_exists'} when is_subtype(Name,cache_name()) > cxy_cache_SUITE.erl:59: The call > cxy_cache:reserve(Cache_Name::atom(),string()) will never return since the > success typing is (atom(),atom()) -> atom() | {'error','already_exists'} > and the contract is (Name,module()) -> Name | {'error','already_exists'} > when is_subtype(Name,cache_name()) > > > Is there a better way to check for failure when a non-string is passed as > an arg to a function > that expects two atoms? > > jay > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Tue Dec 9 10:21:37 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Tue, 9 Dec 2014 09:21:37 +0000 (UTC) Subject: [erlang-questions] POODLE 2.0 and Erlang Message-ID: <1351401782.1208335.1418116897102.JavaMail.zimbra@tpip.net> Hi, The SSL POODLE attacks is back and this time it affects TLS 1.0: https://www.imperialviolet.org/2014/12/08/poodleagain.html The blog entry refers to an interesting discussion on TLS WG maillinglist: https://www.ietf.org/mail-archive/web/tls/current/msg14072.html It went to check the Erlang SSL stack and it does contain this comment: %% For interoperability reasons we do not check the padding content in %% SSL 3.0 and TLS 1.0 as it is not strictly required and breaks %% interopability with for instance Google. In other words, Erlangs TLS 1.0 implementation is 100% RFC compliant and still vulnerable to a POODLE attack on TLS 1.0. For the paranoid, this is a quick fix hack to check padding bytes on TLS 1.0: diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl index a6e5e1b..9e23229 100644 --- a/lib/ssl/src/ssl_cipher.erl +++ b/lib/ssl/src/ssl_cipher.erl @@ -1638,8 +1638,7 @@ generic_stream_cipher_from_bin(T, HashSz) -> %% SSL 3.0 and TLS 1.0 as it is not strictly required and breaks %% interopability with for instance Google. is_correct_padding(#generic_block_cipher{padding_length = Len, - padding = Padding}, {3, N}) - when N == 0; N == 1 -> + padding = Padding}, {3, 0}) -> Len == byte_size(Padding); %% Padding must be check in TLS 1.1 and after is_correct_padding(#generic_block_cipher{padding_length = Len, Andreas -- -- Dipl. Inform. Andreas Schultz From davidnwelton@REDACTED Tue Dec 9 12:33:08 2014 From: davidnwelton@REDACTED (David Welton) Date: Tue, 9 Dec 2014 12:33:08 +0100 Subject: [erlang-questions] C interface, NaN and infinity In-Reply-To: References: <5481E4FE.5010309@erlang.org> <5481EF23.6020706@erlang.org> Message-ID: > It would have been much simpler had the C code indicated that it was > not possible to encode the value, which, from the C side of things, > was a legitimate float. I was thinking: even if the C code doesn't change, the documentation ought to state that encoding certain legitimate float values will cause problems and not be accepted by Erlang. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From community-manager@REDACTED Tue Dec 9 15:42:09 2014 From: community-manager@REDACTED (Bruce Yinhe) Date: Tue, 9 Dec 2014 15:42:09 +0100 Subject: [erlang-questions] New Erlang job openings Message-ID: Hi, Erlang Central has currently 33 Erlang-related job openings. https://erlangcentral.org/jobs To subscribe for weekly updates on new Erlang jobs - Register on Erlang Central. https://erlangcentral.org/login/?action=register To publish your Erlang job openings free of charge: https://erlangcentral.org/jobs/add *Europe:* Senior Erlang Software Engineer at Cisco - Stockholm, Sweden https://erlangcentral.org/senior-erlang-software-engineer-cisco-tail-f/ Backend Engineer at Scycho - Stockholm, Sweden https://erlangcentral.org/backend-engineer-scypho/ Senior Server Developer at Jongla - Helsinki, Finland https://erlangcentral.org/senior-server-developer-jongla/ Backend Engineer at Centralway - Zurich, Switzerland https://erlangcentral.org/backend-engineer-centralway/ Senior Software Engineer ? Core Tech at DemonWare - Dublin, Ireland https://erlangcentral.org/senior-software-engineer-core-tech-demonware/ Back-end Developer at NGTI - Rotterdam, The Netherlands https://erlangcentral.org/back-end-developer-ngti-nl/ Erlang Developer at Darwin Recruitment - UK *http://erlangcentral.org/erlang-developer-darwin-recruitment/ * Software developer at Oxford Knight - London, UK https://erlangcentral.org/software-developer-java-c-scala-clojure-erlang-functional-programming-london/ Erlang Specialist at Modis - Rickmansworth, Hertfordshire, UK https://erlangcentral.org/erlang-specialist-modis/ Experienced Erlang developer for an ambitious Startup at Startors - Remote work possible https://erlangcentral.org/experienced-erlang-developer-for-an-ambitious-startup/ Erlang Consultants ? multiple locations at Erlang Solutions - London, Budapest, Krakow, Stockholm, Copenhagen https://erlangcentral.org/erlang-developers-wanted-multiple-locations/ *Asia & Oceania * Software Engineer ? New Grad at ShoreTel - Canberra, Australia https://erlangcentral.org/software-engineer-new-grad-shoretel/ Lead Cloud Solution Architect at Chaatz Limited - Wan Chai, Hong Kong https://erlangcentral.org/lead-cloud-solution-architect-chaatz/ *Americas:* Erlang Developer at Sqor Sports - San Francisco, CA https://erlangcentral.org/erlang-developer-sqor/ Erlang Developer at Inaka - Buenos Aires https://erlangcentral.org/erlang-developer-inaka/ Infrastructure Engineer at Getaround - San Francisco, CA https://erlangcentral.org/infrastructure-engineer-getaround/ Senior Software Engineer, Erlang Specialist at AdRoll - San Francisco, CA https://erlangcentral.org/senior-software-engineer-erlang-specialist-adroll/ Senior Erlang Engineer at Machine Zone - Palo Alto, CA https://erlangcentral.org/senior-erlang-engineer-machine-zone/ Erlang Back End Engineer at TigerText - Santa Monica, CA https://erlangcentral.org/erlang-developer-tigertext/ Senior Software Engineer ? Distributed Systems at Couchbase - Mountain View, CA https://erlangcentral.org/senior-software-engineer-distributed-systems-couchbase/ Erlang Engineer at CyberCoders - Sunnyvale, CA; Mountain View, CA https://erlangcentral.org/cybercoders-healthcare-mobile-powerhouse-seeks-erlang-engineer- Principal Erlang Developer at CyberCoders - Redwood City, CA https://erlangcentral.org/cybercoders-principal-erlang-developer-ground-breaking-cloud-start-up/ Backend Engineer ? Relo Offered at CyberCoders - Los Angeles, CA; Santa Monica, CA https://erlangcentral.org/backend-engineer-relo-offered-erlang-java-otp-python-rubyonrails-elixir-cybercoders/ Senior Routing Infrastructure Developer at Heorku - Some overlap with EST->PST required https://erlangcentral.org/senior-routing-infrastructure-developer-heroku/ Erlang Developer at Insight Global - Nashville, TN https://erlangcentral.org/erlang-developer-insight-global/ Elixir / Erlang Developer at Vitamin Talent - Austin, Texas (open to remote) https://erlangcentral.org/elixir-erlang-developer-vitamin-talent/ Platform Engineer ? Erlang / Java at GMS Advisors - New York, NY https://erlangcentral.org/platform-engineer-erlang-java-gms-advisors/ Cheers, Bruce Yinhe ErlangCentral.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From drormein@REDACTED Tue Dec 9 17:21:58 2014 From: drormein@REDACTED (Dror Mein) Date: Tue, 9 Dec 2014 16:21:58 +0000 (UTC) Subject: [erlang-questions] how to override meck passthrough Message-ID: <721556659.7049432.1418142118705.JavaMail.yahoo@jws10637.mail.bf1.yahoo.com> I read in the meck readme that you can override a meck passthrough for a single meck:expect.how is it done?Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Tue Dec 9 18:23:14 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Tue, 9 Dec 2014 12:23:14 -0500 Subject: [erlang-questions] how to override meck passthrough In-Reply-To: <721556659.7049432.1418142118705.JavaMail.yahoo@jws10637.mail.bf1.yahoo.com> References: <721556659.7049432.1418142118705.JavaMail.yahoo@jws10637.mail.bf1.yahoo.com> Message-ID: <20141209172313.GI84549@ferdair.local> On 12/09, Dror Mein wrote: > I read in the meck readme that you can override a meck passthrough for a single meck:expect.how is it done?Thanks You just directly delcare the meck expect as usual. The difference is that without the passthrough option, you'll have a module that contains *only* the mocked calls. With passthrough, all the calls will be there, but each expect will override existing ones. Regards, Fred. From jay@REDACTED Tue Dec 9 18:30:59 2014 From: jay@REDACTED (Jay Nelson) Date: Tue, 9 Dec 2014 09:30:59 -0800 Subject: [erlang-questions] Dialyzer safe way to test failure In-Reply-To: References: Message-ID: On Dec 8, 2014, at 6:44 PM, Robert Virding wrote: > I have run into the same problem but I don't think there is anything you can do about it. Dialyzer is quite rightly informing you that you have a type error in your code, it is just unfortunate that that is what you are trying to test. > > Why are you checking your test suites? > > Robert I am dialyzing the test suites because I found that a quick and easy way to fix simple typos and have had type errors in the past which weren?t readily apparent just by compiling and running code. I may change that decision if it creates more false positives than help for true positives. > Original example case: > true = try ?TM:reserve(atom_to_list(Cache_Name), Cache_Module) > catch error:function_clause -> true > j end, In this case I am using try/catch on a single expression which returns a value of a different type from my exact match. For some reason I expected dialyzer to handle this case since the return of the catch is a successful match against the value and I mentally assumed the try/catch was one expression. jay From drormein@REDACTED Tue Dec 9 18:39:28 2014 From: drormein@REDACTED (Dror Mein) Date: Tue, 9 Dec 2014 17:39:28 +0000 (UTC) Subject: [erlang-questions] how to override meck passthrough In-Reply-To: <20141209172313.GI84549@ferdair.local> References: <20141209172313.GI84549@ferdair.local> Message-ID: <233097103.7381060.1418146768651.JavaMail.yahoo@jws10612.mail.bf1.yahoo.com> thank you. that what I thought - stupid bugs (wrong arity) cause you to question your knowledge.? On Tuesday, December 9, 2014 7:23 PM, Fred Hebert wrote: On 12/09, Dror Mein wrote: > I read in the meck readme that you can override a meck passthrough for a single meck:expect.how is it done?Thanks You just directly delcare the meck expect as usual. The difference is that without the passthrough option, you'll have a module that contains *only* the mocked calls. With passthrough, all the calls will be there, but each expect will override existing ones. Regards, Fred. -------------- next part -------------- An HTML attachment was scrubbed... URL: From santosh79@REDACTED Tue Dec 9 19:08:46 2014 From: santosh79@REDACTED (Santosh Kumar) Date: Tue, 9 Dec 2014 13:08:46 -0500 Subject: [erlang-questions] Tuple Matching Question Message-ID: Hi, I just had a question on pattern matching in tuples. Is it possible to perform Head and Tail extraction on a Tuple as I would on a list. So for example, something like so: {H|T} = {a,b,c}. And I expect H to be {a} and T to be {b,c}. I know this works on Lists, just trying to get it to work on Tuples. The reason I ask is, I am working my way through Joe Armstrong's book and one of his exercise is implementing a tuple_to_list function and my approach was as follows: my_tuple_to_list(T) -> my_tuple_to_list_acc(T, []). my_tuple_to_list_acc({}, Acc) -> Acc; my_tuple_to_list_acc({H,T}, Acc) -> my_tuple_to_list_acc(T, [H|Acc]). Thanks Santosh -------------- next part -------------- An HTML attachment was scrubbed... URL: From imantc@REDACTED Tue Dec 9 20:04:24 2014 From: imantc@REDACTED (Imants Cekusins) Date: Tue, 9 Dec 2014 20:04:24 +0100 Subject: [erlang-questions] Tuple Matching Question In-Reply-To: References: Message-ID: Hi Santosh, element(1,{a,b,c}). returns a http://www.erlang.org/doc/reference_manual/data_types.html#id64155 From jared.kofron@REDACTED Tue Dec 9 20:18:08 2014 From: jared.kofron@REDACTED (Jared Kofron) Date: Tue, 09 Dec 2014 19:18:08 +0000 Subject: [erlang-questions] Tuple Matching Question References: Message-ID: Hi Santosh, No, you can't pattern match on the head of a tuple, because a tuple doesn't have a head in the same sense that a list does. The size of the tuple is part of its type - {A,B,C} is of type {any(), any(), any()}, whereas [A,B,C] has type [any()]. If I remove the first element of [any()], I get something of type [any()], whereas if I remove the first element of {any(), any()}, it's of type {any()}. So there's no cons operator for tuples in the same way that there is for lists, because adding/removing some element of a tuple actually changes its type. That's how I think of it, anyhow. On Tue Dec 09 2014 at 11:04:32 AM Imants Cekusins wrote: > Hi Santosh, > > element(1,{a,b,c}). > returns a > > http://www.erlang.org/doc/reference_manual/data_types.html#id64155 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From santosh79@REDACTED Tue Dec 9 20:56:15 2014 From: santosh79@REDACTED (Santosh Kumar) Date: Tue, 9 Dec 2014 14:56:15 -0500 Subject: [erlang-questions] Tuple Matching Question In-Reply-To: References: Message-ID: Hi Jared & Imants, Thank you for your responses. Makes sense. Best, Santosh On Tue, Dec 9, 2014 at 2:18 PM, Jared Kofron wrote: > Hi Santosh, > > No, you can't pattern match on the head of a tuple, because a tuple > doesn't have a head in the same sense that a list does. > > The size of the tuple is part of its type - {A,B,C} is of type {any(), > any(), any()}, whereas [A,B,C] has type [any()]. If I remove the first > element of [any()], I get something of type [any()], whereas if I remove > the first element of {any(), any()}, it's of type {any()}. > > So there's no cons operator for tuples in the same way that there is for > lists, because adding/removing some element of a tuple actually changes its > type. > > That's how I think of it, anyhow. > > On Tue Dec 09 2014 at 11:04:32 AM Imants Cekusins > wrote: > >> Hi Santosh, >> >> element(1,{a,b,c}). >> returns a >> >> http://www.erlang.org/doc/reference_manual/data_types.html#id64155 >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From santosh79@REDACTED Tue Dec 9 21:19:45 2014 From: santosh79@REDACTED (Santosh Kumar) Date: Tue, 9 Dec 2014 15:19:45 -0500 Subject: [erlang-questions] Maps Pattern Matching Message-ID: Hi group, A quick question wrt pattern matching on maps. I am currently working my way through Joe's book and the following code from the book doesn't work: Henry8 = #{ class => king, born => 1491, died => 1547 }. #{born => 1491,class => king,died => 1547} 19> #{ born => B } = Henry8. * 1: illegal pattern It's not liking the pattern matching lookup. Also "B" is unbound (I made sure of that). This is my version of Erlang: Erlang (BEAM) emulator version 6.2 Compiled on Wed Oct 29 16:24:27 2014 Any idea why this wouldn't work? Thank you, Santosh -------------- next part -------------- An HTML attachment was scrubbed... URL: From imantc@REDACTED Tue Dec 9 22:00:05 2014 From: imantc@REDACTED (Imants Cekusins) Date: Tue, 9 Dec 2014 22:00:05 +0100 Subject: [erlang-questions] Maps Pattern Matching In-Reply-To: References: Message-ID: 19> #{ born := B } = Henry8. should work -------------- next part -------------- An HTML attachment was scrubbed... URL: From santosh79@REDACTED Tue Dec 9 22:01:32 2014 From: santosh79@REDACTED (Santosh Kumar) Date: Tue, 9 Dec 2014 16:01:32 -0500 Subject: [erlang-questions] Maps Pattern Matching In-Reply-To: References: Message-ID: Perfect. thanks! On Tue, Dec 9, 2014 at 4:00 PM, Imants Cekusins wrote: > 19> #{ born := B } = Henry8. > > should work > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yitzhakbargeva@REDACTED Tue Dec 9 22:01:14 2014 From: yitzhakbargeva@REDACTED (YltzhakBarGeva) Date: Tue, 9 Dec 2014 23:01:14 +0200 Subject: [erlang-questions] [ANN] NkSIP v0.4.0 Message-ID: <0AF5940A-3481-4ADC-9E4D-FA047D0F53F2@gmail.com> Very interesting idea. I think Elixir should be looked at seriously for developing NKCore. From santosh79@REDACTED Wed Dec 10 02:46:14 2014 From: santosh79@REDACTED (Santosh Kumar) Date: Tue, 9 Dec 2014 20:46:14 -0500 Subject: [erlang-questions] Another question on Maps pattern matching Message-ID: Hi, Working my way through Joe's book and I have another issue with getting one of his code snippets to compile. Specifically, pattern matching within the args list of a function definition just isn't working. Here's the code: count_characters(Str) -> count_characters(Str, #{}). count_characters([H|T], #{ H => N }=X) -> count_characters(T, X#{ H := N+1 }); count_characters([H|T], X) -> count_characters(T, X#{ H => 1 }); count_characters([], X) -> X. It's not liking the variable binding of 'H'. So if I do something like so, it's not "evaluating" the bound value in a map. 39> Henry8. #{born => 1491,class => king,died => 1547} 42> B = born. born 43> #{B := HB} = Henry8. * 1: illegal use of variable 'B' in map Any help is much appreciated. Thanks Santosh -------------- next part -------------- An HTML attachment was scrubbed... URL: From wallentin.dahlberg@REDACTED Wed Dec 10 02:57:13 2014 From: wallentin.dahlberg@REDACTED (=?UTF-8?Q?Bj=C3=B6rn=2DEgil_Dahlberg?=) Date: Wed, 10 Dec 2014 02:57:13 +0100 Subject: [erlang-questions] Another question on Maps pattern matching In-Reply-To: References: Message-ID: Ah, when the book appears before the implementation .. or even the spec. Only literal keys are allowed in Maps in the current release (17.0+). And with literals we mean no variables in this case. In the master branch (18) we currently allow for variables but not as described in joes book (at least not yet). Variables has to be bound before they are used there. // Bj?rn-Egil 2014-12-10 2:46 GMT+01:00 Santosh Kumar : > Hi, > Working my way through Joe's book and I have another issue with getting > one of his code snippets to compile. Specifically, pattern matching within > the args list of a function definition just isn't working. Here's the code: > > count_characters(Str) -> > count_characters(Str, #{}). > count_characters([H|T], #{ H => N }=X) -> > count_characters(T, X#{ H := N+1 }); > count_characters([H|T], X) -> > count_characters(T, X#{ H => 1 }); > count_characters([], X) -> > X. > > It's not liking the variable binding of 'H'. So if I do something like so, > it's not "evaluating" the bound value in a map. > > 39> Henry8. > > #{born => 1491,class => king,died => 1547} > > 42> B = born. > > born > > 43> #{B := HB} = Henry8. > > * 1: illegal use of variable 'B' in map > > > Any help is much appreciated. > > > Thanks > > Santosh > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From santosh79@REDACTED Wed Dec 10 03:00:01 2014 From: santosh79@REDACTED (Santosh Kumar) Date: Tue, 9 Dec 2014 21:00:01 -0500 Subject: [erlang-questions] Another question on Maps pattern matching In-Reply-To: References: Message-ID: Thanks, Bjorn. Kind of a bummer -- but I'm having so much fun with the language to let these come in the way :). Best, Santosh On Tue, Dec 9, 2014 at 8:57 PM, Bj?rn-Egil Dahlberg < wallentin.dahlberg@REDACTED> wrote: > Ah, when the book appears before the implementation .. or even the spec. > > Only literal keys are allowed in Maps in the current release (17.0+). And > with literals we mean no variables in this case. > > In the master branch (18) we currently allow for variables but not as > described in joes book (at least not yet). Variables has to be bound before > they are used there. > > // Bj?rn-Egil > > 2014-12-10 2:46 GMT+01:00 Santosh Kumar : > >> Hi, >> Working my way through Joe's book and I have another issue with getting >> one of his code snippets to compile. Specifically, pattern matching within >> the args list of a function definition just isn't working. Here's the code: >> >> count_characters(Str) -> >> count_characters(Str, #{}). >> count_characters([H|T], #{ H => N }=X) -> >> count_characters(T, X#{ H := N+1 }); >> count_characters([H|T], X) -> >> count_characters(T, X#{ H => 1 }); >> count_characters([], X) -> >> X. >> >> It's not liking the variable binding of 'H'. So if I do something like >> so, it's not "evaluating" the bound value in a map. >> >> 39> Henry8. >> >> #{born => 1491,class => king,died => 1547} >> >> 42> B = born. >> >> born >> >> 43> #{B := HB} = Henry8. >> >> * 1: illegal use of variable 'B' in map >> >> >> Any help is much appreciated. >> >> >> Thanks >> >> Santosh >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cian@REDACTED Wed Dec 10 13:26:01 2014 From: cian@REDACTED (Cian Synnott) Date: Wed, 10 Dec 2014 12:26:01 +0000 Subject: [erlang-questions] Another question on Maps pattern matching In-Reply-To: References: Message-ID: On Wed, Dec 10, 2014 at 2:00 AM, Santosh Kumar wrote: > Thanks, Bjorn. Kind of a bummer -- but I'm having so much fun with the > language to let these come in the way :). > The errata for the book are here: https://pragprog.com/titles/jaerlang2/errata They mention the count_characters example and other problems with maps. Cian From richard.youngkin@REDACTED Wed Dec 10 18:59:12 2014 From: richard.youngkin@REDACTED (Youngkin, Rich) Date: Wed, 10 Dec 2014 10:59:12 -0700 Subject: [erlang-questions] socket_closed_unexpectedly with clustered RabbitMQ in EC2 Message-ID: Hi, I'm using the Erlang amqp client and am getting a "socket_closed_unexpectedly" CRASH REPORT. This error happens regardless of whether the application is actively publishing or consuming messages (i.e., the app is idle, but connected to RabbitMQ). This doesn't happen in a non-EC2 environment or in a single-zone EC2 environment. Here are some environmental details: 1. My application is using Erlang version is R15B01 2. amqp_client-2.7.1 3. RabbitMQ 3.2.2 using Erlang R14B04 Here are the details regarding the EC2 configuration: 1. 2 EC2 zones in the same EC2 region 2. 2 RabbitMQ instances per Zone - 4 total instances 3. All RabbitMQ instances are clustered (cluster_partition_handling set to pause_minority). 4. 2 Application instances per Zone (my app) - 4 total instances 5. There is an haproxy between my app and the RabbitMQ cluster 6. My application is using Mnesia and it's clustered across all app instances I've included the text from the SASL log below. As I stated above, the error message occurs whether my application is publishing or not. It does happen more frequently while publishing is occurring. It looks to me like AMQP is recovering/restarting the affected processes, but I'd like to better understand why it's occurring and fix it if possible. The error is happening regularly, every 50 seconds. This seems significant. Any help is appreciated. Thanks! Rich =CRASH REPORT==== 8-Dec-2014::20:52:34 === crasher: initial call: amqp_gen_connection:init/1 pid: <0.5460.10> registered_name: [] exception exit: socket_closed_unexpectedly in function gen_server:terminate/6 (gen_server.erl, line 747) ancestors: [<0.5459.10>,amqp_sup,<0.4172.0>] messages: [] links: [<0.6264.0>,<0.5459.10>,#Port<0.7206767>] dictionary: [] trap_exit: false status: running heap_size: 610 stack_size: 24 reductions: 717 neighbours: =SUPERVISOR REPORT==== 9-Dec-2014::20:55:15 === Supervisor: {<0.4172.0>,amqp_connection_sup} Context: child_terminated Reason: socket_closed_unexpectedly Offender: [{pid,<0.4173.0>}, {name,connection}, {mfa, {amqp_gen_connection,start_link, [amqp_network_connection, {amqp_params_network,<<"guest">>,<<"guest">>, <<"/">>,"10.199.30.169",5672,0,0,1000,infinity, none, [#Fun, #Fun], [],[]}, #Fun, #Fun,[]]}}, {restart_type,intrinsic}, {shutdown,brutal_kill}, {child_type,worker}] =SUPERVISOR REPORT==== 9-Dec-2014::20:55:15 === Supervisor: {<0.4172.0>,amqp_connection_sup} Context: shutdown Reason: reached_max_restart_intensity Offender: [{pid,<0.4173.0>}, {name,connection}, {mfa, {amqp_gen_connection,start_link, [amqp_network_connection, {amqp_params_network,<<"guest">>,<<"guest">>, <<"/">>,"10.199.30.169",5672,0,0,1000,infinity, none, [#Fun, #Fun], [],[]}, #Fun, #Fun,[]]}}, {restart_type,intrinsic}, {shutdown,brutal_kill}, {child_type,worker}] =PROGRESS REPORT==== 9-Dec-2014::20:55:15 === supervisor: {<0.4320.0>,amqp_connection_sup} started: [{pid,<0.4321.0>}, {name,connection}, {mfa, {amqp_gen_connection,start_link, [amqp_network_connection, {amqp_params_network,<<"guest">>,<<"guest">>, <<"/">>,"10.199.30.169",5672,0,0,1000, infinity,none, [#Fun, #Fun], [],[]}, #Fun, #Fun,[]]}}, {restart_type,intrinsic}, {shutdown,brutal_kill}, {child_type,worker}] ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.youngkin@REDACTED Wed Dec 10 23:56:46 2014 From: richard.youngkin@REDACTED (Youngkin, Rich) Date: Wed, 10 Dec 2014 15:56:46 -0700 Subject: [erlang-questions] socket_closed_unexpectedly with clustered RabbitMQ in EC2 In-Reply-To: References: Message-ID: Looking at this a bit more it turns out the the default haproxy client timeout was 50 seconds. Changing this to other values (larger and smaller) changed the frequency of the socket_closed_unexpectedly errors. So I think I answered my own question. Thanks to anyone who took a look at this in the meantime. Thanks, Rich On Wed, Dec 10, 2014 at 10:59 AM, Youngkin, Rich < richard.youngkin@REDACTED> wrote: > Hi, > > I'm using the Erlang amqp client and am getting a > "socket_closed_unexpectedly" CRASH REPORT. This error happens regardless of > whether the application is actively publishing or consuming messages (i.e., > the app is idle, but connected to RabbitMQ). This doesn't happen in a > non-EC2 environment or in a single-zone EC2 environment. > > Here are some environmental details: > > 1. My application is using Erlang version is R15B01 > 2. amqp_client-2.7.1 > 3. RabbitMQ 3.2.2 using Erlang R14B04 > > Here are the details regarding the EC2 configuration: > > 1. 2 EC2 zones in the same EC2 region > 2. 2 RabbitMQ instances per Zone - 4 total instances > 3. All RabbitMQ instances are clustered (cluster_partition_handling > set to pause_minority). > 4. 2 Application instances per Zone (my app) - 4 total instances > 5. There is an haproxy between my app and the RabbitMQ cluster > 6. My application is using Mnesia and it's clustered across all app > instances > > I've included the text from the SASL log below. > > As I stated above, the error message occurs whether my application is > publishing or not. It does happen more frequently while publishing is > occurring. It looks to me like AMQP is recovering/restarting the affected > processes, but I'd like to better understand why it's occurring and fix it > if possible. The error is happening regularly, every 50 seconds. This > seems significant. > > Any help is appreciated. > > Thanks! > Rich > > > =CRASH REPORT==== 8-Dec-2014::20:52:34 === > > crasher: > > initial call: amqp_gen_connection:init/1 > > pid: <0.5460.10> > > registered_name: [] > > exception exit: socket_closed_unexpectedly > > in function gen_server:terminate/6 (gen_server.erl, line 747) > > ancestors: [<0.5459.10>,amqp_sup,<0.4172.0>] > > messages: [] > > links: [<0.6264.0>,<0.5459.10>,#Port<0.7206767>] > > dictionary: [] > > trap_exit: false > > status: running > > heap_size: 610 > > stack_size: 24 > > reductions: 717 > > neighbours: > > > =SUPERVISOR REPORT==== 9-Dec-2014::20:55:15 === > > Supervisor: {<0.4172.0>,amqp_connection_sup} > > Context: child_terminated > > Reason: socket_closed_unexpectedly > > Offender: [{pid,<0.4173.0>}, > > {name,connection}, > > {mfa, > > {amqp_gen_connection,start_link, > > [amqp_network_connection, > > {amqp_params_network,<<"guest">>,<<"guest">>, > > > <<"/">>,"10.199.30.169",5672,0,0,1000,infinity, > > none, > > [#Fun, > > #Fun], > > [],[]}, > > #Fun, > > #Fun,[]]}}, > > {restart_type,intrinsic}, > > {shutdown,brutal_kill}, > > {child_type,worker}] > > =SUPERVISOR REPORT==== 9-Dec-2014::20:55:15 === > Supervisor: {<0.4172.0>,amqp_connection_sup} > Context: shutdown > Reason: reached_max_restart_intensity > Offender: [{pid,<0.4173.0>}, > {name,connection}, > {mfa, > {amqp_gen_connection,start_link, > [amqp_network_connection, > {amqp_params_network,<<"guest">>,<<"guest">>, > > <<"/">>,"10.199.30.169",5672,0,0,1000,infinity, > none, > [#Fun, > #Fun], > [],[]}, > #Fun, > #Fun,[]]}}, > {restart_type,intrinsic}, > {shutdown,brutal_kill}, > {child_type,worker}] > > =PROGRESS REPORT==== 9-Dec-2014::20:55:15 === supervisor: > {<0.4320.0>,amqp_connection_sup} started: [{pid,<0.4321.0>}, > {name,connection}, {mfa, {amqp_gen_connection,start_link, > [amqp_network_connection, {amqp_params_network,<<"guest">>,<<"guest">>, > <<"/">>,"10.199.30.169",5672,0,0,1000, infinity,none, > [#Fun, > #Fun], [],[]}, > #Fun, > #Fun,[]]}}, {restart_type,intrinsic}, > {shutdown,brutal_kill}, {child_type,worker}] > > ... > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From axling@REDACTED Thu Dec 11 00:18:43 2014 From: axling@REDACTED (Erik Axling) Date: Thu, 11 Dec 2014 00:18:43 +0100 Subject: [erlang-questions] Decoding term with ei that has a map with long atom keys Message-ID: Hello! I ran into an issue where ei_decode_version seems to fail when trying to decode a term that contains a map with large atom keys. My message that is sent to the port looks something like this: erlang:port_command(Port, term_to_binary({cmd, type, undefined, #{asdadasdsadasdasdasdasda=>sadsadsada,asdsadsadsadsadsadsadasdasdsadasb=>sdsdsdsdsdb})). This fails in my port pretty quickly when doing ei_decode_version(but, &index, &version). It works when i send a message similar to erlang:port_command(Port, term_to_binary({cmd, type, undefined, #{b=>s, a=>s})). Erlang version is : Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.2 (abort with ^G) Running this on a Macbook Air if that is interesting. I know that the maps feature is still a bit experimental so just would like to know if this is a known issue of if I'm understanding something wrong? /axling -------------- next part -------------- An HTML attachment was scrubbed... URL: From wallentin.dahlberg@REDACTED Thu Dec 11 01:45:15 2014 From: wallentin.dahlberg@REDACTED (=?UTF-8?Q?Bj=C3=B6rn=2DEgil_Dahlberg?=) Date: Thu, 11 Dec 2014 01:45:15 +0100 Subject: [erlang-questions] Decoding term with ei that has a map with long atom keys In-Reply-To: References: Message-ID: I think something else is going here. Just to be sure, I added your specific example to erl_interface tests and that passed without problems. If ei_decode_version(but, &index, &version) fails, that typically means you have corrupted your binary somewhere. ei_decode_version checks if the leading byte of the binary is 131 (the current version). // Bj?rn-Egil 2014-12-11 0:18 GMT+01:00 Erik Axling : > Hello! > > I ran into an issue where ei_decode_version seems to fail when trying to > decode a term that contains a map with large atom keys. > > My message that is sent to the port looks something like this: > > erlang:port_command(Port, term_to_binary({cmd, type, undefined, > #{asdadasdsadasdasdasdasda=>sadsadsada,asdsadsadsadsadsadsadasdasdsadasb=>sdsdsdsdsdb})). > > This fails in my port pretty quickly when doing ei_decode_version(but, > &index, &version). > > It works when i send a message similar to > > erlang:port_command(Port, term_to_binary({cmd, type, undefined, #{b=>s, > a=>s})). > > Erlang version is : > Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:4:4] [async-threads:10] > [hipe] [kernel-poll:false] > > Eshell V6.2 (abort with ^G) > > Running this on a Macbook Air if that is interesting. > > > I know that the maps feature is still a bit experimental so just would > like to know if this is a known issue of if I'm understanding something > wrong? > > /axling > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Thu Dec 11 05:45:02 2014 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Wed, 10 Dec 2014 23:45:02 -0500 Subject: [erlang-questions] Teaching Erlang; Erlang in education Message-ID: <9D276694-3694-4725-AF19-CD185BF80C15@writersglen.com> Hello, Now here's a platform to bring Erlang to students of every age: http://www.hardkernel.com/main/products/prdt_info.php?g_code=G141578608433&tab_idx=1 I'd be much interested in discussion on or off list with folks seriously interested in developing instructional materials around this unit. All the best, LRP Sent from my iPad From axling@REDACTED Thu Dec 11 07:43:38 2014 From: axling@REDACTED (Erik Axling) Date: Thu, 11 Dec 2014 07:43:38 +0100 Subject: [erlang-questions] Decoding term with ei that has a map with long atom keys In-Reply-To: References: Message-ID: <579A8F70-E411-422E-B9DA-DF5DFED6B73E@gmail.com> Ok. I'll see if I can narrow it down some more. Thanks for checking this case at least. /axling > 11 dec 2014 kl. 01:45 skrev Bj?rn-Egil Dahlberg : > > I think something else is going here. > > Just to be sure, I added your specific example to erl_interface tests and that passed without problems. > > If ei_decode_version(but, &index, &version) fails, that typically means you have corrupted your binary somewhere. > ei_decode_version checks if the leading byte of the binary is 131 (the current version). > > // Bj?rn-Egil > > 2014-12-11 0:18 GMT+01:00 Erik Axling : >> Hello! >> >> I ran into an issue where ei_decode_version seems to fail when trying to decode a term that contains a map with large atom keys. >> >> My message that is sent to the port looks something like this: >> >> erlang:port_command(Port, term_to_binary({cmd, type, undefined, #{asdadasdsadasdasdasdasda=>sadsadsada,asdsadsadsadsadsadsadasdasdsadasb=>sdsdsdsdsdb})). >> >> This fails in my port pretty quickly when doing ei_decode_version(but, &index, &version). >> >> It works when i send a message similar to >> >> erlang:port_command(Port, term_to_binary({cmd, type, undefined, #{b=>s, a=>s})). >> >> Erlang version is : >> Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V6.2 (abort with ^G) >> >> Running this on a Macbook Air if that is interesting. >> >> >> I know that the maps feature is still a bit experimental so just would like to know if this is a known issue of if I'm understanding something wrong? >> >> /axling >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From axling@REDACTED Thu Dec 11 09:07:15 2014 From: axling@REDACTED (Erik Axling) Date: Thu, 11 Dec 2014 09:07:15 +0100 Subject: [erlang-questions] Decoding term with ei that has a map with long atom keys In-Reply-To: <579A8F70-E411-422E-B9DA-DF5DFED6B73E@gmail.com> References: <579A8F70-E411-422E-B9DA-DF5DFED6B73E@gmail.com> Message-ID: Embarrasingly enough I simply allocated a too small buffer in my C program. I based my code on http://erlangcentral.org/wiki/index.php?title=How_to_use_ei_to_marshal_binary_terms_in_port_programs which allocated a 128 byte sized buffer for the messages. Increasing this size solved this problem. Not entirely sure why though as the code seems to realloc the buffer if the size is larger then the previously allocated buffer but I should be able to figure it out though. /axling On Thu, Dec 11, 2014 at 7:43 AM, Erik Axling wrote: > Ok. I'll see if I can narrow it down some more. Thanks for checking this > case at least. > > /axling > > 11 dec 2014 kl. 01:45 skrev Bj?rn-Egil Dahlberg < > wallentin.dahlberg@REDACTED>: > > I think something else is going here. > > Just to be sure, I added your specific example to erl_interface tests and > that passed without problems. > > If ei_decode_version(but, &index, &version) fails, that typically means > you have corrupted your binary somewhere. > ei_decode_version checks if the leading byte of the binary is 131 (the > current version). > > // Bj?rn-Egil > > 2014-12-11 0:18 GMT+01:00 Erik Axling : > >> Hello! >> >> I ran into an issue where ei_decode_version seems to fail when trying to >> decode a term that contains a map with large atom keys. >> >> My message that is sent to the port looks something like this: >> >> erlang:port_command(Port, term_to_binary({cmd, type, undefined, >> #{asdadasdsadasdasdasdasda=>sadsadsada,asdsadsadsadsadsadsadasdasdsadasb=>sdsdsdsdsdb})). >> >> This fails in my port pretty quickly when doing ei_decode_version(but, >> &index, &version). >> >> It works when i send a message similar to >> >> erlang:port_command(Port, term_to_binary({cmd, type, undefined, #{b=>s, >> a=>s})). >> >> Erlang version is : >> Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:4:4] [async-threads:10] >> [hipe] [kernel-poll:false] >> >> Eshell V6.2 (abort with ^G) >> >> Running this on a Macbook Air if that is interesting. >> >> >> I know that the maps feature is still a bit experimental so just would >> like to know if this is a known issue of if I'm understanding something >> wrong? >> >> /axling >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Thu Dec 11 13:08:23 2014 From: henrik@REDACTED (Henrik Nord) Date: Thu, 11 Dec 2014 13:08:23 +0100 Subject: [erlang-questions] Erlang/OTP 17.4 has been released. Message-ID: <54898937.6030009@erlang.org> Erlang/OTP 17.4 has been released. Erlang/OTP 17.4 is a service release on the 17 track with mostly bug fixes, but is does contain a number of new features and characteristics improvements as well. Some highlights of the release are: * eldap: Nearly all TCP options are possible to give in the eldap:open/2 call. * ssh: Added API functions ptty_alloc/3 and ptty_alloc/4, to allocate a pseudo tty. * ssl: Handle servers that may send an empty SNI extension to the client. 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 tagged "OTP-17.4" The Windows binary distribution can be downloaded from http://www.erlang.org/download/otp_win32_17.4.exe http://www.erlang.org/download/otp_win64_17.4.exe You can also download the complete HTML documentation or the Unix manual files http://www.erlang.org/download/otp_doc_html_17.4.tar.gz http://www.erlang.org/download/otp_doc_man_17.4.tar.gz We also want to thank those that sent us patches, suggestions and bug reports. Many thanks to the 33 different contributors in this release. The Erlang/OTP Team at Ericsson -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From boozelclark@REDACTED Thu Dec 11 10:40:08 2014 From: boozelclark@REDACTED (Chris Clark) Date: Thu, 11 Dec 2014 11:40:08 +0200 Subject: [erlang-questions] Stopping a supervisor running under a supervisor Message-ID: Hi I am fairly new to erlang and have a question regarding properly stopping a supervisor that resides directly under another supervisor. My application consist of a top level supervisor (my_supersup) which is a simple_one_for_one supervisor of other supervisors my_sup. Each my_sup supervises a gen_server, serv and another supervisor that is also a simple_one_for_one supervisor of some workers my_supersup (simple_one_for_one, transient) | |_______ ... | my_sup (one_for_all, transient) |________________ | | | serv worker_sup (simple_one_for_one, transient) |___________ ... | | w1 w2 How do shutdown an instance of my_sup gracefully without killing it. At present I can do it with supervisor:terminate_child and supervisor:delete_child but I would like them to shutdown rather than be killed if possible? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.s.klishin@REDACTED Thu Dec 11 13:23:16 2014 From: michael.s.klishin@REDACTED (Michael Klishin) Date: Thu, 11 Dec 2014 15:23:16 +0300 Subject: [erlang-questions] Erlang/OTP 17.4 has been released. In-Reply-To: <54898937.6030009@erlang.org> References: <54898937.6030009@erlang.org> Message-ID: On 11 December 2014 at 15:08:39, Henrik Nord (henrik@REDACTED) wrote: > Some highlights of the release are: > > eldap: Nearly all TCP options are possible to give in the eldap:open/2 > call. > ssh: Added API functions ptty_alloc/3 and ptty_alloc/4, to > allocate a pseudo tty. > ssl: Handle servers that may send an empty SNI extension to the > client. Henrik, Congrats on the release! It would be nice if future announcements included a link to release change log [1], as it is annoyingly painful to locate one at the moment. 1.?http://www.erlang.org/download/otp_src_17.4.readme -- @michaelklishin, github.com/michaelklishin From karol.urbanski@REDACTED Thu Dec 11 13:31:39 2014 From: karol.urbanski@REDACTED (Karol Urbanski) Date: Thu, 11 Dec 2014 13:31:39 +0100 Subject: [erlang-questions] Erlang Solutions packages for Erlang 17.4 Message-ID: <20141211123139.GB1844@dex.erlang-solutions.com> Hello, as always, binary packages for the new release of Erlang (the 17.4 version) are available for download on www.erlang-solutions.com/downloads/download-erlang-otp or www.erlangcentral.org As of now, packages for Mac OS Yosemite; Ubuntu Precise, Trusty and Utopic; Debian Wheezy; and CentOS 6 and 7 are available. More to come soon! Best regards, Karol Urbanski From comptekki@REDACTED Thu Dec 11 18:00:56 2014 From: comptekki@REDACTED (Wes James) Date: Thu, 11 Dec 2014 10:00:56 -0700 Subject: [erlang-questions] wx debugger not working now In-Reply-To: References: <54839F7C.6070204@wanadoo.fr> Message-ID: Dan, Thanks for getting the wx debugger fixed for 17.4! -wes On Sun, Dec 7, 2014 at 2:03 AM, Dan Gudmundsson wrote: > Seems I broke something when I removed the gs code from debugger. > > ia and iaa calls dbg_ui_trace which is removed from the code base now. > > Does the debugger window start at all? > i.e. does im(), debugger:start() work? > > Will dig more to tomorrow. > > On Sun, Dec 7, 2014 at 5:13 AM, Wes James wrote: > >> Thanks for checking. I installed wx 3 per these instructions: >> >> http://codelite.org/LiteEditor/WxWidgets30Binaries#toc2 >> >> and ran: >> >> $> wx-config --version-full >> 3.0.2.0 >> >> ran make clean and make and make install and still got the error. I >> apt-get purge'd the wx2.8 stuff I had just so it was not there. Did make >> clean, make and make install and I still get the error :( >> >> Any idea why (otp devs)? >> >> Thanks, >> >> -wes >> >> >> >> On Sat, Dec 6, 2014 at 5:29 PM, PAILLEAU Eric >> wrote: >> >>> Hi, >>> >>> I get same error on Kubuntu (Ubuntu 14.04.1 LTS) i686 >>> with : >>> $> cat /usr/lib/erlang/releases/RELEASES >>> [{release,"Erlang/OTP","17","6.2", >>> [{kernel,"3.0.3","/usr/lib/erlang/lib/kernel-3.0.3"}, >>> {stdlib,"2.2","/usr/lib/erlang/lib/stdlib-2.2"}, >>> {sasl,"2.4.1","/usr/lib/erlang/lib/sasl-2.4.1"}], >>> permanent}]. >>> >>> $> grep -rl dbg_ui_trace /usr/lib/erlang/lib >>> /usr/lib/erlang/lib/debugger-4.0.1/ebin/dbg_wx_mon.beam >>> /usr/lib/erlang/lib/debugger-4.0.1/src/i.erl >>> /usr/lib/erlang/lib/debugger-4.0.1/src/dbg_wx_mon.erl >>> >>> looks linked to wx in debugger. >>> >>> $> wx-config --version-full >>> 2.8.12.1 >>> >>> It is maybe due to a WX 3.0 driver feature used. But OTP team may better >>> answer on this. >>> >>> Regards >>> >>> _______________________________________________ >>> 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 sdl.web@REDACTED Fri Dec 12 10:43:20 2014 From: sdl.web@REDACTED (Leo Liu) Date: Fri, 12 Dec 2014 17:43:20 +0800 Subject: [erlang-questions] what is $char ? Message-ID: <874mt1gq4n.fsf@gmail.com> The OTP erlang/doc/reference_manual/data_types.html#idm140043841877600 says: $char ASCII value of the character char. In cases of unicode what is $char? So far I have taken it to be the code-point. Could someone elaborate i.e. how does erlang go from $char -> integer? Thanks, Leo From g9414002.pccu.edu.tw@REDACTED Fri Dec 12 10:57:34 2014 From: g9414002.pccu.edu.tw@REDACTED (=?UTF-8?B?6buD6ICA6LOiIChZYXUtSHNpZW4gSHVhbmcp?=) Date: Fri, 12 Dec 2014 17:57:34 +0800 Subject: [erlang-questions] what is $char ? In-Reply-To: <874mt1gq4n.fsf@gmail.com> References: <874mt1gq4n.fsf@gmail.com> Message-ID: Turn on an Erlang console and check followings. Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.2 (abort with ^G) 1> $c. 99 2> $h. 104 3> $a. 97 4> $r. 114 5> You got it? /Y-H On Friday, December 12, 2014, Leo Liu wrote: > The OTP erlang/doc/reference_manual/data_types.html#idm140043841877600 > says: $char ASCII value of the character char. > > In cases of unicode what is $char? So far I have taken it to be the > code-point. Could someone elaborate i.e. how does erlang go from $char > -> integer? > > Thanks, > Leo > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Best Regards. --- Y-H. H. -------------- next part -------------- An HTML attachment was scrubbed... URL: From petergi@REDACTED Fri Dec 12 09:43:23 2014 From: petergi@REDACTED (Peter J Etheridge) Date: Fri, 12 Dec 2014 19:43:23 +1100 Subject: [erlang-questions] application organisation software Message-ID: <9e029b70a3af53690b183f4c1ea3d40dc2ce726f@webmail.iinet.net.au> dear fellow erlangers, i plan to commence writing an application. after viewing a lecture by joe in which he mentioned organising our files, i was wondering if anyone has a favourite website with some guidance on how best to organise pseudocode, files and modules etc. for a project?has someone written an app. in erlang, for instance? happy coding to all,petergi -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Fri Dec 12 12:28:30 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Fri, 12 Dec 2014 12:28:30 +0100 Subject: [erlang-questions] what is $char ? In-Reply-To: <874mt1gq4n.fsf@gmail.com> References: <874mt1gq4n.fsf@gmail.com> Message-ID: <603A8356-9A93-401D-875B-415B182F5537@gmail.com> The documentation should probably be updated to mention Unicode code points instead of "ASCII values". Le 12 d?c. 2014 ? 10:43, Leo Liu a ?crit : > The OTP erlang/doc/reference_manual/data_types.html#idm140043841877600 > says: $char ASCII value of the character char. > > In cases of unicode what is $char? So far I have taken it to be the > code-point. Could someone elaborate i.e. how does erlang go from $char > -> integer? > > Thanks, > Leo > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From sdl.web@REDACTED Fri Dec 12 14:02:11 2014 From: sdl.web@REDACTED (Leo Liu) Date: Fri, 12 Dec 2014 21:02:11 +0800 Subject: [erlang-questions] what is $char ? In-Reply-To: <603A8356-9A93-401D-875B-415B182F5537@gmail.com> (Anthony Ramine's message of "Fri, 12 Dec 2014 12:28:30 +0100") References: <874mt1gq4n.fsf@gmail.com> <603A8356-9A93-401D-875B-415B182F5537@gmail.com> Message-ID: <87ppbp6my4.fsf@gmail.com> On 2014-12-12 12:28 +0100, Anthony Ramine wrote: > The documentation should probably be updated to mention Unicode code > points instead of "ASCII values". I sent a PR on github https://github.com/erlang/otp/pull/560 Leo From igarai@REDACTED Fri Dec 12 14:02:40 2014 From: igarai@REDACTED (=?UTF-8?B?ScOxYWtpIEdhcmF5?=) Date: Fri, 12 Dec 2014 10:02:40 -0300 Subject: [erlang-questions] application organisation software In-Reply-To: <9e029b70a3af53690b183f4c1ea3d40dc2ce726f@webmail.iinet.net.au> References: <9e029b70a3af53690b183f4c1ea3d40dc2ce726f@webmail.iinet.net.au> Message-ID: Hello Peter, On Fri, Dec 12, 2014 at 5:43 AM, Peter J Etheridge wrote: > dear fellow erlangers, > i plan to commence writing an application. > by app I suppose you mean a desktop or non-server program? > after viewing a lecture by joe in which he mentioned organising our files, > i was wondering if anyone has a favourite website with some guidance on how > best to organise pseudocode, files and modules etc. for a project? > has someone written an app. in erlang, for instance? > In my experience, most Erlang applications follow the OTP guidelines for file organization[0]. Wings3D[1] is a subdivision modeller written in erlang. Command-line applications are easy, you can use rebar's or gut's[3] escriptize functionality to create something easily runnable. You could also separate the interface and structure your application as a client-server, still following OTP guidelines for layout. [0] http://www.erlang.org/doc/design_principles/applications.html#id74089 [1] www.wings3d.com [2] https://github.com/rebar/rebar [3] https://github.com/unbalancedparentheses/gut good luck, I?aki -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Fri Dec 12 15:11:06 2014 From: zxq9@REDACTED (zxq9) Date: Fri, 12 Dec 2014 23:11:06 +0900 Subject: [erlang-questions] application organisation software In-Reply-To: References: <9e029b70a3af53690b183f4c1ea3d40dc2ce726f@webmail.iinet.net.au> Message-ID: <61679091.BkUEFK3IcU@changa> On 2014?12?12? ??? 10:02:40 I?aki Garay wrote: > On Fri, Dec 12, 2014 Peter J Etheridge wrote: > > i plan to commence writing an application. > by app I suppose you mean a desktop or non-server program? Turns out to be far less annoying if you abstract a few non-Erlangish things about wx away from your core problem-solving code. > You could also separate the interface and structure your application as a > client-server, still following OTP guidelines for layout. This. Do it. From rvirding@REDACTED Fri Dec 12 15:46:37 2014 From: rvirding@REDACTED (Robert Virding) Date: Fri, 12 Dec 2014 15:46:37 +0100 Subject: [erlang-questions] Dialyzer safe way to test failure In-Reply-To: References: Message-ID: One way which helps is when you know a function may not return is to declare it of type no_return() which tells dialyzer that you know this function may generate an error. It at least works for functions which explicitly call erlang:error/1. Robert On 9 December 2014 at 18:30, Jay Nelson wrote: > > > On Dec 8, 2014, at 6:44 PM, Robert Virding wrote: > > > I have run into the same problem but I don't think there is anything you > can do about it. Dialyzer is quite rightly informing you that you have a > type error in your code, it is just unfortunate that that is what you are > trying to test. > > > > Why are you checking your test suites? > > > > Robert > > > > I am dialyzing the test suites because I found that a quick and easy way to > fix simple typos and have had type errors in the past which weren?t readily > apparent just by compiling and running code. I may change that decision if > it creates more false positives than help for true positives. > > > Original example case: > > true = try ?TM:reserve(atom_to_list(Cache_Name), Cache_Module) > > catch error:function_clause -> true > > j end, > > In this case I am using try/catch on a single expression which returns a > value > of a different type from my exact match. For some reason I expected > dialyzer > to handle this case since the return of the catch is a successful match > against > the value and I mentally assumed the try/catch was one expression. > > jay > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.nijhof@REDACTED Fri Dec 12 20:38:45 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Fri, 12 Dec 2014 20:38:45 +0100 Subject: [erlang-questions] What lib to use for http requests Message-ID: Hi, I am looking for the atm best solution to make http requests, from downloading a small file till larger (100mb) archives. I know of f.ex. the httpc, ibrowse, gun. Any preferences? And why? -Mark -- Mark Nijhof t: @MarkNijhof s: marknijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From igarai@REDACTED Fri Dec 12 20:44:59 2014 From: igarai@REDACTED (=?UTF-8?B?ScOxYWtpIEdhcmF5?=) Date: Fri, 12 Dec 2014 16:44:59 -0300 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: We love our tool shotgun[1], built on top of gun: [1] https://github.com/inaka/shotgun It improves on gun's SSE support. good luck, I?aki On Fri, Dec 12, 2014 at 4:38 PM, Mark Nijhof wrote: > > Hi, > > I am looking for the atm best solution to make http requests, from > downloading a small file till larger (100mb) archives. I know of f.ex. the > httpc, ibrowse, gun. > > Any preferences? And why? > > -Mark > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From felixgallo@REDACTED Fri Dec 12 21:03:11 2014 From: felixgallo@REDACTED (Felix Gallo) Date: Fri, 12 Dec 2014 12:03:11 -0800 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: httpc has some weird bugs under load and should be retired from the standard distribution. lhttpc is better but is a dead project and has a variety of forks, some of which are buggy or incomplete. The 'esl' fork seems to be the closest although in my experience it seems to have a broken pooling mechanism. Additionally it uses 'let it crash' for the common case of timeouts, which can fill up crash.log quickly and impede investigation into real issues. dlhttpc is a fork of lhttpc that ferd put together to handle high volume requests to a low number of endpoints. It's also not actively maintained, but ferd is still alive and kicking and has recently responded to pull requests there. I intended on using this but rustled up my own nasty pool mechanism on top of my own hacked fork of lhttpc. gun appears to be the most actively maintained; I haven't tried it yet but if it's as solid as cowboy, this is probably the right one to use for new projects. shotgun is just an SSE convenience wrapper on gun, so if you don't need SSE, sticking with gun is probably your best bet. fusco is an alpha quality http client that doesn't appear to be actively maintained. In general the state of http clients in erlang is a bewildering, overgrown thicket of ancient decaying masonry and beguiling dead ends filled with poisonous invisible gila monsters. F. On Fri, Dec 12, 2014 at 11:44 AM, I?aki Garay wrote: > > We love our tool shotgun[1], built on top of gun: > > [1] https://github.com/inaka/shotgun > > It improves on gun's SSE support. > > good luck, > I?aki > > On Fri, Dec 12, 2014 at 4:38 PM, Mark Nijhof < > mark.nijhof@REDACTED> wrote: > >> Hi, >> >> I am looking for the atm best solution to make http requests, from >> downloading a small file till larger (100mb) archives. I know of f.ex. the >> httpc, ibrowse, gun. >> >> Any preferences? And why? >> >> -Mark >> >> -- >> Mark Nijhof >> t: @MarkNijhof >> s: marknijhof >> >> >> _______________________________________________ >> 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 mark.nijhof@REDACTED Fri Dec 12 21:17:46 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Fri, 12 Dec 2014 21:17:46 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: Hi Felix, I?aki, Thanks for your reply, you confirm what I was thinking myself about using Gun but I asked because of: > In general the state of http clients in erlang is a bewildering, overgrown thicket of ancient decaying masonry and beguiling dead ends filled with poisonous invisible gila monsters. Cheers, -Mark On Fri, Dec 12, 2014 at 9:03 PM, Felix Gallo wrote: > httpc has some weird bugs under load and should be retired from the > standard distribution. > > lhttpc is better but is a dead project and has a variety of forks, some of > which are buggy or incomplete. The 'esl' fork seems to be the closest > although in my experience it seems to have a broken pooling mechanism. > Additionally it uses 'let it crash' for the common case of timeouts, which > can fill up crash.log quickly and impede investigation into real issues. > > dlhttpc is a fork of lhttpc that ferd put together to handle high volume > requests to a low number of endpoints. It's also not actively maintained, > but ferd is still alive and kicking and has recently responded to pull > requests there. I intended on using this but rustled up my own nasty pool > mechanism on top of my own hacked fork of lhttpc. > > gun appears to be the most actively maintained; I haven't tried it yet but > if it's as solid as cowboy, this is probably the right one to use for new > projects. > > shotgun is just an SSE convenience wrapper on gun, so if you don't need > SSE, sticking with gun is probably your best bet. > > fusco is an alpha quality http client that doesn't appear to be actively > maintained. > > In general the state of http clients in erlang is a bewildering, overgrown > thicket of ancient decaying masonry and beguiling dead ends filled with > poisonous invisible gila monsters. > > F. > > > On Fri, Dec 12, 2014 at 11:44 AM, I?aki Garay wrote: >> >> We love our tool shotgun[1], built on top of gun: >> >> [1] https://github.com/inaka/shotgun >> >> It improves on gun's SSE support. >> >> good luck, >> I?aki >> >> On Fri, Dec 12, 2014 at 4:38 PM, Mark Nijhof < >> mark.nijhof@REDACTED> wrote: >> >>> Hi, >>> >>> I am looking for the atm best solution to make http requests, from >>> downloading a small file till larger (100mb) archives. I know of f.ex. the >>> httpc, ibrowse, gun. >>> >>> Any preferences? And why? >>> >>> -Mark >>> >>> -- >>> Mark Nijhof >>> t: @MarkNijhof >>> s: marknijhof >>> >>> >>> _______________________________________________ >>> 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 >> >> -- Mark Nijhof t: @MarkNijhof s: marknijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.shneyderman@REDACTED Fri Dec 12 21:27:48 2014 From: a.shneyderman@REDACTED (Alex Shneyderman) Date: Fri, 12 Dec 2014 15:27:48 -0500 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: nobody mentioned hackney: well written, mature, filled with features. not to mention very active. On Fri, Dec 12, 2014 at 3:17 PM, Mark Nijhof wrote: > Hi Felix, I?aki, > > Thanks for your reply, you confirm what I was thinking myself about using > Gun but I asked because of: > > > In general the state of http clients in erlang is a bewildering, > overgrown thicket of ancient decaying masonry and beguiling dead ends > filled with poisonous invisible gila monsters. > > Cheers, > > -Mark > > > On Fri, Dec 12, 2014 at 9:03 PM, Felix Gallo wrote: > >> httpc has some weird bugs under load and should be retired from the >> standard distribution. >> >> lhttpc is better but is a dead project and has a variety of forks, some >> of which are buggy or incomplete. The 'esl' fork seems to be the closest >> although in my experience it seems to have a broken pooling mechanism. >> Additionally it uses 'let it crash' for the common case of timeouts, which >> can fill up crash.log quickly and impede investigation into real issues. >> >> dlhttpc is a fork of lhttpc that ferd put together to handle high volume >> requests to a low number of endpoints. It's also not actively maintained, >> but ferd is still alive and kicking and has recently responded to pull >> requests there. I intended on using this but rustled up my own nasty pool >> mechanism on top of my own hacked fork of lhttpc. >> >> gun appears to be the most actively maintained; I haven't tried it yet >> but if it's as solid as cowboy, this is probably the right one to use for >> new projects. >> >> shotgun is just an SSE convenience wrapper on gun, so if you don't need >> SSE, sticking with gun is probably your best bet. >> >> fusco is an alpha quality http client that doesn't appear to be actively >> maintained. >> >> In general the state of http clients in erlang is a bewildering, >> overgrown thicket of ancient decaying masonry and beguiling dead ends >> filled with poisonous invisible gila monsters. >> >> F. >> >> >> On Fri, Dec 12, 2014 at 11:44 AM, I?aki Garay wrote: >>> >>> We love our tool shotgun[1], built on top of gun: >>> >>> [1] https://github.com/inaka/shotgun >>> >>> It improves on gun's SSE support. >>> >>> good luck, >>> I?aki >>> >>> On Fri, Dec 12, 2014 at 4:38 PM, Mark Nijhof < >>> mark.nijhof@REDACTED> wrote: >>> >>>> Hi, >>>> >>>> I am looking for the atm best solution to make http requests, from >>>> downloading a small file till larger (100mb) archives. I know of f.ex. the >>>> httpc, ibrowse, gun. >>>> >>>> Any preferences? And why? >>>> >>>> -Mark >>>> >>>> -- >>>> Mark Nijhof >>>> t: @MarkNijhof >>>> s: marknijhof >>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >>> > > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.nijhof@REDACTED Fri Dec 12 21:45:11 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Fri, 12 Dec 2014 21:45:11 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: I meant to mention Hackney. Why would you choose Hackney over Gun and vise verse? On Fri, Dec 12, 2014 at 9:27 PM, Alex Shneyderman wrote: > nobody mentioned hackney: well written, mature, filled with features. not > to mention very active. > > On Fri, Dec 12, 2014 at 3:17 PM, Mark Nijhof < > mark.nijhof@REDACTED> wrote: > >> Hi Felix, I?aki, >> >> Thanks for your reply, you confirm what I was thinking myself about using >> Gun but I asked because of: >> >> > In general the state of http clients in erlang is a bewildering, >> overgrown thicket of ancient decaying masonry and beguiling dead ends >> filled with poisonous invisible gila monsters. >> >> Cheers, >> >> -Mark >> >> >> On Fri, Dec 12, 2014 at 9:03 PM, Felix Gallo >> wrote: >> >>> httpc has some weird bugs under load and should be retired from the >>> standard distribution. >>> >>> lhttpc is better but is a dead project and has a variety of forks, some >>> of which are buggy or incomplete. The 'esl' fork seems to be the closest >>> although in my experience it seems to have a broken pooling mechanism. >>> Additionally it uses 'let it crash' for the common case of timeouts, which >>> can fill up crash.log quickly and impede investigation into real issues. >>> >>> dlhttpc is a fork of lhttpc that ferd put together to handle high volume >>> requests to a low number of endpoints. It's also not actively maintained, >>> but ferd is still alive and kicking and has recently responded to pull >>> requests there. I intended on using this but rustled up my own nasty pool >>> mechanism on top of my own hacked fork of lhttpc. >>> >>> gun appears to be the most actively maintained; I haven't tried it yet >>> but if it's as solid as cowboy, this is probably the right one to use for >>> new projects. >>> >>> shotgun is just an SSE convenience wrapper on gun, so if you don't need >>> SSE, sticking with gun is probably your best bet. >>> >>> fusco is an alpha quality http client that doesn't appear to be actively >>> maintained. >>> >>> In general the state of http clients in erlang is a bewildering, >>> overgrown thicket of ancient decaying masonry and beguiling dead ends >>> filled with poisonous invisible gila monsters. >>> >>> F. >>> >>> >>> On Fri, Dec 12, 2014 at 11:44 AM, I?aki Garay wrote: >>>> >>>> We love our tool shotgun[1], built on top of gun: >>>> >>>> [1] https://github.com/inaka/shotgun >>>> >>>> It improves on gun's SSE support. >>>> >>>> good luck, >>>> I?aki >>>> >>>> On Fri, Dec 12, 2014 at 4:38 PM, Mark Nijhof < >>>> mark.nijhof@REDACTED> wrote: >>>> >>>>> Hi, >>>>> >>>>> I am looking for the atm best solution to make http requests, from >>>>> downloading a small file till larger (100mb) archives. I know of f.ex. the >>>>> httpc, ibrowse, gun. >>>>> >>>>> Any preferences? And why? >>>>> >>>>> -Mark >>>>> >>>>> -- >>>>> Mark Nijhof >>>>> t: @MarkNijhof >>>>> s: marknijhof >>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 >>>> >>>> >> >> >> -- >> Mark Nijhof >> t: @MarkNijhof >> s: marknijhof >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- Mark Nijhof t: @MarkNijhof s: marknijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.nijhof@REDACTED Fri Dec 12 21:49:57 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Fri, 12 Dec 2014 21:49:57 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: Thanks for the feedback so far, not that a decision now is set in stone anyway, but it is nice to get a good start :) On Fri, Dec 12, 2014 at 9:45 PM, Mark Nijhof wrote: > I meant to mention Hackney. Why would you choose Hackney over Gun and vise > verse? > > On Fri, Dec 12, 2014 at 9:27 PM, Alex Shneyderman > wrote: > >> nobody mentioned hackney: well written, mature, filled with features. not >> to mention very active. >> >> On Fri, Dec 12, 2014 at 3:17 PM, Mark Nijhof < >> mark.nijhof@REDACTED> wrote: >> >>> Hi Felix, I?aki, >>> >>> Thanks for your reply, you confirm what I was thinking myself about >>> using Gun but I asked because of: >>> >>> > In general the state of http clients in erlang is a bewildering, >>> overgrown thicket of ancient decaying masonry and beguiling dead ends >>> filled with poisonous invisible gila monsters. >>> >>> Cheers, >>> >>> -Mark >>> >>> >>> On Fri, Dec 12, 2014 at 9:03 PM, Felix Gallo >>> wrote: >>> >>>> httpc has some weird bugs under load and should be retired from the >>>> standard distribution. >>>> >>>> lhttpc is better but is a dead project and has a variety of forks, some >>>> of which are buggy or incomplete. The 'esl' fork seems to be the closest >>>> although in my experience it seems to have a broken pooling mechanism. >>>> Additionally it uses 'let it crash' for the common case of timeouts, which >>>> can fill up crash.log quickly and impede investigation into real issues. >>>> >>>> dlhttpc is a fork of lhttpc that ferd put together to handle high >>>> volume requests to a low number of endpoints. It's also not actively >>>> maintained, but ferd is still alive and kicking and has recently responded >>>> to pull requests there. I intended on using this but rustled up my own >>>> nasty pool mechanism on top of my own hacked fork of lhttpc. >>>> >>>> gun appears to be the most actively maintained; I haven't tried it yet >>>> but if it's as solid as cowboy, this is probably the right one to use for >>>> new projects. >>>> >>>> shotgun is just an SSE convenience wrapper on gun, so if you don't need >>>> SSE, sticking with gun is probably your best bet. >>>> >>>> fusco is an alpha quality http client that doesn't appear to be >>>> actively maintained. >>>> >>>> In general the state of http clients in erlang is a bewildering, >>>> overgrown thicket of ancient decaying masonry and beguiling dead ends >>>> filled with poisonous invisible gila monsters. >>>> >>>> F. >>>> >>>> >>>> On Fri, Dec 12, 2014 at 11:44 AM, I?aki Garay wrote: >>>>> >>>>> We love our tool shotgun[1], built on top of gun: >>>>> >>>>> [1] https://github.com/inaka/shotgun >>>>> >>>>> It improves on gun's SSE support. >>>>> >>>>> good luck, >>>>> I?aki >>>>> >>>>> On Fri, Dec 12, 2014 at 4:38 PM, Mark Nijhof < >>>>> mark.nijhof@REDACTED> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I am looking for the atm best solution to make http requests, from >>>>>> downloading a small file till larger (100mb) archives. I know of f.ex. the >>>>>> httpc, ibrowse, gun. >>>>>> >>>>>> Any preferences? And why? >>>>>> >>>>>> -Mark >>>>>> >>>>>> -- >>>>>> Mark Nijhof >>>>>> t: @MarkNijhof >>>>>> s: marknijhof >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>>>> >>>>> >>> >>> >>> -- >>> Mark Nijhof >>> t: @MarkNijhof >>> s: marknijhof >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > -- Mark Nijhof t: @MarkNijhof s: marknijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From drew.varner@REDACTED Fri Dec 12 22:18:53 2014 From: drew.varner@REDACTED (Drew Varner) Date: Fri, 12 Dec 2014 16:18:53 -0500 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: <30DCC6FA-9776-40E3-8A71-1A848680A004@redops.org> Mark, If you are communicating to servers via HTTPS, Hackney and other HTTP clients allow you to pass options to the underlying SSL/TLS socket, including some verification of the peer certificate. For example: https://github.com/talko/httpcbench/blob/master/src/httpcbench_client.erl#L79-L86 Gun has an open issue to address this (https://github.com/extend/gun/pull/27 ), but it is not implemented. If you use Gun as your HTTPS client, you?re open to man-in-the-middle attacks. Do not fall into a false sense of security that any Erlang HTTPS clients provide complete protection against man-in-the-middle attacks out of the box. You?ll also want to consider cases where your peer certificate was revoked by a Certificate Authority. You?d want to know how your HTTPS client handles certificates when their revocation data has been published via a CRL or OCSP. CRL verification has made some headway in Erlang (see the ssl module docs and https://github.com/Vagabond/erl_crl_example ). You?ll also want to look at hostname verification (https://github.com/deadtrickster/ssl_verify_hostname.erl ). HTTPS is as secure as you make it. Felix mentioned ESL?s lhttpc repo. I?d take a look at Talko?s: https://github.com/talko/lhttpc It?s the underlying HTTP client for erlcloud. Hackney also has nice multipart/form functionality. Cheers, Drew > On Dec 12, 2014, at 3:45 PM, Mark Nijhof wrote: > > I meant to mention Hackney. Why would you choose Hackney over Gun and vise verse? > > On Fri, Dec 12, 2014 at 9:27 PM, Alex Shneyderman > wrote: > nobody mentioned hackney: well written, mature, filled with features. not to mention very active. > > On Fri, Dec 12, 2014 at 3:17 PM, Mark Nijhof > wrote: > Hi Felix, I?aki, > > Thanks for your reply, you confirm what I was thinking myself about using Gun but I asked because of: > > > In general the state of http clients in erlang is a bewildering, overgrown thicket of ancient decaying masonry and beguiling dead ends filled with poisonous invisible gila monsters. > > Cheers, > > -Mark > > > On Fri, Dec 12, 2014 at 9:03 PM, Felix Gallo > wrote: > httpc has some weird bugs under load and should be retired from the standard distribution. > > lhttpc is better but is a dead project and has a variety of forks, some of which are buggy or incomplete. The 'esl' fork seems to be the closest although in my experience it seems to have a broken pooling mechanism. Additionally it uses 'let it crash' for the common case of timeouts, which can fill up crash.log quickly and impede investigation into real issues. > > dlhttpc is a fork of lhttpc that ferd put together to handle high volume requests to a low number of endpoints. It's also not actively maintained, but ferd is still alive and kicking and has recently responded to pull requests there. I intended on using this but rustled up my own nasty pool mechanism on top of my own hacked fork of lhttpc. > > gun appears to be the most actively maintained; I haven't tried it yet but if it's as solid as cowboy, this is probably the right one to use for new projects. > > shotgun is just an SSE convenience wrapper on gun, so if you don't need SSE, sticking with gun is probably your best bet. > > fusco is an alpha quality http client that doesn't appear to be actively maintained. > > In general the state of http clients in erlang is a bewildering, overgrown thicket of ancient decaying masonry and beguiling dead ends filled with poisonous invisible gila monsters. > > F. > > > On Fri, Dec 12, 2014 at 11:44 AM, I?aki Garay > wrote: > We love our tool shotgun[1], built on top of gun: > > [1] https://github.com/inaka/shotgun > > It improves on gun's SSE support. > > good luck, > I?aki > > On Fri, Dec 12, 2014 at 4:38 PM, Mark Nijhof > wrote: > Hi, > > I am looking for the atm best solution to make http requests, from downloading a small file till larger (100mb) archives. I know of f.ex. the httpc, ibrowse, gun. > > Any preferences? And why? > > -Mark > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > > _______________________________________________ > 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 > > > > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.nijhof@REDACTED Fri Dec 12 22:29:39 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Fri, 12 Dec 2014 22:29:39 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: <30DCC6FA-9776-40E3-8A71-1A848680A004@redops.org> References: <30DCC6FA-9776-40E3-8A71-1A848680A004@redops.org> Message-ID: Hi Drew, Thanks, especially for the HTTPS links! -Mark On Fri, Dec 12, 2014 at 10:18 PM, Drew Varner wrote: > Mark, > > If you are communicating to servers via HTTPS, Hackney and other HTTP > clients allow you to pass options to the underlying SSL/TLS socket, > including some verification of the peer certificate. For example: > > > https://github.com/talko/httpcbench/blob/master/src/httpcbench_client.erl#L79-L86 > > Gun has an open issue to address this ( > https://github.com/extend/gun/pull/27), but it is not implemented. If you > use Gun as your HTTPS client, you?re open to man-in-the-middle attacks. > > Do not fall into a false sense of security that any Erlang HTTPS clients > provide complete protection against man-in-the-middle attacks out of the > box. You?ll also want to consider cases where your peer certificate was > revoked by a Certificate Authority. You?d want to know how your HTTPS > client handles certificates when their revocation data has been published > via a CRL or OCSP. CRL verification has made some headway in Erlang (see > the ssl module docs and https://github.com/Vagabond/erl_crl_example > ). You?ll also want to look at > hostname verification ( > https://github.com/deadtrickster/ssl_verify_hostname.erl > ). > > HTTPS is as secure as you make it. > > Felix mentioned ESL?s lhttpc repo. I?d take a look at Talko?s: > https://github.com/talko/lhttpc It?s the underlying HTTP client for > erlcloud. > > Hackney also has nice multipart/form functionality. > > Cheers, > Drew > > On Dec 12, 2014, at 3:45 PM, Mark Nijhof > wrote: > > I meant to mention Hackney. Why would you choose Hackney over Gun and vise > verse? > > On Fri, Dec 12, 2014 at 9:27 PM, Alex Shneyderman > wrote: > >> nobody mentioned hackney: well written, mature, filled with features. not >> to mention very active. >> >> On Fri, Dec 12, 2014 at 3:17 PM, Mark Nijhof < >> mark.nijhof@REDACTED> wrote: >> >>> Hi Felix, I?aki, >>> >>> Thanks for your reply, you confirm what I was thinking myself about >>> using Gun but I asked because of: >>> >>> > In general the state of http clients in erlang is a bewildering, >>> overgrown thicket of ancient decaying masonry and beguiling dead ends >>> filled with poisonous invisible gila monsters. >>> >>> Cheers, >>> >>> -Mark >>> >>> >>> On Fri, Dec 12, 2014 at 9:03 PM, Felix Gallo >>> wrote: >>> >>>> httpc has some weird bugs under load and should be retired from the >>>> standard distribution. >>>> >>>> lhttpc is better but is a dead project and has a variety of forks, some >>>> of which are buggy or incomplete. The 'esl' fork seems to be the closest >>>> although in my experience it seems to have a broken pooling mechanism. >>>> Additionally it uses 'let it crash' for the common case of timeouts, which >>>> can fill up crash.log quickly and impede investigation into real issues. >>>> >>>> dlhttpc is a fork of lhttpc that ferd put together to handle high >>>> volume requests to a low number of endpoints. It's also not actively >>>> maintained, but ferd is still alive and kicking and has recently responded >>>> to pull requests there. I intended on using this but rustled up my own >>>> nasty pool mechanism on top of my own hacked fork of lhttpc. >>>> >>>> gun appears to be the most actively maintained; I haven't tried it yet >>>> but if it's as solid as cowboy, this is probably the right one to use for >>>> new projects. >>>> >>>> shotgun is just an SSE convenience wrapper on gun, so if you don't need >>>> SSE, sticking with gun is probably your best bet. >>>> >>>> fusco is an alpha quality http client that doesn't appear to be >>>> actively maintained. >>>> >>>> In general the state of http clients in erlang is a bewildering, >>>> overgrown thicket of ancient decaying masonry and beguiling dead ends >>>> filled with poisonous invisible gila monsters. >>>> >>>> F. >>>> >>>> >>>> On Fri, Dec 12, 2014 at 11:44 AM, I?aki Garay wrote: >>>>> >>>>> We love our tool shotgun[1], built on top of gun: >>>>> >>>>> [1] https://github.com/inaka/shotgun >>>>> >>>>> It improves on gun's SSE support. >>>>> >>>>> good luck, >>>>> I?aki >>>>> >>>>> On Fri, Dec 12, 2014 at 4:38 PM, Mark Nijhof < >>>>> mark.nijhof@REDACTED> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I am looking for the atm best solution to make http requests, from >>>>>> downloading a small file till larger (100mb) archives. I know of f.ex. the >>>>>> httpc, ibrowse, gun. >>>>>> >>>>>> Any preferences? And why? >>>>>> >>>>>> -Mark >>>>>> >>>>>> -- >>>>>> Mark Nijhof >>>>>> t: @MarkNijhof >>>>>> s: marknijhof >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>>>> >>>>> >>> >>> >>> -- >>> Mark Nijhof >>> t: @MarkNijhof >>> s: marknijhof >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -- Mark Nijhof t: @MarkNijhof s: marknijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From santosh79@REDACTED Sat Dec 13 03:52:31 2014 From: santosh79@REDACTED (Santosh Kumar) Date: Fri, 12 Dec 2014 21:52:31 -0500 Subject: [erlang-questions] Bit Packing question Message-ID: Hi group, I was trying to pack a number into 4 bytes and was having a hard time doing it. Here is what I was trying: 102> Num = 128. 128 103> <>. ** exception error: bad argument While this works: 104> <>. <<0,0,0,128>> Here the packing into 32 bits works but the packing into 4 bytes fails. Not sure why. Any help, much appreciated. Thanks Santosh -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob@REDACTED Sat Dec 13 04:39:47 2014 From: bob@REDACTED (Bob Ippolito) Date: Fri, 12 Dec 2014 19:39:47 -0800 Subject: [erlang-questions] Bit Packing question In-Reply-To: References: Message-ID: 'bytes' is for packing binaries, not numbers. The working example you have is the correct way to do it. On Friday, December 12, 2014, Santosh Kumar wrote: > Hi group, > I was trying to pack a number into 4 bytes and was having a hard time > doing it. Here is what I was trying: > > 102> Num = 128. > > 128 > > 103> <>. > > ** exception error: bad argument > > > While this works: > > > 104> <>. > > <<0,0,0,128>> > > > Here the packing into 32 bits works but the packing into 4 bytes fails. > Not sure why. > > > Any help, much appreciated. > > > Thanks > > Santosh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From santosh79@REDACTED Sat Dec 13 05:22:32 2014 From: santosh79@REDACTED (Santosh Kumar) Date: Fri, 12 Dec 2014 23:22:32 -0500 Subject: [erlang-questions] Bit Packing question In-Reply-To: References: Message-ID: Hrm, I'm not sure I understand. Here's some code: Num = 128. 128 So, Num is a number. I then do: BNum = <>. Now, BNum is a binary. I check it too: is_binary(BNum). true I now, try doing: Packet = <>. ** exception error: bad argument Here, I am trying to create another binary Packet, that is 4 bytes long as and has as it's contents BNum. If what you say is true and "/bytes" is used to pack Binary data this would work. Unless I am missing something. Thanks for your response. Santosh On Fri, Dec 12, 2014 at 10:39 PM, Bob Ippolito wrote: > > 'bytes' is for packing binaries, not numbers. The working example you have > is the correct way to do it. > > > On Friday, December 12, 2014, Santosh Kumar wrote: > >> Hi group, >> I was trying to pack a number into 4 bytes and was having a hard time >> doing it. Here is what I was trying: >> >> 102> Num = 128. >> >> 128 >> >> 103> <>. >> >> ** exception error: bad argument >> >> >> While this works: >> >> >> 104> <>. >> >> <<0,0,0,128>> >> >> >> Here the packing into 32 bits works but the packing into 4 bytes fails. >> Not sure why. >> >> >> Any help, much appreciated. >> >> >> Thanks >> >> Santosh >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Sat Dec 13 05:54:06 2014 From: comptekki@REDACTED (Wes James) Date: Sat, 13 Dec 2014 04:54:06 +0000 Subject: [erlang-questions] Bit Packing question References: Message-ID: According to: http://www.erlang.org/doc/programming_examples/bit_syntax.html after the / you need integer, float or binary, i.e., <> -wes On Fri Dec 12 2014 at 9:22:59 PM Santosh Kumar wrote: > Hrm, I'm not sure I understand. Here's some code: > > Num = 128. > > 128 > > > So, Num is a number. I then do: > > BNum = <>. > > > Now, BNum is a binary. I check it too: > > is_binary(BNum). > > true > > > I now, try doing: > > Packet = <>. > > ** exception error: bad argument > > > Here, I am trying to create another binary Packet, that is 4 bytes long as > and has as it's contents BNum. If what you say is true and "/bytes" is > used to pack Binary data this would work. Unless I am missing something. > > > Thanks for your response. > > > Santosh > > On Fri, Dec 12, 2014 at 10:39 PM, Bob Ippolito wrote: >> >> 'bytes' is for packing binaries, not numbers. The working example you >> have is the correct way to do it. >> >> >> On Friday, December 12, 2014, Santosh Kumar wrote: >> >>> Hi group, >>> I was trying to pack a number into 4 bytes and was having a hard time >>> doing it. Here is what I was trying: >>> >>> 102> Num = 128. >>> >>> 128 >>> >>> 103> <>. >>> >>> ** exception error: bad argument >>> >>> >>> While this works: >>> >>> >>> 104> <>. >>> >>> <<0,0,0,128>> >>> >>> >>> Here the packing into 32 bits works but the packing into 4 bytes fails. >>> Not sure why. >>> >>> >>> Any help, much appreciated. >>> >>> >>> Thanks >>> >>> Santosh >>> >> _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob@REDACTED Sat Dec 13 06:34:36 2014 From: bob@REDACTED (Bob Ippolito) Date: Fri, 12 Dec 2014 21:34:36 -0800 Subject: [erlang-questions] Bit Packing question In-Reply-To: References: Message-ID: <> is equivalent to <>. Its byte_size is 1. If you want a four byte long representation of that number, you need to explicitly state that you want it to be encoded in 32 bits as <>. On Fri, Dec 12, 2014 at 8:22 PM, Santosh Kumar wrote: > Hrm, I'm not sure I understand. Here's some code: > > Num = 128. > > 128 > > > So, Num is a number. I then do: > > BNum = <>. > > > Now, BNum is a binary. I check it too: > > is_binary(BNum). > > true > > > I now, try doing: > > Packet = <>. > > ** exception error: bad argument > > > Here, I am trying to create another binary Packet, that is 4 bytes long as > and has as it's contents BNum. If what you say is true and "/bytes" is > used to pack Binary data this would work. Unless I am missing something. > > > Thanks for your response. > > > Santosh > > On Fri, Dec 12, 2014 at 10:39 PM, Bob Ippolito wrote: >> >> 'bytes' is for packing binaries, not numbers. The working example you >> have is the correct way to do it. >> >> >> On Friday, December 12, 2014, Santosh Kumar wrote: >> >>> Hi group, >>> I was trying to pack a number into 4 bytes and was having a hard time >>> doing it. Here is what I was trying: >>> >>> 102> Num = 128. >>> >>> 128 >>> >>> 103> <>. >>> >>> ** exception error: bad argument >>> >>> >>> While this works: >>> >>> >>> 104> <>. >>> >>> <<0,0,0,128>> >>> >>> >>> Here the packing into 32 bits works but the packing into 4 bytes fails. >>> Not sure why. >>> >>> >>> Any help, much appreciated. >>> >>> >>> Thanks >>> >>> Santosh >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From matwey.kornilov@REDACTED Sat Dec 13 13:11:12 2014 From: matwey.kornilov@REDACTED (Matwey V. Kornilov) Date: Sat, 13 Dec 2014 15:11:12 +0300 Subject: [erlang-questions] Erlang/OTP 17.4 has been released. In-Reply-To: <54898937.6030009@erlang.org> References: <54898937.6030009@erlang.org> Message-ID: 11.12.2014 15:08, Henrik Nord ?????: > Erlang/OTP 17.4 has been released. Hi, Could you please explain release policy? Only 17.x releases are announced and placed on http://www.erlang.org/download.html (except 17.2). At the same time at github there are way more tags: 17.3.Y Should I consider only announces releases as `official`? From santosh79@REDACTED Sat Dec 13 15:25:56 2014 From: santosh79@REDACTED (Santosh Kumar) Date: Sat, 13 Dec 2014 09:25:56 -0500 Subject: [erlang-questions] Bit Packing question In-Reply-To: References: Message-ID: Hi Wes, I just tried <> and that didn't work as well. Here are the complete steps I ran through in erl: 1> Num = 128. 128 2> BNum = <>. <<128>> 3> Packet = <>. ** exception error: bad argument Any help much appreciated. Thanks Santosh On Fri, Dec 12, 2014 at 11:54 PM, Wes James wrote: > > According to: > > http://www.erlang.org/doc/programming_examples/bit_syntax.html > > after the / you need integer, float or binary, i.e., <> > > -wes > > > On Fri Dec 12 2014 at 9:22:59 PM Santosh Kumar > wrote: > >> Hrm, I'm not sure I understand. Here's some code: >> >> Num = 128. >> >> 128 >> >> >> So, Num is a number. I then do: >> >> BNum = <>. >> >> >> Now, BNum is a binary. I check it too: >> >> is_binary(BNum). >> >> true >> >> >> I now, try doing: >> >> Packet = <>. >> >> ** exception error: bad argument >> >> >> Here, I am trying to create another binary Packet, that is 4 bytes long >> as and has as it's contents BNum. If what you say is true and "/bytes" >> is used to pack Binary data this would work. Unless I am missing something. >> >> >> Thanks for your response. >> >> >> Santosh >> >> On Fri, Dec 12, 2014 at 10:39 PM, Bob Ippolito wrote: >>> >>> 'bytes' is for packing binaries, not numbers. The working example you >>> have is the correct way to do it. >>> >>> >>> On Friday, December 12, 2014, Santosh Kumar wrote: >>> >>>> Hi group, >>>> I was trying to pack a number into 4 bytes and was having a hard time >>>> doing it. Here is what I was trying: >>>> >>>> 102> Num = 128. >>>> >>>> 128 >>>> >>>> 103> <>. >>>> >>>> ** exception error: bad argument >>>> >>>> >>>> While this works: >>>> >>>> >>>> 104> <>. >>>> >>>> <<0,0,0,128>> >>>> >>>> >>>> Here the packing into 32 bits works but the packing into 4 bytes fails. >>>> Not sure why. >>>> >>>> >>>> Any help, much appreciated. >>>> >>>> >>>> Thanks >>>> >>>> Santosh >>>> >>> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Sat Dec 13 15:32:50 2014 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sat, 13 Dec 2014 15:32:50 +0100 Subject: [erlang-questions] Bit Packing question In-Reply-To: References: Message-ID: <548C4E12.9010101@wanadoo.fr> 1> Num = 128. 128 2> BNum = <>. <<128>> 3> Packet = <>. <<128>> regards. Le 13/12/2014 15:25, Santosh Kumar a ?crit : > Hi Wes, > I just tried <> and that didn't work as well. Here are > the complete steps I ran through in erl: > > 1> Num = 128. > > 128 > > 2> BNum = <>. > > <<128>> > > 3> Packet = <>. > > ** exception error: bad argument > > > Any help much appreciated. > > > Thanks > > Santosh > > > On Fri, Dec 12, 2014 at 11:54 PM, Wes James > wrote: > > According to: > > http://www.erlang.org/doc/programming_examples/bit_syntax.html > > after the / you need integer, float or binary, i.e., <> > > -wes > > > On Fri Dec 12 2014 at 9:22:59 PM Santosh Kumar > wrote: > > Hrm, I'm not sure I understand. Here's some code: > > Num = 128. > > 128 > > > So, Num is a number. I then do: > > BNum = <>. > > > Now, BNum is a binary. I check it too: > > is_binary(BNum). > > true > > > I now, try doing: > > Packet = <>. > > ** exception error: bad argument > > > Here, I am trying to create another binary Packet, that is 4 > bytes long as and has as it's contents BNum. If what you say is > true and "/bytes" is used to pack Binary data this would work. > Unless I am missing something. > > > Thanks for your response. > > > Santosh > > > On Fri, Dec 12, 2014 at 10:39 PM, Bob Ippolito > wrote: > > 'bytes' is for packing binaries, not numbers. The > working example you have is the correct way to do it. > > > On Friday, December 12, 2014, Santosh Kumar > > wrote: > > Hi group, > I was trying to pack a number into 4 bytes and was > having a hard time doing it. Here is what I was trying: > > 102> Num = 128. > > 128 > > 103> <>. > > ** exception error: bad argument > > > While this works: > > > 104> <>. > > <<0,0,0,128>> > > > Here the packing into 32 bits works but the packing into > 4 bytes fails. Not sure why. > > > Any help, much appreciated. > > > Thanks > > Santosh > > _________________________________________________ > 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 eric.pailleau@REDACTED Sat Dec 13 15:35:21 2014 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sat, 13 Dec 2014 15:35:21 +0100 Subject: [erlang-questions] Bit Packing question In-Reply-To: <548C4E12.9010101@wanadoo.fr> References: <548C4E12.9010101@wanadoo.fr> Message-ID: <548C4EA9.4030306@wanadoo.fr> 5> A = <<1,2,8>>. <<1,2,8>> 6> P = <>. <<1,2>> Got it ? Le 13/12/2014 15:32, PAILLEAU Eric a ?crit : > 1> Num = 128. > 128 > 2> BNum = <>. > <<128>> > 3> Packet = <>. > <<128>> > > regards. > > > Le 13/12/2014 15:25, Santosh Kumar a ?crit : >> Hi Wes, >> I just tried <> and that didn't work as well. Here are >> the complete steps I ran through in erl: >> >> 1> Num = 128. >> >> 128 >> >> 2> BNum = <>. >> >> <<128>> >> >> 3> Packet = <>. >> >> ** exception error: bad argument >> >> >> Any help much appreciated. >> >> >> Thanks >> >> Santosh >> >> >> On Fri, Dec 12, 2014 at 11:54 PM, Wes James > > wrote: >> >> According to: >> >> http://www.erlang.org/doc/programming_examples/bit_syntax.html >> >> after the / you need integer, float or binary, i.e., >> <> >> >> -wes >> >> >> On Fri Dec 12 2014 at 9:22:59 PM Santosh Kumar > > wrote: >> >> Hrm, I'm not sure I understand. Here's some code: >> >> Num = 128. >> >> 128 >> >> >> So, Num is a number. I then do: >> >> BNum = <>. >> >> >> Now, BNum is a binary. I check it too: >> >> is_binary(BNum). >> >> true >> >> >> I now, try doing: >> >> Packet = <>. >> >> ** exception error: bad argument >> >> >> Here, I am trying to create another binary Packet, that is 4 >> bytes long as and has as it's contents BNum. If what you say is >> true and "/bytes" is used to pack Binary data this would work. >> Unless I am missing something. >> >> >> Thanks for your response. >> >> >> Santosh >> >> >> On Fri, Dec 12, 2014 at 10:39 PM, Bob Ippolito > > wrote: >> >> 'bytes' is for packing binaries, not numbers. The >> working example you have is the correct way to do it. >> >> >> On Friday, December 12, 2014, Santosh Kumar >> > wrote: >> >> Hi group, >> I was trying to pack a number into 4 bytes and was >> having a hard time doing it. Here is what I was trying: >> >> 102> Num = 128. >> >> 128 >> >> 103> <>. >> >> ** exception error: bad argument >> >> >> While this works: >> >> >> 104> <>. >> >> <<0,0,0,128>> >> >> >> Here the packing into 32 bits works but the packing into >> 4 bytes fails. Not sure why. >> >> >> Any help, much appreciated. >> >> >> Thanks >> >> Santosh >> >> _________________________________________________ >> 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 tuncer.ayaz@REDACTED Sat Dec 13 21:27:25 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sat, 13 Dec 2014 21:27:25 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: On Fri, Dec 12, 2014 at 9:03 PM, Felix Gallo wrote: > httpc has some weird bugs under load and should be retired from the > standard distribution. Hi Felix, you clearly have experienced httpc's limitations/bugs, so I'm curious to hear your thoughts on the following. What's the solution? 1) replace httpc's implementation with hackney? 2) rewrite httpc? 3) drop httpc? I haven't used httpc enough to run into the mentioned issues, but I do wonder why instead of fixing httpc we, as a community, write more than a few alternative http clients. Is it because it's easy to do like a httpd? I think it's very important that the network code in otp.git is fixed and improved where necessary to leave external httpd or httpc libs to special purpose cases. Other languages don't seem to suffer from this and carry http[c,d] libs which are well-maintained and the go to implementation for common use cases. Also see: http://erlang.org/pipermail/erlang-questions/2014-February/077766.html With all that said, I'm confident the OTP team would more than welcome improvements or even replacements for inets components. From g@REDACTED Sat Dec 13 21:40:14 2014 From: g@REDACTED (Garrett Smith) Date: Sat, 13 Dec 2014 14:40:14 -0600 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: Wrap curl with a port. Keep in mind though, from the sound of it, people seem to _like_ wrassling with Erlang and http client behavior. You'd miss out on the fun if you go with curl. On Fri, Dec 12, 2014 at 1:38 PM, Mark Nijhof wrote: > Hi, > > I am looking for the atm best solution to make http requests, from > downloading a small file till larger (100mb) archives. I know of f.ex. the > httpc, ibrowse, gun. > > Any preferences? And why? > > -Mark > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From essen@REDACTED Sat Dec 13 22:10:28 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sat, 13 Dec 2014 23:10:28 +0200 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: <548CAB44.4020707@ninenines.eu> On 12/13/2014 10:27 PM, Tuncer Ayaz wrote: > On Fri, Dec 12, 2014 at 9:03 PM, Felix Gallo wrote: >> httpc has some weird bugs under load and should be retired from the >> standard distribution. > [...] > I haven't used httpc enough to run into the mentioned issues, but I do > wonder why instead of fixing httpc we, as a community, write more than > a few alternative http clients. Is it because it's easy to do like a > httpd? The "httpc gets confused under load" bug has popped up for at least two years. I am not sure as to why nobody sent a patch for it (other than it being quite hard to replicate outside production), but I can tell you why some alternatives were written: to get different properties. Hackney would be what you use for process-less connections. Gun what you use for message-based always-connected connections. Etc. This is the main reason why alternatives exist. Existing project A has different properties than you need; you can't add those properties to project A without breaking all existing code (or sometimes, at all); you either fork A into project A' or create project B. In my projects for example, the need for specific properties is why Cowboy and erlang.mk exist. I moved from rebar to erlang.mk because of two issues that can never be fixed in rebar: "hot" compilation speed, and self-contained dependencies (aka don't use top-level rebar to compile everything, because some dependencies expect a particular version of rebar). And in projects I use, Gproc would be a great example of replicating functionality found in OTP but with different, and imo much better, properties. Sometimes people also write alternatives as a way of learning, too, but I do not know many examples like this. > I think it's very important that the network code in otp.git is fixed > and improved where necessary to leave external httpd or httpc libs to > special purpose cases. Other languages don't seem to suffer from this > and carry http[c,d] libs which are well-maintained and the go to > implementation for common use cases. As for httpd being the odd one out, I would guess the main reason would be that the documentation is very confusing as to how to make it run your Erlang code, and what you can do and how. It's well documented for the file serving part, but seem to fall apart after that. The Apache oriented design will also leave many people scratching their head I'm sure. > Also see: > http://erlang.org/pipermail/erlang-questions/2014-February/077766.html > > > With all that said, I'm confident the OTP team would more than welcome > improvements or even replacements for inets components. Perhaps it is fine as it is (though that bug being fixed eventually would still be nice). OTP libs don't have to try to be the ultimate "everything you'll ever need", just provide the bare minimum for a useful system. (I would say they provide way too many libs right now, but http[cd] are fine.) -- Lo?c Hoguin http://ninenines.eu From max.lapshin@REDACTED Sun Dec 14 08:56:32 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Sun, 14 Dec 2014 10:56:32 +0300 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: <548CAB44.4020707@ninenines.eu> References: <548CAB44.4020707@ninenines.eu> Message-ID: Haha, there are about 20 ruby http clients, because stdlib clients is useless. The same with python. I can't remember languages with good http client in stdlib except browser javascript -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Sun Dec 14 09:44:28 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Sun, 14 Dec 2014 09:44:28 +0100 Subject: [erlang-questions] What lib to use for http requests Message-ID: I always thought that the solution is not to write httpc modules but to write each needed RFC as a module and do some Lego with dependances. This way would efficient to know what is able to do a httpc module. A big work however for a single man, not so much for a community... regards ? Envoy? depuis mon mobile ? Eric Max Lapshin a ?crit?: >Haha, there are about 20 ruby http clients, because stdlib clients is >useless. > >The same with python. I can't remember languages with good http client in >stdlib except browser javascript > >_______________________________________________ >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 Sun Dec 14 13:04:51 2014 From: eriksoe@REDACTED (=?UTF-8?Q?Erik_S=C3=B8e_S=C3=B8rensen?=) Date: Sun, 14 Dec 2014 13:04:51 +0100 Subject: [erlang-questions] Bit Packing question In-Reply-To: <548C4EA9.4030306@wanadoo.fr> References: <548C4E12.9010101@wanadoo.fr> <548C4EA9.4030306@wanadoo.fr> Message-ID: Since no-one else mentioned it: What you're looking for is probably the "unit" modifier: 1> Num = 123. 123 2> <>. <<0,0,0,123>> The default unit for (integers/floats/bitstring) is 1 bit, while the default unit for binaries ('bytes') is 1 byte. /Erik 2014-12-13 15:35 GMT+01:00 PAILLEAU Eric : > > 5> A = <<1,2,8>>. > <<1,2,8>> > 6> P = <>. > <<1,2>> > > Got it ? > > Le 13/12/2014 15:32, PAILLEAU Eric a ?crit : > > 1> Num = 128. >> 128 >> 2> BNum = <>. >> <<128>> >> 3> Packet = <>. >> <<128>> >> >> regards. >> >> >> Le 13/12/2014 15:25, Santosh Kumar a ?crit : >> >>> Hi Wes, >>> I just tried <> and that didn't work as well. Here are >>> the complete steps I ran through in erl: >>> >>> 1> Num = 128. >>> >>> 128 >>> >>> 2> BNum = <>. >>> >>> <<128>> >>> >>> 3> Packet = <>. >>> >>> ** exception error: bad argument >>> >>> >>> Any help much appreciated. >>> >>> >>> Thanks >>> >>> Santosh >>> >>> >>> On Fri, Dec 12, 2014 at 11:54 PM, Wes James >> > wrote: >>> >>> According to: >>> >>> http://www.erlang.org/doc/programming_examples/bit_syntax.html >>> >>> after the / you need integer, float or binary, i.e., >>> <> >>> >>> -wes >>> >>> >>> On Fri Dec 12 2014 at 9:22:59 PM Santosh Kumar >> > wrote: >>> >>> Hrm, I'm not sure I understand. Here's some code: >>> >>> Num = 128. >>> >>> 128 >>> >>> >>> So, Num is a number. I then do: >>> >>> BNum = <>. >>> >>> >>> Now, BNum is a binary. I check it too: >>> >>> is_binary(BNum). >>> >>> true >>> >>> >>> I now, try doing: >>> >>> Packet = <>. >>> >>> ** exception error: bad argument >>> >>> >>> Here, I am trying to create another binary Packet, that is 4 >>> bytes long as and has as it's contents BNum. If what you say is >>> true and "/bytes" is used to pack Binary data this would work. >>> Unless I am missing something. >>> >>> >>> Thanks for your response. >>> >>> >>> Santosh >>> >>> >>> On Fri, Dec 12, 2014 at 10:39 PM, Bob Ippolito >> > wrote: >>> >>> 'bytes' is for packing binaries, not numbers. The >>> working example you have is the correct way to do it. >>> >>> >>> On Friday, December 12, 2014, Santosh Kumar >>> > wrote: >>> >>> Hi group, >>> I was trying to pack a number into 4 bytes and was >>> having a hard time doing it. Here is what I was trying: >>> >>> 102> Num = 128. >>> >>> 128 >>> >>> 103> <>. >>> >>> ** exception error: bad argument >>> >>> >>> While this works: >>> >>> >>> 104> <>. >>> >>> <<0,0,0,128>> >>> >>> >>> Here the packing into 32 bits works but the packing into >>> 4 bytes fails. Not sure why. >>> >>> >>> Any help, much appreciated. >>> >>> >>> Thanks >>> >>> Santosh >>> >>> _________________________________________________ >>> 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Sun Dec 14 22:21:15 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sun, 14 Dec 2014 22:21:15 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: On Sun, Dec 14, 2014 at 9:44 AM, Eric Pailleau wrote: > > I always thought that the solution is not to write httpc modules but to > write each needed RFC as a module and do some Lego with dependances. > This way would efficient to know what is able to do a httpc module. > A big work however for a single man, not so much for a community... > regards > ? Envoy? depuis mon mobile ? Eric > cowlib or hackney_lib (in hackney) do that. Main difficulty is not to weite them but write proper test to them .... - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Sun Dec 14 22:24:11 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sun, 14 Dec 2014 22:24:11 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: <30DCC6FA-9776-40E3-8A71-1A848680A004@redops.org> References: <30DCC6FA-9776-40E3-8A71-1A848680A004@redops.org> Message-ID: On Fri, Dec 12, 2014 at 10:18 PM, Drew Varner wrote: > > Mark, > > If you are communicating to servers via HTTPS, Hackney and other HTTP > clients allow you to pass options to the underlying SSL/TLS socket, > including some verification of the peer certificate. For example: > > > https://github.com/talko/httpcbench/blob/master/src/httpcbench_client.erl#L79-L86 > > Gun has an open issue to address this ( > https://github.com/extend/gun/pull/27), but it is not implemented. If you > use Gun as your HTTPS client, you?re open to man-in-the-middle attacks. > > Do not fall into a false sense of security that any Erlang HTTPS clients > provide complete protection against man-in-the-middle attacks out of the > box. You?ll also want to consider cases where your peer certificate was > revoked by a Certificate Authority. You?d want to know how your HTTPS > client handles certificates when their revocation data has been published > via a CRL or OCSP. CRL verification has made some headway in Erlang (see > the ssl module docs and https://github.com/Vagabond/erl_crl_example > ). You?ll also want to look at > hostname verification ( > https://github.com/deadtrickster/ssl_verify_hostname.erl > ). > > HTTPS is as secure as you make it. > Just to expand a little bit, now on latest stable erlang versions of SSL hackney 1.0.x is by default checking SSL certificates and their hostname. - benoit > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drew.varner@REDACTED Sun Dec 14 22:27:52 2014 From: drew.varner@REDACTED (Drew Varner) Date: Sun, 14 Dec 2014 16:27:52 -0500 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: <30DCC6FA-9776-40E3-8A71-1A848680A004@redops.org> Message-ID: <953B4A0D-652E-4897-80B6-BC65ABB1EF37@redops.org> Benoit, Nice. Is there any CRL or OCSP integration implemented or planned? Cheers, Drew > On Dec 14, 2014, at 4:24 PM, Benoit Chesneau wrote: > > > >> On Fri, Dec 12, 2014 at 10:18 PM, Drew Varner wrote: >> Mark, >> >> If you are communicating to servers via HTTPS, Hackney and other HTTP clients allow you to pass options to the underlying SSL/TLS socket, including some verification of the peer certificate. For example: >> >> https://github.com/talko/httpcbench/blob/master/src/httpcbench_client.erl#L79-L86 >> >> Gun has an open issue to address this (https://github.com/extend/gun/pull/27), but it is not implemented. If you use Gun as your HTTPS client, you?re open to man-in-the-middle attacks. >> >> Do not fall into a false sense of security that any Erlang HTTPS clients provide complete protection against man-in-the-middle attacks out of the box. You?ll also want to consider cases where your peer certificate was revoked by a Certificate Authority. You?d want to know how your HTTPS client handles certificates when their revocation data has been published via a CRL or OCSP. CRL verification has made some headway in Erlang (see the ssl module docs and https://github.com/Vagabond/erl_crl_example). You?ll also want to look at hostname verification (https://github.com/deadtrickster/ssl_verify_hostname.erl). >> >> HTTPS is as secure as you make it. > > > Just to expand a little bit, now on latest stable erlang versions of SSL hackney 1.0.x is by default checking SSL certificates and their hostname. > > - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From felixgallo@REDACTED Sun Dec 14 22:44:23 2014 From: felixgallo@REDACTED (Felix Gallo) Date: Sun, 14 Dec 2014 13:44:23 -0800 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: Hi Tuncer, Your questions are excellent ones. I agree with your assertion that it'd be nice if http[c,d] were well-supported and kept up to date in the standard library, but on the other hand that's equivalent to me saying that it would be nice if other people did some tedious work. The OTP team appears to be, ah, not luxuriously staffed, and, er, somewhat well-task-committed towards commercial customers, so it's easy to see how they're not spending their days fastidiously refactoring the standard library. It would be interesting to know what the OTP team's official position on accepting new libraries and deprecating old ones is, and what the process would look like (EEP? Other?). F. On Sat, Dec 13, 2014 at 12:27 PM, Tuncer Ayaz wrote: > > On Fri, Dec 12, 2014 at 9:03 PM, Felix Gallo wrote: > > httpc has some weird bugs under load and should be retired from the > > standard distribution. > > Hi Felix, > > you clearly have experienced httpc's limitations/bugs, so I'm curious > to hear your thoughts on the following. > > What's the solution? > 1) replace httpc's implementation with hackney? > > 2) rewrite httpc? > > 3) drop httpc? > I haven't used httpc enough to run into the mentioned issues, but I do > wonder why instead of fixing httpc we, as a community, write more than > a few alternative http clients. Is it because it's easy to do like a > httpd? > > I think it's very important that the network code in otp.git is fixed > and improved where necessary to leave external httpd or httpc libs to > special purpose cases. Other languages don't seem to suffer from this > and carry http[c,d] libs which are well-maintained and the go to > implementation for common use cases. > > Also see: > http://erlang.org/pipermail/erlang-questions/2014-February/077766.html > > > With all that said, I'm confident the OTP team would more than welcome > improvements or even replacements for inets components. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Sun Dec 14 22:48:28 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sun, 14 Dec 2014 22:48:28 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: <953B4A0D-652E-4897-80B6-BC65ABB1EF37@redops.org> References: <30DCC6FA-9776-40E3-8A71-1A848680A004@redops.org> <953B4A0D-652E-4897-80B6-BC65ABB1EF37@redops.org> Message-ID: > On 14 Dec 2014, at 22:27, Drew Varner wrote: > > Benoit, > > Nice. Is there any CRL or OCSP integration implemented or planned? > > Cheers, > Drew > Could you open a ticket about it? If it?s possible I would say why not. Not sure what it requires right now though. - benoit > > > On Dec 14, 2014, at 4:24 PM, Benoit Chesneau > wrote: > >> >> >> On Fri, Dec 12, 2014 at 10:18 PM, Drew Varner > wrote: >> Mark, >> >> If you are communicating to servers via HTTPS, Hackney and other HTTP clients allow you to pass options to the underlying SSL/TLS socket, including some verification of the peer certificate. For example: >> >> https://github.com/talko/httpcbench/blob/master/src/httpcbench_client.erl#L79-L86 >> >> Gun has an open issue to address this (https://github.com/extend/gun/pull/27 ), but it is not implemented. If you use Gun as your HTTPS client, you?re open to man-in-the-middle attacks. >> >> Do not fall into a false sense of security that any Erlang HTTPS clients provide complete protection against man-in-the-middle attacks out of the box. You?ll also want to consider cases where your peer certificate was revoked by a Certificate Authority. You?d want to know how your HTTPS client handles certificates when their revocation data has been published via a CRL or OCSP. CRL verification has made some headway in Erlang (see the ssl module docs and https://github.com/Vagabond/erl_crl_example ). You?ll also want to look at hostname verification (https://github.com/deadtrickster/ssl_verify_hostname.erl ). >> >> HTTPS is as secure as you make it. >> >> >> Just to expand a little bit, now on latest stable erlang versions of SSL hackney 1.0.x is by default checking SSL certificates and their hostname. >> >> - benoit >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Sun Dec 14 23:04:24 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Sun, 14 Dec 2014 23:04:24 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: To replace httpc by another client? What if people fixed it instead of scratching their own NIH itches by making new ones? Le 14 d?c. 2014 ? 22:44, Felix Gallo a ?crit : > It would be interesting to know what the OTP team's official position on accepting new libraries and deprecating old ones is, and what the process would look like (EEP? Other?). > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Sun Dec 14 23:12:38 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sun, 14 Dec 2014 23:12:38 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: <3E072338-138E-4A0E-8196-C5C26432C8E4@gmail.com> > On 14 Dec 2014, at 23:04, Anthony Ramine wrote: > > To replace httpc by another client? What if people fixed it instead of scratching their own NIH itches by making new ones? Because it?s easier to start from scratch rather than having to touch each bits when its not just about fixing it? Anyway more interestingly, is there any EEP that describes the requirements of httpc? Which one to check if we want to enter in? - benoit > > Le 14 d?c. 2014 ? 22:44, Felix Gallo > a ?crit : > >> It would be interesting to know what the OTP team's official position on accepting new libraries and deprecating old ones is, and what the process would look like (EEP? Other?). >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Sun Dec 14 23:39:21 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Sun, 14 Dec 2014 23:39:21 +0100 Subject: [erlang-questions] What lib to use for http requests Message-ID: <53xes4yk0evoqpdlavca8xvj.1418596761024@email.android.com> Hi, ok but RFC 2616 or 2817 ? (or even historical 1945 ?) A list of features in readme.md, but no reference to a RFC version... If each RFC had its own module, easy to compare several implementation, and even have the choice between speed, memory footprint, or whatsoever. comparing two modules of same RFC is totally objective. And same common tests can be used. Each brick of RFC tree might be written by community. Easy to maintain each brick, and easy to supersede a module by a better implementation. This would help Erlang to be THE reference in all languages jungle... A dream ? ? Envoy? depuis mon mobile ? Eric Benoit Chesneau a ?crit?: >On Sun, Dec 14, 2014 at 9:44 AM, Eric Pailleau >wrote: >> >> I always thought that the solution is not to write httpc modules but to >> write each needed RFC as a module and do some Lego with dependances. >> This way would efficient to know what is able to do a httpc module. >> A big work however for a single man, not so much for a community... >> regards >> ? Envoy? depuis mon mobile ? Eric >> > >cowlib or hackney_lib (in hackney) do that. Main difficulty is not to weite >them but write proper test to them .... > >- benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Sun Dec 14 23:40:16 2014 From: t@REDACTED (Tristan Sloughter) Date: Sun, 14 Dec 2014 16:40:16 -0600 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: <1418596816.3904703.202810009.7DDFAD3E@webmail.messagingengine.com> Some are trying to fix bugs in httpc. Give help: http://erlang.org/pipermail/erlang-bugs/2014-November/004655.html -- Tristan Sloughter t@REDACTED On Sun, Dec 14, 2014, at 04:04 PM, Anthony Ramine wrote: > To replace httpc by another client? What if people fixed it instead of > scratching their own NIH itches by making new ones? > > Le 14 d?c. 2014 ? 22:44, Felix Gallo a ?crit : > >> It would be interesting to know what the OTP team's official position >> on accepting new libraries and deprecating old ones is, and what the >> process would look like (EEP? Other?). >> > > _________________________________________________ > 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 Mon Dec 15 00:17:30 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Sun, 14 Dec 2014 18:17:30 -0500 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: <53xes4yk0evoqpdlavca8xvj.1418596761024@email.android.com> References: <53xes4yk0evoqpdlavca8xvj.1418596761024@email.android.com> Message-ID: <20141214231729.GB1307@ferdmbp.local> On 12/14, Eric Pailleau wrote: > Hi, > ok but RFC 2616 or 2817 ? (or even historical 1945 ?) By the way you also have RFCs 7230..7235 now, superseding the two previous HTTP/1.1 versions. (not sure if anyone would have wanted the 26 drafts in between too: http://trac.tools.ietf.org/wg/httpbis/trac/browser#draft-ietf-httpbis) Best of luck to whoever decides to go for literal RFC support for this. From eric.pailleau@REDACTED Mon Dec 15 00:40:48 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Mon, 15 Dec 2014 00:40:48 +0100 Subject: [erlang-questions] What lib to use for http requests Message-ID: Sure, would be idiot to implement obsolete or superseded RFCs . but is it smart to have dozen of ?same? applications/modules that cannot be compared each other, or even against the IETF reference ? Some inefficient entropy. With brilliant works fulling cimetary. However, being RFC compliant is not enough, as far RFC texts are full of SHOULD and SHOULD NOT... But easier to say ?RFC compliant with option this, but not option that.? Erlang community is growing, and contributors are now numerous. Could be a great motivation, each one its own RFC. MHO. ? Envoy? depuis mon mobile ? Eric Fred Hebert a ?crit?: >On 12/14, Eric Pailleau wrote: >> Hi, >> ok but RFC 2616 or 2817 ? (or even historical 1945 ?) > >By the way you also have RFCs 7230..7235 now, superseding the two previous >HTTP/1.1 versions. (not sure if anyone would have wanted the 26 drafts >in between too: http://trac.tools.ietf.org/wg/httpbis/trac/browser#draft-ietf-httpbis) > >Best of luck to whoever decides to go for literal RFC support for this. From timmcgil@REDACTED Mon Dec 15 02:14:46 2014 From: timmcgil@REDACTED (Tim McGilchrist) Date: Mon, 15 Dec 2014 12:14:46 +1100 Subject: [erlang-questions] Emysql: a cry for help (Harbinger is releasing control) In-Reply-To: References: <546CCEAA.2060207@gmail.com> Message-ID: <888AD908-EFD4-4571-9AFC-31DDA3EA046D@gmail.com> I've got some spare cycles that I'd like to put towards this project, I may regret it but that's for my future self to deal with :-) Database libraries have always kinda sucked IMO in erlang and I'd like to try improving that situation. I've got a decent enough grasp of the language and the problem space (I think), but would appreciate having someone to bounce ideas off. Suppose I start with doing a triage of the open issues and go from there. Adding a github organisation sounds like a win to me, it'd fix some of the issues around finding the official mysql driver and having a group of interested contributors. Tim @lambda_foo http://github.com/tmcgilchrist On 20 Nov 2014, at 8:29 am, Jesper Louis Andersen wrote: > It sounds really awesome you would take over the work by volunteering with no time at all :) However, much as I would like to add you to the repository, it is not mine. It is owned by Henning Diedrich, but I can vouch for you to be added if need be. Also, the immediate work that needs done is to triage all the open PRs and pull those in which makes sense. I don't want to be the judge too much on the direction to take though my style has mostly been to stay backwards compatible at all costs. Mostly because one has to strike a balance deciding if this is development or maintenance. > > On Wed, Nov 19, 2014 at 6:39 PM, Garrett Smith wrote: > On Wed, Nov 19, 2014 at 11:08 AM, Michael Truog wrote: > > On 11/19/2014 08:18 AM, Jesse Gumm wrote: > > > > On Nov 19, 2014 10:16 AM, "Jesse Gumm" wrote: > >> > >> What about creating an organization on github called emysql and move the > >> repo over to that, promoting a handful of team members whose contributions > >> you trust to be acceptable. > >> > >> Then we don't have to figure out whose repo is "official" every couple of > >> years, just promote contributors to the repo and magical things happen. > >> > >> -Jesse > > > > > > I agree. This approach makes the most sense. > > One other option - and this one would minimize moving parts until the > library is (wave hands) re-launched as something better - is for > Jesper to just add some of us as contributors to deal with the PRs. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > J. > _______________________________________________ > 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 Mon Dec 15 10:00:23 2014 From: tony@REDACTED (Tony Rogvall) Date: Mon, 15 Dec 2014 10:00:23 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: <8E94BDC4-54F0-4BCB-969D-2590766DE5AF@rogvall.se> 1000% agree on this. Unfortunately I tend to have that itch my self :-) But I am trying to fight it. > On 14 dec 2014, at 23:04, Anthony Ramine wrote: > > To replace httpc by another client? What if people fixed it instead of scratching their own NIH itches by making new ones? > > Le 14 d?c. 2014 ? 22:44, Felix Gallo > a ?crit : > >> It would be interesting to know what the OTP team's official position on accepting new libraries and deprecating old ones is, and what the process would look like (EEP? Other?). >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: Message signed with OpenPGP using GPGMail URL: From davidnwelton@REDACTED Mon Dec 15 17:56:13 2014 From: davidnwelton@REDACTED (David Welton) Date: Mon, 15 Dec 2014 17:56:13 +0100 Subject: [erlang-questions] C interface, NaN and infinity In-Reply-To: References: <5481E4FE.5010309@erlang.org> <5481EF23.6020706@erlang.org> Message-ID: I started working on what might be a fix for this, here: https://github.com/davidw/otp/tree/error_on_nan_inf It's a little bit more complicated than I'd hoped for, since it's necessary to link against libm: LD /home/davidw/workshop/otp/lib/erl_interface/bin/x86_64-unknown-linux-gnu/erl_call /home/davidw/workshop/otp/lib/erl_interface/obj/x86_64-unknown-linux-gnu/libei.a(encode_double.o): In function `ei_encode_double': /home/davidw/workshop/otp/lib/erl_interface/src/encode/encode_double.c:34: undefined reference to `__fpclassify' collect2: error: ld returned 1 exit status ... and I'm not quite sure how to do that within the Erlang compilation framework (it's been ages since I've worked with configure and friends). Also, there are docs and the test suite to fix too. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From essen@REDACTED Mon Dec 15 19:13:05 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 15 Dec 2014 20:13:05 +0200 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: <20141214231729.GB1307@ferdmbp.local> References: <53xes4yk0evoqpdlavca8xvj.1418596761024@email.android.com> <20141214231729.GB1307@ferdmbp.local> Message-ID: <548F24B1.1040500@ninenines.eu> On 12/15/2014 01:17 AM, Fred Hebert wrote: > On 12/14, Eric Pailleau wrote: >> Hi, >> ok but RFC 2616 or 2817 ? (or even historical 1945 ?) > > By the way you also have RFCs 7230..7235 now, superseding the two previous > HTTP/1.1 versions. (not sure if anyone would have wanted the 26 drafts > in between too: http://trac.tools.ietf.org/wg/httpbis/trac/browser#draft-ietf-httpbis) > > Best of luck to whoever decides to go for literal RFC support for this. It's a little more than those 6, there's a number of other RFCs still standing (PATCH for example) and some others released since (like the one adding a new redirect status code). The RFC723x ones are much better though, they don't leave much room for interpretation (though some things are still undefined) so implementations following them should be much more compatible. I am currently working my way through the parsing of HTTP headers from RFC7230 and RFC7231, making it more precise and more efficient than previous Cowboy code, and well tested using Triq. I believe this, and most of the code in Cowlib, would benefit httpc users, as I don't think httpc comes with header parsing functions and the like. The drawback though is that httpc uses strings, so it needs to convert values to binary first. But it'd still be possible for users of most project to depend on Cowlib and start using the parsing functions there. They're fairly straightforward too I think: cow_http_hd:parse_content_type(ContentType) The parsing code was detached from Cowboy into a separate library so that it could be shared between projects, so there should be no problem for other projects using it. It *is* parsing code only though. The logic code and interface is where projects would differ the most so it makes little sense to try to abstract those. For example a proxy server needs to follow different rules than a plain origin server (including some parsing rules, as baffling as that is). And origin servers can have entirely different purposes too. -- Lo?c Hoguin http://ninenines.eu From mononcqc@REDACTED Mon Dec 15 19:45:13 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Mon, 15 Dec 2014 13:45:13 -0500 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: <548F24B1.1040500@ninenines.eu> References: <53xes4yk0evoqpdlavca8xvj.1418596761024@email.android.com> <20141214231729.GB1307@ferdmbp.local> <548F24B1.1040500@ninenines.eu> Message-ID: <20141215184512.GO84549@ferdair.local> On 12/15, Lo?c Hoguin wrote: > > The RFC723x ones are much better though, they don't leave much room for > interpretation (though some things are still undefined) so implementations > following them should be much more compatible. > Yes and no. Some features, like dropping support for Header line-folding, could mean that if you religiously implemented HTTP/1.1 RFCs before RFCs 723x, you may suddenly find other HTTP/1.1 servers (who also respect their spec, though a newer one) explode on you. Intuitively, the issue is that HTTP/1.1 has had 3 revisions (or more) without a single version number change. If I want to have a truly flexible client, server, or proxy, I likely have to disregard that section of the new RFCs and keep implementing the old stuff, at least until the point where people start sending more garbage headers preceded by whitespace in practice, to the extent Postel's law dictates I should now switch over and pander to currently broken clients and servers rather than previously strict and correct ones. Did I mention I really loathe HTTP on this list before? From eric.pailleau@REDACTED Mon Dec 15 20:58:20 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Mon, 15 Dec 2014 20:58:20 +0100 Subject: [erlang-questions] What lib to use for http requests Message-ID: <2wqy2b56v47uoa8qx87x39f8.1418673500523@email.android.com> Hi, no doubt, you are expert on this subject. this emphasize the fact that people a bit less expert have to convince much less expert big boss that Erlang is great, and an opensource http erlang is a solution. Then come the question of the big boss : "is this project RFC xxxx compatible ?" "well... probably. Some experts wrote it, and some other less experts use it". ? Envoy? depuis mon mobile ? Eric Fred Hebert a ?crit?: >On 12/15, Lo?c Hoguin wrote: >> >> The RFC723x ones are much better though, they don't leave much room for >> interpretation (though some things are still undefined) so implementations >> following them should be much more compatible. >> > >Yes and no. Some features, like dropping support for Header >line-folding, could mean that if you religiously implemented HTTP/1.1 >RFCs before RFCs 723x, you may suddenly find other HTTP/1.1 servers (who >also respect their spec, though a newer one) explode on you. > >Intuitively, the issue is that HTTP/1.1 has had 3 revisions (or more) >without a single version number change. > >If I want to have a truly flexible client, server, or proxy, I likely >have to disregard that section of the new RFCs and keep implementing the >old stuff, at least until the point where people start sending more >garbage headers preceded by whitespace in practice, to the extent >Postel's law dictates I should now switch over and pander to currently >broken clients and servers rather than previously strict and correct >ones. > >Did I mention I really loathe HTTP on this list before? From mark.nijhof@REDACTED Mon Dec 15 20:58:39 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Mon, 15 Dec 2014 20:58:39 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: <20141215184512.GO84549@ferdair.local> References: <53xes4yk0evoqpdlavca8xvj.1418596761024@email.android.com> <20141214231729.GB1307@ferdmbp.local> <548F24B1.1040500@ninenines.eu> <20141215184512.GO84549@ferdair.local> Message-ID: Amazing responses, way more then anticipated, thanks :) -Mark On Monday, December 15, 2014, Fred Hebert wrote: > On 12/15, Lo?c Hoguin wrote: > > > > The RFC723x ones are much better though, they don't leave much room for > > interpretation (though some things are still undefined) so > implementations > > following them should be much more compatible. > > > > Yes and no. Some features, like dropping support for Header > line-folding, could mean that if you religiously implemented HTTP/1.1 > RFCs before RFCs 723x, you may suddenly find other HTTP/1.1 servers (who > also respect their spec, though a newer one) explode on you. > > Intuitively, the issue is that HTTP/1.1 has had 3 revisions (or more) > without a single version number change. > > If I want to have a truly flexible client, server, or proxy, I likely > have to disregard that section of the new RFCs and keep implementing the > old stuff, at least until the point where people start sending more > garbage headers preceded by whitespace in practice, to the extent > Postel's law dictates I should now switch over and pander to currently > broken clients and servers rather than previously strict and correct > ones. > > Did I mention I really loathe HTTP on this list before? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Mark Nijhof t: @MarkNijhof s: marknijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Mon Dec 15 21:00:25 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 15 Dec 2014 22:00:25 +0200 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: <20141215184512.GO84549@ferdair.local> References: <53xes4yk0evoqpdlavca8xvj.1418596761024@email.android.com> <20141214231729.GB1307@ferdmbp.local> <548F24B1.1040500@ninenines.eu> <20141215184512.GO84549@ferdair.local> Message-ID: <548F3DD9.9090405@ninenines.eu> On 12/15/2014 08:45 PM, Fred Hebert wrote: > On 12/15, Lo?c Hoguin wrote: >> >> The RFC723x ones are much better though, they don't leave much room for >> interpretation (though some things are still undefined) so implementations >> following them should be much more compatible. >> > > Yes and no. Some features, like dropping support for Header > line-folding, could mean that if you religiously implemented HTTP/1.1 > RFCs before RFCs 723x, you may suddenly find other HTTP/1.1 servers (who > also respect their spec, though a newer one) explode on you. Well this particular syntax is simply obsoleted by the RFC, you can still implement it. The reason it has been made obsolete is also worth reading as it's basically to prevent security issues so this would be the kind of thing you would want to use with proper consideration. In Cowboy 2 this will most likely end up as a syntax disabled by default that you can enable through configuration (because, hey, we have the code already in after all). > Intuitively, the issue is that HTTP/1.1 has had 3 revisions (or more) > without a single version number change. My point was strictly concerning RFC723x implementations, and is that RFC723x compliant implementations have a lot more chances of being compatible with each other, than RFC2616 compliant implementations would have with each other. Of course there's a little of me that's being hopeful that in a couple years we can just forget about the bad dream that RFC2616 was, despite us never getting rid of it completely ever. > If I want to have a truly flexible client, server, or proxy, I likely > have to disregard that section of the new RFCs and keep implementing the > old stuff, at least until the point where people start sending more > garbage headers preceded by whitespace in practice, to the extent > Postel's law dictates I should now switch over and pander to currently > broken clients and servers rather than previously strict and correct > ones. From what I read, if you follow RFC723x, including all the obsolete stuff, you should have no compatibility problem with RFC2616. In particular RFC723x comes with an "obsolete whitespace" and "obsolete text" that is input that should always be parsed but never generated. The only breaking changes I've seen so far concern a handful of headers that were either broken in the wild (everyone doing them wrong, basically) or that had some elements that were not used (so it shouldn't break anything if you parse them the new way, but probably will). -- Lo?c Hoguin http://ninenines.eu From bchesneau@REDACTED Mon Dec 15 23:35:45 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Mon, 15 Dec 2014 23:35:45 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: <2wqy2b56v47uoa8qx87x39f8.1418673500523@email.android.com> References: <2wqy2b56v47uoa8qx87x39f8.1418673500523@email.android.com> Message-ID: On Mon, Dec 15, 2014 at 8:58 PM, Eric Pailleau wrote: > > Hi, > no doubt, you are expert on this subject. > this emphasize the fact that people a bit less expert have to convince > much less expert big boss that Erlang is great, and an opensource http > erlang is a solution. > Then come the question of the big boss : "is this project RFC xxxx > compatible ?" > "well... probably. Some experts wrote it, and some other less experts use > it". > Find me someone that do real stuff with HTTP asking for it then maybe. It's quire rare though. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksoe@REDACTED Tue Dec 16 00:28:39 2014 From: eriksoe@REDACTED (=?UTF-8?Q?Erik_S=C3=B8e_S=C3=B8rensen?=) Date: Tue, 16 Dec 2014 00:28:39 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: <8E94BDC4-54F0-4BCB-969D-2590766DE5AF@rogvall.se> References: <8E94BDC4-54F0-4BCB-969D-2590766DE5AF@rogvall.se> Message-ID: You can't agree more than 110%. I thought everyone knew that... /Erik Den 15/12/2014 10.00 skrev "Tony Rogvall" : > 1000% agree on this. > > Unfortunately I tend to have that itch my self :-) > But I am trying to fight it. > > On 14 dec 2014, at 23:04, Anthony Ramine wrote: > > To replace httpc by another client? What if people fixed it instead of > scratching their own NIH itches by making new ones? > > Le 14 d?c. 2014 ? 22:44, Felix Gallo a ?crit : > > It would be interesting to know what the OTP team's official position on > accepting new libraries and deprecating old ones is, and what the process > would look like (EEP? Other?). > > > _______________________________________________ > 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 raould@REDACTED Tue Dec 16 01:00:23 2014 From: raould@REDACTED (Raoul Duke) Date: Mon, 15 Dec 2014 16:00:23 -0800 Subject: [erlang-questions] embedded systems erlang? Message-ID: hi, I see many google hits for things people have done with Erlang targeting "embedded" resource constrained systems. But I'm not sure if there's like an official build or something for it? Does everybody hack up their own thing? What's the state of the art or mainstream way to go here? I'm looking at like 256 K RAM (!) From raould@REDACTED Tue Dec 16 01:00:24 2014 From: raould@REDACTED (Raoul Duke) Date: Mon, 15 Dec 2014 16:00:24 -0800 Subject: [erlang-questions] embedded systems erlang? Message-ID: hi, I see many google hits for things people have done with Erlang targeting "embedded" resource constrained systems. But I'm not sure if there's like an official build or something for it? Does everybody hack up their own thing? What's the state of the art or mainstream way to go here? I'm looking at like 256 K RAM (!) From eric.pailleau@REDACTED Tue Dec 16 07:15:45 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Tue, 16 Dec 2014 07:15:45 +0100 Subject: [erlang-questions] What lib to use for http requests Message-ID: <22wmp9m8gkg9r2ipcgh4iene.1418710545450@email.android.com> http://www.drummondgroup.com/b2b-home some interoperability companies used by much much less experts marketing managers. ;-) ? Envoy? depuis mon mobile ? Eric Benoit Chesneau a ?crit?: >On Mon, Dec 15, 2014 at 8:58 PM, Eric Pailleau >wrote: >> >> Hi, >> no doubt, you are expert on this subject. >> this emphasize the fact that people a bit less expert have to convince >> much less expert big boss that Erlang is great, and an opensource http >> erlang is a solution. >> Then come the question of the big boss : "is this project RFC xxxx >> compatible ?" >> "well... probably. Some experts wrote it, and some other less experts use >> it". >> > >Find me someone that do real stuff with HTTP asking for it then maybe. It's >quire rare though. > >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From mangalaman93@REDACTED Tue Dec 16 09:05:08 2014 From: mangalaman93@REDACTED (aman mangal) Date: Tue, 16 Dec 2014 08:05:08 +0000 Subject: [erlang-questions] Why doesn't Erlang has return statement? Message-ID: Hi everyone, I have seen similar questions before on the forum but I could never understand the reason behind it. Is it due to theoretical reasons such as *return *statement makes it hard to reason about the program or practical reasons that it is hard to implement it (this doesn't seem right but I cannot think of anything else)? Moreover, is there a good alternate to avoid nested case statements? Making more functions just seems tedious. Using *catch *statement seems another good alternate but my intuition is that it is not good practice, is it? Thank you Aman Mangal www.prism.gatech.edu/~amangal7 -------------- next part -------------- An HTML attachment was scrubbed... URL: From imantc@REDACTED Tue Dec 16 09:59:49 2014 From: imantc@REDACTED (Imants Cekusins) Date: Tue, 16 Dec 2014 09:59:49 +0100 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: Erlang does not specify void | any() return type. It is probably easier to expect every statement to return something. Multiple functions or function with guard clauses usually go along with multiple case | if statements quite well. If they look really bad, try to refactor the code. From tony@REDACTED Tue Dec 16 10:23:20 2014 From: tony@REDACTED (Tony Rogvall) Date: Tue, 16 Dec 2014 10:23:20 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: <8E94BDC4-54F0-4BCB-969D-2590766DE5AF@rogvall.se> Message-ID: Sorry. slipped on the keyboard :-) 110% that is then. /Tony > On 16 dec 2014, at 00:28, Erik S?e S?rensen wrote: > > You can't agree more than 110%. I thought everyone knew that... > > /Erik > > Den 15/12/2014 10.00 skrev "Tony Rogvall" >: > 1000% agree on this. > > Unfortunately I tend to have that itch my self :-) > But I am trying to fight it. > >> On 14 dec 2014, at 23:04, Anthony Ramine > wrote: >> >> To replace httpc by another client? What if people fixed it instead of scratching their own NIH itches by making new ones? >> >> Le 14 d?c. 2014 ? 22:44, Felix Gallo > a ?crit : >> >>> It would be interesting to know what the OTP team's official position on accepting new libraries and deprecating old ones is, and what the process would look like (EEP? Other?). >>> >> >> _______________________________________________ >> 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: Message signed with OpenPGP using GPGMail URL: From Ola.Backstrom@REDACTED Tue Dec 16 10:59:18 2014 From: Ola.Backstrom@REDACTED (=?utf-8?B?T2xhIELDpGNrc3Ryw7Zt?=) Date: Tue, 16 Dec 2014 09:59:18 +0000 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: > Moreover, is there a good alternate to avoid nested case statements? Making more functions just seems tedious. Making new functions can actually be a good choice, if you find good names for them. But if the expressions to make decisions on are non-expensive and without side effects you can make more compact case statemens by combining 2 (or more) expressions into one tuple. Example with 2 nested: case condition1() of true -> case condition2() of true -> doA(); false -> ignore() end; false -> ignore() end Simplified: case {condition1(), condition2()} of {true, true} -> doA(); {C1, C2} when is_boolean(C1) andalso is_boolean(C2) -> ignore() end > Using catch statement seems another good alternate but my intuition is that it is not good practice, is it? I don?t see how catch statements can help out in this scenario, but definitely the more modern try-catch statements can be used if you need to catch something. /Ola From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of aman mangal Sent: den 16 december 2014 09:05 To: Erlang Subject: [erlang-questions] Why doesn't Erlang has return statement? Hi everyone, I have seen similar questions before on the forum but I could never understand the reason behind it. Is it due to theoretical reasons such as return statement makes it hard to reason about the program or practical reasons that it is hard to implement it (this doesn't seem right but I cannot think of anything else)? Moreover, is there a good alternate to avoid nested case statements? Making more functions just seems tedious. Using catch statement seems another good alternate but my intuition is that it is not good practice, is it? Thank you Aman Mangal www.prism.gatech.edu/~amangal7 -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Tue Dec 16 11:43:47 2014 From: z@REDACTED (Danil Zagoskin) Date: Tue, 16 Dec 2014 14:43:47 +0400 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: Hi! I think return statement could make reading the code quite difficult. When you debug code not written by you, you could end up in "this function takes these arguments and returns completely unexpected stuff". The next step is looking at code (usually final case) to see how that value could be returned. Return in the middle of a long function would require you to look for returns first. As for nested cases. There are some alternatives, each of them has its disadvantages: 1. Chaining function calls, each function has a single case. This makes quite hard to add a new argument for the last check. 2. Putting all arguments in record and chaining calls ? requires wrappers for checks to fetch arguments from a record. 3. foldl over function list with arguments+result record as accumulator ? so monadic that it is hard to understand, but keeps the processing sequence in single place. 4. something like this: https://gist.github.com/stolen/8537619 ? very uncommon, so may be hard to understand, but flattens cases. On Tue, Dec 16, 2014 at 11:05 AM, aman mangal wrote: > Hi everyone, > > I have seen similar questions before on the forum but I could never > understand the reason behind it. Is it due to theoretical reasons such as *return > *statement makes it hard to reason about the program or practical reasons > that it is hard to implement it (this doesn't seem right but I cannot think > of anything else)? > > Moreover, is there a good alternate to avoid nested case statements? > Making more functions just seems tedious. Using *catch *statement seems > another good alternate but my intuition is that it is not good practice, is > it? > > Thank you > Aman Mangal > www.prism.gatech.edu/~amangal7 > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From g9414002.pccu.edu.tw@REDACTED Tue Dec 16 12:21:25 2014 From: g9414002.pccu.edu.tw@REDACTED (=?UTF-8?B?6buD6ICA6LOiIChZYXUtSHNpZW4gSHVhbmcp?=) Date: Tue, 16 Dec 2014 19:21:25 +0800 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: Hi, aman, First, IMO, on Erlang, every function is real function, and every function returns something, that it depends on you to check what returned. Though a language with return statement guide programmers to check things returned but ignore those functions without a return statement. The later one is so-called ?? in Chinese, a ?function-like procedure.? It?s a weird concept of some function without a return statement, that in definition it does not return thing, but in memory of real computer system it return such as 0 but actually it does not return 0 because the 0 is a symbol to represent ?nothing'. For the second question, how to avoid cascade case statement, there are at least two way to do. The first way, case statement is similar to function statement, and if some thing goes through many states in cascade case statement, it seams to be some thing going through some functions and then becoming some state. The second way, if items existing in cascade case statement do not just occur in condition within case statement, layers of case statement may be reduced by putting items together: for example, case A of ok -> case B of ? end; {error, _} -> ? end may be arranged as case {A, B} of {ok, ok} -> ?; {{error, _}, _} -> ?; {_, {error, _}} -> ? end /Y-H On Tuesday, December 16, 2014, aman mangal wrote: > Hi everyone, > I have seen similar questions before on the forum but I could never understand the reason behind it. Is it due to theoretical reasons such as return statement makes it hard to reason about the program or practical reasons that it is hard to implement it (this doesn't seem right but I cannot think of anything else)? > Moreover, is there a good alternate to avoid nested case statements? Making more functions just seems tedious. Using catch statement seems another good alternate but my intuition is that it is not good practice, is it? > Thank you > Aman Mangal > www.prism.gatech.edu/~amangal7 -- Best Regards. --- Y-H. H. -------------- next part -------------- An HTML attachment was scrubbed... URL: From g9414002.pccu.edu.tw@REDACTED Tue Dec 16 12:21:33 2014 From: g9414002.pccu.edu.tw@REDACTED (=?UTF-8?B?6buD6ICA6LOiIChZYXUtSHNpZW4gSHVhbmcp?=) Date: Tue, 16 Dec 2014 19:21:33 +0800 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: Hi, aman, First, IMO, on Erlang, every function is real function, and every function returns something, that it depends on you to check what returned. Though a language with return statement guide programmers to check things returned but ignore those functions without a return statement. The later one is so-called ?? in Chinese, a ?function-like procedure.? It?s a weird concept of some function without a return statement, that in definition it does not return thing, but in memory of real computer system it return such as 0 but actually it does not return 0 because the 0 is a symbol to represent ?nothing'. For the second question, how to avoid cascade case statement, there are at least two way to do. The first way, case statement is similar to function statement, and if some thing goes through many states in cascade case statement, it seams to be some thing going through some functions and then becoming some state. The second way, if items existing in cascade case statement do not just occur in condition within case statement, layers of case statement may be reduced by putting items together: for example, case A of ok -> case B of ? end; {error, _} -> ? end may be On Tuesday, December 16, 2014, aman mangal wrote: > Hi everyone, > I have seen similar questions before on the forum but I could never understand the reason behind it. Is it due to theoretical reasons such as return statement makes it hard to reason about the program or practical reasons that it is hard to implement it (this doesn't seem right but I cannot think of anything else)? > Moreover, is there a good alternate to avoid nested case statements? Making more functions just seems tedious. Using catch statement seems another good alternate but my intuition is that it is not good practice, is it? > Thank you > Aman Mangal > www.prism.gatech.edu/~amangal7 -------------- next part -------------- An HTML attachment was scrubbed... URL: From g9414002.pccu.edu.tw@REDACTED Tue Dec 16 12:23:28 2014 From: g9414002.pccu.edu.tw@REDACTED (=?UTF-8?B?6buD6ICA6LOiIChZYXUtSHNpZW4gSHVhbmcp?=) Date: Tue, 16 Dec 2014 19:23:28 +0800 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: Hi, aman, First, IMO, on Erlang, every function is real function, and every function returns something, that it depends on you to check what returned. Though a language with return statement guide programmers to check things returned but ignore those functions without a return statement. The later one is so-called ?? in Chinese, a ?function-like procedure.? It?s a weird concept of some function without a return statement, that in definition it does not return thing, but in memory of real computer system it return such as 0 but actually it does not return 0 because the 0 is a symbol to represent ?nothing'. For the second question, how to avoid cascade case statement, there are at least two way to do. The first way, case statement is similar to function statement, and if some thing goes through many states in cascade case statement, it seams to be some thing going through some functions and then becoming some state. The second way, if items existing in cascade case statement do not just occur in condition within case statement, layers of case statement may be reduced by putting items together: for example, case A of ok -> case B of ? end; {error, _} -> ? end may be case {A, B} of {ok, ok} -> ...; {{error, _}, _} -> ...; {_, {error, _}} -> ... end /Y-H On Tue, Dec 16, 2014 at 4:05 PM, aman mangal wrote: > > Hi everyone, > > I have seen similar questions before on the forum but I could never > understand the reason behind it. Is it due to theoretical reasons such as *return > *statement makes it hard to reason about the program or practical reasons > that it is hard to implement it (this doesn't seem right but I cannot think > of anything else)? > > Moreover, is there a good alternate to avoid nested case statements? > Making more functions just seems tedious. Using *catch *statement seems > another good alternate but my intuition is that it is not good practice, is > it? > > Thank you > Aman Mangal > www.prism.gatech.edu/~amangal7 > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Best Regards. --- Y-H. H. -------------- next part -------------- An HTML attachment was scrubbed... URL: From community-manager@REDACTED Tue Dec 16 12:41:19 2014 From: community-manager@REDACTED (Bruce Yinhe) Date: Tue, 16 Dec 2014 12:41:19 +0100 Subject: [erlang-questions] Erlang package manager Message-ID: Hi everyone, Industrial Erlang User Group (IEUG) has been working together with the Erlang/OTP team to investigate and create a package management system for Erlang/OTP. The lack of a package management system for Erlang has been discussed for a long time in the community. In essence, a straightforward package management system is believed to take Erlang programming language a step forward. Multiple tools will appear in the community. It needs to be supported by a highly visible community behind it. In order to increase the adoption and to result in a tool widely used in the Erlang ecosystem, we are identifying the most important user categories and use cases, based on what the majority of the community want in a package manager. Therefore we would like to invite an open discussion. Now you are welcome to share your thoughts, suggestions or proposals about an Erlang package manager. It would be great if you could reply with your motivation, explaining why a feature is necessary to have. There are some example questions to begin the dicussion with, including, but not limited to the following. - What metadata information should an Erlang package include? - What functionality do you need in a package manager for Erlang in order to use it in production? - What other concerns do you have about an Erlang package management system? Erlang package manager's brief wish list of features: - Console interface - Web interface - Package Index and Repository - Fetch, Install and Remove Packages - Publish packages - Versioning and Dependency Management We are aware of several previous efforts and existing tools that attempt to achieve the similar goal. We want to look at existing things, both from Erlang and Elixir, to see if they fit the requirements. If not, we will then have to make something new, perhaps as a rewrite of an existing tool. The IEUG members are putting together requirements for a package manager and will work with the community and Ericsson to create a standard and address any voids which exists in the existing tooling, funding necessary efforts required. Best regards Bruce Yinhe Erlang Community Manager Industrial Erlang User Group community-manager@REDACTED +46 72 311 43 89 -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Tue Dec 16 12:50:31 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 16 Dec 2014 12:50:31 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: Message-ID: Hi Bruce and all, I have one addition to the feature list: it should have an Erlang interface too, so that it can be integrated with other tools. If it only runs as an escript and gets configuration in a half-magic way, then it's not easy to integrate it. best regards, Vlad On Tue, Dec 16, 2014 at 12:41 PM, Bruce Yinhe wrote: > > Hi everyone, > > Industrial Erlang User Group (IEUG) has been working together with the > Erlang/OTP team to investigate and create a package management system for > Erlang/OTP. > > The lack of a package management system for Erlang has been discussed for > a long time in the community. In essence, a straightforward package > management system is believed to take Erlang programming language a step > forward. Multiple tools will appear in the community. It needs to be > supported by a highly visible community behind it. > > In order to increase the adoption and to result in a tool widely used in > the Erlang ecosystem, we are identifying the most important user categories > and use cases, based on what the majority of the community want in a > package manager. Therefore we would like to invite an open discussion. > > Now you are welcome to share your thoughts, suggestions or proposals about > an Erlang package manager. It would be great if you could reply with your > motivation, explaining why a feature is necessary to have. There are some > example questions to begin the dicussion with, including, but not limited > to the following. > > - What metadata information should an Erlang package include? > - What functionality do you need in a package manager for Erlang in > order to use it in production? > - What other concerns do you have about an Erlang package management > system? > > Erlang package manager's brief wish list of features: > > - Console interface > - Web interface > - Package Index and Repository > - Fetch, Install and Remove Packages > - Publish packages > - Versioning and Dependency Management > > We are aware of several previous efforts and existing tools that attempt > to achieve the similar goal. We want to look at existing things, both from > Erlang and Elixir, to see if they fit the requirements. If not, we will > then have to make something new, perhaps as a rewrite of an existing tool. > > The IEUG members are putting together requirements for a package manager > and will work with the community and Ericsson to create a standard and > address any voids which exists in the existing tooling, funding necessary > efforts required. > > Best regards > > Bruce Yinhe > > Erlang Community Manager > Industrial Erlang User Group > community-manager@REDACTED > +46 72 311 43 89 > > _______________________________________________ > 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 Tue Dec 16 13:17:16 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 16 Dec 2014 14:17:16 +0200 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: Message-ID: <549022CC.9000205@ninenines.eu> Personally I do not need a package manager. However a centralized package index would be good to have. This package index needs to be exportable in a variety of different formats (tab separated values would be great). The metadata should include at least: * name * repository type (git, hg, svn...) * repository uri * recommended version (hopefully we can avoid "everything master") * project uri * description That's really it. Actual package management is not needed at all in my workflow where everything is a dep, including test, documentation and other tools. Best of luck with it. On 12/16/2014 01:41 PM, Bruce Yinhe wrote: > Hi everyone, > > Industrial Erlang User Group (IEUG) has been working together with the > Erlang/OTP team to investigate and create a package management system > for Erlang/OTP. > > The lack of a package management system for Erlang has been discussed > for a long time in the community. In essence, a straightforward package > management system is believed to take Erlang programming language a step > forward. Multiple tools will appear in the community. It needs to be > supported by a highly visible community behind it. > > > In order to increase the adoption and to result in a tool widely used in > the Erlang ecosystem, we are identifying the most important user > categories and use cases, based on what the majority of the community > want in a package manager. Therefore we would like to invite an open > discussion. > > Now you are welcome to share your thoughts, suggestions or proposals > about an Erlang package manager. It would be great if you could reply > with your motivation, explaining why a feature is necessary to have. > There are some example questions to begin the dicussion with, including, > but not limited to the following. > > * What metadata information should an Erlang package include? > * What functionality do you need in a package manager for Erlang in > order to use it in production? > * What other concerns do you have about an Erlang package management > system? > > Erlang package manager's brief wish list of features: > > * Console interface > * Web interface > * Package Index and Repository > * Fetch, Install and Remove Packages > * Publish packages > * Versioning and Dependency Management > > We are aware of several previous efforts and existing tools that attempt > to achieve the similar goal. We want to look at existing things, both > from Erlang and Elixir, to see if they fit the requirements. If not, we > will then have to make something new, perhaps as a rewrite of an > existing tool. > > The IEUG members are putting together requirements for a package manager > and will work with the community and Ericsson to create a standard and > address any voids which exists in the existing tooling, funding > necessary efforts required. > > Best regards > > Bruce Yinhe > > Erlang Community Manager > Industrial Erlang User Group > community-manager@REDACTED > +46 72 311 43 89 > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From essen@REDACTED Tue Dec 16 13:34:40 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 16 Dec 2014 14:34:40 +0200 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: <549026E0.7090105@ninenines.eu> Erlang has no statements, it only has expressions. All expressions return a value. So there is no need for a "return" instruction, the last expression executed gives the return value of the function. If you use function clauses in addition to case expressions, you shouldn't have too many levels deep. If you do, create a new function. Avoid using catch for these things because it creates a stacktrace and that's expensive. On 12/16/2014 10:05 AM, aman mangal wrote: > Hi everyone, > > I have seen similar questions before on the forum but I could never > understand the reason behind it. Is it due to theoretical reasons such > as /return /statement makes it hard to reason about the program or > practical reasons that it is hard to implement it (this doesn't seem > right but I cannot think of anything else)? > > Moreover, is there a good alternate to avoid nested case statements? > Making more functions just seems tedious. Using /catch /statement seems > another good alternate but my intuition is that it is not good practice, > is it? > > Thank you > Aman Mangal > www.prism.gatech.edu/~amangal7 > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From vladdu55@REDACTED Tue Dec 16 13:43:57 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 16 Dec 2014 13:43:57 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <549022CC.9000205@ninenines.eu> References: <549022CC.9000205@ninenines.eu> Message-ID: On Tue, Dec 16, 2014 at 1:17 PM, Lo?c Hoguin wrote: > > Actual package management is not needed at all in my workflow where > everything is a dep, including test, documentation and other tools. I may be wrong, but I believe that 'package' in this context means what you mean by 'dep'. You still need to fetch the dependencies and you don't care about another tool because (I guess) you are using rebar which implements this thing. My understanding of this package manager thing is that it separates this functionality, unifies the different features that rebar, mix, hex, agner etc have and makes it available so that we don't need to reinvent the wheel. If I got it wrong, I'm sure that Bruce will correct me :-) regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Tue Dec 16 13:52:38 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 16 Dec 2014 14:52:38 +0200 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <549022CC.9000205@ninenines.eu> Message-ID: <54902B16.3010204@ninenines.eu> On 12/16/2014 02:43 PM, Vlad Dumitrescu wrote: > > On Tue, Dec 16, 2014 at 1:17 PM, Lo?c Hoguin > wrote: > > Actual package management is not needed at all in my workflow where > everything is a dep, including test, documentation and other tools. > > > I may be wrong, but I believe that 'package' in this context means what > you mean by 'dep'. You still need to fetch the dependencies and you No. From the first post: > Fetch, Install and Remove Packages > Versioning and Dependency Management I have no use for installing packages. There was also no mention of that package manager doing something like deps either (nor do I want it to: booting the Erlang VM to then call "git clone" is not particularly efficient, and efficiency is important for my workflow). > don't care about another tool because (I guess) you are using rebar I am using erlang.mk which implements something similar to rebar, yes. > which implements this thing. My understanding of this package manager > thing is that it separates this functionality, unifies the different > features that rebar, mix, hex, agner etc have and makes it available so > that we don't need to reinvent the wheel. Unfortunately in my case I will have to keep maintaining a separate wheel because I do not want to boot the Erlang VM for these things. -- Lo?c Hoguin http://ninenines.eu From mononcqc@REDACTED Tue Dec 16 14:08:51 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Tue, 16 Dec 2014 08:08:51 -0500 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: Message-ID: <20141216130850.GP84549@ferdair.local> On 12/16, Bruce Yinhe wrote: > - What metadata information should an Erlang package include? > - What functionality do you need in a package manager for Erlang in > order to use it in production? > - What other concerns do you have about an Erlang package management > system? I'd certainly like to see signing addressed by a would-be package manager. From gleber.p@REDACTED Tue Dec 16 14:20:19 2014 From: gleber.p@REDACTED (Gleb Peregud) Date: Tue, 16 Dec 2014 14:20:19 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <20141216130850.GP84549@ferdair.local> References: <20141216130850.GP84549@ferdair.local> Message-ID: I would really like to see hermiticity and reproducibility of Nix package manager. On Dec 16, 2014 2:09 PM, "Fred Hebert" wrote: > On 12/16, Bruce Yinhe wrote: > > - What metadata information should an Erlang package include? > > - What functionality do you need in a package manager for Erlang in > > order to use it in production? > > - What other concerns do you have about an Erlang package management > > system? > > I'd certainly like to see signing addressed by a would-be package manager. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Tue Dec 16 14:47:40 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Tue, 16 Dec 2014 14:47:40 +0100 Subject: [erlang-questions] Erlang package manager Message-ID: +1 Why not generating OS packages instead reinvent the wheel ? Each dependance could be a package itself and Ports source packages. There is also nugets and chocolatey for Windows. ? Envoy? depuis mon mobile ? Eric Gleb Peregud a ?crit?: >I would really like to see hermiticity and reproducibility of Nix package >manager. >On Dec 16, 2014 2:09 PM, "Fred Hebert" wrote: > >> On 12/16, Bruce Yinhe wrote: >> > - What metadata information should an Erlang package include? >> > - What functionality do you need in a package manager for Erlang in >> > order to use it in production? >> > - What other concerns do you have about an Erlang package management >> > system? >> >> I'd certainly like to see signing addressed by a would-be package manager. >> >> _______________________________________________ >> 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 leonard.boyce@REDACTED Tue Dec 16 14:49:54 2014 From: leonard.boyce@REDACTED (Leonard Boyce) Date: Tue, 16 Dec 2014 08:49:54 -0500 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: Message-ID: Hi Bruce, Glad to hear there will at least be "official" work effort expended on this. A few things I'd like to see: - Require semver for all packages in the index - Add/remove alternative package locations - The ability to 'pin' a package in your local system to a specific version - Options for both local and global install locations (ala deps vs lib install location) - Support for both 'archive' and 'source' versions of packages (user option) - Package signing with signature verification - Ability to mirror the package index and sources - All package should have explicit license information and as a user I should be aware of/have to explicitly accept licenses before any package is installed Kind regards, Leonard On Tue, Dec 16, 2014 at 6:41 AM, Bruce Yinhe wrote: > Hi everyone, > > Industrial Erlang User Group (IEUG) has been working together with the > Erlang/OTP team to investigate and create a package management system for > Erlang/OTP. > > The lack of a package management system for Erlang has been discussed for a > long time in the community. In essence, a straightforward package management > system is believed to take Erlang programming language a step forward. > Multiple tools will appear in the community. It needs to be supported by a > highly visible community behind it. > > > In order to increase the adoption and to result in a tool widely used in the > Erlang ecosystem, we are identifying the most important user categories and > use cases, based on what the majority of the community want in a package > manager. Therefore we would like to invite an open discussion. > > Now you are welcome to share your thoughts, suggestions or proposals about > an Erlang package manager. It would be great if you could reply with your > motivation, explaining why a feature is necessary to have. There are some > example questions to begin the dicussion with, including, but not limited to > the following. > > What metadata information should an Erlang package include? > What functionality do you need in a package manager for Erlang in order to > use it in production? > What other concerns do you have about an Erlang package management system? > > Erlang package manager's brief wish list of features: > > Console interface > Web interface > Package Index and Repository > Fetch, Install and Remove Packages > Publish packages > Versioning and Dependency Management > > We are aware of several previous efforts and existing tools that attempt to > achieve the similar goal. We want to look at existing things, both from > Erlang and Elixir, to see if they fit the requirements. If not, we will then > have to make something new, perhaps as a rewrite of an existing tool. > > The IEUG members are putting together requirements for a package manager and > will work with the community and Ericsson to create a standard and address > any voids which exists in the existing tooling, funding necessary efforts > required. > > Best regards > > Bruce Yinhe > > Erlang Community Manager > Industrial Erlang User Group > community-manager@REDACTED > +46 72 311 43 89 > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From zxq9@REDACTED Tue Dec 16 14:52:15 2014 From: zxq9@REDACTED (zxq9) Date: Tue, 16 Dec 2014 22:52:15 +0900 Subject: [erlang-questions] Erlang package manager In-Reply-To: <20141216130850.GP84549@ferdair.local> References: <20141216130850.GP84549@ferdair.local> Message-ID: <2806437.gkUSdVVdcQ@changa> On 2014?12?16? ??? 08:08:51 Fred Hebert wrote: > On 12/16, Bruce Yinhe wrote: > > - What metadata information should an Erlang package include? > > - What functionality do you need in a package manager for Erlang in > > order to use it in production? > > - What other concerns do you have about an Erlang package management > > system? > > I'd certainly like to see signing addressed by a would-be package manager. With that in mind, I would like to see a signed repo (or optionally signed repo, with a selectable sensitivity) where deps/packages/whatever are curated to some degree instead of just being "go fetch $trash from $place, which hopefully still exists". In this sense building a base of Erlang deps is not unlike managing a meta OS distribution, and the tasks of a full-blown build/dep/repo tool are not unlike the stack of services that underly ports/portage or cpan. Separation of the "packaging" job from the "code scribbling" job is, in my opinion, a healthy thing. This has been my experience in packaging/managing Linux distros in the past, and I see more useful parallels in the curation model there than in the "grab $shit from $codesite", and felt the pain of not doing it right in Cabal in the past. In particular, the repo itself should be versioned collectively -- so you have an API promise within major versions within revisions of the same dep definition within the overall repo major release. So you can "write against OTP17R + E-Universe 3" and know that your stuff will build without chasing down breakages every time someone types "rebase" in their upstream project tree. (Of course... this means either upstream *or* packagers will have to adhere to a reasonable versioning scheme... otoh, curation gives packagers a chance to interdict idiotic upstream versioning...) This is how I've come to view the build/packaging/repo/dep problem after dealing with it in OSes and language environments -- I don't think a simple (or separate, greatly divergent, incompatible) tools for each individual aspect will solve the problem. This is probably a heretical view to many people (its OK, already wearing fireproof undies). From eric.pailleau@REDACTED Tue Dec 16 15:56:22 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Tue, 16 Dec 2014 15:56:22 +0100 Subject: [erlang-questions] Erlang package manager Message-ID: I forgot to say that Erlang packages may need Non Erlang application, like Postgresql, or Varnish or (fill blanks). Debian Meta package allow this, for instance. This could not be achieved with a specific Erlang packager. ? Envoy? depuis mon mobile ? Eric Eric Pailleau a ?crit?: >+1 >Why not generating OS packages instead reinvent the wheel ? Each dependance could be a package itself and Ports source packages. >There is also nugets and chocolatey for Windows. > >? Envoy? depuis mon mobile ? Eric > >Gleb Peregud a ?crit?: > >>I would really like to see hermiticity and reproducibility of Nix package >>manager. >>On Dec 16, 2014 2:09 PM, "Fred Hebert" wrote: >> >>> On 12/16, Bruce Yinhe wrote: >>> > - What metadata information should an Erlang package include? >>> > - What functionality do you need in a package manager for Erlang in >>> > order to use it in production? >>> > - What other concerns do you have about an Erlang package management >>> > system? >>> >>> I'd certainly like to see signing addressed by a would-be package manager. >>> >>> _______________________________________________ >>> 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 zxq9@REDACTED Tue Dec 16 17:38:07 2014 From: zxq9@REDACTED (zxq9) Date: Wed, 17 Dec 2014 01:38:07 +0900 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: Message-ID: <2543408.g567yR3yLD@changa> On 2014?12?16? ??? 15:56:22 Eric Pailleau wrote: > I forgot to say that Erlang packages may need Non Erlang application, like > Postgresql, or Varnish or (fill blanks). Debian Meta package allow this, > for instance. This could not be achieved with a specific Erlang packager. There are no Erlang packages or builds that require Postgres. Some C interfaces may require Postgres headers to build (and these are not "Erlang packages" in the strict sense), but most Erlang systems that have anything at all to do with something like Postgres need to be given the address of a servicing port with which to connect. This is not an Erlang build issue. At all. Ever. The way this is handled is through OS distributions -- and if the decision were made to include this sort of "build" support (or rather, not "dep resolution" but "adjacent service provision") then the package manager would wind up becoming its own OS distro in short order, and from there wind up trying to be OpenStack. And it can't ever be that. Not even anything remotely close to that. The only thing even sort of close would be for Erlang to pick a single distro of a single OS on a single platform and settle on that as the sole reference implementation forever and ever, amen, and pour time into maintaining that (blessed) distro's Erlang subsection of packages through its package manager. This, actually, is workable from a technical point of view -- but is guaranteed to not be socially workable, even if it were done in the Belly of Some Beast (neither MS nor IBM has been able to pull this off, and they own their entire stack) -- actually, I imagine the annoyance of keeping up with this sort of thing is why Erlang was spun out of Ericsson in the first place. And that leaves us back at the original problem, which has been demonstrated to be twofold: 1- Define an ecosystem within which code can be grown and known to survive with a minimum of wasted developer effort. 2- Set clear limits of that ecosystem. The ecosystem definition is really more important than any particular implementation of a tool within it -- but that gets into standards, and who follows those without a reference implementation anyway? (And who spends time writing *and* maintaining new implementations when the reference platform already works well? We want to do more interesting things with Erlang than write more Erlang, I imagine...) It has to be complete enough to cover the problem space so that something can be implemented in the first place -- but absolutely can't go so far that it suffers from second-system-syndrome. I've got plenty of ideas what the above statements should mean, but that's not the point of this message. My purpose is to point out straight away that this entire idea will be DOA if we let the Good Idea Fairy serve up a big dream steak smothered in hope peppers with a side of good intentions and a community love salad before even a line of code has been written. -Craig From tuncer.ayaz@REDACTED Tue Dec 16 18:05:15 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 16 Dec 2014 18:05:15 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: Message-ID: Hi Bruce, in addition to what others have said, here's a list of other important features. -- must haves -- * archival of published versions * real version constraint solver (SAT) * instead of blindly following semver, look at RPM versioning. see comments starting here: https://github.com/rebar/rebar/issues/240#issuecomment-38035168 * design index _and_ packages folder with mirroring in mind: - avoid SPOF (availability and reliability issues) - allow local mirrors - Ideally avoid the use of a CDN and use mirrors like FreeBSD, CTAN, and Linux distros do. This means, master is only written to when the index is updated and normally no client operation should contact master. So, only mirrors should ever be in contac with the master. - Avoiding a CDN solves multiple issues: + no superfluous hosting costs due to unnecessary centralization. hosting costs may not be a problem today, but a package index and repo of open source code does not need to be hosted in a central location by one administrating org. + No accessibility issues for geographical or organizational network reasons. This is where the ability to mirror, as in CTAN or Debian mirror, is a vital feature. + No downtime if, say, S3 is for some reason inaccessible or its availability is limited. - With a proper mirroring system in place, the only operation that can suffer is modification of the index+package_dir. That means, no r/o user will be affected if EIUG takes master down for maintenance. This may seem like it's not a problem, but compared to centralized solutions, I never once had a remote reliability problem when operating on Linux, BSD, or CTAN packages. - Based on the multitude of mirrors for BSD, Linux, CTAN, etc., I believe it's more likely for someone to host another mirror than expecting such offers to turn into monetary support for covering costs of a centralized system. -- nice to have -- * pinning as - in stay at this version and do not down-/up-grade * pinning local package as in 'opam source PKGNAME --pin' * regardless of .ez limitations, architecture specific variants of a package * delta index (Debian-like) and package updates (Fedora-like) -- to be careful about -- * generating native packages (FreeBSD pkg, dpkg, rpm, etc.) is nice to have, but if existing issues of, say, the way Perl is packaged in Linux distros is any indication, I'd say it should only be optional. * a git repository with its history is not a suitable mechanism to store either the index or the packages -- extra notes -- I had planned to work on .ez-fying all libs/apps in OTP-18.0, but I haven't had the time to approach that yet. I mention that because we definitely have to improve support in that space first, especially: * Make sure everything works with .ez archives without first extracting (like JAR and WAR archives). * Figure out official extensions of .app fields to properly support packaging in general. * Figure out a convention to load .so/.dll from .ez and extend the loaders accordingly. It's up for discussion whether somepkg-1.0.ez should bundle all .so/.dll files or if there should be one somepkg-1.0-.ez for each supported architecture. From eric.pailleau@REDACTED Tue Dec 16 18:10:40 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Tue, 16 Dec 2014 18:10:40 +0100 Subject: [erlang-questions] Erlang package manager Message-ID: <3ee7ak20i9nxxufqh28tqgba.1418749805663@email.android.com> Hi, your opinion. There is already esl-erlang packages for Erlang core and libs. I write on package for erlang applications. Doing OS packages for an Erlang application may need other tools , and dependencies to esl could install the right Erlang vm version. the main problem to address is to be able to install and use several VM version in parallel , like alternatives with java. kerl ? I do not talk on embedded system releases. And not mentioning native code. ? Envoy? depuis mon mobile ? Eric zxq9 a ?crit?: >On 2014?12?16? ??? 15:56:22 Eric Pailleau wrote: >> I forgot to say that Erlang packages may need Non Erlang application, like >> Postgresql, or Varnish or (fill blanks). Debian Meta package allow this, >> for instance. This could not be achieved with a specific Erlang packager. > >There are no Erlang packages or builds that require Postgres. Some C >interfaces may require Postgres headers to build (and these are not "Erlang >packages" in the strict sense), but most Erlang systems that have anything at >all to do with something like Postgres need to be given the address of a >servicing port with which to connect. > >This is not an Erlang build issue. At all. Ever. > >The way this is handled is through OS distributions -- and if the decision >were made to include this sort of "build" support (or rather, not "dep >resolution" but "adjacent service provision") then the package manager would >wind up becoming its own OS distro in short order, and from there wind up >trying to be OpenStack. And it can't ever be that. Not even anything remotely >close to that. > >The only thing even sort of close would be for Erlang to pick a single distro >of a single OS on a single platform and settle on that as the sole reference >implementation forever and ever, amen, and pour time into maintaining that >(blessed) distro's Erlang subsection of packages through its package manager. >This, actually, is workable from a technical point of view -- but is >guaranteed to not be socially workable, even if it were done in the Belly of >Some Beast (neither MS nor IBM has been able to pull this off, and they own >their entire stack) -- actually, I imagine the annoyance of keeping up with >this sort of thing is why Erlang was spun out of Ericsson in the first place. > >And that leaves us back at the original problem, which has been demonstrated >to be twofold: > >1- Define an ecosystem within which code can be grown and known to survive with >a minimum of wasted developer effort. >2- Set clear limits of that ecosystem. > >The ecosystem definition is really more important than any particular >implementation of a tool within it -- but that gets into standards, and who >follows those without a reference implementation anyway? (And who spends time >writing *and* maintaining new implementations when the reference platform >already works well? We want to do more interesting things with Erlang than >write more Erlang, I imagine...) It has to be complete enough to cover the >problem space so that something can be implemented in the first place -- but >absolutely can't go so far that it suffers from second-system-syndrome. > >I've got plenty of ideas what the above statements should mean, but that's not >the point of this message. My purpose is to point out straight away that this >entire idea will be DOA if we let the Good Idea Fairy serve up a big dream >steak smothered in hope peppers with a side of good intentions and a community >love salad before even a line of code has been written. > >-Craig >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions From tuncer.ayaz@REDACTED Tue Dec 16 18:20:30 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 16 Dec 2014 18:20:30 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: <548CAB44.4020707@ninenines.eu> References: <548CAB44.4020707@ninenines.eu> Message-ID: On Sat, Dec 13, 2014 at 10:10 PM, Loic Hoguin wrote: > The "httpc gets confused under load" bug has popped up for at least > two years. I am not sure as to why nobody sent a patch for it (other > than it being quite hard to replicate outside production), but I can > tell you why Having an easy to reproduce test would increase the likelyhood of someone fixing it, assuming the user being able to reproduce is not able to submit a patch. > Cowboy and erlang.mk exist. I moved from rebar to erlang.mk because > of two issues that can never be fixed in rebar: "hot" compilation > speed, and self-contained dependencies (aka don't use top-level > rebar to compile everything, because some dependencies expect a > particular version of rebar). It's off-topic, but as you mentioned here, I'll respond: Naturally rebar does a lot more than invoking 'erl -make', but I'd like to encourage anyone who found .erl compiltion to be too slow to try out a newer version, as there have been big performance fixes. Regarding some dep strictly requiring a certain rebar version, I can say that it's something which should not happen, and if it does, it's most likely a regression. If you know of any, I'd appreciate more information in a different thread (this list, github ticket, or rebar list). > Perhaps it is fine as it is (though that bug being fixed eventually > would still be nice). OTP libs don't have to try to be the ultimate > "everything you'll ever need", just provide the bare minimum for a > useful system. (I would say they provide way too many libs right > now, but http[cd] are fine.) But features that are provided should be free of known bugs. From tuncer.ayaz@REDACTED Tue Dec 16 18:30:11 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 16 Dec 2014 18:30:11 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: On Sun, Dec 14, 2014 at 10:44 PM, Felix Gallo wrote: > Hi Tuncer, > > Your questions are excellent ones. I agree with your assertion that > it'd be nice if http[c,d] were well-supported and kept up to date in > the standard library, but on the other hand that's equivalent to me > saying that it would be nice if other people did some tedious work. > The OTP team appears to be, ah, not luxuriously staffed, and, er, > somewhat well-task-committed towards commercial customers, so it's > easy to see how they're not spending their days fastidiously > refactoring the standard library. I'm sorry if I failed to express it correctly, so I'd like to point your attention to the last bit where I said the OTP team are likely to welcome patches to fix (or maybe even replace things). That means, I'm only expecting them to consider integrating sensible patches, not fixing issues they aren't able to reproduce or refactoring libs they don't run into bugs with :). > It would be interesting to know what the OTP team's official > position on accepting new libraries and deprecating old ones is, and > what the process would look like (EEP? Other?). I don't have an answer, but eldap was integrated, so I don't think they would object a good replacement, if somebody proposes it in non-API breaking patch. From tuncer.ayaz@REDACTED Tue Dec 16 18:37:05 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 16 Dec 2014 18:37:05 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <54902B16.3010204@ninenines.eu> References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> Message-ID: On Tue, Dec 16, 2014 at 1:52 PM, Loic Hoguin wrote: > Unfortunately in my case I will have to keep maintaining a separate > wheel because I do not want to boot the Erlang VM for these things. Curious, has the issue to do with slow startup time of the VM? If so, it's something that has regressed after R13, and IIRC, at least part of is due to new features like line numbers, but I'd have to dig out an old thread to be sure. From mjtruog@REDACTED Tue Dec 16 20:12:38 2014 From: mjtruog@REDACTED (Michael Truog) Date: Tue, 16 Dec 2014 11:12:38 -0800 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: Message-ID: <54908426.4000506@gmail.com> 1) It needs to be simple, allowing you to publish a package within less than 1 hour of usage. Good examples are https://hex.pm/ for elixir, https://pypi.python.org/pypi for python, https://rubygems.org/ for ruby, https://www.npmjs.com/ for node.js. Bad examples are http://search.maven.org/ for java, http://www.cpan.org/ for perl. Maven is probably the best example of what is worst, due to the process being as complex as possible and taking as long as possible. The goal of the package manager is not to earn more consulting money (I hope), i.e., consultant-ware. 2) It needs to use source code in the packages, not binaries, to make sure everything is transparent, avoiding black-box binary blobs which lack any ability to be examined easily. Past erlang package managers have had trouble here. Along with this, there needs to be signing of the package for the identity of the publisher and the integrity of the package. 3) We don't need package dictators which attempt to decide what packages are important, since that just limits the size of the community, making this less of an open source effort (unless that is the goal). You will notice the large open source communities don't need to do this. 4) It should be easy to utilize external build tools (like autoconf/automake/makefiles) in a way that is the same as things like rebar and emake due to the obvious problems doing non-Erlang builds within an Erlang package (port, NIF and port driver compilation support is unable to cover complex usage, i.e., it lacks cross-platform support and dependency checking, these shortcomings are likely to always be there, due to the effort involved in tackling them seriously). It would be good to avoid bikeshedding here and the potential for lock-in. 5) It should not require a server running locally, just basic client usage of a tool. If the package manager tool's execution lasts beyond its usage, it doesn't look as simple as it should (instead it just looks like a potential security problem). This could include leaving epmd running which has been an issue with past erlang package managers (puzzling potential users). 6) Ideally, it should be easy to create a private package index for private corporate usage of internal packages. It would be nice to keep all the programming language usage in Erlang for the sake of simplicity (there have been issues in the past with mixing Python and other programming languages into the tool) and to keep the dependencies limited. This is a great opportunity to show how Erlang can shine to provide the community with simple package management. On 12/16/2014 03:41 AM, Bruce Yinhe wrote: > Hi everyone, > > Industrial Erlang User Group (IEUG) has been working together with the Erlang/OTP team to investigate and create a package management system for Erlang/OTP. > > The lack of a package management system for Erlang has been discussed for a long time in the community. In essence, a straightforward package management system is believed to take Erlang programming language a step forward. Multiple tools will appear in the community. It needs to be supported by a highly visible community behind it. > > > In order to increase the adoption and to result in a tool widely used in the Erlang ecosystem, we are identifying the most important user categories and use cases, based on what the majority of the community want in a package manager. Therefore we would like to invite an open discussion. > > Now you are welcome to share your thoughts, suggestions or proposals about an Erlang package manager. It would be great if you could reply with your motivation, explaining why a feature is necessary to have. There are some example questions to begin the dicussion with, including, but not limited to the following. > > * What metadata information should an Erlang package include? > * What functionality do you need in a package manager for Erlang in order to use it in production? > * What other concerns do you have about an Erlang package management system? > > Erlang package manager's brief wish list of features: > > * Console interface > * Web interface > * Package Index and Repository > * Fetch, Install and Remove Packages > * Publish packages > * Versioning and Dependency Management > > We are aware of several previous efforts and existing tools that attempt to achieve the similar goal. We want to look at existing things, both from Erlang and Elixir, to see if they fit the requirements. If not, we will then have to make something new, perhaps as a rewrite of an existing tool. > > The IEUG members are putting together requirements for a package manager and will work with the community and Ericsson to create a standard and address any voids which exists in the existing tooling, funding necessary efforts required. > > Best regards > > Bruce Yinhe > > Erlang Community Manager > Industrial Erlang User Group > community-manager@REDACTED > +46 72 311 43 89 > > > _______________________________________________ > 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 Tue Dec 16 21:23:54 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 16 Dec 2014 22:23:54 +0200 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: Message-ID: <549094DA.10408@ninenines.eu> On 12/16/2014 07:05 PM, Tuncer Ayaz wrote: > * a git repository with its history is not a suitable mechanism to > store either the index or the packages Then what is suitable for the index? (It's obviously not suitable for packages themselves, yes.) -- Lo?c Hoguin http://ninenines.eu From essen@REDACTED Tue Dec 16 21:28:47 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 16 Dec 2014 22:28:47 +0200 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> Message-ID: <549095FF.5030900@ninenines.eu> On 12/16/2014 07:37 PM, Tuncer Ayaz wrote: > On Tue, Dec 16, 2014 at 1:52 PM, Loic Hoguin wrote: > >> Unfortunately in my case I will have to keep maintaining a separate >> wheel because I do not want to boot the Erlang VM for these things. > > Curious, has the issue to do with slow startup time of the VM? If so, > it's something that has regressed after R13, and IIRC, at least part > of is due to new features like line numbers, but I'd have to dig out > an old thread to be sure. It's mostly about slow startup time, yes. It's interesting how erlc runs very fast though, despite running Erlang code. If the package manager was built like erlc, instead of like an escript, it would ease my concerns very much and I might be able to integrate it with erlang.mk (assuming there are no other issues that I can't foresee at the moment). -- Lo?c Hoguin http://ninenines.eu From daniel.goertzen@REDACTED Tue Dec 16 21:43:07 2014 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Tue, 16 Dec 2014 14:43:07 -0600 Subject: [erlang-questions] embedded systems erlang? In-Reply-To: References: Message-ID: 64MB is the smallest system I've run Erlang on. For a 256k system, you could leverage parts of your Erlang kung-fu by using something like FreeRTOS (to get tasks and message queues.) On Mon, Dec 15, 2014 at 6:00 PM, Raoul Duke wrote: > > hi, > > I see many google hits for things people have done with Erlang > targeting "embedded" resource constrained systems. But I'm not sure if > there's like an official build or something for it? Does everybody > hack up their own thing? What's the state of the art or mainstream way > to go here? > > I'm looking at like 256 K RAM (!) > _______________________________________________ > 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 Tue Dec 16 21:47:13 2014 From: raould@REDACTED (Raoul Duke) Date: Tue, 16 Dec 2014 12:47:13 -0800 Subject: [erlang-questions] embedded systems erlang? In-Reply-To: References: Message-ID: Thanks for the mention of a reasonable lower bound; very good to know to set expectations. :-) (Personally even though I grew up on Atari 2600s, wobbly ZX81 16K RAM packs, and the like, I still find it hard to believe anything at all can run in 256K. I have to remind myself it is possible... it is possible.) From tuncer.ayaz@REDACTED Tue Dec 16 21:55:59 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 16 Dec 2014 21:55:59 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <549094DA.10408@ninenines.eu> References: <549094DA.10408@ninenines.eu> Message-ID: On Tue, Dec 16, 2014 at 9:23 PM, Loic Hoguin wrote: > On 12/16/2014 07:05 PM, Tuncer Ayaz wrote: > > > > * a git repository with its history is not a suitable mechanism to > > store either the index or the packages > > Then what is suitable for the index? (It's obviously not suitable > for packages themselves, yes.) It would be a good start to take hints from Debian or Fedora's systems, to name two designs that are better suited than just putting anything in a git repo. If we take archival of old versions seriously, it's a good idea to have a look at Hackage(2) as well. Ubuntu's index does not appear to support delta index updates, and that's why I wrote Debian, if somebody wonders. From tuncer.ayaz@REDACTED Tue Dec 16 22:07:14 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 16 Dec 2014 22:07:14 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <549095FF.5030900@ninenines.eu> References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> <549095FF.5030900@ninenines.eu> Message-ID: On Tue, Dec 16, 2014 at 9:28 PM, Loic Hoguin wrote: > On 12/16/2014 07:37 PM, Tuncer Ayaz wrote: > > > > On Tue, Dec 16, 2014 at 1:52 PM, Loic Hoguin wrote: > > > > > Unfortunately in my case I will have to keep maintaining a > > > separate wheel because I do not want to boot the Erlang VM for > > > these things. > > > > > > Curious, has the issue to do with slow startup time of the VM? If > > so, it's something that has regressed after R13, and IIRC, at > > least part of is due to new features like line numbers, but I'd > > have to dig out an old thread to be sure. > > > It's mostly about slow startup time, yes. > > It's interesting how erlc runs very fast though, despite running > Erlang code. If the package manager was built like erlc, instead of Without having checked the code, I suppose it's due to starting with less apps (modules) and similar settings. From what I recall, I think it used to start the VM with args like "-mode minimal" and maybe other switches, but I don't remember it all. > like an escript, it would ease my concerns very much and I might be > able to integrate it with erlang.mk (assuming there are no other > issues that I can't foresee at the moment). The increase in startup time after R13 is unfortunate and asking for someone to profile and check for possible improvements. Maybe there's also a need for an erlc-like escript startup mode that could try to delay stuff. Anyway, Loic, this is off-topic, so we should either use a separate thread or not pollute the pkg mgr thread. From essen@REDACTED Tue Dec 16 22:11:21 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Tue, 16 Dec 2014 23:11:21 +0200 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> <549095FF.5030900@ninenines.eu> Message-ID: <54909FF9.2070509@ninenines.eu> On 12/16/2014 11:07 PM, Tuncer Ayaz wrote: > On Tue, Dec 16, 2014 at 9:28 PM, Loic Hoguin wrote: >> On 12/16/2014 07:37 PM, Tuncer Ayaz wrote: >>> >>> On Tue, Dec 16, 2014 at 1:52 PM, Loic Hoguin wrote: >>> >>>> Unfortunately in my case I will have to keep maintaining a >>>> separate wheel because I do not want to boot the Erlang VM for >>>> these things. >>> >>> >>> Curious, has the issue to do with slow startup time of the VM? If >>> so, it's something that has regressed after R13, and IIRC, at >>> least part of is due to new features like line numbers, but I'd >>> have to dig out an old thread to be sure. >> >> >> It's mostly about slow startup time, yes. >> >> It's interesting how erlc runs very fast though, despite running >> Erlang code. If the package manager was built like erlc, instead of > > Without having checked the code, I suppose it's due to starting with > less apps (modules) and similar settings. From what I recall, I think > it used to start the VM with args like "-mode minimal" and maybe other > switches, but I don't remember it all. > >> like an escript, it would ease my concerns very much and I might be >> able to integrate it with erlang.mk (assuming there are no other >> issues that I can't foresee at the moment). > > The increase in startup time after R13 is unfortunate and asking for > someone to profile and check for possible improvements. Maybe there's > also a need for an erlc-like escript startup mode that could try to > delay stuff. > > Anyway, Loic, this is off-topic, so we should either use a separate > thread or not pollute the pkg mgr thread. This is not off-topic. A package manager that runs fast like erlc is something I would like to see, otherwise its usefulness is very limited to me. -- Lo?c Hoguin http://ninenines.eu From mangalaman93@REDACTED Tue Dec 16 22:12:29 2014 From: mangalaman93@REDACTED (aman mangal) Date: Tue, 16 Dec 2014 21:12:29 +0000 Subject: [erlang-questions] Why doesn't Erlang has return statement? References: <549026E0.7090105@ninenines.eu> Message-ID: Thank you all for your replies. Now I have more clear understanding of why Erlang doesn't have *return *statements :) On Tue Dec 16 2014 at 7:34:49 AM Lo?c Hoguin wrote: > Erlang has no statements, it only has expressions. All expressions > return a value. So there is no need for a "return" instruction, the last > expression executed gives the return value of the function. > > If you use function clauses in addition to case expressions, you > shouldn't have too many levels deep. If you do, create a new function. > Avoid using catch for these things because it creates a stacktrace and > that's expensive. > > On 12/16/2014 10:05 AM, aman mangal wrote: > > Hi everyone, > > > > I have seen similar questions before on the forum but I could never > > understand the reason behind it. Is it due to theoretical reasons such > > as /return /statement makes it hard to reason about the program or > > practical reasons that it is hard to implement it (this doesn't seem > > right but I cannot think of anything else)? > > > > Moreover, is there a good alternate to avoid nested case statements? > > Making more functions just seems tedious. Using /catch /statement seems > > another good alternate but my intuition is that it is not good practice, > > is it? > > > > Thank you > > Aman Mangal > > www.prism.gatech.edu/~amangal7 > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > Lo?c Hoguin > http://ninenines.eu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Tue Dec 16 22:23:45 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 16 Dec 2014 22:23:45 +0100 Subject: [erlang-questions] What lib to use for http requests In-Reply-To: References: Message-ID: While at it, I want to suggest that anyone trying to improve the performance of http clients or servers might also want to have a look at the inet_drv C code, as it's used by all servers/clients and likely to contain code paths with the potential for optimizations. I'm not talking about HTTP parser specifically, just to be clear. From max.lapshin@REDACTED Tue Dec 16 23:33:25 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 17 Dec 2014 01:33:25 +0300 Subject: [erlang-questions] DTLS/SRTP for WebRTC In-Reply-To: <1561626763.987018.1416222640677.JavaMail.zimbra@tpip.net> References: <651666163.987017.1416222640143.JavaMail.zimbra@tpip.net> <1561626763.987018.1416222640677.JavaMail.zimbra@tpip.net> Message-ID: Hi, Andreas. I'm implementing server-side for webrtc now and I want know if it is possible to work with you on this DTLS stuff? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Tue Dec 16 23:53:33 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 17 Dec 2014 11:53:33 +1300 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: <09BB764D-FC16-4C0A-80E6-BDF5EC520F95@cs.otago.ac.nz> On 16/12/2014, at 9:05 pm, aman mangal wrote: > I have seen similar questions before on the forum but I could never understand the reason behind it. Is it due to theoretical reasons such as return statement makes it hard to reason about the program or practical reasons that it is hard to implement it (this doesn't seem right but I cannot think of anything else)? What would you use a ?return statement? *for*? You might as well ask why Erlang doesn?t have an ?assigned GO TO? statement. > Moreover, is there a good alternate to avoid nested case statements? Why avoid them? Give a *real* example where nested case expressions (not ?statements?, Erlang doesn?t strictly speaking *have* ?statements?) are a problem. > Making more functions just seems tedious. That?s not the question, surely? The question is whether it is *more* tedious than other alternatives. And whether it leads to *better* code. > Using catch statement seems another good alternate but my intuition is that it is not good practice, is it? ?try . . . catch? is another ?case?-like structure; that would be to cast out devils by means of Beelzebub. It seems to be a goood rule in all discussions like this to focus on some actual concrete cases from real code. From mark.nijhof@REDACTED Wed Dec 17 00:00:54 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Wed, 17 Dec 2014 00:00:54 +0100 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: <09BB764D-FC16-4C0A-80E6-BDF5EC520F95@cs.otago.ac.nz> References: <09BB764D-FC16-4C0A-80E6-BDF5EC520F95@cs.otago.ac.nz> Message-ID: When I first started using Erlang I was missing the return statement as well, in other languages return gave me an easy way to exit a function as early as possible, i,e, when this thing is not true then don't continue but exit. This kept the functions pretty clean. Pattern matching has completely replaced this for me. -Mark On Tue, Dec 16, 2014 at 11:53 PM, Richard A. O'Keefe wrote: > > > On 16/12/2014, at 9:05 pm, aman mangal wrote: > > I have seen similar questions before on the forum but I could never > understand the reason behind it. Is it due to theoretical reasons such as > return statement makes it hard to reason about the program or practical > reasons that it is hard to implement it (this doesn't seem right but I > cannot think of anything else)? > > What would you use a ?return statement? *for*? > You might as well ask why Erlang doesn?t have an ?assigned GO TO? > statement. > > > Moreover, is there a good alternate to avoid nested case statements? > > Why avoid them? Give a *real* example where nested case expressions > (not ?statements?, Erlang doesn?t strictly speaking *have* ?statements?) > are a problem. > > > Making more functions just seems tedious. > > That?s not the question, surely? The question is whether it is *more* > tedious than other alternatives. And whether it leads to *better* code. > > > Using catch statement seems another good alternate but my intuition is > that it is not good practice, is it? > > ?try . . . catch? is another ?case?-like structure; that would be to > cast out devils by means of Beelzebub. > > It seems to be a goood rule in all discussions like this to focus on > some actual concrete cases from real code. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Mark Nijhof t: @MarkNijhof s: marknijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Wed Dec 17 01:18:08 2014 From: t@REDACTED (Tristan Sloughter) Date: Tue, 16 Dec 2014 18:18:08 -0600 Subject: [erlang-questions] Erlang package manager In-Reply-To: <54909FF9.2070509@ninenines.eu> References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> <549095FF.5030900@ninenines.eu> <54909FF9.2070509@ninenines.eu> Message-ID: <1418775488.862817.203765265.5E4252E8@webmail.messagingengine.com> I'm just throwing my thoughts out there. This isn't to cover all features I'd want to see in a package manager, but instead just the ones I know are "controversial". These are also the direction we've gone with rebar3 (http://rebar3.org). * Binary packages Why build from source if you don't need to? Most Erlang applications have no native code. * No semver enforcement I mean, why bother? For one, you can't actually force semantic versioning. You can require the version be of the format MAJOR.MINOR.PATCH+[metadata] but not the semantic part. I think forcing the format in the name of "semver" is confusing and wrong. * Strict version declarations No ">=1.0" or "<1.0 and >0.5". The project should set a version number of the dependency it relies on. "Solving" dependencies is a matter of choosing the highest version of a dep in the dependency tree. This is also followed by maven, http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html * No global install It just causes headaches. Sandboxes are much more fun to play in without all the kids in the neighborhood crowding in and someone ending up leaving a poop in it. -- Tristan Sloughter t@REDACTED From mangalaman93@REDACTED Wed Dec 17 01:31:58 2014 From: mangalaman93@REDACTED (aman mangal) Date: Wed, 17 Dec 2014 00:31:58 +0000 Subject: [erlang-questions] Why doesn't Erlang has return statement? References: <09BB764D-FC16-4C0A-80E6-BDF5EC520F95@cs.otago.ac.nz> Message-ID: On Tue Dec 16 2014 at 5:54:22 PM Richard A. O'Keefe wrote: > > On 16/12/2014, at 9:05 pm, aman mangal wrote: > > I have seen similar questions before on the forum but I could never > understand the reason behind it. Is it due to theoretical reasons such as > return statement makes it hard to reason about the program or practical > reasons that it is hard to implement it (this doesn't seem right but I > cannot think of anything else)? > > What would you use a ?return statement? *for*? > You might as well ask why Erlang doesn?t have an ?assigned GO TO? > statement. > yes exactly but that also makes the reasoning about the program harder. Even if we keep that aside, as from the discussions, Erlang has only expressions, no statements as such. > > > Moreover, is there a good alternate to avoid nested case statements? > > Why avoid them? Give a *real* example where nested case expressions > (not ?statements?, Erlang doesn?t strictly speaking *have* ?statements?) > are a problem. > > When I am using pattern matching, I wonder what if the function returned something else. More specifically the return could be {ok, Result} | {error, Reason}. This can happen in a sequence of statements and I end up using nested case expressions or calling one functions after another to handle both the cases separately. > Making more functions just seems tedious. > > That?s not the question, surely? The question is whether it is *more* > tedious than other alternatives. And whether it leads to *better* code. > > > Using catch statement seems another good alternate but my intuition is > that it is not good practice, is it? > > ?try . . . catch? is another ?case?-like structure; that would be to > cast out devils by means of Beelzebub. > In this case, I could just follow all the good scenarios and handle all bad scenarios once and for all in catch part of the expression. > > It seems to be a goood rule in all discussions like this to focus on > some actual concrete cases from real code. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex@REDACTED Wed Dec 17 02:06:56 2014 From: alex@REDACTED (Alex Wilson) Date: Wed, 17 Dec 2014 11:06:56 +1000 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: <09BB764D-FC16-4C0A-80E6-BDF5EC520F95@cs.otago.ac.nz> Message-ID: <1AF718E0-2432-4B1C-898D-AE92CB5FC7DB@cooperi.net> > On 17 Dec 2014, at 10:31 am, aman mangal wrote: > > > Moreover, is there a good alternate to avoid nested case statements? > > Why avoid them? Give a *real* example where nested case expressions > (not ?statements?, Erlang doesn?t strictly speaking *have* ?statements?) > are a problem. > > When I am using pattern matching, I wonder what if the function returned something else. More specifically the return could be {ok, Result} | {error, Reason}. This can happen in a sequence of statements and I end up using nested case expressions or calling one functions after another to handle both the cases separately. > You could consider something like a monad, perhaps. I know "monad" is a horrible functional programming word that makes people go "OMG THAT'S TOO HARD", but it's a pretty clean way to deal with errors sometimes. https://github.com/rabbitmq/erlando#do has an example of implementing do-notation for monads in Erlang using a parse-transform. The error monad example is kind of interesting. You can do the same thing without the parse-transform by having a function like this one: threaduntil([], Acc) -> Acc; threaduntil([Fun | Rest], Acc) -> case Fun(Acc) of {error, E} -> {error, E}; Acc1 -> threaduntil(Rest, Acc1) end. So you call this with a list of funs, and whatever the output from one fun is, becomes the argument to the next one on the list, until either it reaches the end of the list (and returns the last return value), or one of the funs returns {error, _} -- then it short-circuits and returns the error straight away. It's not the lowest-overhead thing ever (making all those funs and executing them), but usually you see this kind of thing when dealing with i/o or high-level control logic that doesn't have to be the fastest-executing thing ever. I've used this pattern (and the erlando do-transform specifically) quite a lot to avoid chains of Thing1 = blah(Thing), Thing2 = foo(Thing1), Thing3 = bar(Thing2)... etc etc, and also to deal with situations where deeply nested errors need to produce a well-defined return value. I have a personal distaste for try/catch, so I prefer to choose between either crashing the process, or using this kind of approach. From jared.kofron@REDACTED Wed Dec 17 03:51:00 2014 From: jared.kofron@REDACTED (Jared Kofron) Date: Wed, 17 Dec 2014 02:51:00 +0000 Subject: [erlang-questions] Why doesn't Erlang has return statement? References: <09BB764D-FC16-4C0A-80E6-BDF5EC520F95@cs.otago.ac.nz> <1AF718E0-2432-4B1C-898D-AE92CB5FC7DB@cooperi.net> Message-ID: On Tue Dec 16 2014 at 5:07:22 PM Alex Wilson wrote: > > > On 17 Dec 2014, at 10:31 am, aman mangal wrote: > > > > > Moreover, is there a good alternate to avoid nested case statements? > I think everybody would agree that there is a smell that comes from nested case expressions, which shows up in the fact that idiomatic Erlang tends toward lots of short functions. It's kind of a non-answer, but I would say replace a nested case with a function call. I personally find that unlike in a language like C where having a ton of functions can sometimes make things a little muddled, after working with Erlang for a while matching inside a case and calling functions (which generally means having a lot of functions) on the result is very natural, and actually makes your code easier to follow, debug, and test. > > > > You could consider something like a monad, perhaps. I know "monad" is a > horrible functional programming word that makes people go "OMG THAT'S TOO > HARD", but it's a pretty clean way to deal with errors sometimes. > > https://github.com/rabbitmq/erlando#do has an example of implementing > do-notation for monads in Erlang using a parse-transform. The error monad > example is kind of interesting. > > You can do the same thing without the parse-transform by having a function > like this one: > > threaduntil([], Acc) -> Acc; > threaduntil([Fun | Rest], Acc) -> > case Fun(Acc) of > {error, E} -> {error, E}; > Acc1 -> threaduntil(Rest, Acc1) > end. > > So you call this with a list of funs, and whatever the output from one fun > is, becomes the argument to the next one on the list, until either it > reaches the end of the list (and returns the last return value), or one of > the funs returns {error, _} -- then it short-circuits and returns the error > straight away. > > It's not the lowest-overhead thing ever (making all those funs and > executing them), but usually you see this kind of thing when dealing with > i/o or high-level control logic that doesn't have to be the > fastest-executing thing ever. > > I've used this pattern (and the erlando do-transform specifically) quite a > lot to avoid chains of Thing1 = blah(Thing), Thing2 = foo(Thing1), Thing3 = > bar(Thing2)... etc etc, and also to deal with situations where deeply > nested errors need to produce a well-defined return value. I have a > personal distaste for try/catch, so I prefer to choose between either > crashing the process, or using this kind of approach. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.goertzen@REDACTED Wed Dec 17 03:51:50 2014 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Tue, 16 Dec 2014 20:51:50 -0600 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: I recommend giving Garrett's video below a watch to overcome your fear of adding more functions. I've always been skeptical of the approach, but I forced myself to try it and it actually works out really well. https://www.youtube.com/watch?v=CQyt9Vlkbis On Tue, Dec 16, 2014 at 2:05 AM, aman mangal wrote: > > Hi everyone, > > I have seen similar questions before on the forum but I could never > understand the reason behind it. Is it due to theoretical reasons such as *return > *statement makes it hard to reason about the program or practical reasons > that it is hard to implement it (this doesn't seem right but I cannot think > of anything else)? > > Moreover, is there a good alternate to avoid nested case statements? > Making more functions just seems tedious. Using *catch *statement seems > another good alternate but my intuition is that it is not good practice, is > it? > > Thank you > Aman Mangal > www.prism.gatech.edu/~amangal7 > > _______________________________________________ > 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 Dec 17 05:19:30 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 17 Dec 2014 17:19:30 +1300 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: <09BB764D-FC16-4C0A-80E6-BDF5EC520F95@cs.otago.ac.nz> Message-ID: On 17/12/2014, at 12:00 pm, Mark Nijhof wrote: > When I first started using Erlang I was missing the return statement as well, in other languages return gave me an easy way to exit a function as early as possible, A ?return? statement is highly unusual in a functional language. There is no ?return? in ML or O?Caml or F# or Haskell or ? Scheme does have (and SML/NJ has copied) something not entirely unrelated, namely continuations. (call-with-current-continuation (lambda (k) . . .)) binds k to a function which when called exits call-with-current-continuation, returning the value it was given. What?s really interesting in Scheme is that this is a first- class value and can be stored in global variables and data structures and can be invoked many times. So you can ?return? from the same invocation any number of times. Examining >500,000 lines of Scheme code I happened to find lying around, I discovered 91 mentions of call-with-current-continuation or call/cc. Most of these mentions are benchmarks, test cases, compiler or preprocessor code dealing with it rather than using it. Let?s look at one serious use of it. The context is Reduced Ordered Binary Decision Diagrams, represented as #t #f ( ) ;; (true-model R) => `(true-model ,@REDACTED) for ;; some model M making R true if any exist ;; or ?no-true-model if there are no such models. (define (true-model R) (call-with-current-continuation (lambda (K) (let loop ((R R) (L '())) (if (boolean? R) (if R (K (cons 'true-model (reverse L)))) (begin (loop (cadr R) (cons (cons (car R) #t) L)) (loop (caddr R) (cons (cons (car R) #f) L))))) 'no-true-model))) What might not be clear here is that (let loop . . .) defines and calls a recursive function; it is commonly used for (tail recursive) loops but is not limited to that. Let?s try doing this in Erlang, using true false {Var,Robdd_T,Robdd_F} true_model(R) -> true_model(R, []). true_model(true, M) -> {true_model,M}; true_model(false, M) -> no_true_model; true_model({V,T,F}, M) -> case true_model(T, [{V,true}|M]) of no_true_model -> true_model(F, [{V,false}|M]) ; Success -> Success end. That wasn?t so hard. Note that the Scheme code here is doing something you can?t do in C, C++, Java, C# &c. It?s returning from the *outer* function from inside the *inner* function. In fact, every use of call-with-current-contination I can find in that body of Scheme code is either a test case or a lexically scoped early exit from a recursive traversal of some data structure, and there aren?t many of those. Here?s another real use, this time from a library for handling (parsed) XML. (define (first-descendant p Element) (if (not (procedure? p)) (set! p (is-named? p))) (call-with-current-continuation (lambda (k) (define (g List) (if (pair? List) (begin (f (car List)) (g (cdr List))))) (define (f Item) (if (p Item) (k Item)) (g (element-children Item))) (f Element) #f))) Given a predicate (or an element name) p, and an XML element, this is supposed to return the first descendent in document order satisfying p (or being an element named p). If there is none, it returns false. Let?s use {Tag,Attributes,Children} for an Element, {pcdata,Text} for parsed character data, and ignore everything else that can happen in XML. And let?s fix the somewhat confusing ?find first descendant that is an element with a given name? merger with ?find first descendant satisfying a predicate?. %? elsewhere in library is_named_element(T, {T,_,_}) -> true; is_named_element(_, _ ) -> false. is_named_element(T) -> fun (X) -> is_named_element(T, X) end. children({_,_,Children}) -> Children; children({pcdata,_}) -> []. %- unimportant glue code first_descendant_named(T, XML) -> first_descendant(is_named(T), XML). %- code under discussion %% first_descendant(P, XML) finds the first descendant of XML %% that satisfies P, or false if nothing does. It might be %% XML itself. Note the early exit in the auxiliary function. first_descendant(P, XML) -> case P(XML) of true -> XML ; false -> first_descendant_kids(P, children(XML)) end. first_descendant_kids(_, []) -> false; first_descendant_kids(P, [Kid|Kids]) -> case first_descendant(P, Kid) of false -> first_descendant_kids(P, Kids) ; Found -> Found end. It?s the same pattern, with ?return? being used to effect a long-distance BUT VISIBLY BOUNDED control transfer. Let?s try to simplify this using catch and throw. first_descendant(P, XML) -> try first_descendant_item(P, XML) catch throw:Found -> Found end. first_descendant_item(P, XML) -> case P(XML) of true -> throw(XML) ; false -> first_descendant_kids(P, children(Kids)) end. first_descendant_kids(_, []) -> false; first_descendant_kids(P, [Kid|Kids]) -> first_descendant_item(P, Kid) first_descendant_kids(P, Kids). We could fiddle with the indentation of try-catch-end, but there?s no reduction in code size here. If it were a matter of searching for a matching *child*, a return statement would be useful in C, because we?d use a while statement to search a list. But for a matching *descendant*, we can?t use a plain ?while? loop. Now, it so happens that I have a C implementation of the ?Document Value Model?. xml find_first_descendant(bool (*p)(xml), xml e) { for_each_descendant(e, d) if (p(d)) return d; end_each_descendant return (xml)0; } This makes it look very much as if a C-style ?return? would be useful in cases like this. Well, yes, but it took *this* code to make it work: #define for_each_descendant(e, d) { \ xml const _x_a = (e); \ struct XML_Stack *_x_s = 0; \ x_desc_push(&_x_s, &_x_a, 1); \ while (_x_s != 0) { \ xml const _x_c = x_desc_next(&_x_s); \ xml const d = _x_c; #define end_each_descendant \ if (is_element(_x_c) && x_size(_x_c) != 0) \ x_desc_push(&_x_s, &_x_c->u.children[1], x_size(_x_c)); \ } \ x_desc_free(&_x_s); \ } and the sad result is a storage leak. So you have to write xml find_first_descendant(bool (*p)(xml), xml e) { for_each_descendant(e, d) if (p(d)) descendant_found(d); /* free the hidden stack */ end_each_descendant return (xml)0; } Using this style instead of a straightforward recursion comes with a 70% performance penalty on a modern Mac. Returning to Erlang, can we do something cleaner? There are four conditions. Is the predicate satisfied or not? (find_first_descendant/2) Is the XML item an element or not? (children/1) Have we reached the end of the children or not? (find_descendant_kids/2) Should we exit early or not? (find_descendant_kids/2) Of these, only the last one is elided by the catch+throw or call/cc approach, and in the case of catch+throw it is replaced by ?DID we exit early or not??, which is no real improvement. I do agree that ?check head, if that failed try tail? is not as pretty as ?check head, check tail?. -define(OR_ELSE(E1,E2), case E1 of false -> E2 ; _X -> X end). first_descendant_kids(_, []) -> false; first_descendant_kids(P, [Kid|Kids]) -> ?OR_ELSE(first_descendant(P, Kid), first_descendant_kids(P, Kids)). might be thought to clarify this, or it might not. Personally, I think the original code, with the comment pointing out the early exit, is good enough. From viktor@REDACTED Tue Dec 16 23:58:58 2014 From: viktor@REDACTED (=?windows-1252?Q?Viktor_S=F6derqvist?=) Date: Tue, 16 Dec 2014 23:58:58 +0100 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: <5490B932.8060706@zuiderkwast.se> On 2014-12-16 09.05, aman mangal wrote: > Moreover, is there a good alternate to avoid nested case statements? One way is to avoid them is actually not to write them. Especially if the cases are error handling, handle only the expected case and let everything else crash. When I'm parsing some input or structure and want to return {ok, Value} or 'error' instead of crashing, I often wrap that code in a try-catch. This is only when dealing with untrusted input and similar situations. parse_foo_url(URL) -> case http_uri:parse(URL) of {ok, {_, _, _, _, Path, _}} -> case re:split(Path, "/", [{return, list}]) of ["", "foo", Foo] -> try list_to_integer(Foo) of FooInt -> {ok, FooInt} catch error:_ -> error end; _BadPath -> error end; _BadUri -> error; end. ----> parse_foo_url(URL) -> try {ok, {_, _, _, _, Path, _}} = http_uri:parse(URL), ["", "foo", Foo] = re:split(Path, "/", [{return, list}]), FooInt = list_to_integer(Foo), {ok, FooInt} catch error:_ -> error end. > Using /catch /statement seems another good alternate but my intuition > is that it is not good practice, is it? In the above example I dare to say it's not bad practice. Just don't overuse try-catch so that it becomes defensive programming and make sure you don't put any other code inside the try-catch so that you accidentally catch totally unrelated errors. Viktor -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Wed Dec 17 06:07:22 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 17 Dec 2014 06:07:22 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <54908426.4000506@gmail.com> References: <54908426.4000506@gmail.com> Message-ID: On Tue, Dec 16, 2014 at 8:12 PM, Michael Truog wrote: > > > 6) Ideally, it should be easy to create a private package index for > private corporate usage of internal packages. It would be nice to keep all > the programming language usage in Erlang for the sake of simplicity (there > have been issues in the past with mixing Python and other programming > languages into the tool) and to keep the dependencies limited. This is a > great opportunity to show how Erlang can shine to provide the community > with simple package management. > > IMO this should be a must have. Even in non corporate usage you would like to use a private package index to not rely on external networks or such (ex for offline development purpose). NPM, Python offers a way to mirror locally an index or create an index to use with your own packages. - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Wed Dec 17 06:09:09 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 17 Dec 2014 06:09:09 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <1418775488.862817.203765265.5E4252E8@webmail.messagingengine.com> References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> <549095FF.5030900@ninenines.eu> <54909FF9.2070509@ninenines.eu> <1418775488.862817.203765265.5E4252E8@webmail.messagingengine.com> Message-ID: On Wed, Dec 17, 2014 at 1:18 AM, Tristan Sloughter wrote: > > I'm just throwing my thoughts out there. This isn't to cover all > features I'd want to see in a package manager, but instead just the ones > I know are "controversial". These are also the direction we've gone with > rebar3 (http://rebar3.org). > > * Binary packages > > Why build from source if you don't need to? Most Erlang applications > have no native code. > > * No semver enforcement > > I mean, why bother? For one, you can't actually force semantic > versioning. You can require the version be of the format > MAJOR.MINOR.PATCH+[metadata] but not the semantic part. > > I think forcing the format in the name of "semver" is confusing and > wrong. > > * Strict version declarations > > No ">=1.0" or "<1.0 and >0.5". The project should set a version number > of the dependency it relies on. > > "Solving" dependencies is a matter of choosing the highest version of a > dep in the dependency tree. This is also followed by maven, > > http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html What if you want to support a package from version 3 to 5 but not 6 neither 1 or 2 due breaking changes in the API? -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Wed Dec 17 08:50:41 2014 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 17 Dec 2014 07:50:41 +0000 (UTC) Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: <118087622.30170.1418802641985.JavaMail.yahoo@jws10703.mail.gq1.yahoo.com> Note that once you're used to erlang or functional programming, there's usually little need for an explicit return statement. However, if you do need it, you can emulate return a bit awkwardly with throw(X) and an appropriate enclosing try ... catch (or perhaps just catch) to capture the result. Best,Thomas On Tuesday, December 16, 2014 9:05 AM, aman mangal wrote: Hi everyone, I have seen similar questions before on the forum but I could never understand the reason behind it. Is it due to theoretical reasons such as return statement makes it hard to reason about the program or practical reasons that it is hard to implement it (this doesn't seem right but I cannot think of anything else)? Moreover, is there a good alternate to avoid nested case statements? Making more functions just seems tedious. Using catch statement?seems another good alternate but my intuition is that it is not good practice, is it? Thank youAman Mangalwww.prism.gatech.edu/~amangal7 _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From be.dmitry@REDACTED Wed Dec 17 08:59:52 2014 From: be.dmitry@REDACTED (Dmitry Belyaev) Date: Wed, 17 Dec 2014 18:59:52 +1100 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: <6D8EAD2C-DC5B-45F5-9145-6BDCE94FA772@gmail.com> Although erlang doesn't have return statement, it's not very hard to implement a substitute. Here is a toy I made but never used: https://github.com/RumataEstor/ereturn -- Best wishes, Dmitry Belyaev On 16 December 2014 7:05:08 PM AEDT, aman mangal wrote: >Hi everyone, > >I have seen similar questions before on the forum but I could never >understand the reason behind it. Is it due to theoretical reasons such >as *return >*statement makes it hard to reason about the program or practical >reasons >that it is hard to implement it (this doesn't seem right but I cannot >think >of anything else)? > >Moreover, is there a good alternate to avoid nested case statements? >Making >more functions just seems tedious. Using *catch *statement seems >another >good alternate but my intuition is that it is not good practice, is it? > >Thank you >Aman Mangal >www.prism.gatech.edu/~amangal7 > > >------------------------------------------------------------------------ > >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomasl_erlang@REDACTED Wed Dec 17 09:21:07 2014 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Wed, 17 Dec 2014 08:21:07 +0000 (UTC) Subject: [erlang-questions] Erlang package manager In-Reply-To: References: Message-ID: <955746700.32374.1418804467970.JavaMail.yahoo@jws10722.mail.gq1.yahoo.com> >From the replies, it seems to me like you first of all should take the best practices of OS package managers into account, so I'll skip that part. Instead, I'm interested in whether there are any erlang-specific features that should be catered to. I don't have a solution for these issues, so just consider it a wishlist. Statically, it would be useful to programmatically or automatically assemble packages into releases, including distributed releases. Then easily distribute the release(s) and start the nodes. It would also be nice if we could do erlang-style hot upgrades in this framework. Some possible issues then come to mind:? - a nice way to handle appup files (and, in the longer term, a nicer way to write them than today) - a nice way to handle & build/install linked in drivers (ideally, detecting and managing any possible conflicts) - databases and upgrading their contents in some standard way, preferrably without stopping the world - possibly also detecting or even handling name clashes of registered processes, module names, etc (Issues 2 and 4 also apply to the static case.) Best,Thomas On Tuesday, December 16, 2014 12:41 PM, Bruce Yinhe wrote: Hi everyone, Industrial Erlang User Group (IEUG) has been working together with the Erlang/OTP team to investigate and create a package management system for Erlang/OTP.? The lack of a package management system for Erlang has been discussed for a long time in the community. In essence, a straightforward package management system is believed to take Erlang programming language a step forward. Multiple tools will appear in the community. It needs to be supported by a highly visible community behind it. In order to increase the adoption and to result in a tool widely used in the Erlang ecosystem, we are identifying the most important user categories and use cases, based on what the majority of the community want in a package manager. Therefore we would like to invite an open discussion. Now you are welcome to share your thoughts, suggestions or proposals about an Erlang package manager. It would be great if you could reply with your motivation, explaining why a feature is necessary to have. There are some example questions to begin the dicussion with, including, but not limited to the following.? - What metadata information should an Erlang package include? - What functionality do you need in a package manager for Erlang in order to use it in production? - What other concerns do you have about an Erlang package management system? Erlang package manager's brief wish list of features:? - Console interface - Web interface - Package Index and Repository - Fetch, Install and Remove Packages - Publish packages - Versioning and Dependency Management We are aware of several previous efforts and existing tools that attempt to achieve the similar goal. We want to look at existing things, both from Erlang and Elixir, to see if they fit the requirements. If not, we will then have to make something new, perhaps as a rewrite of an existing tool. The IEUG members are putting together requirements for a package manager and will work with the community and Ericsson to create a standard and address any voids which exists in the existing tooling, funding necessary efforts required.? Best regards Bruce Yinhe Erlang Community ManagerIndustrial Erlang User Group community-manager@REDACTED 72 311 43 89 _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Wed Dec 17 09:40:30 2014 From: matthias@REDACTED (Matthias Lang) Date: Wed, 17 Dec 2014 09:40:30 +0100 Subject: [erlang-questions] embedded systems erlang? In-Reply-To: References: Message-ID: <20141217084030.GA22434@corelatus.se> On Monday, December 15, Raoul Duke wrote: > I see many google hits for things people have done with Erlang > targeting "embedded" resource constrained systems. But I'm not sure if > there's like an official build or something for it? There is no "official" build for "resource constrained" erlang. But cross compilation, which is a hurdle for many embedded systems, has been part of the official build for years now (it's definitely in R14B03, probably appeared around R12 or R13) > Does everybody hack up their own thing? Yes, because different people's embedded systems are quite different. > I'm looking at like 256 K RAM (!) There's no way you'll get normal Erlang to run in that. Just starting the shell on R14B03 on a 32 bit ARM CPU uses about 10 MB. Older versions of Erlang, e.g. R7, were a bit less hungry, maybe 6 MB. But 256 K is totally out of reach. Here's erlang:memory() on an ARM, for a newly started emulator which hasn't done anything other than start the shell: Erlang R14B03 (erts-5.8.4) [source] [rq:1] [async-threads:0] [kernel-poll:false] Eshell V5.8.4 (abort with ^G) 1> erlang:memory(). [{total,3488376}, {processes,679792}, {processes_used,673232}, {system,2808584}, {atom,300553}, {atom_used,272023}, {binary,17688}, {code,1745473}, {ets,86156}] the values are in bytes. (The memory use according to the OS is 10 MB for that emulator) Matt From essen@REDACTED Wed Dec 17 09:49:11 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 17 Dec 2014 10:49:11 +0200 Subject: [erlang-questions] Erlang package manager In-Reply-To: <1418775488.862817.203765265.5E4252E8@webmail.messagingengine.com> References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> <549095FF.5030900@ninenines.eu> <54909FF9.2070509@ninenines.eu> <1418775488.862817.203765265.5E4252E8@webmail.messagingengine.com> Message-ID: <54914387.6030307@ninenines.eu> On 12/17/2014 02:18 AM, Tristan Sloughter wrote: > * No global install > > It just causes headaches. Sandboxes are much more fun to play in without > all the kids in the neighborhood crowding in and someone ending up > leaving a poop in it. I think this is a very important point. I like deps not because I enjoy compiling everything, but because they are local to the project and I can have different projects use different dep versions without having to worry that the wrong version gets picked up. I am not even sure how -pa or ERL_LIBS work when you have both app-1 and app-2 in your lib directory. Which one does it choose? Will it choose the right version when I want to start a shell for experimenting? I have not seen anything that allows me to choose what version to run outside of making a release/upgrade. -- Lo?c Hoguin http://ninenines.eu From max.lapshin@REDACTED Wed Dec 17 10:03:03 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 17 Dec 2014 12:03:03 +0300 Subject: [erlang-questions] embedded systems erlang? In-Reply-To: <20141217084030.GA22434@corelatus.se> References: <20141217084030.GA22434@corelatus.se> Message-ID: We are making our own firmware for IP camera and struggling from low memory: 64 MB for everything. I'm a bit afraid to launch erlang there. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Wed Dec 17 10:05:03 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 17 Dec 2014 10:05:03 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <54914387.6030307@ninenines.eu> References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> <549095FF.5030900@ninenines.eu> <54909FF9.2070509@ninenines.eu> <1418775488.862817.203765265.5E4252E8@webmail.messagingengine.com> <54914387.6030307@ninenines.eu> Message-ID: On Wed, Dec 17, 2014 at 9:49 AM, Lo?c Hoguin wrote: > > > I am not even sure how -pa or ERL_LIBS work when you have both app-1 and > app-2 in your lib directory. Which one does it choose? Will it choose the > right version when I want to start a shell for experimenting? I have not > seen anything that allows me to choose what version to run outside of > making a release/upgrade. The code path is searched in order, that's why we have both -pa and -pz. Of course, when a module has been loaded, even if the code path changes afterwards, it is not reloaded automatically. regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Wed Dec 17 10:14:26 2014 From: zxq9@REDACTED (zxq9) Date: Wed, 17 Dec 2014 18:14:26 +0900 Subject: [erlang-questions] Erlang package manager In-Reply-To: <54914387.6030307@ninenines.eu> References: <1418775488.862817.203765265.5E4252E8@webmail.messagingengine.com> <54914387.6030307@ninenines.eu> Message-ID: <14499781.GAcrFgAboa@changa> On 2014?12?17? ??? 10:49:11 Lo?c Hoguin wrote: > On 12/17/2014 02:18 AM, Tristan Sloughter wrote: > > * No global install > > > > It just causes headaches. Sandboxes are much more fun to play in without > > all the kids in the neighborhood crowding in and someone ending up > > leaving a poop in it. > > I think this is a very important point. I like deps not because I enjoy > compiling everything, but because they are local to the project and I > can have different projects use different dep versions without having to > worry that the wrong version gets picked up. > > I am not even sure how -pa or ERL_LIBS work when you have both app-1 and > app-2 in your lib directory. Which one does it choose? Will it choose > the right version when I want to start a shell for experimenting? I have > not seen anything that allows me to choose what version to run outside > of making a release/upgrade. On this point, something that combines the best features of portage and mock would be ideal as far as build/release goes -- especially as a foundation upon which to script automated build/release of several concurrently maintained major versions of a product (its almost as if people forgot this situation exists...). Build environment isolation is of paramount importance, always. That said, flexible definition of dependencies is necessary, and to have that you have to make version numbers mean something (hence semver, or something like it). You don't have to force developers to version their stuff, but you do have to declare Maj.Min.Rev within the curated dep repo so that versions can indicate where API promises are being upheld or broken. There is no practical future for a tool that just "grabs the latest version of everything". Especially not in Erland, the kingdom of super-duper legacy support software cycles. Internal/external easy repo declaration (one of the best features of the RPM createrepo and signature system), mirroring, etc. is a must-have for serious use and broad adoption inside and outside of industry. It makes things flexible and not dependent on whatever The Blessed Repo winds up being (like if it gets screwy, or your network is down, or your boss has a serious NIH affliction, or someone is allergic to open source, or whatever). Taking yet another page from portage, the build system shouldn't hiccup when building *your* project using deps that are fully from-source, fully binary, arbitrary mix (based on availability) or whatever. The repo building tool should default to building as much of both a source and binary repo as it can, but wait to complain about anything until it completes (whether success or failure, give a full report). It should optionally put erldoc pages up and a package summary page in the repo root the way rpm and deb repo tools do. In our case with all Erlang->Erlang development dependencies adding full erldoc output for each package that has it is trivial to add as a feature (and way more useful from a developers perspective, since everything in the repo is effectively a "foo-dev" package for us, this not being an OS repo). Blah blah. -Craig From erlang@REDACTED Wed Dec 17 10:20:15 2014 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 17 Dec 2014 10:20:15 +0100 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: <5490B932.8060706@zuiderkwast.se> References: <5490B932.8060706@zuiderkwast.se> Message-ID: The question was : Why doesn't Erlang have a return statement I can let you into a secret - the first version of Erlang *did* have a return statement return was written ^Expression. Something like: foo() -> a,b,^c. Erlang with a return statement would look something like: foo() -> a, b, return(c). Here's some little fragments of code with returns foo(X) -> case g(X) of pattern1 -> a(), b, return(c); pattern2 -> do,de,dar, return(z) end. Now what would happen if all the branches in the case clause didn't do a return? We could write: foo(X) -> case g(X) of pattern1 -> a(), b, return(c); pattern2 -> do,de,dar, return(z); pattern3 -> Y = h(H), P = z(Y) end, foo(), return(P). Which kind of sucks - case is now NOT a function with a return value it's something that either returns a value OR binds some variables whose values escape from the case construction. In this case P escapes so we can use it after the case construct. This is a bit messy so we might rewrite it like this foo(X) -> P = case g(X) of pattern1 -> a(), b, return(c); pattern2 -> do,de,dar, return(z); pattern3 -> Y = h(H), z(Y) end, foo(), return(P). Again case is "funny" - from a flow of control point of view it can either a) return to the caller or b) carry on executing *after* the end statement. This actually makes it difficult to understand. It's really easy to "see" this in the small example above - but if the case statement had dozens of branches and one of them had a return in and all the others didn't this would be very difficult to spot. Now there are actually two methods for making an abrupt return from a function - exit(Expr) and throw(Expr). Both are in a sense "returns" (note the quotes). exit is for an abnormal return - throw is used to break out of computation, ie to return a value to some grand parent of the called function. In the absence of return(X) you can write throw(X) but this can make your programs more difficult to understand if abused. Cheers /Joe On Tue, Dec 16, 2014 at 11:58 PM, Viktor S?derqvist wrote: > On 2014-12-16 09.05, aman mangal wrote: > > Moreover, is there a good alternate to avoid nested case statements? > > One way is to avoid them is actually not to write them. Especially if the > cases are error handling, handle only the expected case and let everything > else crash. > > When I'm parsing some input or structure and want to return {ok, Value} or > 'error' instead of crashing, I often wrap that code in a try-catch. This is > only when dealing with untrusted input and similar situations. > > parse_foo_url(URL) -> > case http_uri:parse(URL) of > {ok, {_, _, _, _, Path, _}} -> > case re:split(Path, "/", [{return, list}]) of > ["", "foo", Foo] -> > try list_to_integer(Foo) of > FooInt -> {ok, FooInt} > catch error:_ -> > error > end; > _BadPath -> > error > end; > _BadUri -> > error; > end. > > ----> > > parse_foo_url(URL) -> > try > {ok, {_, _, _, _, Path, _}} = http_uri:parse(URL), > ["", "foo", Foo] = re:split(Path, "/", [{return, list}]), > FooInt = list_to_integer(Foo), > {ok, FooInt} > catch error:_ -> > error > end. > > Using catch statement seems another good alternate but my intuition is that > it is not good practice, is it? > > In the above example I dare to say it's not bad practice. Just don't overuse > try-catch so that it becomes defensive programming and make sure you don't > put any other code inside the try-catch so that you accidentally catch > totally unrelated errors. > > Viktor > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From dmytro.lytovchenko@REDACTED Wed Dec 17 10:47:18 2014 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Wed, 17 Dec 2014 10:47:18 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <54914387.6030307@ninenines.eu> References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> <549095FF.5030900@ninenines.eu> <54909FF9.2070509@ninenines.eu> <1418775488.862817.203765265.5E4252E8@webmail.messagingengine.com> <54914387.6030307@ninenines.eu> Message-ID: They way Nix does that (simplified estimation) -- is that it stores all package versions in its cache, and when you need a shell with specific versions of packages, it resolves versions and starts a shell for you with paths adjusted in such a way that you only see versions requested. I can see this as running "$ erlangpackagemanager shell" or alternatively it may print paths to copy-paste to your -pa or -pz (not to be committed to git as those paths will be local, of course). On Wed, Dec 17, 2014 at 9:49 AM, Lo?c Hoguin wrote: > > On 12/17/2014 02:18 AM, Tristan Sloughter wrote: > >> * No global install >> >> It just causes headaches. Sandboxes are much more fun to play in without >> all the kids in the neighborhood crowding in and someone ending up >> leaving a poop in it. >> > > I think this is a very important point. I like deps not because I enjoy > compiling everything, but because they are local to the project and I can > have different projects use different dep versions without having to worry > that the wrong version gets picked up. > > I am not even sure how -pa or ERL_LIBS work when you have both app-1 and > app-2 in your lib directory. Which one does it choose? Will it choose the > right version when I want to start a shell for experimenting? I have not > seen anything that allows me to choose what version to run outside of > making a release/upgrade. > > -- > Lo?c Hoguin > http://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mangalaman93@REDACTED Wed Dec 17 11:07:45 2014 From: mangalaman93@REDACTED (aman mangal) Date: Wed, 17 Dec 2014 10:07:45 +0000 Subject: [erlang-questions] Why doesn't Erlang has return statement? References: <5490B932.8060706@zuiderkwast.se> Message-ID: I understand what to do if the only way out is to use *return *but I think it takes away the fun of writing Erlang code and makes the program difficult to understand. More importantly, as the Garrett Smith explains in the video that it is important to write quality code than worrying too much about say performance as of today and *return *statement is definitely not the way to go. I like the approach of writing functions than using case expressions as he explained that functions are just named case expressions, and if next function call is the last statement in current function it won't affect performance as well if I even think about it. Great discussion, I have learnt so much of Erlang in such a short time, thank you so much! Aman Mangal On Wed Dec 17 2014 at 4:20:21 AM Joe Armstrong wrote: > The question was : Why doesn't Erlang have a return statement > > I can let you into a secret - the first version of Erlang *did* have a > return statement > > return was written ^Expression. > > Something like: > > foo() -> > a,b,^c. > > Erlang with a return statement would look something like: > > foo() -> > a, > b, > return(c). > > Here's some little fragments of code with returns > > foo(X) -> > case g(X) of > pattern1 -> > a(), b, return(c); > pattern2 -> > do,de,dar, return(z) > end. > > Now what would happen if all the branches in the case clause didn't > do a return? > > We could write: > > foo(X) -> > case g(X) of > pattern1 -> > a(), b, return(c); > pattern2 -> > do,de,dar, return(z); > pattern3 -> > Y = h(H), P = z(Y) > end, > foo(), > return(P). > > Which kind of sucks - case is now NOT a function with a return value > it's something that either returns a value OR binds some variables > whose values escape from the case construction. In this case > P escapes so we can use it after the case construct. > > This is a bit messy so we might rewrite it like this > > foo(X) -> > P = case g(X) of > pattern1 -> > a(), b, return(c); > pattern2 -> > do,de,dar, return(z); > pattern3 -> > Y = h(H), z(Y) > end, > foo(), > return(P). > > Again case is "funny" - from a flow of control point of view it can > either a) return to the caller or b) carry on executing *after* the > end statement. > > This actually makes it difficult to understand. It's really easy to > "see" this in the small example above - but if the case statement had > dozens of branches and one of them had a return in and all the others > didn't this would be very difficult to spot. > > Now there are actually two methods for making an abrupt return > from a function - exit(Expr) and throw(Expr). > > Both are in a sense "returns" (note the quotes). > > exit is for an abnormal return - throw is used to break out of > computation, ie to return a value to some grand parent of the called > function. > > In the absence of return(X) you can write throw(X) but this > can make your programs more difficult to understand if abused. > > Cheers > > /Joe > > On Tue, Dec 16, 2014 at 11:58 PM, Viktor S?derqvist > wrote: > > On 2014-12-16 09.05, aman mangal wrote: > > > > Moreover, is there a good alternate to avoid nested case statements? > > > > One way is to avoid them is actually not to write them. Especially if the > > cases are error handling, handle only the expected case and let > everything > > else crash. > > > > When I'm parsing some input or structure and want to return {ok, Value} > or > > 'error' instead of crashing, I often wrap that code in a try-catch. This > is > > only when dealing with untrusted input and similar situations. > > > > parse_foo_url(URL) -> > > case http_uri:parse(URL) of > > {ok, {_, _, _, _, Path, _}} -> > > case re:split(Path, "/", [{return, list}]) of > > ["", "foo", Foo] -> > > try list_to_integer(Foo) of > > FooInt -> {ok, FooInt} > > catch error:_ -> > > error > > end; > > _BadPath -> > > error > > end; > > _BadUri -> > > error; > > end. > > > > ----> > > > > parse_foo_url(URL) -> > > try > > {ok, {_, _, _, _, Path, _}} = http_uri:parse(URL), > > ["", "foo", Foo] = re:split(Path, "/", [{return, list}]), > > FooInt = list_to_integer(Foo), > > {ok, FooInt} > > catch error:_ -> > > error > > end. > > > > Using catch statement seems another good alternate but my intuition is > that > > it is not good practice, is it? > > > > In the above example I dare to say it's not bad practice. Just don't > overuse > > try-catch so that it becomes defensive programming and make sure you > don't > > put any other code inside the try-catch so that you accidentally catch > > totally unrelated errors. > > > > Viktor > > > > _______________________________________________ > > 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 dmkolesnikov@REDACTED Wed Dec 17 12:48:02 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Wed, 17 Dec 2014 13:48:02 +0200 Subject: [erlang-questions] embedded systems erlang? In-Reply-To: <20141217084030.GA22434@corelatus.se> References: <20141217084030.GA22434@corelatus.se> Message-ID: <0F263FA9-D851-40AC-AFBF-6F4290EEFA39@gmail.com> Hello, Erlang demands some memory on embedded system but you can run decent applications on some HW platforms. I think the lowest grade HW is Raspberry PI B Model with 512MB RAM (I?ve not touched HW with lower memory). I am successfully running OTP 17.3 with web server that proxies requests to serial port. This is not a faster solution available on the globe but it address my immediate needs as fault tolerant HW controller. I?ve made some benchmark for you with 8 concurrent load source that sends HTTP POST request to web server over Wi-Fi, the payload is 1KB. The server handles 75 RPS on average, the memory consumption peaks to 24MB. Mean response latency is 250ms but 95th percentile goes to 500ms. However, the single load source with same traffic pattern shows different results. The benchmark driver generates about 50 RPS on average, mean response latency is less then 100ms, 99 percent of requests is responded within 250ms. Just starting the shell on 17.3 on Raspberry PI B Model uses about 7 MB but you can reduce it to 4MB with some VM restrictions on number of processes, stack sizes, etc. root@REDACTED:/home/pi# erl Eshell V6.2 (abort with ^G) 1> erlang:memory(). [{total,6596552}, {processes,2404276}, {processes_used,2404216}, {system,4192276}, {atom,146321}, {atom_used,127004}, {binary,344536}, {code,2185825}, {ets,118956}] 2> - Dmitry > On 17 Dec 2014, at 10:40, Matthias Lang wrote: > > On Monday, December 15, Raoul Duke wrote: > >> I see many google hits for things people have done with Erlang >> targeting "embedded" resource constrained systems. But I'm not sure if >> there's like an official build or something for it? > > There is no "official" build for "resource constrained" erlang. > > But cross compilation, which is a hurdle for many embedded systems, has > been part of the official build for years now (it's definitely in R14B03, > probably appeared around R12 or R13) > >> Does everybody hack up their own thing? > > Yes, because different people's embedded systems are quite different. > >> I'm looking at like 256 K RAM (!) > > There's no way you'll get normal Erlang to run in that. > > Just starting the shell on R14B03 on a 32 bit ARM CPU uses about 10 MB. > Older versions of Erlang, e.g. R7, were a bit less hungry, maybe 6 MB. > But 256 K is totally out of reach. > > Here's erlang:memory() on an ARM, for a newly started emulator which > hasn't done anything other than start the shell: > > Erlang R14B03 (erts-5.8.4) [source] [rq:1] [async-threads:0] [kernel-poll:false] > > Eshell V5.8.4 (abort with ^G) > 1> erlang:memory(). > [{total,3488376}, > {processes,679792}, > {processes_used,673232}, > {system,2808584}, > {atom,300553}, > {atom_used,272023}, > {binary,17688}, > {code,1745473}, > {ets,86156}] > > the values are in bytes. (The memory use according to the OS is 10 MB for > that emulator) > > Matt > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From zkessin@REDACTED Wed Dec 17 13:14:57 2014 From: zkessin@REDACTED (Zachary Kessin) Date: Wed, 17 Dec 2014 14:14:57 +0200 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: Message-ID: <549173C1.6060503@gmail.com> As the elixir guys already have hex i think a very useful thing would be for an erlang package tool to be able to use hex packages and vice versa. On the erlang VM we have Erlang, Elixir, LFE, ErlyDTL and a few other languages all of which can generate a .beam file. What I would love to see is a way that I can use a package without caring (much) about which language it was written in. --Zach On 12/16/2014 01:41 PM, Bruce Yinhe wrote: > Hi everyone, > > Industrial Erlang User Group (IEUG) has been working together with the > Erlang/OTP team to investigate and create a package management system > for Erlang/OTP. > > The lack of a package management system for Erlang has been discussed > for a long time in the community. In essence, a straightforward > package management system is believed to take Erlang programming > language a step forward. Multiple tools will appear in the community. > It needs to be supported by a highly visible community behind it. > > > In order to increase the adoption and to result in a tool widely used > in the Erlang ecosystem, we are identifying the most important user > categories and use cases, based on what the majority of the community > want in a package manager. Therefore we would like to invite an open > discussion. > > Now you are welcome to share your thoughts, suggestions or proposals > about an Erlang package manager. It would be great if you could reply > with your motivation, explaining why a feature is necessary to have. > There are some example questions to begin the dicussion with, > including, but not limited to the following. > > * What metadata information should an Erlang package include? > * What functionality do you need in a package manager for Erlang in > order to use it in production? > * What other concerns do you have about an Erlang package management > system? > > Erlang package manager's brief wish list of features: > > * Console interface > * Web interface > * Package Index and Repository > * Fetch, Install and Remove Packages > * Publish packages > * Versioning and Dependency Management > > We are aware of several previous efforts and existing tools that > attempt to achieve the similar goal. We want to look at existing > things, both from Erlang and Elixir, to see if they fit the > requirements. If not, we will then have to make something new, perhaps > as a rewrite of an existing tool. > > The IEUG members are putting together requirements for a package > manager and will work with the community and Ericsson to create a > standard and address any voids which exists in the existing tooling, > funding necessary efforts required. > > Best regards > > Bruce Yinhe > > Erlang Community Manager > Industrial Erlang User Group > community-manager@REDACTED > +46 72 311 43 89 > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From darach@REDACTED Wed Dec 17 13:37:36 2014 From: darach@REDACTED (Darach Ennis) Date: Wed, 17 Dec 2014 12:37:36 +0000 Subject: [erlang-questions] Erlang package manager In-Reply-To: <549173C1.6060503@gmail.com> References: <549173C1.6060503@gmail.com> Message-ID: What Zach said. Elixir have done a wonderful job with Hex/Mix. They work, work well and it would be nice to be able to use other beam based languages where it makes sense with a single package management, build and release (relx) toolchain. The node folk have a good solution with npm. The only mistake there was a notion of 'peer dependencies' which often breaks. Essentially, an organic pattern of defining package plugins to other packages created a 'peer dependency' crosscutting regular package dependencies. This way madness and dependency cycles lies. The convenience was rather inconvenient as cycles can be very hard to break, control unless every version is pinned, and even then you're only a plugin away from a nightmare... We should avoid 'peer dependencies'. "What I would love to see is a way that I can use a package without caring (much) about which (beam based) language it was written in." Zach nails it. I want that too! On Wed, Dec 17, 2014 at 12:14 PM, Zachary Kessin wrote: > > As the elixir guys already have hex i think a very useful thing would be > for an erlang package tool to be able to use hex packages and vice versa. > > On the erlang VM we have Erlang, Elixir, LFE, ErlyDTL and a few other > languages all of which can generate a .beam file. What I would love to see > is a way that I can use a package > without caring (much) about which language it was written in. > > --Zach > > On 12/16/2014 01:41 PM, Bruce Yinhe wrote: > > Hi everyone, > > Industrial Erlang User Group (IEUG) has been working together with the > Erlang/OTP team to investigate and create a package management system for > Erlang/OTP. > > The lack of a package management system for Erlang has been discussed > for a long time in the community. In essence, a straightforward package > management system is believed to take Erlang programming language a step > forward. Multiple tools will appear in the community. It needs to be > supported by a highly visible community behind it. > > In order to increase the adoption and to result in a tool widely used in > the Erlang ecosystem, we are identifying the most important user categories > and use cases, based on what the majority of the community want in a > package manager. Therefore we would like to invite an open discussion. > > Now you are welcome to share your thoughts, suggestions or proposals > about an Erlang package manager. It would be great if you could reply with > your motivation, explaining why a feature is necessary to have. There are > some example questions to begin the dicussion with, including, but not > limited to the following. > > - What metadata information should an Erlang package include? > - What functionality do you need in a package manager for Erlang in > order to use it in production? > - What other concerns do you have about an Erlang package management > system? > > Erlang package manager's brief wish list of features: > > - Console interface > - Web interface > - Package Index and Repository > - Fetch, Install and Remove Packages > - Publish packages > - Versioning and Dependency Management > > We are aware of several previous efforts and existing tools that attempt > to achieve the similar goal. We want to look at existing things, both from > Erlang and Elixir, to see if they fit the requirements. If not, we will > then have to make something new, perhaps as a rewrite of an existing tool. > > The IEUG members are putting together requirements for a package manager > and will work with the community and Ericsson to create a standard and > address any voids which exists in the existing tooling, funding necessary > efforts required. > > Best regards > > Bruce Yinhe > > Erlang Community Manager > Industrial Erlang User Group > community-manager@REDACTED > +46 72 311 43 89 > > > _______________________________________________ > 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 kenji@REDACTED Wed Dec 17 14:20:51 2014 From: kenji@REDACTED (Kenji Rikitake) Date: Wed, 17 Dec 2014 22:20:51 +0900 Subject: [erlang-questions] Erlang package manager In-Reply-To: <549173C1.6060503@gmail.com> References: <549173C1.6060503@gmail.com> Message-ID: <20141217132051.GA38880@k2r.org> Hex.pm looks practical to me too (even for an Erlang user). Kenji Rikitake ++> Zachary Kessin [2014-12-17 14:14:57 +0200]: > As the elixir guys already have hex i think a very useful thing would be > for an erlang package tool to be able to use hex packages and vice versa. From kenji@REDACTED Wed Dec 17 14:25:59 2014 From: kenji@REDACTED (Kenji Rikitake) Date: Wed, 17 Dec 2014 22:25:59 +0900 Subject: [erlang-questions] Erlang package manager In-Reply-To: <54908426.4000506@gmail.com> References: <54908426.4000506@gmail.com> Message-ID: <20141217132559.GA38975@k2r.org> +1 for Michael, especially the following three points. I suggest you to learn from what FreeBSD Ports (not necessarily "pkg") do. (See http://www.freshports.org/ ) Kenji Rikitake ++> Michael Truog [2014-12-16 11:12:38 -0800]: > 1) It needs to be simple, allowing you to publish a package within less than 1 hour of usage. Good examples are https://hex.pm/ for elixir, https://pypi.python.org/pypi for python, https://rubygems.org/ for ruby, https://www.npmjs.com/ for node.js. Bad examples are http://search.maven.org/ for java, http://www.cpan.org/ for perl. Maven is probably the best example of what is worst, due to the process being as complex as possible and taking as long as possible. The goal of the package manager is not to earn more consulting money (I hope), i.e., consultant-ware. > 2) It needs to use source code in the packages, not binaries, to make sure everything is transparent, avoiding black-box binary blobs which lack any ability to be examined easily. Past erlang package managers have had trouble here. Along with this, there needs to be signing of the package for the identity of the publisher and the integrity of the package. > 3) We don't need package dictators which attempt to decide what packages are important, since that just limits the size of the community, making this less of an open source effort (unless that is the goal). You will notice the large open source communities don't need to do this. From mononcqc@REDACTED Wed Dec 17 14:26:29 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 17 Dec 2014 08:26:29 -0500 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> <549095FF.5030900@ninenines.eu> <54909FF9.2070509@ninenines.eu> <1418775488.862817.203765265.5E4252E8@webmail.messagingengine.com> <54914387.6030307@ninenines.eu> Message-ID: <20141217132627.GQ84549@ferdair.local> For ERL_LIBS the distinction is that the paths are dynamically added at strat time (unless you used a release's boot file that set the paths for you). In ERL_LIBS, Erlang will automatically pick the newest version of any library it sees and load that as a path. Older copies are more or less just sitting there, not used. So using a mechanism where you set all libs in a kind of global directory forces you to either always use the bleeding edge (no matter which Erlang version it was compiled for), or to adapt your paths in every single one of your commands (erl, dialyzer, ct_run, typer, ...) to use a consistent set of `-pa's and `-pz's in order to give you reasonable results. I can't help but feel I'd just have an easier time using deps local to each project, specifically since I can go and edit them if I feel like tweaking projects. For what it's worth, rebar3 introduces a '_checkouts' directory where you can symlink stuff that would usually be in `_build/lib` (where deps live) so that they get recompiled all the time if you end up working and editing them and avoids crushing them by treating them as static dependencies, whereas the other deps just get ignored after they've been compiled once. See https://github.com/rebar/rebar3/blob/2ba2002a80e29aaf6b295ad8cf4856c4a142920b/doc/guide.md#checkout-dependencies for details. Regards, Fred. On 12/17, Vlad Dumitrescu wrote: > On Wed, Dec 17, 2014 at 9:49 AM, Lo?c Hoguin wrote: > > > > > > I am not even sure how -pa or ERL_LIBS work when you have both app-1 and > > app-2 in your lib directory. Which one does it choose? Will it choose the > > right version when I want to start a shell for experimenting? I have not > > seen anything that allows me to choose what version to run outside of > > making a release/upgrade. > > > The code path is searched in order, that's why we have both -pa and -pz. Of > course, when a module has been loaded, even if the code path changes > afterwards, it is not reloaded automatically. > > regards, > Vlad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From zkessin@REDACTED Wed Dec 17 14:28:35 2014 From: zkessin@REDACTED (Zachary Kessin) Date: Wed, 17 Dec 2014 15:28:35 +0200 Subject: [erlang-questions] Erlang package manager In-Reply-To: <54908426.4000506@gmail.com> References: <54908426.4000506@gmail.com> Message-ID: <54918503.9010808@gmail.com> On 12/16/2014 09:12 PM, Michael Truog wrote: > 2) It needs to use source code in the packages, not binaries, to make > sure everything is transparent, avoiding black-box binary blobs which > lack any ability to be examined easily. Past erlang package managers > have had trouble here. Along with this, there needs to be signing of > the package for the identity of the publisher and the integrity of the > package. I would like to see the option of source, binary or both for packages, I would in general prefer source, but there may be cases when someone wants to put out a binary only package for some reason, and it should support that --Zach From kenji@REDACTED Wed Dec 17 14:35:16 2014 From: kenji@REDACTED (Kenji Rikitake) Date: Wed, 17 Dec 2014 22:35:16 +0900 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: Message-ID: <20141217133516.GA39049@k2r.org> ++> Bruce Yinhe [2014-12-16 12:41:19 +0100]: > - Web interface Command line tools *first* please. Web I/F is something you can build upon the decent command line tools. My JPY2 worth, Kenji Rikitake From zkessin@REDACTED Wed Dec 17 14:38:18 2014 From: zkessin@REDACTED (Zachary Kessin) Date: Wed, 17 Dec 2014 15:38:18 +0200 Subject: [erlang-questions] Build tools Message-ID: <5491874A.4090704@gmail.com> it is a good thing for all of us that the Erlang eco system is growing! The problem is that this means that we have more and more options for building packages. As an application developer If I find a package I want to use that is written in LFE or Elixir (or whatever new beam language comes out in 2016) I would like to be able to use it without having to figure out a new tool. Since we don't want 1 tool to know how to build everything because that turns into a nighmare for whomever has to maintain that tool what we should have is a standard way for a tool to look at a directory and know how to build it. That way Mix and Rebar (and any other tool) can simply delegate out building to the correct tool. If a tool find a package that it does not otherwise know how to build it should have some standard way to invoke a build I see that there are a few options for this 1) Use a makefile, even if it is a very simple makefile that simply has an "all" target that calls mix or rebar 2) have a standard script say ".erl_build" which can be a bash script that will invoke the actual build tool Mostly I want this to be simple for both package maintainers, and for tool builders. --Zach From zkessin@REDACTED Wed Dec 17 14:39:45 2014 From: zkessin@REDACTED (Zachary Kessin) Date: Wed, 17 Dec 2014 15:39:45 +0200 Subject: [erlang-questions] Erlang package manager In-Reply-To: <20141217133516.GA39049@k2r.org> References: <20141217133516.GA39049@k2r.org> Message-ID: <549187A1.9070804@gmail.com> I agree, If I can't put it in a .travis.yml config its useless --Zach On 12/17/2014 03:35 PM, Kenji Rikitake wrote: > ++> Bruce Yinhe [2014-12-16 12:41:19 +0100]: >> - Web interface > Command line tools *first* please. Web I/F is something you can build > upon the decent command line tools. > > My JPY2 worth, > Kenji Rikitake > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From essen@REDACTED Wed Dec 17 15:59:48 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 17 Dec 2014 16:59:48 +0200 Subject: [erlang-questions] Build tools In-Reply-To: <5491874A.4090704@gmail.com> References: <5491874A.4090704@gmail.com> Message-ID: <54919A64.7090106@ninenines.eu> On 12/17/2014 03:38 PM, Zachary Kessin wrote: > 1) Use a makefile, even if it is a very simple makefile that simply has > an "all" target that calls mix or rebar This is what erlang.mk does. It does not care that the dep is written in Erlang, LFE, or even that it is an Erlang related project. It'll work even if the dep is a set of JS libs that are minified, or a library written in C... It just runs "make" on the dep. Do note that it does not need an "all" target but rather that the result of running "make" on that Makefile only builds the project (this is expected behavior of a Makefile). The main target can have any name, it does not have to be named "all". Using a Makefile like this also solves the issue that rebar currently has in that projects are tested against a version of rebar (often included in the repository) and then that version of rebar is ignored when building because the top-level rebar builds everything. This means that if the top-level rebar has a regression (or an unfortunate "fix") your project may not build when used as a dep. The side effect of doing it this way for rebar however is that rebar becomes even slower than it already is as you now have to start the Erlang VM and rebar many times and this takes a lot of time. Note that I say rebar here, because it's what I used in the past, but it probably applies to similar tools in the other languages. -- Lo?c Hoguin http://ninenines.eu From t@REDACTED Wed Dec 17 16:05:07 2014 From: t@REDACTED (Tristan Sloughter) Date: Wed, 17 Dec 2014 09:05:07 -0600 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> <549095FF.5030900@ninenines.eu> <54909FF9.2070509@ninenines.eu> <1418775488.862817.203765265.5E4252E8@webmail.messagingengine.com> Message-ID: <1418828707.1114479.204012397.37E87A60@webmail.messagingengine.com> You define it to rely on 5. rebar3 will then warn you about all other version that are not used. Assume this app you are talking about is a dep of the project you are working on and another version of it is chosen because of another dep depending on it, lets say 6, you then must define at the top level rebar.config that you want 5 (or 3). Leaving it up to the user. -- Tristan Sloughter t@REDACTED On Tue, Dec 16, 2014, at 11:09 PM, Benoit Chesneau wrote: > > > On Wed, Dec 17, 2014 at 1:18 AM, Tristan Sloughter > wrote: >> I'm just throwing my thoughts out there. This isn't to cover all >> features I'd want to see in a package manager, but instead just the ones >> I know are "controversial". These are also the direction we've gone with >> rebar3 (http://rebar3.org). >> >> * Binary packages >> >> Why build from source if you don't need to? Most Erlang applications >> have no native code. >> >> * No semver enforcement >> >> I mean, why bother? For one, you can't actually force semantic >> versioning. You can require the version be of the format >> MAJOR.MINOR.PATCH+[metadata] but not the semantic part. >> >> I think forcing the format in the name of "semver" is confusing and >> wrong. >> >> * Strict version declarations >> >> No ">=1.0" or "<1.0 and >0.5". The project should set a version number >> of the dependency it relies on. >> >> "Solving" dependencies is a matter of choosing the highest version of a >> dep in the dependency tree. This is also followed by maven, >> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html > > > What if you want to support a package from version 3 to 5 but not 6 > neither 1 or 2 due breaking changes in the API? -------------- next part -------------- An HTML attachment was scrubbed... URL: From co7eb@REDACTED Wed Dec 17 16:07:12 2014 From: co7eb@REDACTED (Gilberio Carmenates Garcia) Date: Wed, 17 Dec 2014 10:07:12 -0500 (CST) Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: Message-ID: <9974201.369327.1418828831998.JavaMail.root@frcuba.co.cu> Hi everyone, I like Erlang without a return statement, it is more clean and beautiful, despite, the fact that you can elegantly treat a return case the same as a non-return case by simply returning always whatever you want of implicit manner. it is not the same writing: return pass or none. than just pass or none foo()-> pass; foo(1) -> return (pass); // weird right ? foo(X)-> X * 2; in Erlang all methods are functions so they obligatory have to always return, being implicit or explicit they always need to return something. Because if not, you break the standards rules of functional programming. and make a nasty mix of paradigms. Regards, Ivan. ----- Mensaje original ----- De: Joe Armstrong Para: Viktor S?derqvist CC: Erlang Enviado: Wed, 17 Dec 2014 04:20:15 -0500 (CST) Asunto: Re: [erlang-questions] Why doesn't Erlang has return statement? The question was : Why doesn't Erlang have a return statement I can let you into a secret - the first version of Erlang *did* have a return statement return was written ^Expression. Something like: foo() -> a,b,^c. Erlang with a return statement would look something like: foo() -> a, b, return(c). Here's some little fragments of code with returns foo(X) -> case g(X) of pattern1 -> a(), b, return(c); pattern2 -> do,de,dar, return(z) end. Now what would happen if all the branches in the case clause didn't do a return? We could write: foo(X) -> case g(X) of pattern1 -> a(), b, return(c); pattern2 -> do,de,dar, return(z); pattern3 -> Y = h(H), P = z(Y) end, foo(), return(P). Which kind of sucks - case is now NOT a function with a return value it's something that either returns a value OR binds some variables whose values escape from the case construction. In this case P escapes so we can use it after the case construct. This is a bit messy so we might rewrite it like this foo(X) -> P = case g(X) of pattern1 -> a(), b, return(c); pattern2 -> do,de,dar, return(z); pattern3 -> Y = h(H), z(Y) end, foo(), return(P). Again case is "funny" - from a flow of control point of view it can either a) return to the caller or b) carry on executing *after* the end statement. This actually makes it difficult to understand. It's really easy to "see" this in the small example above - but if the case statement had dozens of branches and one of them had a return in and all the others didn't this would be very difficult to spot. Now there are actually two methods for making an abrupt return from a function - exit(Expr) and throw(Expr). Both are in a sense "returns" (note the quotes). exit is for an abnormal return - throw is used to break out of computation, ie to return a value to some grand parent of the called function. In the absence of return(X) you can write throw(X) but this can make your programs more difficult to understand if abused. Cheers /Joe On Tue, Dec 16, 2014 at 11:58 PM, Viktor S?derqvist wrote: > On 2014-12-16 09.05, aman mangal wrote: > > Moreover, is there a good alternate to avoid nested case statements? > > One way is to avoid them is actually not to write them. Especially if the > cases are error handling, handle only the expected case and let everything > else crash. > > When I'm parsing some input or structure and want to return {ok, Value} or > 'error' instead of crashing, I often wrap that code in a try-catch. This is > only when dealing with untrusted input and similar situations. > > parse_foo_url(URL) -> > case http_uri:parse(URL) of > {ok, {_, _, _, _, Path, _}} -> > case re:split(Path, "/", [{return, list}]) of > ["", "foo", Foo] -> > try list_to_integer(Foo) of > FooInt -> {ok, FooInt} > catch error:_ -> > error > end; > _BadPath -> > error > end; > _BadUri -> > error; > end. > > ----> > > parse_foo_url(URL) -> > try > {ok, {_, _, _, _, Path, _}} = http_uri:parse(URL), > ["", "foo", Foo] = re:split(Path, "/", [{return, list}]), > FooInt = list_to_integer(Foo), > {ok, FooInt} > catch error:_ -> > error > end. > > Using catch statement seems another good alternate but my intuition is that > it is not good practice, is it? > > In the above example I dare to say it's not bad practice. Just don't overuse > try-catch so that it becomes defensive programming and make sure you don't > put any other code inside the try-catch so that you accidentally catch > totally unrelated errors. > > Viktor > > _______________________________________________ > 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 mattevans123@REDACTED Wed Dec 17 17:26:48 2014 From: mattevans123@REDACTED (Matthew Evans) Date: Wed, 17 Dec 2014 11:26:48 -0500 Subject: [erlang-questions] gen_fsm timer getting canceled/never firing Message-ID: Hi Group, We have just hit a case when we set a timeout on a gen_fsm Module:StateName function. e.g: wait_handle_commit_ok({process_commit_ok,TransactionId}, State) -> %% Stuff {next_state, wait_handle_commit_ok, State?WAIT_COMMIT_OK_TIME_LONG}; The timeout is 2 seconds (2000). In this case the timeout never fired. This code is heavily logged and the fsm appeared to not get any other message during this 2 second period. Unless Erlang will send a handle_event / handle_info for fun. The only thing in the log at the same time is this: =ERROR REPORT==== 16-Dec-2014::09:39:44 ===** Node node@REDACTED not responding **** Removing (timedout) connection ** Is it possible that timers could get canceled for some unknown reason? I should add that this code has been running for a few years without seeing this before. Cheers Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Wed Dec 17 17:44:40 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 17 Dec 2014 17:44:40 +0100 Subject: [erlang-questions] gen_fsm timer getting canceled/never firing In-Reply-To: References: Message-ID: On Wed, Dec 17, 2014 at 5:26 PM, Matthew Evans wrote: > > Is it possible that timers could get canceled for some unknown reason? Such a timer is cancelled if *any* message arrives or another event happens. The callback timeouts only trigger if no other event happens in the window. For a more surefire way, see gen_fsm:start_timer/2 which runs on the internal erlang timer and doesn't have this problem. You often see the call-back timers missed due to someone altering the FSMs behaviour in a way such that it does not trigger. Or if the system suddenly experiences more load so the timers won't trigger anymore. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattevans123@REDACTED Wed Dec 17 18:11:03 2014 From: mattevans123@REDACTED (Matthew Evans) Date: Wed, 17 Dec 2014 12:11:03 -0500 Subject: [erlang-questions] gen_fsm timer getting canceled/never firing In-Reply-To: References: , Message-ID: Right, as I said we don't protect handle_info or handle_event in this case (i.e. we don't restart the timer). However, I am fairly certain that nothing is sending an event that would cause these callback functions to get called. The only odd thing I see is the : =ERROR REPORT==== 16-Dec-2014::09:39:44 ===** Node node@REDACTED not responding **** Removing (timedout) connection ** Between when the timer was set and it should've been called. But I will add the timeout to handle_info/handle_event anyway. From: jesper.louis.andersen@REDACTED Date: Wed, 17 Dec 2014 17:44:40 +0100 Subject: Re: [erlang-questions] gen_fsm timer getting canceled/never firing To: mattevans123@REDACTED CC: erlang-questions@REDACTED On Wed, Dec 17, 2014 at 5:26 PM, Matthew Evans wrote:Is it possible that timers could get canceled for some unknown reason? Such a timer is cancelled if *any* message arrives or another event happens. The callback timeouts only trigger if no other event happens in the window. For a more surefire way, see gen_fsm:start_timer/2 which runs on the internal erlang timer and doesn't have this problem. You often see the call-back timers missed due to someone altering the FSMs behaviour in a way such that it does not trigger. Or if the system suddenly experiences more load so the timers won't trigger anymore. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean@REDACTED Wed Dec 17 18:45:52 2014 From: sean@REDACTED (Sean Cribbs) Date: Wed, 17 Dec 2014 11:45:52 -0600 Subject: [erlang-questions] [CFP] PaPoC Workshop, colocated with EuroSys 2015 Message-ID: Many distributed applications today need low-latency, scalability, high availability, and geo-replication. The well-known tradeoff between Consistency, Availability, and Partition Tolerance (and low latency) led to the development of weakly consistent data stores, whose success made clear that ?one size does not fit all? when it comes to consistency. Designing correct applications using weakly consistent shared data, however, is a challenging task. The PaPoC workshop will bring forth ideas on how to use, specify, and implement consistency semantics ranging from weaker to stronger models. It will bring together academic researchers, industrial researchers, and practitioners coming from different fields: distributed algorithms, distributed systems, databases, programming languages, and verification. Each of these fields has attacked the problem of consistency from a different angle and there is ample opportunity for synergies. PaPoC is the direct successor of the EuroSys 2014 Workshop on Principles and Practice of Eventual Consistency, which was attended by approximately 40 researchers from the above fields. Submissions should be short papers (2 pages or more) on cutting-edge work, even if ongoing, or vision papers. Accepted papers will be published in ACM Digital Library only upon the request of the authors. Examples of relevant discussion topics include: * Design principles, correctness conditions, and programming patterns for scalable distributed data systems. * Techniques for weak consistency: session guarantees, causal consistency, operational transformation, conflict-free replicated data types, monotonic programming, state merge, commutativity, etc. * Consistency vs. performance and scalability trade-offs: guiding developers, controlling the system. * Analysis and verification of weakly consistent programs. * Strengthening guarantees of weakly consistent system: transactions, fault tolerance, security, ensuring invariants, bounding metadata size, and controlling divergence. * Platform guarantees vs. application involvement: guiding developers, controlling the system. More information about the conference can be found in the conference website http://papoc.di.uminho.pt *** IMPORTANT DATES *** Paper submission: February 10, 2015 Authors notification: March 6, 2015 Workshop: April 21, 2015 (in Bordeaux, France - colocated with Eurosys 2015) *** ORGANIZATION *** Program Chairs * Carlos Baquero (INESC TEC & University of Minho, Portugal) * Marco Serafini (Qatar Computing Research Institute, Qatar) Program Committee * Peter Alvaro (UC Berkeley, USA) * Sebastian Burckhardt (Microsoft Research, USA) * Sean Cribbs (Basho Technologies Inc., USA) * Wojciech Golab (University of Waterloo, Canada) * Rachid Guerraoui (?cole Polytechnique F?d?rale de Lausanne, Switzerland) * Lindsey Kuper (Intel Labs, USA) * Rune Skou Larsen (Trifork, Denmark) * Fernando Pedone (University of Lugano (USI), Switzerland) * Rodrigo Rodrigues (NOVA-LINCS & NOVA University of Lisbon, Portugal) * Kapil Vaswani (Microsoft Research, India) Steering Committee * Peter Bailis (UC Berkeley, USA) * Alexey Gotsman (IMDEA Software, Spain) * Nuno Preguic?a (NOVA-LINCS & NOVA University of Lisbon, Portugal) * Marc Shapiro (INRIA & LIP6, France) * Justin Sheehy (VMware Inc., USA) -- Sean Cribbs Sr. Software Engineer Basho Technologies, Inc. http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Wed Dec 17 20:37:15 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 17 Dec 2014 21:37:15 +0200 Subject: [erlang-questions] Erlang occasionally hangs at startup Message-ID: <5491DB6B.8010803@ninenines.eu> Hello, I see occasional hangs when starting the Erlang VM ("erl", regardless of options). It seems to occur only on some networks (seen it happen in a few hotels and seeing it in the appartment I rent here now; though it didn't happen a few weeks ago in the same place). I never see it at home though. This is with 17.3.4, though I have seen it with 17.1 and also with versions before 17. The hang is just before Erlang starts printing things in the shell. "strace erl" prints a lot of things until: write(6, "\0", 1) = 1 select(0, NULL, NULL, NULL, NULL Then it hangs, then it prints the shell stuff: Erlang/OTP 17 [erts-6.2.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.2.1 (abort with ^G) 1> According to the manual this select call waits until it receives a signal. Not sure what the signal it expects is or if it even hangs *there* though. My strace skills are pretty weak, especially with threaded programs, so I'm most likely missing something. Note that I can Ctrl+C and get the menu just fine while it hangs. Not Ctrl+G though (as expected, since the shell isn't started yet). Has anyone seen this before or knows how I can investigate this issue further? -- Lo?c Hoguin http://ninenines.eu From tuncer.ayaz@REDACTED Wed Dec 17 21:39:10 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 17 Dec 2014 21:39:10 +0100 Subject: [erlang-questions] Erlang occasionally hangs at startup In-Reply-To: <5491DB6B.8010803@ninenines.eu> References: <5491DB6B.8010803@ninenines.eu> Message-ID: On Wed, Dec 17, 2014 at 8:37 PM, Loic Hoguin wrote: > Hello, > > I see occasional hangs when starting the Erlang VM ("erl", > regardless of options). It seems to occur only on some networks > (seen it happen in a few hotels and seeing it in the appartment I > rent here now; though it didn't happen a few weeks ago in the same > place). I never see it at home though. > > This is with 17.3.4, though I have seen it with 17.1 and also with > versions before 17. Is it correct to assume that you're mentioning the locations with regards to the local wired/wireless network? If so, have you tried different ~/.erl_inetrc settings? > The hang is just before Erlang starts printing things in the shell. > > "strace erl" prints a lot of things until: > > write(6, "\0", 1) = 1 > select(0, NULL, NULL, NULL, NULL > > Then it hangs, then it prints the shell stuff: > > Erlang/OTP 17 [erts-6.2.1] [source] [64-bit] [smp:4:4] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V6.2.1 (abort with ^G) > 1> > > According to the manual this select call waits until it receives a > signal. Not sure what the signal it expects is or if it even hangs > *there* though. My strace skills are pretty weak, especially with > threaded programs, so I'm most likely missing something. > > Note that I can Ctrl+C and get the menu just fine while it hangs. > Not Ctrl+G though (as expected, since the shell isn't started yet). > > Has anyone seen this before or knows how I can investigate this > issue further? If tracing the release VM does not reveal anything informative, then I'd suggest to try a debug build, but that might of course hide the issue, though my gut feeling is that your problem is not of that sort. From essen@REDACTED Wed Dec 17 21:47:24 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 17 Dec 2014 22:47:24 +0200 Subject: [erlang-questions] Erlang occasionally hangs at startup In-Reply-To: References: <5491DB6B.8010803@ninenines.eu> Message-ID: <5491EBDC.4040706@ninenines.eu> On 12/17/2014 10:39 PM, Tuncer Ayaz wrote: > On Wed, Dec 17, 2014 at 8:37 PM, Loic Hoguin wrote: >> Hello, >> >> I see occasional hangs when starting the Erlang VM ("erl", >> regardless of options). It seems to occur only on some networks >> (seen it happen in a few hotels and seeing it in the appartment I >> rent here now; though it didn't happen a few weeks ago in the same >> place). I never see it at home though. >> >> This is with 17.3.4, though I have seen it with 17.1 and also with >> versions before 17. > > Is it correct to assume that you're mentioning the locations with > regards to the local wired/wireless network? > > If so, have you tried different ~/.erl_inetrc settings? It's always wireless IIRC. I will look into that file, I was not aware of its existence. > If tracing the release VM does not reveal anything informative, then > I'd suggest to try a debug build, but that might of course hide the > issue, though my gut feeling is that your problem is not of that > sort. I will try that tomorrow. Thanks. -- Lo?c Hoguin http://ninenines.eu From garazdawi@REDACTED Wed Dec 17 21:55:57 2014 From: garazdawi@REDACTED (Lukas Larsson) Date: Wed, 17 Dec 2014 21:55:57 +0100 Subject: [erlang-questions] Erlang occasionally hangs at startup In-Reply-To: <5491DB6B.8010803@ninenines.eu> References: <5491DB6B.8010803@ninenines.eu> Message-ID: On Wed, Dec 17, 2014 at 8:37 PM, Lo?c Hoguin wrote: > Hello, > > "strace erl" prints a lot of things until: > > write(6, "\0", 1) = 1 > select(0, NULL, NULL, NULL, NULL > > This part is most likely this: https://github.com/erlang/otp/blob/maint/erts/emulator/sys/unix/sys.c#L3060-L3089 The initial thread is always put in an eternal select, so this is normal behaviour. Don't know what could be causing the emulator to hang. If you think/suspect that it is the emulator that hangs, then attach to the pid with gdb and do a "threads apply all bt full" and check if any threads sit in something that is not expected. I doubt that is something in the emulator though. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Wed Dec 17 21:56:33 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 17 Dec 2014 21:56:33 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <20141217132627.GQ84549@ferdair.local> References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> <549095FF.5030900@ninenines.eu> <54909FF9.2070509@ninenines.eu> <1418775488.862817.203765265.5E4252E8@webmail.messagingengine.com> <54914387.6030307@ninenines.eu> <20141217132627.GQ84549@ferdair.local> Message-ID: On Wed, Dec 17, 2014 at 2:26 PM, Fred Hebert wrote: > For ERL_LIBS the distinction is that the paths are dynamically added > at strat time (unless you used a release's boot file that set the > paths for you). In ERL_LIBS, Erlang will automatically pick the > newest version of any library it sees and load that as a path. > > Older copies are more or less just sitting there, not used. > > So using a mechanism where you set all libs in a kind of global > directory forces you to either always use the bleeding edge (no > matter which Erlang version it was compiled for), or to adapt your > paths in every single one of your commands (erl, dialyzer, ct_run, > typer, ...) to use a consistent set of `-pa's and `-pz's in order to > give you reasonable results. > > I can't help but feel I'd just have an easier time using deps local > to each project, specifically since I can go and edit them if I feel > like tweaking projects. I guess I should have expanded in the section titled 'extra notes' in [1], so here it goes. The loader changes and .app extensions should go hand in hand. That means, ERL_LIBS may very well contain multiple versions of an app where the version constraint in the .app file is used to select the right one to use as in releases. Of course, this is not as simple as it sounds and might require further changes, but I think it's clear that one instance of the VM shouldn't have to deal with simultaneously using different versions of the same app. Therefore, I don't think it's as complicated as it might seem at first. [1] http://erlang.org/pipermail/erlang-questions/2014-December/082132.html From tuncer.ayaz@REDACTED Wed Dec 17 22:08:03 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 17 Dec 2014 22:08:03 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <20141217132051.GA38880@k2r.org> References: <549173C1.6060503@gmail.com> <20141217132051.GA38880@k2r.org> Message-ID: On Wed, Dec 17, 2014 at 2:20 PM, Kenji Rikitake wrote: > Hex.pm looks practical to me too (even for an Erlang user). I haven't used Hex, but it's important to not limit ourselves to existing solutions but figure out the right .app extensions and loader changes first. To be clear, when I say 'loader' I mean the code loader, code server, and any related subsystem. Once that's done, Hex can or should build on it. What I'm trying to say is that we need to extend/adapt the OTP underpinnings first. That's why I had planned to .ez-ify all apps in 18.0 and fix any lurking bugs. > Kenji Rikitake > > ++> Zachary Kessin [2014-12-17 14:14:57 +0200]: > > As the elixir guys already have hex i think a very useful thing > > would be for an erlang package tool to be able to use hex packages > > and vice versa. From imantc@REDACTED Wed Dec 17 22:17:42 2014 From: imantc@REDACTED (Imants Cekusins) Date: Wed, 17 Dec 2014 22:17:42 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <549022CC.9000205@ninenines.eu> <54902B16.3010204@ninenines.eu> <549095FF.5030900@ninenines.eu> <54909FF9.2070509@ninenines.eu> <1418775488.862817.203765265.5E4252E8@webmail.messagingengine.com> <54914387.6030307@ninenines.eu> <20141217132627.GQ84549@ferdair.local> Message-ID: A central repository with unambiguous version-ing (one version -> single package archive) would be very useful. This way, once you know the required package & version, the quest would be over. From essen@REDACTED Wed Dec 17 22:18:43 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 17 Dec 2014 23:18:43 +0200 Subject: [erlang-questions] Erlang occasionally hangs at startup In-Reply-To: References: <5491DB6B.8010803@ninenines.eu> Message-ID: <5491F333.1060601@ninenines.eu> On 12/17/2014 10:39 PM, Tuncer Ayaz wrote: > On Wed, Dec 17, 2014 at 8:37 PM, Loic Hoguin wrote: >> Hello, >> >> I see occasional hangs when starting the Erlang VM ("erl", >> regardless of options). It seems to occur only on some networks >> (seen it happen in a few hotels and seeing it in the appartment I >> rent here now; though it didn't happen a few weeks ago in the same >> place). I never see it at home though. >> >> This is with 17.3.4, though I have seen it with 17.1 and also with >> versions before 17. > > Is it correct to assume that you're mentioning the locations with > regards to the local wired/wireless network? > > If so, have you tried different ~/.erl_inetrc settings? OK while reading about this file I remembered a similar issue I had with Opera in the past, where the fix was to disable IPv6. IPv6 was already disabled on my system globally, but this apparently doesn't prevent individual programs from trying to use it, and I just found that my local DNS server had it enabled. Disabling it there made "erl" not hang at startup anymore. Thanks for the help! -- Lo?c Hoguin http://ninenines.eu From max.lapshin@REDACTED Wed Dec 17 22:34:04 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 18 Dec 2014 01:34:04 +0400 Subject: [erlang-questions] Erlang occasionally hangs at startup In-Reply-To: <5491EBDC.4040706@ninenines.eu> References: <5491DB6B.8010803@ninenines.eu> <5491EBDC.4040706@ninenines.eu> Message-ID: I suppose that it looks like DNS that causes a problem. For example, problem may be in trying to resolve local hostname synchronously. Try to look at hostname during such hang and try to ping it. About strace: use strace -f to look at all forks -------------- next part -------------- An HTML attachment was scrubbed... URL: From puzza007@REDACTED Wed Dec 17 22:52:29 2014 From: puzza007@REDACTED (Paul Oliver) Date: Wed, 17 Dec 2014 21:52:29 +0000 Subject: [erlang-questions] Why doesn't Erlang has return statement? References: <09BB764D-FC16-4C0A-80E6-BDF5EC520F95@cs.otago.ac.nz> <1AF718E0-2432-4B1C-898D-AE92CB5FC7DB@cooperi.net> Message-ID: On Wed Dec 17 2014 at 02:07:20 Alex Wilson wrote: > > > On 17 Dec 2014, at 10:31 am, aman mangal wrote: > > > > > Moreover, is there a good alternate to avoid nested case statements? > > > > Why avoid them? Give a *real* example where nested case expressions > > (not ?statements?, Erlang doesn?t strictly speaking *have* ?statements?) > > are a problem. > > > > When I am using pattern matching, I wonder what if the function returned > something else. More specifically the return could be {ok, Result} | > {error, Reason}. This can happen in a sequence of statements and I end up > using nested case expressions or calling one functions after another to > handle both the cases separately. > > > > You could consider something like a monad, perhaps. I know "monad" is a > horrible functional programming word that makes people go "OMG THAT'S TOO > HARD", but it's a pretty clean way to deal with errors sometimes. > > https://github.com/rabbitmq/erlando#do has an example of implementing > do-notation for monads in Erlang using a parse-transform. The error monad > example is kind of interesting. > > You can do the same thing without the parse-transform by having a function > like this one: > > threaduntil([], Acc) -> Acc; > threaduntil([Fun | Rest], Acc) -> > case Fun(Acc) of > {error, E} -> {error, E}; > Acc1 -> threaduntil(Rest, Acc1) > end. > > So you call this with a list of funs, and whatever the output from one fun > is, becomes the argument to the next one on the list, until either it > reaches the end of the list (and returns the last return value), or one of > the funs returns {error, _} -- then it short-circuits and returns the error > straight away. > > It's not the lowest-overhead thing ever (making all those funs and > executing them), but usually you see this kind of thing when dealing with > i/o or high-level control logic that doesn't have to be the > fastest-executing thing ever. > > I've used this pattern (and the erlando do-transform specifically) quite a > lot to avoid chains of Thing1 = blah(Thing), Thing2 = foo(Thing1), Thing3 = > bar(Thing2)... etc etc, and also to deal with situations where deeply > nested errors need to produce a well-defined return value. I have a > personal distaste for try/catch, so I prefer to choose between either > crashing the process, or using this kind of approach. > Something along similar lines to erlando is https://github.com/ibnfirnas/hope/. If you've used any ocaml you might find it somewhat familiar. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Thu Dec 18 03:40:03 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 18 Dec 2014 15:40:03 +1300 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: <5490B932.8060706@zuiderkwast.se> Message-ID: Let me offer one example of how ?return? can affect things. Suppose I have a function foo(<|args|>) -> <|stuff|>. Now suppose I discover that this is sometimes returning integers and sometimes returning floats, but my life would be easier if it always returned floats. Easy: foo(<|args|>) -> float(( <|stuff|>)). I don?t have to look inside <|stuff|> at all. Any value returned will be caught this way. But in the presence of ?return?, I have to locate each and every ?return? and patch that separately. Yes, I have had to do this kind of thing in C. I am actually quite tired of writing #define safely(e) (void)(<|clean up|>), e macros and changing return e; to return safely(e); and then finding I?ve missed one. This is of course why Lisp provides unwind-protect, which Java copied as try-finally. What is the price of NOT having return? Code duplication in a few rare cases. case E1 of P1 -> .., ^E2 ; P2 -> .., ^E3 ; P3 -> .. ; P4 -> .. end, E5 has to become case E1 of P1 -> .., E2 ; P2 -> .., E3 ; P3 -> .., E5 ; P4 -> .., E5 end A compiler that does cross-jumping optimisation can eliminate the duplication in the BEAM code. If you keep your function bodies small, a little bit of duplication won?t be a problem. (Is Garrett Smith reading this thread?) From sdl.web@REDACTED Thu Dec 18 03:45:42 2014 From: sdl.web@REDACTED (Leo Liu) Date: Thu, 18 Dec 2014 10:45:42 +0800 Subject: [erlang-questions] error_msg and error_report? Message-ID: I am confused why both is needed? they appear to send similar messages to the event manager. I am also confused when to use what? Ideas? Thanks, Leo From g@REDACTED Thu Dec 18 04:45:53 2014 From: g@REDACTED (Garrett Smith) Date: Wed, 17 Dec 2014 21:45:53 -0600 Subject: [erlang-questions] Why doesn't Erlang has return statement? In-Reply-To: References: Message-ID: I agree with Daniel and think he makes a very good point. On Dec 16, 2014 8:52 PM, "Daniel Goertzen" wrote: > I recommend giving Garrett's video below a watch to overcome your fear of > adding more functions. I've always been skeptical of the approach, but I > forced myself to try it and it actually works out really well. > > https://www.youtube.com/watch?v=CQyt9Vlkbis > > On Tue, Dec 16, 2014 at 2:05 AM, aman mangal > wrote: >> >> Hi everyone, >> >> I have seen similar questions before on the forum but I could never >> understand the reason behind it. Is it due to theoretical reasons such as *return >> *statement makes it hard to reason about the program or practical >> reasons that it is hard to implement it (this doesn't seem right but I >> cannot think of anything else)? >> >> Moreover, is there a good alternate to avoid nested case statements? >> Making more functions just seems tedious. Using *catch *statement seems >> another good alternate but my intuition is that it is not good practice, is >> it? >> >> Thank you >> Aman Mangal >> www.prism.gatech.edu/~amangal7 >> >> _______________________________________________ >> 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 zkessin@REDACTED Thu Dec 18 07:58:43 2014 From: zkessin@REDACTED (Zachary Kessin) Date: Thu, 18 Dec 2014 08:58:43 +0200 Subject: [erlang-questions] Why would dialyzer only be using one core Message-ID: <54927B23.20501@gmail.com> I have been using dialyzer on my code base, and one thing I have noticed is that recently it has gotten very slow. When I run top I see that it is only running on 1 CPU core (intel i7 With 8 threads) any idea why this would happen and how to fix it? This is on Fedora 21 with erlang 17.4 --Zach From bengt.kleberg@REDACTED Thu Dec 18 09:55:05 2014 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Thu, 18 Dec 2014 09:55:05 +0100 Subject: [erlang-questions] error_msg and error_report? In-Reply-To: References: Message-ID: <54929669.8070501@ericsson.com> Please see the documentation (http://www.erlang.org/doc/man/error_logger.html): "If called with bad arguments, [error_msg] can crash the standard event handler, meaning no further events are logged. When in doubt, use error_report/1 instead." bengt On 12/18/2014 03:45 AM, Leo Liu wrote: > I am confused why both is needed? they appear to send similar messages > to the event manager. I am also confused when to use what? Ideas? > > Thanks, > Leo > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From sperber@REDACTED Thu Dec 18 09:20:58 2014 From: sperber@REDACTED (Michael Sperber) Date: Thu, 18 Dec 2014 09:20:58 +0100 Subject: [erlang-questions] BOB conference on Jan 23 in Berlin: Early-bird registration ends Friday, Dec 19! Message-ID: BOB features an entire Erlang track! ================================================================ BOB 2015 Conference "What happens if we simply use what's best?" January 23.2015 Berlin http://bobkonf.de/2015/ Program: http://bobkonf.de/2015/programm.html Registration: http://bobkonf.de/2015/registration.html ================================================================ BOB is the conference for developers, architects and decision-makers to explore technologies beyond the mainstream in software development, and to find the best tools available to software developers today. Our goal is for all participants of BOB to return home with new insights that enable them to improve their own software development experiences. The program features 14 talks and 8 tutorials on current topics: http://bobkonf.de/2015/programm.html The subject range of talks includes functional programming, microservices, package management, and data management. The tutorials feature introductions to Erlang, Haskell, Swift, and ClojureScript, and their applications. Anil Madhavapeddy will hold the keynote talk - about unikernels and functional programming. Registration is open online: http://bobkonf.de/2015/registration.html NOTE: The early-bird rates expire on Dec. 19, 2014! BOB cooperates with the :clojured conference on the following day. There is a registration discount available for participants of both events. http://www.clojured.de/ From sdl.web@REDACTED Thu Dec 18 11:41:56 2014 From: sdl.web@REDACTED (Leo Liu) Date: Thu, 18 Dec 2014 18:41:56 +0800 Subject: [erlang-questions] error_msg and error_report? In-Reply-To: <54929669.8070501@ericsson.com> (Bengt Kleberg's message of "Thu, 18 Dec 2014 09:55:05 +0100") References: <54929669.8070501@ericsson.com> Message-ID: On 2014-12-18 16:55 +0800, Bengt Kleberg wrote: > Please see the documentation > (http://www.erlang.org/doc/man/error_logger.html): > > "If called with bad arguments, [error_msg] can crash the standard > event handler, meaning no further events are logged. When in doubt, > use error_report/1 instead." > > > bengt Thanks for the pointer. Also from discussion on #erlang, the _msg function of the pair let users control the format while the _report one doesn't. Leo From james@REDACTED Thu Dec 18 16:32:28 2014 From: james@REDACTED (James Fish) Date: Thu, 18 Dec 2014 15:32:28 +0000 Subject: [erlang-questions] Is it possible to have nested parametrised types when the base type is opaque? Message-ID: Hi all, I am never one to doubt that dialyzer is correct, and I am wrong. In this case I am perplexed by the warning generated with nested parametrised types. For example if a module defines the type: -type myqueue(Item) :: {myqueue, queue:queue({integer(), Item})}. And another module wishes to use myqueue/1: -spec in(integer(), myqueue(integer()) -> myqueue(integer()). Dialyzer will warn that success typing has the second argument and result of the form {myqueue, queue:queue({integer(), any()})}. What is the subtlety that I am missing? You can find two sample modules attached. One module with a parametrised queue and another with a parametrised "parametrised" queue using the first module. Dialyzer has alot of fun with the second module. If queue:queue() was not opaque no warnings are generated and if myqueue:myqueue() is not opaque an extra warning is generated. Thank you, James -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: myqueue.erl Type: text/x-erlang Size: 415 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: myqueue_params.erl Type: text/x-erlang Size: 521 bytes Desc: not available URL: From james@REDACTED Thu Dec 18 16:52:57 2014 From: james@REDACTED (James Fish) Date: Thu, 18 Dec 2014 15:52:57 +0000 Subject: [erlang-questions] Is it possible to have nested parametrised types when the base type is opaque? In-Reply-To: References: Message-ID: I forgot to mention this is on 17.3 and 17.4 (note the queue:queue/1 type in the sample modules). On 18 December 2014 at 15:32, James Fish wrote: > > Hi all, > > I am never one to doubt that dialyzer is correct, and I am wrong. In this > case I am perplexed by the warning generated with nested parametrised > types. For example if a module defines the type: > > -type myqueue(Item) :: {myqueue, queue:queue({integer(), Item})}. > > And another module wishes to use myqueue/1: > > -spec in(integer(), myqueue(integer()) -> myqueue(integer()). > > Dialyzer will warn that success typing has the second argument and result > of the form {myqueue, queue:queue({integer(), any()})}. What is the > subtlety that I am missing? > > You can find two sample modules attached. One module with a parametrised > queue and another with a parametrised "parametrised" queue using the first > module. Dialyzer has alot of fun with the second module. If queue:queue() > was not opaque no warnings are generated and if myqueue:myqueue() is not > opaque an extra warning is generated. > > Thank you, > > James > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Thu Dec 18 18:09:55 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 18 Dec 2014 21:09:55 +0400 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? Message-ID: I've made simple project with erlang.mk and relx.config: {release, {peeklio, "0.1"}, [peeklio]}. {extended_start_script, true}. {include_erts, false}. I compile it under MacOS and copy _rel/... to linux. It doesn't work because crypto library is copied with MacOS .so How should I force relx to make some output that will use erlang from system? -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Thu Dec 18 18:14:35 2014 From: t@REDACTED (Tristan Sloughter) Date: Thu, 18 Dec 2014 11:14:35 -0600 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? In-Reply-To: References: Message-ID: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> You must also set: {system_libs, false}. I've been undecided on making a single config variable that says to not include erts or system libs. Or you can set it to include another erts, which could be compiled for the platform you are deploying to: {include_erts, "/path/to/erts"}. I'm working on documentation as well. Currently it is within the rebar3 project, http://www.rebar3.org/v1.0/docs/releases, but is the same for using relx on its own or with erlang.mk (except that you have to have a relx.config and can't use profiles). But I'll be creating a relx only set of docs similar to these. Tristan On Thu, Dec 18, 2014, at 11:09 AM, Max Lapshin wrote: > > I've made simple project with erlang.mk and relx.config: > > {release, {peeklio, "0.1"}, [peeklio]}. > > {extended_start_script, true}. > > {include_erts, false}. > > > I compile it under MacOS and copy _rel/... to linux. It doesn't work > because crypto library is copied with MacOS .so > > How should I force relx to make some output that will use erlang > from system? > > _________________________________________________ > erlang-questions mailing list erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.nijhof@REDACTED Thu Dec 18 18:29:33 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Thu, 18 Dec 2014 18:29:33 +0100 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? In-Reply-To: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> References: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> Message-ID: Maybe a bit more cumbersome then changing a parameter (perhaps more guaranteed success), but I used to use a docker image to create a release for Ubuntu on MacOS so the platform is the same. Now I run Ubuntu on my machine so I don't need it anymore, but it was useful. Here is a repo: https://github.com/MarkNijhof/erlang_docker -Mark On Thu, Dec 18, 2014 at 6:14 PM, Tristan Sloughter wrote: > > You must also set: > > {system_libs, false}. > > I've been undecided on making a single config variable that says to not > include erts or system libs. > > Or you can set it to include another erts, which could be compiled for the > platform you are deploying to: > > {include_erts, "/path/to/erts"}. > > I'm working on documentation as well. Currently it is within the rebar3 > project, http://www.rebar3.org/v1.0/docs/releases, but is the same for > using relx on its own or with erlang.mk (except that you have to have a > relx.config and can't use profiles). But I'll be creating a relx only set > of docs similar to these. > > Tristan > > On Thu, Dec 18, 2014, at 11:09 AM, Max Lapshin wrote: > > > I've made simple project with erlang.mk and relx.config: > > {release, {peeklio, "0.1"}, > [peeklio]}. > > {extended_start_script, true}. > > {include_erts, false}. > > > I compile it under MacOS and copy _rel/... to linux. It doesn't work > because > crypto library is copied with MacOS .so > > How should I force relx to make some output that will use erlang from > system? > > *_______________________________________________* > 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 > > -- Mark Nijhof t: @MarkNijhof s: marknijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Thu Dec 18 18:32:44 2014 From: t@REDACTED (Tristan Sloughter) Date: Thu, 18 Dec 2014 11:32:44 -0600 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? In-Reply-To: References: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> Message-ID: <1418923964.1925380.204517385.6F45C496@webmail.messagingengine.com> Yea, we were doing the same at Heroku. A docker image that built the release and uploaded to S3 so we could deploy. It is a decent flow, but now I have just travis-ci doing the build, after tests pass, and uploading to S3. Which works nicely. I intend to document different deployment and upgrade strategies on rebar3 and relx websites eventually. -- Tristan Sloughter t@REDACTED On Thu, Dec 18, 2014, at 11:29 AM, Mark Nijhof wrote: > Maybe a bit more cumbersome then changing a parameter (perhaps more > guaranteed success), but I used to use a docker image to create a > release for Ubuntu on MacOS so the platform is the same. Now I run > Ubuntu on my machine so I don't need it anymore, but it was useful. > > Here is a repo: https://github.com/MarkNijhof/erlang_docker > > -Mark > > On Thu, Dec 18, 2014 at 6:14 PM, Tristan Sloughter > wrote: >> __ >> You must also set: >> >> {system_libs, false}. >> >> I've been undecided on making a single config variable that says to >> not include erts or system libs. >> >> Or you can set it to include another erts, which could be compiled >> for the platform you are deploying to: >> >> {include_erts, "/path/to/erts"}. >> >> I'm working on documentation as well. Currently it is within the >> rebar3 project, http://www.rebar3.org/v1.0/docs/releases, but is the >> same for using relx on its own or with erlang.mk (except that you >> have to have a relx.config and can't use profiles). But I'll be >> creating a relx only set of docs similar to these. >> >> Tristan >> >> On Thu, Dec 18, 2014, at 11:09 AM, Max Lapshin wrote: >>> >>> I've made simple project with erlang.mk and relx.config: >>> >>> {release, {peeklio, "0.1"}, [peeklio]}. >>> >>> {extended_start_script, true}. >>> >>> {include_erts, false}. >>> >>> >>> I compile it under MacOS and copy _rel/... to linux. It doesn't work >>> because crypto library is copied with MacOS .so >>> >>> How should I force relx to make some output that will use erlang >>> from system? >>> >>> _________________________________________________ >>> 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 >> > > > -- > Mark Nijhof > t: @MarkNijhof[1] > s: marknijhof > Links: 1. https://twitter.com/MarkNijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.nijhof@REDACTED Thu Dec 18 18:33:56 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Thu, 18 Dec 2014 18:33:56 +0100 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? In-Reply-To: <1418923964.1925380.204517385.6F45C496@webmail.messagingengine.com> References: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> <1418923964.1925380.204517385.6F45C496@webmail.messagingengine.com> Message-ID: For a production setup absolute the best to have a CI do the "heavy lifting" On Thu, Dec 18, 2014 at 6:32 PM, Tristan Sloughter wrote: > > Yea, we were doing the same at Heroku. A docker image that built the > release and uploaded to S3 so we could deploy. > > It is a decent flow, but now I have just travis-ci doing the build, after > tests pass, and uploading to S3. Which works nicely. > > I intend to document different deployment and upgrade strategies on rebar3 > and relx websites eventually. > > -- > Tristan Sloughter > t@REDACTED > > > > On Thu, Dec 18, 2014, at 11:29 AM, Mark Nijhof wrote: > > Maybe a bit more cumbersome then changing a parameter (perhaps more > guaranteed success), but I used to use a docker image to create a release > for Ubuntu on MacOS so the platform is the same. Now I run Ubuntu on my > machine so I don't need it anymore, but it was useful. > > Here is a repo: https://github.com/MarkNijhof/erlang_docker > > -Mark > > On Thu, Dec 18, 2014 at 6:14 PM, Tristan Sloughter > wrote: > > > You must also set: > > {system_libs, false}. > > I've been undecided on making a single config variable that says to not > include erts or system libs. > > Or you can set it to include another erts, which could be compiled for the > platform you are deploying to: > > {include_erts, "/path/to/erts"}. > > I'm working on documentation as well. Currently it is within the rebar3 > project, http://www.rebar3.org/v1.0/docs/releases, but is the same for > using relx on its own or with erlang.mk (except that you have to have a > relx.config and can't use profiles). But I'll be creating a relx only set > of docs similar to these. > > Tristan > > On Thu, Dec 18, 2014, at 11:09 AM, Max Lapshin wrote: > > > I've made simple project with erlang.mk and relx.config: > > {release, {peeklio, "0.1"}, > [peeklio]}. > > {extended_start_script, true}. > > {include_erts, false}. > > > I compile it under MacOS and copy _rel/... to linux. It doesn't work > because > crypto library is copied with MacOS .so > > How should I force relx to make some output that will use erlang from > system? > > *_______________________________________________* > 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 > > > > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > > > -- Mark Nijhof t: @MarkNijhof s: marknijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt@REDACTED Thu Dec 18 19:48:35 2014 From: pablo.platt@REDACTED (pablo platt) Date: Thu, 18 Dec 2014 20:48:35 +0200 Subject: [erlang-questions] sync gproc table with a slave server Message-ID: Hi, I'm using gproc to register user sessions. How can I sync the gproc ets table with a slave server? Is gen_leader an overkill when the same server will always be the master and I don't need master election? Can the slave be notified for any change in gproc so it will know when a user session added, removed or changed? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From james@REDACTED Thu Dec 18 19:53:49 2014 From: james@REDACTED (James Aimonetti) Date: Thu, 18 Dec 2014 10:53:49 -0800 Subject: [erlang-questions] Is it possible to have nested parametrised types when the base type is opaque? In-Reply-To: References: Message-ID: <549322BD.1060600@2600hz.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Le 2014-12-18 07:32, James Fish a ?crit : > Hi all, > > I am never one to doubt that dialyzer is correct, and I am wrong. > In this case I am perplexed by the warning generated with nested > parametrised types. For example if a module defines the type: > > -type myqueue(Item) :: {myqueue, queue:queue({integer(), Item})}. > > And another module wishes to use myqueue/1: > > -spec in(integer(), myqueue(integer()) -> myqueue(integer()). > > Dialyzer will warn that success typing has the second argument and > result of the form {myqueue, queue:queue({integer(), any()})}. What > is the subtlety that I am missing? > > You can find two sample modules attached. One module with a > parametrised queue and another with a parametrised "parametrised" > queue using the first module. Dialyzer has alot of fun with the > second module. If queue:queue() was not opaque no warnings are > generated and if myqueue:myqueue() is not opaque an extra warning > is generated. > > Thank you, > > James > > > > _______________________________________________ erlang-questions > mailing list erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > It seems, in the parameterized version, you are inserting Item only, not a tuple. Compare myqueue.erl: #myqueue{queue=queue:in({1, Item}, Q)}. to myqueue_params.erl: P#myqueue_params{myqueue=myqueue:in(Item, Q)}. The first is a tuple and the second is an integer. That's my initial reading, anyway. - -- James Aimonetti Lead Systems Architect / Impressionable Scallywag "I thought I fixed that" 2600Hz | http://2600hz.com sip:james@REDACTED tel:415.886.7905 irc:mc_ @ freenode -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJUkyK9AAoJENTKa+JPXCVgtpAIAJkSgQcA98T1VYyZeTEqhU9t B5D+aBf964qXqcTcFPJuquEhEBp59ULEj6A96OYc+QLiN0D1Lk8SdHy4YHdCtuSQ HrIA1sVsTz6Jj3EgyqjwtMjCVco25ZQiDs1cT7jhGUKCi2OUIpjpgi6Vb+UwASfw GVry3XJhobgNaH3xfDdx9h8S766k0B/JqtykK6fVbjoIJVxfnQ6yqz6w5604tjw1 VdIyPwml4oAxOndQe0gxiAP5A7P8AyjAs0TvpRMILOm7gtE3tj4JM2ouFgK7VjY4 aX8PGfoeKkazf4XJbuQSJXTODGikGLQSgnhmUz8Cd/MRKvnf4WCfaKl75JWPhl0= =yQIn -----END PGP SIGNATURE----- From max.lapshin@REDACTED Thu Dec 18 21:09:28 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 19 Dec 2014 00:09:28 +0400 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? In-Reply-To: References: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> <1418923964.1925380.204517385.6F45C496@webmail.messagingengine.com> Message-ID: It is a pity, but it doesn't work. Seems that it is possible to use relx only if you build package on the same architecture as you are going to launch =( -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Thu Dec 18 21:10:12 2014 From: t@REDACTED (Tristan Sloughter) Date: Thu, 18 Dec 2014 14:10:12 -0600 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? In-Reply-To: References: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> <1418923964.1925380.204517385.6F45C496@webmail.messagingengine.com> Message-ID: <1418933412.1957835.204576521.1AA9D4CC@webmail.messagingengine.com> What doesn't work? -- Tristan Sloughter t@REDACTED On Thu, Dec 18, 2014, at 02:09 PM, Max Lapshin wrote: > It is a pity, but it doesn't work. > > Seems that it is possible to use relx only if you build package on the > same architecture as you are going to launch =( > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Thu Dec 18 21:12:48 2014 From: t@REDACTED (Tristan Sloughter) Date: Thu, 18 Dec 2014 14:12:48 -0600 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? In-Reply-To: <1418933412.1957835.204576521.1AA9D4CC@webmail.messagingengine.com> References: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> <1418923964.1925380.204517385.6F45C496@webmail.messagingengine.com> <1418933412.1957835.204576521.1AA9D4CC@webmail.messagingengine.com> Message-ID: <1418933568.1958610.204577229.67EC475C@webmail.messagingengine.com> You can also give a path to system_libs, or false. As described in the docs I posted earlier http://www.rebar3.org/v1.0/docs/releases You'll need to be more specific about what part isn't working. -- Tristan Sloughter t@REDACTED On Thu, Dec 18, 2014, at 02:10 PM, Tristan Sloughter wrote: > What doesn't work? > > -- > Tristan Sloughter t@REDACTED > > > > On Thu, Dec 18, 2014, at 02:09 PM, Max Lapshin wrote: >> It is a pity, but it doesn't work. >> >> Seems that it is possible to use relx only if you build package on >> the same architecture as you are going to launch =( >> >> > _________________________________________________ > 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 Dec 18 21:12:51 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 19 Dec 2014 00:12:51 +0400 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? In-Reply-To: <1418933412.1957835.204576521.1AA9D4CC@webmail.messagingengine.com> References: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> <1418923964.1925380.204517385.6F45C496@webmail.messagingengine.com> <1418933412.1957835.204576521.1AA9D4CC@webmail.messagingengine.com> Message-ID: I have specified erlang that is compiled for linux: {include_erts, "../erlang-17.4/lib/erlang/erts-6.3"}. but still it deploys crypto from mac build of erlang. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Thu Dec 18 21:14:41 2014 From: t@REDACTED (Tristan Sloughter) Date: Thu, 18 Dec 2014 14:14:41 -0600 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? In-Reply-To: References: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> <1418923964.1925380.204517385.6F45C496@webmail.messagingengine.com> <1418933412.1957835.204576521.1AA9D4CC@webmail.messagingengine.com> Message-ID: <1418933681.1958728.204577781.54E614D3@webmail.messagingengine.com> Try also with: {system_libs, "/path/to/erlang/libs"}. -- Tristan Sloughter t@REDACTED On Thu, Dec 18, 2014, at 02:12 PM, Max Lapshin wrote: > I have specified erlang that is compiled for linux: > > {include_erts, "../erlang-17.4/lib/erlang/erts-6.3"}. > > but still it deploys crypto from mac build of erlang. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From james@REDACTED Thu Dec 18 22:03:48 2014 From: james@REDACTED (James Fish) Date: Thu, 18 Dec 2014 21:03:48 +0000 Subject: [erlang-questions] Fwd: Is it possible to have nested parametrised types when the base type is opaque? In-Reply-To: References: <549322BD.1060600@2600hz.com> Message-ID: ---------- Forwarded message ---------- From: James Fish Date: 18 December 2014 at 20:24 Subject: Re: [erlang-questions] Is it possible to have nested parametrised types when the base type is opaque? To: James Aimonetti On 18 December 2014 at 18:53, James Aimonetti wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Le 2014-12-18 07:32, James Fish a ?crit : > > Hi all, > > > > I am never one to doubt that dialyzer is correct, and I am wrong. > > In this case I am perplexed by the warning generated with nested > > parametrised types. For example if a module defines the type: > > > > -type myqueue(Item) :: {myqueue, queue:queue({integer(), Item})}. > > > > And another module wishes to use myqueue/1: > > > > -spec in(integer(), myqueue(integer()) -> myqueue(integer()). > > > > Dialyzer will warn that success typing has the second argument and > > result of the form {myqueue, queue:queue({integer(), any()})}. What > > is the subtlety that I am missing? > > > > You can find two sample modules attached. One module with a > > parametrised queue and another with a parametrised "parametrised" > > queue using the first module. Dialyzer has alot of fun with the > > second module. If queue:queue() was not opaque no warnings are > > generated and if myqueue:myqueue() is not opaque an extra warning > > is generated. > > > > Thank you, > > > > James > > > > > > > > _______________________________________________ erlang-questions > > mailing list erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > It seems, in the parameterized version, you are inserting Item only, > not a tuple. > > Compare myqueue.erl: > > #myqueue{queue=queue:in({1, Item}, Q)}. > > to myqueue_params.erl: > > P#myqueue_params{myqueue=myqueue:in(Item, Q)}. > > The first is a tuple and the second is an integer. > > That's my initial reading, anyway. > > - -- > James Aimonetti > Lead Systems Architect / Impressionable Scallywag > "I thought I fixed that" > > 2600Hz | http://2600hz.com > sip:james@REDACTED > tel:415.886.7905 > irc:mc_ @ freenode > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1 > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > > iQEcBAEBAgAGBQJUkyK9AAoJENTKa+JPXCVgtpAIAJkSgQcA98T1VYyZeTEqhU9t > B5D+aBf964qXqcTcFPJuquEhEBp59ULEj6A96OYc+QLiN0D1Lk8SdHy4YHdCtuSQ > HrIA1sVsTz6Jj3EgyqjwtMjCVco25ZQiDs1cT7jhGUKCi2OUIpjpgi6Vb+UwASfw > GVry3XJhobgNaH3xfDdx9h8S766k0B/JqtykK6fVbjoIJVxfnQ6yqz6w5604tjw1 > VdIyPwml4oAxOndQe0gxiAP5A7P8AyjAs0TvpRMILOm7gtE3tj4JM2ouFgK7VjY4 > aX8PGfoeKkazf4XJbuQSJXTODGikGLQSgnhmUz8Cd/MRKvnf4WCfaKl75JWPhl0= > =yQIn > -----END PGP SIGNATURE----- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > Thank you for taking a look. That is actually intentional, the myqueue module is wrapping the queue module and also acting as a queue. It enqueues a 2-tuple, the first an integer and the second element is the item enqueued though its own API (myqueue:in/2). This means that a myqueue(Item) contains a queue:queue({integer(), Item}). The myqueue_params module wraps the myqueue module and simply enqueues an integer directly to myqueue. Thus contains a myqueue:myqueue(integer()), as per the -spec. However dialyzer (at least in 17.*) produces the following warnings: myqueue_params.erl:10: Function new/0 has no local return myqueue_params.erl:11: The attempt to match a term of type myqueue:myqueue(integer()) against the variable _ breaks the opaqueness of the term myqueue_params.erl:14: Function in/2 has no local return myqueue_params.erl:15: The call myqueue:in(Item::integer(),Q::myqueue:myqueue(integer())) does not have an opaque term of type myqueue:myqueue(_) as 2nd argument Firstly the warning on line 11. This is warning that matching against the _ variable breaks opaqueness. A _ variable is never used and if it did I am unsure how matching against it would break an opaque contract. Secondly the warning on line 15. Dialyzer is producing a warning that appears contradictory as it appears to be warning about an over specification (i.e. the spec is less allowing that it needs to be), though does not class it as such. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ct.radu.001@REDACTED Fri Dec 19 11:23:28 2014 From: ct.radu.001@REDACTED (CT Radu) Date: Fri, 19 Dec 2014 12:23:28 +0200 Subject: [erlang-questions] automake and erlang.mk Message-ID: Good morning everyone, Has any of you used erlang.mk and automake tools ? I am currently working on a project that uses automake across the whole ecosystem (including the erlang project I am working on). What I want is to use erlang.mk in my project instead of custom/home made Makefiles and at the same time be sure autoreconf do not overwrite or make unusable make targets exposed by erlang.mk. Regards, Tiberiu -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Fri Dec 19 11:45:30 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Fri, 19 Dec 2014 12:45:30 +0200 Subject: [erlang-questions] automake and erlang.mk In-Reply-To: References: Message-ID: <549401CA.8080106@ninenines.eu> A quick look at automake docs gives this result: http://www.gnu.org/software/automake/manual/html_node/Subdirectories.html Which leads to this page which contains exactly what you want, I think: http://www.gnu.org/software/automake/manual/html_node/Third_002dParty-Makefiles.html It seems you will need to add some targets in your Makefile. erlang.mk already comes with some (all, clean, distclean) and another is already planned to be added (check, that would run tests + dialyzer and others). If you have success with this it may be interesting to add some guidance to the erlang.mk README on how to make it work with automake, or even to add these extra rules to erlang.mk itself (it seems that empty rules are OK). On 12/19/2014 12:23 PM, CT Radu wrote: > Good morning everyone, > > Has any of you used erlang.mk and automake tools ? > I am currently working on a project that uses automake across the whole > ecosystem (including the erlang project I am working on). > What I want is to use erlang.mk in my project instead > of custom/home made Makefiles and at the same time be sure autoreconf do > not overwrite or make unusable make targets exposed by erlang.mk > . > > Regards, > Tiberiu > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From kostis@REDACTED Fri Dec 19 15:22:06 2014 From: kostis@REDACTED (Kostis Sagonas) Date: Fri, 19 Dec 2014 15:22:06 +0100 Subject: [erlang-questions] Why would dialyzer only be using one core In-Reply-To: <54927B23.20501@gmail.com> References: <54927B23.20501@gmail.com> Message-ID: <5494348E.5010907@cs.ntua.gr> On 12/18/2014 07:58 AM, Zachary Kessin wrote: > I have been using dialyzer on my code base, and one thing I have noticed > is that recently it has gotten very slow. When I run top I see that it > is only running on 1 CPU core (intel i7 With 8 threads) any idea why > this would happen and how to fix it? No idea about this one. Moreover, I cannot reproduce this with 17.4 freshly built from sources. I would suggest that you try to build a "standard" PLT (e.g. dialyzer --build_plt --apps erts kernel stdlib) or something of that sort, and watch what's happening using htop (or similar). If that one does not show multicore activity, then something is wrong with your installation. Try to build and install an OTP from sources then. In any case, write a follow up mail here to see if that was a false alarm or the problem persists. Kostis From ct.radu.001@REDACTED Fri Dec 19 15:43:26 2014 From: ct.radu.001@REDACTED (CT Radu) Date: Fri, 19 Dec 2014 16:43:26 +0200 Subject: [erlang-questions] automake and erlang.mk In-Reply-To: <549401CA.8080106@ninenines.eu> References: <549401CA.8080106@ninenines.eu> Message-ID: Mersi Lo?c, Third party Makefiles is the thing I missed until now. I think this is the path I'm going to take. I'll let you know once I get this one working. Regards, Tiberiu 2014-12-19 12:45 GMT+02:00 Lo?c Hoguin : > > A quick look at automake docs gives this result: > > http://www.gnu.org/software/automake/manual/html_node/Subdirectories.html > > Which leads to this page which contains exactly what you want, I think: > > http://www.gnu.org/software/automake/manual/html_node/ > Third_002dParty-Makefiles.html > > It seems you will need to add some targets in your Makefile. erlang.mk > already comes with some (all, clean, distclean) and another is already > planned to be added (check, that would run tests + dialyzer and others). > > If you have success with this it may be interesting to add some guidance > to the erlang.mk README on how to make it work with automake, or even to > add these extra rules to erlang.mk itself (it seems that empty rules are > OK). > > On 12/19/2014 12:23 PM, CT Radu wrote: > >> Good morning everyone, >> >> Has any of you used erlang.mk and automake tools ? >> I am currently working on a project that uses automake across the whole >> ecosystem (including the erlang project I am working on). >> What I want is to use erlang.mk in my project instead >> of custom/home made Makefiles and at the same time be sure autoreconf do >> not overwrite or make unusable make targets exposed by erlang.mk >> . >> >> Regards, >> Tiberiu >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- > Lo?c Hoguin > http://ninenines.eu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim.rosenblum@REDACTED Fri Dec 19 16:55:55 2014 From: jim.rosenblum@REDACTED (jim rosenblum) Date: Fri, 19 Dec 2014 10:55:55 -0500 Subject: [erlang-questions] Creating an application that is portable across versions of CentOS Message-ID: I have a standard OTP application in which I use Rebar to generate a release. When I tar up the appropriate release directory, I can explode it on another CentOS 6.2 machine, and it will run with no problems. But when I explode it on a CentOS 5.2 machine, it will not run giving the following output: #bin/jc console Exec: /root/test/jc/erts-6.2/bin/erlexec -boot /root/test/jc/releases/1.0.0/jc -mode embedded -config /root/test/jc/releases/1.0.0/sys.config -args_file /root/test/jc/releases/1.0.0/vm.args -- console Root: /root/test/jc bin/jc: line 224: /root/test/jc/erts-6.2/bin/erlexec: cannot execute binary file bin/jc: line 224: /root/test/jc/erts-6.2/bin/erlexec: Success Should this work? If so, can someone share the tricks to portability. The version of Erlang that I build on is: Erlang/OTP 17 [erts-6.2] [source-5c974be] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false] The erl_opts in the rebar.config does not include the atom native: {erl_opts, [warn_missing_spec, {parse_transform, lager_transform}]}. Any help would be much appreciated. Jr0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Fri Dec 19 17:40:39 2014 From: t@REDACTED (Tristan Sloughter) Date: Fri, 19 Dec 2014 10:40:39 -0600 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? In-Reply-To: <1418933681.1958728.204577781.54E614D3@webmail.messagingengine.com> References: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> <1418923964.1925380.204517385.6F45C496@webmail.messagingengine.com> <1418933412.1957835.204576521.1AA9D4CC@webmail.messagingengine.com> <1418933681.1958728.204577781.54E614D3@webmail.messagingengine.com> Message-ID: <1419007239.2281434.204912133.23112F22@webmail.messagingengine.com> Did this work? I know others have been successful with this and want to make sure it is working consistently. -- Tristan Sloughter t@REDACTED On Thu, Dec 18, 2014, at 02:14 PM, Tristan Sloughter wrote: > Try also with: > > {system_libs, "/path/to/erlang/libs"}. > > -- > Tristan Sloughter t@REDACTED > > > > On Thu, Dec 18, 2014, at 02:12 PM, Max Lapshin wrote: >> I have specified erlang that is compiled for linux: >> >> {include_erts, "../erlang-17.4/lib/erlang/erts-6.3"}. >> >> but still it deploys crypto from mac build of erlang. >> > > _________________________________________________ > 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 Dec 19 17:46:43 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 19 Dec 2014 20:46:43 +0400 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? In-Reply-To: <1419007239.2281434.204912133.23112F22@webmail.messagingengine.com> References: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> <1418923964.1925380.204517385.6F45C496@webmail.messagingengine.com> <1418933412.1957835.204576521.1AA9D4CC@webmail.messagingengine.com> <1418933681.1958728.204577781.54E614D3@webmail.messagingengine.com> <1419007239.2281434.204912133.23112F22@webmail.messagingengine.com> Message-ID: > {system_libs, "/path/to/erlang/libs"}. what exactly should I write here? I have unpacked erlang: $ find erlang-17.4/ erlang-17.4/ erlang-17.4//bin erlang-17.4//bin/ct_run erlang-17.4//bin/to_erl ... erlang-17.4//bin/typer erlang-17.4//lib erlang-17.4//lib/erlang erlang-17.4//lib/erlang/bin erlang-17.4//lib/erlang/bin/no_dot_erlang.boot .... erlang-17.4//lib/erlang/erts-6.3 erlang-17.4//lib/erlang/erts-6.3/bin erlang-17.4//lib/erlang/erts-6.3/bin/beam ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Fri Dec 19 19:58:35 2014 From: t@REDACTED (Tristan Sloughter) Date: Fri, 19 Dec 2014 12:58:35 -0600 Subject: [erlang-questions] relx: how to use system erlang, not embed from my computer? In-Reply-To: References: <1418922875.1921515.204509205.3DE38E93@webmail.messagingengine.com> <1418923964.1925380.204517385.6F45C496@webmail.messagingengine.com> <1418933412.1957835.204576521.1AA9D4CC@webmail.messagingengine.com> <1418933681.1958728.204577781.54E614D3@webmail.messagingengine.com> <1419007239.2281434.204912133.23112F22@webmail.messagingengine.com> Message-ID: <1419015515.2310140.204960961.6E327DC4@webmail.messagingengine.com> Looks like "erlang-17.4/lib" prefixed by the path to erlang-17.4 -- Tristan Sloughter t@REDACTED On Fri, Dec 19, 2014, at 10:46 AM, Max Lapshin wrote: > >{system_libs, "/path/to/erlang/libs"}. > > what exactly should I write here? > > I have unpacked erlang: > > $ find erlang-17.4/ > erlang-17.4/ > erlang-17.4//bin > erlang-17.4//bin/ct_run > erlang-17.4//bin/to_erl > ... > erlang-17.4//bin/typer > erlang-17.4//lib > erlang-17.4//lib/erlang > erlang-17.4//lib/erlang/bin > erlang-17.4//lib/erlang/bin/no_dot_erlang.boot > .... > erlang-17.4//lib/erlang/erts-6.3 > erlang-17.4//lib/erlang/erts-6.3/bin > erlang-17.4//lib/erlang/erts-6.3/bin/beam > ... > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Fri Dec 19 23:19:04 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 19 Dec 2014 23:19:04 +0100 Subject: [erlang-questions] Creating an application that is portable across versions of CentOS In-Reply-To: References: Message-ID: On Fri, Dec 19, 2014 at 4:55 PM, jim rosenblum wrote: > I have a standard OTP application in which I use Rebar to generate a > release. > When I tar up the appropriate release directory, I can explode it on > another CentOS 6.2 machine, and it will run with no problems. But > when I explode it on a CentOS 5.2 machine, it will not run giving > the following output: > > #bin/jc console > Exec: /root/test/jc/erts-6.2/bin/erlexec -boot > /root/test/jc/releases/1.0.0/jc -mode embedded -config > /root/test/jc/releases/1.0.0/sys.config -args_file > /root/test/jc/releases/1.0.0/vm.args -- console > Root: /root/test/jc > bin/jc: line 224: /root/test/jc/erts-6.2/bin/erlexec: cannot execute > binary file > bin/jc: line 224: /root/test/jc/erts-6.2/bin/erlexec: Success > > Should this work? If so, can someone share the tricks to > portability. Just to be sure, both CentOS installations are amd64, right? If so, maybe the erlexec binary built on or for CentOS 6.2 is incompatible with 5.2's system libs or missing extra libs not installed on the 5.2 machine. Also, assuming you've built or are using Erlang for CentOS 6.2, your chances of using a release from CentOS 5.2 on the CentOS 6.2 machine are most likely higher. From paulperegud@REDACTED Fri Dec 19 23:47:31 2014 From: paulperegud@REDACTED (Paul Peregud) Date: Fri, 19 Dec 2014 23:47:31 +0100 Subject: [erlang-questions] sync gproc table with a slave server In-Reply-To: References: Message-ID: Pablo, since you have not provided that much information, I'll suggest to try to get away with calls to master node's gproc app instance via Erlang distribution (erlang:rpc/3). You will avoid a can of worms. Or you can try gproc global registration. I would suspect dragons in that particular area. On Dec 18, 2014 7:48 PM, "pablo platt" wrote: > Hi, > > I'm using gproc to register user sessions. > How can I sync the gproc ets table with a slave server? > Is gen_leader an overkill when the same server will always be the master > and I don't need master election? > > Can the slave be notified for any change in gproc so it will know when a > user session added, removed or changed? > > Thanks > > _______________________________________________ > 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 Dec 20 00:03:50 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sat, 20 Dec 2014 01:03:50 +0200 Subject: [erlang-questions] sync gproc table with a slave server In-Reply-To: References: Message-ID: <5494AED6.3040908@ninenines.eu> Guessing by erlang:rpc/3 you meant to look at the rpc module. This module allows both synchronous and asynchronous calls (the latter is often missed). Also look at gen_server:multi_call/2,3,4 and gen_server:abcast/2,3, and at equivalents for gen_fsm and others. I have had issues with gproc+gen_leader (if a node crashes, the tables lose sync). Ulf created the locks application that can be used with gproc, not sure if this gproc+locks combination works well though. Been eager to know and tried to get people to test it, as I haven't had the opportunity to try myself. :-) A gproc local + multi_call/abcast solution has worked pretty well in my experience, with a small number of servers located right next to each other. This wouldn't work with a large number of servers though. On 12/20/2014 12:47 AM, Paul Peregud wrote: > Pablo, since you have not provided that much information, I'll suggest > to try to get away with calls to master node's gproc app instance via > Erlang distribution (erlang:rpc/3). You will avoid a can of worms. > > Or you can try gproc global registration. I would suspect dragons in > that particular area. > > On Dec 18, 2014 7:48 PM, "pablo platt" > wrote: > > Hi, > > I'm using gproc to register user sessions. > How can I sync the gproc ets table with a slave server? > Is gen_leader an overkill when the same server will always be the > master and I don't need master election? > > Can the slave be notified for any change in gproc so it will know > when a user session added, removed or changed? > > Thanks > > _______________________________________________ > 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 > -- Lo?c Hoguin http://ninenines.eu From pablo.platt@REDACTED Sat Dec 20 00:15:34 2014 From: pablo.platt@REDACTED (pablo platt) Date: Sat, 20 Dec 2014 01:15:34 +0200 Subject: [erlang-questions] sync gproc table with a slave server In-Reply-To: <5494AED6.3040908@ninenines.eu> References: <5494AED6.3040908@ninenines.eu> Message-ID: Paul, my use case is simple. I have a master server that handles user sessions and a slave server that handles a specific app separated from the main session. The slave need to know if a user has permission to view or edit app instance. gproc local is very nice because it clean names and properties when a process dies. With mnesia I could use ram only table and have a read-only copy on the slave. I can also listen to table events and handle user permissions changes. Another option is that the slave will make a call to the master when a new user try to access an app instance. When a user permission is changed on the master, it will send a message to the slave. This is a bit more complicated and in case of a network error, I'll might be in a non consistent state. If gproc had a simple read only replication (based on mnesia?) and more granular notifications it could solve my use case. On Sat, Dec 20, 2014 at 1:03 AM, Lo?c Hoguin wrote: > Guessing by erlang:rpc/3 you meant to look at the rpc module. This module > allows both synchronous and asynchronous calls (the latter is often missed). > > Also look at gen_server:multi_call/2,3,4 and gen_server:abcast/2,3, and at > equivalents for gen_fsm and others. > > I have had issues with gproc+gen_leader (if a node crashes, the tables > lose sync). Ulf created the locks application that can be used with gproc, > not sure if this gproc+locks combination works well though. Been eager to > know and tried to get people to test it, as I haven't had the opportunity > to try myself. :-) > > A gproc local + multi_call/abcast solution has worked pretty well in my > experience, with a small number of servers located right next to each > other. This wouldn't work with a large number of servers though. > > On 12/20/2014 12:47 AM, Paul Peregud wrote: > >> Pablo, since you have not provided that much information, I'll suggest >> to try to get away with calls to master node's gproc app instance via >> Erlang distribution (erlang:rpc/3). You will avoid a can of worms. >> >> Or you can try gproc global registration. I would suspect dragons in >> that particular area. >> >> On Dec 18, 2014 7:48 PM, "pablo platt" > > wrote: >> >> Hi, >> >> I'm using gproc to register user sessions. >> How can I sync the gproc ets table with a slave server? >> Is gen_leader an overkill when the same server will always be the >> master and I don't need master election? >> >> Can the slave be notified for any change in gproc so it will know >> when a user session added, removed or changed? >> >> Thanks >> >> _______________________________________________ >> 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 >> >> > -- > Lo?c Hoguin > http://ninenines.eu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim.rosenblum@REDACTED Sat Dec 20 03:30:20 2014 From: jim.rosenblum@REDACTED (Jim) Date: Fri, 19 Dec 2014 21:30:20 -0500 Subject: [erlang-questions] Creating an application that is portable across versions of CentOS In-Reply-To: References: Message-ID: <475A2687-B4F3-4392-B4AE-44E19601753E@gmail.com> I thought one of the value propositions of Erlang was its portability? Both are amd64 architectures. What expectations should one have regarding portability of beam files? Sent from my iPad > On Dec 19, 2014, at 5:19 PM, Tuncer Ayaz wrote: > >> On Fri, Dec 19, 2014 at 4:55 PM, jim rosenblum wrote: >> I have a standard OTP application in which I use Rebar to generate a >> release. >> When I tar up the appropriate release directory, I can explode it on >> another CentOS 6.2 machine, and it will run with no problems. But >> when I explode it on a CentOS 5.2 machine, it will not run giving >> the following output: >> >> #bin/jc console >> Exec: /root/test/jc/erts-6.2/bin/erlexec -boot >> /root/test/jc/releases/1.0.0/jc -mode embedded -config >> /root/test/jc/releases/1.0.0/sys.config -args_file >> /root/test/jc/releases/1.0.0/vm.args -- console >> Root: /root/test/jc >> bin/jc: line 224: /root/test/jc/erts-6.2/bin/erlexec: cannot execute >> binary file >> bin/jc: line 224: /root/test/jc/erts-6.2/bin/erlexec: Success >> >> Should this work? If so, can someone share the tricks to >> portability. > > Just to be sure, both CentOS installations are amd64, right? > > If so, maybe the erlexec binary built on or for CentOS 6.2 is > incompatible with 5.2's system libs or missing extra libs not > installed on the 5.2 machine. > > Also, assuming you've built or are using Erlang for CentOS 6.2, your > chances of using a release from CentOS 5.2 on the CentOS 6.2 machine > are most likely higher. From essen@REDACTED Sat Dec 20 10:11:34 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sat, 20 Dec 2014 11:11:34 +0200 Subject: [erlang-questions] Creating an application that is portable across versions of CentOS In-Reply-To: <475A2687-B4F3-4392-B4AE-44E19601753E@gmail.com> References: <475A2687-B4F3-4392-B4AE-44E19601753E@gmail.com> Message-ID: <54953D46.8070100@ninenines.eu> The beam files are portable. The VM itself is not. As a first guess I would look to see if there are libc incompatibilities between the CentOS versions which would make loading the executables fail. Another possible issue is crypto, if you didn't compile it statically. If that fails I would use file or ld or other on the erl or erlexec executable to figure out what the problem is. Running erl directly might also give a better error message. On 12/20/2014 04:30 AM, Jim wrote: > I thought one of the value propositions of Erlang was its portability? Both are amd64 architectures. What expectations should one have regarding portability of beam files? > > Sent from my iPad > >> On Dec 19, 2014, at 5:19 PM, Tuncer Ayaz wrote: >> >>> On Fri, Dec 19, 2014 at 4:55 PM, jim rosenblum wrote: >>> I have a standard OTP application in which I use Rebar to generate a >>> release. >>> When I tar up the appropriate release directory, I can explode it on >>> another CentOS 6.2 machine, and it will run with no problems. But >>> when I explode it on a CentOS 5.2 machine, it will not run giving >>> the following output: >>> >>> #bin/jc console >>> Exec: /root/test/jc/erts-6.2/bin/erlexec -boot >>> /root/test/jc/releases/1.0.0/jc -mode embedded -config >>> /root/test/jc/releases/1.0.0/sys.config -args_file >>> /root/test/jc/releases/1.0.0/vm.args -- console >>> Root: /root/test/jc >>> bin/jc: line 224: /root/test/jc/erts-6.2/bin/erlexec: cannot execute >>> binary file >>> bin/jc: line 224: /root/test/jc/erts-6.2/bin/erlexec: Success >>> >>> Should this work? If so, can someone share the tricks to >>> portability. >> >> Just to be sure, both CentOS installations are amd64, right? >> >> If so, maybe the erlexec binary built on or for CentOS 6.2 is >> incompatible with 5.2's system libs or missing extra libs not >> installed on the 5.2 machine. >> >> Also, assuming you've built or are using Erlang for CentOS 6.2, your >> chances of using a release from CentOS 5.2 on the CentOS 6.2 machine >> are most likely higher. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From zxq9@REDACTED Sat Dec 20 10:58:48 2014 From: zxq9@REDACTED (zxq9) Date: Sat, 20 Dec 2014 18:58:48 +0900 Subject: [erlang-questions] Creating an application that is portable across versions of CentOS In-Reply-To: <54953D46.8070100@ninenines.eu> References: <475A2687-B4F3-4392-B4AE-44E19601753E@gmail.com> <54953D46.8070100@ninenines.eu> Message-ID: <1533994.YUJZ18jkFo@changa> On 2014?12?20? ??? 11:11:34 Lo?c Hoguin wrote: > The beam files are portable. The VM itself is not. As a first guess I > would look to see if there are libc incompatibilities between the CentOS > versions which would make loading the executables fail. Another possible > issue is crypto, if you didn't compile it statically. > > If that fails I would use file or ld or other on the erl or erlexec > executable to figure out what the problem is. Running erl directly might > also give a better error message. Indeed, there are a lot of differences between the 5.x and 6.x systems with regard to libs. It is unreasonable to expect a binary built against one RHEL major version family to work directly on another. Rebuilds are nearly always necessary. There are major version differences between some core libraries and the kernels don't look much alike at all anymore, either (RedHat backports a lot of security fixes, but they don't slide versions forward in the core distro, only in "developer tools" add ons). It looks like Erlang Solutions is only maintaining rpms for the Fedora 12/13 derived family (RHEL 6 & friends) and Fedora 19 family (RHEL 7 &co.). 5.x was based on Fedora Core 6 -- which in Linux history terms was the Bronze Age. All that said, building from source on 5.2 should be pretty straightforward if it has been receiving updates (in particular to gcc -- I'm not sure what version 5.2 had to start with, but needed bug fixes should have been released in maintenance patches). Building with wxErlang might be a challenge, though. From goto310@REDACTED Sat Dec 20 13:03:05 2014 From: goto310@REDACTED (gongtao) Date: Sat, 20 Dec 2014 20:03:05 +0800 (CST) Subject: [erlang-questions] High CPU usage problem Message-ID: <4afb7459.10962.14a67946226.Coremail.goto310@163.com> hello everyone: I am a programmer from china.I have a problem with my game server.There is 8193 processes in my erlang node.But the cpu usage is nearly full,and the computer have 24 cpus.I looked some erlang processes info,find the message_queue_len of process is very big,more than 1000 sometimes.The disk io and net io are normal,memory is normal.My erlang version is R15B03.I don't know why. My english is poor.There are same informations from system.Hope you can understand. Looking forward to your reply. Thanks. -bash-4.2$ sar -u 2 10 Linux 2.6.32-279.el6.x86_64 12/20/2014 _x86_64_ (24 CPU) 06:33:37 PM CPU %user %nice %system %iowait %steal %idle 06:33:39 PM all 11.21 0.00 75.04 0.00 0.00 13.75 06:33:41 PM all 10.91 0.00 77.22 0.00 0.00 11.86 06:33:43 PM all 12.08 0.00 75.96 0.00 0.00 11.97 06:33:45 PM all 10.50 0.00 77.71 0.00 0.00 11.79 06:33:47 PM all 11.09 0.00 76.75 0.00 0.00 12.16 06:33:49 PM all 11.07 0.00 76.03 0.00 0.00 12.90 06:33:51 PM all 12.07 0.00 75.27 0.00 0.00 12.66 06:33:53 PM all 11.36 0.00 76.84 0.00 0.00 11.80 | CPU Utilisation ------------------------------------------------------------------------------------------------------------------------------------- | |---------------------------+-------------------------------------------------+ | |CPU User% Sys% Wait% Idle|0 |25 |50 |75 100| | | 1 14.1 75.9 0.0 9.9|UUUUUUUsssssssssssssssssssssssssssssssssssss >| | | 2 9.8 81.3 0.0 8.8|UUUUssssssssssssssssssssssssssssssssssssssss >| | | 3 11.6 76.9 0.0 11.6|UUUUUssssssssssssssssssssssssssssssssssssss > | | 4 7.6 82.3 0.0 10.1|UUUsssssssssssssssssssssssssssssssssssssssss > | | | 5 14.2 74.1 0.0 11.7|UUUUUUUsssssssssssssssssssssssssssssssssssss > | | | 6 8.6 81.3 0.0 10.1|UUUUssssssssssssssssssssssssssssssssssssssss > | | | 7 11.6 75.9 0.0 12.6|UUUUUsssssssssssssssssssssssssssssssssssss > | | 8 8.5 81.0 0.0 10.5|UUUUssssssssssssssssssssssssssssssssssssssss > | | | 9 11.7 76.1 0.0 12.2|UUUUUssssssssssssssssssssssssssssssssssssss > | | 10 9.1 80.8 0.0 10.1|UUUUssssssssssssssssssssssssssssssssssssssss > | | 11 10.2 76.5 0.0 13.3|UUUUUssssssssssssssssssssssssssssssssssssss > | | | 12 6.6 81.6 0.0 11.7|UUUssssssssssssssssssssssssssssssssssssssss > | | 13 12.1 75.3 0.0 12.6|UUUUUUsssssssssssssssssssssssssssssssssssss > | | 14 9.0 80.6 0.0 10.4|UUUUssssssssssssssssssssssssssssssssssssssss > | | 15 15.7 71.1 0.0 13.2|UUUUUUUsssssssssssssssssssssssssssssssssss >| | | 16 9.2 80.1 0.0 10.7|UUUUssssssssssssssssssssssssssssssssssssssss > | | | 17 13.6 74.2 0.0 12.1|UUUUUUsssssssssssssssssssssssssssssssssssss > | | | 18 7.2 82.1 0.0 10.8|UUUsssssssssssssssssssssssssssssssssssssssss > | | | 19 16.5 69.5 0.0 14.0|UUUUUUUUssssssssssssssssssssssssssssssssss > | | | 20 7.3 81.2 0.0 11.5|UUUssssssssssssssssssssssssssssssssssssssss > | | | 21 17.8 69.0 0.0 13.2|UUUUUUUUssssssssssssssssssssssssssssssssss > | | | 22 11.4 77.2 0.0 11.4|UUUUUssssssssssssssssssssssssssssssssssssss > | | | 23 14.4 71.1 0.0 14.4|UUUUUUUsssssssssssssssssssssssssssssssssss > | | | 24 5.8 81.7 0.0 12.6|UUssssssssssssssssssssssssssssssssssssssss > | | |---------------------------+-------------------------------------------------+ | |Avg 11.0 77.3 0.0 11.7|UUUUUssssssssssssssssssssssssssssssssssssss > | | |---------------------------+-------------------------------------------------+ -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Sat Dec 20 17:19:42 2014 From: g@REDACTED (Guilherme Andrade) Date: Sat, 20 Dec 2014 16:19:42 +0000 Subject: [erlang-questions] High CPU usage problem In-Reply-To: <4afb7459.10962.14a67946226.Coremail.goto310@163.com> References: <4afb7459.10962.14a67946226.Coremail.goto310@163.com> Message-ID: <5495A19E.2020405@gandrade.net> Hello gongtao, Besides 'message_queue_len', I would also look into 'reductions' over time (also using process_info/2.) As for big message queues, if the CPU is not overloaded, in most cases it's due to single processes becoming a bottleneck, whether due to IO and/or heavy crunching; if they can be pooled or split into multiple ones, the better. However, you say that CPU is topping at 100%, so it's most likely that it's just too heavy. Long-running NIFs could also cause weird behaviour in the scheduler. This dirty (multiple) one-liner should give you some insight into reduction count: ------------------ rp([{-Reduc, Pid, case process_info(Pid, registered_name) of {registered_name,Name} -> Name; _ -> '_' end} || {Reduc, Pid} <- lists:foldl( fun(Pid, L) when length(L) > 40 -> SL = lists:sublist(lists:keysort(1, L), 20), case process_info(Pid, reductions) of {reductions,Reduc} -> [{-Reduc, Pid} | SL]; undefined -> L end; (Pid, L) -> case process_info(Pid, reductions) of {reductions,Reduc} -> [{-Reduc, Pid} | L]; undefined -> L end end, [], erlang:processes())]). ------------------ Cheers, On 20-12-2014 12:03, gongtao wrote: > hello everyone: > I am a programmer from china.I have a problem with my game > server.There is 8193 processes in my erlang node.But the cpu usage is > nearly full,and the computer have 24 cpus.I looked some erlang > processes info,find the message_queue_len of process is very big,more > than 1000 sometimes.The disk io and net io are normal,memory is > normal.My erlang version is R15B03.I don't know why. > My english is poor.There are same informations from system.Hope > you can understand. > Looking forward to your reply. > Thanks. > > -bash-4.2$ sar -u 2 10 > Linux 2.6.32-279.el6.x86_64 12/20/2014 _x86_64_ > (24 CPU) > > 06:33:37 PM CPU %user %nice %system %iowait %steal > %idle > 06:33:39 PM all 11.21 0.00 75.04 0.00 0.00 > 13.75 > 06:33:41 PM all 10.91 0.00 77.22 0.00 0.00 > 11.86 > 06:33:43 PM all 12.08 0.00 75.96 0.00 0.00 > 11.97 > 06:33:45 PM all 10.50 0.00 77.71 0.00 0.00 > 11.79 > 06:33:47 PM all 11.09 0.00 76.75 0.00 0.00 > 12.16 > 06:33:49 PM all 11.07 0.00 76.03 0.00 0.00 > 12.90 > 06:33:51 PM all 12.07 0.00 75.27 0.00 0.00 > 12.66 > 06:33:53 PM all 11.36 0.00 76.84 0.00 0.00 > 11.80 > > > | CPU Utilisation > ------------------------------------------------------------------------------------------------------------------------------------- > | > |---------------------------+-------------------------------------------------+ > > | > |CPU User% Sys% Wait% Idle|0 |25 |50 |75 > 100| > | > | 1 14.1 75.9 0.0 > 9.9|UUUUUUUsssssssssssssssssssssssssssssssssssss >| > | > | 2 9.8 81.3 0.0 > 8.8|UUUUssssssssssssssssssssssssssssssssssssssss >| > | > | 3 11.6 76.9 0.0 > 11.6|UUUUUssssssssssssssssssssssssssssssssssssss > > | > | 4 7.6 82.3 0.0 > 10.1|UUUsssssssssssssssssssssssssssssssssssssssss > | > | > | 5 14.2 74.1 0.0 > 11.7|UUUUUUUsssssssssssssssssssssssssssssssssssss > | > | > | 6 8.6 81.3 0.0 > 10.1|UUUUssssssssssssssssssssssssssssssssssssssss > | > | > | 7 11.6 75.9 0.0 > 12.6|UUUUUsssssssssssssssssssssssssssssssssssss > > | > | 8 8.5 81.0 0.0 > 10.5|UUUUssssssssssssssssssssssssssssssssssssssss > | > | > | 9 11.7 76.1 0.0 > 12.2|UUUUUssssssssssssssssssssssssssssssssssssss > > | > | 10 9.1 80.8 0.0 > 10.1|UUUUssssssssssssssssssssssssssssssssssssssss > > | > | 11 10.2 76.5 0.0 > 13.3|UUUUUssssssssssssssssssssssssssssssssssssss > | > | > | 12 6.6 81.6 0.0 > 11.7|UUUssssssssssssssssssssssssssssssssssssssss > > | > | 13 12.1 75.3 0.0 > 12.6|UUUUUUsssssssssssssssssssssssssssssssssssss > > | > | 14 9.0 80.6 0.0 > 10.4|UUUUssssssssssssssssssssssssssssssssssssssss > > | > | 15 15.7 71.1 0.0 > 13.2|UUUUUUUsssssssssssssssssssssssssssssssssss >| > | > | 16 9.2 80.1 0.0 > 10.7|UUUUssssssssssssssssssssssssssssssssssssssss > | > | > | 17 13.6 74.2 0.0 > 12.1|UUUUUUsssssssssssssssssssssssssssssssssssss > | > | > | 18 7.2 82.1 0.0 > 10.8|UUUsssssssssssssssssssssssssssssssssssssssss > | > | > | 19 16.5 69.5 0.0 > 14.0|UUUUUUUUssssssssssssssssssssssssssssssssss > | > | > | 20 7.3 81.2 0.0 > 11.5|UUUssssssssssssssssssssssssssssssssssssssss > | > | > | 21 17.8 69.0 0.0 > 13.2|UUUUUUUUssssssssssssssssssssssssssssssssss > | > | > | 22 11.4 77.2 0.0 > 11.4|UUUUUssssssssssssssssssssssssssssssssssssss > | > | > | 23 14.4 71.1 0.0 > 14.4|UUUUUUUsssssssssssssssssssssssssssssssssss > | > | > | 24 5.8 81.7 0.0 > 12.6|UUssssssssssssssssssssssssssssssssssssssss > | > | > |---------------------------+-------------------------------------------------+ > > | > |Avg 11.0 77.3 0.0 > 11.7|UUUUUssssssssssssssssssssssssssssssssssssss > | > | > |---------------------------+-------------------------------------------------+ > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Guilherme https://www.gandrade.net/ PGP: 0x35CB8191 / 1968 5252 3901 B40F ED8A D67A 9330 79B1 35CB 8191 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 455 bytes Desc: OpenPGP digital signature URL: From flw@REDACTED Sat Dec 20 17:23:08 2014 From: flw@REDACTED (Florian Waas) Date: Sat, 20 Dec 2014 08:23:08 -0800 Subject: [erlang-questions] Creating an application that is portable across versions of CentOS In-Reply-To: <1533994.YUJZ18jkFo@changa> References: <475A2687-B4F3-4392-B4AE-44E19601753E@gmail.com> <54953D46.8070100@ninenines.eu> <1533994.YUJZ18jkFo@changa> Message-ID: Just confirming what others already mentioned: in fact, natively built binaries (including the Erlang VM) aren't portable between CentOS 5.x and 6.x. Within each generation things are usually portable though, e.g., from 5.8 to 5.10 etc. We have a few customers who still run 5.x -- and, yes, we roll a separate 5.x release for them. Regards, -fl. On Sat, Dec 20, 2014 at 1:58 AM, zxq9 wrote: > On 2014?12?20? ??? 11:11:34 Lo?c Hoguin wrote: > > The beam files are portable. The VM itself is not. As a first guess I > > would look to see if there are libc incompatibilities between the CentOS > > versions which would make loading the executables fail. Another possible > > issue is crypto, if you didn't compile it statically. > > > > If that fails I would use file or ld or other on the erl or erlexec > > executable to figure out what the problem is. Running erl directly might > > also give a better error message. > > Indeed, there are a lot of differences between the 5.x and 6.x systems with > regard to libs. It is unreasonable to expect a binary built against one > RHEL > major version family to work directly on another. Rebuilds are nearly > always > necessary. There are major version differences between some core libraries > and > the kernels don't look much alike at all anymore, either (RedHat backports > a > lot of security fixes, but they don't slide versions forward in the core > distro, only in "developer tools" add ons). > > It looks like Erlang Solutions is only maintaining rpms for the Fedora > 12/13 > derived family (RHEL 6 & friends) and Fedora 19 family (RHEL 7 &co.). 5.x > was > based on Fedora Core 6 -- which in Linux history terms was the Bronze Age. > > All that said, building from source on 5.2 should be pretty > straightforward if > it has been receiving updates (in particular to gcc -- I'm not sure what > version 5.2 had to start with, but needed bug fixes should have been > released > in maintenance patches). Building with wxErlang might be a challenge, > though. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Sat Dec 20 17:49:41 2014 From: g@REDACTED (Guilherme Andrade) Date: Sat, 20 Dec 2014 16:49:41 +0000 Subject: [erlang-questions] High CPU usage problem In-Reply-To: <5495A19E.2020405@gandrade.net> References: <4afb7459.10962.14a67946226.Coremail.goto310@163.com> <5495A19E.2020405@gandrade.net> Message-ID: <5495A8A5.7040103@gandrade.net> Now that I look more carefully, it looks like your system is spending a whole lot of CPU time (~75%) in kernel space. Some system call (or calls) is taking away way too many resources. On 20-12-2014 16:19, Guilherme Andrade wrote: > Hello gongtao, > > Besides 'message_queue_len', I would also look into 'reductions' over > time (also using process_info/2.) > > As for big message queues, if the CPU is not overloaded, in most cases > it's due to single processes becoming a bottleneck, whether due to IO > and/or heavy crunching; if they can be pooled or split into multiple > ones, the better. However, you say that CPU is topping at 100%, so > it's most likely that it's just too heavy. > > Long-running NIFs could also cause weird behaviour in the scheduler. > > This dirty (multiple) one-liner should give you some insight into > reduction count: > > ------------------ > rp([{-Reduc, Pid, case process_info(Pid, registered_name) of > {registered_name,Name} -> Name; _ -> '_' end} || > {Reduc, Pid} <- > lists:foldl( > fun(Pid, L) when length(L) > 40 -> > SL = lists:sublist(lists:keysort(1, L), 20), > case process_info(Pid, reductions) of > {reductions,Reduc} -> [{-Reduc, Pid} | SL]; > undefined -> L > end; > (Pid, L) -> > case process_info(Pid, reductions) of > {reductions,Reduc} -> [{-Reduc, Pid} | L]; > undefined -> L > end > end, [], erlang:processes())]). > ------------------ > > > Cheers, > > On 20-12-2014 12:03, gongtao wrote: >> hello everyone: >> I am a programmer from china.I have a problem with my game >> server.There is 8193 processes in my erlang node.But the cpu usage is >> nearly full,and the computer have 24 cpus.I looked some erlang >> processes info,find the message_queue_len of process is very big,more >> than 1000 sometimes.The disk io and net io are normal,memory is >> normal.My erlang version is R15B03.I don't know why. >> My english is poor.There are same informations from system.Hope >> you can understand. >> Looking forward to your reply. >> Thanks. >> >> -bash-4.2$ sar -u 2 10 >> Linux 2.6.32-279.el6.x86_64 12/20/2014 _x86_64_ >> (24 CPU) >> >> 06:33:37 PM CPU %user %nice %system %iowait %steal >> %idle >> 06:33:39 PM all 11.21 0.00 75.04 0.00 0.00 >> 13.75 >> 06:33:41 PM all 10.91 0.00 77.22 0.00 0.00 >> 11.86 >> 06:33:43 PM all 12.08 0.00 75.96 0.00 0.00 >> 11.97 >> 06:33:45 PM all 10.50 0.00 77.71 0.00 0.00 >> 11.79 >> 06:33:47 PM all 11.09 0.00 76.75 0.00 0.00 >> 12.16 >> 06:33:49 PM all 11.07 0.00 76.03 0.00 0.00 >> 12.90 >> 06:33:51 PM all 12.07 0.00 75.27 0.00 0.00 >> 12.66 >> 06:33:53 PM all 11.36 0.00 76.84 0.00 0.00 >> 11.80 >> >> >> | CPU Utilisation >> ------------------------------------------------------------------------------------------------------------------------------------- >> | >> |---------------------------+-------------------------------------------------+ >> >> | >> |CPU User% Sys% Wait% Idle|0 |25 |50 |75 >> 100| >> | >> | 1 14.1 75.9 0.0 >> 9.9|UUUUUUUsssssssssssssssssssssssssssssssssssss >| >> | >> | 2 9.8 81.3 0.0 >> 8.8|UUUUssssssssssssssssssssssssssssssssssssssss >| >> | >> | 3 11.6 76.9 0.0 >> 11.6|UUUUUssssssssssssssssssssssssssssssssssssss > >> | >> | 4 7.6 82.3 0.0 >> 10.1|UUUsssssssssssssssssssssssssssssssssssssssss > | >> | >> | 5 14.2 74.1 0.0 >> 11.7|UUUUUUUsssssssssssssssssssssssssssssssssssss > | >> | >> | 6 8.6 81.3 0.0 >> 10.1|UUUUssssssssssssssssssssssssssssssssssssssss > | >> | >> | 7 11.6 75.9 0.0 >> 12.6|UUUUUsssssssssssssssssssssssssssssssssssss > >> | >> | 8 8.5 81.0 0.0 >> 10.5|UUUUssssssssssssssssssssssssssssssssssssssss > | >> | >> | 9 11.7 76.1 0.0 >> 12.2|UUUUUssssssssssssssssssssssssssssssssssssss > >> | >> | 10 9.1 80.8 0.0 >> 10.1|UUUUssssssssssssssssssssssssssssssssssssssss > >> | >> | 11 10.2 76.5 0.0 >> 13.3|UUUUUssssssssssssssssssssssssssssssssssssss > | >> | >> | 12 6.6 81.6 0.0 >> 11.7|UUUssssssssssssssssssssssssssssssssssssssss > >> | >> | 13 12.1 75.3 0.0 >> 12.6|UUUUUUsssssssssssssssssssssssssssssssssssss > >> | >> | 14 9.0 80.6 0.0 >> 10.4|UUUUssssssssssssssssssssssssssssssssssssssss > >> | >> | 15 15.7 71.1 0.0 >> 13.2|UUUUUUUsssssssssssssssssssssssssssssssssss >| >> | >> | 16 9.2 80.1 0.0 >> 10.7|UUUUssssssssssssssssssssssssssssssssssssssss > | >> | >> | 17 13.6 74.2 0.0 >> 12.1|UUUUUUsssssssssssssssssssssssssssssssssssss > | >> | >> | 18 7.2 82.1 0.0 >> 10.8|UUUsssssssssssssssssssssssssssssssssssssssss > | >> | >> | 19 16.5 69.5 0.0 >> 14.0|UUUUUUUUssssssssssssssssssssssssssssssssss > | >> | >> | 20 7.3 81.2 0.0 >> 11.5|UUUssssssssssssssssssssssssssssssssssssssss > | >> | >> | 21 17.8 69.0 0.0 >> 13.2|UUUUUUUUssssssssssssssssssssssssssssssssss > | >> | >> | 22 11.4 77.2 0.0 >> 11.4|UUUUUssssssssssssssssssssssssssssssssssssss > | >> | >> | 23 14.4 71.1 0.0 >> 14.4|UUUUUUUsssssssssssssssssssssssssssssssssss > | >> | >> | 24 5.8 81.7 0.0 >> 12.6|UUssssssssssssssssssssssssssssssssssssssss > | >> | >> |---------------------------+-------------------------------------------------+ >> >> | >> |Avg 11.0 77.3 0.0 >> 11.7|UUUUUssssssssssssssssssssssssssssssssssssss > | >> | >> |---------------------------+-------------------------------------------------+ >> >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > -- > Guilherme > > https://www.gandrade.net/ > PGP: 0x35CB8191 / 1968 5252 3901 B40F ED8A D67A 9330 79B1 35CB 8191 > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Guilherme https://www.gandrade.net/ PGP: 0x35CB8191 / 1968 5252 3901 B40F ED8A D67A 9330 79B1 35CB 8191 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 455 bytes Desc: OpenPGP digital signature URL: From g@REDACTED Sat Dec 20 17:53:04 2014 From: g@REDACTED (Guilherme Andrade) Date: Sat, 20 Dec 2014 16:53:04 +0000 Subject: [erlang-questions] High CPU usage problem In-Reply-To: <5495A8A5.7040103@gandrade.net> References: <4afb7459.10962.14a67946226.Coremail.goto310@163.com> <5495A19E.2020405@gandrade.net> <5495A8A5.7040103@gandrade.net> Message-ID: <5495A970.8080603@gandrade.net> Looking into kernel threads (both current CPU utilisation and consumed CPU time) in something like ps / htop should help. Cheers, On 20-12-2014 16:49, Guilherme Andrade wrote: > Now that I look more carefully, it looks like your system is spending > a whole lot of CPU time (~75%) in kernel space. Some system call (or > calls) is taking away way too many resources. > > > On 20-12-2014 16:19, Guilherme Andrade wrote: >> Hello gongtao, >> >> Besides 'message_queue_len', I would also look into 'reductions' over >> time (also using process_info/2.) >> >> As for big message queues, if the CPU is not overloaded, in most >> cases it's due to single processes becoming a bottleneck, whether due >> to IO and/or heavy crunching; if they can be pooled or split into >> multiple ones, the better. However, you say that CPU is topping at >> 100%, so it's most likely that it's just too heavy. >> >> Long-running NIFs could also cause weird behaviour in the scheduler. >> >> This dirty (multiple) one-liner should give you some insight into >> reduction count: >> >> ------------------ >> rp([{-Reduc, Pid, case process_info(Pid, registered_name) of >> {registered_name,Name} -> Name; _ -> '_' end} || >> {Reduc, Pid} <- >> lists:foldl( >> fun(Pid, L) when length(L) > 40 -> >> SL = lists:sublist(lists:keysort(1, L), 20), >> case process_info(Pid, reductions) of >> {reductions,Reduc} -> [{-Reduc, Pid} | SL]; >> undefined -> L >> end; >> (Pid, L) -> >> case process_info(Pid, reductions) of >> {reductions,Reduc} -> [{-Reduc, Pid} | L]; >> undefined -> L >> end >> end, [], erlang:processes())]). >> ------------------ >> >> >> Cheers, >> >> On 20-12-2014 12:03, gongtao wrote: >>> hello everyone: >>> I am a programmer from china.I have a problem with my game >>> server.There is 8193 processes in my erlang node.But the cpu usage >>> is nearly full,and the computer have 24 cpus.I looked some erlang >>> processes info,find the message_queue_len of process is very >>> big,more than 1000 sometimes.The disk io and net io are >>> normal,memory is normal.My erlang version is R15B03.I don't know why. >>> My english is poor.There are same informations from system.Hope >>> you can understand. >>> Looking forward to your reply. >>> Thanks. >>> >>> -bash-4.2$ sar -u 2 10 >>> Linux 2.6.32-279.el6.x86_64 12/20/2014 _x86_64_ >>> (24 CPU) >>> >>> 06:33:37 PM CPU %user %nice %system %iowait >>> %steal %idle >>> 06:33:39 PM all 11.21 0.00 75.04 0.00 >>> 0.00 13.75 >>> 06:33:41 PM all 10.91 0.00 77.22 0.00 >>> 0.00 11.86 >>> 06:33:43 PM all 12.08 0.00 75.96 0.00 >>> 0.00 11.97 >>> 06:33:45 PM all 10.50 0.00 77.71 0.00 >>> 0.00 11.79 >>> 06:33:47 PM all 11.09 0.00 76.75 0.00 >>> 0.00 12.16 >>> 06:33:49 PM all 11.07 0.00 76.03 0.00 >>> 0.00 12.90 >>> 06:33:51 PM all 12.07 0.00 75.27 0.00 >>> 0.00 12.66 >>> 06:33:53 PM all 11.36 0.00 76.84 0.00 >>> 0.00 11.80 >>> >>> >>> | CPU Utilisation >>> ------------------------------------------------------------------------------------------------------------------------------------- >>> | >>> |---------------------------+-------------------------------------------------+ >>> >>> | >>> |CPU User% Sys% Wait% Idle|0 |25 |50 |75 >>> 100| >>> | >>> | 1 14.1 75.9 0.0 >>> 9.9|UUUUUUUsssssssssssssssssssssssssssssssssssss >| >>> | >>> | 2 9.8 81.3 0.0 >>> 8.8|UUUUssssssssssssssssssssssssssssssssssssssss >| >>> | >>> | 3 11.6 76.9 0.0 >>> 11.6|UUUUUssssssssssssssssssssssssssssssssssssss > >>> | >>> | 4 7.6 82.3 0.0 >>> 10.1|UUUsssssssssssssssssssssssssssssssssssssssss > | >>> | >>> | 5 14.2 74.1 0.0 >>> 11.7|UUUUUUUsssssssssssssssssssssssssssssssssssss > | >>> | >>> | 6 8.6 81.3 0.0 >>> 10.1|UUUUssssssssssssssssssssssssssssssssssssssss > | >>> | >>> | 7 11.6 75.9 0.0 >>> 12.6|UUUUUsssssssssssssssssssssssssssssssssssss > >>> | >>> | 8 8.5 81.0 0.0 >>> 10.5|UUUUssssssssssssssssssssssssssssssssssssssss > | >>> | >>> | 9 11.7 76.1 0.0 >>> 12.2|UUUUUssssssssssssssssssssssssssssssssssssss > >>> | >>> | 10 9.1 80.8 0.0 >>> 10.1|UUUUssssssssssssssssssssssssssssssssssssssss > >>> | >>> | 11 10.2 76.5 0.0 >>> 13.3|UUUUUssssssssssssssssssssssssssssssssssssss > | >>> | >>> | 12 6.6 81.6 0.0 >>> 11.7|UUUssssssssssssssssssssssssssssssssssssssss > >>> | >>> | 13 12.1 75.3 0.0 >>> 12.6|UUUUUUsssssssssssssssssssssssssssssssssssss > >>> | >>> | 14 9.0 80.6 0.0 >>> 10.4|UUUUssssssssssssssssssssssssssssssssssssssss > >>> | >>> | 15 15.7 71.1 0.0 >>> 13.2|UUUUUUUsssssssssssssssssssssssssssssssssss >| >>> | >>> | 16 9.2 80.1 0.0 >>> 10.7|UUUUssssssssssssssssssssssssssssssssssssssss > | >>> | >>> | 17 13.6 74.2 0.0 >>> 12.1|UUUUUUsssssssssssssssssssssssssssssssssssss > | >>> | >>> | 18 7.2 82.1 0.0 >>> 10.8|UUUsssssssssssssssssssssssssssssssssssssssss > | >>> | >>> | 19 16.5 69.5 0.0 >>> 14.0|UUUUUUUUssssssssssssssssssssssssssssssssss > | >>> | >>> | 20 7.3 81.2 0.0 >>> 11.5|UUUssssssssssssssssssssssssssssssssssssssss > | >>> | >>> | 21 17.8 69.0 0.0 >>> 13.2|UUUUUUUUssssssssssssssssssssssssssssssssss > | >>> | >>> | 22 11.4 77.2 0.0 >>> 11.4|UUUUUssssssssssssssssssssssssssssssssssssss > | >>> | >>> | 23 14.4 71.1 0.0 >>> 14.4|UUUUUUUsssssssssssssssssssssssssssssssssss > | >>> | >>> | 24 5.8 81.7 0.0 >>> 12.6|UUssssssssssssssssssssssssssssssssssssssss > | >>> | >>> |---------------------------+-------------------------------------------------+ >>> >>> | >>> |Avg 11.0 77.3 0.0 >>> 11.7|UUUUUssssssssssssssssssssssssssssssssssssss > | >>> | >>> |---------------------------+-------------------------------------------------+ >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> -- >> Guilherme >> >> https://www.gandrade.net/ >> PGP: 0x35CB8191 / 1968 5252 3901 B40F ED8A D67A 9330 79B1 35CB 8191 >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > -- > Guilherme > > https://www.gandrade.net/ > PGP: 0x35CB8191 / 1968 5252 3901 B40F ED8A D67A 9330 79B1 35CB 8191 > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Guilherme https://www.gandrade.net/ PGP: 0x35CB8191 / 1968 5252 3901 B40F ED8A D67A 9330 79B1 35CB 8191 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 455 bytes Desc: OpenPGP digital signature URL: From jim.rosenblum@REDACTED Sat Dec 20 18:05:05 2014 From: jim.rosenblum@REDACTED (Jim Rosenblum) Date: Sat, 20 Dec 2014 12:05:05 -0500 Subject: [erlang-questions] Creating an application that is portable across versions of CentOS In-Reply-To: <54953D46.8070100@ninenines.eu> References: <475A2687-B4F3-4392-B4AE-44E19601753E@gmail.com> <54953D46.8070100@ninenines.eu> Message-ID: <0238083C-B997-44BF-A2A8-37B6626B4F54@gmail.com> Thanks for everyone's replies. I have a better understanding of expectations and things to look at. Thanks. Sent from my iPhone > On Dec 20, 2014, at 4:11 AM, Lo?c Hoguin wrote: > > The beam files are portable. The VM itself is not. As a first guess I would look to see if there are libc incompatibilities between the CentOS versions which would make loading the executables fail. Another possible issue is crypto, if you didn't compile it statically. > > If that fails I would use file or ld or other on the erl or erlexec executable to figure out what the problem is. Running erl directly might also give a better error message. > >> On 12/20/2014 04:30 AM, Jim wrote: >> I thought one of the value propositions of Erlang was its portability? Both are amd64 architectures. What expectations should one have regarding portability of beam files? >> >> Sent from my iPad >> >>>> On Dec 19, 2014, at 5:19 PM, Tuncer Ayaz wrote: >>>> >>>> On Fri, Dec 19, 2014 at 4:55 PM, jim rosenblum wrote: >>>> I have a standard OTP application in which I use Rebar to generate a >>>> release. >>>> When I tar up the appropriate release directory, I can explode it on >>>> another CentOS 6.2 machine, and it will run with no problems. But >>>> when I explode it on a CentOS 5.2 machine, it will not run giving >>>> the following output: >>>> >>>> #bin/jc console >>>> Exec: /root/test/jc/erts-6.2/bin/erlexec -boot >>>> /root/test/jc/releases/1.0.0/jc -mode embedded -config >>>> /root/test/jc/releases/1.0.0/sys.config -args_file >>>> /root/test/jc/releases/1.0.0/vm.args -- console >>>> Root: /root/test/jc >>>> bin/jc: line 224: /root/test/jc/erts-6.2/bin/erlexec: cannot execute >>>> binary file >>>> bin/jc: line 224: /root/test/jc/erts-6.2/bin/erlexec: Success >>>> >>>> Should this work? If so, can someone share the tricks to >>>> portability. >>> >>> Just to be sure, both CentOS installations are amd64, right? >>> >>> If so, maybe the erlexec binary built on or for CentOS 6.2 is >>> incompatible with 5.2's system libs or missing extra libs not >>> installed on the 5.2 machine. >>> >>> Also, assuming you've built or are using Erlang for CentOS 6.2, your >>> chances of using a release from CentOS 5.2 on the CentOS 6.2 machine >>> are most likely higher. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > -- > Lo?c Hoguin > http://ninenines.eu From donpedrothird@REDACTED Sat Dec 20 19:37:25 2014 From: donpedrothird@REDACTED (John Doe) Date: Sat, 20 Dec 2014 22:37:25 +0400 Subject: [erlang-questions] Creating an application that is portable across versions of CentOS In-Reply-To: References: <475A2687-B4F3-4392-B4AE-44E19601753E@gmail.com> <54953D46.8070100@ninenines.eu> <1533994.YUJZ18jkFo@changa> Message-ID: I don't confirm this. Erlang R16B03-1 binaries built on Centos 5.10 with static openssl and disabled ncurses are portable between Centos 5.10. 6.5 and 7.0, Fedora 19 and 20, tested this myself on digitalocean droplets and by some of my clients who run the software with bundled in Erlang on their own servers. The same is true with Ubuntu 10.04, 12.04, 14.04, 14.10, Debian 6.0 and 7.0 with binaries built on Debian 6.0. It might depend on libc or something other, but in general they are portable or at least sometimes are portable. 2014-12-20 19:23 GMT+03:00 Florian Waas : > Just confirming what others already mentioned: in fact, natively built > binaries (including the Erlang VM) aren't portable between CentOS 5.x and > 6.x. Within each generation things are usually portable though, e.g., from > 5.8 to 5.10 etc. > > We have a few customers who still run 5.x -- and, yes, we roll a separate > 5.x release for them. > > Regards, > -fl. > > > > On Sat, Dec 20, 2014 at 1:58 AM, zxq9 wrote: > >> On 2014?12?20? ??? 11:11:34 Lo?c Hoguin wrote: >> > The beam files are portable. The VM itself is not. As a first guess I >> > would look to see if there are libc incompatibilities between the CentOS >> > versions which would make loading the executables fail. Another possible >> > issue is crypto, if you didn't compile it statically. >> > >> > If that fails I would use file or ld or other on the erl or erlexec >> > executable to figure out what the problem is. Running erl directly might >> > also give a better error message. >> >> Indeed, there are a lot of differences between the 5.x and 6.x systems >> with >> regard to libs. It is unreasonable to expect a binary built against one >> RHEL >> major version family to work directly on another. Rebuilds are nearly >> always >> necessary. There are major version differences between some core >> libraries and >> the kernels don't look much alike at all anymore, either (RedHat >> backports a >> lot of security fixes, but they don't slide versions forward in the core >> distro, only in "developer tools" add ons). >> >> It looks like Erlang Solutions is only maintaining rpms for the Fedora >> 12/13 >> derived family (RHEL 6 & friends) and Fedora 19 family (RHEL 7 &co.). 5.x >> was >> based on Fedora Core 6 -- which in Linux history terms was the Bronze Age. >> >> All that said, building from source on 5.2 should be pretty >> straightforward if >> it has been receiving updates (in particular to gcc -- I'm not sure what >> version 5.2 had to start with, but needed bug fixes should have been >> released >> in maintenance patches). Building with wxErlang might be a challenge, >> though. >> _______________________________________________ >> 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 erlang@REDACTED Sat Dec 20 23:59:47 2014 From: erlang@REDACTED (Andreas Stenius) Date: Sat, 20 Dec 2014 23:59:47 +0100 Subject: [erlang-questions] [ANN] ErlyDTL 0.10.0 Message-ID: Fellow Erlangers, This message announces the release of ErlyDTL 0.10.0. ErlyDTL is a template rendering engine for Erlang, that strives to stay as compatible as possible to that of the Django template language. Release notes and downloads: https://github.com/erlydtl/erlydtl/releases/tag/0.10.0 Cheers, Andreas Stenius//kaos -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Sun Dec 21 04:50:15 2014 From: zxq9@REDACTED (zxq9) Date: Sun, 21 Dec 2014 12:50:15 +0900 Subject: [erlang-questions] Creating an application that is portable across versions of CentOS In-Reply-To: References: Message-ID: <2550440.eoejlMf1Ma@changa> On 2014?12?20? ??? 22:37:25 you wrote: > I don't confirm this. > Erlang R16B03-1 binaries built on Centos 5.10 with static openssl and > disabled ncurses are portable between Centos 5.10. 6.5 and 7.0, Fedora 19 > and 20, tested this myself on digitalocean droplets and by some of my > clients who run the software with bundled in Erlang on their own servers. > > The same is true with Ubuntu 10.04, 12.04, 14.04, 14.10, Debian 6.0 and 7.0 > with binaries built on Debian 6.0. > > It might depend on libc or something other, but in general they are > portable or at least sometimes are portable. That is the magic of forward portability *and* backported patches and developer tools RedHat has backported to the 5.x line that have been gradually added since 5.6 or so and wound up in 5.10 (but don't exist in earlier versions). This will not work from 5.2, and a build from 5.10 will probably not run on 5.2 (in particular, wx built on 5.10 will probably not work on 5.2). A build made on 6.x will not run on 5.x, and a build on 7.x won't run on 6.x or 5.x. That is, of course, unless you build everything statically -- which is a whole different discussion. Going forward is always easier than going backward -- its a sort of "least common denominator" effect with regard to mature, stable APIs. From mjtruog@REDACTED Sun Dec 21 09:52:11 2014 From: mjtruog@REDACTED (Michael Truog) Date: Sun, 21 Dec 2014 00:52:11 -0800 Subject: [erlang-questions] [ANN] CloudI 1.4.0 Released! Message-ID: <54968A3B.6060803@gmail.com> Download 1.4.0 from http://sourceforge.net/projects/cloudi/files/latest/download (checksums at the bottom of this email) Things to be aware of: 1) CloudI is no longer beta! yay! 2) The 1.4.0 release was mainly focused on bugfixes and testing. 3) Best to get a fresh clone of the source code repository due to deleting binary files rewriting commits to reduce the repository size (in https://github.com/CloudI/CloudI ). 4) The raw loadtest results from the source code repository have moved to https://github.com/CloudI/loadtests . CloudI (http://cloudi.org/) is a "universal integrator" using an Erlang core to provide fault-tolerance with efficiency and scalability. The CloudI API provides a minimal interface to communicate among services so programming language agnostic, database agnostic, and messaging bus agnostic integration can occur. CloudI currently integrates with the programming languages C/C++, Elixir, Erlang, Java, JavaScript, PHP, Perl, Python, and Ruby, the databases PostgreSQL, elasticsearch, Cassandra, MySQL, couchdb, memcached, riak, and tokyotyrant, the messaging bus ZeroMQ, websockets, and the internal CloudI service bus. HTTP is supported with both cowboy and elli integration. The details for this release are below: * JavaScript/node.js, PHP and Perl are now supported programming languages with their own CloudI API implementations * A Quick Start now has intros for all supported programming languages (http://cloudi.org/#quick_start) * Loadtests were ran (http://cloudi.org/faq.html#5_LoadTesting) * Various bugs were fixed (see the ChangeLog for more detail) Please mention any problems, issues, or ideas! Thanks, Michael SHA256 CHECKSUMS bcc7489459ce60691d29b2b59caabc6aa5b4699bf0b2e15563cc706882e3289d cloudi-1.4.0.tar.bz2 (53164 bytes) 930fa3413bb2441a4146bf0008910d6da885f3b07d8e81dc94ad13651fd6e1e1 cloudi-1.4.0.tar.gz (55632 bytes) From essen@REDACTED Mon Dec 22 12:36:04 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 22 Dec 2014 13:36:04 +0200 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: Message-ID: <54980224.8070106@ninenines.eu> Hello, Adding something I believe nobody mentioned yet (if I missed it, sorry). The way things are now there are many companies or larger projects who have a fork of some of the projects they use, because they need a specific set of patches on top of them (sometimes these can easily be contributed back; but sometimes they are plain hacks). The package manager should be able to handle this, perhaps by allowing some package information to be overriden to allow changing the source location. Another solution could be to allow applying a set of patch files. None of this would apply to binary-only packages though, of course. On 12/16/2014 01:41 PM, Bruce Yinhe wrote: > Hi everyone, > > Industrial Erlang User Group (IEUG) has been working together with the > Erlang/OTP team to investigate and create a package management system > for Erlang/OTP. > > The lack of a package management system for Erlang has been discussed > for a long time in the community. In essence, a straightforward package > management system is believed to take Erlang programming language a step > forward. Multiple tools will appear in the community. It needs to be > supported by a highly visible community behind it. > > > In order to increase the adoption and to result in a tool widely used in > the Erlang ecosystem, we are identifying the most important user > categories and use cases, based on what the majority of the community > want in a package manager. Therefore we would like to invite an open > discussion. > > Now you are welcome to share your thoughts, suggestions or proposals > about an Erlang package manager. It would be great if you could reply > with your motivation, explaining why a feature is necessary to have. > There are some example questions to begin the dicussion with, including, > but not limited to the following. > > * What metadata information should an Erlang package include? > * What functionality do you need in a package manager for Erlang in > order to use it in production? > * What other concerns do you have about an Erlang package management > system? > > Erlang package manager's brief wish list of features: > > * Console interface > * Web interface > * Package Index and Repository > * Fetch, Install and Remove Packages > * Publish packages > * Versioning and Dependency Management > > We are aware of several previous efforts and existing tools that attempt > to achieve the similar goal. We want to look at existing things, both > from Erlang and Elixir, to see if they fit the requirements. If not, we > will then have to make something new, perhaps as a rewrite of an > existing tool. > > The IEUG members are putting together requirements for a package manager > and will work with the community and Ericsson to create a standard and > address any voids which exists in the existing tooling, funding > necessary efforts required. > > Best regards > > Bruce Yinhe > > Erlang Community Manager > Industrial Erlang User Group > community-manager@REDACTED > +46 72 311 43 89 > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From tuncer.ayaz@REDACTED Mon Dec 22 13:13:55 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Mon, 22 Dec 2014 13:13:55 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <54980224.8070106@ninenines.eu> References: <54980224.8070106@ninenines.eu> Message-ID: On Mon, Dec 22, 2014 at 12:36 PM, Loic Hoguin wrote: > Hello, > > Adding something I believe nobody mentioned yet (if I missed it, > sorry). > > The way things are now there are many companies or larger projects > who have a fork of some of the projects they use, because they need > a specific set of patches on top of them (sometimes these can easily > be contributed back; but sometimes they are plain hacks). > > The package manager should be able to handle this, perhaps by > allowing some package information to be overriden to allow changing > the source location. > > Another solution could be to allow applying a set of patch files. > > None of this would apply to binary-only packages though, of course. That's what 'pinning' is for, and AFAIR it has been mentioned by others, but it's good to point it out again for clarity :). For example, with opam you can do the following: # fetch source and pin as preferred source $ opam source public_pkg --pin $ cd public_pkg # apply modifications # add pkg that only exists locally $ cd private_pkg $ opam pin add private_pkg . Now, anytime you run 'opam install' or 'opam upgrade', opam will use the local dir as the source. Gentoo's portage calls this an 'overlay'. You may also want a similar feature like Debian's pinning, but that's a different thing, and I'm not sure if it's needed. From ankitrana1709@REDACTED Mon Dec 22 13:56:38 2014 From: ankitrana1709@REDACTED (Ankit Rana) Date: Mon, 22 Dec 2014 18:26:38 +0530 Subject: [erlang-questions] How to use Push Notifiactions with Eajbberd 14.07 Message-ID: Hi, Could not find out a core module for implementing Push Notifications on Eajbberd 14.07. Came across mod_zeropush but i am skeptical if it is the right direction to see into. I aim to use both Android and iOS clients to connect with my ejabberd. Pointers would be great help! Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From nyarly@REDACTED Mon Dec 22 19:18:13 2014 From: nyarly@REDACTED (Judson Lester) Date: Mon, 22 Dec 2014 18:18:13 +0000 Subject: [erlang-questions] Erlang package manager References: <54980224.8070106@ninenines.eu> Message-ID: I'm not the only one, but I'd like to raise another voice for Nix. The world has far too many package managers specific to either a virtual machine or an OS distribution, and it's kind of a nightmare. My understanding is that Nix Package Manager (as opposed to the closely related NixOS) fulfills all or almost all the requirements that people are talking about here, as well as allowing unprivileged users to install software, establishing different installation contexts on the same host (i.e. different versions of dependencies for different applications), and completely reproducible installs. But most attractive: it wouldn't be "the Erlang Package Manager" - it'd be "the Erlang application of Nix," which has at least three benefits: Erlang benefits from improvements to Nix, the Erlang community has a stronger basis for input on Nix, and anyone who's used Nix before but not Erlang has the barrier to trying Erlang lowered slightly. Judson On Mon Dec 22 2014 at 4:14:47 AM Tuncer Ayaz wrote: > On Mon, Dec 22, 2014 at 12:36 PM, Loic Hoguin wrote: > > Hello, > > > > Adding something I believe nobody mentioned yet (if I missed it, > > sorry). > > > > The way things are now there are many companies or larger projects > > who have a fork of some of the projects they use, because they need > > a specific set of patches on top of them (sometimes these can easily > > be contributed back; but sometimes they are plain hacks). > > > > The package manager should be able to handle this, perhaps by > > allowing some package information to be overriden to allow changing > > the source location. > > > > Another solution could be to allow applying a set of patch files. > > > > None of this would apply to binary-only packages though, of course. > > That's what 'pinning' is for, and AFAIR it has been mentioned by > others, but it's good to point it out again for clarity :). > > For example, with opam you can do the following: > > # fetch source and pin as preferred source > $ opam source public_pkg --pin > $ cd public_pkg > # apply modifications > > # add pkg that only exists locally > $ cd private_pkg > $ opam pin add private_pkg . > > Now, anytime you run 'opam install' or 'opam upgrade', opam will use > the local dir as the source. > > Gentoo's portage calls this an 'overlay'. > > You may also want a similar feature like Debian's pinning, but that's > a different thing, and I'm not sure if it's needed. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gleber.p@REDACTED Mon Dec 22 21:31:38 2014 From: gleber.p@REDACTED (Gleb Peregud) Date: Mon, 22 Dec 2014 21:31:38 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> Message-ID: On Mon, Dec 22, 2014 at 7:18 PM, Judson Lester wrote: > I'm not the only one, but I'd like to raise another voice for Nix. The world > has far too many package managers specific to either a virtual machine or an > OS distribution, and it's kind of a nightmare. > > My understanding is that Nix Package Manager (as opposed to the closely > related NixOS) fulfills all or almost all the requirements that people are > talking about here, as well as allowing unprivileged users to install > software, establishing different installation contexts on the same host > (i.e. different versions of dependencies for different applications), and > completely reproducible installs. > > But most attractive: it wouldn't be "the Erlang Package Manager" - it'd be > "the Erlang application of Nix," which has at least three benefits: Erlang > benefits from improvements to Nix, the Erlang community has a stronger basis > for input on Nix, and anyone who's used Nix before but not Erlang has the > barrier to trying Erlang lowered slightly. I second this. Nix does solve most of these problems (if not all) in a very principled, well-defined and consistent way, including: - hermetic, verifiable and reproducible builds - patch sets - interoperation with other languages - really fast - transparent binary distribution of artifacts (obviously with fallback to building from source) - extensive caching of build artifacts - private and public repositories - unprivileged installation - multiple version of the same package can coexist and won't conflict - one command deployment (with all dependencies) to normal OS, to Docker or to a cloud - centralized configuration management - developer-friendly - etc. etc. etc. From tuncer.ayaz@REDACTED Mon Dec 22 21:32:17 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Mon, 22 Dec 2014 21:32:17 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> Message-ID: On Mon, Dec 22, 2014 at 7:18 PM, Judson Lester wrote: > I'm not the only one, but I'd like to raise another voice for Nix. > The world has far too many package managers specific to either a > virtual machine or an OS distribution, and it's kind of a nightmare. > > My understanding is that Nix Package Manager (as opposed to the > closely related NixOS) fulfills all or almost all the requirements > that people are talking about here, as well as allowing unprivileged > users to install software, establishing different installation > contexts on the same host (i.e. different versions of dependencies > for different applications), and completely reproducible installs. > > But most attractive: it wouldn't be "the Erlang Package Manager" - > it'd be "the Erlang application of Nix," which has at least three > benefits: Erlang benefits from improvements to Nix, the Erlang > community has a stronger basis for input on Nix, and anyone who's > used Nix before but not Erlang has the barrier to trying Erlang > lowered slightly. Yes, Nix solves a lot of common issues in elegant ways, and if we go that route, I'd support it. > On Mon Dec 22 2014 at 4:14:47 AM Tuncer Ayaz wrote: > > > > On Mon, Dec 22, 2014 at 12:36 PM, Loic Hoguin wrote: > > > Hello, > > > > > > Adding something I believe nobody mentioned yet (if I missed it, > > > sorry). > > > > > > The way things are now there are many companies or larger > > > projects who have a fork of some of the projects they use, > > > because they need a specific set of patches on top of them > > > (sometimes these can easily be contributed back; but sometimes > > > they are plain hacks). > > > > > > The package manager should be able to handle this, perhaps by > > > allowing some package information to be overriden to allow > > > changing the source location. > > > > > > Another solution could be to allow applying a set of patch > > > files. > > > > > > None of this would apply to binary-only packages though, of > > > course. > > > > That's what 'pinning' is for, and AFAIR it has been mentioned by > > others, but it's good to point it out again for clarity :). > > > > For example, with opam you can do the following: > > > > # fetch source and pin as preferred source > > $ opam source public_pkg --pin > > $ cd public_pkg > > # apply modifications > > > > # add pkg that only exists locally > > $ cd private_pkg > > $ opam pin add private_pkg . > > > > Now, anytime you run 'opam install' or 'opam upgrade', opam will > > use the local dir as the source. > > > > Gentoo's portage calls this an 'overlay'. > > > > You may also want a similar feature like Debian's pinning, but > > that's a different thing, and I'm not sure if it's needed. From t@REDACTED Mon Dec 22 21:38:41 2014 From: t@REDACTED (Tristan Sloughter) Date: Mon, 22 Dec 2014 14:38:41 -0600 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> Message-ID: <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> I tried to do this with Nix a while ago and failed miserably -- requires a lot of hacky bash scripting. If anyone can get it to work I'd be interested in using it. -- Tristan Sloughter t@REDACTED On Mon, Dec 22, 2014, at 02:31 PM, Gleb Peregud wrote: > On Mon, Dec 22, 2014 at 7:18 PM, Judson Lester wrote: > > I'm not the only one, but I'd like to raise another voice for Nix. The world > > has far too many package managers specific to either a virtual machine or an > > OS distribution, and it's kind of a nightmare. > > > > My understanding is that Nix Package Manager (as opposed to the closely > > related NixOS) fulfills all or almost all the requirements that people are > > talking about here, as well as allowing unprivileged users to install > > software, establishing different installation contexts on the same host > > (i.e. different versions of dependencies for different applications), and > > completely reproducible installs. > > > > But most attractive: it wouldn't be "the Erlang Package Manager" - it'd be > > "the Erlang application of Nix," which has at least three benefits: Erlang > > benefits from improvements to Nix, the Erlang community has a stronger basis > > for input on Nix, and anyone who's used Nix before but not Erlang has the > > barrier to trying Erlang lowered slightly. > > I second this. Nix does solve most of these problems (if not all) in a > very principled, well-defined and consistent way, including: > - hermetic, verifiable and reproducible builds > - patch sets > - interoperation with other languages > - really fast > - transparent binary distribution of artifacts (obviously with > fallback to building from source) > - extensive caching of build artifacts > - private and public repositories > - unprivileged installation > - multiple version of the same package can coexist and won't conflict > - one command deployment (with all dependencies) to normal OS, to > Docker or to a cloud > - centralized configuration management > - developer-friendly > - etc. etc. etc. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From carlos@REDACTED Mon Dec 22 22:21:02 2014 From: carlos@REDACTED (Carlos Paparoni) Date: Mon, 22 Dec 2014 16:51:02 -0430 Subject: [erlang-questions] Newbie question - running qdate results in noproc, gen_server exception Message-ID: Hi everyone, I'm fairly (read: extremely) new to Erlang and still learning how to do stuff. I'm currently trying to code some timezone functions in ChicagoBoss using the qdate library (https://github.com/choptastic/qdate); however, when trying to test the code either standalone or inside the controller, I'm getting this error: qdate:set_timezone("GMT"). ** exception exit: {noproc,{gen_server,call, [qdate_srv,{set_timezone,<0.54.0>,"GMT"}]}} in function gen_server:call/2 (gen_server.erl, line 182) in call from qdate_srv:set_timezone/2 (qdate_srv.erl, line 49) Even though I previously did this: qdate_srv:start_link(). {ok,<0.51.0>} Would anyone be so kind as to tell me what I'm doing wrong (and how to fix it), please? Thanks in advance, *CARLOS PAPARONI * * Web Developer* carlos@REDACTED *CONFIDENTIALITY NOTICE:* This message may contain confidential, privileged and/or proprietary information and/or material for the sole confidential use of Systrix and related parties. The use, copy, dissemination or distribution of this message may only be made by and to authorized parties. If you received this message by mistake, please notify immediately to the sender and Systrix and delete the message. The recipients are advised that NONE of the information and/or material contained in this communication should be interpreted as a digital or electronic signature that can be used in any way to authenticate a contract or other legal document. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan@REDACTED Mon Dec 22 22:47:50 2014 From: ivan@REDACTED (Ivan Uemlianin) Date: Mon, 22 Dec 2014 21:47:50 +0000 Subject: [erlang-questions] Newbie question - running qdate results in noproc, gen_server exception In-Reply-To: References: Message-ID: You might need to do sth like application:start(qdate). (Haven't got computer with me) Best wishes Ivan -- festina lente > On 22 Dec 2014, at 21:21, Carlos Paparoni wrote: > > Hi everyone, I'm fairly (read: extremely) new to Erlang and still learning how to do stuff. > > I'm currently trying to code some timezone functions in ChicagoBoss using the qdate library (https://github.com/choptastic/qdate); however, when trying to test the code either standalone or inside the controller, I'm getting this error: > > qdate:set_timezone("GMT"). > ** exception exit: {noproc,{gen_server,call, > [qdate_srv,{set_timezone,<0.54.0>,"GMT"}]}} > in function gen_server:call/2 (gen_server.erl, line 182) > in call from qdate_srv:set_timezone/2 (qdate_srv.erl, line 49) > > Even though I previously did this: > > qdate_srv:start_link(). > {ok,<0.51.0>} > > Would anyone be so kind as to tell me what I'm doing wrong (and how to fix it), please? > > Thanks in advance, > > CARLOS PAPARONI > Web Developer > carlos@REDACTED > > > CONFIDENTIALITY NOTICE: This message may contain confidential, privileged and/or proprietary information and/or material for the sole confidential use of Systrix and related parties. The use, copy, dissemination or distribution of this message may only be made by and to authorized parties. If you received this message by mistake, please notify immediately to the sender and Systrix and delete the message. The recipients are advised that NONE of the information and/or material contained in this communication should be interpreted as a digital or electronic signature that can be used in any way to authenticate a contract or other legal document. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From gumm@REDACTED Mon Dec 22 22:49:03 2014 From: gumm@REDACTED (Jesse Gumm) Date: Mon, 22 Dec 2014 15:49:03 -0600 Subject: [erlang-questions] Newbie question - running qdate results in noproc, gen_server exception In-Reply-To: References: Message-ID: Hi Carlos, If you do application:start(qdate), it'll start the server appropriately and keep it running. That said, I've been planning on removing the running server requirement, as it's almost certainly not necessary, and most anything the server does can be safely replaced with environment vars. Take care, -Jesse On Mon, Dec 22, 2014 at 3:21 PM, Carlos Paparoni wrote: > Hi everyone, I'm fairly (read: extremely) new to Erlang and still learning > how to do stuff. > > I'm currently trying to code some timezone functions in ChicagoBoss using > the qdate library (https://github.com/choptastic/qdate); however, when > trying to test the code either standalone or inside the controller, I'm > getting this error: > > qdate:set_timezone("GMT"). > ** exception exit: {noproc,{gen_server,call, > > [qdate_srv,{set_timezone,<0.54.0>,"GMT"}]}} > in function gen_server:call/2 (gen_server.erl, line 182) > in call from qdate_srv:set_timezone/2 (qdate_srv.erl, line 49) > > Even though I previously did this: > > qdate_srv:start_link(). > {ok,<0.51.0>} > > Would anyone be so kind as to tell me what I'm doing wrong (and how to fix > it), please? > > Thanks in advance, > > *CARLOS PAPARONI * > * Web Developer* > carlos@REDACTED > *CONFIDENTIALITY NOTICE:* This message may contain confidential, > privileged and/or proprietary information and/or material for the sole > confidential use of Systrix and related parties. The use, copy, > dissemination or distribution of this message may only be made by and to > authorized parties. If you received this message by mistake, please notify > immediately to the sender and Systrix and delete the message. The > recipients are advised that NONE of the information and/or material > contained in this communication should be interpreted as a digital or > electronic signature that can be used in any way to authenticate a contract > or other legal document. > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji@REDACTED Tue Dec 23 01:46:48 2014 From: kenji@REDACTED (Kenji Rikitake) Date: Tue, 23 Dec 2014 09:46:48 +0900 Subject: [erlang-questions] All possible internal states of Erlang/OTP random module are practically computable Message-ID: <20141223004648.GA34572@k2r.org> This is a preliminary result of a brute-force check of the AS183 algorithm looping period, using a C program running in the exactly same algorithm as in the Erlang/OTP random module. The code is shown at the following GitHub repository: https://github.com/jj1bdx/as183-c/ The preliminary result tested on Mac mini 2012 (2.6GHz Core i7) using single core (the code is purely sequential) for *less than nine hours* shows that Internal state loop detected count = 6953607871644, y1 = 3172, y2=9814, y3 = 20125 (The {3172, 9814, 20125} is the internal initial seed value of erlang:seed/0, and given as the initial value of the simulation code.) So the period length is: 6953607871644 ~= 2 ^ (42.661). This period is an expected value in the original AS183 algorithm paper. The fact I observed this time is: A C code can practically exploit all the possible sequence of AS183 in less than NINE HOURS on a Mac mini, far shorter than 880 years shown in the original paper. This suggests you can guess the seed value (three 15-bit integers) from a partial random number sequence, and this can be used for an algorithmic attack. (The calculation is practically easily parallelized, since the internal state values can be obtained for a certain large interval value (of 10^8 in my code, for example).) I am now testing this on an Intel NUC at home running FreeBSD as well. The code is portable and will run on other platforms as well. Conclusion: I have to say that Erlang/OTP "random" module should be revised ASAP. Kenji Rikitake From n.oxyde@REDACTED Tue Dec 23 03:06:22 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 23 Dec 2014 03:06:22 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> Message-ID: <363E3713-E728-4FFF-920B-F9FE004D7D3F@gmail.com> Le 22 d?c. 2014 ? 21:31, Gleb Peregud a ?crit : > Nix does solve most of these problems Nix interests me, but in the context of Erlang, it doesn't support Windows and AFAIR it's a big no-no. From ok@REDACTED Tue Dec 23 05:14:39 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 23 Dec 2014 17:14:39 +1300 Subject: [erlang-questions] All possible internal states of Erlang/OTP random module are practically computable In-Reply-To: <20141223004648.GA34572@k2r.org> References: <20141223004648.GA34572@k2r.org> Message-ID: <0AD10A0F-6460-4CF6-BF01-D723B8BD1B08@cs.otago.ac.nz> On 23/12/2014, at 1:46 pm, Kenji Rikitake wrote: > This is a preliminary result of a brute-force check of the AS183 algorithm > looping period, using a C program running in the exactly same algorithm as in > the Erlang/OTP random module. The result is anything but surprising. > Conclusion: I have to say that Erlang/OTP "random" module should be > revised ASAP. We have known this for some time. There is a 4-generator version of the Wichmann-Hill idea; there is some IP restriction on it which I do not understand. The point is that the inventors of AS183 themselves believe it is past its use-by date. AS183 was an excellent choice for a 4 mB 20 MHz machine that secretly wanted to be a 16-bit machine. Those days are long past. George Marsaglia?s ?Random Number Generators? is a good survey of the 2003 state of the art. Many of the good ones (not excluding the Mersenne Twister) require large mutable tables, so are best done in the VM. There is code for a Complementary-Multiply-With-Carry generator in the right column of page 9, and a table that can be used to shrink the table size to something lighter weight. From kenji@REDACTED Tue Dec 23 08:30:36 2014 From: kenji@REDACTED (Kenji Rikitake) Date: Tue, 23 Dec 2014 16:30:36 +0900 Subject: [erlang-questions] All possible internal states of Erlang/OTP random module are practically computable In-Reply-To: <0AD10A0F-6460-4CF6-BF01-D723B8BD1B08@cs.otago.ac.nz> References: <20141223004648.GA34572@k2r.org> <0AD10A0F-6460-4CF6-BF01-D723B8BD1B08@cs.otago.ac.nz> Message-ID: <20141223073036.GA35777@k2r.org> I know there's NOTHING NEW on this from academic viewpoints. This is just a brute-force scanning of the problem space. The reason why I wrote this on the mailing list was to show the practicality of this rather primitive brute-force computation method. I've proposed and implemented five alternatives for this in Erlang (the algorithms are of other math geniuses): SFMT19937: https://github.com/jj1bdx/sfmt-erlang (Period: 2^19937-1) TinyMT: https://github.com/jj1bdx/tinymt-erlang (Period: 2^127-1) Xorshift*64: https://github.com/jj1bdx/exs64 (Period: 2^64-1) Xorshift+128: https://github.com/jj1bdx/exsplus (Period: 2^128-1) Xorshift*1024: https://github.com/jj1bdx/exs1024 (Period: 2^1024-1) I agree that at least one algorithm should be in Erlang VM as a BIF (Xorshift*64 will be a practical candidate because it's small and is fast on a 64-bit machine, and will provide a sufficient long period). More details on Xorshift*/Xorshift+: http://xorshift.di.unimi.it/ Kenji Rikitake ++> Richard A. O'Keefe [2014-12-23 17:14:39 +1300]: > On 23/12/2014, at 1:46 pm, Kenji Rikitake wrote: > > > This is a preliminary result of a brute-force check of the AS183 algorithm > > looping period, using a C program running in the exactly same algorithm as in > > the Erlang/OTP random module. > > The result is anything but surprising. > > > Conclusion: I have to say that Erlang/OTP "random" module should be > > revised ASAP. > > We have known this for some time. > > There is a 4-generator version of the Wichmann-Hill idea; there is some > IP restriction on it which I do not understand. The point is that the > inventors of AS183 themselves believe it is past its use-by date. > > AS183 was an excellent choice for a 4 mB 20 MHz machine that secretly > wanted to be a 16-bit machine. Those days are long past. > > George Marsaglia?s ?Random Number Generators? is a good survey of > the 2003 state of the art. > > Many of the good ones (not excluding the Mersenne Twister) require > large mutable tables, so are best done in the VM. > There is code for a Complementary-Multiply-With-Carry generator > in the right column of page 9, and a table that can be used to > shrink the table size to something lighter weight. From carlos@REDACTED Mon Dec 22 23:10:58 2014 From: carlos@REDACTED (Carlos Paparoni) Date: Mon, 22 Dec 2014 17:40:58 -0430 Subject: [erlang-questions] Newbie question - running qdate results in noproc, gen_server exception In-Reply-To: References: Message-ID: Thanks Jesse, Ivan, that did the job perfectly. Now I just have to get the controller working with ChicagoBoss (or maybe add the server start code to CB's startup script). *CARLOS PAPARONI * * Web Developer* carlos@REDACTED *CONFIDENTIALITY NOTICE:* This message may contain confidential, privileged and/or proprietary information and/or material for the sole confidential use of Systrix and related parties. The use, copy, dissemination or distribution of this message may only be made by and to authorized parties. If you received this message by mistake, please notify immediately to the sender and Systrix and delete the message. The recipients are advised that NONE of the information and/or material contained in this communication should be interpreted as a digital or electronic signature that can be used in any way to authenticate a contract or other legal document. 2014-12-22 17:19 GMT-04:30 Jesse Gumm : > Hi Carlos, > > If you do application:start(qdate), it'll start the server appropriately > and keep it running. > > That said, I've been planning on removing the running server requirement, > as it's almost certainly not necessary, and most anything the server does > can be safely replaced with environment vars. > > Take care, > > -Jesse > > On Mon, Dec 22, 2014 at 3:21 PM, Carlos Paparoni > wrote: > >> Hi everyone, I'm fairly (read: extremely) new to Erlang and still >> learning how to do stuff. >> >> I'm currently trying to code some timezone functions in ChicagoBoss using >> the qdate library (https://github.com/choptastic/qdate); however, when >> trying to test the code either standalone or inside the controller, I'm >> getting this error: >> >> qdate:set_timezone("GMT"). >> ** exception exit: {noproc,{gen_server,call, >> >> [qdate_srv,{set_timezone,<0.54.0>,"GMT"}]}} >> in function gen_server:call/2 (gen_server.erl, line 182) >> in call from qdate_srv:set_timezone/2 (qdate_srv.erl, line 49) >> >> Even though I previously did this: >> >> qdate_srv:start_link(). >> {ok,<0.51.0>} >> >> Would anyone be so kind as to tell me what I'm doing wrong (and how to >> fix it), please? >> >> Thanks in advance, >> >> *CARLOS PAPARONI * >> * Web Developer* >> carlos@REDACTED >> *CONFIDENTIALITY NOTICE:* This message may contain confidential, >> privileged and/or proprietary information and/or material for the sole >> confidential use of Systrix and related parties. The use, copy, >> dissemination or distribution of this message may only be made by and to >> authorized parties. If you received this message by mistake, please notify >> immediately to the sender and Systrix and delete the message. The >> recipients are advised that NONE of the information and/or material >> contained in this communication should be interpreted as a digital or >> electronic signature that can be used in any way to authenticate a contract >> or other legal document. >> >> _______________________________________________ >> 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidnwelton@REDACTED Tue Dec 23 10:28:15 2014 From: davidnwelton@REDACTED (David Welton) Date: Tue, 23 Dec 2014 10:28:15 +0100 Subject: [erlang-questions] Newbie question - running qdate results in noproc, gen_server exception In-Reply-To: References: Message-ID: > I'm currently trying to code some timezone functions in ChicagoBoss using the qdate library (https://github.com/choptastic/qdate); however, when trying to test the code either standalone or inside the controller, Another thing you *could* do, depending on circumstances, is use other components of your system to handle TZ stuff. For instance, I use Chicago Boss too, and offload all timezone handling to Postgres, since it's only needed in relation to the data I'm fetching from the database. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From n.oxyde@REDACTED Tue Dec 23 10:35:04 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 23 Dec 2014 10:35:04 +0100 Subject: [erlang-questions] All possible internal states of Erlang/OTP random module are practically computable In-Reply-To: <20141223004648.GA34572@k2r.org> References: <20141223004648.GA34572@k2r.org> Message-ID: <3B66C477-7CA6-4D0E-8A6B-7061D3794AB6@gmail.com> The Erlang documentation says: > It should be noted that this random number generator is not cryptographically strong. If a strong cryptographic random number generator is needed for example crypto:rand_bytes/1 could be used instead. I am not sure I understand the alarming tone. Le 23 d?c. 2014 ? 01:46, Kenji Rikitake a ?crit : > Conclusion: I have to say that Erlang/OTP "random" module should be > revised ASAP. From goto310@REDACTED Tue Dec 23 11:03:29 2014 From: goto310@REDACTED (gongtao) Date: Tue, 23 Dec 2014 18:03:29 +0800 (CST) Subject: [erlang-questions] High CPU usage problem In-Reply-To: <5495A970.8080603@gandrade.net> References: <4afb7459.10962.14a67946226.Coremail.goto310@163.com> <5495A19E.2020405@gandrade.net> <5495A8A5.7040103@gandrade.net> <5495A970.8080603@gandrade.net> Message-ID: <56d67039.dd63.14a7699f94c.Coremail.goto310@163.com> Thanks for you reply. I got more informations from system,there is the CPU analyze result,looks like the most cost is sched_yield.What calls in erlang can trigger a sched_yield? % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 83.95 51.691294 18 2917715 sched_yield 13.23 8.147366 60 136096 53085 futex 0.92 0.568038 18 31832 4954 recvfrom 0.91 0.559971 16 35466 51 writev 0.29 0.177944 14 12999 5 stat 0.28 0.172864 16 10555 196 epoll_ctl 0.16 0.095549 95549 1 vfork 0.08 0.048692 73 666 munmap 0.07 0.046025 1 77373 74974 close 0.07 0.045406 16 2815 epoll_wait 0.01 0.008748 35 253 mmap 0.01 0.004698 36 132 getdents 0.01 0.003173 20 156 getsockopt 0.00 0.001910 18 104 setsockopt 0.00 0.001204 16 74 getpeername 0.00 0.000997 13 75 open 0.00 0.000336 8 42 fcntl 0.00 0.000136 7 20 1 accept 0.00 0.000000 0 1 read 0.00 0.000000 0 5 write 0.00 0.000000 0 2 fstat 0.00 0.000000 0 3 mprotect 0.00 0.000000 0 1 brk 0.00 0.000000 0 13 1 access 0.00 0.000000 0 2 pipe 0.00 0.000000 0 2 dup2 0.00 0.000000 0 1 execve 0.00 0.000000 0 1 getcwd 0.00 0.000000 0 1 times 0.00 0.000000 0 1 arch_prctl ------ ----------- ----------- --------- --------- ---------------- 100.00 61.574351 3226407 133267 total In erlang node there is a process called 'erl_prim_loader',this process has the biggest reduction,is it normall? [{registered_name,erl_prim_loader}, {current_function,{erl_prim_loader,loop,3}}, {initial_call,{erlang,apply,2}}, {status,waiting}, {message_queue_len,0}, {messages,[]}, {links,[#Port<0.1>,<0.0.0>]}, {dictionary,[]}, {trap_exit,true}, {error_handler,error_handler}, {priority,normal}, {group_leader,<0.0.0>}, {total_heap_size,57314}, {heap_size,10946}, {stack_size,6}, {reductions,7774178639}, {garbage_collection,[{min_bin_vheap_size,10946}, {min_heap_size,10946}, {fullsweep_after,65535}, {minor_gcs,12}]}, {suspending,[]}] At 2014-12-21 00:53:04, "Guilherme Andrade" wrote: Looking into kernel threads (both current CPU utilisation and consumed CPU time) in something like ps / htop should help. Cheers, On 20-12-2014 16:49, Guilherme Andrade wrote: Now that I look more carefully, it looks like your system is spending a whole lot of CPU time (~75%) in kernel space. Some system call (or calls) is taking away way too many resources. On 20-12-2014 16:19, Guilherme Andrade wrote: Hello gongtao, Besides 'message_queue_len', I would also look into 'reductions' over time (also using process_info/2.) As for big message queues, if the CPU is not overloaded, in most cases it's due to single processes becoming a bottleneck, whether due to IO and/or heavy crunching; if they can be pooled or split into multiple ones, the better. However, you say that CPU is topping at 100%, so it's most likely that it's just too heavy. Long-running NIFs could also cause weird behaviour in the scheduler. This dirty (multiple) one-liner should give you some insight into reduction count: ------------------ rp([{-Reduc, Pid, case process_info(Pid, registered_name) of {registered_name,Name} -> Name; _ -> '_' end} || {Reduc, Pid} <- lists:foldl( fun(Pid, L) when length(L) > 40 -> SL = lists:sublist(lists:keysort(1, L), 20), case process_info(Pid, reductions) of {reductions,Reduc} -> [{-Reduc, Pid} | SL]; undefined -> L end; (Pid, L) -> case process_info(Pid, reductions) of {reductions,Reduc} -> [{-Reduc, Pid} | L]; undefined -> L end end, [], erlang:processes())]). ------------------ Cheers, On 20-12-2014 12:03, gongtao wrote: hello everyone: I am a programmer from china.I have a problem with my game server.There is 8193 processes in my erlang node.But the cpu usage is nearly full,and the computer have 24 cpus.I looked some erlang processes info,find the message_queue_len of process is very big,more than 1000 sometimes.The disk io and net io are normal,memory is normal.My erlang version is R15B03.I don't know why. My english is poor.There are same informations from system.Hope you can understand. Looking forward to your reply. Thanks. -bash-4.2$ sar -u 2 10 Linux 2.6.32-279.el6.x86_64 12/20/2014 _x86_64_ (24 CPU) 06:33:37 PM CPU %user %nice %system %iowait %steal %idle 06:33:39 PM all 11.21 0.00 75.04 0.00 0.00 13.75 06:33:41 PM all 10.91 0.00 77.22 0.00 0.00 11.86 06:33:43 PM all 12.08 0.00 75.96 0.00 0.00 11.97 06:33:45 PM all 10.50 0.00 77.71 0.00 0.00 11.79 06:33:47 PM all 11.09 0.00 76.75 0.00 0.00 12.16 06:33:49 PM all 11.07 0.00 76.03 0.00 0.00 12.90 06:33:51 PM all 12.07 0.00 75.27 0.00 0.00 12.66 06:33:53 PM all 11.36 0.00 76.84 0.00 0.00 11.80 | CPU Utilisation ------------------------------------------------------------------------------------------------------------------------------------- | |---------------------------+-------------------------------------------------+ | |CPU User% Sys% Wait% Idle|0 |25 |50 |75 100| | | 1 14.1 75.9 0.0 9.9|UUUUUUUsssssssssssssssssssssssssssssssssssss >| | | 2 9.8 81.3 0.0 8.8|UUUUssssssssssssssssssssssssssssssssssssssss >| | | 3 11.6 76.9 0.0 11.6|UUUUUssssssssssssssssssssssssssssssssssssss > | | 4 7.6 82.3 0.0 10.1|UUUsssssssssssssssssssssssssssssssssssssssss > | | | 5 14.2 74.1 0.0 11.7|UUUUUUUsssssssssssssssssssssssssssssssssssss > | | | 6 8.6 81.3 0.0 10.1|UUUUssssssssssssssssssssssssssssssssssssssss > | | | 7 11.6 75.9 0.0 12.6|UUUUUsssssssssssssssssssssssssssssssssssss > | | 8 8.5 81.0 0.0 10.5|UUUUssssssssssssssssssssssssssssssssssssssss > | | | 9 11.7 76.1 0.0 12.2|UUUUUssssssssssssssssssssssssssssssssssssss > | | 10 9.1 80.8 0.0 10.1|UUUUssssssssssssssssssssssssssssssssssssssss > | | 11 10.2 76.5 0.0 13.3|UUUUUssssssssssssssssssssssssssssssssssssss > | | | 12 6.6 81.6 0.0 11.7|UUUssssssssssssssssssssssssssssssssssssssss > | | 13 12.1 75.3 0.0 12.6|UUUUUUsssssssssssssssssssssssssssssssssssss > | | 14 9.0 80.6 0.0 10.4|UUUUssssssssssssssssssssssssssssssssssssssss > | | 15 15.7 71.1 0.0 13.2|UUUUUUUsssssssssssssssssssssssssssssssssss >| | | 16 9.2 80.1 0.0 10.7|UUUUssssssssssssssssssssssssssssssssssssssss > | | | 17 13.6 74.2 0.0 12.1|UUUUUUsssssssssssssssssssssssssssssssssssss > | | | 18 7.2 82.1 0.0 10.8|UUUsssssssssssssssssssssssssssssssssssssssss > | | | 19 16.5 69.5 0.0 14.0|UUUUUUUUssssssssssssssssssssssssssssssssss > | | | 20 7.3 81.2 0.0 11.5|UUUssssssssssssssssssssssssssssssssssssssss > | | | 21 17.8 69.0 0.0 13.2|UUUUUUUUssssssssssssssssssssssssssssssssss > | | | 22 11.4 77.2 0.0 11.4|UUUUUssssssssssssssssssssssssssssssssssssss > | | | 23 14.4 71.1 0.0 14.4|UUUUUUUsssssssssssssssssssssssssssssssssss > | | | 24 5.8 81.7 0.0 12.6|UUssssssssssssssssssssssssssssssssssssssss > | | |---------------------------+-------------------------------------------------+ | |Avg 11.0 77.3 0.0 11.7|UUUUUssssssssssssssssssssssssssssssssssssss > | | |---------------------------+-------------------------------------------------+ _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions -- Guilherme https://www.gandrade.net/ PGP: 0x35CB8191 / 1968 5252 3901 B40F ED8A D67A 9330 79B1 35CB 8191 _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions -- Guilherme https://www.gandrade.net/ PGP: 0x35CB8191 / 1968 5252 3901 B40F ED8A D67A 9330 79B1 35CB 8191 _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED://erlang.org/mailman/listinfo/erlang-questions -- Guilherme https://www.gandrade.net/ PGP: 0x35CB8191 / 1968 5252 3901 B40F ED8A D67A 9330 79B1 35CB 8191 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Tue Dec 23 15:56:46 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 23 Dec 2014 15:56:46 +0100 Subject: [erlang-questions] All possible internal states of Erlang/OTP random module are practically computable In-Reply-To: <20141223004648.GA34572@k2r.org> References: <20141223004648.GA34572@k2r.org> Message-ID: While people might already know these things, I'll make a writeup anyway: Random processes are, to a certain extent, a misnomer. When writing computer software, we want different kinds of randomness in different situations. The hard part is that a computer is supposed to be deterministic, and thus, the random process we are building is also, by extension, deterministic. So when we say "random" we mean "indistinguishable from random" It is fairly easy to devise a truly random process: Take a lottery machine. Put a large set of balls into it, half of which has a 0 on them, and half of which has a 1. When we want to make up a random sequence, crank the machine read the bit that comes out and put the bit back into the machine before doing the next draw. Other methods that have been used throughout time are dice throws, pictures of lava lamps, background radiation and so forth. This yields a truly random sequence. In practice, these methods are not feasible for the vast majority of computers, sadly. A sequence generated by random processes like above will have certain properties. In order to make sure it is random, people have devised a large set of tests which such a random sequence passes. The bulk of these are written in Knuth, The Art of Computer Programming Vol 2., but more has happened in the field since then. For a process to "look random", it must pass all of these tests, as we otherwise can claim the generated sequence to be less random than a (truly) random process. So we want a process which passes all the known tests, looks random, but can be implemented on computers. This is where the world of PRNGs (Pseudo-Random Number Generators). AS183 is one such PRNG and it is used in Erlangs 'random' module. It works like every other computational process, it is deterministic. In order to make it look random, it stores a hidden state, in the process dictionary, and evolves that state whenever you draw random values from it. But being a deterministic process, sooner or later, the state will become one of the earlier states and then the sequence will repeat itself. Kenji has showed the period is roughly 2 ^ 43 so after that many draws, the AS183 PRNG repeats itself. There are much better PRNGs out there, with far better periods, and a modern implementation of randomness would probably pick one of these. On a modern computer we would expect far better periods than something which can be computed in 9 hours on modern hardware. The other problem/feature of a PRNG is the state. If you can get hold of the state, you can generate the exact same sequence of random values. In certain settings, this is highly useful. As an example, a benchmark would like to keep the random input "the same" for every run. If your Common Test run fails for a certain random perturbation of your test cases, then you want to repeat that exact order while figuring out what is wrong. If you are using a tool to artificially control the schedulers in your system in order to uncover security bugs, you may want to be able to reproduce a given "random" schedule once you find a problem. On the contrary, however, if the random input was used in cryptographic systems, the repeatability would be devastating! If I know the internal PRNG state, I can predict the next number in the sequence. Many crypto-systems fail spectacularly if the random value is known or predicted. Worse, it might be that I can predict the internal state from the output. Or even worse yet, that I can predict the state from partial output. This makes a PRNG based on a static state dangerous. Even basing the PRNG off of the ubiquituous 'os:timestamp()' won't help at all. A malicious party who knows this, can abuse the knowledge of time in order to narrow down what state the PRNG could have started in. This leads us to the next type of PRNG, the CSPRNG (Cryptographically Safe/Secure PRNG). These, while having the properties of PRNGs in general guards against both of the before-mentioned problems: sequence predictability and internal state. We require, in addition to passing the normal PRNG tests that: * The CSPRNG passes the next-bit test. That is, given k bits of output from the CSPRNG, our prediction of bit k+1 is no better than 50%. * The CSPRNG passes the "state compromise extension". Even if we end up determining the internal state of the CSPRNG, fully or partially, we can't predict the preceeding bits in the output. In order to achieve these two goals, we usually accept a slower generator function. In order to achieve their goal, CSPRNGs usually harvest entropy[0] from different entropy sources. A modern laptop can measure the nanosecond time between keystrokes for instance. Or the arrival time of network packets. And so on. In addition, we can store the current random state on disk between reboots to add even more entropy to the system. This state is then feed into the CSPRNG in order to produce its data. While the CSPRNG is running, it periodically re-cooks itself by feeding in more entropy. Usually, CSPRNGs use well known cryptographic primitives internally to make it impossible to predict what it is going to do, and usually, they are implemented in the operating system kernel for easy entropy-access. CSPRNG selection is somewhat crucial. It is widely regarded that the DUAL_EC_DRBG CSPRNG was backdoored, by means of "magic constants" which it uses internally. There is a hidden of number and if known, then the properities of a CSPRNG is broken for the algorithm. The current fact is that someone knew the hidden numbers and that the "magic constants" were not selected at random in order to weaken security all over the world. There is also a source of randomness in modern CPUs (VIA PadLock, Intel RDRAND on Ivy Bridge and Haswell). This is an entropy source you can use. Due to worries about backdoors, it is currently fed into a CSPRNG as an additional source rather than being used as the sole source (Intel has a alleged CSPRNG in hardware you can call, but most operating systems shy away from it on grounds it is not verifiable). So where does this makes us stand? 1. The 'random' module is not a CSPRNG. It can *never* be used for cryptographically secure randomness. 2. Even when used in its current form, the 'random' module is a weak generator with a short period. Replacing it should definitely be a priority because there are far better PRNGs out there which are faster and have better periods. For a modern system, 2^43 is far too low, while not being in RANDU territory[3]. Not having a PRNG with a nice period in Erlang is somewhat of a weakness. While it doesn't apply to CSPRNG data, you don't want your Non-CSPRNG processes to have randomness this predictable. 3. If you need a CSPRNG, you should use 'crypto:strong_rand_bytes/1'. It turns out that 'crypto:rand_bytes/1' is predictable in some situations and can't be used as a CSPRNG at all. The 'strong_rand_bytes/1' function can return 'low_entropy' which is outright wrong and preposterous on modern machines. It never will, if the underlying random primitive is correctly implemented. The whole idea of "running out of entropy" is false. 4. An alternative CSPRNG is 'enacl:randombytes/1' which is using /dev/urandom on most UNIX systems and 'arc4random' on OpenBSD. This will be a CSPRNG on at least Linux, FreeBSD and OpenBSD. On windows it uses RtlGenRandom, of which I know little. And I have no clue as to what Illumos is doing with its /dev/urandom[2] ? [0] A good way to understand entropy is to make it equivalent with uncertainty. A source with high entropy has high uncertainty if you were to guess what happens. In order to add uncertainty to a process, you harvest entropy. [1] 'rand_bytes/1' is a call to RAND_pseudo_bytes and 'strong_rand_bytes/1' is a call to 'RAND_bytes', see https://www.openssl.org/docs/crypto/RAND_bytes.html [2] Note: On most modern systems, /dev/urandom is the same device as /dev/random. It has the same properties w.r.t security. eNaCl exploits this fact to its fullest. [3] RANDU: http://en.wikipedia.org/wiki/RANDU -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists@REDACTED Tue Dec 23 16:00:57 2014 From: lists@REDACTED (Camille Troillard) Date: Tue, 23 Dec 2014 16:00:57 +0100 Subject: [erlang-questions] Line wrapping issue when attaching to running node Message-ID: <83111B73-54CC-4118-871A-03C0E4C1D923@tuli.pe> Hello, We are experiencing an annoying problem in integration or production environment that deals with incorrect line wrapping when connecting to a remote shell. Erlang version: Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false] Installed on FreeBSD using the `erlang-17.3_3,3` package. We generate a release using rebar. When we want to interact with it, we attach to the system like so (assuming the release is named ?abc?) : $ ./rel/abc/bin/abc attach (abc@REDACTED)1> In this situation, whenever you write something that exceeds the width of the terminal (typically 80 columns), the line wraps onto a second line, which is OK. But if you have an open parenthesis on the first line, that is closed on the second line, then the output becomes garbled, text overwritten and it is no longer possible to sanely use the shell. This is an example of expected output: (abc@REDACTED)1> this_is_an_example_of_a_long_module_name:call_this_function([1 , 2, 3, 4], another_arg). And the actual output (the cursor is on the first line at column 2): .abc@REDACTED, another_arg)an_example_of_a_long_module_name:call_this_function([1 , 2, 3, 4] Text garbling occurs as soon as I hit the first ?]?. It also occurs on ?)?. It does not happen when typing into an erlang shell that was launched using `erl` directly. It seems to happen to_erl. The same erratic behaviour is seen when attach to a release running on FreeBSD or OS X. It does not matter whether the console is running locally or via SSH. Also, it does not seem to matter wether the TERM variable is set to ansi, vt100, xterm or xterm-256color. I would like to know if someone noticed this problem, and how to fix it. Thanks ! Camille From nyarly@REDACTED Tue Dec 23 20:16:08 2014 From: nyarly@REDACTED (Judson Lester) Date: Tue, 23 Dec 2014 19:16:08 +0000 Subject: [erlang-questions] Erlang package manager References: <54980224.8070106@ninenines.eu> <363E3713-E728-4FFF-920B-F9FE004D7D3F@gmail.com> Message-ID: It looks like Windows is a contemplated target of Nix: https://nixos.org/wiki/Nix_on_Windows - in some sense there'd need to be work done to build an erlang packager - that work could instead go into completing Windows support. On Mon Dec 22 2014 at 6:06:25 PM Anthony Ramine wrote: > Le 22 d?c. 2014 ? 21:31, Gleb Peregud a ?crit : > > > Nix does solve most of these problems > > Nix interests me, but in the context of Erlang, it doesn't support Windows > and AFAIR it's a big no-no. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Tue Dec 23 20:50:12 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Tue, 23 Dec 2014 20:50:12 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> <363E3713-E728-4FFF-920B-F9FE004D7D3F@gmail.com> Message-ID: <688A3FC7-A7BD-4785-827A-6A1F1DC46E48@gmail.com> Le 23 d?c. 2014 ? 20:16, Judson Lester a ?crit : > It looks like Windows is a contemplated target of Nix: https://nixos.org/wiki/Nix_on_Windows - in some sense there'd need to be work done to build an erlang packager - that work could instead go into completing Windows support. By support, I meant upstream support in the long term, but if it's a contemplated target as you say there might be hope. From stephane@REDACTED Tue Dec 23 20:59:53 2014 From: stephane@REDACTED (=?utf-8?q?St=C3=A9phane?= Wirtel) Date: Tue, 23 Dec 2014 20:59:53 +0100 Subject: [erlang-questions] Good Explanation of gen_tcp:listen ({active, true}) ? Message-ID: Hi all, In an example from a friend, I see this code. For the listener ``` {ok, ListeningSocket} = gen_tcp:listen(2525, [{active, true}]) ``` And for each worker, there is part in the code of the supervisor. ``` {ok, _Socket} = gen_tcp:accept(ListeningSocket) supervisor.start_child() ``` the code executes a new worker for this client, but I don't understand how the child process can handle the new client connection, because he does not pass the _Socket variable to supervisor.start_child. Do you have a good explanation of this magic thing ? Thank you, Stephane -- St?phane Wirtel - http://wirtel.be - @matrixise From hobson42@REDACTED Tue Dec 23 21:23:50 2014 From: hobson42@REDACTED (Ian) Date: Tue, 23 Dec 2014 20:23:50 +0000 Subject: [erlang-questions] All possible internal states of Erlang/OTP random module are practically computable In-Reply-To: References: <20141223004648.GA34572@k2r.org> Message-ID: <5499CF56.1090500@gmail.com> Hi All, On 23/12/2014 14:56, Jesper Louis Andersen wrote: > For a process to "look random", it must pass all of these tests, as we > otherwise can claim the generated sequence to be less random than a > (truly) random process. This is not true, and disfigures Jesper's otherwise excellent post. Its a subtle point but, a truly random sequence can be expected to fail 5% of randomness tests at 95% significance, and 1% at 99% significance. Different sequences will fail different sets of tests. Any sequence that passes all the tests is (with high confidence) not random, but fudged to pass the tests. Regards Ian -- Ian Hobson Mid Auchentiber, Auchentiber, Kilwinning, North Ayrshire KA13 7RR Tel: 0203 287 1392 Preparing eBooks for Kindle and ePub formats to give the best reader experience. From surferjeff@REDACTED Tue Dec 23 21:27:00 2014 From: surferjeff@REDACTED (Jeffrey Rennie) Date: Tue, 23 Dec 2014 12:27:00 -0800 Subject: [erlang-questions] Windows Pipes as erlang network transport. Message-ID: Sewer is an experiment to use Windows Pipes instead of sockets as the transport for erlang messaging. The current code proves the concept. It plays a game of hot potato using either erlang's native sockets or Windows Pipes. Why would anyone want Windows Pipes instead of sockets? 1. Running in an enterprise environment where Erlang's cookie's do not integrate with existing authentication and security. 2. Want to run on a user's machine, and don't want the Firewall warning to pop up. The user may not even have permission to poke a hole in the firewall. Please give it a try: https://github.com/surferjeff/sewer Does this look useful to anyone? What kind of license would best work with existing Erlang users? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ankitrana1709@REDACTED Tue Dec 23 17:35:11 2014 From: ankitrana1709@REDACTED (Ankit Rana) Date: Tue, 23 Dec 2014 22:05:11 +0530 Subject: [erlang-questions] Adding a self created HTML page to Ejabberd's browser interface Message-ID: Hi all, Greetings! I don't seem to find a plausible way to host/include my HTML page on Ejabberd. Currently several interface pages like Users, Online Users, Virtual Hosts etc are accessible from the menu. I want to add one of my own. Ideas? Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Tue Dec 23 23:22:44 2014 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 23 Dec 2014 23:22:44 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> References: <54980224.8070106@ninenines.eu> <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> Message-ID: Using nix package seems to open a lot of interesting questions. For example: what is the "scope" of an Erlang package manager/build system? I see a hierarchy of needs: 1) Package/distribute/build "pure" Erlang applications This seems at first sight to be easy(ish) but is complicated by the fact that Erlang has changed with time. Program with new language features (say maps in R17+) will not work with R < 17 2) Package apps with NIFS Now we have additional dependencies upon OS, versions of compiler, libraries 3) Package apps with things being interfaced with. For example a particular Erlang library with NIFs and all, might provide an interface to MySQL. Do we want the package to install and build MySQL as well? 4) Package an entire OS with Erlang and MySQL 5) Package a cloud :-) We could in principle start anywhere in this heirarchy. For example to do 1) we'd need to know the SHA1 checksum of the tree describing the Erlang used to test the package, then compile the application into a tree and compute the checksum of the tree. Then store the tree as blob and make it available. The Nix package manager is the only system I'm aware of that seems to address problems like this - an entire system is described by a single SHA1 checksum (in principle) and is thus cacheable - given that we can represent a blob by a hash, and (recursively) a tree by a hash we can describe the state of an entire system by a single hash - at least that's the theory. This is *fantastic* if works in practise - I know the theory but does it really work? This means that, for example, a build of a NIF with a specific version of Erlang with a specific version of gcc and so on reduces to a tree with a specific hash. For common systems we can retrieve a binary copy given the hash, and for uncommon combinations we'll have to rebuild from the sources. Has anybody made any Nix build scripts for Erlang? On Mon, Dec 22, 2014 at 9:38 PM, Tristan Sloughter wrote: > I tried to do this with Nix a while ago and failed miserably -- requires > a lot of hacky bash scripting. If anyone can get it to work I'd be > interested in using it. Interesting - I read the papers and was impressed - I downloaded NiX on my MacBook and the first command in the tutorial I was following failed. Can anybody point me to a good tutorial other than the manual page and various academic papers? Cheers /Joe > -- > Tristan Sloughter > t@REDACTED > > On Mon, Dec 22, 2014, at 02:31 PM, Gleb Peregud wrote: >> On Mon, Dec 22, 2014 at 7:18 PM, Judson Lester wrote: >> > I'm not the only one, but I'd like to raise another voice for Nix. The world >> > has far too many package managers specific to either a virtual machine or an >> > OS distribution, and it's kind of a nightmare. >> > >> > My understanding is that Nix Package Manager (as opposed to the closely >> > related NixOS) fulfills all or almost all the requirements that people are >> > talking about here, as well as allowing unprivileged users to install >> > software, establishing different installation contexts on the same host >> > (i.e. different versions of dependencies for different applications), and >> > completely reproducible installs. >> > >> > But most attractive: it wouldn't be "the Erlang Package Manager" - it'd be >> > "the Erlang application of Nix," which has at least three benefits: Erlang >> > benefits from improvements to Nix, the Erlang community has a stronger basis >> > for input on Nix, and anyone who's used Nix before but not Erlang has the >> > barrier to trying Erlang lowered slightly. >> >> I second this. Nix does solve most of these problems (if not all) in a >> very principled, well-defined and consistent way, including: >> - hermetic, verifiable and reproducible builds >> - patch sets >> - interoperation with other languages >> - really fast >> - transparent binary distribution of artifacts (obviously with >> fallback to building from source) >> - extensive caching of build artifacts >> - private and public repositories >> - unprivileged installation >> - multiple version of the same package can coexist and won't conflict >> - one command deployment (with all dependencies) to normal OS, to >> Docker or to a cloud >> - centralized configuration management >> - developer-friendly >> - etc. etc. etc. >> _______________________________________________ >> 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 imantc@REDACTED Tue Dec 23 23:54:21 2014 From: imantc@REDACTED (Imants Cekusins) Date: Tue, 23 Dec 2014 23:54:21 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> Message-ID: 2) Package apps with NIFS boundary would make sense, no? If non-erlang deps (or even a compatible Erlang version) are not present , the PM could throw an error and indicate the missing dep. If this PM made installing pure erlang code a breeze ( e.g., bash one-liner), it already would be very useful. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Wed Dec 24 00:10:08 2014 From: lloyd@REDACTED (lloyd@REDACTED) Date: Tue, 23 Dec 2014 18:10:08 -0500 (EST) Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> Message-ID: <1419376208.8379287@apps.rackspace.com> Hello, Here's a profoundly naive question reflecting deep ignorance, but a thoughtful response could possible shed a bit of light--- What are the implication of building an Erlang app in Docker? Thanks, LRP -----Original Message----- From: "Joe Armstrong" Sent: Tuesday, December 23, 2014 5:22pm To: "Tristan Sloughter" Cc: "Erlang" Subject: Re: [erlang-questions] Erlang package manager Using nix package seems to open a lot of interesting questions. For example: what is the "scope" of an Erlang package manager/build system? I see a hierarchy of needs: 1) Package/distribute/build "pure" Erlang applications This seems at first sight to be easy(ish) but is complicated by the fact that Erlang has changed with time. Program with new language features (say maps in R17+) will not work with R < 17 2) Package apps with NIFS Now we have additional dependencies upon OS, versions of compiler, libraries 3) Package apps with things being interfaced with. For example a particular Erlang library with NIFs and all, might provide an interface to MySQL. Do we want the package to install and build MySQL as well? 4) Package an entire OS with Erlang and MySQL 5) Package a cloud :-) We could in principle start anywhere in this heirarchy. For example to do 1) we'd need to know the SHA1 checksum of the tree describing the Erlang used to test the package, then compile the application into a tree and compute the checksum of the tree. Then store the tree as blob and make it available. The Nix package manager is the only system I'm aware of that seems to address problems like this - an entire system is described by a single SHA1 checksum (in principle) and is thus cacheable - given that we can represent a blob by a hash, and (recursively) a tree by a hash we can describe the state of an entire system by a single hash - at least that's the theory. This is *fantastic* if works in practise - I know the theory but does it really work? This means that, for example, a build of a NIF with a specific version of Erlang with a specific version of gcc and so on reduces to a tree with a specific hash. For common systems we can retrieve a binary copy given the hash, and for uncommon combinations we'll have to rebuild from the sources. Has anybody made any Nix build scripts for Erlang? On Mon, Dec 22, 2014 at 9:38 PM, Tristan Sloughter wrote: > I tried to do this with Nix a while ago and failed miserably -- requires > a lot of hacky bash scripting. If anyone can get it to work I'd be > interested in using it. Interesting - I read the papers and was impressed - I downloaded NiX on my MacBook and the first command in the tutorial I was following failed. Can anybody point me to a good tutorial other than the manual page and various academic papers? Cheers /Joe > -- > Tristan Sloughter > t@REDACTED > > On Mon, Dec 22, 2014, at 02:31 PM, Gleb Peregud wrote: >> On Mon, Dec 22, 2014 at 7:18 PM, Judson Lester wrote: >> > I'm not the only one, but I'd like to raise another voice for Nix. The world >> > has far too many package managers specific to either a virtual machine or an >> > OS distribution, and it's kind of a nightmare. >> > >> > My understanding is that Nix Package Manager (as opposed to the closely >> > related NixOS) fulfills all or almost all the requirements that people are >> > talking about here, as well as allowing unprivileged users to install >> > software, establishing different installation contexts on the same host >> > (i.e. different versions of dependencies for different applications), and >> > completely reproducible installs. >> > >> > But most attractive: it wouldn't be "the Erlang Package Manager" - it'd be >> > "the Erlang application of Nix," which has at least three benefits: Erlang >> > benefits from improvements to Nix, the Erlang community has a stronger basis >> > for input on Nix, and anyone who's used Nix before but not Erlang has the >> > barrier to trying Erlang lowered slightly. >> >> I second this. Nix does solve most of these problems (if not all) in a >> very principled, well-defined and consistent way, including: >> - hermetic, verifiable and reproducible builds >> - patch sets >> - interoperation with other languages >> - really fast >> - transparent binary distribution of artifacts (obviously with >> fallback to building from source) >> - extensive caching of build artifacts >> - private and public repositories >> - unprivileged installation >> - multiple version of the same package can coexist and won't conflict >> - one command deployment (with all dependencies) to normal OS, to >> Docker or to a cloud >> - centralized configuration management >> - developer-friendly >> - etc. etc. etc. >> _______________________________________________ >> 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 jesper.louis.andersen@REDACTED Wed Dec 24 00:17:50 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 23 Dec 2014 23:17:50 +0000 Subject: [erlang-questions] All possible internal states of Erlang/OTP random module are practically computable References: <20141223004648.GA34572@k2r.org> <5499CF56.1090500@gmail.com> Message-ID: Hi Ian, You are totally correct in your observation. Many of the randomness tests are "passed" if your sequence follows a certain distribution obtained from running the test. Of course, sometimes a generator will fail a test, but this is to be expected, as per your notions. But if it fails the test "too often", then it is grounds for worry as the generator doesn't seem to handle the particular test well and this could expose a weakness in the generator. On Tue Dec 23 2014 at 9:24:05 PM Ian wrote: > Hi All, > > On 23/12/2014 14:56, Jesper Louis Andersen wrote: > > For a process to "look random", it must pass all of these tests, as we > > otherwise can claim the generated sequence to be less random than a > > (truly) random process. > This is not true, and disfigures Jesper's otherwise excellent post. > > Its a subtle point but, a truly random sequence can be expected to fail > 5% of randomness tests at 95% significance, and 1% at 99% significance. > > Different sequences will fail different sets of tests. > > Any sequence that passes all the tests is (with high confidence) not > random, but fudged to pass the tests. > > Regards > > Ian > > -- > Ian Hobson > Mid Auchentiber, Auchentiber, Kilwinning, North Ayrshire KA13 7RR > Tel: 0203 287 1392 > Preparing eBooks for Kindle and ePub formats to give the best reader > experience. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy.j.li@REDACTED Wed Dec 24 09:56:14 2014 From: andy.j.li@REDACTED (Andy Li J) Date: Wed, 24 Dec 2014 08:56:14 +0000 Subject: [erlang-questions] How to define snmp get bulk request pdu including max-repetitions and no-repeaters Message-ID: <3657600B1AAAE34C9A9DABD197B9106B1CA3CC7E@ESGSCMB103.ericsson.se> Hi all, If I want to define a snmp get request pdu, and the format as follows: #pdu{ type = 'get-request', request_id = ReqId, error_status = noError, error_index = 0, varbinds } And if I want to define a snmp get bulk pdu including max-repetitions and no-repeaters, how to define it? I try the following, but report max_repetitions and no_repeaters undefined in record pdu. #pdu{ type = 'get-bulk-request', request_id = ReqId, max_repetitions = MaxRepetitions, non_repeaters = NonRepeaters, varbinds } But I find that in RFC3416, BulkPDU ::= -- must be identical in SEQUENCE { -- structure to PDU request-id INTEGER (-214783648..214783647), non-repeaters INTEGER (0..max-bindings), max-repetitions INTEGER (0..max-bindings), variable-bindings -- values are ignored VarBindList } Could you help me? Thanks very much. B.R Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Wed Dec 24 11:55:28 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Wed, 24 Dec 2014 11:55:28 +0100 Subject: [erlang-questions] All possible internal states of Erlang/OTP random module are practically computable Message-ID: ____ make_ref() Returns an almost unique reference. The returned reference will reoccur after approximately 2^82 calls; therefore it is unique enough for most practical purposes. ____ hi, could this function a base for a better non cryptographic random generator ? phash2 on such make_ref() value does not help with 2^32 cycle... regards ? Envoy? depuis mon mobile ? Eric From roberto@REDACTED Wed Dec 24 12:40:49 2014 From: roberto@REDACTED (Roberto Ostinelli) Date: Wed, 24 Dec 2014 12:40:49 +0100 Subject: [erlang-questions] Hackney socket Message-ID: Hello, I'm using hackney to send a HTTPS request. The server I'm connecting to will keep the resulting TCP connection open, so that it then becomes a two-way communication channel using HTTP chunk. I therefore need to retrieve the Socket from a Connection Reference, so I can send chunked data into it. Does anyone know what is the cleanest way to retrieve the underlying socket from a Connection Reference? Best, r. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominik_pawlak@REDACTED Wed Dec 24 13:48:12 2014 From: dominik_pawlak@REDACTED (Dominik Pawlak) Date: Wed, 24 Dec 2014 13:48:12 +0100 Subject: [erlang-questions] How to define snmp get bulk request pdu including max-repetitions and no-repeaters In-Reply-To: <3657600B1AAAE34C9A9DABD197B9106B1CA3CC7E@ESGSCMB103.ericsson.se> References: <3657600B1AAAE34C9A9DABD197B9106B1CA3CC7E@ESGSCMB103.ericsson.se> Message-ID: <549AB60C.6010403@yahoo.co.uk> Hello Andy, Don't know why you try to construct the pdu yourself, but I can see that in the snmp application the code for constructing bulk request pdu is: make_pdu(bulk, {NonRepeaters, MaxRepetitions, Oids}, MiniMIB) -> Foids = [flatten_oid(Oid, MiniMIB) || Oid <- Oids], #pdu{type = 'get-bulk-request', request_id = request_id(), * error_status = NonRepeaters, ** ** error_index = MaxRepetitions,* varbinds = [make_vb(Foid) || Foid <- Foids]}; The standard way to perform a bulk request would be: snmpm:sync_get_bulk("snmp_user", "snmp_agent", 0, 3, [[1,3,6,1,4,1,14817,3,12,2,10,1,5,1]]). Best Dominik On 24.12.2014 09:56, Andy Li J wrote: > > Hi all, > > If I want to define a snmp get request pdu, and the format as follows: > > #pdu{ type = ?get-request?, request_id = ReqId, > > error_status = noError, error_index = 0, > > varbinds } > > And if I want to define a snmp get bulk pdu including max-repetitions > and no-repeaters, how to define it? > > I try the following, but report max_repetitions and no_repeaters > undefined in record pdu. > > #pdu{ type = ?get-bulk-request?, request_id = ReqId, > > max_repetitions = MaxRepetitions, non_repeaters = > NonRepeaters, > > varbinds } > > But I find that in RFC3416, > > BulkPDU ::= -- must be identical in > > SEQUENCE { -- structure to PDU > > request-id INTEGER (-214783648..214783647), > > non-repeaters INTEGER (0..max-bindings), > > max-repetitions INTEGER (0..max-bindings), > > variable-bindings -- values are ignored > > VarBindList > > } > > Could you help me? Thanks very much. > > B.R > > Andy > > > > _______________________________________________ > 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 Dec 24 18:45:23 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 24 Dec 2014 18:45:23 +0100 Subject: [erlang-questions] Hackney socket In-Reply-To: References: Message-ID: On Wed, Dec 24, 2014 at 12:40 PM, Roberto Ostinelli wrote: > Hello, > I'm using hackney to send a HTTPS request. The server I'm connecting to > will keep the resulting TCP connection open, so that it then becomes a > two-way communication channel using HTTP chunk. > > I therefore need to retrieve the Socket from a Connection Reference, so I > can send chunked data into it. > > Does anyone know what is the cleanest way to retrieve the underlying > socket from a Connection Reference? > > Best, > r. > > If you want to reuse the socket and cancel the request then you can use `hackney:cancel_request/1` . Note that you can directly send chunks using hackney if you specify the Tranfer-Encoding header. Hackney will take care about it. It also works if you want to stream the request. - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Wed Dec 24 20:05:43 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 24 Dec 2014 20:05:43 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> Message-ID: On Mon, Dec 22, 2014 at 9:32 PM, Tuncer Ayaz wrote: > On Mon, Dec 22, 2014 at 7:18 PM, Judson Lester wrote: > > I'm not the only one, but I'd like to raise another voice for Nix. > > The world has far too many package managers specific to either a > > virtual machine or an OS distribution, and it's kind of a > > nightmare. > > > > My understanding is that Nix Package Manager (as opposed to the > > closely related NixOS) fulfills all or almost all the requirements > > that people are talking about here, as well as allowing > > unprivileged users to install software, establishing different > > installation contexts on the same host (i.e. different versions of > > dependencies for different applications), and completely > > reproducible installs. > > > > But most attractive: it wouldn't be "the Erlang Package Manager" - > > it'd be "the Erlang application of Nix," which has at least three > > benefits: Erlang benefits from improvements to Nix, the Erlang > > community has a stronger basis for input on Nix, and anyone who's > > used Nix before but not Erlang has the barrier to trying Erlang > > lowered slightly. > > Yes, Nix solves a lot of common issues in elegant ways, and if we go > that route, I'd support it. I should add, though, that Nix as it is may not necessarily be an exact fit for Erlang's requirements, but it sure has a better design than other package managers. That means, we'd have to figure out how Nix can fulfill the requirements, and, if any, what modifications we'd need. From tuncer.ayaz@REDACTED Wed Dec 24 20:07:39 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 24 Dec 2014 20:07:39 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> Message-ID: On Tue, Dec 23, 2014 at 11:22 PM, Joe Armstrong wrote: > Can anybody point me to a good tutorial other than the manual page > and various academic papers? https://ocharles.org.uk/blog/posts/2014-02-04-how-i-develop-with-nixos.html http://www.cse.chalmers.se/~bernardy/nix.html http://www.pavelkogan.com/2014/07/09/haskell-development-with-nix/ From jesper.louis.andersen@REDACTED Thu Dec 25 03:17:16 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 25 Dec 2014 03:17:16 +0100 Subject: [erlang-questions] Good Explanation of gen_tcp:listen ({active, true}) ? In-Reply-To: References: Message-ID: Hi Stephane, The process which calls `gen_tcp:accept(LSock)` becomes what is called the "controlling process" of the socket. It will receive data on the socket as messages in the form {tcp, Socket, Data}. Strictly speaking the _Socket is not needed for you to receive active messages like this. But you can't tell different sockets apart from each other. And worse, since you have no reference to the socket, you can't close the socket and you can't change it's properties. The only way to close the socket is by terminating the (worker) process who is the controller. There are no other ways around this. And usually, I would call this way of coding rather bad style. There is no function `supervisor:start_child/0` so your friends code will not work, but will fail. There has to be something intricate going on here if the code works. Usually, you arrange it such that the right process is the one calling accept, so the right process becomes the controller. Or you give away control by calling the gen_tcp call to change the controlling process to another. However, when doing so, care must be taken since the listen socket is active by default, so a race might occur where the wrong process ends up with a message. Finally, I would recommend your friend to use {active, once} semantics instead of {active, true} since it removes the situation where a fast peer can outrun your Erlang code. Instead, the principles of flow control will be invoked by TCP once the receiver window fills up, allowing you to handle data at the pace your system can digest. On Tue Dec 23 2014 at 9:02:45 PM St?phane Wirtel wrote: > Hi all, > > In an example from a friend, I see this code. > > For the listener > ``` > {ok, ListeningSocket} = gen_tcp:listen(2525, [{active, true}]) > ``` > > And for each worker, there is part in the code of the supervisor. > > ``` > {ok, _Socket} = gen_tcp:accept(ListeningSocket) > > supervisor.start_child() > ``` > > the code executes a new worker for this client, but I don't understand > how the child process can handle the new client connection, > because he does not pass the _Socket variable to supervisor.start_child. > > Do you have a good explanation of this magic thing ? > > Thank you, > > Stephane > -- > St?phane Wirtel - http://wirtel.be - @matrixise > _______________________________________________ > 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 Thu Dec 25 03:32:28 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 25 Dec 2014 02:32:28 +0000 Subject: [erlang-questions] All possible internal states of Erlang/OTP random module are practically computable References: Message-ID: A quick guess would be no. I'm pretty sure such a solution would have two problems: * It would not pass the necessary statistical tests well enough. * It would be considerably slower than appropriating a PRNG made for the purpose. On Wed Dec 24 2014 at 11:55:35 AM Eric Pailleau wrote: > ____ > make_ref() > > Returns an almost unique reference. > > The returned reference will reoccur after approximately 2^82 calls; > therefore it is unique enough for most practical purposes. > ____ > > hi, > could this function a base for a better non cryptographic random > generator ? > phash2 on such make_ref() value does not help with 2^32 cycle... > regards > > > > > ? Envoy? depuis mon mobile ? Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From drormein@REDACTED Thu Dec 25 11:55:46 2014 From: drormein@REDACTED (Dror Mein) Date: Thu, 25 Dec 2014 10:55:46 +0000 (UTC) Subject: [erlang-questions] how to dynamically create function to run in a different node Message-ID: <1617333044.1259127.1419504946319.JavaMail.yahoo@jws106129.mail.bf1.yahoo.com> Hi all,I want to send a function created dynamically in one node to a second node to be run there. If I do this with erlang shell it works because the created function is compiled with erl_eval:?(abe)1> A = fun() -> io:format(use, "sup", []) end.#Fun?(abe)2> B=fun test:hey/0. #Fun(abe)3>{shell, bob} ! A.A(abe)4>{shell, bob} ! B. B (bob)1>register(shell, self()).true(bob)2>receive A -> A() end.supok(bob)3>receive B -> B() end.** exception error: undefined function test:hey/0 If I load the module to the second node it will work, but then I have to have all the parameters set.?My preferred solution would be somehow to compile a function turning it into in a module. Is it possible? will it work? thank you all -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Thu Dec 25 20:29:39 2014 From: ulf@REDACTED (Ulf Wiger) Date: Thu, 25 Dec 2014 20:29:39 +0100 Subject: [erlang-questions] how to dynamically create function to run in a different node In-Reply-To: <1617333044.1259127.1419504946319.JavaMail.yahoo@jws106129.mail.bf1.yahoo.com> References: <1617333044.1259127.1419504946319.JavaMail.yahoo@jws106129.mail.bf1.yahoo.com> Message-ID: <24A572A4-2B88-435B-B25D-F8C2A842D5C9@feuerlabs.com> On 25 Dec 2014, at 11:55, Dror Mein wrote: > My preferred solution would be somehow to compile a function turning it into in a module. Is it possible? will it work? > One solution to this can be found in the locks application: https://github.com/uwiger/locks/blob/master/src/locks_watcher.erl The code is invoked via a parse transform: https://github.com/uwiger/locks/blob/master/src/locks_agent.erl#L39 And the transform expands the pseudo-call `locks_watcher(self())` https://github.com/uwiger/locks/blob/master/src/locks_agent.erl#L731 watch_node(N) -> {M, F, A} = locks_watcher(self()), % expanded through parse_transform P = spawn(N, M, F, A), erlang:monitor(process, P). The {M, F, A} tuple will be {erl_eval, exprs, [Exprs, Bindings]}, where Exprs is the abstract-form representation of the code for locks_watcher:locks_watcher/1. Another version can be found in the deqc application: https://github.com/uwiger/deqc/blob/master/src/deqc_proxy.erl#L80 where the function disconnect_script(Node) ends up returning a list of abstract forms via some parse transform magic. disconnect_script(EqcNode) -> codegen:exprs( fun() -> Nodes = nodes(), [net_kernel:disconnect(N) || N <- Nodes -- [{'$var', EqcNode}]] end). The function codegen:exprs/1 is a pseudo function handled by parse_trans_codegen. BR, Ulf W Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail URL: From tthread@REDACTED Fri Dec 26 00:51:40 2014 From: tthread@REDACTED (Ilya Shcherbak) Date: Fri, 26 Dec 2014 00:51:40 +0100 Subject: [erlang-questions] socket_closed_unexpectedly with clustered RabbitMQ in EC2 In-Reply-To: References: Message-ID: Hey, there is heartbeat parameter in RMQ connection. for prevent closing session by proxy u need to turn on it. (it's turned of by default if u use erlang amqp_client). but u need to negotiate this parameter and IDLE tcp timeout parameter in AWS load balancer. https://www.rabbitmq.com/configure.html if u use eralng amqp_client u can establish connection like this: amqp_connection:start( #amqp_params_network{ host = Host, port = Port, ... heartbeat = 30 %%
  • heartbeat :: non_neg_integer() - The hearbeat interval in seconds, %% defaults to 0 (turned off) (network only)
  • } ). Ilya Shcherbak 2014-12-10 23:56 GMT+01:00 Youngkin, Rich : > Looking at this a bit more it turns out the the default haproxy client > timeout was 50 seconds. Changing this to other values (larger and smaller) > changed the frequency of the socket_closed_unexpectedly errors. So I think > I answered my own question. Thanks to anyone who took a look at this in the > meantime. > > Thanks, > Rich > > > On Wed, Dec 10, 2014 at 10:59 AM, Youngkin, Rich < > richard.youngkin@REDACTED> wrote: > >> Hi, >> >> I'm using the Erlang amqp client and am getting a >> "socket_closed_unexpectedly" CRASH REPORT. This error happens regardless of >> whether the application is actively publishing or consuming messages (i.e., >> the app is idle, but connected to RabbitMQ). This doesn't happen in a >> non-EC2 environment or in a single-zone EC2 environment. >> >> Here are some environmental details: >> >> 1. My application is using Erlang version is R15B01 >> 2. amqp_client-2.7.1 >> 3. RabbitMQ 3.2.2 using Erlang R14B04 >> >> Here are the details regarding the EC2 configuration: >> >> 1. 2 EC2 zones in the same EC2 region >> 2. 2 RabbitMQ instances per Zone - 4 total instances >> 3. All RabbitMQ instances are clustered (cluster_partition_handling >> set to pause_minority). >> 4. 2 Application instances per Zone (my app) - 4 total instances >> 5. There is an haproxy between my app and the RabbitMQ cluster >> 6. My application is using Mnesia and it's clustered across all app >> instances >> >> I've included the text from the SASL log below. >> >> As I stated above, the error message occurs whether my application is >> publishing or not. It does happen more frequently while publishing is >> occurring. It looks to me like AMQP is recovering/restarting the affected >> processes, but I'd like to better understand why it's occurring and fix it >> if possible. The error is happening regularly, every 50 seconds. This >> seems significant. >> >> Any help is appreciated. >> >> Thanks! >> Rich >> >> >> =CRASH REPORT==== 8-Dec-2014::20:52:34 === >> >> crasher: >> >> initial call: amqp_gen_connection:init/1 >> >> pid: <0.5460.10> >> >> registered_name: [] >> >> exception exit: socket_closed_unexpectedly >> >> in function gen_server:terminate/6 (gen_server.erl, line 747) >> >> ancestors: [<0.5459.10>,amqp_sup,<0.4172.0>] >> >> messages: [] >> >> links: [<0.6264.0>,<0.5459.10>,#Port<0.7206767>] >> >> dictionary: [] >> >> trap_exit: false >> >> status: running >> >> heap_size: 610 >> >> stack_size: 24 >> >> reductions: 717 >> >> neighbours: >> >> >> =SUPERVISOR REPORT==== 9-Dec-2014::20:55:15 === >> >> Supervisor: {<0.4172.0>,amqp_connection_sup} >> >> Context: child_terminated >> >> Reason: socket_closed_unexpectedly >> >> Offender: [{pid,<0.4173.0>}, >> >> {name,connection}, >> >> {mfa, >> >> {amqp_gen_connection,start_link, >> >> [amqp_network_connection, >> >> {amqp_params_network,<<"guest">>,<<"guest">>, >> >> >> <<"/">>,"10.199.30.169",5672,0,0,1000,infinity, >> >> none, >> >> [#Fun, >> >> #Fun], >> >> [],[]}, >> >> #Fun, >> >> #Fun,[]]}}, >> >> {restart_type,intrinsic}, >> >> {shutdown,brutal_kill}, >> >> {child_type,worker}] >> >> =SUPERVISOR REPORT==== 9-Dec-2014::20:55:15 === >> Supervisor: {<0.4172.0>,amqp_connection_sup} >> Context: shutdown >> Reason: reached_max_restart_intensity >> Offender: [{pid,<0.4173.0>}, >> {name,connection}, >> {mfa, >> {amqp_gen_connection,start_link, >> [amqp_network_connection, >> {amqp_params_network,<<"guest">>,<<"guest">>, >> >> <<"/">>,"10.199.30.169",5672,0,0,1000,infinity, >> none, >> [#Fun, >> #Fun], >> [],[]}, >> #Fun, >> #Fun,[]]}}, >> {restart_type,intrinsic}, >> {shutdown,brutal_kill}, >> {child_type,worker}] >> >> =PROGRESS REPORT==== 9-Dec-2014::20:55:15 === supervisor: >> {<0.4320.0>,amqp_connection_sup} started: [{pid,<0.4321.0>}, >> {name,connection}, {mfa, {amqp_gen_connection,start_link, >> [amqp_network_connection, {amqp_params_network,<<"guest">>,<<"guest">>, >> <<"/">>,"10.199.30.169",5672,0,0,1000, infinity,none, >> [#Fun, >> #Fun], [],[]}, >> #Fun, >> #Fun,[]]}}, {restart_type,intrinsic}, >> {shutdown,brutal_kill}, {child_type,worker}] >> >> ... >> >> >> > > _______________________________________________ > 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 Fri Dec 26 12:30:04 2014 From: eriksoe@REDACTED (=?UTF-8?Q?Erik_S=C3=B8e_S=C3=B8rensen?=) Date: Fri, 26 Dec 2014 12:30:04 +0100 Subject: [erlang-questions] All possible internal states of Erlang/OTP random module are practically computable In-Reply-To: References: <20141223004648.GA34572@k2r.org> Message-ID: Another minor nitpick with the nice explanation: > But being a deterministic process, sooner or later, the state will become one of the earlier states and then the sequence will repeat itself. Having a *limited state space* (a bounded number of bits), the process will sooner or later revisit one of the earlier states. Being a *deterministic process*, once a state has been revisited, the sequence will repeat itself, yielding the same numbers it did from the first time it was in that state. Just to get things right - I'm confident that you know this but that it slipped in the explanation. (It's a lot of words anyhow.) /Erik 2014-12-23 15:56 GMT+01:00 Jesper Louis Andersen < jesper.louis.andersen@REDACTED>: > While people might already know these things, I'll make a writeup anyway: > > Random processes are, to a certain extent, a misnomer. When writing > computer software, we want different kinds of randomness in different > situations. The hard part is that a computer is supposed to be > deterministic, and thus, the random process we are building is also, by > extension, deterministic. So when we say "random" we mean > "indistinguishable from random" It is fairly easy to devise a truly random > process: > > Take a lottery machine. Put a large set of balls into it, half of which > has a 0 on them, and half of which has a 1. When we want to make up a > random sequence, crank the machine read the bit that comes out and put the > bit back into the machine before doing the next draw. Other methods that > have been used throughout time are dice throws, pictures of lava lamps, > background radiation and so forth. This yields a truly random sequence. In > practice, these methods are not feasible for the vast majority of > computers, sadly. > > A sequence generated by random processes like above will have certain > properties. In order to make sure it is random, people have devised a large > set of tests which such a random sequence passes. The bulk of these are > written in Knuth, The Art of Computer Programming Vol 2., but more has > happened in the field since then. For a process to "look random", it must > pass all of these tests, as we otherwise can claim the generated sequence > to be less random than a (truly) random process. > > So we want a process which passes all the known tests, looks random, but > can be implemented on computers. This is where the world of PRNGs > (Pseudo-Random Number Generators). AS183 is one such PRNG and it is used in > Erlangs 'random' module. It works like every other computational process, > it is deterministic. In order to make it look random, it stores a hidden > state, in the process dictionary, and evolves that state whenever you draw > random values from it. But being a deterministic process, sooner or later, > the state will become one of the earlier states and then the sequence will > repeat itself. Kenji has showed the period is roughly 2 ^ 43 so after that > many draws, the AS183 PRNG repeats itself. There are much better PRNGs out > there, with far better periods, and a modern implementation of randomness > would probably pick one of these. On a modern computer we would expect far > better periods than something which can be computed in 9 hours on modern > hardware. > > The other problem/feature of a PRNG is the state. If you can get hold of > the state, you can generate the exact same sequence of random values. In > certain settings, this is highly useful. As an example, a benchmark would > like to keep the random input "the same" for every run. If your Common Test > run fails for a certain random perturbation of your test cases, then you > want to repeat that exact order while figuring out what is wrong. If you > are using a tool to artificially control the schedulers in your system in > order to uncover security bugs, you may want to be able to reproduce a > given "random" schedule once you find a problem. > > On the contrary, however, if the random input was used in cryptographic > systems, the repeatability would be devastating! If I know the internal > PRNG state, I can predict the next number in the sequence. Many > crypto-systems fail spectacularly if the random value is known or > predicted. Worse, it might be that I can predict the internal state from > the output. Or even worse yet, that I can predict the state from partial > output. This makes a PRNG based on a static state dangerous. Even basing > the PRNG off of the ubiquituous 'os:timestamp()' won't help at all. A > malicious party who knows this, can abuse the knowledge of time in order to > narrow down what state the PRNG could have started in. > > This leads us to the next type of PRNG, the CSPRNG (Cryptographically > Safe/Secure PRNG). These, while having the properties of PRNGs in general > guards against both of the before-mentioned problems: sequence > predictability and internal state. We require, in addition to passing the > normal PRNG tests that: > > * The CSPRNG passes the next-bit test. That is, given k bits of output > from the CSPRNG, our prediction of bit k+1 is no better than 50%. > * The CSPRNG passes the "state compromise extension". Even if we end up > determining the internal state of the CSPRNG, fully or partially, we can't > predict the preceeding bits in the output. > > In order to achieve these two goals, we usually accept a slower generator > function. > > In order to achieve their goal, CSPRNGs usually harvest entropy[0] from > different entropy sources. A modern laptop can measure the nanosecond time > between keystrokes for instance. Or the arrival time of network packets. > And so on. In addition, we can store the current random state on disk > between reboots to add even more entropy to the system. This state is then > feed into the CSPRNG in order to produce its data. While the CSPRNG is > running, it periodically re-cooks itself by feeding in more entropy. > Usually, CSPRNGs use well known cryptographic primitives internally to make > it impossible to predict what it is going to do, and usually, they are > implemented in the operating system kernel for easy entropy-access. > > CSPRNG selection is somewhat crucial. It is widely regarded that the > DUAL_EC_DRBG CSPRNG was backdoored, by means of "magic constants" which it > uses internally. There is a hidden of number and if known, then the > properities of a CSPRNG is broken for the algorithm. The current fact is > that someone knew the hidden numbers and that the "magic constants" were > not selected at random in order to weaken security all over the world. > > There is also a source of randomness in modern CPUs (VIA PadLock, Intel > RDRAND on Ivy Bridge and Haswell). This is an entropy source you can use. > Due to worries about backdoors, it is currently fed into a CSPRNG as an > additional source rather than being used as the sole source (Intel has a > alleged CSPRNG in hardware you can call, but most operating systems shy > away from it on grounds it is not verifiable). > > So where does this makes us stand? > > 1. The 'random' module is not a CSPRNG. It can *never* be used for > cryptographically secure randomness. > > 2. Even when used in its current form, the 'random' module is a weak > generator with a short period. Replacing it should definitely be a priority > because there are far better PRNGs out there which are faster and have > better periods. For a modern system, 2^43 is far too low, while not being > in RANDU territory[3]. Not having a PRNG with a nice period in Erlang is > somewhat of a weakness. While it doesn't apply to CSPRNG data, you don't > want your Non-CSPRNG processes to have randomness this predictable. > > 3. If you need a CSPRNG, you should use 'crypto:strong_rand_bytes/1'. It > turns out that 'crypto:rand_bytes/1' is predictable in some situations and > can't be used as a CSPRNG at all. The 'strong_rand_bytes/1' function can > return 'low_entropy' which is outright wrong and preposterous on modern > machines. It never will, if the underlying random primitive is correctly > implemented. The whole idea of "running out of entropy" is false. > > 4. An alternative CSPRNG is 'enacl:randombytes/1' which is using > /dev/urandom on most UNIX systems and 'arc4random' on OpenBSD. This will be > a CSPRNG on at least Linux, FreeBSD and OpenBSD. On windows it uses > RtlGenRandom, of which I know little. And I have no clue as to what Illumos > is doing with its /dev/urandom[2] > ? > [0] A good way to understand entropy is to make it equivalent with > uncertainty. A source with high entropy has high uncertainty if you were to > guess what happens. In order to add uncertainty to a process, you harvest > entropy. > [1] 'rand_bytes/1' is a call to RAND_pseudo_bytes and > 'strong_rand_bytes/1' is a call to 'RAND_bytes', see > https://www.openssl.org/docs/crypto/RAND_bytes.html > [2] Note: On most modern systems, /dev/urandom is the same device as > /dev/random. It has the same properties w.r.t security. eNaCl exploits this > fact to its fullest. > [3] RANDU: http://en.wikipedia.org/wiki/RANDU > > > _______________________________________________ > 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 Fri Dec 26 12:42:08 2014 From: eriksoe@REDACTED (=?UTF-8?Q?Erik_S=C3=B8e_S=C3=B8rensen?=) Date: Fri, 26 Dec 2014 12:42:08 +0100 Subject: [erlang-questions] All possible internal states of Erlang/OTP random module are practically computable In-Reply-To: References: Message-ID: There's another problem: seeding. erik@REDACTED:~$ erl -noshell -eval 'io:format("~p\n", [make_ref()]), init:stop().' #Ref<0.0.0.27> erik@REDACTED:~$ erl -noshell -eval 'io:format("~p\n", [make_ref()]), init:stop().' #Ref<0.0.0.27> That is, while the state space may be as big as 2^82, only the first tinyish part of it is of interest to an attacker, so the effective state space is much smaller. 2014-12-25 3:32 GMT+01:00 Jesper Louis Andersen < jesper.louis.andersen@REDACTED>: > A quick guess would be no. I'm pretty sure such a solution would have two > problems: > > * It would not pass the necessary statistical tests well enough. > * It would be considerably slower than appropriating a PRNG made for the > purpose. > > On Wed Dec 24 2014 at 11:55:35 AM Eric Pailleau > wrote: > >> ____ >> make_ref() >> >> Returns an almost unique reference. >> >> The returned reference will reoccur after approximately 2^82 calls; >> therefore it is unique enough for most practical purposes. >> ____ >> >> hi, >> could this function a base for a better non cryptographic random >> generator ? >> phash2 on such make_ref() value does not help with 2^32 cycle... >> regards >> >> >> >> >> ? Envoy? depuis mon mobile ? Eric > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Fri Dec 26 13:56:21 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Fri, 26 Dec 2014 13:56:21 +0100 Subject: [erlang-questions] All possible internal states of Erlang/OTP random module are practically computable Message-ID: hi, yes, good catch. I did not thought that make_ref() itself was a good candidate, but maybe the underlaying code allowing 2^82 space could be reused. but looks like the statistical tests would not pass anyway... ? Envoy? depuis mon mobile ? Eric Erik S?e S?rensen a ?crit?: >There's another problem: seeding. > >erik@REDACTED:~$ erl -noshell -eval 'io:format("~p\n", [make_ref()]), >init:stop().' >#Ref<0.0.0.27> >erik@REDACTED:~$ erl -noshell -eval 'io:format("~p\n", [make_ref()]), >init:stop().' >#Ref<0.0.0.27> > >That is, while the state space may be as big as 2^82, only the first >tinyish part of it is of interest to an attacker, so the effective state >space is much smaller. > > >2014-12-25 3:32 GMT+01:00 Jesper Louis Andersen < >jesper.louis.andersen@REDACTED>: > >> A quick guess would be no. I'm pretty sure such a solution would have two >> problems: >> >> * It would not pass the necessary statistical tests well enough. >> * It would be considerably slower than appropriating a PRNG made for the >> purpose. >> >> On Wed Dec 24 2014 at 11:55:35 AM Eric Pailleau >> wrote: >> >>> ____ >>> make_ref() >>> >>> Returns an almost unique reference. >>> >>> The returned reference will reoccur after approximately 2^82 calls; >>> therefore it is unique enough for most practical purposes. >>> ____ >>> >>> hi, >>> could this function a base for a better non cryptographic random >>> generator ? >>> phash2 on such make_ref() value does not help with 2^32 cycle... >>> regards >>> >>> >>> >>> >>> ? Envoy? depuis mon mobile ? Eric >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From ankitrana1709@REDACTED Fri Dec 26 14:53:11 2014 From: ankitrana1709@REDACTED (Ankit Rana) Date: Fri, 26 Dec 2014 19:23:11 +0530 Subject: [erlang-questions] How to add a self created html page to Ejabberd's admin interface? Message-ID: How do i go about adding a self created HTML page to ejabberd's home interface. It would be great *to have an option on the LHS column menu* which leads to my page: i.e *along with the following:-* - ejabberd - Access Control Lists - Access Rules - Virtual Hosts - devlab - Access Control Lists - Access Rules - Users - Online Users - Last Activity I am currently using mod_http_fileserver to load my html page *but for that i have to manually edit the URL in the address bar of my browser.* I wish to avoid this. Let me know of your suggestions! Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.youngkin@REDACTED Fri Dec 26 23:35:26 2014 From: richard.youngkin@REDACTED (Youngkin, Rich) Date: Fri, 26 Dec 2014 15:35:26 -0700 Subject: [erlang-questions] socket_closed_unexpectedly with clustered RabbitMQ in EC2 In-Reply-To: References: Message-ID: Thanks Ilya & Aram! I'll take a look at this and revisit the haproxy timeout value. Cheers, Rich On Fri, Dec 26, 2014 at 12:53 PM, Aram Antonyan wrote: > Hi Rich, > You shall not change session timeout value, instead add heartbeat value > when you connect to the server as was suggested in previous email, that > will solve an issue. > > Thanks Aram. > > > > On Thu, Dec 25, 2014 at 3:51 PM, Ilya Shcherbak wrote: > >> Hey, >> there is heartbeat parameter in RMQ connection. for prevent closing >> session by proxy u need to turn on it. (it's turned of by default if u use >> erlang amqp_client). but u need to negotiate this parameter and IDLE tcp >> timeout parameter in AWS load balancer. >> https://www.rabbitmq.com/configure.html >> >> if u use eralng amqp_client u can establish connection like this: >> amqp_connection:start( >> #amqp_params_network{ >> host = Host, >> port = Port, >> ... >> heartbeat = 30 %%
  • heartbeat :: non_neg_integer() - The >> hearbeat interval in seconds, >> %% defaults to 0 (turned off) >> (network only)
  • >> } >> ). >> >> Ilya Shcherbak >> >> >> 2014-12-10 23:56 GMT+01:00 Youngkin, Rich : >> >>> Looking at this a bit more it turns out the the default haproxy client >>> timeout was 50 seconds. Changing this to other values (larger and smaller) >>> changed the frequency of the socket_closed_unexpectedly errors. So I think >>> I answered my own question. Thanks to anyone who took a look at this in the >>> meantime. >>> >>> Thanks, >>> Rich >>> >>> >>> On Wed, Dec 10, 2014 at 10:59 AM, Youngkin, Rich < >>> richard.youngkin@REDACTED> wrote: >>> >>>> Hi, >>>> >>>> I'm using the Erlang amqp client and am getting a >>>> "socket_closed_unexpectedly" CRASH REPORT. This error happens regardless of >>>> whether the application is actively publishing or consuming messages (i.e., >>>> the app is idle, but connected to RabbitMQ). This doesn't happen in a >>>> non-EC2 environment or in a single-zone EC2 environment. >>>> >>>> Here are some environmental details: >>>> >>>> 1. My application is using Erlang version is R15B01 >>>> 2. amqp_client-2.7.1 >>>> 3. RabbitMQ 3.2.2 using Erlang R14B04 >>>> >>>> Here are the details regarding the EC2 configuration: >>>> >>>> 1. 2 EC2 zones in the same EC2 region >>>> 2. 2 RabbitMQ instances per Zone - 4 total instances >>>> 3. All RabbitMQ instances are clustered (cluster_partition_handling >>>> set to pause_minority). >>>> 4. 2 Application instances per Zone (my app) - 4 total instances >>>> 5. There is an haproxy between my app and the RabbitMQ cluster >>>> 6. My application is using Mnesia and it's clustered across all app >>>> instances >>>> >>>> I've included the text from the SASL log below. >>>> >>>> As I stated above, the error message occurs whether my application is >>>> publishing or not. It does happen more frequently while publishing is >>>> occurring. It looks to me like AMQP is recovering/restarting the affected >>>> processes, but I'd like to better understand why it's occurring and fix it >>>> if possible. The error is happening regularly, every 50 seconds. This >>>> seems significant. >>>> >>>> Any help is appreciated. >>>> >>>> Thanks! >>>> Rich >>>> >>>> >>>> =CRASH REPORT==== 8-Dec-2014::20:52:34 === >>>> >>>> crasher: >>>> >>>> initial call: amqp_gen_connection:init/1 >>>> >>>> pid: <0.5460.10> >>>> >>>> registered_name: [] >>>> >>>> exception exit: socket_closed_unexpectedly >>>> >>>> in function gen_server:terminate/6 (gen_server.erl, line 747) >>>> >>>> ancestors: [<0.5459.10>,amqp_sup,<0.4172.0>] >>>> >>>> messages: [] >>>> >>>> links: [<0.6264.0>,<0.5459.10>,#Port<0.7206767>] >>>> >>>> dictionary: [] >>>> >>>> trap_exit: false >>>> >>>> status: running >>>> >>>> heap_size: 610 >>>> >>>> stack_size: 24 >>>> >>>> reductions: 717 >>>> >>>> neighbours: >>>> >>>> >>>> =SUPERVISOR REPORT==== 9-Dec-2014::20:55:15 === >>>> >>>> Supervisor: {<0.4172.0>,amqp_connection_sup} >>>> >>>> Context: child_terminated >>>> >>>> Reason: socket_closed_unexpectedly >>>> >>>> Offender: [{pid,<0.4173.0>}, >>>> >>>> {name,connection}, >>>> >>>> {mfa, >>>> >>>> {amqp_gen_connection,start_link, >>>> >>>> [amqp_network_connection, >>>> >>>> {amqp_params_network,<<"guest">>,<<"guest">>, >>>> >>>> >>>> <<"/">>,"10.199.30.169",5672,0,0,1000,infinity, >>>> >>>> none, >>>> >>>> [#Fun, >>>> >>>> #Fun], >>>> >>>> [],[]}, >>>> >>>> #Fun, >>>> >>>> #Fun,[]]}}, >>>> >>>> {restart_type,intrinsic}, >>>> >>>> {shutdown,brutal_kill}, >>>> >>>> {child_type,worker}] >>>> >>>> =SUPERVISOR REPORT==== 9-Dec-2014::20:55:15 === >>>> Supervisor: {<0.4172.0>,amqp_connection_sup} >>>> Context: shutdown >>>> Reason: reached_max_restart_intensity >>>> Offender: [{pid,<0.4173.0>}, >>>> {name,connection}, >>>> {mfa, >>>> {amqp_gen_connection,start_link, >>>> [amqp_network_connection, >>>> {amqp_params_network,<<"guest">>,<<"guest">>, >>>> >>>> <<"/">>,"10.199.30.169",5672,0,0,1000,infinity, >>>> none, >>>> [#Fun, >>>> #Fun], >>>> [],[]}, >>>> #Fun, >>>> #Fun,[]]}}, >>>> {restart_type,intrinsic}, >>>> {shutdown,brutal_kill}, >>>> {child_type,worker}] >>>> >>>> =PROGRESS REPORT==== 9-Dec-2014::20:55:15 === supervisor: >>>> {<0.4320.0>,amqp_connection_sup} started: [{pid,<0.4321.0>}, >>>> {name,connection}, {mfa, {amqp_gen_connection,start_link, >>>> [amqp_network_connection, {amqp_params_network,<<"guest">>,<<"guest">>, >>>> <<"/">>,"10.199.30.169",5672,0,0,1000, infinity,none, >>>> [#Fun, >>>> #Fun], [],[]}, >>>> #Fun, >>>> #Fun,[]]}}, {restart_type,intrinsic}, >>>> {shutdown,brutal_kill}, {child_type,worker}] >>>> >>>> ... >>>> >>>> >>>> >>> >>> _______________________________________________ >>> 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 aram.antonyan@REDACTED Fri Dec 26 20:53:54 2014 From: aram.antonyan@REDACTED (Aram Antonyan) Date: Fri, 26 Dec 2014 11:53:54 -0800 Subject: [erlang-questions] socket_closed_unexpectedly with clustered RabbitMQ in EC2 In-Reply-To: References: Message-ID: Hi Rich, You shall not change session timeout value, instead add heartbeat value when you connect to the server as was suggested in previous email, that will solve an issue. Thanks Aram. On Thu, Dec 25, 2014 at 3:51 PM, Ilya Shcherbak wrote: > Hey, > there is heartbeat parameter in RMQ connection. for prevent closing > session by proxy u need to turn on it. (it's turned of by default if u use > erlang amqp_client). but u need to negotiate this parameter and IDLE tcp > timeout parameter in AWS load balancer. > https://www.rabbitmq.com/configure.html > > if u use eralng amqp_client u can establish connection like this: > amqp_connection:start( > #amqp_params_network{ > host = Host, > port = Port, > ... > heartbeat = 30 %%
  • heartbeat :: non_neg_integer() - The > hearbeat interval in seconds, > %% defaults to 0 (turned off) > (network only)
  • > } > ). > > Ilya Shcherbak > > > 2014-12-10 23:56 GMT+01:00 Youngkin, Rich : > >> Looking at this a bit more it turns out the the default haproxy client >> timeout was 50 seconds. Changing this to other values (larger and smaller) >> changed the frequency of the socket_closed_unexpectedly errors. So I think >> I answered my own question. Thanks to anyone who took a look at this in the >> meantime. >> >> Thanks, >> Rich >> >> >> On Wed, Dec 10, 2014 at 10:59 AM, Youngkin, Rich < >> richard.youngkin@REDACTED> wrote: >> >>> Hi, >>> >>> I'm using the Erlang amqp client and am getting a >>> "socket_closed_unexpectedly" CRASH REPORT. This error happens regardless of >>> whether the application is actively publishing or consuming messages (i.e., >>> the app is idle, but connected to RabbitMQ). This doesn't happen in a >>> non-EC2 environment or in a single-zone EC2 environment. >>> >>> Here are some environmental details: >>> >>> 1. My application is using Erlang version is R15B01 >>> 2. amqp_client-2.7.1 >>> 3. RabbitMQ 3.2.2 using Erlang R14B04 >>> >>> Here are the details regarding the EC2 configuration: >>> >>> 1. 2 EC2 zones in the same EC2 region >>> 2. 2 RabbitMQ instances per Zone - 4 total instances >>> 3. All RabbitMQ instances are clustered (cluster_partition_handling >>> set to pause_minority). >>> 4. 2 Application instances per Zone (my app) - 4 total instances >>> 5. There is an haproxy between my app and the RabbitMQ cluster >>> 6. My application is using Mnesia and it's clustered across all app >>> instances >>> >>> I've included the text from the SASL log below. >>> >>> As I stated above, the error message occurs whether my application is >>> publishing or not. It does happen more frequently while publishing is >>> occurring. It looks to me like AMQP is recovering/restarting the affected >>> processes, but I'd like to better understand why it's occurring and fix it >>> if possible. The error is happening regularly, every 50 seconds. This >>> seems significant. >>> >>> Any help is appreciated. >>> >>> Thanks! >>> Rich >>> >>> >>> =CRASH REPORT==== 8-Dec-2014::20:52:34 === >>> >>> crasher: >>> >>> initial call: amqp_gen_connection:init/1 >>> >>> pid: <0.5460.10> >>> >>> registered_name: [] >>> >>> exception exit: socket_closed_unexpectedly >>> >>> in function gen_server:terminate/6 (gen_server.erl, line 747) >>> >>> ancestors: [<0.5459.10>,amqp_sup,<0.4172.0>] >>> >>> messages: [] >>> >>> links: [<0.6264.0>,<0.5459.10>,#Port<0.7206767>] >>> >>> dictionary: [] >>> >>> trap_exit: false >>> >>> status: running >>> >>> heap_size: 610 >>> >>> stack_size: 24 >>> >>> reductions: 717 >>> >>> neighbours: >>> >>> >>> =SUPERVISOR REPORT==== 9-Dec-2014::20:55:15 === >>> >>> Supervisor: {<0.4172.0>,amqp_connection_sup} >>> >>> Context: child_terminated >>> >>> Reason: socket_closed_unexpectedly >>> >>> Offender: [{pid,<0.4173.0>}, >>> >>> {name,connection}, >>> >>> {mfa, >>> >>> {amqp_gen_connection,start_link, >>> >>> [amqp_network_connection, >>> >>> {amqp_params_network,<<"guest">>,<<"guest">>, >>> >>> >>> <<"/">>,"10.199.30.169",5672,0,0,1000,infinity, >>> >>> none, >>> >>> [#Fun, >>> >>> #Fun], >>> >>> [],[]}, >>> >>> #Fun, >>> >>> #Fun,[]]}}, >>> >>> {restart_type,intrinsic}, >>> >>> {shutdown,brutal_kill}, >>> >>> {child_type,worker}] >>> >>> =SUPERVISOR REPORT==== 9-Dec-2014::20:55:15 === >>> Supervisor: {<0.4172.0>,amqp_connection_sup} >>> Context: shutdown >>> Reason: reached_max_restart_intensity >>> Offender: [{pid,<0.4173.0>}, >>> {name,connection}, >>> {mfa, >>> {amqp_gen_connection,start_link, >>> [amqp_network_connection, >>> {amqp_params_network,<<"guest">>,<<"guest">>, >>> >>> <<"/">>,"10.199.30.169",5672,0,0,1000,infinity, >>> none, >>> [#Fun, >>> #Fun], >>> [],[]}, >>> #Fun, >>> #Fun,[]]}}, >>> {restart_type,intrinsic}, >>> {shutdown,brutal_kill}, >>> {child_type,worker}] >>> >>> =PROGRESS REPORT==== 9-Dec-2014::20:55:15 === supervisor: >>> {<0.4320.0>,amqp_connection_sup} started: [{pid,<0.4321.0>}, >>> {name,connection}, {mfa, {amqp_gen_connection,start_link, >>> [amqp_network_connection, {amqp_params_network,<<"guest">>,<<"guest">>, >>> <<"/">>,"10.199.30.169",5672,0,0,1000, infinity,none, >>> [#Fun, >>> #Fun], [],[]}, >>> #Fun, >>> #Fun,[]]}}, {restart_type,intrinsic}, >>> {shutdown,brutal_kill}, {child_type,worker}] >>> >>> ... >>> >>> >>> >> >> _______________________________________________ >> 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 alcosholik@REDACTED Sat Dec 27 01:07:19 2014 From: alcosholik@REDACTED (Alexei Sholik) Date: Sat, 27 Dec 2014 02:07:19 +0200 Subject: [erlang-questions] Chicago Erlang Conference 2015 Message-ID: Are there any plans to have a repeat? Best regards, Alexei Sholik -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Sat Dec 27 01:42:28 2014 From: g@REDACTED (Garrett Smith) Date: Fri, 26 Dec 2014 18:42:28 -0600 Subject: [erlang-questions] Chicago Erlang Conference 2015 In-Reply-To: References: Message-ID: With nice questions like this, definitely increases the odds :) Stay tuned - it'll be Sept/Oct 2015. On Fri, Dec 26, 2014 at 6:07 PM, Alexei Sholik wrote: > Are there any plans to have a repeat? > > Best regards, > Alexei Sholik > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From imantc@REDACTED Sat Dec 27 01:48:53 2014 From: imantc@REDACTED (Imants Cekusins) Date: Sat, 27 Dec 2014 01:48:53 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> Message-ID: Nix package repository is very convenient to search : https://nixos.org/nixos/packages.html simple and very fast. It sets a good example. From dmytro.lytovchenko@REDACTED Sat Dec 27 15:49:06 2014 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Sat, 27 Dec 2014 15:49:06 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> Message-ID: Going with Nix sets few targets to focus on: - Adapt it for Erlang specifics (and contribute if they will accept flow of contributions of this type). If they don't like it, we're facing a source code fork. It's licence is LGPL2.1(or later) which is sticky and may annoy people; - Make it work on Windows; - Nix is C++ so OTP team will squint at it, they don't like and don't use C++ but, well, many other people including me do. Besides opensource contributions, a permanent one or more people should be assigned to maintain the Erlang-faced part of Nix, that is up to IUG to decide the budget and the candidate(s), hope i can be one. Erlang specific details include: - make it appear (be built or downloaded or bundled with OTP) when you make OTP source; - source-only and binary installs being recognized as interchangeable. but if user is unable to build for some reason he may enforce binary prebuilt install; - making environments for Erlang, that is a directory with symlinks to packages, which can be added to -pa/-pz and starting an OS shell or Erlang shell for user; - make it aware of Erlang in general, people will find out what they want when they start using it. Many surprise things may appear such as hot upgrades and reloads on a running VM, not sure if that's package manager's thing to poke VM with a stick and make it reload things. On Sat, Dec 27, 2014 at 1:48 AM, Imants Cekusins wrote: > Nix package repository is very convenient to search : > > https://nixos.org/nixos/packages.html > > simple and very fast. It sets a good example. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From imantc@REDACTED Sat Dec 27 16:10:34 2014 From: imantc@REDACTED (Imants Cekusins) Date: Sat, 27 Dec 2014 16:10:34 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> Message-ID: Docker looks good re: Windows compatibility: http://en.wikipedia.org/wiki/Docker_%28software%29 On October 15, 2014, Microsoft announced plans to integrate Docker with the next (mid-2015) release of Windows Server.[25] http://www.zdnet.com/article/docker-container-support-coming-to-microsofts-next-windows-server-release/ From t@REDACTED Sat Dec 27 16:33:35 2014 From: t@REDACTED (Tristan Sloughter) Date: Sat, 27 Dec 2014 09:33:35 -0600 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> Message-ID: <1419694415.1579008.207127445.49E0B4BD@webmail.messagingengine.com> Erlang Solutions certainly won't be going the nix route. So someone should just go try it already :P. I did and gave up and tossed it in the garbage. I say this because I feel the conversation is pointless and has completely derailed any talk of an actual solution to real problems. -- Tristan Sloughter t@REDACTED From k.petrauskas@REDACTED Sat Dec 27 17:12:14 2014 From: k.petrauskas@REDACTED (Karolis Petrauskas) Date: Sat, 27 Dec 2014 18:12:14 +0200 Subject: [erlang-questions] Line wrapping issue when attaching to running node In-Reply-To: <83111B73-54CC-4118-871A-03C0E4C1D923@tuli.pe> References: <83111B73-54CC-4118-871A-03C0E4C1D923@tuli.pe> Message-ID: Hi, I have the same problem and I have no solution for it. I think it is related to the terminal specified when starting the node (not when attaching to it). The only workaround I found was to type commands in a text editor and copy/paste them to the terminal. Karolis On Tue, Dec 23, 2014 at 5:00 PM, Camille Troillard wrote: > Hello, > > We are experiencing an annoying problem in integration or production environment that deals with incorrect line wrapping when connecting to a remote shell. > > Erlang version: > Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false] > > Installed on FreeBSD using the `erlang-17.3_3,3` package. > > > We generate a release using rebar. When we want to interact with it, we attach to the system like so (assuming the release is named ?abc?) : > > $ ./rel/abc/bin/abc attach > > (abc@REDACTED)1> > > > In this situation, whenever you write something that exceeds the width of the terminal (typically 80 columns), the line wraps onto a second line, which is OK. But if you have an open parenthesis on the first line, that is closed on the second line, then the output becomes garbled, text overwritten and it is no longer possible to sanely use the shell. > > This is an example of expected output: > > (abc@REDACTED)1> this_is_an_example_of_a_long_module_name:call_this_function([1 > , 2, 3, 4], another_arg). > > And the actual output (the cursor is on the first line at column 2): > > .abc@REDACTED, another_arg)an_example_of_a_long_module_name:call_this_function([1 > , 2, 3, 4] > > > Text garbling occurs as soon as I hit the first ?]?. It also occurs on ?)?. > > It does not happen when typing into an erlang shell that was launched using `erl` directly. > > It seems to happen to_erl. The same erratic behaviour is seen when attach to a release running on FreeBSD or OS X. It does not matter whether the console is running locally or via SSH. Also, it does not seem to matter wether the TERM variable is set to ansi, vt100, xterm or xterm-256color. > > > I would like to know if someone noticed this problem, and how to fix it. > > Thanks ! > Camille > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From garazdawi@REDACTED Sat Dec 27 18:53:29 2014 From: garazdawi@REDACTED (Lukas Larsson) Date: Sat, 27 Dec 2014 18:53:29 +0100 Subject: [erlang-questions] Line wrapping issue when attaching to running node In-Reply-To: References: <83111B73-54CC-4118-871A-03C0E4C1D923@tuli.pe> Message-ID: I think this might be a bug that was introduced in 17.0, that has been fixed in 17.4. See OTP-12275 in the erts release notes. On Sat, Dec 27, 2014 at 5:12 PM, Karolis Petrauskas wrote: > Hi, > > I have the same problem and I have no solution for it. I think it is > related to the terminal specified when starting the node (not when > attaching to it). > > The only workaround I found was to type commands in a text editor and > copy/paste them to the terminal. > > Karolis > > On Tue, Dec 23, 2014 at 5:00 PM, Camille Troillard wrote: > > Hello, > > > > We are experiencing an annoying problem in integration or production > environment that deals with incorrect line wrapping when connecting to a > remote shell. > > > > Erlang version: > > Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:4:4] [async-threads:10] > [kernel-poll:false] > > > > Installed on FreeBSD using the `erlang-17.3_3,3` package. > > > > > > We generate a release using rebar. When we want to interact with it, we > attach to the system like so (assuming the release is named ?abc?) : > > > > $ ./rel/abc/bin/abc attach > > > > (abc@REDACTED)1> > > > > > > In this situation, whenever you write something that exceeds the width > of the terminal (typically 80 columns), the line wraps onto a second line, > which is OK. But if you have an open parenthesis on the first line, that > is closed on the second line, then the output becomes garbled, text > overwritten and it is no longer possible to sanely use the shell. > > > > This is an example of expected output: > > > > (abc@REDACTED)1> > this_is_an_example_of_a_long_module_name:call_this_function([1 > > , 2, 3, 4], another_arg). > > > > And the actual output (the cursor is on the first line at column 2): > > > > .abc@REDACTED, > another_arg)an_example_of_a_long_module_name:call_this_function([1 > > , 2, 3, 4] > > > > > > Text garbling occurs as soon as I hit the first ?]?. It also occurs on > ?)?. > > > > It does not happen when typing into an erlang shell that was launched > using `erl` directly. > > > > It seems to happen to_erl. The same erratic behaviour is seen when > attach to a release running on FreeBSD or OS X. It does not matter whether > the console is running locally or via SSH. Also, it does not seem to > matter wether the TERM variable is set to ansi, vt100, xterm or > xterm-256color. > > > > > > I would like to know if someone noticed this problem, and how to fix it. > > > > Thanks ! > > Camille > > > > _______________________________________________ > > 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 289602744@REDACTED Sat Dec 27 12:36:24 2014 From: 289602744@REDACTED (=?ISO-8859-1?B?Mjg5NjAyNzQ0?=) Date: Sat, 27 Dec 2014 19:36:24 +0800 Subject: [erlang-questions] is there anything wrong with global? Message-ID: These days,I found global did not work well. I have hundreds of nodes,and these nodes are connected with each other. But on some nodes, I can't get a process's global registered name with global:whereis_name, althrough I can get the node info by net_kernel:node_info/1 I didnot find a way to resolve this problem. Unless I unregister that process's name and then register the name again, and then, I can get the global name by global:whereis_name/1. Is there anything wrong with global? with so many nodes, I can't unregister and then register a process name every time I find global return me an undefined. -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto@REDACTED Sun Dec 28 10:59:47 2014 From: roberto@REDACTED (Roberto Ostinelli) Date: Sun, 28 Dec 2014 10:59:47 +0100 Subject: [erlang-questions] Hackney socket In-Reply-To: References: Message-ID: Thank you Benoit! Best, r. On Wed, Dec 24, 2014 at 6:45 PM, Benoit Chesneau wrote: > > > On Wed, Dec 24, 2014 at 12:40 PM, Roberto Ostinelli > wrote: > >> Hello, >> I'm using hackney to send a HTTPS request. The server I'm connecting to >> will keep the resulting TCP connection open, so that it then becomes a >> two-way communication channel using HTTP chunk. >> >> I therefore need to retrieve the Socket from a Connection Reference, so I >> can send chunked data into it. >> >> Does anyone know what is the cleanest way to retrieve the underlying >> socket from a Connection Reference? >> >> Best, >> r. >> >> > If you want to reuse the socket and cancel the request then you can use > `hackney:cancel_request/1` . Note that you can directly send chunks using > hackney if you specify the Tranfer-Encoding header. Hackney will take care > about it. It also works if you want to stream the request. > > - benoit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto@REDACTED Sun Dec 28 11:00:56 2014 From: roberto@REDACTED (Roberto Ostinelli) Date: Sun, 28 Dec 2014 11:00:56 +0100 Subject: [erlang-questions] load balancing In-Reply-To: References: Message-ID: Thank you all for the great feedback. I've decided to go for now with the HAProxy solution and heavily benchmark, inventing a more custom protocol. Best, r. On Fri, Nov 14, 2014 at 5:59 AM, Felix Gallo wrote: > haproxy is really, really excellent at load balancing and providing HA > switchover. It has a number of modes, can do weighting, heartbeats, has a > vibrant community, and is incredibly stable. Before you write your own, > I'd try that. > > On Thu, Nov 13, 2014 at 8:11 PM, Max Lapshin > wrote: > >> > Implement a protocol that a client has to first ask to which server >> to connect to, and then go for it >> >> It is the best one if you can add it: >> >> 1) it doesn't have DNS lag >> 2) it doesn't require such SPOF like HAProxy >> 3) you will have problem how to design resolver, but it will be simpler >> and it is possible to do it reliable and scalable. >> >> >> _______________________________________________ >> 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 Sun Dec 28 12:16:16 2014 From: roberto@REDACTED (Roberto Ostinelli) Date: Sun, 28 Dec 2014 12:16:16 +0100 Subject: [erlang-questions] Command-line for releases Message-ID: Hi all, Let's say that you have a running node, started from a release command: $ myapp start Now, I'd like to check some current stats of the node (for instance, with erlang:memory/0), but would like to do it with an external script, i.e. a command-line tool so that it gets printed in the console, like so: $ myappctl memory total:14303080 What is your recommended way to have a command-line tool connect to a release-started erlang node to issue a command and return a value? There are many ways, I'd like to hear some recommendations. Best, r. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Sun Dec 28 12:28:39 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 28 Dec 2014 11:28:39 +0000 Subject: [erlang-questions] Command-line for releases References: Message-ID: I tend to do two things in this area (note relx): Alter the 'myapp' script such that it takes extra commands and execute this command like "ping" is implemented: call nodetool to do rpc towards the node (IIRC it creates a distributed node, connects it to the running node and runs its stuff). But for stats in general, my approach is very different. I use "folsom" to gather statistics[0]. Note that this is gathering, not persisting/storing. Then another application shovels the gathered statistics to a foreign system for historical data and you plot the data. Knowing that your system used 320 megabytes of space now is of little use unless you happen to know what the typical baseline of your system tend to be. So I gather that information for any production system if I can. I'm pretty aggressive in stats gathering. It is not uncommon to have 1000+ probes in a system for me. This is because I firmly believe that you need to measure in order to improve a system. [0] In a newly deployed system, I would probably check out exometer. On Sun Dec 28 2014 at 12:16:26 PM Roberto Ostinelli wrote: > Hi all, > Let's say that you have a running node, started from a release command: > $ myapp start > > Now, I'd like to check some current stats of the node (for instance, with > erlang:memory/0), but would like to do it with an external script, i.e. a > command-line tool so that it gets printed in the console, like so: > > $ myappctl memory > total:14303080 > > What is your recommended way to have a command-line tool connect to a > release-started erlang node to issue a command and return a value? > > There are many ways, I'd like to hear some recommendations. > > Best, > r. > _______________________________________________ > 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 Sun Dec 28 12:48:41 2014 From: roberto@REDACTED (Roberto Ostinelli) Date: Sun, 28 Dec 2014 12:48:41 +0100 Subject: [erlang-questions] Command-line for releases In-Reply-To: References: Message-ID: Thank you Jesper! Yes indeed, the erlang:memory() call is just an example (I use folsom too for real production system monitoring). I use rebar for releases, and the ping command just dumps a "pong" response. I'm assuming you refer to the RPC command instead, or maybe the nodetool generated by relx is different? Best, r. On Sun, Dec 28, 2014 at 12:28 PM, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > I tend to do two things in this area (note relx): > > Alter the 'myapp' script such that it takes extra commands and execute > this command like "ping" is implemented: call nodetool to do rpc towards > the node (IIRC it creates a distributed node, connects it to the running > node and runs its stuff). > > But for stats in general, my approach is very different. I use "folsom" to > gather statistics[0]. Note that this is gathering, not persisting/storing. > Then another application shovels the gathered statistics to a foreign > system for historical data and you plot the data. Knowing that your system > used 320 megabytes of space now is of little use unless you happen to know > what the typical baseline of your system tend to be. So I gather that > information for any production system if I can. > > I'm pretty aggressive in stats gathering. It is not uncommon to have 1000+ > probes in a system for me. This is because I firmly believe that you need > to measure in order to improve a system. > > > [0] In a newly deployed system, I would probably check out exometer. > > On Sun Dec 28 2014 at 12:16:26 PM Roberto Ostinelli > wrote: > >> Hi all, >> Let's say that you have a running node, started from a release command: >> $ myapp start >> >> Now, I'd like to check some current stats of the node (for instance, with >> erlang:memory/0), but would like to do it with an external script, i.e. a >> command-line tool so that it gets printed in the console, like so: >> >> $ myappctl memory >> total:14303080 >> >> What is your recommended way to have a command-line tool connect to a >> release-started erlang node to issue a command and return a value? >> >> There are many ways, I'd like to hear some recommendations. >> >> Best, >> r. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmytro.lytovchenko@REDACTED Sun Dec 28 13:02:33 2014 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Sun, 28 Dec 2014 13:02:33 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <1419694415.1579008.207127445.49E0B4BD@webmail.messagingengine.com> References: <54980224.8070106@ninenines.eu> <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> <1419694415.1579008.207127445.49E0B4BD@webmail.messagingengine.com> Message-ID: Its not up to ESL to decide what gets chosen, OTP/E/// and IUG will decide the final options and budget according to what is discussed here. But ESL may offer a person to work on this budget and this project. >From my personal point of view, - Nix has a chance because its C++ which is potentially cross platform and compiles everywhere. Also from NIH point of view - huge work was done there and it would be silly to just throw the idea away because parts of it are not compatible - this can be fixed; - pure C or C++ implementation from scratch has a chance because its cross platform and compiles everywhere (or it should by design); - pure Erlang implementation although doesn't exist yet only in a form of non-working bare skeleton prototype, also has a chance - and then Elixir implementation has slim chance because carrying Elixir compiler or compiled BEAM's in OTP source may be non-desirable. On Sat, Dec 27, 2014 at 4:33 PM, Tristan Sloughter wrote: > Erlang Solutions certainly won't be going the nix route. > > So someone should just go try it already :P. I did and gave up and > tossed it in the garbage. > > I say this because I feel the conversation is pointless and has > completely derailed any talk of an actual solution to real problems. > > -- > Tristan Sloughter > t@REDACTED > _______________________________________________ > 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 Sun Dec 28 13:19:17 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 28 Dec 2014 12:19:17 +0000 Subject: [erlang-questions] Command-line for releases References: Message-ID: Well, I just adopt the 'ping' command and implement what I miss if the system needs to be prodded from the outside. A good example is to poke the system via cron at regular intervals. So I just rewrite the script appropriately. I think relx nodetool is different, but you will have to dig that up yourself. I think 'erl_call' may be an alternative path you can pursue if you want. The damning way of providing an HTTP POSTable endpoint seems so futile compared to an internal call IMO, but is is also possible. Or open an ssh connection to the shell via the ssh application. On Sun Dec 28 2014 at 12:48:42 PM Roberto Ostinelli wrote: > Thank you Jesper! > Yes indeed, the erlang:memory() call is just an example (I use folsom too > for real production system monitoring). > > I use rebar for releases, and the ping command just dumps a "pong" > response. I'm assuming you refer to the RPC command instead, or maybe the > nodetool generated by relx is different? > > Best, > r. > > > On Sun, Dec 28, 2014 at 12:28 PM, Jesper Louis Andersen < > jesper.louis.andersen@REDACTED> wrote: > >> I tend to do two things in this area (note relx): >> >> Alter the 'myapp' script such that it takes extra commands and execute >> this command like "ping" is implemented: call nodetool to do rpc towards >> the node (IIRC it creates a distributed node, connects it to the running >> node and runs its stuff). >> >> But for stats in general, my approach is very different. I use "folsom" >> to gather statistics[0]. Note that this is gathering, not >> persisting/storing. Then another application shovels the gathered >> statistics to a foreign system for historical data and you plot the data. >> Knowing that your system used 320 megabytes of space now is of little use >> unless you happen to know what the typical baseline of your system tend to >> be. So I gather that information for any production system if I can. >> >> I'm pretty aggressive in stats gathering. It is not uncommon to have >> 1000+ probes in a system for me. This is because I firmly believe that you >> need to measure in order to improve a system. >> >> >> [0] In a newly deployed system, I would probably check out exometer. >> >> On Sun Dec 28 2014 at 12:16:26 PM Roberto Ostinelli >> wrote: >> >>> Hi all, >>> Let's say that you have a running node, started from a release command: >>> $ myapp start >>> >>> Now, I'd like to check some current stats of the node (for instance, >>> with erlang:memory/0), but would like to do it with an external script, >>> i.e. a command-line tool so that it gets printed in the console, like so: >>> >>> $ myappctl memory >>> total:14303080 >>> >>> What is your recommended way to have a command-line tool connect to a >>> release-started erlang node to issue a command and return a value? >>> >>> There are many ways, I'd like to hear some recommendations. >>> >>> Best, >>> r. >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Sun Dec 28 17:39:57 2014 From: t@REDACTED (Tristan Sloughter) Date: Sun, 28 Dec 2014 10:39:57 -0600 Subject: [erlang-questions] Erlang package manager In-Reply-To: References: <54980224.8070106@ninenines.eu> <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> <1419694415.1579008.207127445.49E0B4BD@webmail.messagingengine.com> Message-ID: <1419784797.2301728.207355877.581FF3F7@webmail.messagingengine.com> Right, thanks for the clarification, I shouldn't have said only Erlang Solutions. My point about Nix wasn't about Windows support or only the fact that I don't consider it a fit, but was my understanding from the design doc and proposals that Nix certainly wasn't a fit. For instance, including Nix in Erlang/OTP sounds to me like something much less likely to be included than Elixir... There is much work already into a foundation to base an Erlang PM to be included in OTP on, hex.pm, which rebar3 will be moving to as well, meaning 2 implementations of the API will already be worked on. -- Tristan Sloughter t@REDACTED On Sun, Dec 28, 2014, at 06:02 AM, Dmytro Lytovchenko wrote: > Its not up to ESL to decide what gets chosen, OTP/E/// and IUG will > decide the final options and budget according to what is discussed > here. But ESL may offer a person to work on this budget and this > project. > > From my personal point of view, > - Nix has a chance because its C++ which is potentially cross platform > and compiles everywhere. Also from NIH point of view - huge work was > done there and it would be silly to just throw the idea away because > parts of it are not compatible - this can be fixed; > - pure C or C++ implementation from scratch has a chance because its > cross platform and compiles everywhere (or it should by design); > - pure Erlang implementation although doesn't exist yet only in a form > of non-working bare skeleton prototype, also has a chance > - and then Elixir implementation has slim chance because carrying > Elixir compiler or compiled BEAM's in OTP source may be > non-desirable. > > On Sat, Dec 27, 2014 at 4:33 PM, Tristan Sloughter > wrote: >> Erlang Solutions certainly won't be going the nix route. >> >> So someone should just go try it already :P. I did and gave up and >> tossed it in the garbage. >> >> I say this because I feel the conversation is pointless and has >> completely derailed any talk of an actual solution to real problems. >> >> -- >> Tristan Sloughter >> t@REDACTED >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Sun Dec 28 18:29:09 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sun, 28 Dec 2014 18:29:09 +0100 Subject: [erlang-questions] Erlang package manager In-Reply-To: <1419784797.2301728.207355877.581FF3F7@webmail.messagingengine.com> References: <54980224.8070106@ninenines.eu> <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> <1419694415.1579008.207127445.49E0B4BD@webmail.messagingengine.com> <1419784797.2301728.207355877.581FF3F7@webmail.messagingengine.com> Message-ID: On Sun, Dec 28, 2014 at 5:39 PM, Tristan Sloughter wrote: > My point about Nix wasn't about Windows support or only the fact > that I don't consider it a fit, but was my understanding from the > design doc and proposals that Nix certainly wasn't a fit. For > instance, including Nix in Erlang/OTP sounds to me like something > much less likely to be included than Elixir... My support for Nix is based on that it solves issues other pkg mgrs seem to ignore for the most part. That said, as I wrote earlier, if and how Nix _or_ its design can be used is a whole other story. > There is much work already into a foundation to base an Erlang PM to > be included in OTP on, hex.pm, which rebar3 will be moving to as > well, meaning 2 implementations of the API will already be worked > on. Again, the first step as I see it is figuring out the required changes in the .app and .ez infrastructure wrt missing features. See "extra notes" at the end of http://erlang.org/pipermail/erlang-questions/2014-December/082132.html From sean@REDACTED Sun Dec 28 20:39:33 2014 From: sean@REDACTED (Sean Cribbs) Date: Sun, 28 Dec 2014 13:39:33 -0600 Subject: [erlang-questions] is there anything wrong with global? In-Reply-To: References: Message-ID: Global registration is inherently a consensus problem, and thus will have problems with liveness, as you've discovered. I can't speak to the implementation of the 'global' module, but I would suspect it is not partition-tolerant. Is there a way you can reconfigure your application to have locally-registered processes (one-per-node), or not require a single distribution point? There is also some work done by my colleague Chris Meiklejohn for eventually-consistent (and partition-tolerant) process groups, if you don't require a single authoritative process: https://github.com/cmeiklejohn/riak_pg On Sat, Dec 27, 2014 at 5:36 AM, 289602744 <289602744@REDACTED> wrote: > These days,I found global did not work well. > I have hundreds of nodes,and these nodes are connected with each other. > But on some nodes, I can't get a process's global registered name with > global:whereis_name, althrough I can get the node info by > net_kernel:node_info/1 > I didnot find a way to resolve this problem. Unless I unregister that > process's name and then register the name again, and then, I can get the > global name by global:whereis_name/1. > Is there anything wrong with global? with so many nodes, I can't > unregister and then register a process name every time I find global return > me an undefined. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Sean Cribbs Sr. Software Engineer Basho Technologies, Inc. http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Sun Dec 28 22:05:19 2014 From: mjtruog@REDACTED (Michael Truog) Date: Sun, 28 Dec 2014 13:05:19 -0800 Subject: [erlang-questions] is there anything wrong with global? In-Reply-To: References: Message-ID: <54A0708F.9020501@gmail.com> On 12/28/2014 11:39 AM, Sean Cribbs wrote: > Global registration is inherently a consensus problem, and thus will have problems with liveness, as you've discovered. I can't speak to the implementation of the 'global' module, but I would suspect it is not partition-tolerant. Is there a way you can reconfigure your application to have locally-registered processes (one-per-node), or not require a single distribution point? > > There is also some work done by my colleague Chris Meiklejohn for eventually-consistent (and partition-tolerant) process groups, if you don't require a single authoritative process: https://github.com/cmeiklejohn/riak_pg If you need something that has already been in production, you need not look further than Erlang/OTP with http://www.erlang.org/doc/man/pg2.html . There also is https://github.com/okeuday/cpg/ which has more features without ets usage to avoid contention (and it supports the via syntax, if you need that (i.e., {via,Module,ViaName})). > > On Sat, Dec 27, 2014 at 5:36 AM, 289602744 <289602744@REDACTED > wrote: > > These days,I found global did not work well. > I have hundreds of nodes,and these nodes are connected with each other. > But on some nodes, I can't get a process's global registered name with global:whereis_name, althrough I can get the node info by net_kernel:node_info/1 > I didnot find a way to resolve this problem. Unless I unregister that process's name and then register the name again, and then, I can get the global name by global:whereis_name/1. > Is there anything wrong with global? with so many nodes, I can't unregister and then register a process name every time I find global return me an undefined. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- > Sean Cribbs > > Sr. Software Engineer > Basho Technologies, Inc. > http://basho.com/ > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy.j.li@REDACTED Tue Dec 30 02:32:27 2014 From: andy.j.li@REDACTED (Andy Li J) Date: Tue, 30 Dec 2014 01:32:27 +0000 Subject: [erlang-questions] How to define snmp get bulk request pdu including max-repetitions and no-repeaters In-Reply-To: <549AB60C.6010403@yahoo.co.uk> References: <3657600B1AAAE34C9A9DABD197B9106B1CA3CC7E@ESGSCMB103.ericsson.se> <549AB60C.6010403@yahoo.co.uk> Message-ID: <3657600B1AAAE34C9A9DABD197B9106B1CA3D7D0@ESGSCMB103.ericsson.se> Hi Dominik, Thanks very much. I try to construct the pdu according to the my conjecture (they may has the element max_repetitions and non_repeaters), but I found that it was wrong? Get bulk has reused the error_status and error_index. B.R Andy From: Dominik Pawlak [mailto:dominik_pawlak@REDACTED] Sent: Wednesday, December 24, 2014 8:48 PM To: Andy Li J; erlang-questions@REDACTED Subject: Re: [erlang-questions] How to define snmp get bulk request pdu including max-repetitions and no-repeaters Hello Andy, Don't know why you try to construct the pdu yourself, but I can see that in the snmp application the code for constructing bulk request pdu is: make_pdu(bulk, {NonRepeaters, MaxRepetitions, Oids}, MiniMIB) -> Foids = [flatten_oid(Oid, MiniMIB) || Oid <- Oids], #pdu{type = 'get-bulk-request', request_id = request_id(), error_status = NonRepeaters, error_index = MaxRepetitions, varbinds = [make_vb(Foid) || Foid <- Foids]}; The standard way to perform a bulk request would be: snmpm:sync_get_bulk("snmp_user", "snmp_agent", 0, 3, [[1,3,6,1,4,1,14817,3,12,2,10,1,5,1]]). Best Dominik On 24.12.2014 09:56, Andy Li J wrote: Hi all, If I want to define a snmp get request pdu, and the format as follows: #pdu{ type = ?get-request?, request_id = ReqId, error_status = noError, error_index = 0, varbinds } And if I want to define a snmp get bulk pdu including max-repetitions and no-repeaters, how to define it? I try the following, but report max_repetitions and no_repeaters undefined in record pdu. #pdu{ type = ?get-bulk-request?, request_id = ReqId, max_repetitions = MaxRepetitions, non_repeaters = NonRepeaters, varbinds } But I find that in RFC3416, BulkPDU ::= -- must be identical in SEQUENCE { -- structure to PDU request-id INTEGER (-214783648..214783647), non-repeaters INTEGER (0..max-bindings), max-repetitions INTEGER (0..max-bindings), variable-bindings -- values are ignored VarBindList } Could you help me? Thanks very much. B.R Andy _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.rascao@REDACTED Tue Dec 30 17:52:32 2014 From: luis.rascao@REDACTED (=?UTF-8?B?THVpcyBSYXNjw6Nv?=) Date: Tue, 30 Dec 2014 16:52:32 +0000 Subject: [erlang-questions] Type tuple won't compile Message-ID: Hi all, I'm having a hard time figuring out why the following code won't compile: -module(t). -export([test/1]). -record(map, {a, b}). -type map() :: #map{}. -record(tuple, {a, b}). -type tuple() :: #tuple{}. -record(list, {a, b}). -type list() :: #list{}. -spec test(map() | tuple() | list()) -> map | tuple | list. test(#map{}) -> map; test(#tuple{}) -> tuple; test(#list{}) -> list. erlc t.erl: t.erl:9: type tuple() already defined why should the tuple() type throw an error when the others do not? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.nijhof@REDACTED Tue Dec 30 20:46:57 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Tue, 30 Dec 2014 20:46:57 +0100 Subject: [erlang-questions] Type tuple won't compile In-Reply-To: References: Message-ID: Predefined types: http://www.erlang.org/doc/reference_manual/typespec.html On Tue, Dec 30, 2014 at 5:52 PM, Luis Rasc?o wrote: > Hi all, > I'm having a hard time figuring out why the following code won't compile: > > -module(t). > > -export([test/1]). > > -record(map, {a, b}). > -type map() :: #map{}. > > -record(tuple, {a, b}). > -type tuple() :: #tuple{}. > > -record(list, {a, b}). > -type list() :: #list{}. > > -spec test(map() | tuple() | list()) -> map | tuple | list. > test(#map{}) -> map; > test(#tuple{}) -> tuple; > test(#list{}) -> list. > > erlc t.erl: > t.erl:9: type tuple() already defined > > why should the tuple() type throw an error when the others do not? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Mark Nijhof t: @MarkNijhof s: marknijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.nijhof@REDACTED Tue Dec 30 20:54:37 2014 From: mark.nijhof@REDACTED (Mark Nijhof) Date: Tue, 30 Dec 2014 20:54:37 +0100 Subject: [erlang-questions] Type tuple won't compile In-Reply-To: References: Message-ID: I actually get: src/t.erl:9: type tuple() already defined src/t.erl:12: type list() is a builtin type; it cannot be redefined src/t.erl:6: Warning: type map is a new builtin type; its (re)definition is allowed only until the next release Using Erlang 17.3 or 4 (don't seem to be able to get that info after the . anymore) On Tue, Dec 30, 2014 at 8:46 PM, Mark Nijhof wrote: > Predefined types: http://www.erlang.org/doc/reference_manual/typespec.html > > On Tue, Dec 30, 2014 at 5:52 PM, Luis Rasc?o > wrote: > >> Hi all, >> I'm having a hard time figuring out why the following code won't compile: >> >> -module(t). >> >> -export([test/1]). >> >> -record(map, {a, b}). >> -type map() :: #map{}. >> >> -record(tuple, {a, b}). >> -type tuple() :: #tuple{}. >> >> -record(list, {a, b}). >> -type list() :: #list{}. >> >> -spec test(map() | tuple() | list()) -> map | tuple | list. >> test(#map{}) -> map; >> test(#tuple{}) -> tuple; >> test(#list{}) -> list. >> >> erlc t.erl: >> t.erl:9: type tuple() already defined >> >> why should the tuple() type throw an error when the others do not? >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > -- Mark Nijhof t: @MarkNijhof s: marknijhof -------------- next part -------------- An HTML attachment was scrubbed... URL: From the.silly.sad@REDACTED Tue Dec 30 19:54:52 2014 From: the.silly.sad@REDACTED (the.silly.sad) Date: Tue, 30 Dec 2014 19:54:52 +0100 Subject: [erlang-questions] Type tuple won't compile In-Reply-To: References: Message-ID: <54A2F4FC.5090807@gmail.com> On 12/30/2014 05:52 PM, Luis Rasc?o wrote: > Hi all, > I'm having a hard time figuring out why the following code won't compile: > > -module(t). > > -export([test/1]). > > -record(map, {a, b}). > -type map() :: #map{}. > > -record(tuple, {a, b}). > -type tuple() :: #tuple{}. > > -record(list, {a, b}). > -type list() :: #list{}. > > -spec test(map() | tuple() | list()) -> map | tuple | list. > test(#map{}) -> map; > test(#tuple{}) -> tuple; > test(#list{}) -> list. > > erlc t.erl: > t.erl:9: type tuple() already defined > > why should the tuple() type throw an error when the others do not? because it is already defined. From samp4040@REDACTED Tue Dec 30 20:44:09 2014 From: samp4040@REDACTED (sam pendleton) Date: Tue, 30 Dec 2014 14:44:09 -0500 Subject: [erlang-questions] mesos and erlang Message-ID: Does it typically make sense to use Mesos (https://mesos.apache.org/) and Erlang together when you are building a web app? From luis.rascao@REDACTED Tue Dec 30 22:15:51 2014 From: luis.rascao@REDACTED (=?UTF-8?B?THVpcyBSYXNjw6Nv?=) Date: Tue, 30 Dec 2014 21:15:51 +0000 Subject: [erlang-questions] Type tuple won't compile In-Reply-To: References: Message-ID: i'm on 16B03-1, i know about predefined types and if all of them failed i would have had no problem with this, what bugs me is that only tuple is raised as an error, guess it's a bug that's since been fixed, thanks! On Tuesday, December 30, 2014, Mark Nijhof wrote: > I actually get: > > src/t.erl:9: type tuple() already defined > src/t.erl:12: type list() is a builtin type; it cannot be redefined > src/t.erl:6: Warning: type map is a new builtin type; its (re)definition > is allowed only until the next release > > Using Erlang 17.3 or 4 (don't seem to be able to get that info after the . > anymore) > > > On Tue, Dec 30, 2014 at 8:46 PM, Mark Nijhof < > mark.nijhof@REDACTED > > wrote: > >> Predefined types: >> http://www.erlang.org/doc/reference_manual/typespec.html >> >> On Tue, Dec 30, 2014 at 5:52 PM, Luis Rasc?o > > wrote: >> >>> Hi all, >>> I'm having a hard time figuring out why the following code won't compile: >>> >>> -module(t). >>> >>> -export([test/1]). >>> >>> -record(map, {a, b}). >>> -type map() :: #map{}. >>> >>> -record(tuple, {a, b}). >>> -type tuple() :: #tuple{}. >>> >>> -record(list, {a, b}). >>> -type list() :: #list{}. >>> >>> -spec test(map() | tuple() | list()) -> map | tuple | list. >>> test(#map{}) -> map; >>> test(#tuple{}) -> tuple; >>> test(#list{}) -> list. >>> >>> erlc t.erl: >>> t.erl:9: type tuple() already defined >>> >>> why should the tuple() type throw an error when the others do not? >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> >> -- >> Mark Nijhof >> t: @MarkNijhof >> s: marknijhof >> >> > > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From duncan@REDACTED Wed Dec 31 00:16:29 2014 From: duncan@REDACTED (Duncan McGreggor) Date: Tue, 30 Dec 2014 17:16:29 -0600 Subject: [erlang-questions] mesos and erlang In-Reply-To: References: Message-ID: I feel like we've come in on the middle of a conversation ... I'm not sure what you mean by "typically" in this case. The implication being that this might be a very natural thing to do in the Erlang community, building web apps using Mesos? A little background: Mesos' initial (and I believe still primary) use case is abstracting computing resources at the data center level. Though the project uses many of the same terms that one uses to describe Erlang applications, the two are (for the most part) addressing very different things. The typical web app in Erlang is built using Cowboy, YAWS, Nitrogen, ChicagoBoss, etc. Mesos now supports Docker, and you can run Erlang apps in Docker containers, so that's definitely a possibility. I haven't heard anyone talking about deploying Erlang on Mesos, but there might be folks on this list who have done so. To better answer your question, we'd need to know more about what you were trying to do... build a PaaS for running web apps? Use an existing PaaS for the same? Run a fault-tolerant web app on more traditional setups (e.g.,multiple lb'ed machines)? The possible combinations of web app frameworks and deployment mechanisms are great in number and essentially boil down to your particular needs, experience, and preference (like most things). If anyone on the list is deploying Erlang apps across large numbers of compute resources in a data center (e.g., 1000s of hardware nodes), it would be fascinating to hear from them. There are folks from Heroku (AWS infrastructure) on this list and probably Joyent, too ... they might have useful anecdotes to share... d On Tue, Dec 30, 2014 at 1:44 PM, sam pendleton wrote: > Does it typically make sense to use Mesos (https://mesos.apache.org/) > and Erlang together when you are building a web app? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From setori88@REDACTED Wed Dec 31 06:49:36 2014 From: setori88@REDACTED (stewart mackenzie) Date: Wed, 31 Dec 2014 13:49:36 +0800 Subject: [erlang-questions] [Nix-dev] Erlang Package Manager In-Reply-To: References: Message-ID: Dear all, I am an Erlang programmer and I use NixOS almost exclusively. Here is a nix project that compiles and deploys MongooseIM https://github.com/headcounter/deployment You can visit www.headcounter.org/hydra to see the CI. Particularly this build: https://headcounter.org/hydra/eval/14531 which also runs the tests : https://headcounter.org/hydra/build/447454/download/1/ct_report/ and builds the manual. Points of interest: This file builds the erlang dependencies: https://github.com/headcounter/deployment/blob/master/pkgs/build-support/build-erlang.nix Here are the erlang dependencies for MongooseIM : https://github.com/headcounter/deployment/tree/master/pkgs/erldeps This folder deals with MongooseIM: https://github.com/headcounter/deployment/tree/master/pkgs/mongooseim Have fun! We'll be rolling out NixOS in production shortly. Kind regards Stewart On Wed, Dec 31, 2014 at 1:00 PM, Anderson Torres wrote: > I think using Nix is very attractive: > - we are a small team by now, and we need more programmers and > beta-testers (as almost any big project). > - also, we can serve as a platform for popularizing Erlang. From kostis@REDACTED Wed Dec 31 09:21:24 2014 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 31 Dec 2014 10:21:24 +0200 Subject: [erlang-questions] Type tuple won't compile In-Reply-To: References: Message-ID: <54A3B204.2070707@cs.ntua.gr> On 12/30/2014 11:15 PM, Luis Rasc?o wrote: > i'm on 16B03-1, i know about predefined types and if all of them failed > i would have had no problem with this, what bugs me is that only tuple > is raised as an error, guess it's a bug that's since been fixed, thanks! Since you are on R16B03-1, it's not at all surprising that there is no complaint about the map() type since maps were introduced starting with OTP 17. (This also explains why the compiler in 17.* gives a warning rather than an error when confronted with a definition of the map() type; this gives some time to programs to adapt when language additions or changes take place.) But it's indeed a bug that the R16B03-1 does not raise an error for redefining list(). It's good to know that in 17.x it does not occur anymore. Kostis From torres.anderson.85@REDACTED Wed Dec 31 06:00:54 2014 From: torres.anderson.85@REDACTED (Anderson Torres) Date: Wed, 31 Dec 2014 03:00:54 -0200 Subject: [erlang-questions] Erlang Package Manager Message-ID: Hello! I am Anderson Torres. I'm a wannabe computer scientist, and a regular NixOS user. Recently at nix-dev mailing list [N1], Eric announced that the developers of Erlang were discussing the need of a package manager. I read the message of Joe Armstrong about using Nix. I think using Nix is very attractive: - we are a small team by now, and we need more programmers and beta-testers (as almost any big project). - also, we can serve as a platform for popularizing Erlang. I am not an Erlang programmer, but as an active NixOS user, I regularly maintain Nix expressions for some good softwares [N2]. So, maybe I can help answering questions about Nix, and even programming some small testing apps! Many thanks in advance! Waiting for input, Anderson ----------------------- N1: http://lists.science.uu.nl/pipermail/nix-dev/2014-December/015402.html N2: http://monitor.nixos.org From essen@REDACTED Wed Dec 31 12:02:45 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 31 Dec 2014 12:02:45 +0100 Subject: [erlang-questions] Erlang Package Manager In-Reply-To: References: Message-ID: <54A3D7D5.1080509@ninenines.eu> Hey there, welcome! Everything I am writing here is not Erlang/OTP team's views. They have not said anything after launching the debate and nobody knows if they find Nix a good fit or not. The biggest concern about using Nix from the discussions were Windows support. Erlang is supported on a number of OS, the three big ones being Linux/Windows/OSX. Patches to Erlang for functionality that do not exist on Windows tend to be rejected, so it is assumed the package manager will need to work on Windows too. Potential license issues also came up, most of everything in Erlang's world being BSD/MIT/ISC/Apache2. Again, only speculation there. Currently Erlang has no package manager but does come with dependency facilities (third party build tools do, anyway, but everyone uses one of those, be it erlang.mk, mad, rebar or another). Each project has a list of "deps" that it fetches (from git or other methods), compiles and then use when building the Erlang system (Erlang has "releases" which are a sort of packaging on steroids for Erlang systems). So people do not install anything, they just have different dependencies per project. Those dependencies are downloaded in a subfolder of the project. Also note that the "releases" come with the Erlang VM (BEAM) but also all applications needed to run it, so even in production there is little need to install anything (the most I ever installed to run a "release" was openssl). You just push the "release" to production and you're good. Personally I love this system and even if a package manager appears I will continue keeping things this way (with a manager's help or not). With erlang.mk creating a project is a matter of copying one file, running one command, editing Makefile, then typing make and you got your release generated. More importantly you have a project-local copy of the dependencies and so can go in and edit the source directly to fix bugs, and then easily push that dependency on your github and make your project depend on your github instead of the canonical one (needed while you wait for the patch to get merged or if you did a gross hack). If it's one of your projects you can also easily make deps/app_name a link to your local folder too. I do not see all this being as easy with a package manager (but I do not know Nix, so perhaps it is compatible with all this). What would make my life easier compared to today though would be an official package *index* (erlang.mk comes with an index but it's hard to motivate people to fill it; so I have been pushing for something official for a while). The topic of package managers regularly comes up on the mailing list though so there are some people who want to deal with installing things. Now erlang.org seems down so it's a little difficult to access but I recommend reading the previous thread (I *think* it starts here): http://erlang.org/pipermail/erlang-questions/2014-December/082119.html OTP team is probably on holiday leave now so no idea when things will get back up. On 12/31/2014 06:00 AM, Anderson Torres wrote: > Hello! > I am Anderson Torres. I'm a wannabe computer scientist, and a regular > NixOS user. > > Recently at nix-dev mailing list [N1], Eric announced that the > developers of Erlang were discussing the need of a package manager. I > read the message of Joe Armstrong about using Nix. > > I think using Nix is very attractive: > - we are a small team by now, and we need more programmers and > beta-testers (as almost any big project). > - also, we can serve as a platform for popularizing Erlang. > > I am not an Erlang programmer, but as an active NixOS user, I > regularly maintain Nix expressions for some good softwares [N2]. So, > maybe I can help answering questions about Nix, and even programming > some small testing apps! > > Many thanks in advance! > Waiting for input, > Anderson > > ----------------------- > N1: http://lists.science.uu.nl/pipermail/nix-dev/2014-December/015402.html > N2: http://monitor.nixos.org > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From essen@REDACTED Wed Dec 31 13:20:14 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 31 Dec 2014 13:20:14 +0100 Subject: [erlang-questions] Type tuple won't compile In-Reply-To: References: Message-ID: <54A3E9FE.9080907@ninenines.eu> I am curious as to why the error for tuple() and list() are different. On 12/30/2014 08:54 PM, Mark Nijhof wrote: > I actually get: > > src/t.erl:9: type tuple() already defined > src/t.erl:12: type list() is a builtin type; it cannot be redefined > src/t.erl:6: Warning: type map is a new builtin type; its (re)definition > is allowed only until the next release > > Using Erlang 17.3 or 4 (don't seem to be able to get that info after the > . anymore) > > > On Tue, Dec 30, 2014 at 8:46 PM, Mark Nijhof > > > wrote: > > Predefined types: > http://www.erlang.org/doc/reference_manual/typespec.html > > On Tue, Dec 30, 2014 at 5:52 PM, Luis Rasc?o > wrote: > > Hi all, > I'm having a hard time figuring out why the following code won't > compile: > > -module(t). > > -export([test/1]). > > -record(map, {a, b}). > -type map() :: #map{}. > > -record(tuple, {a, b}). > -type tuple() :: #tuple{}. > > -record(list, {a, b}). > -type list() :: #list{}. > > -spec test(map() | tuple() | list()) -> map | tuple | list. > test(#map{}) -> map; > test(#tuple{}) -> tuple; > test(#list{}) -> list. > > erlc t.erl: > t.erl:9: type tuple() already defined > > why should the tuple() type throw an error when the others do not? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > > > > -- > Mark Nijhof > t: @MarkNijhof > s: marknijhof > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From t@REDACTED Wed Dec 31 15:58:24 2014 From: t@REDACTED (Tristan Sloughter) Date: Wed, 31 Dec 2014 08:58:24 -0600 Subject: [erlang-questions] [Nix-dev] Erlang Package Manager In-Reply-To: References: Message-ID: <1420037904.3286020.208308277.3B5341AF@webmail.messagingengine.com> I tried to setup Nix for erlang development months or so ago and walked away frustrated. Your build-erlang.nix is an example of what I found unsatisfactory. Besides the simple fact of needing so much shell scripting (and it would need more if it was to support more than rebar, or even rebar3) there was also the need to manually (in the script) perform the linking. I came to Nix to try this because I thought I would be able to create build environments per project that only require telling it the Erlang/OTP version I want and the dependencies -- these being nix expressions with the url/sha to fetch -- and since all those would be set to install to something like .../erlang/lib/ I would get a ready environment with all my deps and Erlang in my path. That wasn't true, so next I was attempting scripts like you have but generic and setting ERL_LIBS instead of putting in ./deps/ because I didn't want it to assume what build tool that is in use. After fiddling some more I decided it wasn't worth it. So, it started with my lack of understanding of Nix -- my assumption that I could simply list dependencies in addition to the ones it would find based on the binary linking trick it does -- but I think in the end it just isn't a fit for Erlang development. -- Tristan Sloughter t@REDACTED On Tue, Dec 30, 2014, at 11:49 PM, stewart mackenzie wrote: > Dear all, > > I am an Erlang programmer and I use NixOS almost exclusively. > > Here is a nix project that compiles and deploys MongooseIM > > https://github.com/headcounter/deployment > > You can visit www.headcounter.org/hydra to see the CI. > Particularly this build: https://headcounter.org/hydra/eval/14531 > which also runs the tests : > https://headcounter.org/hydra/build/447454/download/1/ct_report/ > and builds the manual. > > Points of interest: > This file builds the erlang dependencies: > https://github.com/headcounter/deployment/blob/master/pkgs/build-support/build-erlang.nix > Here are the erlang dependencies for MongooseIM : > https://github.com/headcounter/deployment/tree/master/pkgs/erldeps > This folder deals with MongooseIM: > https://github.com/headcounter/deployment/tree/master/pkgs/mongooseim > > Have fun! > > We'll be rolling out NixOS in production shortly. > > Kind regards > Stewart > > > On Wed, Dec 31, 2014 at 1:00 PM, Anderson Torres > wrote: > > I think using Nix is very attractive: > > - we are a small team by now, and we need more programmers and > > beta-testers (as almost any big project). > > - also, we can serve as a platform for popularizing Erlang. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From setori88@REDACTED Wed Dec 31 16:34:35 2014 From: setori88@REDACTED (stewart mackenzie) Date: Wed, 31 Dec 2014 23:34:35 +0800 Subject: [erlang-questions] [Nix-dev] Erlang Package Manager In-Reply-To: <1420037904.3286020.208308277.3B5341AF@webmail.messagingengine.com> References: <1420037904.3286020.208308277.3B5341AF@webmail.messagingengine.com> Message-ID: Nix has cabal2nix, npm2nix what is needed is a rebar2nix. Lets not get too dramatic about it all. Next you could package Erl deps in the same fashion nix packages python, perl and other languages ie include the name pythonPackages.package_name. It really isnt far flung to imagine an erlangPackages.cowboy /s From n.oxyde@REDACTED Wed Dec 31 16:47:41 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Wed, 31 Dec 2014 16:47:41 +0100 Subject: [erlang-questions] [Nix-dev] Erlang Package Manager In-Reply-To: References: <1420037904.3286020.208308277.3B5341AF@webmail.messagingengine.com> Message-ID: How do you handle multiple versions of a single package? Le 31 d?c. 2014 ? 16:34, stewart mackenzie a ?crit : > Nix has cabal2nix, npm2nix what is needed is a rebar2nix. > > Lets not get too dramatic about it all. > > Next you could package Erl deps in the same fashion nix packages > python, perl and other languages ie include the name > pythonPackages.package_name. It really isnt far flung to imagine an > erlangPackages.cowboy > > /s > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From bchesneau@REDACTED Wed Dec 31 17:25:52 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 31 Dec 2014 17:25:52 +0100 Subject: [erlang-questions] [ANN] cbt 1.2.0 released Message-ID: Hi all, I just released cbt a pure Erlang library to manage multi-layer append-only Btrees. While the source code is based on Apache CouchDB it benefits from a lot of enhancements. This new version provides the following new features: - an ETS backend allowing you to store the BTree in memory: https://github.com/benoitc/cbt#ets-backend - the possibility to use your own storage backend: https://github.com/benoitc/cbt#custom-storage-backend Enjoy!? - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From drormein@REDACTED Wed Dec 31 18:49:13 2014 From: drormein@REDACTED (Dror Mein) Date: Wed, 31 Dec 2014 17:49:13 +0000 (UTC) Subject: [erlang-questions] how to dynamically create function to run in a different node In-Reply-To: <24A572A4-2B88-435B-B25D-F8C2A842D5C9@feuerlabs.com> References: <24A572A4-2B88-435B-B25D-F8C2A842D5C9@feuerlabs.com> Message-ID: <997694066.3161864.1420048153567.JavaMail.yahoo@jws106124.mail.bf1.yahoo.com> Thank you! so parse_transform is responsible of returning {M,F,A} where A is something I don't yet understand :).is there a way to turn {M,F,A} to fun? Is there a simpler way to create a fun that can be run on a different node? -------------- next part -------------- An HTML attachment was scrubbed... URL: From setori88@REDACTED Wed Dec 31 20:01:31 2014 From: setori88@REDACTED (stewart mackenzie) Date: Thu, 1 Jan 2015 03:01:31 +0800 Subject: [erlang-questions] [Nix-dev] Erlang Package Manager In-Reply-To: References: <1420037904.3286020.208308277.3B5341AF@webmail.messagingengine.com> Message-ID: On Wed, Dec 31, 2014 at 11:47 PM, Anthony Ramine wrote: > How do you handle multiple versions of a single package? Okay allow me to give a rather detailed answer describing in how NixOS works. I'll also describe how I envisage Erlang adopting Nix as its package manager. So I like to think of Nix as the Matrix, you, Neo, can reconfigure your world at a command. Your entire environment is made up of thousands of symlinks that can shifted about in an instant. Dodge speeding bullets - no problem. Now some code. A convenient way of creating an environment is using nix-shell. These files sit in your project folder. (contents of dev-shell) #! /bin/sh s=$(type -p nix-shell) exec $s release.nix -A erlangEnv (contents of release.nix) let pkgs = import {}; stdenv = pkgs.stdenv; in rec { erlangEnv = stdenv.mkDerivation rec { name = "erlang-env"; version = "1.1.1.1"; src = ./.; buildInputs = [ pkgs.erlang_odbc pkgs.git pkgs.openssl pkgs.libyaml pkgs.expat pkgs.zlib pkgs.libcouchbase pkgs.automake pkgs.autoconf pkgs.rebar ]; }; } Typically the above is used for short quick projects they are project specific environments. See the above 'pkgs.erlang_odbc' that currently points to erlang 17 with odbc support. I can change that to 'pkgs.erlangR16' and it'll point to Erlang R16.03. These are the Erlang versions supported https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/interpreters/erlang They are exposed via the all-packages.nix file https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix#L3994 You cannot have Erlang R16 and Erlang R17 in the same environment you will get a conflict. One could commit dev-shell and release.nix into your repo and thereafter run './dev-shell' and you'll leave your current environment and an environment as dictated by the release.nix will be created for you. Now if the Erlang community is considering adopting Nix as its package manager then the below is the way to do it: Nix already supports python, perl, php, haskell, node, lua and guile: https://github.com/NixOS/nixpkgs/tree/master/pkgs/top-level please notice the language specific *.nix files. For example When adding a node package one simply adds the package name to this file https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/node-packages.json and run npm2nix on the file like such: 'npm2nix node-packages.json node-packages-generated.nix'. The program npm2nix will go to the canonical https://www.npmjs.com/ and download all the node packages, update each package and create nix expressions accordingly. The packager then commits the edited *.json file and the generated file and makes a pull request for everyone's disposal. So referring to the previous release.nix example, notice there are no erlang code dependencies (yes yes forget about rebar). one would add 'erlangPackages.cowboy'. This then gets the cowboy package that is part of the nixpkgs. In other words the Nix community and Erlang community need to start banging their heads together, create an erlang-packages.nix and extend it accordingly. So a rebar2nix program (see https://github.com/NixOS/npm2nix and https://github.com/NixOS/cabal2nix) could simply be pointed at a git cloned erlang project from github and it'll parse the rebar.config file pulling down dependencies, compiling them then making them immutable derivatives in your nix-store. Note these packages are obviously not available to everyone in the community. Though if you run the very same rebar2nix program on the canonical erlang-packages.nix in https://github.com/NixOS/nixpkgs/tree/master/pkgs/top-level and generate a new file, then that would become available to everyone. Both communities are filled with terribly smart people. You'll get along just fine. Now, Nix also supports creating long lasting custom environments similar to nix-shell but essentially you install this environment as a package in your /nix/store so to speak. I have this file ~/.nixpkgs/erlang.nix ``` # $ nix-env -iA erlangEnv -f erlang.nix -p /nix/var/nix/gcroots/profiles/per-user/erlang # Make a convenience link. # $ ln -sf /nix/var/nix/gcroots/profiles/per-user/erlang/bin/load-env-erlang . # Activate the environment. # $ ./load-env-erlang # Optionally, rollback to an earlier generation of this profile. # $ nix-env --list-generations -p /nix/var/nix/gcroots/profiles/per-user/erlang let pkgs = import {}; stdenv = pkgs.stdenv; in rec { erlangEnv = pkgs.myEnvFun { name = "erlang"; buildInputs = with pkgs; [ erlang rebar openssl git binutils bash emacs which libyaml expat zlib automake autoconf mc libtool python libevent meld tig libpcap cmake libcouchbase pidgin ]; }; } ``` So this allows one to have generations such that one can rollback if something messed up. These environments can be quite complex if needed. You are limited by your creativity and the understanding of the nix expression language which is a lazy declarative language designed for managing packages. Indeed even nix-shell environment can be as complex as you want. A neat thing about NixOS (not Nix) is that you can configure your entire system (every daemon) in a declarative manner from one file: /etc/nixos/configuration.nix Nix is the package manager, it runs on Darwin, Linux, FreeBSD and IIRC windows. NixOS is it's own linux distro with Nix the package manager front and centre. Last word on immutability. Nix is very strict about immutability. So there are multiple phases when building a package. These phases allow for mutability, thereafter that package becomes immutable. Indeed /nix/store is read only. This is the Nix way, it's pointless fighting it. This is a quick grep of erlang in my /nix/store dr-xr-xr-x 5 root root 4096 Jan 1 1970 xi3r2y8wapfk19717k64az9973w881a3-erlang-16B03-1-odbc -r--r--r-- 1 root root 8835 Jan 1 1970 xjllfqh87k6d0b0mag6dajgbpdkbbmxj-env-erlangEnv.drv -r--r--r-- 1 root root 2274 Jan 1 1970 xqa5w0xldnbi6vkrqaf53y2wz55lh11x-erlang-env.drv dr-xr-xr-x 5 root root 4096 Jan 1 1970 xs8pn8l7zws0ck32k3jrgj53rk3ywvzx-erlang-17.3-odbc (did I just hear wtf?) A very happy new year to everyone Stewart From zkessin@REDACTED Wed Dec 31 21:22:36 2014 From: zkessin@REDACTED (Zachary Kessin) Date: Wed, 31 Dec 2014 22:22:36 +0200 Subject: [erlang-questions] Mostly Erlang on Packages Message-ID: <54A45B0C.1080408@gmail.com> Hi Everyone With all the conversation here on Packages and how we should manage them I thought that it might make sense to have a podcast on the topic. However for this I wanted to do something a bit different. Instead of recording it with the Panel and then releasing after editing. I had thought that we will try something new and do it live. We will do a google hangout on Air at 18:00GMT on January 6 (Convert that into your local timezone) and anyone who wants to can listen in and ask questions via the chat. --Zach Kessin Host Mostly Erlang Podcast @zkessin From eric.pailleau@REDACTED Wed Dec 31 22:02:00 2014 From: eric.pailleau@REDACTED (Eric Pailleau) Date: Wed, 31 Dec 2014 22:02:00 +0100 Subject: [erlang-questions] [Nix-dev] Erlang Package Manager Message-ID: https://getcomposer.org/doc/03-cli.md php have Composer, wich use php binary. replace php with erl, and count me in. I cannot see how nix can work pn Windows, even I do not use it. The PM must run on all plateform where erl is running. best wishes. ? Envoy? depuis mon mobile ? Eric stewart mackenzie a ?crit?: >On Wed, Dec 31, 2014 at 11:47 PM, Anthony Ramine wrote: >> How do you handle multiple versions of a single package? > >Okay allow me to give a rather detailed answer describing in how NixOS >works. I'll also describe how I envisage Erlang adopting Nix as its >package manager. > >So I like to think of Nix as the Matrix, you, Neo, can reconfigure >your world at a command. Your entire environment is made up of >thousands of symlinks that can shifted about in an instant. Dodge >speeding bullets - no problem. > >Now some code. > >A convenient way of creating an environment is using nix-shell. These >files sit in your project folder. > >(contents of dev-shell) >#! /bin/sh >s=$(type -p nix-shell) >exec $s release.nix -A erlangEnv > >(contents of release.nix) >let > pkgs = import {}; > stdenv = pkgs.stdenv; > in rec { > erlangEnv = stdenv.mkDerivation rec { > name = "erlang-env"; > version = "1.1.1.1"; > src = ./.; > buildInputs = [ pkgs.erlang_odbc pkgs.git pkgs.openssl >pkgs.libyaml pkgs.expat pkgs.zlib pkgs.libcouchbase pkgs.automake >pkgs.autoconf pkgs.rebar ]; > }; > } > >Typically the above is used for short quick projects they are project >specific environments. > >See the above 'pkgs.erlang_odbc' that currently points to erlang 17 >with odbc support. I can change that to 'pkgs.erlangR16' and it'll >point to Erlang R16.03. > >These are the Erlang versions supported >https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/interpreters/erlang >They are exposed via the all-packages.nix file >https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix#L3994 > >You cannot have Erlang R16 and Erlang R17 in the same environment you >will get a conflict. > >One could commit dev-shell and release.nix into your repo and >thereafter run './dev-shell' and you'll leave your current >environment and an environment as dictated by the release.nix will be >created for you. > >Now if the Erlang community is considering adopting Nix as its package >manager then the below is the way to do it: Nix already supports >python, perl, php, haskell, node, lua and guile: >https://github.com/NixOS/nixpkgs/tree/master/pkgs/top-level please >notice the language specific *.nix files. > >For example >When adding a node package one simply adds the package name to this >file https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/node-packages.json >and run npm2nix on the file like such: 'npm2nix node-packages.json >node-packages-generated.nix'. The program npm2nix will go to the >canonical https://www.npmjs.com/ and download all the node packages, >update each package and create nix expressions accordingly. The >packager then commits the edited *.json file and the generated file >and makes a pull request for everyone's disposal. > >So referring to the previous release.nix example, notice there are no >erlang code dependencies (yes yes forget about rebar). one would add >'erlangPackages.cowboy'. This then gets the cowboy package that is >part of the nixpkgs. > >In other words the Nix community and Erlang community need to start >banging their heads together, create an erlang-packages.nix and extend >it accordingly. > >So a rebar2nix program (see https://github.com/NixOS/npm2nix and >https://github.com/NixOS/cabal2nix) could simply be pointed at a git >cloned erlang project from github and it'll parse the rebar.config >file pulling down dependencies, compiling them then making them >immutable derivatives in your nix-store. Note these packages are >obviously not available to everyone in the community. Though if you >run the very same rebar2nix program on the canonical >erlang-packages.nix in >https://github.com/NixOS/nixpkgs/tree/master/pkgs/top-level and >generate a new file, then that would become available to everyone. > >Both communities are filled with terribly smart people. You'll get >along just fine. > >Now, Nix also supports creating long lasting custom environments >similar to nix-shell but essentially you install this environment as a >package in your /nix/store so to speak. > >I have this file ~/.nixpkgs/erlang.nix >``` ># $ nix-env -iA erlangEnv -f erlang.nix -p >/nix/var/nix/gcroots/profiles/per-user/erlang ># Make a convenience link. ># $ ln -sf >/nix/var/nix/gcroots/profiles/per-user/erlang/bin/load-env-erlang . ># Activate the environment. ># $ ./load-env-erlang ># Optionally, rollback to an earlier generation of this profile. ># $ nix-env --list-generations -p >/nix/var/nix/gcroots/profiles/per-user/erlang > >let > pkgs = import {}; > stdenv = pkgs.stdenv; > in rec { > erlangEnv = pkgs.myEnvFun { > name = "erlang"; > buildInputs = with pkgs; [ erlang rebar openssl git binutils >bash emacs which libyaml expat zlib automake autoconf mc libtool >python libevent meld tig libpcap cmake libcouchbase pidgin ]; > }; > } >``` > >So this allows one to have generations such that one can rollback if >something messed up. These environments can be quite complex if >needed. You are limited by your creativity and the understanding of >the nix expression language which is a lazy declarative language >designed for managing packages. Indeed even nix-shell environment can >be as complex as you want. > >A neat thing about NixOS (not Nix) is that you can configure your >entire system (every daemon) in a declarative manner from one file: >/etc/nixos/configuration.nix > >Nix is the package manager, it runs on Darwin, Linux, FreeBSD and IIRC >windows. NixOS is it's own linux distro with Nix the package manager >front and centre. > >Last word on immutability. Nix is very strict about immutability. So >there are multiple phases when building a package. These phases allow >for mutability, thereafter that package becomes immutable. Indeed >/nix/store is read only. This is the Nix way, it's pointless fighting >it. >This is a quick grep of erlang in my /nix/store > >dr-xr-xr-x 5 root root 4096 Jan 1 1970 >xi3r2y8wapfk19717k64az9973w881a3-erlang-16B03-1-odbc >-r--r--r-- 1 root root 8835 Jan 1 1970 >xjllfqh87k6d0b0mag6dajgbpdkbbmxj-env-erlangEnv.drv >-r--r--r-- 1 root root 2274 Jan 1 1970 >xqa5w0xldnbi6vkrqaf53y2wz55lh11x-erlang-env.drv >dr-xr-xr-x 5 root root 4096 Jan 1 1970 >xs8pn8l7zws0ck32k3jrgj53rk3ywvzx-erlang-17.3-odbc > >(did I just hear wtf?) > >A very happy new year to everyone > >Stewart >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions From assistant.mechanic.palmer@REDACTED Wed Dec 31 15:39:53 2014 From: assistant.mechanic.palmer@REDACTED (Palmer) Date: Wed, 31 Dec 2014 14:39:53 +0000 (UTC) Subject: [erlang-questions] Erlang package manager References: <54980224.8070106@ninenines.eu> <1419280721.3759353.205867005.30015C38@webmail.messagingengine.com> Message-ID: Joe Armstrong gmail.com> writes: > > Interesting - I read the papers and was impressed - I downloaded NiX > on my MacBook and the first command in the tutorial I was following > failed. > > Can anybody point me to a good tutorial other than the manual page > and various academic papers? Hi Joe, The OS X version of Nix has been under development recently. You should try using the testing branch. Setup instructions here: https://nixos.org/wiki/Nix_on_OS_X -Palmer