From technion@REDACTED Mon Aug 1 01:14:21 2016 From: technion@REDACTED (Technion) Date: Sun, 31 Jul 2016 23:14:21 +0000 Subject: [erlang-questions] JSX 2.8.0 Issue In-Reply-To: References: Message-ID: Well it's not a "Linux" problem, here it is running fine under Arch Linux. Are you sure you have consistent versions of Erlang? $ uname -a Linux linodeplz 4.4.0-2-ec2 #1 SMP Thu Jan 21 09:52:26 PST 2016 x86_64 GNU/Linu Erlang/OTP 19 [erts-8.0] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false] 1> jsx:encode(#{<<"library">> => <<"jsx">>, <<"awesome">> => true}). <<"{\"awesome\":true,\"library\":\"jsx\"}">> ________________________________ From: erlang-questions-bounces@REDACTED on behalf of Theepan Sent: Monday, 1 August 2016 7:10:02 AM To: Erlang Questions Mailing List Subject: [erlang-questions] JSX 2.8.0 Issue Hi There, I encounter an issue with JSX where -- jsx:encode(maps:to_list(#{<<"library">> => <<"jsx">>, <<"awesome">> => true})). -- works both on both OSX and CentOS. But -- jsx:encode(#{<<"library">> => <<"jsx">>, <<"awesome">> => true}). -- works on OSX but not on CentOS. I am using the same JSX version on both the machines, and I am using the example from the JSX GitHub page. Please see the logs below: ON CENTOS --------- (eventcx_server@REDACTED)18> (eventcx_server@REDACTED)18> (eventcx_server@REDACTED)18> (eventcx_server@REDACTED)18> jsx:encode(#{<<"library">> => <<"jsx">>, <<"awesome">> => true}). ** exception error: bad argument in function jsx_parser:value/4 (../src/jsx_parser.erl, line 163) (eventcx_server@REDACTED)19> (eventcx_server@REDACTED)19> (eventcx_server@REDACTED)19> (eventcx_server@REDACTED)19> jsx:encode(maps:to_list(#{<<"library">> => <<"jsx">>, <<"awesome">> => true})). <<"{\"awesome\":true,\"library\":\"jsx\"}">> (eventcx_server@REDACTED)20> (eventcx_server@REDACTED)20> (eventcx_server@REDACTED)20> [Quit] [root@REDACTED eventcx_server]# [root@REDACTED eventcx_server]# uname -a Linux echowave 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux [root@REDACTED eventcx_server]# ON OSX ------- 1> 1> 1> jsx:encode(#{<<"library">> => <<"jsx">>, <<"awesome">> => true}). <<"{\"awesome\":true,\"library\":\"jsx\"}">> 2> 2> 2> 2> jsx:encode(maps:to_list(#{<<"library">> => <<"jsx">>, <<"awesome">> => true})). <<"{\"awesome\":true,\"library\":\"jsx\"}">> 3> 3> 3> q(). ok 4> Piriyatheepans-MacBook-Pro:~ piriyatheepan$ Piriyatheepans-MacBook-Pro:~ piriyatheepan$ uname -a Darwin Piriyatheepans-MacBook-Pro.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64 Piriyatheepans-MacBook-Pro:~ piriyatheepan$ Piriyatheepans-MacBook-Pro:~ piriyatheepan$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From garazdawi@REDACTED Mon Aug 1 01:45:56 2016 From: garazdawi@REDACTED (Lukas Larsson) Date: Mon, 1 Aug 2016 01:45:56 +0200 Subject: [erlang-questions] LCNT: understanding proc_* and db_hash_slot collisions In-Reply-To: References: Message-ID: On Sun, Jul 31, 2016 at 2:37 PM, Max Lapshin wrote: > Very nice, so it seems that our measuring > process_info(Pid,message_queue_len) is really expensive? > > On Sun, Jul 31, 2016 at 2:38 PM, Max Lapshin wrote: > We can do it (measure message_queue_len) about 200 000 times per second. > It is bad practice? > As always, it depends. The locks are on a per process basis, so what you want to avoid is having the message queue length of one process being read very frequently by multiple other processes. When the conflicts happen some extra work has to be done by the process which is being inspected, but perhaps most notably the process doing the inspection gets suspended until it can get the locks it needs. The CPU usage of the conflict handing is not very large, but the suspension of the inspector could cause noticeably higher latency, especially if there are a lot of processes being suspended because they need the same lock. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasdeveloper@REDACTED Mon Aug 1 03:06:48 2016 From: vasdeveloper@REDACTED (Theepan) Date: Mon, 1 Aug 2016 06:36:48 +0530 Subject: [erlang-questions] JSX 2.8.0 Issue In-Reply-To: References: Message-ID: Yes - 18.0 On Mon, Aug 1, 2016 at 4:44 AM, Technion wrote: > Well it's not a "Linux" problem, here it is running fine under Arch Linux. > Are you sure you have consistent versions of Erlang? > > > $ uname -a > Linux linodeplz 4.4.0-2-ec2 #1 SMP Thu Jan 21 09:52:26 PST 2016 x86_64 > GNU/Linu > > > Erlang/OTP 19 [erts-8.0] [source] [64-bit] [async-threads:10] [hipe] > [kernel-poll:false] > > > 1> jsx:encode(#{<<"library">> => <<"jsx">>, <<"awesome">> => true}). > <<"{\"awesome\":true,\"library\":\"jsx\"}">> > > ------------------------------ > *From:* erlang-questions-bounces@REDACTED < > erlang-questions-bounces@REDACTED> on behalf of Theepan < > vasdeveloper@REDACTED> > *Sent:* Monday, 1 August 2016 7:10:02 AM > *To:* Erlang Questions Mailing List > *Subject:* [erlang-questions] JSX 2.8.0 Issue > > Hi There, > > I encounter an issue with JSX where -- > > > jsx:encode(maps:to_list(#{<<"library">> => <<"jsx">>, <<"awesome">> => > true})). -- works both on both OSX and CentOS. > > But -- > > jsx:encode(#{<<"library">> => <<"jsx">>, <<"awesome">> => true}). -- works > on OSX but not on CentOS. > > I am using the same JSX version on both the machines, and I am using the > example from the JSX GitHub page. > > Please see the logs below: > > > ON CENTOS > --------- > > (eventcx_server@REDACTED)18> > (eventcx_server@REDACTED)18> > (eventcx_server@REDACTED)18> > (eventcx_server@REDACTED)18> jsx:encode(#{<<"library">> => <<"jsx">>, > <<"awesome">> => true}). > ** exception error: bad argument > in function jsx_parser:value/4 (../src/jsx_parser.erl, line 163) > (eventcx_server@REDACTED)19> > (eventcx_server@REDACTED)19> > > (eventcx_server@REDACTED)19> > (eventcx_server@REDACTED)19> jsx:encode(maps:to_list(#{<<"library">> => > <<"jsx">>, <<"awesome">> => true})). > <<"{\"awesome\":true,\"library\":\"jsx\"}">> > (eventcx_server@REDACTED)20> > (eventcx_server@REDACTED)20> > (eventcx_server@REDACTED)20> [Quit] > > [root@REDACTED eventcx_server]# > [root@REDACTED eventcx_server]# uname -a > Linux echowave 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 > x86_64 x86_64 x86_64 GNU/Linux > [root@REDACTED eventcx_server]# > > > ON OSX > ------- > > 1> > 1> > 1> jsx:encode(#{<<"library">> => <<"jsx">>, <<"awesome">> => true}). > <<"{\"awesome\":true,\"library\":\"jsx\"}">> > 2> > 2> > > > 2> > 2> jsx:encode(maps:to_list(#{<<"library">> => <<"jsx">>, <<"awesome">> => > true})). > <<"{\"awesome\":true,\"library\":\"jsx\"}">> > 3> > 3> > 3> q(). > ok > > > 4> Piriyatheepans-MacBook-Pro:~ piriyatheepan$ > Piriyatheepans-MacBook-Pro:~ piriyatheepan$ uname -a > Darwin Piriyatheepans-MacBook-Pro.local 15.4.0 Darwin Kernel Version > 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 > x86_64 > Piriyatheepans-MacBook-Pro:~ piriyatheepan$ > Piriyatheepans-MacBook-Pro:~ piriyatheepan$ > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasdeveloper@REDACTED Mon Aug 1 03:12:25 2016 From: vasdeveloper@REDACTED (Theepan) Date: Mon, 1 Aug 2016 06:42:25 +0530 Subject: [erlang-questions] JSX 2.8.0 Issue In-Reply-To: References: Message-ID: JSX on CentOS 7 requires EVERY map to be converted into a list. On Mon, Aug 1, 2016 at 6:36 AM, Theepan wrote: > > Yes - 18.0 > > On Mon, Aug 1, 2016 at 4:44 AM, Technion wrote: > >> Well it's not a "Linux" problem, here it is running fine under Arch >> Linux. Are you sure you have consistent versions of Erlang? >> >> >> $ uname -a >> Linux linodeplz 4.4.0-2-ec2 #1 SMP Thu Jan 21 09:52:26 PST 2016 x86_64 >> GNU/Linu >> >> >> Erlang/OTP 19 [erts-8.0] [source] [64-bit] [async-threads:10] [hipe] >> [kernel-poll:false] >> >> >> 1> jsx:encode(#{<<"library">> => <<"jsx">>, <<"awesome">> => true}). >> <<"{\"awesome\":true,\"library\":\"jsx\"}">> >> >> ------------------------------ >> *From:* erlang-questions-bounces@REDACTED < >> erlang-questions-bounces@REDACTED> on behalf of Theepan < >> vasdeveloper@REDACTED> >> *Sent:* Monday, 1 August 2016 7:10:02 AM >> *To:* Erlang Questions Mailing List >> *Subject:* [erlang-questions] JSX 2.8.0 Issue >> >> Hi There, >> >> I encounter an issue with JSX where -- >> >> >> jsx:encode(maps:to_list(#{<<"library">> => <<"jsx">>, <<"awesome">> => >> true})). -- works both on both OSX and CentOS. >> >> But -- >> >> jsx:encode(#{<<"library">> => <<"jsx">>, <<"awesome">> => true}). -- >> works on OSX but not on CentOS. >> >> I am using the same JSX version on both the machines, and I am using the >> example from the JSX GitHub page. >> >> Please see the logs below: >> >> >> ON CENTOS >> --------- >> >> (eventcx_server@REDACTED)18> >> (eventcx_server@REDACTED)18> >> (eventcx_server@REDACTED)18> >> (eventcx_server@REDACTED)18> jsx:encode(#{<<"library">> => <<"jsx">>, >> <<"awesome">> => true}). >> ** exception error: bad argument >> in function jsx_parser:value/4 (../src/jsx_parser.erl, line 163) >> (eventcx_server@REDACTED)19> >> (eventcx_server@REDACTED)19> >> >> (eventcx_server@REDACTED)19> >> (eventcx_server@REDACTED)19> jsx:encode(maps:to_list(#{<<"library">> => >> <<"jsx">>, <<"awesome">> => true})). >> <<"{\"awesome\":true,\"library\":\"jsx\"}">> >> (eventcx_server@REDACTED)20> >> (eventcx_server@REDACTED)20> >> (eventcx_server@REDACTED)20> [Quit] >> >> [root@REDACTED eventcx_server]# >> [root@REDACTED eventcx_server]# uname -a >> Linux echowave 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 >> x86_64 x86_64 x86_64 GNU/Linux >> [root@REDACTED eventcx_server]# >> >> >> ON OSX >> ------- >> >> 1> >> 1> >> 1> jsx:encode(#{<<"library">> => <<"jsx">>, <<"awesome">> => true}). >> <<"{\"awesome\":true,\"library\":\"jsx\"}">> >> 2> >> 2> >> >> >> 2> >> 2> jsx:encode(maps:to_list(#{<<"library">> => <<"jsx">>, <<"awesome">> => >> true})). >> <<"{\"awesome\":true,\"library\":\"jsx\"}">> >> 3> >> 3> >> 3> q(). >> ok >> >> >> 4> Piriyatheepans-MacBook-Pro:~ piriyatheepan$ >> Piriyatheepans-MacBook-Pro:~ piriyatheepan$ uname -a >> Darwin Piriyatheepans-MacBook-Pro.local 15.4.0 Darwin Kernel Version >> 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 >> x86_64 >> Piriyatheepans-MacBook-Pro:~ piriyatheepan$ >> Piriyatheepans-MacBook-Pro:~ piriyatheepan$ >> >> >> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc@REDACTED Mon Aug 1 10:21:31 2016 From: marc@REDACTED (Marc Worrell) Date: Mon, 1 Aug 2016 10:21:31 +0200 Subject: [erlang-questions] httpc: connection per request In-Reply-To: References: Message-ID: <60C94356-5A4C-41DB-9C81-984924D9D922@worrell.nl> Hi Matwey, You can use different profiles. One profile per connection. A profile name is an atom, and you can start different profiles using inets. Example code: -spec ensure_profile(atom()) -> ok. ensure_profile(Profile) -> case inets:start(httpc, [{profile, Profile}]) of {ok, _} -> ok; {error, {already_started, _}} -> ok end. You can pass this profile name to httpc:request. - Marc > On 31 Jul 2016, at 20:55, Matwey V. Kornilov wrote: > > Hello, > > I use httpc in streaming mode to obtain the data from the remote hosts. > This data are processed in the special manner. > The processing of some stream pairs are depend on each other, i.e. the > processing process simultaneously reads both HTTP responses (there is > huge amount of data in each response, so I use streaming mode). > When the pair is located at the same server I would like to have one > connection per request, because I will easily run into dead lock > otherwise as the following. > The processor read some data from the first response stream and want to > read data from the second in order to make some decision and process > further. But the second request is awaiting until first response > finished inside httpc. But the first response will never be finished > because it is stop to read by processor which want second request > running in parallel. > > I would like to have one TCP connection per HTTP request in order not to > deadlock. Is {max_keep_alive_length, 1} sufficient to achieve this? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From yangzhenguo@REDACTED Mon Aug 1 15:47:13 2016 From: yangzhenguo@REDACTED (Yang Zhenguo) Date: Mon, 1 Aug 2016 21:47:13 +0800 Subject: [erlang-questions] The way to backup mnesia data daily In-Reply-To: References: Message-ID: Thanks James. Anothernode is the previous node name. Sorry for the "bad" name. Looks like I can restore it successfully without changing node name process. What I missed is that creating the tables in the new node. 2016-07-30 3:15 GMT+08:00 James Kingsbery <06jameskingsbery@REDACTED>: > I've followed those instructions before with success. I think you need to > give more to go on - is 'web_server@REDACTED' the new node name? When > you look at the node's name (eg, as shown in mnesia:info/0) what do you see? > > I would add that you should look at what your box is doing when you run > backups. Depending on what sort of data you have stored, it could use a lot > of resources and make the box sluggish or even cause a kernel panic. > > On Mon, Jul 25, 2016 at 7:38 AM, Yang Zhenguo > wrote: > >> Hi Team, >> >> Any suggestion on it? >> >> Thanks, >> Zhenguo >> >> 2016-07-24 22:14 GMT+08:00 Yang Zhenguo : >> >>> Hi Folks, >>> >>> Having a question about mnesia backup. >>> >>> We have an application running based on Erlang Cowboy and Mnesia. I am >>> wondering to know what is a good way to backup mnesia data daily, since we >>> only have one node. >>> >>> I followed the steps here >>> >>> http://stackoverflow.com/questions/463400/how-to-rename-the-node-running-a-mnesia-database >>> >>> But got the errors below: >>> >>> {aborted,{'EXIT',{aborted,{bad_commit,{missing_lock,'web_server@REDACTED >>> '}}}}??} >>> >>> The reason I want to change node name is in case I deploy it in another >>> machine with different ip address. >>> >>> May I have your suggestion? Many thanks. >>> >>> -- >>> Zhenguo Yang >>> www.prinbit.com >>> >> >> >> >> -- >> Zhenguo Yang >> www.prinbit.com >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- Zhenguo Yang www.prinbit.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasdeveloper@REDACTED Mon Aug 1 16:40:16 2016 From: vasdeveloper@REDACTED (Theepan) Date: Mon, 1 Aug 2016 20:10:16 +0530 Subject: [erlang-questions] Cowboy - cowboy_req:reply Message-ID: Hi Team, What is the return value of cowboy_req:reply? {ok, Req2} or Req2. The document says the below, but the real return value is Req2. {ok, Req2} = cowboy_req:reply(200, [ {<<"content-type">>, <<"text/plain">>} ], "Hello world!", Req). OR Req2 = cowboy_req:reply(200, [ {<<"content-type">>, <<"text/plain">>} ], "Hello world!", Req). -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathaniel@REDACTED Mon Aug 1 16:56:27 2016 From: nathaniel@REDACTED (Nathaniel Waisbrot) Date: Mon, 1 Aug 2016 10:56:27 -0400 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: References: Message-ID: <34D99FD6-423F-47C5-B1B1-DB72CBA5082A@waisbrot.net> > What is the return value of cowboy_req:reply? {ok, Req2} or Req2. > > The document says the below, but the real return value is Req2. How are you determining the "real return value"? https://github.com/ninenines/cowboy/blob/1.0.x/src/cowboy_req.erl#L892 -------------- 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 jesper.louis.andersen@REDACTED Mon Aug 1 16:58:15 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 1 Aug 2016 16:58:15 +0200 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: References: Message-ID: On Mon, Aug 1, 2016 at 4:40 PM, Theepan wrote: > What is the return value of cowboy_req:reply? {ok, Req2} or Req2. > Both! Cowboy version 1.x uses {ok, Req2} Cowboy version 2.x (when it is released) uses Req2. You may want to make sure you are reading the right version of the documentation. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Mon Aug 1 17:01:19 2016 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 1 Aug 2016 18:01:19 +0300 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: References: Message-ID: Btw, is it time to convert all production code to cowboy2? -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasdeveloper@REDACTED Mon Aug 1 17:24:53 2016 From: vasdeveloper@REDACTED (Theepan) Date: Mon, 1 Aug 2016 20:54:53 +0530 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: References: Message-ID: Thanks guys! That clarifies.. Regards, Theepan On Mon, Aug 1, 2016 at 8:31 PM, Max Lapshin wrote: > Btw, is it time to convert all production code to cowboy2? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Mon Aug 1 17:28:42 2016 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 1 Aug 2016 17:28:42 +0200 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: References: Message-ID: <28dea54c-c094-a49b-3bf8-1cbf15582fb7@ninenines.eu> No! I am finishing up changes to what will be released as 2.0.0-pre.4. I will start recommending this version which, although it won't be finished, should be pretty close to the final interface. It'll be out before the end of summer. On 08/01/2016 05:01 PM, Max Lapshin wrote: > Btw, is it time to convert all production code to cowboy2? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From arunp@REDACTED Mon Aug 1 17:22:01 2016 From: arunp@REDACTED (ARUN P) Date: Mon, 01 Aug 2016 20:52:01 +0530 Subject: [erlang-questions] rpc call from erlang node to cnode In-Reply-To: References: <579CBE22.7080206@utl.in> Message-ID: <579F6919.50704@utl.in> Hi Vlad, Thank you for the valuable comment. Actually i have implemented cnode the way you have mentioned ie. through message passing. The cnode is used to interface erlang with my C application, which is a library and have some handy number of functions implemented in it with unique functionalities. So if i want to call any of those functions, i need to send specific message, these messages should be interpreted at cnode and based on this i should call the specific functionality. The message interpretation was tedious, thats why this doubt popped up in my mind. Best regard Arun On Sunday 31 July 2016 01:46 PM, Vlad Dumitrescu wrote: > Hi Arun, > > Well, it is possible to do RPC calls in all directions, but what is > missing is a framework on the cnode that will handle it. An RPC call > is simply a mesage from a node to another. Cnodes are not beam VMs and > you would have to implement code that receives the message, interpret > it to find out what to call (because cnodes know nothing about Erlang > code and libraries), execute the call and return the result as another > message. > > My guess is that cnodes were thought in the beginning to serve as > "inputs" in the system, interfacing with the world. This has partially > been superseded by NIFs. > > Why do you need to make RPC calls to a cnode? > > best regards, > Vlad > > > On Sat, Jul 30, 2016 at 4:48 PM, ARUN P > wrote: > > Hi , > > can anyone please suggest me is there any possible way to do > rpc call from erlang node to cnode. I understand that there is no > direct mechanism available to make rpc to cnode, but am curious > because of the fact that, am able to make rpc call from cnode to > erlang node, then why vice-vers is not possible. Somebody kindly > assist me. > > Thanks in advance. > Arun > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliver.bollmann@REDACTED Mon Aug 1 18:06:50 2016 From: oliver.bollmann@REDACTED (Oliver Bollmann) Date: Mon, 1 Aug 2016 18:06:50 +0200 Subject: [erlang-questions] How to add wxHtmlDCRenderer class to wxerlang Message-ID: <30551c1b-70c9-e0e7-9add-a4e5ff0f0a3e@t-online.de> I tried https://github.com/erlang/otp/tree/3b7a6ffddc819bf305353a593904cea9e932e7dc/lib/wx/api_gen but seems very old description, we are using wx 3.x but description is for wx 2.8! Any hints? -- Gr??e Oliver Bollmann From vasdeveloper@REDACTED Mon Aug 1 18:20:29 2016 From: vasdeveloper@REDACTED (Theepan) Date: Mon, 1 Aug 2016 21:50:29 +0530 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: <28dea54c-c094-a49b-3bf8-1cbf15582fb7@ninenines.eu> References: <28dea54c-c094-a49b-3bf8-1cbf15582fb7@ninenines.eu> Message-ID: Great Lo?c.. Were there any serious bugs in 2.0.0-pre.2 ? On Mon, Aug 1, 2016 at 8:58 PM, Lo?c Hoguin wrote: > No! > > I am finishing up changes to what will be released as 2.0.0-pre.4. I will > start recommending this version which, although it won't be finished, > should be pretty close to the final interface. > > It'll be out before the end of summer. > > On 08/01/2016 05:01 PM, Max Lapshin wrote: > >> Btw, is it time to convert all production code to cowboy2? >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kennethlakin@REDACTED Mon Aug 1 20:56:30 2016 From: kennethlakin@REDACTED (Kenneth Lakin) Date: Mon, 1 Aug 2016 11:56:30 -0700 Subject: [erlang-questions] How to add wxHtmlDCRenderer class to wxerlang In-Reply-To: <30551c1b-70c9-e0e7-9add-a4e5ff0f0a3e@t-online.de> References: <30551c1b-70c9-e0e7-9add-a4e5ff0f0a3e@t-online.de> Message-ID: <579F9B5E.7020102@gmail.com> On 08/01/2016 09:06 AM, Oliver Bollmann wrote: > Any hints? Does following the instructions in the readme "Adding/changing stuff/classes should be done by updating wxapi.conf and running make. Sometimes the code generator will require changes, I havn't thought of everything yet." not work? Also: Gentoo Linux builds Erlang against wxWidgets 3.0 and and applies this patch before building OTP 18.2.1 or later: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-lang/erlang/files/18.2.1-wx3.0.patch I checked on my system and the wxe_driver.so built by Gentoo links against wx 3.0, whereas the one built from Github sources links against wx 2.8. Hope this helps! -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From essen@REDACTED Mon Aug 1 20:58:32 2016 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 1 Aug 2016 20:58:32 +0200 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: References: <28dea54c-c094-a49b-3bf8-1cbf15582fb7@ninenines.eu> Message-ID: <77be537f-96f2-2ba1-9da0-144dd883d818@ninenines.eu> No, 2.0.0-pre.3 and below are pretty similar to 1.0.4 in terms of known bugs (for the same features). Anything in between is anyone's guess. On 08/01/2016 06:20 PM, Theepan wrote: > Great Lo?c.. > > Were there any serious bugs in 2.0.0-pre.2 ? > > On Mon, Aug 1, 2016 at 8:58 PM, Lo?c Hoguin > wrote: > > No! > > I am finishing up changes to what will be released as 2.0.0-pre.4. I > will start recommending this version which, although it won't be > finished, should be pretty close to the final interface. > > It'll be out before the end of summer. > > On 08/01/2016 05:01 PM, Max Lapshin wrote: > > Btw, is it time to convert all production code to cowboy2? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From j.14159@REDACTED Mon Aug 1 23:32:39 2016 From: j.14159@REDACTED (Jeremy Pierre) Date: Mon, 01 Aug 2016 21:32:39 +0000 Subject: [erlang-questions] MLFE version 0.2.0 released Message-ID: Hi all, Version 0.2.0 of "ML-flavoured Erlang" (MLFE) is available now (name change still pending) at https://github.com/j14159/mlfe Lots of feedback and contributions from others, please see the changelog here: https://github.com/j14159/mlfe/blob/master/ChangeLog.org The big changes are: - binaries - basic map support - strings are now UTF-8 binaries - a very simple test directive for making test functions that EUnit can find There's a quick tour of the language now available here: https://github.com/j14159/mlfe/blob/master/Tour.md Blog post for the release including my rough plans for version 0.3.0: http://noisycode.com/blog/2016/08/01/mlfe-v0-dot-2-0-released/ As always, feedback and contributions are most welcome. You can find a few interested parties in #mlfe on freenode as well. Thanks, Jeremy -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasdeveloper@REDACTED Mon Aug 1 23:39:41 2016 From: vasdeveloper@REDACTED (Theepan) Date: Tue, 2 Aug 2016 03:09:41 +0530 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: <77be537f-96f2-2ba1-9da0-144dd883d818@ninenines.eu> References: <28dea54c-c094-a49b-3bf8-1cbf15582fb7@ninenines.eu> <77be537f-96f2-2ba1-9da0-144dd883d818@ninenines.eu> Message-ID: I noticed another issue with Cowboy. When it comes to static files, once or twice a day they fail to deliver with "500 - Internal Server Error". Dynamics pages are working fine. Is there any any issue? When the server (Erlang Node) is restarted, things work fine back, then after about 10 hours or so again the same pattern recurred. Unless you restart the node, the error is persistent. On Tue, Aug 2, 2016 at 12:28 AM, Lo?c Hoguin wrote: > No, 2.0.0-pre.3 and below are pretty similar to 1.0.4 in terms of known > bugs (for the same features). > > Anything in between is anyone's guess. > > On 08/01/2016 06:20 PM, Theepan wrote: > >> Great Lo?c.. >> >> Were there any serious bugs in 2.0.0-pre.2 ? >> >> On Mon, Aug 1, 2016 at 8:58 PM, Lo?c Hoguin > > wrote: >> >> No! >> >> I am finishing up changes to what will be released as 2.0.0-pre.4. I >> will start recommending this version which, although it won't be >> finished, should be pretty close to the final interface. >> >> It'll be out before the end of summer. >> >> On 08/01/2016 05:01 PM, Max Lapshin wrote: >> >> Btw, is it time to convert all production code to cowboy2? >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> -- >> Lo?c Hoguin >> http://ninenines.eu >> Author of The Erlanger Playbook, >> A book about software development using Erlang >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Mon Aug 1 23:41:17 2016 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 1 Aug 2016 23:41:17 +0200 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: References: <28dea54c-c094-a49b-3bf8-1cbf15582fb7@ninenines.eu> <77be537f-96f2-2ba1-9da0-144dd883d818@ninenines.eu> Message-ID: <9f5b3982-7ca6-a4de-dc6b-86136058c8b9@ninenines.eu> Never heard of it but feel free to open a ticket with more details. If there's a 500 error then there's probably a related log sent to error_logger. On 08/01/2016 11:39 PM, Theepan wrote: > I noticed another issue with Cowboy. When it comes to static files, once > or twice a day they fail to deliver with "500 - Internal Server Error". > Dynamics pages are working fine. > > Is there any any issue? > > When the server (Erlang Node) is restarted, things work fine back, then > after about 10 hours or so again the same pattern recurred. Unless you > restart the node, the error is persistent. > > > > On Tue, Aug 2, 2016 at 12:28 AM, Lo?c Hoguin > wrote: > > No, 2.0.0-pre.3 and below are pretty similar to 1.0.4 in terms of > known bugs (for the same features). > > Anything in between is anyone's guess. > > On 08/01/2016 06:20 PM, Theepan wrote: > > Great Lo?c.. > > Were there any serious bugs in 2.0.0-pre.2 ? > > On Mon, Aug 1, 2016 at 8:58 PM, Lo?c Hoguin > >> wrote: > > No! > > I am finishing up changes to what will be released as > 2.0.0-pre.4. I > will start recommending this version which, although it won't be > finished, should be pretty close to the final interface. > > It'll be out before the end of summer. > > On 08/01/2016 05:01 PM, Max Lapshin wrote: > > Btw, is it time to convert all production code to cowboy2? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > > > > http://erlang.org/mailman/listinfo/erlang-questions > > > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > > -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From vasdeveloper@REDACTED Mon Aug 1 23:47:55 2016 From: vasdeveloper@REDACTED (Theepan) Date: Tue, 2 Aug 2016 03:17:55 +0530 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: <9f5b3982-7ca6-a4de-dc6b-86136058c8b9@ninenines.eu> References: <28dea54c-c094-a49b-3bf8-1cbf15582fb7@ninenines.eu> <77be537f-96f2-2ba1-9da0-144dd883d818@ninenines.eu> <9f5b3982-7ca6-a4de-dc6b-86136058c8b9@ninenines.eu> Message-ID: Now when I probed what happens during the 500 error, I see the following error in the Erlang logs. Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.2399.0> exit with reason: {cowboy_handler,[{class,error},{reason,{badmatch,{error,enoent}}},{mfa,{cowboy_static,init,2}},{stacktrace,[{filename,absname,1,[{file,"filename.erl"},{line,68}]},{cowboy_static,init_dir,3,[{file,"../src/cowboy_static.erl"},{line,82}]},{cowboy_handler,execute,2,[{file,"../src/cowb But all the files are present in the server, and their read access rights have not changed. Do you have a quick guess? On Tue, Aug 2, 2016 at 3:11 AM, Lo?c Hoguin wrote: > Never heard of it but feel free to open a ticket with more details. > > If there's a 500 error then there's probably a related log sent to > error_logger. > > On 08/01/2016 11:39 PM, Theepan wrote: > >> I noticed another issue with Cowboy. When it comes to static files, once >> or twice a day they fail to deliver with "500 - Internal Server Error". >> Dynamics pages are working fine. >> >> Is there any any issue? >> >> When the server (Erlang Node) is restarted, things work fine back, then >> after about 10 hours or so again the same pattern recurred. Unless you >> restart the node, the error is persistent. >> >> >> >> On Tue, Aug 2, 2016 at 12:28 AM, Lo?c Hoguin > > wrote: >> >> No, 2.0.0-pre.3 and below are pretty similar to 1.0.4 in terms of >> known bugs (for the same features). >> >> Anything in between is anyone's guess. >> >> On 08/01/2016 06:20 PM, Theepan wrote: >> >> Great Lo?c.. >> >> Were there any serious bugs in 2.0.0-pre.2 ? >> >> On Mon, Aug 1, 2016 at 8:58 PM, Lo?c Hoguin > >> >> wrote: >> >> No! >> >> I am finishing up changes to what will be released as >> 2.0.0-pre.4. I >> will start recommending this version which, although it won't >> be >> finished, should be pretty close to the final interface. >> >> It'll be out before the end of summer. >> >> On 08/01/2016 05:01 PM, Max Lapshin wrote: >> >> Btw, is it time to convert all production code to cowboy2? >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> >> > > >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> -- >> Lo?c Hoguin >> http://ninenines.eu >> Author of The Erlanger Playbook, >> A book about software development using Erlang >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> >> > > >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> -- >> Lo?c Hoguin >> http://ninenines.eu >> Author of The Erlanger Playbook, >> A book about software development using Erlang >> >> >> > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasdeveloper@REDACTED Mon Aug 1 23:53:08 2016 From: vasdeveloper@REDACTED (Theepan) Date: Tue, 2 Aug 2016 03:23:08 +0530 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: References: <28dea54c-c094-a49b-3bf8-1cbf15582fb7@ninenines.eu> <77be537f-96f2-2ba1-9da0-144dd883d818@ninenines.eu> <9f5b3982-7ca6-a4de-dc6b-86136058c8b9@ninenines.eu> Message-ID: Also wanted to share that the server is running on a VM instance and the OS is CentOS 7. When I restarted the node every thing started working fine. When this happens next time, I would also problem if the node itself is prevented from accessing the file system. On Tue, Aug 2, 2016 at 3:17 AM, Theepan wrote: > Now when I probed what happens during the 500 error, I see the following > error in the Erlang logs. > > Ranch listener http had connection process started with > cowboy_protocol:start_link/4 at <0.2399.0> exit with reason: > {cowboy_handler,[{class,error},{reason,{badmatch,{error,enoent}}},{mfa,{cowboy_static,init,2}},{stacktrace,[{filename,absname,1,[{file,"filename.erl"},{line,68}]},{cowboy_static,init_dir,3,[{file,"../src/cowboy_static.erl"},{line,82}]},{cowboy_handler,execute,2,[{file,"../src/cowb > > But all the files are present in the server, and their read access rights > have not changed. > > Do you have a quick guess? > > > > On Tue, Aug 2, 2016 at 3:11 AM, Lo?c Hoguin wrote: > >> Never heard of it but feel free to open a ticket with more details. >> >> If there's a 500 error then there's probably a related log sent to >> error_logger. >> >> On 08/01/2016 11:39 PM, Theepan wrote: >> >>> I noticed another issue with Cowboy. When it comes to static files, once >>> or twice a day they fail to deliver with "500 - Internal Server Error". >>> Dynamics pages are working fine. >>> >>> Is there any any issue? >>> >>> When the server (Erlang Node) is restarted, things work fine back, then >>> after about 10 hours or so again the same pattern recurred. Unless you >>> restart the node, the error is persistent. >>> >>> >>> >>> On Tue, Aug 2, 2016 at 12:28 AM, Lo?c Hoguin >> > wrote: >>> >>> No, 2.0.0-pre.3 and below are pretty similar to 1.0.4 in terms of >>> known bugs (for the same features). >>> >>> Anything in between is anyone's guess. >>> >>> On 08/01/2016 06:20 PM, Theepan wrote: >>> >>> Great Lo?c.. >>> >>> Were there any serious bugs in 2.0.0-pre.2 ? >>> >>> On Mon, Aug 1, 2016 at 8:58 PM, Lo?c Hoguin >> >>> >> wrote: >>> >>> No! >>> >>> I am finishing up changes to what will be released as >>> 2.0.0-pre.4. I >>> will start recommending this version which, although it >>> won't be >>> finished, should be pretty close to the final interface. >>> >>> It'll be out before the end of summer. >>> >>> On 08/01/2016 05:01 PM, Max Lapshin wrote: >>> >>> Btw, is it time to convert all production code to >>> cowboy2? >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> >>> >> > >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> -- >>> Lo?c Hoguin >>> http://ninenines.eu >>> Author of The Erlanger Playbook, >>> A book about software development using Erlang >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> >>> >> > >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> >>> -- >>> Lo?c Hoguin >>> http://ninenines.eu >>> Author of The Erlanger Playbook, >>> A book about software development using Erlang >>> >>> >>> >> -- >> Lo?c Hoguin >> http://ninenines.eu >> Author of The Erlanger Playbook, >> A book about software development using Erlang >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben@REDACTED Mon Aug 1 23:59:51 2016 From: ben@REDACTED (Ben Adams) Date: Mon, 01 Aug 2016 17:59:51 -0400 Subject: [erlang-questions] Off topic testing code questions Message-ID: I'm setting up a new project I have unit testing embedded to the code base.? I also want to do visual regression testing. Should this be in code base or external to compare to environments? -- Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Tue Aug 2 09:34:25 2016 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Tue, 2 Aug 2016 09:34:25 +0200 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: References: <28dea54c-c094-a49b-3bf8-1cbf15582fb7@ninenines.eu> <77be537f-96f2-2ba1-9da0-144dd883d818@ninenines.eu> <9f5b3982-7ca6-a4de-dc6b-86136058c8b9@ninenines.eu> Message-ID: The error log says the error happens in filename:absname/1, probably here: https://github.com/erlang/otp/blob/maint/lib/stdlib/src/filename.erl#L69 You'll need to investigate when it happens again. Perhaps someone can help you, on a quick glance it seems the error could come from the port driver. I have no experience in that area. Cheers, On 08/01/2016 11:53 PM, Theepan wrote: > Also wanted to share that the server is running on a VM instance and the > OS is CentOS 7. > > When I restarted the node every thing started working fine. When this > happens next time, I would also problem if the node itself is prevented > from accessing the file system. > > > On Tue, Aug 2, 2016 at 3:17 AM, Theepan > wrote: > > Now when I probed what happens during the 500 error, I see the > following error in the Erlang logs. > > Ranch listener http had connection process started with > cowboy_protocol:start_link/4 at <0.2399.0> exit with reason: > {cowboy_handler,[{class,error},{reason,{badmatch,{error,enoent}}},{mfa,{cowboy_static,init,2}},{stacktrace,[{filename,absname,1,[{file,"filename.erl"},{line,68}]},{cowboy_static,init_dir,3,[{file,"../src/cowboy_static.erl"},{line,82}]},{cowboy_handler,execute,2,[{file,"../src/cowb > > But all the files are present in the server, and their read access > rights have not changed. > > Do you have a quick guess? > > > > On Tue, Aug 2, 2016 at 3:11 AM, Lo?c Hoguin > wrote: > > Never heard of it but feel free to open a ticket with more details. > > If there's a 500 error then there's probably a related log sent > to error_logger. > > On 08/01/2016 11:39 PM, Theepan wrote: > > I noticed another issue with Cowboy. When it comes to static > files, once > or twice a day they fail to deliver with "500 - Internal > Server Error". > Dynamics pages are working fine. > > Is there any any issue? > > When the server (Erlang Node) is restarted, things work fine > back, then > after about 10 hours or so again the same pattern recurred. > Unless you > restart the node, the error is persistent. > > > > On Tue, Aug 2, 2016 at 12:28 AM, Lo?c Hoguin > > >> wrote: > > No, 2.0.0-pre.3 and below are pretty similar to 1.0.4 in > terms of > known bugs (for the same features). > > Anything in between is anyone's guess. > > On 08/01/2016 06:20 PM, Theepan wrote: > > Great Lo?c.. > > Were there any serious bugs in 2.0.0-pre.2 ? > > On Mon, Aug 1, 2016 at 8:58 PM, Lo?c Hoguin > > > > >>> wrote: > > No! > > I am finishing up changes to what will be > released as > 2.0.0-pre.4. I > will start recommending this version which, > although it won't be > finished, should be pretty close to the final > interface. > > It'll be out before the end of summer. > > On 08/01/2016 05:01 PM, Max Lapshin wrote: > > Btw, is it time to convert all production > code to cowboy2? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > > > > > >> > > http://erlang.org/mailman/listinfo/erlang-questions > > > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > > > > > >> > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > > > > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > > > -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From max.lapshin@REDACTED Tue Aug 2 10:40:49 2016 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 2 Aug 2016 11:40:49 +0300 Subject: [erlang-questions] =?utf-8?q?active=2CN_=E2=80=94_reset_counter_o?= =?utf-8?q?r_increment=3F?= Message-ID: Hi, it is not 100% clear for me from documentation if setting {active,1} reset active counter to 1 or increment it by 1? So, when I accept socket, I set: inet:setopts(Sock, [{active,50}]) then in handle_info({tcp,Socket,Bin}, ...) -> inet:setopts(Socket, [{active,1}]), ... Does it reset active counter to 1 or increment it by 1 from 49 to 50? If it increments, then can I ever receive {tcp_passive, Socket} ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From kennethlakin@REDACTED Tue Aug 2 11:08:58 2016 From: kennethlakin@REDACTED (Kenneth Lakin) Date: Tue, 2 Aug 2016 02:08:58 -0700 Subject: [erlang-questions] =?utf-8?q?active=2CN_=E2=80=94_reset_counter_o?= =?utf-8?q?r_increment=3F?= In-Reply-To: References: Message-ID: <57A0632A.8070703@gmail.com> On 08/02/2016 01:40 AM, Max Lapshin wrote: > Hi, it is not 100% clear for me from documentation if setting {active,1} > reset active counter to 1 or increment it by 1? If the integer passed in is positive, it increments. If it's negative, it decrements. If this operation causes the socket's message count to be <= 0, then the socket returns to passive mode. From the documentation for the active option to inet:setopts: "If the value is an integer N in the range -32768 to 32767 (inclusive), the value is added to the socket's count of data messages sent to the controlling process. ... Once the socket's message count reaches 0, either because of sending received data messages to the process or by being explicitly set, the process is then notified by a special message ... that the socket has entered passive mode." > Can [this sample code] ever receive {tcp_passive, Socket} ? Unless some other code is changing the message count for that socket, no. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From max.lapshin@REDACTED Tue Aug 2 11:15:09 2016 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 2 Aug 2016 12:15:09 +0300 Subject: [erlang-questions] =?utf-8?q?active=2CN_=E2=80=94_reset_counter_o?= =?utf-8?q?r_increment=3F?= In-Reply-To: <57A0632A.8070703@gmail.com> References: <57A0632A.8070703@gmail.com> Message-ID: Can it happen so that erlang is sending message after message and my process is not activated yet. Then erlang sends {tcp_passive and scheduler starts scheduling my process. It gets 50 messages, increments active counter back to 50, then it gets {tcp_passive and again increments by 50. Can this happen? -------------- next part -------------- An HTML attachment was scrubbed... URL: From kennethlakin@REDACTED Tue Aug 2 11:36:41 2016 From: kennethlakin@REDACTED (Kenneth Lakin) Date: Tue, 2 Aug 2016 02:36:41 -0700 Subject: [erlang-questions] =?utf-8?q?active=2CN_=E2=80=94_reset_counter_o?= =?utf-8?q?r_increment=3F?= In-Reply-To: References: <57A0632A.8070703@gmail.com> Message-ID: <57A069A9.7000906@gmail.com> On 08/02/2016 02:15 AM, Max Lapshin wrote: > Can it happen so that erlang is sending message after message and my > process is not activated yet. Then erlang sends {tcp_passive and > scheduler starts scheduling my process. That's a good point. I should have thought of that. That sounds like it could happen. So, maybe either increment in your packet handling code and do nothing when you get tcp_passive, or *only* increment when you get tcp_passive. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From max.lapshin@REDACTED Tue Aug 2 13:22:46 2016 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 2 Aug 2016 14:22:46 +0300 Subject: [erlang-questions] =?utf-8?q?active=2CN_=E2=80=94_reset_counter_o?= =?utf-8?q?r_increment=3F?= In-Reply-To: <57A069A9.7000906@gmail.com> References: <57A0632A.8070703@gmail.com> <57A069A9.7000906@gmail.com> Message-ID: It seems that good pattern of usage {active,N} is still to be designed =) Looks like it is required to check getopts(Socket,[active]) when handling tcp_passive -------------- next part -------------- An HTML attachment was scrubbed... URL: From thoffmann@REDACTED Tue Aug 2 15:33:24 2016 From: thoffmann@REDACTED (Torben Hoffmann) Date: Tue, 02 Aug 2016 15:33:24 +0200 Subject: [erlang-questions] Beginner gen_server and child monitoring In-Reply-To: References: Message-ID: <57a0b53d.9609370a.ae8ce.773c@mx.google.com> Hi Giovanni, Giovanni Giorgi writes: > Hi all, > I am an erlang newbies. > I am developing a small stock exchange monitoring application, after reading Francesco Cesarini Erlang book and wpriting some small libraries: > > https://github.com/daitangio/erprice > > I have a gen_server which take a monitor request, in the form {StockTicker, Market, droplimitvalue}. > Then the gen_server spawn a child process which track the price, sleeping at some interval. > The child process is monitored. > The child process die when the stock goes below the price drop but before that sends a notification to its gen_server > > Now the question is: Is a correct approach? > What is the best way of spawn-ing child which must loop and loop? > It depends on how much of a handle on the spawned processes you want. Your solution makes it a little hard to interogate the children because they are just spawned as simple processes. > I think the child cannot be a gen_server because its interface did not > seem to be thinked for continuing monitoring process. You could use gen_server, but it is rather heavy for this purpose. > There is some idiomatic behavior must I implement? > I can spawn_monitot child by hand? It is a good strategy? You could make the child an OTP-compliant process by following this instruction: http://erlang.org/doc/design_principles/spec_proc.html The section on "Special Processes". Then you can hook them into a supervision tree and use the sys module to ask them what they are doing. Small code style hint: when you do a gen_server:call/2 you should tag the message in some way, e.g., {spawned, NewPid}=gen_server:call(GenServer,{start_tick_tracker, Company, Market,lessthen,Quote}), That makes it easier to figure out what the code in handle_call is for. Cheers, Torben > -- > Giovanni Giorgi > jj@REDACTED > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Torben Hoffmann Chief Architect, basho.com M: +45 25 14 05 38 From marc@REDACTED Tue Aug 2 17:46:53 2016 From: marc@REDACTED (Marc Worrell) Date: Tue, 2 Aug 2016 17:46:53 +0200 Subject: [erlang-questions] [ANN] Zotonic hack-day (has been moved) Message-ID: Hey Erlang folks, We are organizing a Zotonic Hack Day. Because of the holidays, we decided to reschedule to 23 September: still a Friday, just a month later. Hopefully everyone can make it; please update your RSVP if this changes things for you. The challenge to release 1.0 before the year is over still stands, so I?ll guess we?ll just have to hack a little harder. :) It is great to see so much interest in the hackday! See you in September! We have updated this Meetup. For more details, see the full listing: https://www.meetup.com/Zotonic/events/232274874/ When: Friday, September 23, 2016 10:00 AM Where: Driebit Oudezijds Voorburgwal 282 Amsterdam Netherlands -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Wed Aug 3 14:26:15 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 3 Aug 2016 14:26:15 +0200 Subject: [erlang-questions] Beginner gen_server and child monitoring In-Reply-To: References: Message-ID: On Thu, Jul 28, 2016 at 7:47 AM, Giovanni Giorgi wrote: > Now the question is: Is a correct approach? The key observation is: "How do you want to handle error in the processes?" That is, you have a Main process and several Ticker processes. What should happen if the Main process crashes or goes away? What should happen if a Ticker process crashes or goes away? This can guide a solution. You could simply run the tickers as Torben suggests and then spawn_link them under the main process. This means, by default, if any ticker or the main process crashes, so does everyone else. You could also use an asymmetric solution: spawn_monitor the tickers and have the tickers monitor the main process. This allows you to handle the case where you want to restart a crashing ticker for instance, but you have to write the logic yourself. In general, spawning processes without knowing where they are only works for processes which are guaranteed to terminate. Otherwise, you end up with process leaks. The final solution is to use a supervision tree: have a main_sup with children MainProcess and TickerPool, the latter being a simple_one_for_one supervisor. Each ticker is added into the TickerPool with supervisor:start_child. It is the the most complex solution, but it has an advantage over the simpler methods: it encodes a *policy* in the supervisors for handling failure modes. That is, you can tolerate some tickers dying, but not too many before trying to restart larger parts of the system. So the TL;DR is to think about the failure mode of the application and write it accordingly. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Wed Aug 3 16:15:57 2016 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 3 Aug 2016 16:15:57 +0200 Subject: [erlang-questions] how: Installing Erlang with zypper (SLES11) Message-ID: <6a538d5d-b163-ade5-2d99-60bdcf91ea11@ericsson.com> Greetings How should I install Erlang on SLES11 using zypper? Adding the SUSE development repository(*) gives me many Erlang based packages, but not Erlang itself. Suggestions? bengt (*) zypper ar -f http://download.opensuse.org/repositories/devel:/languages:/erlang/openSUSE_Factory/ erlang This command borrowed from http://elixir-lang.org/install.html From bengt.kleberg@REDACTED Wed Aug 3 16:26:15 2016 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Wed, 3 Aug 2016 16:26:15 +0200 Subject: [erlang-questions] how: Installing Erlang with zypper (SLES11) In-Reply-To: <6a538d5d-b163-ade5-2d99-60bdcf91ea11@ericsson.com> References: <6a538d5d-b163-ade5-2d99-60bdcf91ea11@ericsson.com> Message-ID: Problem solved. Replace openSUSE_Factory with SLE_11_SP3 when adding repository. On 08/03/2016 04:15 PM, Bengt Kleberg wrote: > Greetings > > How should I install Erlang on SLES11 using zypper? > > Adding the SUSE development repository(*) gives me many Erlang based > packages, but not Erlang itself. > > Suggestions? > > > bengt > > (*) > > zypper ar -f > http://download.opensuse.org/repositories/devel:/languages:/erlang/openSUSE_Factory/ > erlang > This command borrowed from http://elixir-lang.org/install.html > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From roberto@REDACTED Wed Aug 3 17:45:38 2016 From: roberto@REDACTED (Roberto Ostinelli) Date: Wed, 3 Aug 2016 17:45:38 +0200 Subject: [erlang-questions] [ANN] Syn 1.5.0 - now with gen_server `via` tuple API support Message-ID: All, Syn 1.5.0 has just been released. For those of you who don't know it, Syn is a global Process Registry and Process Group manager for Erlang, which supports PubSub. Besides minor optimizations, the main addition is that processes can now also be registered as gen_server names, by usage of via tuples. This way, you can use the gen_server API with these tuples without referring to the Pid directly: Tuple = {via, syn, <<"your process name">>}. gen_server:start_link(Tuple, your_module, []). gen_server:call(Tuple, your_message). Thank you to Heri Sim for the original implementation and Johanna Appel for completing it. https://github.com/ostinelli/syn Best, r. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zambal@REDACTED Thu Aug 4 10:40:52 2016 From: zambal@REDACTED (Vincent Siliakus) Date: Thu, 4 Aug 2016 10:40:52 +0200 Subject: [erlang-questions] enif_keep_resource, enif_release_resource and thread safety Message-ID: Hi, Does anyone know if synchronization is needed when one calls enif_keep_resource in nif functions and enif_release_resource in a nif background thread? Or in other words: is the ref counting that is used under the hood thread safe? I ask this because during some refactoring of code in the LMDB driver I'm developing at https://github.com/zambal/elmdb I stumbled upon a problem that might have been caused by unsynchronized calls to these functions. However, when I searched github for other code that uses resources , I couldn't find examples that use synchronization, but that might be because it's simply not needed in those libraries, so I'm still not sure. Thanks, Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasdeveloper@REDACTED Thu Aug 4 14:55:32 2016 From: vasdeveloper@REDACTED (Theepan) Date: Thu, 4 Aug 2016 18:25:32 +0530 Subject: [erlang-questions] Cowboy - cowboy_req:reply In-Reply-To: References: <28dea54c-c094-a49b-3bf8-1cbf15582fb7@ninenines.eu> <77be537f-96f2-2ba1-9da0-144dd883d818@ninenines.eu> <9f5b3982-7ca6-a4de-dc6b-86136058c8b9@ninenines.eu> Message-ID: Thanks Lo?c, the issue was with the VM used. I hosted the system on a bare metal, and everything was fine. There were also other issues from the file system, so I decided to move it to bare metal. Cowboy is working like a charm! Regards, Theepan On Tue, Aug 2, 2016 at 1:04 PM, Lo?c Hoguin wrote: > The error log says the error happens in filename:absname/1, probably here: > https://github.com/erlang/otp/blob/maint/lib/stdlib/src/filename.erl#L69 > > You'll need to investigate when it happens again. Perhaps someone can help > you, on a quick glance it seems the error could come from the port driver. > I have no experience in that area. > > Cheers, > > On 08/01/2016 11:53 PM, Theepan wrote: > >> Also wanted to share that the server is running on a VM instance and the >> OS is CentOS 7. >> >> When I restarted the node every thing started working fine. When this >> happens next time, I would also problem if the node itself is prevented >> from accessing the file system. >> >> >> On Tue, Aug 2, 2016 at 3:17 AM, Theepan > > wrote: >> >> Now when I probed what happens during the 500 error, I see the >> following error in the Erlang logs. >> >> Ranch listener http had connection process started with >> cowboy_protocol:start_link/4 at <0.2399.0> exit with reason: >> {cowboy_handler,[{class,error},{reason,{badmatch,{error,enoe >> nt}}},{mfa,{cowboy_static,init,2}},{stacktrace,[{filename, >> absname,1,[{file,"filename.erl"},{line,68}]},{cowboy_ >> static,init_dir,3,[{file,"../src/cowboy_static.erl"},{line, >> 82}]},{cowboy_handler,execute,2,[{file,"../src/cowb >> >> But all the files are present in the server, and their read access >> rights have not changed. >> >> Do you have a quick guess? >> >> >> >> On Tue, Aug 2, 2016 at 3:11 AM, Lo?c Hoguin > > wrote: >> >> Never heard of it but feel free to open a ticket with more >> details. >> >> If there's a 500 error then there's probably a related log sent >> to error_logger. >> >> On 08/01/2016 11:39 PM, Theepan wrote: >> >> I noticed another issue with Cowboy. When it comes to static >> files, once >> or twice a day they fail to deliver with "500 - Internal >> Server Error". >> Dynamics pages are working fine. >> >> Is there any any issue? >> >> When the server (Erlang Node) is restarted, things work fine >> back, then >> after about 10 hours or so again the same pattern recurred. >> Unless you >> restart the node, the error is persistent. >> >> >> >> On Tue, Aug 2, 2016 at 12:28 AM, Lo?c Hoguin >> >> >> >> wrote: >> >> No, 2.0.0-pre.3 and below are pretty similar to 1.0.4 in >> terms of >> known bugs (for the same features). >> >> Anything in between is anyone's guess. >> >> On 08/01/2016 06:20 PM, Theepan wrote: >> >> Great Lo?c.. >> >> Were there any serious bugs in 2.0.0-pre.2 ? >> >> On Mon, Aug 1, 2016 at 8:58 PM, Lo?c Hoguin >> >> > >> >> > > >>> wrote: >> >> No! >> >> I am finishing up changes to what will be >> released as >> 2.0.0-pre.4. I >> will start recommending this version which, >> although it won't be >> finished, should be pretty close to the final >> interface. >> >> It'll be out before the end of summer. >> >> On 08/01/2016 05:01 PM, Max Lapshin wrote: >> >> Btw, is it time to convert all production >> code to cowboy2? >> >> >> ______________________________ >> _________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> >> > > >> > >> > >> >> >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> -- >> Lo?c Hoguin >> http://ninenines.eu >> Author of The Erlanger Playbook, >> A book about software development using Erlang >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> >> > > >> > >> > >> >> http://erlang.org/mailman/list >> info/erlang-questions >> >> >> >> -- >> Lo?c Hoguin >> http://ninenines.eu >> Author of The Erlanger Playbook, >> A book about software development using Erlang >> >> >> >> -- >> Lo?c Hoguin >> http://ninenines.eu >> Author of The Erlanger Playbook, >> A book about software development using Erlang >> >> >> >> > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jj@REDACTED Thu Aug 4 17:26:20 2016 From: jj@REDACTED (Giovanni Giorgi) Date: Thu, 4 Aug 2016 17:26:20 +0200 Subject: [erlang-questions] Beginner gen_server and child monitoring In-Reply-To: References: Message-ID: Hi, First of all thank you to Jesper and Troben. On 03/ago/2016, at 14:26, Jesper Louis Andersen wrote: > > On Thu, Jul 28, 2016 at 7:47 AM, Giovanni Giorgi wrote: > Now the question is: Is a correct approach? > > The key observation is: "How do you want to handle error in the processes?" [snip] > You could simply run the tickers as Torben suggests and then spawn_link them under the main process. ... > You could also use an asymmetric solution: spawn_monitor the tickers and have the tickers monitor the main process. This allows you to handle the case where you want to restart a crashing ticker for instance, but you have to write the logic yourself. In my first implementation I am using spawn_monitor because I want to know if some process die, but I do not want to tear down the entire tree for a stupid network error. I am also thinking to get a stronger child process which will crash only for a very bad error (i.e. out of memory or other important logic error). I think I need to implement a supervisor-like behavior for the server watching the small processes > > In general, spawning processes without knowing where they are only works for processes which are guaranteed to terminate. Otherwise, you end up with process leaks. I got it. By the way I am always amaze by how the Erlang language seems like a domain language, because the use of a bunch of right atom give me the freedom to model a problem in an easy to read fashion. > > The final solution is to use a supervision tree: have a main_sup with children MainProcess and TickerPool, the latter being a simple_one_for_one supervisor. Each ticker is added into the TickerPool with supervisor:start_child. It is the the most complex solution, but it has an advantage over the simpler methods: it encodes a *policy* in the supervisors for handling failure modes. That is, you can tolerate some tickers dying, but not too many before trying to restart larger parts of the system. > > So the TL;DR is to think about the failure mode of the application and write it accordingly. > > > -- > J. -- Giovanni Giorgi jj@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliver.bollmann@REDACTED Thu Aug 4 19:26:35 2016 From: oliver.bollmann@REDACTED (Oliver Bollmann) Date: Thu, 4 Aug 2016 19:26:35 +0200 Subject: [erlang-questions] How to make wx gen Message-ID: <10cd3847-f5af-ae27-c787-9c0efe1ad0a3@t-online.de> I use: wxGTK-2.8.12 I do in ..wx/api_gen: make complete_clean -> ok make wxxml_generated -> ok make wx_code_generated -> erl -noshell -run wx_gen code && touch wx_code_generated Error in "wxBitmap" "wxBitmap" {error,{{wx_gen,538},{"wxBitmap","wxBitmap"},{unknown_type,{param,"data",{type,{unhandled,"void",undefined,"wxBitmap","wxBitmap"},undefined,false,true,[const],{pointer,1},undefined},none,true,both,public,undefined,undefined}}},[{wx_gen,add_param2,3,[{file,"wx_gen.erl"},{line,538}]},{lists,foldl,3,[{file,"lists.erl"},{line,1262}]},{wx_gen,parse_member,4,[{file,"wx_gen.erl"},{line,431}]},{wx_gen,'-parse_members/5-fun-0-',4,[{file,"wx_gen.erl"},{line,235}]},{lists,foldl,3,[{file,"lists.erl"},{line,1262}]},{wx_gen,parse_members,5,[{file,"wx_gen.erl"},{line,245}]},{wx_gen,parse_class,5,[{file,"wx_gen.erl"},{line,208}]},{lists,foldl,3,[{file,"lists.erl"},{line,1262}]}]} make: *** [wx_code_generated] Error 1 Any hints? -- Gr??e Oliver Bollmann From lloyd@REDACTED Fri Aug 5 05:34:35 2016 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Thu, 4 Aug 2016 23:34:35 -0400 Subject: [erlang-questions] Coffer is **your personal storage** system. Message-ID: <1D21084C-A610-47CE-B9A9-51057E6F84B4@writersglen.com> Hello, I recently ran across this interesting Erlang application. Project appears to be three-years old. https://github.com/rcouch/coffer Is anyone using this "to store, sync, share, model and back up content?" I'm particularly interested in the "sync" feature, but can't decipher the documentation from the user perspective. Many thanks, LRP Sent from my iPad From ehsan.tck@REDACTED Fri Aug 5 20:34:19 2016 From: ehsan.tck@REDACTED (Ehsan Mohammadi) Date: Fri, 05 Aug 2016 18:34:19 +0000 Subject: [erlang-questions] Lager and syslog Message-ID: hi i`m trying to use lager_syslog in my project but it seems a driver is missing rebar.conf: {deps, [ ... {lager_syslog, {git, "https://github.com/basho/lager_syslog.git", {branch, master}}} ]}. my test handler: {lager_syslog_backend, ["test", local1, info]}, err: 19:29:09.981 [error] Lager failed to install handler {lager_syslog_backend,{"test",local1}} into lager_event, retrying later : {error, {{shutdown, {failed_to_start_child, syslog, "could not load driver syslog_drv: \"cannot open shared object file: No such file or directory\""}}, {syslog_app, start, [normal, []]}}} any suggestion? -------------- next part -------------- An HTML attachment was scrubbed... URL: From kennethlakin@REDACTED Fri Aug 5 23:03:28 2016 From: kennethlakin@REDACTED (Kenneth Lakin) Date: Fri, 5 Aug 2016 14:03:28 -0700 Subject: [erlang-questions] Lager and syslog In-Reply-To: References: Message-ID: <57A4FF20.1090507@gmail.com> On 08/05/2016 11:34 AM, Ehsan Mohammadi wrote: > hi > > i`m trying to use lager_syslog in my project but it seems a driver is > missing rebar.conf: IIRC, rebar3 moved the port compiler out to a rebar3 plugin, rather than packing it in with the core project. From what I've seen, rebar2 projects that relied on it will fail to load their port drivers. Add {overrides, [{override, syslog, [ {plugins, [pc]}, {artifacts, ["priv/syslog_drv.so"]}, {provider_hooks, [ {post, [ {compile, {pc, compile}}, {clean, {pc, clean}} ] }] } ]} ]}. to a rebar.conf in your project, clean, and rebuild. (The syslog project is where lager_syslog's port driver lives.) See also: https://github.com/blt/port_compiler#use-with-existing-dependency -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From Huiqing.Li@REDACTED Fri Aug 5 22:34:25 2016 From: Huiqing.Li@REDACTED (Li, Huiqing) Date: Fri, 5 Aug 2016 20:34:25 +0000 Subject: [erlang-questions] PEPM 2017 SECOND CALL FOR PAPERS Message-ID: <51AD8844B93AD3408D36923062C38477373205EA@UK31S005EXS05.EEAD.EEINT.CO.UK> Apologies if you receive multiple copies of this message. SECOND CALL FOR PAPERS Workshop on PARTIAL EVALUATION AND PROGRAM MANIPULATION (PEPM 2017) NEWS: Keynote talk by Neil Jones, DIKU (see below). http://conf.researchr.org/home/PEPM-2017 Paris, France, January 16th - 17th, 2017 (co-located with POPL 2017) PEPM is the premier forum for discussion of semantics-based program manipulation. The first ACM SIGPLAN PEPM symposium took place in 1991, and meetings have been held in affiliation with POPL every year since 2006. PEPM 2017 will be based on a broad interpretation of semantics-based program manipulation, reflecting the expanded scope of PEPM in recent years beyond the traditionally covered areas of partial evaluation and specialization. Specifically, PEPM 2017 will include practical applications of program transformations such as refactoring tools, and practical implementation techniques such as rule-based transformation systems. In addition, the scope of PEPM covers manipulation and transformations of program and system representations such as structural and semantic models that occur in the context of model-driven development. In order to maintain the dynamic and interactive nature of PEPM and to encourage participation by practitioners, we also solicit submissions of short papers, including tool demonstrations, and of posters. Scope ----- Topics of interest for PEPM 2017 include, but are not limited to: * Program and model manipulation techniques such as: supercompilation, partial evaluation, fusion, on-the-fly program adaptation, active libraries, program inversion, slicing, symbolic execution, refactoring, decompilation, and obfuscation. * Program analysis techniques that are used to drive program/model manipulation such as: abstract interpretation, termination checking, binding-time analysis, constraint solving, type systems, automated testing and test case generation. * Techniques that treat programs/models as data objects including metaprogramming, generative programming, embedded domain-specific languages, program synthesis by sketching and inductive programming, staged computation, and model-driven program generation and transformation. * Application of the above techniques including case studies of program manipulation in real-world (industrial, open-source) projects and software development processes, descriptions of robust tools capable of effectively handling realistic applications, benchmarking. Examples of application domains include legacy program understanding and transformation, DSL implementations, visual languages and end-user programming, scientific computing, middleware frameworks and infrastructure needed for distributed and web-based applications, embedded and resource-limited computation, and security. This list of categories is not exhaustive, and we encourage submissions describing applications of semantics-based program manipulation techniques in new domains. If you have a question as to whether a potential submission is within the scope of the workshop, please contact the programme chairs. Submission categories and guidelines ------------------------------------ Three kinds of submissions will be accepted: Regular Research Papers, Short Papers and Posters. * Regular Research Papers should describe new results, and will be judged on originality, correctness, significance and clarity. Regular research papers must not exceed 12 pages in ACM Proceedings style (including appendix). * Short Papers may include tool demonstrations and presentations of exciting if not fully polished research, and of interesting academic, industrial and open-source applications that are new or unfamiliar. Short papers must not exceed 6 pages in ACM Proceedings style (including appendix). * Posters should describe work relevant to the PEPM community, and must not exceed 2 pages in ACM Proceedings style. We invite poster submissions that present early work not yet ready for submission to a conference or journal, identify new research problems, showcase tools and technologies developed by the author(s), or describe student research projects. At least one author of each accepted contribution must attend the workshop and present the work. In the case of tool demonstration papers, a live demonstration of the described tool is expected. Suggested topics, evaluation criteria, and writing guidelines for both research tool demonstration papers will be made available on the PEPM 2017 web site. Student participants with accepted papers can apply for a SIGPLAN PAC grant to help cover travel expenses and other support. PAC also offers other support, such as for child-care expenses during the meeting or for travel costs for companions of SIGPLAN members with physical disabilities, as well as for travel from locations outside of North America and Europe. For details on the PAC programme, see its web page. Publication and special issue ----------------------------- All accepted papers, short papers and posters included, will appear in formal proceedings published by ACM Press. Accepted papers will be included in the ACM Digital Library. Authors of selected papers from PEPM 2016 and PEPM 2017 will also be invited to expand their papers for publication in a special issue of the journal Computer Languages, Systems and Structures (COMLAN, Elsevier). Keynote ------- Neil Jones (DIKU) will give the PEPM keynote talk, titled Compiling Untyped Lambda Calculus to Lower-level Code by Game Semantics and Partial Evaluation Best paper award ---------------- PEPM 2017 continues the tradition of a Best Paper award. The winner will be announced at the workshop. Submission ---------- Papers should be submitted electronically via HotCRP. https://pepm17.hotcrp.com/ Authors using LaTeX to prepare their submissions should use the new improved SIGPLAN proceedings style, and specifically the sigplanconf.cls 9pt template. Important Dates --------------- For Regular Research Papers and Short Papers: * Abstract submission : Tuesday 13th September 2016 * Paper submission : Friday 16th September 2016 * Author notification : Monday 24th October 2016 * Camera ready : Monday 28th November 2016 For Posters: * Poster submission : Sunday 30th October 2016 * Author notification : Friday 10th November 2016 * Camera ready : Monday 28th November 2016 PEPM workshop: * Workshop : Monday 16th - Tuesday 17th January 2017 The proceedings will be published 2 weeks pre-conference. AUTHORS TAKE NOTE: The official publication date is the date the proceedings are made available in the ACM Digital Library. This date may be up to two weeks prior to the first day of your conference. The official publication date affects the deadline for any patent filings related to published work. (For those rare conferences whose proceedings are published in the ACM Digital Library after the conference is over, the official publication date remains the first day of the conference.). PEPM'17 Programme Committee --------------------------- Elvira Albert (Complutense University of Madrid, Spain) Don Batory (University of Texas at Austin, USA) Martin Berger (University of Sussex, UK) Sebastian Erdweg (TU Delft, Netherlands) Andrew Farmer (Facebook, USA) Matthew Flatt (University of Utah, USA) John Gallagher (Roskilde University, Denmark) Robert Gl??ck (DIKU, Denmark) Jurriaan Hage (Utrecht University, Netherlands) Zhenjiang Hu (National Institute of Informatics, Japan) Yukiyoshi Kameyama (University of Tsukuba, Japan) Ilya Klyuchnikov (Facebook, UK) Huiqing Li (EE, UK) Annie Liu (Stony Brook University, USA) Markus P??schel (ETH Zurich, Switzerland) Ryosuke SATO (University of Tokyo, Japan) Sven-Bodo Scholz (Heriot-Watt University, UK) Ulrik Schultz (co-chair) (University of Southern Denmark) Ilya Sergey (University College London, UK) Chung-chieh Shan (Indiana University, USA) Tijs van der Storm (Centrum Wiskunde & Informatica, Netherlands) Jeremy Yallop (co-chair) (University of Cambridge, UK) NOTICE AND DISCLAIMER This email contains BT information, which may be privileged or confidential. It's meant only for the individual(s) or entity named above. If you're not the intended recipient, note that disclosing, copying, distributing or using this information is prohibited. If you've received this email in error, please let me know immediately on the email address above. Thank you. We monitor our email system, and may record your emails. EE Limited Registered office:Trident Place, Mosquito Way, Hatfield, Hertfordshire, AL10 9BW Registered in England no: 02382161 EE Limited is a wholly owned subsidiary of: British Telecommunications plc Registered office: 81 Newgate Street London EC1A 7AJ Registered in England no: 1800000 -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.goertzen@REDACTED Sat Aug 6 04:16:56 2016 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Sat, 06 Aug 2016 02:16:56 +0000 Subject: [erlang-questions] enif_keep_resource, enif_release_resource and thread safety In-Reply-To: References: Message-ID: Those functions have their own synchronization so no need to add your own. The usage case you describe sound fine. On Thu, Aug 4, 2016, 03:41 Vincent Siliakus wrote: > Hi, > > Does anyone know if synchronization is needed when one calls > enif_keep_resource in nif functions and enif_release_resource in a nif > background thread? Or in other words: is the ref counting that is used > under the hood thread safe? > > I ask this because during some refactoring of code in the LMDB driver I'm > developing at https://github.com/zambal/elmdb I stumbled upon a problem > that might have been caused by unsynchronized calls to these functions. > However, when I searched github for other code that uses resources , I > couldn't find examples that use synchronization, but that might be because > it's simply not needed in those libraries, so I'm still not sure. > > Thanks, > Vincent > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Mon Aug 8 13:35:53 2016 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 8 Aug 2016 13:35:53 +0200 Subject: [erlang-questions] Different SSL behaviours, how to pick ciphers? In-Reply-To: <77B4262B-22F1-4AB1-9B28-A6BF2AF07064@cabine.org> References: <77B4262B-22F1-4AB1-9B28-A6BF2AF07064@cabine.org> Message-ID: <82d3507b-87d5-4513-a6e8-664233c410be@ericsson.com> Greetings, When I read the thread about the cipher problem you seemed happy with the solution to specify {versions, ['tlsv1.2']} I wonder if you could tell me where to set this? To automate a file copy (scp) from one machine to another (different users, etc) I have an escript that starts ssh application, and then does {ok, Connection} = ssh:connect( Hostname, 22, [{user, "x"}, {password, "y"}, {silently_accept_hosts, true}, {connect_timeout, Timeout}], Timeout ), This fails with {error, "Unable to connect using the available authentication methods"} It is not possible to add {versions, ['tlsv1.2']} as an option to ssh:connect/4 bengt From eric.pailleau@REDACTED Mon Aug 8 14:09:02 2016 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Mon, 08 Aug 2016 14:09:02 +0200 Subject: [erlang-questions] Different SSL behaviours, how to pick ciphers? In-Reply-To: <82d3507b-87d5-4513-a6e8-664233c410be@ericsson.com> References: <77B4262B-22F1-4AB1-9B28-A6BF2AF07064@cabine.org> <82d3507b-87d5-4513-a6e8-664233c410be@ericsson.com> Message-ID: Hi, Error you got look to me more another issue. Looks like your server don't accept login/password authentication but allow only with public-key. But I maybe wrong. "Envoy? depuis mon mobile " Eric ---- Bengt Kleberg a ?crit ---- >Greetings, > >When I read the thread about the cipher problem you seemed happy with >the solution to specify > >{versions, ['tlsv1.2']} > >I wonder if you could tell me where to set this? > > >To automate a file copy (scp) from one machine to another (different users, etc) I have an escript that starts ssh application, and then does > {ok, Connection} = ssh:connect( Hostname, 22, [{user, "x"}, {password, "y"}, {silently_accept_hosts, true}, {connect_timeout, Timeout}], Timeout ), >This fails with >{error, "Unable to connect using the available authentication methods"} > >It is not possible to add >{versions, ['tlsv1.2']} >as an option to ssh:connect/4 > > >bengt > >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From zambal@REDACTED Mon Aug 8 15:13:09 2016 From: zambal@REDACTED (Vincent Siliakus) Date: Mon, 8 Aug 2016 15:13:09 +0200 Subject: [erlang-questions] enif_keep_resource, enif_release_resource and thread safety In-Reply-To: References: Message-ID: Thanks for the confirmation! In that case I think the issue I encountered was that a resource was released before a keep call and thereby unexpectedly deleted, but I'll investigate to be sure what was happening. -vincent On Sat, Aug 6, 2016 at 4:16 AM, Daniel Goertzen wrote: > Those functions have their own synchronization so no need to add your own. > The usage case you describe sound fine. > > On Thu, Aug 4, 2016, 03:41 Vincent Siliakus wrote: > >> Hi, >> >> Does anyone know if synchronization is needed when one calls >> enif_keep_resource in nif functions and enif_release_resource in a nif >> background thread? Or in other words: is the ref counting that is used >> under the hood thread safe? >> >> I ask this because during some refactoring of code in the LMDB driver I'm >> developing at https://github.com/zambal/elmdb I stumbled upon a problem >> that might have been caused by unsynchronized calls to these functions. >> However, when I searched github for other code that uses resources , I >> couldn't find examples that use synchronization, but that might be because >> it's simply not needed in those libraries, so I'm still not sure. >> >> Thanks, >> Vincent >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Mon Aug 8 17:40:20 2016 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 8 Aug 2016 17:40:20 +0200 Subject: [erlang-questions] Different SSL behaviours, how to pick ciphers? In-Reply-To: <82d3507b-87d5-4513-a6e8-664233c410be@ericsson.com> References: <77B4262B-22F1-4AB1-9B28-A6BF2AF07064@cabine.org> <82d3507b-87d5-4513-a6e8-664233c410be@ericsson.com> Message-ID: Hi! 2016-08-08 13:35 GMT+02:00 Bengt Kleberg : > Greetings, > > When I read the thread about the cipher problem you seemed happy with the > solution to specify > > {versions, ['tlsv1.2']} > > I wonder if you could tell me where to set this? > > > To automate a file copy (scp) from one machine to another (different > users, etc) I have an escript that starts ssh application, and then does > {ok, Connection} = ssh:connect( Hostname, 22, [{user, "x"}, > {password, "y"}, {silently_accept_hosts, true}, {connect_timeout, > Timeout}], Timeout ), > This fails with > {error, "Unable to connect using the available authentication methods"} > > It is not possible to add > {versions, ['tlsv1.2']} > as an option to ssh:connect/4 > That is an ssl option, not an ssh option. ssl and ssh are different protocols! Regards Ingela Erlang/OTP Team - Ericsson AB > bengt > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Mon Aug 8 17:42:19 2016 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 8 Aug 2016 17:42:19 +0200 Subject: [erlang-questions] Different SSL behaviours, how to pick ciphers? In-Reply-To: <8E730584-E028-4AD3-942F-B38846F3F555@cabine.org> References: <77B4262B-22F1-4AB1-9B28-A6BF2AF07064@cabine.org> <20160713134134.GA51637@fhebert-ltm2.internal.salesforce.com> <8E730584-E028-4AD3-942F-B38846F3F555@cabine.org> Message-ID: Hi! 2016-07-13 17:27 GMT+02:00 Andr? Cruz : > Hello Fred. > > > On 13 Jul 2016, at 14:41, Fred Hebert wrote: > > > > On 07/12, Andr? Cruz wrote: > >> As can be seen I cannot establish a connection using the container > version of Erlang. Looking at the traffic I can see that the ClientHello > message specifies SSLv3 ciphers, while the version that works uses TLS1.2. > How can I influence this choice of ciphers? Is it a problem with the > openssl lib in the container image? > >> > > > > You should at the very least have some basic configuration of SSL in > Erlang -- the one that ships stock isn't particularly great. > > I've found the difference in the default SSL configuration between 18.3.1 > and 18.3.2. > > 18.3.1 uses TLS1.2 records: > > TLSv1.2 Record Layer: Handshake Protocol: Client Hello > Content Type: Handshake (22) > Version: TLS 1.0 (0x0301) > Length: 279 > > > 18.3.2 uses SSL records: > > SSL Record Layer: Handshake Protocol: Client Hello > Content Type: Handshake (22) > Version: TLS 1.0 (0x0301) > Length: 249 > > It's strange to change this default in a minor version upgrade. Is this > something that can be configured? I've found that some SSL servers drop the > connection immediately when SSL records are used. > > Huum ... I think this was suppose to be a bug fix, maybe I got it wrong I will investigate. Regards Ingela Erlang/OTP team - Ericsson AB > Thanks, > Andr? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker.eriksson@REDACTED Mon Aug 8 17:48:37 2016 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Mon, 8 Aug 2016 17:48:37 +0200 Subject: [erlang-questions] enif_keep_resource, enif_release_resource and thread safety In-Reply-To: References: Message-ID: <57A8A9D5.8040200@ericsson.com> Tip: Run on debug VM that adds a lot of runtime assertion for earlier bug detection and nicer core dump to inspect. For this case it will add an extra ref counter to every resource to detect unbalanced calls to enif_release_resource() that may otherwise go unnoticed and instead cause the GC to crash later. $> (cd $ERL_TOP/erts/emulator && make TYPE=debug smp) $> $ERL_TOP/bin/cerl -debug /Sverker, Erlang/OTP On 08/08/2016 03:13 PM, Vincent Siliakus wrote: > Thanks for the confirmation! In that case I think the issue I encountered > was that a resource was released before a keep call and thereby > unexpectedly deleted, but I'll investigate to be sure what was happening. > > -vincent > > On Sat, Aug 6, 2016 at 4:16 AM, Daniel Goertzen > wrote: > >> Those functions have their own synchronization so no need to add your own. >> The usage case you describe sound fine. >> >> On Thu, Aug 4, 2016, 03:41 Vincent Siliakus wrote: >> >>> Hi, >>> >>> Does anyone know if synchronization is needed when one calls >>> enif_keep_resource in nif functions and enif_release_resource in a nif >>> background thread? Or in other words: is the ref counting that is used >>> under the hood thread safe? >>> >>> I ask this because during some refactoring of code in the LMDB driver I'm >>> developing at https://github.com/zambal/elmdb I stumbled upon a problem >>> that might have been caused by unsynchronized calls to these functions. >>> However, when I searched github for other code that uses resources , I >>> couldn't find examples that use synchronization, but that might be because >>> it's simply not needed in those libraries, so I'm still not sure. >>> >>> Thanks, >>> Vincent >>> _______________________________________________ >>> 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 vasdeveloper@REDACTED Tue Aug 9 05:44:00 2016 From: vasdeveloper@REDACTED (Theepan) Date: Tue, 9 Aug 2016 09:14:00 +0530 Subject: [erlang-questions] Cowboy Urlencode Message-ID: Hi Cowboy Team, How safe is to use cow_qs:urlencode ? Regards, Theepan -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Tue Aug 9 08:41:03 2016 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Tue, 9 Aug 2016 08:41:03 +0200 Subject: [erlang-questions] Cowboy Urlencode In-Reply-To: References: Message-ID: <63d2f0ed-42a2-e5d2-6336-d819c602ea5e@ninenines.eu> What do you mean by "safe"? If you're wondering if it works, it does AFAIK, but it's the application/x-www-form-urlencoded variant of url encoding, so might not fit your use case. Use it only for query strings. On 08/09/2016 05:44 AM, Theepan wrote: > Hi Cowboy Team, > > How safe is to use cow_qs:urlencode ? > > Regards, > Theepan > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From lukas@REDACTED Tue Aug 9 12:25:38 2016 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 9 Aug 2016 12:25:38 +0200 Subject: [erlang-questions] Patch package OTP 19.0.3 released Message-ID: Patch Package: OTP 19.0.3 Git Tag: OTP-19.0.3 Date: 2016-08-09 Trouble Report Id: OTP-13688, OTP-13741, OTP-13753 Seq num: seq13149, seq13150 System: OTP Release: 19 Application: inets-6.3.2, kernel-5.0.1, ssl-8.0.1 Predecessor: OTP 19.0.2 Check out the git tag OTP-19.0.3, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- inets-6.3.2 ----------------------------------------------------- --------------------------------------------------------------------- The inets-6.3.2 application can be applied independently of other applications on a full OTP 19 installation. --- Improvements and New Features --- OTP-13688 Application(s): inets Related Id(s): seq13149 PUT and DELETE support has been added to mod_esi Full runtime dependencies of inets-6.3.2: erts-6.0, kernel-3.0, mnesia-4.12, runtime_tools-1.8.14, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --- kernel-5.0.1 ---------------------------------------------------- --------------------------------------------------------------------- The kernel-5.0.1 application can be applied independently of other applications on a full OTP 19 installation. --- Fixed Bugs and Malfunctions --- OTP-13741 Application(s): kernel Fix a os:cmd bug where creating a background job using & would cause os:cmd to hang until the background job terminated or closed its stdout and stderr file descriptors. This bug has existed from kernel 5.0. Full runtime dependencies of kernel-5.0.1: erts-8.0, sasl-3.0, stdlib-3.0 --------------------------------------------------------------------- --- ssl-8.0.1 ------------------------------------------------------- --------------------------------------------------------------------- The ssl-8.0.1 application can be applied independently of other applications on a full OTP 19 installation. --- Fixed Bugs and Malfunctions --- OTP-13753 Application(s): ssl Related Id(s): seq13150 The TLS/SSL protocol version selection for the SSL server has been corrected to follow RFC 5246 Appendix E.1 especially in case where the list of supported versions has gaps. Now the server selects the highest protocol version it supports that is not higher than what the client supports. Full runtime dependencies of ssl-8.0.1: crypto-3.3, erts-7.0, inets-5.10.7, kernel-3.0, public_key-1.2, stdlib-3.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From arshadansari27@REDACTED Tue Aug 9 14:24:20 2016 From: arshadansari27@REDACTED (Arshad Ansari) Date: Tue, 09 Aug 2016 12:24:20 +0000 Subject: [erlang-questions] Relay is adding Route-Record of client instead of self Message-ID: Hello there, I have found that when relay forwards the request to the server that it receives from the client, it adds Route-Record with value of client's Origin-Host. However, RFC 3588 says that the route-record must be relay's own Origin-Host value that is shared with Server during CER. Can anyone shed light as to why the default behavior of Erlang-Diameter module is not in sync with the RFC? Also, how can I modify the said AVP in prepare_request method of relay_callback module? May be I'm misreading the specs, however; I would really appreciate if someone can clarify it a bit for me. Regards, Arshad Ansari -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Tue Aug 9 14:27:23 2016 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 9 Aug 2016 14:27:23 +0200 Subject: [erlang-questions] Different SSL behaviours, how to pick ciphers? In-Reply-To: References: <77B4262B-22F1-4AB1-9B28-A6BF2AF07064@cabine.org> <20160713134134.GA51637@fhebert-ltm2.internal.salesforce.com> <8E730584-E028-4AD3-942F-B38846F3F555@cabine.org> Message-ID: Hi! I investigated it and as it turns out it is not a bug. RFC 5246 says, 7.4.1.4.1 Signature Algorithms[...] Note: this extension is not meaningful for TLS versions prior to 1.2. Clients MUST NOT offer it if they are offering prior versions. However the initial client hello will now be sent with the TLS record protocol with lowest version supported, which it failed to do before and that is why it happened to work before. Extensions are sent for the wanted version and should be ignored if a lower version is negotiated with exception of signature algorithms, due to the sentence above. Regards Ingela Erlang/OTP Team - Ericsson AB 2016-08-08 17:42 GMT+02:00 Ingela Andin : > Hi! > > > 2016-07-13 17:27 GMT+02:00 Andr? Cruz : > >> Hello Fred. >> >> > On 13 Jul 2016, at 14:41, Fred Hebert wrote: >> > >> > On 07/12, Andr? Cruz wrote: >> >> As can be seen I cannot establish a connection using the container >> version of Erlang. Looking at the traffic I can see that the ClientHello >> message specifies SSLv3 ciphers, while the version that works uses TLS1.2. >> How can I influence this choice of ciphers? Is it a problem with the >> openssl lib in the container image? >> >> >> > >> > You should at the very least have some basic configuration of SSL in >> Erlang -- the one that ships stock isn't particularly great. >> >> I've found the difference in the default SSL configuration between 18.3.1 >> and 18.3.2. >> >> 18.3.1 uses TLS1.2 records: >> >> TLSv1.2 Record Layer: Handshake Protocol: Client Hello >> Content Type: Handshake (22) >> Version: TLS 1.0 (0x0301) >> Length: 279 >> >> >> 18.3.2 uses SSL records: >> >> SSL Record Layer: Handshake Protocol: Client Hello >> Content Type: Handshake (22) >> Version: TLS 1.0 (0x0301) >> Length: 249 >> >> It's strange to change this default in a minor version upgrade. Is this >> something that can be configured? I've found that some SSL servers drop the >> connection immediately when SSL records are used. >> >> > Huum ... I think this was suppose to be a bug fix, maybe I got it wrong I > will investigate. > > Regards Ingela Erlang/OTP team - Ericsson AB > > > >> Thanks, >> Andr? >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Wed Aug 10 03:29:13 2016 From: mjtruog@REDACTED (Michael Truog) Date: Tue, 09 Aug 2016 18:29:13 -0700 Subject: [erlang-questions] os:perf_counter/1 is slow Message-ID: <57AA8369.7070103@gmail.com> Hi, When I test the speed of os:perf_counter/1 as a potential source of pseudo-randomness from the microseconds result, the speed is slower than os:timestamp/0, erlang:monotonic_time/0 and erlang:system_time/1 which I found surprising, since the documentation claims os:perf_counter/1 should be fast (http://erlang.org/doc/man/os.html#perf_counter-1). Should this be explained as a hardware problem due to lower-level instruction usage that is hardware dependent, or is this still being improved (it is new in 19.0)? The results from https://github.com/okeuday/erlbench when I do "make" is: N == 10000 (10 runs) 18_bxor_abs get: 2507.1 us ( 1.2) 18_erlang:system_tim get: 2095.7 us ( 1.0) 18_monotonic get: 2186.1 us ( 1.0) 18_rand_exs1024 get: 13539.0 us ( 6.5) 18_rand_exs64 get: 11205.1 us ( 5.3) 18_rand_exsplus get: 6171.4 us ( 2.9) 19_os:perf_counter/1 get: 5214.4 us ( 2.5) crypto:rand_uniform/ get: 88909.9 us ( 42.4) os:timestamp/0 get: 2214.8 us ( 1.1) random:uniform/1 get: 6058.7 us ( 2.9) random_wh06_int:unif get: 14252.9 us ( 6.8) random_wh82:uniform/ get: 6049.0 us ( 2.9) random_wh82_int:unif get: 6595.8 us ( 3.1) The machine is: Core i7 2670QM 2.2GHz 1 cpu, 4 cores/cpu, 2 hts/core L2:4?256KB L3:6MB RAM:8GB:DDR3-1333MHz Sandy Bridge-HE-4 (Socket G2) Thanks, Michael From garazdawi@REDACTED Wed Aug 10 11:33:28 2016 From: garazdawi@REDACTED (Lukas Larsson) Date: Wed, 10 Aug 2016 11:33:28 +0200 Subject: [erlang-questions] os:perf_counter/1 is slow In-Reply-To: <57AA8369.7070103@gmail.com> References: <57AA8369.7070103@gmail.com> Message-ID: The conversion to micro seconds has not been optimized as much for os:perf_counter/1 as it has for the other functions which is why there is such a large difference. If I use os:perf_counter() instead I get about 1.3-1.4. The remaining 30%-40% comes from the fact that bignums are returned by os:perf_counter() and not smalls. I did a quick hack to see what the result would be if os:perf_counter/1 used the same optimization as monotonic/system_time and then the time is about the same for all four time measurement variants. On modern hw running modern OS's the gain of os:perf_counter over erlang:system_time will not be all that great. On Wed, Aug 10, 2016 at 3:29 AM, Michael Truog wrote: > Hi, > > When I test the speed of os:perf_counter/1 as a potential source of > pseudo-randomness from the microseconds result, the speed is slower than > os:timestamp/0, erlang:monotonic_time/0 and erlang:system_time/1 which I > found surprising, since the documentation claims os:perf_counter/1 should > be fast (http://erlang.org/doc/man/os.html#perf_counter-1). Should this > be explained as a hardware problem due to lower-level instruction usage > that is hardware dependent, or is this still being improved (it is new in > 19.0)? > > The results from https://github.com/okeuday/erlbench when I do "make" is: > N == 10000 (10 runs) > 18_bxor_abs get: 2507.1 us ( 1.2) > 18_erlang:system_tim get: 2095.7 us ( 1.0) > 18_monotonic get: 2186.1 us ( 1.0) > 18_rand_exs1024 get: 13539.0 us ( 6.5) > 18_rand_exs64 get: 11205.1 us ( 5.3) > 18_rand_exsplus get: 6171.4 us ( 2.9) > 19_os:perf_counter/1 get: 5214.4 us ( 2.5) > crypto:rand_uniform/ get: 88909.9 us ( 42.4) > os:timestamp/0 get: 2214.8 us ( 1.1) > random:uniform/1 get: 6058.7 us ( 2.9) > random_wh06_int:unif get: 14252.9 us ( 6.8) > random_wh82:uniform/ get: 6049.0 us ( 2.9) > random_wh82_int:unif get: 6595.8 us ( 3.1) > > The machine is: > Core i7 2670QM 2.2GHz 1 cpu, 4 cores/cpu, 2 hts/core > L2:4?256KB L3:6MB RAM:8GB:DDR3-1333MHz > Sandy Bridge-HE-4 (Socket G2) > > Thanks, > Michael > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From arshadansari27@REDACTED Wed Aug 10 20:38:05 2016 From: arshadansari27@REDACTED (Arshad Ansari) Date: Wed, 10 Aug 2016 18:38:05 +0000 Subject: [erlang-questions] Relay is adding Route-Record of client instead of self In-Reply-To: References: Message-ID: I'm sorry about misunderstanding the role of route record avp. I was corrected by my collegue on this regard and I forgot to close this chain/ Thanks for the reply On Wed, Aug 10, 2016 at 3:46 PM Anders Svensson wrote: > Oops, missed my CC to the list. You can reply there if you prefer. /Anders > > > On Wed, Aug 10, 2016 at 12:11 PM, Anders Svensson > wrote: > > Hi Arshad. > > > > Where are you reading this? I see this in both RFC 3588 (6.1.8) and > > RFC6733 (6.1.9): > > > > A relay or proxy agent MUST append a Route-Record AVP to all requests > > forwarded. The AVP contains the identity of the peer from which the > > request was received. > > > > Anders > > > > > > > > On Tue, Aug 9, 2016 at 2:24 PM, Arshad Ansari > wrote: > >> Hello there, > >> > >> I have found that when relay forwards the request to the server that it > >> receives from the client, it adds Route-Record with value of client's > >> Origin-Host. However, RFC 3588 says that the route-record must be > relay's > >> own Origin-Host value that is shared with Server during CER. Can anyone > shed > >> light as to why the default behavior of Erlang-Diameter module is not in > >> sync with the RFC? Also, how can I modify the said AVP in > prepare_request > >> method of relay_callback module? > >> > >> May be I'm misreading the specs, however; I would really appreciate if > >> someone can clarify it a bit for me. > >> > >> Regards, > >> Arshad Ansari > >> > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ehsan.tck@REDACTED Thu Aug 11 21:43:22 2016 From: ehsan.tck@REDACTED (Ehsan Mohammadi) Date: Thu, 11 Aug 2016 19:43:22 +0000 Subject: [erlang-questions] Diameter Relay Agent Message-ID: hi i`m working on a diameter relay agent app i need to access User-Name AVP to find destination peer base on username. i passed {'Auth-Application-Id', [?DIAMETER_APP_ID_RELAY]} and {dictionary, ?DIAMETER_DICT_RELAY} to start_service and my packet is undefined and can`t access it`s avp(tried on CCR/CCA). i had to use bin property of packet and pass it to diameter:decode. what`s correct solution to overcome this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmcl2303@REDACTED Fri Aug 12 10:16:34 2016 From: rmcl2303@REDACTED (Richard McLean) Date: Fri, 12 Aug 2016 18:16:34 +1000 Subject: [erlang-questions] gen_fsm - calling state function clauses directly (question from Learn You Some Erlang chapter 20) Message-ID: <320BD082-2F51-4B47-93E8-BB7C0C19B274@bigpond.net.au> Hi, I?m just learning erlang/OTP so please excuse me if I ask a newbie question. I?m currently reading "Learn You Some Erlang For Great Good? by Fred H?bert. Regarding Chapter 20 ?The Count of Applications?? The author presents an OTP application that uses gen_fsm to recursively grep through a directory tree using one worker process per file/regex. There are a couple of instances where the code transitions from one state to another (and simulates triggering an event) by calling a state function directly rather than via a {next_state, StateName, StateData} return tuple. For example (page 326) : dispatching(done, Data) -> %% This is a special case. We cannot assume that all messages have NOT %% been received by the time we hit 'done'. As such, we directly move to %% listening/2 without waiting for an external event. listening(done, Data). listening(done, #data{regex=Re, refs=[]}) -> % all received! [io:format("Regex ?s has ?p results?n", [R,C]) || {R, C} <- Re], {stop, normal, done}; listening(done, Data) -> % entries still missing {next_state, listening, Data}. And (page 328) : handle_event({complete, Regex, Ref, Count}, State, Data = #data{regex=Re, refs=Refs}) -> {Regex, OldCount} = lists:keyfind(Regex, 1, Re), NewRe = lists:keyreplace(Regex, 1, Re, {Regex, OldCount+Count}), NewData = Data#data{regex=NewRe, refs=Refs--[Ref]}, case State of dispatching -> {next_state, dispatching, NewData}; listening -> listening(done, NewData) end. *dispatching and listening are the two states implemented in this gen_fsm with state functions of matching name. I?m specifically referring to the "listening(done, Data)? call that is the last (tail) call of the dispatching(done, Data) clause, and the listening(done, NewData) call that is one of the possible last (tail) calls of the handle_event({complete, Regex, Ref, Count}, State, Data = #data{regex=Re, refs=Refs}) clause. I understand that the author is trying to simultaneously change state and execute the correct clause without having to send any events, and that just returning a {next_state, listening, StateData} tuple would only change the state? and to execute a clause in the listening state would then require matching a particular event (ie. ?done?), which would mean having to send a ?done? event, and other events or messages in the queue may need to be processed in the meantime which could leave the FSM in a state other than ?listening? (ie. "dispatching?) which might lead to some oscillating behaviour. My main question is? Is this approach recommended or not ? (and if not are there any other recommended ways to achieve the same thing ?) Does calling state functions directly break any OTP principles or lead to any strange behaviour (eg. the main gen_fsm loop not knowing which state it?s in +/- any corruption of centrally held StateData of the main server loop) ? I couldn?t find anything about direct state function calls after extensive googling. The gen_fsm docs don?t mention anything about it either way - it only mentions state transitions via state function return tuples, and execution of state functions via matching events received while in that state. Could someone who is familiar with Erlang/OTP give some advice ? Regards Richard From rickard@REDACTED Fri Aug 12 14:22:09 2016 From: rickard@REDACTED (Rickard Green) Date: Fri, 12 Aug 2016 14:22:09 +0200 Subject: [erlang-questions] Patch package OTP 19.0.4 released Message-ID: <98129972-4a03-8ba4-1ff6-b8f4fdc6a5d0@erlang.org> Patch Package: OTP 19.0.4 Git Tag: OTP-19.0.4 Date: 2016-08-12 Trouble Report Id: OTP-13798, OTP-13799 Seq num: System: OTP Release: 19 Application: erts-8.0.3 Predecessor: OTP 19.0.3 Check out the git tag OTP-19.0.4, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- erts-8.0.3 ------------------------------------------------------ --------------------------------------------------------------------- The erts-8.0.3 application can be applied independently of other applications on a full OTP 19 installation. --- Fixed Bugs and Malfunctions --- OTP-13798 Application(s): erts Related Id(s): OTP-11997 Fixed a race that could cause a lost wakeup of a process that timed out in a receive ... after. This bug was introduced in ERTS version 7.0. OTP-13799 Application(s): erts Fixed segfault after writing an erl crash dump. Full runtime dependencies of erts-8.0.3: kernel-5.0, sasl-3.0, stdlib-3.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From raimo+erlang-questions@REDACTED Fri Aug 12 14:28:04 2016 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 12 Aug 2016 14:28:04 +0200 Subject: [erlang-questions] gen_fsm - calling state function clauses directly (question from Learn You Some Erlang chapter 20) In-Reply-To: <320BD082-2F51-4B47-93E8-BB7C0C19B274@bigpond.net.au> References: <320BD082-2F51-4B47-93E8-BB7C0C19B274@bigpond.net.au> Message-ID: <20160812122804.GA10534@erix.ericsson.se> On Fri, Aug 12, 2016 at 06:16:34PM +1000, Richard McLean wrote: > Hi, > > I?m just learning erlang/OTP so please excuse me if I ask a newbie question. > > I?m currently reading "Learn You Some Erlang For Great Good? by Fred H?bert. > > Regarding Chapter 20 ?The Count of Applications?? > > The author presents an OTP application that uses gen_fsm to recursively grep through a directory tree using one worker process per file/regex. > > There are a couple of instances where the code transitions from one state to another (and simulates triggering an event) by calling a state function directly rather than via a {next_state, StateName, StateData} return tuple. > > For example (page 326) : > > dispatching(done, Data) -> > %% This is a special case. We cannot assume that all messages have NOT > %% been received by the time we hit 'done'. As such, we directly move to > %% listening/2 without waiting for an external event. > listening(done, Data). > > listening(done, #data{regex=Re, refs=[]}) -> % all received! > [io:format("Regex ?s has ?p results?n", [R,C]) || {R, C} <- Re], > {stop, normal, done}; > listening(done, Data) -> % entries still missing > {next_state, listening, Data}. > > And (page 328) : > > handle_event({complete, Regex, Ref, Count}, State, > Data = #data{regex=Re, refs=Refs}) -> > {Regex, OldCount} = lists:keyfind(Regex, 1, Re), > NewRe = lists:keyreplace(Regex, 1, Re, {Regex, OldCount+Count}), > NewData = Data#data{regex=NewRe, refs=Refs--[Ref]}, > case State of > dispatching -> > {next_state, dispatching, NewData}; > listening -> > listening(done, NewData) > end. > > *dispatching and listening are the two states implemented in this gen_fsm with state functions of matching name. > > I?m specifically referring to the "listening(done, Data)? call that is the last (tail) call of the dispatching(done, Data) clause, and the listening(done, NewData) call that is one of the possible last (tail) calls of the handle_event({complete, Regex, Ref, Count}, State, Data = #data{regex=Re, refs=Refs}) clause. > > I understand that the author is trying to simultaneously change state and execute the correct clause without having to send any events, and that just returning a {next_state, listening, StateData} tuple would only change the state? and to execute a clause in the listening state would then require matching a particular event (ie. ?done?), which would mean having to send a ?done? event, and other events or messages in the queue may need to be processed in the meantime which could leave the FSM in a state other than ?listening? (ie. "dispatching?) which might lead to some oscillating behaviour. > > My main question is? > > Is this approach recommended or not ? > (and if not are there any other recommended ways to achieve the same thing ?) There is no other way to do it in gen_fsm, except possibly for to reorganize your code so both states dispatching and listening share some code that is not a state function. This is essentially a case of code reuse where you reuse a state function from another as if it was a helper function. No immediate harm in that. > > Does calling state functions directly break any OTP principles or lead to any strange behaviour (eg. the main gen_fsm loop not knowing which state it?s in +/- any corruption of centrally held StateData of the main server loop) ? Well, the gen_fsm engine still thinks you are in state dispatching, but since the code either returns {stop,,} or {next_state,,} this is of little importance. It will look as if you stopped from the dispatching state, while you returned {stop,,} from the listening function, which probably is of little importance. But there is no centrally held state data apart from the state name that will be corrupted. The StateData is in the callback module's possesion at the time so it will not be held by the gen_fsm engine until you return it. > > I couldn?t find anything about direct state function calls after extensive googling. > > The gen_fsm docs don?t mention anything about it either way - it only mentions state transitions via state function return tuples, and execution of state functions via matching events received while in that state. Yes. This is a flaw we do not like to talk about. But sufficiently complicated state machines often end up doing this with gen_fsm. > > Could someone who is familiar with Erlang/OTP give some advice ? I just have to push for gen_statem that I created partly due to this problem in gen_fsm. It is a new addition to Erlang/OTP. Some small API changes are anticipated for the next release, but it will not be removed. It will in the future be recommended to use instead of gen_fsm. http://www.erlang.org/doc/man/gen_statem.html http://erlang.org/doc/design_principles/statem.html In gen_statem you can return with an action {next_event,internal,Something} which will truly change states and send an internal event Something to arrive before any queued events. This sounds like exactly what you are missing from gen_fsm. There was a lengthy and somewhat heated discussion while developing gen_statem (in which Fred H?bert participated, by the way): https://github.com/erlang/otp/pull/960 There are small API changes in the pipeline probably for OTP-19.1 discussed in this pull request: https://github.com/erlang/otp/pull/1133 but proposed in this pull request (currently in the lead): https://github.com/erlang/otp/pull/1135 -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From mononcqc@REDACTED Fri Aug 12 14:34:16 2016 From: mononcqc@REDACTED (Fred Hebert) Date: Fri, 12 Aug 2016 08:34:16 -0400 Subject: [erlang-questions] gen_fsm - calling state function clauses directly (question from Learn You Some Erlang chapter 20) In-Reply-To: <320BD082-2F51-4B47-93E8-BB7C0C19B274@bigpond.net.au> References: <320BD082-2F51-4B47-93E8-BB7C0C19B274@bigpond.net.au> Message-ID: <20160812123416.GC18912@fhebert-ltm2.internal.salesforce.com> On 08/12, Richard McLean wrote: >My main question is? > >Is this approach recommended or not ? >(and if not are there any other recommended ways to achieve the same thing ?) > There's no recommendations around that. It is not the best thing in the world from the point of view of tracing and debug functions you may install in an OTP process throuhg the `sys' module, where that intermediary step will be lost. >Does calling state functions directly break any OTP principles or lead >to any strange behaviour (eg. the main gen_fsm loop not knowing which >state it?s in +/- any corruption of centrally held StateData of the >main server loop) ? > There is no negative cost of doing it aside from this in the current case, as long as you can tolerate the out-of-order of messages. In this case, the FSM has been designed to be able to do it. There's also the lack of traceability as mentioned above. If you however use gen_statem (which is newer and I don't know if or when I'll update LYSE for it), you can make use of the `next_event' action to do the same thing; it allows you to specifically inject an event as the next one for instant handling. Say by returning: {next_state, listening, NewData, [{next_event, cast, done}]} Which for gen_statem would let it do its event transition to listening while automatically re-triggering the `done' message sent as an asynchronous event, but right away. This gets rid of the obscurity around debugging functions and whatnot. The bigger problem -- and this is a possibility both in gen_fsm and gen_statem -- happens if you rely on this mechanism for many events and/or transitions in an uninterrupted sequence. The risk is eventually generating a chain of self-triggering events that never stop, and your FSM ends up mostly busy-looping itself for good, never handling external work. Regards, Fred. From rickard@REDACTED Fri Aug 12 14:48:21 2016 From: rickard@REDACTED (Rickard Green) Date: Fri, 12 Aug 2016 14:48:21 +0200 Subject: [erlang-questions] Patch package OTP 18.3.4.4 released Message-ID: Patch Package: OTP 18.3.4.4 Git Tag: OTP-18.3.4.4 Date: 2016-08-12 Trouble Report Id: OTP-13798, OTP-13799 Seq num: System: OTP Release: 18 Application: erts-7.3.1.2 Predecessor: OTP 18.3.4.3 Check out the git tag OTP-18.3.4.4, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- erts-7.3.1.2 ---------------------------------------------------- --------------------------------------------------------------------- The erts-7.3.1.2 application can be applied independently of other applications on a full OTP 18 installation. --- Fixed Bugs and Malfunctions --- OTP-13798 Application(s): erts Related Id(s): OTP-11997 Fixed a race that could cause a lost wakeup of a process that timed out in a receive ... after. This bug was introduced in ERTS version 7.0. OTP-13799 Application(s): erts Fixed segfault after writing an erl crash dump. Full runtime dependencies of erts-7.3.1.2: kernel-4.0, sasl-2.4, stdlib-2.5 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From aeyakovenko@REDACTED Fri Aug 12 20:25:41 2016 From: aeyakovenko@REDACTED (Anatoly Yakovenko) Date: Fri, 12 Aug 2016 18:25:41 +0000 Subject: [erlang-questions] having problems with ssl on ubuntu 16 Message-ID: Hi folks, It's my first time installing erlang, and I am having some issues with it finding ssl. I am on ubuntu 16 i have libssl-dev installed /usr/lib/x86_64-linux-gnu/libssl.so But when I run kerl i see that it can't find any of the libs. It also can't find any of the executables $ javac -version javac 1.8.0_102 $ fop -v FOP Version 2.1 any ideas? kerl command below: $ KERL_CONFIGURE_DISABLE_APPLICATIONS=odbc KERL_CONFIGURE_OPTIONS="--enable-dirty-schedulers --disable-hipe --with-openssl" kerl build 19.0 erlang.19.0.dirty_sched.no_hipe.ssl Verifying archive checksum... Checksum verified (f64eefc697d47193444aa224d971f367) Building Erlang/OTP 19.0 (erlang.19.0.dirty_sched.no_hipe.ssl), please wait... APPLICATIONS DISABLED (See: /home/ayakovenko/.kerl/builds/erlang.19.0.dirty_sched.no_hipe.ssl/otp_build_19.0.log) * crypto : No usable OpenSSL found * jinterface : No Java compiler found * odbc : ODBC library - link check failed * ssh : No usable OpenSSL found * ssl : No usable OpenSSL found APPLICATIONS INFORMATION (See: /home/ayakovenko/.kerl/builds/erlang.19.0.dirty_sched.no_hipe.ssl/otp_build_19.0.log) * wx : wxWidgets not found, wx will NOT be usable DOCUMENTATION INFORMATION (See: /home/ayakovenko/.kerl/builds/erlang.19.0.dirty_sched.no_hipe.ssl/otp_build_19.0.log) * documentation : * xsltproc is missing. * fop is missing. * The documentation can not be built. -------------- next part -------------- An HTML attachment was scrubbed... URL: From emeka_1978@REDACTED Sat Aug 13 04:17:02 2016 From: emeka_1978@REDACTED (emeka_1978) Date: Sat, 13 Aug 2016 05:17:02 +0300 Subject: [erlang-questions] Fw: my favourite book Message-ID: <000049a350c8$b6a21d85$33db308a$@yahoo.com> Dear, Have you already read that new book? It's my favourite, you can find it here emeka_1978 -------------- next part -------------- An HTML attachment was scrubbed... URL: From emeka_1978@REDACTED Sat Aug 13 04:17:18 2016 From: emeka_1978@REDACTED (emeka_1978) Date: Sat, 13 Aug 2016 05:17:18 +0300 Subject: [erlang-questions] that is not a joke! Message-ID: <0000828c290b$5e008f8f$8b93f526$@yahoo.com> Dear, I have recently tried this stuff and it helped me, that's no joke! Read more here emeka_1978 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Sat Aug 13 10:49:38 2016 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Sat, 13 Aug 2016 10:49:38 +0200 Subject: [erlang-questions] having problems with ssl on ubuntu 16 In-Reply-To: References: Message-ID: <2ft9kd1v26jfjtu81orr387m.1471078178871@email.android.com> Hi, You need openssl to be installed. "Envoy? depuis mon mobile " Eric ---- Anatoly Yakovenko a ?crit ---- >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From aeyakovenko@REDACTED Sat Aug 13 17:55:02 2016 From: aeyakovenko@REDACTED (Anatoly Yakovenko) Date: Sat, 13 Aug 2016 15:55:02 +0000 Subject: [erlang-questions] having problems with ssl on ubuntu 16 In-Reply-To: <2ft9kd1v26jfjtu81orr387m.1471078178871@email.android.com> References: <2ft9kd1v26jfjtu81orr387m.1471078178871@email.android.com> Message-ID: The problem was with kerl reusing the old config after I restarted it. https://github.com/kerl/kerl/issues/158 Anatoly On Sat, Aug 13, 2016 at 1:49 AM ?ric Pailleau wrote: > Hi, > You need openssl to be installed. > > "Envoy? depuis mon mobile " Eric > > > ---- Anatoly Yakovenko a ?crit ---- > > Hi folks, > > It's my first time installing erlang, and I am having some issues with it > finding ssl. I am on ubuntu 16 > > i have libssl-dev installed > > /usr/lib/x86_64-linux-gnu/libssl.so > > But when I run kerl i see that it can't find any of the libs. It also > can't find any of the executables > > > $ javac -version > > javac 1.8.0_102 > > > $ fop -v > > FOP Version 2.1 > > any ideas? > > > kerl command below: > > $ KERL_CONFIGURE_DISABLE_APPLICATIONS=odbc > KERL_CONFIGURE_OPTIONS="--enable-dirty-schedulers --disable-hipe > --with-openssl" kerl build 19.0 erlang.19.0.dirty_sched.no_hipe.ssl > > Verifying archive checksum... > > Checksum verified (f64eefc697d47193444aa224d971f367) > > Building Erlang/OTP 19.0 (erlang.19.0.dirty_sched.no_hipe.ssl), please > wait... > > APPLICATIONS DISABLED (See: > /home/ayakovenko/.kerl/builds/erlang.19.0.dirty_sched.no_hipe.ssl/otp_build_19.0.log) > > * crypto : No usable OpenSSL found > > * jinterface : No Java compiler found > > * odbc : ODBC library - link check failed > > * ssh : No usable OpenSSL found > > * ssl : No usable OpenSSL found > > > APPLICATIONS INFORMATION (See: > /home/ayakovenko/.kerl/builds/erlang.19.0.dirty_sched.no_hipe.ssl/otp_build_19.0.log) > > * wx : wxWidgets not found, wx will NOT be usable > > > DOCUMENTATION INFORMATION (See: > /home/ayakovenko/.kerl/builds/erlang.19.0.dirty_sched.no_hipe.ssl/otp_build_19.0.log) > > * documentation : > > * xsltproc is missing. > > * fop is missing. > > * The documentation can not be built. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Mon Aug 15 00:38:21 2016 From: donpedrothird@REDACTED (John Doe) Date: Mon, 15 Aug 2016 01:38:21 +0300 Subject: [erlang-questions] Can't make dirty schedulers work on a certain VPS Message-ID: Hi all, got a very strange problem today on a Debian 7.11, gcc 4.7.2 VPS - all apps with dirty schedulers nifs fail with "{error, {bad_lib, xxx requires a runtime with dirty scheduler support."}}" The erlang is built by KERL_CONFIGURE_OPTIONS="--disable-dynamic-ssl-lib --with-ssl=/usr/ --enable-smp-support --without-termcap --enable-dirty-schedulers --enable-builtin-zlib" ./kerl build git https://github.com/erlang/otp.git OTP-19.0.4 OTP-19.0.4 This is not problem of the apps, all the apps fail with the same error, I tried https://github.com/vinoski/bitwise and a couple of other. There are no problems altogether with the same apps and the same OTP built with the same command on my home box. Anyway, i tried to build erlang with other flags and with no kerl, nothing changed. What could be the reason for that? I can give root ssh to the VPS if anyone interested. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Mon Aug 15 01:08:01 2016 From: vinoski@REDACTED (Steve Vinoski) Date: Sun, 14 Aug 2016 19:08:01 -0400 Subject: [erlang-questions] Can't make dirty schedulers work on a certain VPS In-Reply-To: References: Message-ID: On Sun, Aug 14, 2016 at 6:38 PM, John Doe wrote: > Hi all, > got a very strange problem today on a Debian 7.11, gcc 4.7.2 VPS - all > apps with dirty schedulers nifs fail with "{error, {bad_lib, xxx requires > a runtime with dirty scheduler support."}}" > > The erlang is built by > KERL_CONFIGURE_OPTIONS="--disable-dynamic-ssl-lib --with-ssl=/usr/ > --enable-smp-support --without-termcap --enable-dirty-schedulers > --enable-builtin-zlib" ./kerl build git https://github.com/erlang/otp.git > OTP-19.0.4 OTP-19.0.4 > > This is not problem of the apps, all the apps fail with the same error, I > tried https://github.com/vinoski/bitwise and a couple of other. > > There are no problems altogether with the same apps and the same OTP built > with the same command on my home box. Anyway, i tried to build erlang with > other flags and with no kerl, nothing changed. > > What could be the reason for that? > I think the only way you can get that error message is if the runtime is not actually compiled with dirty schedulers enabled. Are you sure you're picking up the right runtime via your path? When you start an erlang shell, does the status line include something like [smp:8:8] [ds:8:8:10] or is the "ds" part missing? What do you get if you execute the following in the erlang shell? erlang:system_info(dirty_cpu_schedulers). --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Mon Aug 15 01:13:23 2016 From: donpedrothird@REDACTED (John Doe) Date: Mon, 15 Aug 2016 02:13:23 +0300 Subject: [erlang-questions] Can't make dirty schedulers work on a certain VPS In-Reply-To: References: Message-ID: there's neither smp no ds Erlang/OTP 19 [erts-8.0.3] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false] 1> erlang:system_info(dirty_cpu_schedulers). ** exception error: bad argument in function erlang:system_info/1 called as erlang:system_info(dirty_cpu_schedulers) 2016-08-15 2:08 GMT+03:00 Steve Vinoski : > > > On Sun, Aug 14, 2016 at 6:38 PM, John Doe wrote: > >> Hi all, >> got a very strange problem today on a Debian 7.11, gcc 4.7.2 VPS - all >> apps with dirty schedulers nifs fail with "{error, {bad_lib, xxx requires >> a runtime with dirty scheduler support."}}" >> >> The erlang is built by >> KERL_CONFIGURE_OPTIONS="--disable-dynamic-ssl-lib --with-ssl=/usr/ >> --enable-smp-support --without-termcap --enable-dirty-schedulers >> --enable-builtin-zlib" ./kerl build git https://github.com/erlang/otp.git >> OTP-19.0.4 OTP-19.0.4 >> >> This is not problem of the apps, all the apps fail with the same error, I >> tried https://github.com/vinoski/bitwise and a couple of other. >> >> There are no problems altogether with the same apps and the same OTP >> built with the same command on my home box. Anyway, i tried to build erlang >> with other flags and with no kerl, nothing changed. >> >> What could be the reason for that? >> > > I think the only way you can get that error message is if the runtime is > not actually compiled with dirty schedulers enabled. Are you sure you're > picking up the right runtime via your path? When you start an erlang shell, > does the status line include something like > > [smp:8:8] [ds:8:8:10] > > or is the "ds" part missing? What do you get if you execute the following > in the erlang shell? > > erlang:system_info(dirty_cpu_schedulers). > > --steve > -------------- next part -------------- An HTML attachment was scrubbed... URL: From felixgallo@REDACTED Mon Aug 15 01:17:52 2016 From: felixgallo@REDACTED (Felix Gallo) Date: Sun, 14 Aug 2016 16:17:52 -0700 Subject: [erlang-questions] Can't make dirty schedulers work on a certain VPS In-Reply-To: References: Message-ID: If you're running on just one core, then erlang doesn't enable smp or dirty schedulers. Could that be it? On Aug 14, 2016 4:13 PM, "John Doe" wrote: > there's neither smp no ds > Erlang/OTP 19 [erts-8.0.3] [source] [64-bit] [async-threads:10] [hipe] > [kernel-poll:false] > > 1> erlang:system_info(dirty_cpu_schedulers). > ** exception error: bad argument > in function erlang:system_info/1 > called as erlang:system_info(dirty_cpu_schedulers) > > > 2016-08-15 2:08 GMT+03:00 Steve Vinoski : > >> >> >> On Sun, Aug 14, 2016 at 6:38 PM, John Doe >> wrote: >> >>> Hi all, >>> got a very strange problem today on a Debian 7.11, gcc 4.7.2 VPS - all >>> apps with dirty schedulers nifs fail with "{error, {bad_lib, xxx requires >>> a runtime with dirty scheduler support."}}" >>> >>> The erlang is built by >>> KERL_CONFIGURE_OPTIONS="--disable-dynamic-ssl-lib --with-ssl=/usr/ >>> --enable-smp-support --without-termcap --enable-dirty-schedulers >>> --enable-builtin-zlib" ./kerl build git https://github.com/erlang/otp. >>> git OTP-19.0.4 OTP-19.0.4 >>> >>> This is not problem of the apps, all the apps fail with the same error, >>> I tried https://github.com/vinoski/bitwise and a couple of other. >>> >>> There are no problems altogether with the same apps and the same OTP >>> built with the same command on my home box. Anyway, i tried to build erlang >>> with other flags and with no kerl, nothing changed. >>> >>> What could be the reason for that? >>> >> >> I think the only way you can get that error message is if the runtime is >> not actually compiled with dirty schedulers enabled. Are you sure you're >> picking up the right runtime via your path? When you start an erlang shell, >> does the status line include something like >> >> [smp:8:8] [ds:8:8:10] >> >> or is the "ds" part missing? What do you get if you execute the following >> in the erlang shell? >> >> erlang:system_info(dirty_cpu_schedulers). >> >> --steve >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Mon Aug 15 01:20:02 2016 From: donpedrothird@REDACTED (John Doe) Date: Mon, 15 Aug 2016 02:20:02 +0300 Subject: [erlang-questions] Can't make dirty schedulers work on a certain VPS In-Reply-To: References: Message-ID: Also 1> erlang:system_info(cpu_topology). [{processor,{logical,0}}] 2> erlang:system_info(logical_processors). 1 3> erlang:system_info(smp_support). false Looks like the build has no smp support at all, thought it was configured with --enable-smp-support uname -a Linux debian-512mb-ams2-01 3.2.0-4-amd64 #1 SMP Debian 3.2.81-1 x86_64 GNU/Linux 2016-08-15 2:08 GMT+03:00 Steve Vinoski : > > > On Sun, Aug 14, 2016 at 6:38 PM, John Doe wrote: > >> Hi all, >> got a very strange problem today on a Debian 7.11, gcc 4.7.2 VPS - all >> apps with dirty schedulers nifs fail with "{error, {bad_lib, xxx requires >> a runtime with dirty scheduler support."}}" >> >> The erlang is built by >> KERL_CONFIGURE_OPTIONS="--disable-dynamic-ssl-lib --with-ssl=/usr/ >> --enable-smp-support --without-termcap --enable-dirty-schedulers >> --enable-builtin-zlib" ./kerl build git https://github.com/erlang/otp.git >> OTP-19.0.4 OTP-19.0.4 >> >> This is not problem of the apps, all the apps fail with the same error, I >> tried https://github.com/vinoski/bitwise and a couple of other. >> >> There are no problems altogether with the same apps and the same OTP >> built with the same command on my home box. Anyway, i tried to build erlang >> with other flags and with no kerl, nothing changed. >> >> What could be the reason for that? >> > > I think the only way you can get that error message is if the runtime is > not actually compiled with dirty schedulers enabled. Are you sure you're > picking up the right runtime via your path? When you start an erlang shell, > does the status line include something like > > [smp:8:8] [ds:8:8:10] > > or is the "ds" part missing? What do you get if you execute the following > in the erlang shell? > > erlang:system_info(dirty_cpu_schedulers). > > --steve > -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Mon Aug 15 01:21:45 2016 From: donpedrothird@REDACTED (John Doe) Date: Mon, 15 Aug 2016 02:21:45 +0300 Subject: [erlang-questions] Can't make dirty schedulers work on a certain VPS In-Reply-To: References: Message-ID: Yes, likely this is the case. is it possible to enable smp on one core? The kernel is configured with smp. 2016-08-15 2:17 GMT+03:00 Felix Gallo : > If you're running on just one core, then erlang doesn't enable smp or > dirty schedulers. Could that be it? > > On Aug 14, 2016 4:13 PM, "John Doe" wrote: > >> there's neither smp no ds >> Erlang/OTP 19 [erts-8.0.3] [source] [64-bit] [async-threads:10] [hipe] >> [kernel-poll:false] >> >> 1> erlang:system_info(dirty_cpu_schedulers). >> ** exception error: bad argument >> in function erlang:system_info/1 >> called as erlang:system_info(dirty_cpu_schedulers) >> >> >> 2016-08-15 2:08 GMT+03:00 Steve Vinoski : >> >>> >>> >>> On Sun, Aug 14, 2016 at 6:38 PM, John Doe >>> wrote: >>> >>>> Hi all, >>>> got a very strange problem today on a Debian 7.11, gcc 4.7.2 VPS - >>>> all apps with dirty schedulers nifs fail with "{error, {bad_lib, xxx >>>> requires a runtime with dirty scheduler support."}}" >>>> >>>> The erlang is built by >>>> KERL_CONFIGURE_OPTIONS="--disable-dynamic-ssl-lib --with-ssl=/usr/ >>>> --enable-smp-support --without-termcap --enable-dirty-schedulers >>>> --enable-builtin-zlib" ./kerl build git https://github.com/erlang/otp. >>>> git OTP-19.0.4 OTP-19.0.4 >>>> >>>> This is not problem of the apps, all the apps fail with the same error, >>>> I tried https://github.com/vinoski/bitwise and a couple of other. >>>> >>>> There are no problems altogether with the same apps and the same OTP >>>> built with the same command on my home box. Anyway, i tried to build erlang >>>> with other flags and with no kerl, nothing changed. >>>> >>>> What could be the reason for that? >>>> >>> >>> I think the only way you can get that error message is if the runtime is >>> not actually compiled with dirty schedulers enabled. Are you sure you're >>> picking up the right runtime via your path? When you start an erlang shell, >>> does the status line include something like >>> >>> [smp:8:8] [ds:8:8:10] >>> >>> or is the "ds" part missing? What do you get if you execute the >>> following in the erlang shell? >>> >>> erlang:system_info(dirty_cpu_schedulers). >>> >>> --steve >>> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Mon Aug 15 01:37:41 2016 From: donpedrothird@REDACTED (John Doe) Date: Mon, 15 Aug 2016 02:37:41 +0300 Subject: [erlang-questions] Can't make dirty schedulers work on a certain VPS In-Reply-To: References: Message-ID: Yes, it works with forced smp enabled erl -smp enable -pa ebin 2016-08-15 2:21 GMT+03:00 John Doe : > Yes, likely this is the case. > is it possible to enable smp on one core? The kernel is configured with > smp. > > 2016-08-15 2:17 GMT+03:00 Felix Gallo : > >> If you're running on just one core, then erlang doesn't enable smp or >> dirty schedulers. Could that be it? >> >> On Aug 14, 2016 4:13 PM, "John Doe" wrote: >> >>> there's neither smp no ds >>> Erlang/OTP 19 [erts-8.0.3] [source] [64-bit] [async-threads:10] [hipe] >>> [kernel-poll:false] >>> >>> 1> erlang:system_info(dirty_cpu_schedulers). >>> ** exception error: bad argument >>> in function erlang:system_info/1 >>> called as erlang:system_info(dirty_cpu_schedulers) >>> >>> >>> 2016-08-15 2:08 GMT+03:00 Steve Vinoski : >>> >>>> >>>> >>>> On Sun, Aug 14, 2016 at 6:38 PM, John Doe >>>> wrote: >>>> >>>>> Hi all, >>>>> got a very strange problem today on a Debian 7.11, gcc 4.7.2 VPS - >>>>> all apps with dirty schedulers nifs fail with "{error, {bad_lib, xxx >>>>> requires a runtime with dirty scheduler support."}}" >>>>> >>>>> The erlang is built by >>>>> KERL_CONFIGURE_OPTIONS="--disable-dynamic-ssl-lib --with-ssl=/usr/ >>>>> --enable-smp-support --without-termcap --enable-dirty-schedulers >>>>> --enable-builtin-zlib" ./kerl build git https://github.com/erlang/otp. >>>>> git OTP-19.0.4 OTP-19.0.4 >>>>> >>>>> This is not problem of the apps, all the apps fail with the same >>>>> error, I tried https://github.com/vinoski/bitwise and a couple of >>>>> other. >>>>> >>>>> There are no problems altogether with the same apps and the same OTP >>>>> built with the same command on my home box. Anyway, i tried to build erlang >>>>> with other flags and with no kerl, nothing changed. >>>>> >>>>> What could be the reason for that? >>>>> >>>> >>>> I think the only way you can get that error message is if the runtime >>>> is not actually compiled with dirty schedulers enabled. Are you sure you're >>>> picking up the right runtime via your path? When you start an erlang shell, >>>> does the status line include something like >>>> >>>> [smp:8:8] [ds:8:8:10] >>>> >>>> or is the "ds" part missing? What do you get if you execute the >>>> following in the erlang shell? >>>> >>>> erlang:system_info(dirty_cpu_schedulers). >>>> >>>> --steve >>>> >>> >>> >>> _______________________________________________ >>> 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 Mon Aug 15 02:47:51 2016 From: felixgallo@REDACTED (Felix Gallo) Date: Sun, 14 Aug 2016 17:47:51 -0700 Subject: [erlang-questions] Can't make dirty schedulers work on a certain VPS In-Reply-To: References: Message-ID: Note that if a dirty job actually gets scheduled when there's only one execution thread available, you may have a bad time. F. On Aug 14, 2016 4:37 PM, "John Doe" wrote: > Yes, it works with forced smp enabled > erl -smp enable -pa ebin > > > 2016-08-15 2:21 GMT+03:00 John Doe : > >> Yes, likely this is the case. >> is it possible to enable smp on one core? The kernel is configured with >> smp. >> >> 2016-08-15 2:17 GMT+03:00 Felix Gallo : >> >>> If you're running on just one core, then erlang doesn't enable smp or >>> dirty schedulers. Could that be it? >>> >>> On Aug 14, 2016 4:13 PM, "John Doe" wrote: >>> >>>> there's neither smp no ds >>>> Erlang/OTP 19 [erts-8.0.3] [source] [64-bit] [async-threads:10] [hipe] >>>> [kernel-poll:false] >>>> >>>> 1> erlang:system_info(dirty_cpu_schedulers). >>>> ** exception error: bad argument >>>> in function erlang:system_info/1 >>>> called as erlang:system_info(dirty_cpu_schedulers) >>>> >>>> >>>> 2016-08-15 2:08 GMT+03:00 Steve Vinoski : >>>> >>>>> >>>>> >>>>> On Sun, Aug 14, 2016 at 6:38 PM, John Doe >>>>> wrote: >>>>> >>>>>> Hi all, >>>>>> got a very strange problem today on a Debian 7.11, gcc 4.7.2 VPS - >>>>>> all apps with dirty schedulers nifs fail with "{error, {bad_lib, xxx >>>>>> requires a runtime with dirty scheduler support."}}" >>>>>> >>>>>> The erlang is built by >>>>>> KERL_CONFIGURE_OPTIONS="--disable-dynamic-ssl-lib --with-ssl=/usr/ >>>>>> --enable-smp-support --without-termcap --enable-dirty-schedulers >>>>>> --enable-builtin-zlib" ./kerl build git >>>>>> https://github.com/erlang/otp.git OTP-19.0.4 OTP-19.0.4 >>>>>> >>>>>> This is not problem of the apps, all the apps fail with the same >>>>>> error, I tried https://github.com/vinoski/bitwise and a couple of >>>>>> other. >>>>>> >>>>>> There are no problems altogether with the same apps and the same OTP >>>>>> built with the same command on my home box. Anyway, i tried to build erlang >>>>>> with other flags and with no kerl, nothing changed. >>>>>> >>>>>> What could be the reason for that? >>>>>> >>>>> >>>>> I think the only way you can get that error message is if the runtime >>>>> is not actually compiled with dirty schedulers enabled. Are you sure you're >>>>> picking up the right runtime via your path? When you start an erlang shell, >>>>> does the status line include something like >>>>> >>>>> [smp:8:8] [ds:8:8:10] >>>>> >>>>> or is the "ds" part missing? What do you get if you execute the >>>>> following in the erlang shell? >>>>> >>>>> erlang:system_info(dirty_cpu_schedulers). >>>>> >>>>> --steve >>>>> >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anders.otp@REDACTED Mon Aug 15 10:22:31 2016 From: anders.otp@REDACTED (Anders Svensson) Date: Mon, 15 Aug 2016 10:22:31 +0200 Subject: [erlang-questions] Diameter Relay Agent In-Reply-To: References: Message-ID: If you mean that that you're looking for User-Name in an incoming message then you can find it in the avps field of the diameter_packet record. Just iterate through that list. Anders On Thu, Aug 11, 2016 at 9:43 PM, Ehsan Mohammadi wrote: > hi > i`m working on a diameter relay agent app > i need to access User-Name AVP to find destination peer base on username. > i passed {'Auth-Application-Id', [?DIAMETER_APP_ID_RELAY]} and {dictionary, > ?DIAMETER_DICT_RELAY} to start_service and my packet is undefined and can`t > access it`s avp(tried on CCR/CCA). > i had to use bin property of packet and pass it to diameter:decode. > what`s correct solution to overcome this problem? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From anders.otp@REDACTED Mon Aug 15 13:22:58 2016 From: anders.otp@REDACTED (Anders Svensson) Date: Mon, 15 Aug 2016 13:22:58 +0200 Subject: [erlang-questions] Diameter Relay Agent In-Reply-To: References: Message-ID: The RFC 4006 dictionary presumably doesn't return the relay identifier from id/0. Even it it did, messages aren't decoded in the same way by a relay. The only decoding that's done is to split the message into AVPs, so it's the avps field you want to look in. Anders On Mon, Aug 15, 2016 at 10:59 AM, Ehsan Mohammadi wrote: > i need to access username to find dst peer and packet type/attrs for logging > purpose > when i pass DIAMETER_DICT_RELAY diameter doesn`t know anything about CCA/CCR > (it`s obvious) > and if i pass rfc4006 dict relay won`t work (i don`t know why) > > On Mon, Aug 15, 2016 at 12:52 PM Anders Svensson > wrote: >> >> If you mean that that you're looking for User-Name in an incoming >> message then you can find it in the avps field of the diameter_packet >> record. Just iterate through that list. >> >> Anders >> >> >> On Thu, Aug 11, 2016 at 9:43 PM, Ehsan Mohammadi >> wrote: >> > hi >> > i`m working on a diameter relay agent app >> > i need to access User-Name AVP to find destination peer base on >> > username. >> > i passed {'Auth-Application-Id', [?DIAMETER_APP_ID_RELAY]} and >> > {dictionary, >> > ?DIAMETER_DICT_RELAY} to start_service and my packet is undefined and >> > can`t >> > access it`s avp(tried on CCR/CCA). >> > i had to use bin property of packet and pass it to diameter:decode. >> > what`s correct solution to overcome this problem? >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > From ehsan.tck@REDACTED Mon Aug 15 10:59:00 2016 From: ehsan.tck@REDACTED (Ehsan Mohammadi) Date: Mon, 15 Aug 2016 08:59:00 +0000 Subject: [erlang-questions] Diameter Relay Agent In-Reply-To: References: Message-ID: i need to access username to find dst peer and packet type/attrs for logging purpose when i pass DIAMETER_DICT_RELAY diameter doesn`t know anything about CCA/CCR (it`s obvious) and if i pass rfc4006 dict relay won`t work (i don`t know why) On Mon, Aug 15, 2016 at 12:52 PM Anders Svensson wrote: > If you mean that that you're looking for User-Name in an incoming > message then you can find it in the avps field of the diameter_packet > record. Just iterate through that list. > > Anders > > > On Thu, Aug 11, 2016 at 9:43 PM, Ehsan Mohammadi > wrote: > > hi > > i`m working on a diameter relay agent app > > i need to access User-Name AVP to find destination peer base on username. > > i passed {'Auth-Application-Id', [?DIAMETER_APP_ID_RELAY]} and > {dictionary, > > ?DIAMETER_DICT_RELAY} to start_service and my packet is undefined and > can`t > > access it`s avp(tried on CCR/CCA). > > i had to use bin property of packet and pass it to diameter:decode. > > what`s correct solution to overcome this problem? > > > > _______________________________________________ > > 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 Tue Aug 16 11:54:51 2016 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Tue, 16 Aug 2016 09:54:51 +0000 Subject: [erlang-questions] A project to replace build system with CMake Message-ID: Good day everyone https://github.com/kvakvs/otp/tree/cmake Here's one thing i've spent few weeks on (its been several attempts, this is the most recent and most successful attempt so far). It uses CMake to configure (not all but many of config.h fields), it calls generator Perl scripts, it compiles emulator, epmd and tools in erts/etc, and the result is runnable. It allows to configure some build variables like platform, HiPE, etc (see root CMakeLists.txt). It only builds on Linux now (using couple months old master). Pros: - Automake/autoconf begone. - Easier start (make directory, run cmake from it, run make) - Shorter build scripts (much shorter actually). Better control over what goes to which directory, easier to group files into static/dynamic libs or executables. - Better control over compiler command lines and dependencies. - Better control over what is written to which directory. All build results are now contained in build directory. - Crossplatform, also supports making projects for major IDEs. - It is possible to easily force C++ compiler on every C file (which after fixing few compile errors allows using Windows MSVC compiler infrastructure and step away from MinGW/Cygwin, which right now is blocking transition to C99/C11). I've investigated this way, it is not too much to fix. Cons: - Results aren't placed in such a way to form Erlang release directory structure, that can be fixed later. - Cross-compiling is not working. 32-bit compiling on 64-bit machine is close to be working. - Libs/tests/docs are not built this way. This can be added later. -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Tue Aug 16 12:28:57 2016 From: z@REDACTED (Danil Zagoskin) Date: Tue, 16 Aug 2016 13:28:57 +0300 Subject: [erlang-questions] LCNT: understanding proc_* and db_hash_slot collisions In-Reply-To: References: Message-ID: Hello again! On Sun, Jul 31, 2016 at 12:45 PM, Lukas Larsson wrote: > On Tue, Jul 26, 2016 at 12:11 PM, Danil Zagoskin wrote: > >> Hello! >> > > Hello! > > >> Inspecting the process gives me >> lock id #tries #collisions collisions [%] time [us] >> duration [%] histogram [log2(us)] >> ----- --- ------- ------------ --------------- ---------- >> ------------- --------------------- >> flu_pulsedb proc_main 6989 4242 60.6954 1161759 >> 11.5906 | ...........XX... | >> flu_pulsedb proc_msgq 7934 3754 47.3154 669383 >> 6.6783 | .xXXxxXxx..xXX... | >> flu_pulsedb proc_status 5489 521 9.4917 287153 >> 2.8649 | ..xxxxxxxxxxxXX.. | >> flu_pulsedb proc_link 864 44 5.0926 566 >> 0.0056 | ...XxX..... | >> flu_pulsedb proc_btm 0 0 0.0000 0 >> 0.0000 | | >> flu_pulsedb proc_trace 201 0 0.0000 0 >> 0.0000 | | >> >> Context: this process is a data receiver. Each sender first checks its >> message queue length and then sends a message >> if queue is not very long. This happens about 220 times a second. Then >> this process accumulates some data and >> writes it to disk periodically. >> What do proc_main, proc_msgq and proc_status locks mean? >> > > proc_main is the main execution lock, proc_msgq is the lock protecting the > external message queue, and proc_status is the lock protecting the process > status ans various other things. > > >> Why at all are collisions possible here? >> > > When doing various operations, different locks are needed in order to > guarantee the order of events. For instance when sending a message the > proc_msgq lock is needed. However when checking the size of the message > queue both the proc_main, proc_msgq are needed. So if many processes > continually check the message queue size of a single other process you will > get a lot of conflict on both the main and msgq lock. > > >> What should I see next to optimise this bottleneck? >> > > Don't check the message queue length of another process unless you really > have to, and if you do have to, do it as seldom as you can. Checking the > length of a message queue is a deceptively expensive operation. > Thank you for explaining this. Removing message queue length check mostly fixed process locking issue in this process. > >> >> Next, inspecting db_hash_slot gives me 20 rows all alike (only top few >> shown): >> lock id #tries #collisions collisions [%] time [us] >> duration [%] histogram [log2(us)] >> ----- --- ------- ------------ --------------- ---------- >> ------------- --------------------- >> db_hash_slot 0 492 299 60.7724 107552 >> 1.0730 | ...XX. . | >> db_hash_slot 1 492 287 58.3333 101951 >> 1.0171 | . ..XX. . | >> db_hash_slot 48 480 248 51.6667 99486 >> 0.9925 | ...xXx. | >> db_hash_slot 47 480 248 51.6667 96443 >> 0.9622 | ...XXx | >> db_hash_slot 2 574 304 52.9617 92952 >> 0.9274 | . ....XX. . | >> >> How do I see what ETS tables are causing this high collision rate? >> Is there any way to map lock id (here: 0, 1, 48, 47, 2) to a table id? >> > > iirc the id used in the lock checker should be the same as the table id. > Unfortunately, the lock equals a table's hash lock id: https://github.com/erlang/otp/blob/maint/erts/emulator/beam/erl_db_hash.c#L687 After changing make_small(i) to tb->common.the_name we were able to see the table name causing locking: (flussonic@REDACTED)22> lcnt:inspect(db_hash_slot, [{max_locks, 10}]). lock id #tries #collisions collisions [%] time [us] duration [%] histogram [log2(us)] ----- --- ------- ------------ --------------- ---------- ------------- --------------------- db_hash_slot pulsedb_seconds_data 523 78 14.9140 26329 0.5265 | .. .XXX .. | db_hash_slot pulsedb_seconds_data 498 77 15.4618 24210 0.4841 | ...xXX. . | db_hash_slot pulsedb_seconds_data 524 62 11.8321 23082 0.4616 | . ..XX. .. | db_hash_slot pulsedb_seconds_data 489 74 15.1329 21425 0.4284 | ...XX. . | db_hash_slot pulsedb_seconds_data 493 79 16.0243 19918 0.3983 | ... .xXX. | db_hash_slot pulsedb_seconds_data 518 67 12.9344 19298 0.3859 | ....XX.. | db_hash_slot pulsedb_seconds_data 595 70 11.7647 18947 0.3789 | . ..XX. | db_hash_slot pulsedb_seconds_data 571 74 12.9597 18638 0.3727 | ....XX. | db_hash_slot pulsedb_seconds_data 470 61 12.9787 17818 0.3563 | .....XX... | db_hash_slot pulsedb_seconds_data 475 75 15.7895 17582 0.3516 | xXX. | ok Should I create a PR for that? The result is not perfect ? it could be better to see {TableName, LockID} there, but I failed to create a new tuple in that function. Or maybe there is a better tool for ETS profiling? >> > > for detection of ETS conflicts there is no better tool. For general ETS > performance, I would use the same tools as for all erlang code, i.e. cprof, > eprof, fprof and friends. > > Lukas > The problem with this table was about very concurrent writes ? over 200 processes inserting about 5 rows a second. Despite write_concurrency option this did not work well. We changed the way we write into the table to single writer process. This removed the db_hash_slot locking but brought up locking in db_tab. After splitting the table into 16 chunks the obvious ETS locking problems seems to go away. But. There are process locks again, now in ranch connections supervisor (it is registered by hand for readability): (flussonic@REDACTED)72> lcnt:inspect(ranch_conns_sup). lock id #tries #collisions collisions [%] time [us] duration [%] histogram [log2(us)] ----- --- ------- ------------ --------------- ---------- ------------- --------------------- ranch_conns_sup proc_link 59 0 0.0000 3766719 71.2297 | . .. . ..x. X| ranch_conns_sup proc_status 50 0 0.0000 3766093 71.2179 | . ..x. X| ranch_conns_sup proc_msgq 63 2 3.1746 59220 1.1199 | X | ranch_conns_sup proc_main 93 11 11.8280 4 0.0001 | X | ranch_conns_sup proc_btm 16 0 0.0000 0 0.0000 | | ranch_conns_sup proc_trace 17 0 0.0000 0 0.0000 | | ok And this happened under half of load which caused initial issue. Reading the erl_db.c and friends I found an option to affect ETS mutex spincount option. Specifying undocumented erl "+zebwt short" option seems to make thing better (but still not perfect). Now we still have long process locks in ranch. Here is lcnt locations with zero lines omitted: (flussonic@REDACTED)52> lcnt:inspect(pid(0,6991,0), [{locations, true}]). id: proc_status 'beam/erl_process_lock.c':761 9 0 0.0000 1057841 20.9704 'beam/bif.c':1156 24 3 12.5000 84 0.0017 id: proc_msgq 'beam/erl_message.c':414 4 2 50.0000 344029 6.8200 id: proc_link 'beam/erl_process_lock.c':761 9 0 0.0000 1057837 20.9703 'beam/bif.c':1156 24 3 12.5000 157 0.0031 Thing still unclear: - Why does ETS usage pattern affect processes which do not use ETS? - Are there more hidden ETS tuning options? - What else can we do to make this system faster? Free system resources are enough for doing 4?5 times more job. -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Tue Aug 16 15:38:05 2016 From: z@REDACTED (Danil Zagoskin) Date: Tue, 16 Aug 2016 16:38:05 +0300 Subject: [erlang-questions] msacc: much time spent in alloc and gc Message-ID: Hello! We have a system which uses only 20?25% of available CPU. After that we see: * increased run_queue * increased scheduler active time (from erlang:statistics(scheduler_wall_time)) * decreased CPU usage At first there were some problems visible with lcnt, but now (after fixes) there aren't. While the system is in troubled state, msacc shows in cumulative scheduler stats: * 19.3% alloc * 19.3% gc * 25.3% ets * 12.3% emulator * 10.0% bif * (other times are quite low) The system is 2x 10-core Xeon E5-2660 (with hyperthreading), so we have 40 schedulers there. We use OTP 19.0 with +MBas aoffcaobf +MBacul 0 Switching scheduler binding from unbound (no option) to default (thread_no_node_processor_spread according to documentation) sligtly increases the throughput, but the alloc/gc/ets times are still very high. How do we inspect high alloc/gc scheduler times? Is there a way to select the most suitable allocation strategies without bruteforcing every option on every allocator type? Maybe we are missing something? Any advice? -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathaniel@REDACTED Tue Aug 16 17:29:53 2016 From: nathaniel@REDACTED (Nathaniel Waisbrot) Date: Tue, 16 Aug 2016 11:29:53 -0400 Subject: [erlang-questions] A project to replace build system with CMake In-Reply-To: References: Message-ID: <56748C87-07BB-4EF1-BBB2-B1D9DF90A407@waisbrot.net> > https://github.com/kvakvs/otp/tree/cmake > Looking good! CMake is VERY SHOUTY but in all other respects I've found it much more pleasant to write and maintain cross-platform code with CMake than with autoconf. -------------- 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 k.petrauskas@REDACTED Tue Aug 16 18:18:34 2016 From: k.petrauskas@REDACTED (Karolis Petrauskas) Date: Tue, 16 Aug 2016 19:18:34 +0300 Subject: [erlang-questions] Mnesia is restarting transactions for a long time. Message-ID: Hello, I have a system of two Erlang nodes, that use a clustered mnesia. Sometimes startup of the database takes very long (tens of minutes). After enabling mnesia event logging I see the following message repeated: mnesia_system_event:mnesia_info: Restarting transaction {tid,143589,<0.1351.0>}: in 10ms {cyclic, 'some-node@REDACTED', {schema,'______WHOLETABLE_____'}, write,write,{tid,143588,<0.1333.0>} } After a second I am getting the following event: Sync serial {tid,143589,<0.1351.0>} And then "Restarting transaction" events are repeated with increasing time intervals. TID is remaining the same. How to determine, why the transaction cannot be restarted. What can I do to to avoid such situations or how to recover from them. I have set {max_wait_for_decision, 300000} (5 min) for Mnesia as well as {auto_repair, true} in sys.config. Karolis -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Tue Aug 16 22:34:33 2016 From: ok@REDACTED (ok@REDACTED) Date: Wed, 17 Aug 2016 08:34:33 +1200 Subject: [erlang-questions] A project to replace build system with CMake In-Reply-To: References: Message-ID: <0bab2443e88d4f0c5827b38ab37573a1.squirrel@chasm.otago.ac.nz> "Dmytro Lytovchenko" wrote about a project to build Erlang using cmake. He missed a couple of Cons: - not tested on Solaris, any flavour of OSX, or OpenBSD or NetBSD. So it's no use to me. - requires cmake For some systems I use, this would mean having to install cmake. For others, having to reinstall. For all, having to use a system I've had bad experiences with. I wonder whether some of the Pro points could not be achieved using the existing infrastructure? What is the problem with C99/C11 under Cygwin? GCC 4.9.2 was running under Cygwin about 2 years ago, and that handled C99/C11 just fine (I thought) and even supported some C++14 features. From dmytro.lytovchenko@REDACTED Tue Aug 16 22:54:13 2016 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Tue, 16 Aug 2016 20:54:13 +0000 Subject: [erlang-questions] A project to replace build system with CMake In-Reply-To: <0bab2443e88d4f0c5827b38ab37573a1.squirrel@chasm.otago.ac.nz> References: <0bab2443e88d4f0c5827b38ab37573a1.squirrel@chasm.otago.ac.nz> Message-ID: > - not tested on Solaris, any flavour of OSX, or OpenBSD or NetBSD. Because it is work in progress, and then i decided to ask for more opinions before either putting effort to finish and deliver it (which i admit is a fair amount of effort remaining to be done) or throwing it away. I have access to Linux x64, latest OSX and possibly one of previous versions, and Windows 10, and can try get my hands on virtual machines for those other you mentioned, should the project go this far. > - requires cmake > had bad experiences with. For that i am sorry :) > What is the problem with C99/C11 under Cygwin? On Windows otp is built using MSVS 2013+ AND at the same time the inner loop beam_emu.c is built using GCC from Cygwin, this was old team's choice probably because MSVC is a fairly good compiler but it doesn't support labels as pointers feature for inner VM loop. Microsoft clearly stated that it will never ever develop support for C99 and newer, this is why otp source is stuck in stone age with C89, last time i asked. I believe this spell can be broken by using C++ mode in MSVC or using GCC to build everything on Windows. > I wonder whether some of the Pro points could not be achieved using the existing infrastructure? I never said something isn't possible. With effort and dedication anything is possible. It is just me, who dislikes existing infrastructure to such extent that several weeks dedicated to try and replace it with modern alternative seemed a fair price. tis 16 aug. 2016 kl 22:34 skrev : > "Dmytro Lytovchenko" > wrote about a project to build Erlang using cmake. > He missed a couple of Cons: > - not tested on Solaris, any flavour of OSX, or OpenBSD or NetBSD. > So it's no use to me. > - requires cmake > For some systems I use, this would mean having to install cmake. > For others, having to reinstall. > For all, having to use a system I've had bad experiences with. > > I wonder whether some of the Pro points could not be achieved > using the existing infrastructure? > > What is the problem with C99/C11 under Cygwin? > GCC 4.9.2 was running under Cygwin about 2 years ago, > and that handled C99/C11 just fine (I thought) > and even supported some C++14 features. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathaniel@REDACTED Tue Aug 16 22:56:34 2016 From: nathaniel@REDACTED (Nathaniel Waisbrot) Date: Tue, 16 Aug 2016 16:56:34 -0400 Subject: [erlang-questions] A project to replace build system with CMake In-Reply-To: <0bab2443e88d4f0c5827b38ab37573a1.squirrel@chasm.otago.ac.nz> References: <0bab2443e88d4f0c5827b38ab37573a1.squirrel@chasm.otago.ac.nz> Message-ID: <255738BB-E08E-4121-9F91-0CE58BC516CE@waisbrot.net> > - not tested on Solaris, any flavour of OSX, or OpenBSD or NetBSD. > So it's no use to me. If you're talking about CMake, it is in fact tested on Solaris, OS X and OpenBSD (but not NetBSD as far as I see): https://open.cdash.org/index.php?project=CMake -------------- 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 ok@REDACTED Wed Aug 17 02:07:35 2016 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 17 Aug 2016 12:07:35 +1200 Subject: [erlang-questions] A project to replace build system with CMake In-Reply-To: <255738BB-E08E-4121-9F91-0CE58BC516CE@waisbrot.net> References: <0bab2443e88d4f0c5827b38ab37573a1.squirrel@chasm.otago.ac.nz> <255738BB-E08E-4121-9F91-0CE58BC516CE@waisbrot.net> Message-ID: <281c9ae0-e0f5-e20a-4ee1-7413d7fb74fe@cs.otago.ac.nz> On 17/08/16 8:56 AM, Nathaniel Waisbrot wrote: >> - not tested on Solaris, any flavour of OSX, or OpenBSD or NetBSD. >> So it's no use to me. > > > If you're talking about CMake I pretty obviously wasn't. From nathaniel@REDACTED Wed Aug 17 02:37:30 2016 From: nathaniel@REDACTED (Nathaniel Waisbrot) Date: Tue, 16 Aug 2016 20:37:30 -0400 Subject: [erlang-questions] A project to replace build system with CMake In-Reply-To: <281c9ae0-e0f5-e20a-4ee1-7413d7fb74fe@cs.otago.ac.nz> References: <0bab2443e88d4f0c5827b38ab37573a1.squirrel@chasm.otago.ac.nz> <255738BB-E08E-4121-9F91-0CE58BC516CE@waisbrot.net> <281c9ae0-e0f5-e20a-4ee1-7413d7fb74fe@cs.otago.ac.nz> Message-ID: >>> - not tested on Solaris, any flavour of OSX, or OpenBSD or NetBSD. >>> So it's no use to me. >> >> >> If you're talking about CMake > > I pretty obviously wasn't. > It made more sense to me than complaining that someone's "here's a neat idea" project wasn't tested on Solaris. -------------- 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 marco.molteni@REDACTED Wed Aug 17 09:11:49 2016 From: marco.molteni@REDACTED (Marco Molteni) Date: Wed, 17 Aug 2016 09:11:49 +0200 Subject: [erlang-questions] A project to replace build system with CMake In-Reply-To: References: Message-ID: Hello Dmytro, very good effort! I use cmake extensively and, although not perfect, it is light-years better or less painful than autotools. Regarding the cons, I think you meant them as temporary cons, in the sense that all 3 of them can be handled with cmake, I think you meant you are not there yet :-) Anyway, as somebody who does huge cmake projects at work, I think this approach makes a lot of sense. Hope this will gain traction. marco > On 16 Aug 2016, at 11:54, Dmytro Lytovchenko wrote: > > Good day everyone > > https://github.com/kvakvs/otp/tree/cmake > > Here's one thing i've spent few weeks on (its been several attempts, this is the most recent and most successful attempt so far). It uses CMake to configure (not all but many of config.h fields), it calls generator Perl scripts, it compiles emulator, epmd and tools in erts/etc, and the result is runnable. It allows to configure some build variables like platform, HiPE, etc (see root CMakeLists.txt). It only builds on Linux now (using couple months old master). > > Pros: > - Automake/autoconf begone. > - Easier start (make directory, run cmake from it, run make) > - Shorter build scripts (much shorter actually). Better control over what goes to which directory, easier to group files into static/dynamic libs or executables. > - Better control over compiler command lines and dependencies. > - Better control over what is written to which directory. All build results are now contained in build directory. > - Crossplatform, also supports making projects for major IDEs. > - It is possible to easily force C++ compiler on every C file (which after fixing few compile errors allows using Windows MSVC compiler infrastructure and step away from MinGW/Cygwin, which right now is blocking transition to C99/C11). I've investigated this way, it is not too much to fix. > > Cons: > - Results aren't placed in such a way to form Erlang release directory structure, that can be fixed later. > - Cross-compiling is not working. 32-bit compiling on 64-bit machine is close to be working. > - Libs/tests/docs are not built this way. This can be added later. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From lukas@REDACTED Wed Aug 17 12:20:00 2016 From: lukas@REDACTED (Lukas Larsson) Date: Wed, 17 Aug 2016 12:20:00 +0200 Subject: [erlang-questions] Patch package OTP 19.0.5 released Message-ID: Patch Package: OTP 19.0.5 Git Tag: OTP-19.0.5 Date: 2016-08-17 Trouble Report Id: OTP-13813 Seq num: System: OTP Release: 19 Application: kernel-5.0.2 Predecessor: OTP 19.0.4 Check out the git tag OTP-19.0.5, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- kernel-5.0.2 ---------------------------------------------------- --------------------------------------------------------------------- The kernel-5.0.2 application can be applied independently of other applications on a full OTP 19 installation. --- Fixed Bugs and Malfunctions --- OTP-13813 Application(s): kernel When calling os:cmd from a process that has set trap_exit to true an 'EXIT' message would be left in the message queue. This bug was introduced in kernel vsn 5.0.1. Full runtime dependencies of kernel-5.0.2: erts-8.0, sasl-3.0, stdlib-3.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Wed Aug 17 17:03:26 2016 From: z@REDACTED (Danil Zagoskin) Date: Wed, 17 Aug 2016 18:03:26 +0300 Subject: [erlang-questions] LCNT: understanding proc_* and db_hash_slot collisions In-Reply-To: References: Message-ID: After reducing ETS load I see a new lock coming up ? now it's one of 1024 pix_lock's: (flussonic@REDACTED)3> lcnt:apply(timer, sleep, [5000]), lcnt:swap_pid_keys(), lcnt:conflicts([{max_locks, 5}]). lock id #tries #collisions collisions [%] time [us] duration [%] ----- --- ------- ------------ --------------- ---------- ------------- 6 6403 686 10.7137 5550663 109.9727 pix_lock 1024 1330 1 0.0752 1481334 29.3490 run_queue 42 3394894 82843 2.4402 171155 3.3910 pollset 1 162867 10714 6.5784 88266 1.7488 db_tab 181 135250 759 0.5612 62164 1.2316 ok (flussonic@REDACTED)5> lcnt:inspect(pix_lock, [{max_locks, 5}]). lock id #tries #collisions collisions [%] time [us] duration [%] histogram [log2(us)] ----- --- ------- ------------ --------------- ---------- ------------- --------------------- pix_lock 53 1284 1 0.0779 1480359 29.3297 | XX. ........ | pix_lock 895 4 0 0.0000 121 0.0024 | X | pix_lock 862 4 0 0.0000 92 0.0018 | X X | pix_lock 270 2 0 0.0000 83 0.0016 | X | pix_lock 949 2 0 0.0000 70 0.0014 | X | ok (flussonic@REDACTED)8> lcnt:inspect(pix_lock, [{locations, true}, {combine, true}]). lock: pix_lock id: 1024 type: mutex location #tries #collisions collisions [%] time [us] duration [%] --------- ------- ------------ --------------- ---------- ------------- 'beam/erl_process_lock.h':422 1330 1 0.0752 1481334 29.3490 undefined:0 0 0 0.0000 0 0.0000 ok The previously described proc_link/proc_status lock is still here. The thing i find strange about pix_lock is that only one lock of 1024 is used and has a significant duration. Other ones have almost zero tries and duration. The lock id is not constant ? it changes over time. May long pix_lock be a same problem as proc_link/proc_status? Why can this happen? What should we see next? On Tue, Aug 16, 2016 at 1:28 PM, Danil Zagoskin wrote: > Hello again! > > On Sun, Jul 31, 2016 at 12:45 PM, Lukas Larsson > wrote: > >> On Tue, Jul 26, 2016 at 12:11 PM, Danil Zagoskin wrote: >> >>> Hello! >>> >> >> Hello! >> >> >>> Inspecting the process gives me >>> lock id #tries #collisions collisions [%] time [us] >>> duration [%] histogram [log2(us)] >>> ----- --- ------- ------------ --------------- ---------- >>> ------------- --------------------- >>> flu_pulsedb proc_main 6989 4242 60.6954 1161759 >>> 11.5906 | ...........XX... | >>> flu_pulsedb proc_msgq 7934 3754 47.3154 669383 >>> 6.6783 | .xXXxxXxx..xXX... | >>> flu_pulsedb proc_status 5489 521 9.4917 287153 >>> 2.8649 | ..xxxxxxxxxxxXX.. | >>> flu_pulsedb proc_link 864 44 5.0926 566 >>> 0.0056 | ...XxX..... | >>> flu_pulsedb proc_btm 0 0 0.0000 0 >>> 0.0000 | | >>> flu_pulsedb proc_trace 201 0 0.0000 0 >>> 0.0000 | | >>> >>> Context: this process is a data receiver. Each sender first checks its >>> message queue length and then sends a message >>> if queue is not very long. This happens about 220 times a second. >>> Then this process accumulates some data and >>> writes it to disk periodically. >>> What do proc_main, proc_msgq and proc_status locks mean? >>> >> >> proc_main is the main execution lock, proc_msgq is the lock protecting >> the external message queue, and proc_status is the lock protecting the >> process status ans various other things. >> >> >>> Why at all are collisions possible here? >>> >> >> When doing various operations, different locks are needed in order to >> guarantee the order of events. For instance when sending a message the >> proc_msgq lock is needed. However when checking the size of the message >> queue both the proc_main, proc_msgq are needed. So if many processes >> continually check the message queue size of a single other process you will >> get a lot of conflict on both the main and msgq lock. >> >> >>> What should I see next to optimise this bottleneck? >>> >> >> Don't check the message queue length of another process unless you really >> have to, and if you do have to, do it as seldom as you can. Checking the >> length of a message queue is a deceptively expensive operation. >> > > Thank you for explaining this. Removing message queue length check mostly > fixed process locking issue in this process. > > >> >>> >>> Next, inspecting db_hash_slot gives me 20 rows all alike (only top few >>> shown): >>> lock id #tries #collisions collisions [%] time [us] >>> duration [%] histogram [log2(us)] >>> ----- --- ------- ------------ --------------- ---------- >>> ------------- --------------------- >>> db_hash_slot 0 492 299 60.7724 107552 >>> 1.0730 | ...XX. . | >>> db_hash_slot 1 492 287 58.3333 101951 >>> 1.0171 | . ..XX. . | >>> db_hash_slot 48 480 248 51.6667 99486 >>> 0.9925 | ...xXx. | >>> db_hash_slot 47 480 248 51.6667 96443 >>> 0.9622 | ...XXx | >>> db_hash_slot 2 574 304 52.9617 92952 >>> 0.9274 | . ....XX. . | >>> >>> How do I see what ETS tables are causing this high collision rate? >>> Is there any way to map lock id (here: 0, 1, 48, 47, 2) to a table id? >>> >> >> iirc the id used in the lock checker should be the same as the table id. >> > > Unfortunately, the lock equals a table's hash lock id: > https://github.com/erlang/otp/blob/maint/erts/emulator/beam/ > erl_db_hash.c#L687 > After changing make_small(i) to tb->common.the_name we were able to see > the table name causing locking: > > (flussonic@REDACTED)22> lcnt:inspect(db_hash_slot, [{max_locks, 10}]). > lock id #tries #collisions collisions [%] time [us] duration [%] histogram [log2(us)] > ----- --- ------- ------------ --------------- ---------- ------------- --------------------- > db_hash_slot pulsedb_seconds_data 523 78 14.9140 26329 0.5265 | .. .XXX .. | > db_hash_slot pulsedb_seconds_data 498 77 15.4618 24210 0.4841 | ...xXX. . | > db_hash_slot pulsedb_seconds_data 524 62 11.8321 23082 0.4616 | . ..XX. .. | > db_hash_slot pulsedb_seconds_data 489 74 15.1329 21425 0.4284 | ...XX. . | > db_hash_slot pulsedb_seconds_data 493 79 16.0243 19918 0.3983 | ... .xXX. | > db_hash_slot pulsedb_seconds_data 518 67 12.9344 19298 0.3859 | ....XX.. | > db_hash_slot pulsedb_seconds_data 595 70 11.7647 18947 0.3789 | . ..XX. | > db_hash_slot pulsedb_seconds_data 571 74 12.9597 18638 0.3727 | ....XX. | > db_hash_slot pulsedb_seconds_data 470 61 12.9787 17818 0.3563 | .....XX... | > db_hash_slot pulsedb_seconds_data 475 75 15.7895 17582 0.3516 | xXX. | > ok > > > > Should I create a PR for that? > The result is not perfect ? it could be better to see {TableName, LockID} > there, but I failed to create a new tuple in that function. > > > Or maybe there is a better tool for ETS profiling? >>> >> >> for detection of ETS conflicts there is no better tool. For general ETS >> performance, I would use the same tools as for all erlang code, i.e. cprof, >> eprof, fprof and friends. >> >> Lukas >> > > > The problem with this table was about very concurrent writes ? over 200 > processes inserting about 5 rows a second. Despite write_concurrency option > this did not work well. > > We changed the way we write into the table to single writer process. This > removed the db_hash_slot locking but brought up locking in db_tab. > After splitting the table into 16 chunks the obvious ETS locking problems > seems to go away. > > > > But. > > > There are process locks again, now in ranch connections supervisor (it is > registered by hand for readability): > > (flussonic@REDACTED)72> lcnt:inspect(ranch_conns_sup). > lock id #tries #collisions collisions [%] time [us] duration [%] histogram [log2(us)] > ----- --- ------- ------------ --------------- ---------- ------------- --------------------- > ranch_conns_sup proc_link 59 0 0.0000 3766719 71.2297 | . .. . ..x. X| > ranch_conns_sup proc_status 50 0 0.0000 3766093 71.2179 | . ..x. X| > ranch_conns_sup proc_msgq 63 2 3.1746 59220 1.1199 | X | > ranch_conns_sup proc_main 93 11 11.8280 4 0.0001 | X | > ranch_conns_sup proc_btm 16 0 0.0000 0 0.0000 | | > ranch_conns_sup proc_trace 17 0 0.0000 0 0.0000 | | > ok > > And this happened under half of load which caused initial issue. > > Reading the erl_db.c and friends I found an option to affect ETS mutex > spincount option. Specifying undocumented erl "+zebwt short" option seems > to make thing better (but still not perfect). > > Now we still have long process locks in ranch. Here is lcnt locations with > zero lines omitted: > (flussonic@REDACTED)52> lcnt:inspect(pid(0,6991,0), [{locations, true}]). > id: proc_status > 'beam/erl_process_lock.c':761 9 0 0.0000 > 1057841 20.9704 > 'beam/bif.c':1156 24 3 12.5000 > 84 0.0017 > > id: proc_msgq > 'beam/erl_message.c':414 4 2 50.0000 > 344029 6.8200 > > id: proc_link > 'beam/erl_process_lock.c':761 9 0 0.0000 > 1057837 20.9703 > 'beam/bif.c':1156 24 3 12.5000 > 157 0.0031 > > > Thing still unclear: > - Why does ETS usage pattern affect processes which do not use ETS? > - Are there more hidden ETS tuning options? > - What else can we do to make this system faster? Free system resources > are enough for doing 4?5 times more job. > > -- > Danil Zagoskin | z@REDACTED > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Wed Aug 17 19:26:33 2016 From: g@REDACTED (Garrett Smith) Date: Wed, 17 Aug 2016 12:26:33 -0500 Subject: [erlang-questions] Your input on the Fireside Chat - EUC 2016 Message-ID: We have a unique opportunity to chat with the Erlang founders in a few weeks at the Erlang User Conference in Stockholm. I'm hosting the discussion and need your input to make this a community process. I've prepared a short survey here: https://www.surveymonkey.com/r/K6H3NCS Whether you're planning to attend the conference or not, think about the topics you'd like to hear discussed, or questions asked and jot them down via this survey. For all the possibilities, we have a very short time so I'd like to make every moment count! The session will be recorded for those who can't make it this year. Please also feel free to circulate the survey link to friends and enemies alike! Garrett From arshadansari27@REDACTED Wed Aug 17 19:52:32 2016 From: arshadansari27@REDACTED (Arshad Ansari) Date: Wed, 17 Aug 2016 17:52:32 +0000 Subject: [erlang-questions] LuaJIT on Erlang Message-ID: Hello there, We have existing business logic in Lua, which is a lot of scripts. We've been using it by calling it from C (freediameter) and through LuaJIT. Beam is much slower when compared to LuaJIT execution (as claimed by many) and I'm now tasked with making erlang to work with those lua scripts but not using lua only. Rather, it has to be using LuaJit. Every example I've seen using luerl and other such libraries are directly executing lua and I'm not able to find a way to do the same with JIT. Can anyone point me in right direction? Regards, Arshad -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Wed Aug 17 19:58:06 2016 From: roger@REDACTED (Roger Lipscombe) Date: Wed, 17 Aug 2016 18:58:06 +0100 Subject: [erlang-questions] LuaJIT on Erlang In-Reply-To: References: Message-ID: On 17 August 2016 at 18:52, Arshad Ansari wrote: > Hello there, > We have existing business logic in Lua, which is a lot of scripts. We've > been using it by calling it from C (freediameter) and through LuaJIT. Beam > is much slower when compared to LuaJIT execution (as claimed by many) and > I'm now tasked with making erlang to work with those lua scripts but not > using lua only. Rather, it has to be using LuaJit. Every example I've seen > using luerl and other such libraries are directly executing lua and I'm not > able to find a way to do the same with JIT. Can anyone point me in right > direction? I *think* that you'll need to continue to use the LuaJIT runtime from C, so you'd be looking at the usual ways to talk to C from Erlang. That is: ports, port drivers, C nodes or NIFs. Start here: http://erlang.org/doc/tutorial/introduction.html Robby Raschke did it with a C Node: http://www.erlang-factory.com/berlin2014/robby-raschke fwiw, we embed Squirrel (inspired by Lua; see http://squirrel-lang.org/) in our Erlang nodes by using a NIF. From felixgallo@REDACTED Wed Aug 17 20:02:12 2016 From: felixgallo@REDACTED (Felix Gallo) Date: Wed, 17 Aug 2016 11:02:12 -0700 Subject: [erlang-questions] LuaJIT on Erlang In-Reply-To: References: Message-ID: There are a number of different ways to do what you want. Luerl (https://github.com/rvirding/luerl) is an implementation of lua in erlang. This is the safest method but uses the BEAM. I'd recommend you try this first to see if it really is too slow for your needs. F. On Wed, Aug 17, 2016 at 10:52 AM, Arshad Ansari wrote: > Hello there, > We have existing business logic in Lua, which is a lot of scripts. We've > been using it by calling it from C (freediameter) and through LuaJIT. Beam > is much slower when compared to LuaJIT execution (as claimed by many) and > I'm now tasked with making erlang to work with those lua scripts but not > using lua only. Rather, it has to be using LuaJit. Every example I've seen > using luerl and other such libraries are directly executing lua and I'm not > able to find a way to do the same with JIT. Can anyone point me in right > direction? > > Regards, > Arshad > > _______________________________________________ > 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 Wed Aug 17 20:05:30 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 17 Aug 2016 20:05:30 +0200 Subject: [erlang-questions] LuaJIT on Erlang In-Reply-To: References: Message-ID: On Wed, Aug 17, 2016 at 7:58 PM, Roger Lipscombe wrote: > Robby Raschke did it with a C Node: > http://www.erlang-factory.com/berlin2014/robby-raschke > This is rather close to a solution I would do as well: write a port process which runs the LuaJIT system on top of a small C node. When I did this for OCaml, my pipelined req/s rate was about 1 million or 1us per request in roundtrip. This is usually fine as the reason you want to outsource computation to a separate system is that it is often request heavy and on the order of several milliseconds. I wouldn't really worry too much about the speed aspect. What is the primary problem is that you have a good deal of Lua code which you need to get to run. The quickest way to do that is not to rewrite it, but to interact with it. Once you have that established, you can start looking into if a rewrite is worth it, or is even necessary. LuaJIT is faster than Erlang, but the question remains if that matters in the domain you are working in. More often than not, efficiency doesn't matter as much as people think since there are other things in a system than raw computational turnaround. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From garazdawi@REDACTED Thu Aug 18 10:27:08 2016 From: garazdawi@REDACTED (Lukas Larsson) Date: Thu, 18 Aug 2016 10:27:08 +0200 Subject: [erlang-questions] LCNT: understanding proc_* and db_hash_slot collisions In-Reply-To: References: Message-ID: On Tue, Aug 16, 2016 at 12:28 PM, Danil Zagoskin wrote: > Next, inspecting db_hash_slot gives me 20 rows all alike (only top few >>> shown): >>> lock id #tries #collisions collisions [%] time [us] >>> duration [%] histogram [log2(us)] >>> ----- --- ------- ------------ --------------- ---------- >>> ------------- --------------------- >>> db_hash_slot 0 492 299 60.7724 107552 >>> 1.0730 | ...XX. . | >>> db_hash_slot 1 492 287 58.3333 101951 >>> 1.0171 | . ..XX. . | >>> db_hash_slot 48 480 248 51.6667 99486 >>> 0.9925 | ...xXx. | >>> db_hash_slot 47 480 248 51.6667 96443 >>> 0.9622 | ...XXx | >>> db_hash_slot 2 574 304 52.9617 92952 >>> 0.9274 | . ....XX. . | >>> >>> How do I see what ETS tables are causing this high collision rate? >>> Is there any way to map lock id (here: 0, 1, 48, 47, 2) to a table id? >>> >> >> iirc the id used in the lock checker should be the same as the table id. >> > > Unfortunately, the lock equals a table's hash lock id: > https://github.com/erlang/otp/blob/maint/erts/emulator/beam/ > erl_db_hash.c#L687 > After changing make_small(i) to tb->common.the_name we were able to see > the table name causing locking: > > (flussonic@REDACTED)22> lcnt:inspect(db_hash_slot, [{max_locks, 10}]). > lock id #tries #collisions collisions [%] time [us] duration [%] histogram [log2(us)] > ----- --- ------- ------------ --------------- ---------- ------------- --------------------- > db_hash_slot pulsedb_seconds_data 523 78 14.9140 26329 0.5265 | .. .XXX .. | > db_hash_slot pulsedb_seconds_data 498 77 15.4618 24210 0.4841 | ...xXX. . | > db_hash_slot pulsedb_seconds_data 524 62 11.8321 23082 0.4616 | . ..XX. .. | > db_hash_slot pulsedb_seconds_data 489 74 15.1329 21425 0.4284 | ...XX. . | > db_hash_slot pulsedb_seconds_data 493 79 16.0243 19918 0.3983 | ... .xXX. | > db_hash_slot pulsedb_seconds_data 518 67 12.9344 19298 0.3859 | ....XX.. | > db_hash_slot pulsedb_seconds_data 595 70 11.7647 18947 0.3789 | . ..XX. | > db_hash_slot pulsedb_seconds_data 571 74 12.9597 18638 0.3727 | ....XX. | > db_hash_slot pulsedb_seconds_data 470 61 12.9787 17818 0.3563 | .....XX... | > db_hash_slot pulsedb_seconds_data 475 75 15.7895 17582 0.3516 | xXX. | > ok > > > > Should I create a PR for that? > The result is not perfect ? it could be better to see {TableName, LockID} > there, but I failed to create a new tuple in that function. > Yes please. Although as you say, the PR should should also contain the lock id so that it's possible to know which hash slot is the culprit. You should be able to just add some memory extra allocation to the erts_alloc call just above the for look and then use the TUPLE2() macro to create the tuple, something like: tb->locks = (DbTableHashFineLocks*) erts_db_alloc_fnf(ERTS_ALC_T_DB_SEG, /* Other type maybe? */ (DbTable *) tb, sizeof(DbTableHashFineLocks) + sizeof(Eterm) * DB_HASH_LOCK_CNT); Eterm *hp = (Eterm*)(tb->locks+1); for (i=0; ilocks->lck_vec[i].lck, &rwmtx_opt, "db_hash_slot", TUPLE2(hp, tb->common.the_name, make_small(i))); hp += 3; } > > Thing still unclear: > - Why does ETS usage pattern affect processes which do not use ETS? > I don't know in your specific case, but in general eliminating contention points like these is a constant game of whack a mole. When you eliminate one, all the processes are free to bang on another contention point so you end up with contention somewhere else. I've even seen cases where eliminating a contention point lead to a slower overall system as another contention point became even more contended which slowed down the system significantly. > - Are there more hidden ETS tuning options? > Most likely, we constantly introduce different tuning options to see if they help or not in specific cases, not all of them get documented for various reasons. > - What else can we do to make this system faster? Free system resources > are enough for doing 4?5 times more job. > Continue doing what you are doing :) Maybe use linux perf to see if you can get any information from it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From garazdawi@REDACTED Thu Aug 18 10:35:02 2016 From: garazdawi@REDACTED (Lukas Larsson) Date: Thu, 18 Aug 2016 10:35:02 +0200 Subject: [erlang-questions] LCNT: understanding proc_* and db_hash_slot collisions In-Reply-To: References: Message-ID: On Wed, Aug 17, 2016 at 5:03 PM, Danil Zagoskin wrote: > After reducing ETS load I see a new lock coming up ? now it's one of 1024 > pix_lock's: > > (flussonic@REDACTED)3> lcnt:apply(timer, sleep, [5000]), > lcnt:swap_pid_keys(), lcnt:conflicts([{max_locks, 5}]). > lock id #tries #collisions collisions [%] > time [us] duration [%] > ----- --- ------- ------------ --------------- > ---------- ------------- > 6 6403 686 10.7137 > 5550663 109.9727 > pix_lock 1024 1330 1 0.0752 > 1481334 29.3490 > run_queue 42 3394894 82843 2.4402 > 171155 3.3910 > pollset 1 162867 10714 6.5784 > 88266 1.7488 > db_tab 181 135250 759 0.5612 > 62164 1.2316 > ok > > (flussonic@REDACTED)5> lcnt:inspect(pix_lock, [{max_locks, 5}]). > lock id #tries #collisions collisions [%] time [us] duration > [%] histogram [log2(us)] > ----- --- ------- ------------ --------------- ---------- > ------------- --------------------- > pix_lock 53 1284 1 0.0779 1480359 > 29.3297 | XX. ........ | > pix_lock 895 4 0 0.0000 121 > 0.0024 | X | > pix_lock 862 4 0 0.0000 92 > 0.0018 | X X | > pix_lock 270 2 0 0.0000 83 > 0.0016 | X | > pix_lock 949 2 0 0.0000 70 > 0.0014 | X | > ok > > (flussonic@REDACTED)8> lcnt:inspect(pix_lock, [{locations, true}, > {combine, true}]). > lock: pix_lock > id: 1024 > type: mutex > location #tries #collisions collisions [%] time > [us] duration [%] > --------- ------- ------------ --------------- > ---------- ------------- > 'beam/erl_process_lock.h':422 1330 1 0.0752 > 1481334 29.3490 > undefined:0 0 0 0.0000 > 0 0.0000 > ok > > > > The previously described proc_link/proc_status lock is still here. > > The thing i find strange about pix_lock is that only one lock of 1024 is > used and has a significant duration. Other ones have almost zero tries and > duration. > The lock id is not constant ? it changes over time. > > > May long pix_lock be a same problem as proc_link/proc_status? > Why can this happen? > What should we see next? > > The pix lock is taken when a contention on a proc_* lock has happened, so to get a conflict there is very rare, but it does happen. I'm not sure why the duration of the conflict is so long, is the result repeatable? AS for the distribution of the pix_locks tries, the sample you have is quite small so it could just be a statistical anomaly, or something is incorrect in the hashing algo. IIRC it is the PID of the process that gets hashed somehow and used to figure out which pix_lock to take. Of course if it is only one process where all the contention happens, that process will hash to the same slot everytime, so maybe that is what is happening. -------------- next part -------------- An HTML attachment was scrubbed... URL: From garazdawi@REDACTED Thu Aug 18 10:53:20 2016 From: garazdawi@REDACTED (Lukas Larsson) Date: Thu, 18 Aug 2016 10:53:20 +0200 Subject: [erlang-questions] msacc: much time spent in alloc and gc In-Reply-To: References: Message-ID: On Tue, Aug 16, 2016 at 3:38 PM, Danil Zagoskin wrote: > Hello! > > We have a system which uses only 20?25% of available CPU. After that we > see: > * increased run_queue > * increased scheduler active time (from erlang:statistics( > scheduler_wall_time)) > * decreased CPU usage > > At first there were some problems visible with lcnt, but now (after fixes) > there aren't. > > While the system is in troubled state, msacc shows in cumulative scheduler > stats: > * 19.3% alloc > * 19.3% gc > * 25.3% ets > * 12.3% emulator > * 10.0% bif > * (other times are quite low) > > The system is 2x 10-core Xeon E5-2660 (with hyperthreading), so we have 40 > schedulers there. > We use OTP 19.0 with +MBas aoffcaobf +MBacul 0 > > Switching scheduler binding from unbound (no option) to default > (thread_no_node_processor_spread according to documentation) sligtly > increases the throughput, but the alloc/gc/ets times are still very high. > > How do we inspect high alloc/gc scheduler times? > For garbage collection I would maybe look at using tracing to see if you can figure out which process it is that is doing all the garbage collections. Also from msacc you should be able to figure out if most of the time is spent doing major or minor gc. The alloc is harder to figure out. I would recommend using perf to dig deeper and see if any C functions stick out and try to understand what they do. > Is there a way to select the most suitable allocation strategies without > bruteforcing every option on every allocator type? > There is a tool called erts_alloc_config that may be useful to you. It was designed to solve this type of problem, although I don't think it has been updated in a long time so it may be outdated with what has happened with the allocated the last releases. > Maybe we are missing something? Any advice? > > msacc is a new tool that we've not used that much yet. Every time I've used it I've had to add a bunch of new states and kind of bisect my way down into the code to figure out what it is that is taking all the time. As I've mentioned in the other mail, linxu perf is also a good help here to figure out what is taking time. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From arshadansari27@REDACTED Thu Aug 18 12:06:22 2016 From: arshadansari27@REDACTED (Arshad Ansari) Date: Thu, 18 Aug 2016 10:06:22 +0000 Subject: [erlang-questions] LuaJIT on Erlang In-Reply-To: References: Message-ID: Thank you guys for all the responses. I was able to create a port to call which in turns uses luaJIT to call lua code. I really appreciate the help. Regards, Arshad On Wed, Aug 17, 2016 at 11:36 PM Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > > On Wed, Aug 17, 2016 at 7:58 PM, Roger Lipscombe > wrote: > >> Robby Raschke did it with a C Node: >> http://www.erlang-factory.com/berlin2014/robby-raschke >> > > This is rather close to a solution I would do as well: write a port > process which runs the LuaJIT system on top of a small C node. When I did > this for OCaml, my pipelined req/s rate was about 1 million or 1us per > request in roundtrip. This is usually fine as the reason you want to > outsource computation to a separate system is that it is often request > heavy and on the order of several milliseconds. > > I wouldn't really worry too much about the speed aspect. What is the > primary problem is that you have a good deal of Lua code which you need to > get to run. The quickest way to do that is not to rewrite it, but to > interact with it. Once you have that established, you can start looking > into if a rewrite is worth it, or is even necessary. LuaJIT is faster than > Erlang, but the question remains if that matters in the domain you are > working in. More often than not, efficiency doesn't matter as much as > people think since there are other things in a system than raw > computational turnaround. > > > -- > J. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From westonc@REDACTED Fri Aug 19 01:18:43 2016 From: westonc@REDACTED (Weston C) Date: Thu, 18 Aug 2016 16:18:43 -0700 Subject: [erlang-questions] Building OTP 18.3 on OS X "ODBC library - header check failed" Message-ID: So I'm trying to build OTP 18.3 on OS X 10.9 Mavericks, and seem to be running into a problem where odbc libraries/headers aren't being found. The first time I tried running `configure` I got the message: ********************************************************************* ********************** APPLICATIONS DISABLED ********************** ********************************************************************* odbc : ODBC library - header check failed I went looking for any information I could find about ODBC libraries on OS X, and found one source which said "Since OS X 10.9 (Mavericks) Apple stopped including the iODBC SQL header files" (http://stackoverflow.com/questions/26210317/installation-of-rodbc-roracle-packages-on-os-x-mavericks ), suggesting that might be the key issue. So I grabbed libiodbc from iodbc.org, built the OS X version, and tried again: odbc : ODBC library - header check failed Hmmm. OK, apparently building for OS X drops the libraries/headers into /Library/Frameworks. Maybe the configuration process for OTP doesn't know to look there? So I tried building libiodbc again, this time with --prefix=/usr/local. And: odbc : ODBC library - header check failed I can verify that /usr/local/include contains iodbcext.h, iodbcunix.h, isqlext.h, sql.h, sqltypes.h, iodbcinst.h, isql.h, isqltypes.h, odbcinst.h, sqlext.h, sqlucode.h, so it definitely seems like the headers should be discoverable. I looked around for any earlier discussion on the mailing list about odbc and builds, and found this old message: https://groups.google.com/forum/#!msg/erlang-programming/XGkOnkp012g/TpJRRTvlbugJ Which suggests there was a time when the configuration process didn't recognize iodbc searches on OS X... but a quick check of lib/odbc/configure.in *seems* to show the patch suggested in that message was taken in and this should no longer be an issue. What am I missing? Is there another way to tell configure where it should be looking for libiodbc? Something else needed? From bchesneau@REDACTED Fri Aug 19 16:59:07 2016 From: bchesneau@REDACTED (Benoit Chesneau) Date: Fri, 19 Aug 2016 14:59:07 +0000 Subject: [erlang-questions] [ann] rebar3_elixir_compile Message-ID: Hi, I'm pleased to announce that the BarrelDB project (https://barrel-db.org) just published rebar3_elixir_compile version 1.0.0. rebar3_elixir_compile is a a rebar3 elixir compiler plugin that allows you to mix elixir application an libraries with Erlang applications in your erlang projects. It works with any erlang applications or release. You can find the source code on github: https://github.com/barrel-db/rebar3_elixir_compile The plugin is available on hex.pm as well: https://hex.pm/packages/rebar3_elixir_compile Enjoy! - beno?t -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Aug 19 18:08:03 2016 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 19 Aug 2016 19:08:03 +0300 Subject: [erlang-questions] LCNT: understanding proc_* and db_hash_slot collisions In-Reply-To: References: Message-ID: After launching erlang with +Mea config Danil has found that our flussonic is stuck in binary allocator: > lcnt:inspect(alcu_allocator). lock id #tries #collisions collisions [%] time [us] duration [%] histogram [log2(us)] ----- --- ------- ------------ --------------- ---------- ------------- --------------------- alcu_allocator binary_alloc 4713942 4713764 99.9962 33319141 608.1216 | .Xx.................. | alcu_allocator eheap_alloc 103189 1329 1.2879 6856 0.1251 | Xx.xX.Xx....... | alcu_allocator fix_alloc 304536 2628 0.8630 1524 0.0278 | .xXXx..... . . | alcu_allocator temp_alloc 123755 938 0.7579 780 0.0142 | xx.xX....... 608% of duration is really serious =) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ehsan.tck@REDACTED Fri Aug 19 23:10:52 2016 From: ehsan.tck@REDACTED (Ehsan Mohammadi) Date: Fri, 19 Aug 2016 21:10:52 +0000 Subject: [erlang-questions] Diameter Disable DWR Message-ID: hi i`m working with a diameter credit-control client (huawei) which doesn`t answer my DWR but send DWR to me is any way to disable sending DWR to this peer and wait for his request? -------------- next part -------------- An HTML attachment was scrubbed... URL: From anders.otp@REDACTED Sat Aug 20 12:13:15 2016 From: anders.otp@REDACTED (Anders Svensson) Date: Sat, 20 Aug 2016 12:13:15 +0200 Subject: [erlang-questions] Diameter Disable DWR In-Reply-To: References: Message-ID: Not disable, but if you turn up watchdog_timer on the transport configuration sufficiently then the peer will always send DWR first. Anders On Fri, Aug 19, 2016 at 11:10 PM, Ehsan Mohammadi wrote: > hi > i`m working with a diameter credit-control client (huawei) which doesn`t > answer my DWR but send DWR to me > is any way to disable sending DWR to this peer and wait for his request? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From vasdeveloper@REDACTED Sat Aug 20 19:15:55 2016 From: vasdeveloper@REDACTED (Theepan) Date: Sat, 20 Aug 2016 22:45:55 +0530 Subject: [erlang-questions] Mnesia table transformation and table indexes Message-ID: Hi Team, This sounds obvious, but wanted to confirm. If an Mnesia table is transformed with a new field, do the indexes of the following fields have to be deleted and recreated? Thanks, Theepan -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasdeveloper@REDACTED Sat Aug 20 19:24:14 2016 From: vasdeveloper@REDACTED (Theepan) Date: Sat, 20 Aug 2016 22:54:14 +0530 Subject: [erlang-questions] Cowboy Urlencode In-Reply-To: <63d2f0ed-42a2-e5d2-6336-d819c602ea5e@ninenines.eu> References: <63d2f0ed-42a2-e5d2-6336-d819c602ea5e@ninenines.eu> Message-ID: Thanks Lo?c, yes I am using on the query parameters individually. Just wanted to know if it covers the specification completely. So far works fine. Regards, Theepan On Tue, Aug 9, 2016 at 12:11 PM, Lo?c Hoguin wrote: > What do you mean by "safe"? > > If you're wondering if it works, it does AFAIK, but it's the > application/x-www-form-urlencoded variant of url encoding, so might not > fit your use case. Use it only for query strings. > > > On 08/09/2016 05:44 AM, Theepan wrote: > >> Hi Cowboy Team, >> >> How safe is to use cow_qs:urlencode ? >> >> Regards, >> Theepan >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Mon Aug 22 05:23:32 2016 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Sun, 21 Aug 2016 23:23:32 -0400 Subject: [erlang-questions] Erlang Eddie -- son of? Message-ID: <9B153944-9E75-4526-BD1B-40A2EA364E6A@writersglen.com> Hello, I just ran across The Eddie Mission. It promises much of great potential value but appears to be dead as a dodo. http://eddie.sourceforge.net/mission.html --- Does anyone know if it's still in production anywhere? --- If one wanted close-to-equivalent functionality based on actively supported contemporary Erlang packages, how might one go about it? Best wishes, LRP Sent from my iPad From ok@REDACTED Mon Aug 22 05:37:13 2016 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 22 Aug 2016 15:37:13 +1200 Subject: [erlang-questions] Erlang Eddie -- son of? In-Reply-To: <9B153944-9E75-4526-BD1B-40A2EA364E6A@writersglen.com> References: <9B153944-9E75-4526-BD1B-40A2EA364E6A@writersglen.com> Message-ID: On 22/08/16 3:23 PM, Lloyd R. Prentice wrote: > Hello, > > I just ran across The Eddie Mission. It promises much of great potential value but appears to be dead as a dodo. According to https://sourceforge.net/projects/eddie/, the last update was in March 2013. That's not "undergoing rapid development", but it's not quite "dead as a dodo" either. Did the e-mail address for any of the core maintainers work? From jinni.park@REDACTED Mon Aug 22 10:35:29 2016 From: jinni.park@REDACTED (Park, Sungjin) Date: Mon, 22 Aug 2016 17:35:29 +0900 Subject: [erlang-questions] Strange performance degradation in dict when it's storing lists Message-ID: I observed a strange performance degradation in dict. Let me share the code I used in the test first. -module(data). -export([start_link/1, get/1, get_concurrent/1]). -export([init/0]). start_link() -> proc_lib:start_link(?MODULE, init, []). init() -> register(?MODULE, self()), % Initialize data: % 0 => [], % 1 => [1], % 2 => [1,2] % ... Dict = lists:foldl( fun (Key, Dict0) -> dict:store(Key, value(Key), Dict0) end, dict:new(), lists:seq(0, 255) ), proc_lib:init_ack({ok, self()}), loop(Dict). value(Key) -> lists:seq(1, Key). loop(Dict) -> receive {get, Key, From} -> case dict:find(Key, Dict) of {ok, Value} -> From ! Value; error -> From ! undefined end; _ -> ok end, loop(Dict). get(Key) -> ?MODULE ! {get, Key, self()}, receive Value -> Value end. %% Run get N times and return average execution time. -spec get_concurrent(integer()) -> number(). get_concurrent(N) -> Profiler = self(), Workers = [ prof_lib:spawn_link( fun () -> Key = erlang:system_time() rem 255, Result = timer:tc(?MODULE, get, [Key]), Profiler ! {self(), Result} end ) || _ <- lists:seq(1, N) ], Ts = receive_all(Workers, []), lists:sum(Ts) / length(Ts). receive_all([], Ts) -> Ts; receive_all(Workers, Ts) -> receive {Worker, {T, _}} -> receive_all(lists:delete(Worker, Workers), [T | Ts]) end. When I ran the test in the shell, I got. 1> data:start_link(). {ok, <0.6497.46>} 2> timer:tc(data, get, [5]). {23,[1,2,3,4,5]} I could get a value in 23 microseconds and expected something not too slower results for concurrent get but, 3> data:get_concurrent(100000). 19442.828 The value 19442.828 microseconds seemed to be too big a value so I tested with different values such as large binaries and tuples. And this time the same get_concurrent(100000) gave me 200 something microseconds. I also tried the same with an ets instead of a dict, but there was no such performance degradation by the value type. -- Park, Sungjin ------------------------------------------------------------------------------------------------------------------- Peculiar travel suggestions are dancing lessons from god. -- The Books of Bokonon ------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker.eriksson@REDACTED Mon Aug 22 15:53:45 2016 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Mon, 22 Aug 2016 15:53:45 +0200 Subject: [erlang-questions] Strange performance degradation in dict when it's storing lists In-Reply-To: References: Message-ID: Looks like you measure the latency of send + dict:find + receive that sometimes happens to get preemted by very heavy calls to lists:delete. /Sverker On 08/22/2016 10:35 AM, Park, Sungjin wrote: > I observed a strange performance degradation in dict. Let me share the > code I used in the test first. > > > -module(data). > -export([start_link/1, get/1, get_concurrent/1]). > -export([init/0]). > > start_link() -> > proc_lib:start_link(?MODULE, init, []). > > init() -> > register(?MODULE, self()), > % Initialize data: > % 0 => [], > % 1 => [1], > % 2 => [1,2] > % ... > Dict = lists:foldl( > fun (Key, Dict0) -> dict:store(Key, value(Key), Dict0) end, > dict:new(), lists:seq(0, 255) > ), > proc_lib:init_ack({ok, self()}), > loop(Dict). > > value(Key) -> > lists:seq(1, Key). > > loop(Dict) -> > receive > {get, Key, From} -> > case dict:find(Key, Dict) of > {ok, Value} -> From ! Value; > error -> From ! undefined > end; > _ -> > ok > end, > loop(Dict). > > get(Key) -> > ?MODULE ! {get, Key, self()}, > receive > Value -> Value > end. > > %% Run get N times and return average execution time. > -spec get_concurrent(integer()) -> number(). > get_concurrent(N) -> > Profiler = self(), > Workers = [ > prof_lib:spawn_link( > fun () -> > Key = erlang:system_time() rem 255, > Result = timer:tc(?MODULE, get, [Key]), > Profiler ! {self(), Result} > end > ) || _ <- lists:seq(1, N) > ], > Ts = receive_all(Workers, []), > lists:sum(Ts) / length(Ts). > > receive_all([], Ts) -> > Ts; > receive_all(Workers, Ts) -> > receive > {Worker, {T, _}} -> receive_all(lists:delete(Worker, Workers), [T | > Ts]) > end. > > > When I ran the test in the shell, I got. > > 1> data:start_link(). > {ok, <0.6497.46>} > 2> timer:tc(data, get, [5]). > {23,[1,2,3,4,5]} > > > I could get a value in 23 microseconds and expected something not too > slower results for concurrent get but, > > 3> data:get_concurrent(100000). > 19442.828 > > > The value 19442.828 microseconds seemed to be too big a value so I tested > with different values such as large binaries and tuples. And this time the > same get_concurrent(100000) gave me 200 something microseconds. > > I also tried the same with an ets instead of a dict, but there was no such > performance degradation by the value type. > > > > _______________________________________________ > 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 Mon Aug 22 18:14:13 2016 From: lloyd@REDACTED (lloyd@REDACTED) Date: Mon, 22 Aug 2016 12:14:13 -0400 (EDT) Subject: [erlang-questions] =?utf-8?q?Erlang_Eddie_--_son_of=3F?= In-Reply-To: References: <9B153944-9E75-4526-BD1B-40A2EA364E6A@writersglen.com> Message-ID: <1471882453.481320522@apps.rackspace.com> Thanks for your reply, Richard. I somehow missed the 2013 date. The last date I saw was in 2000 plus an erlang-questions post regarding problems with install due to "bit rot." I didn't think to contact core maintainers. Somehow I feel like I'm imposting when I post directly to someone I don't know. But I suppose I should get over that. So, I will do that now. Thanks again, Lloyd -----Original Message----- From: "Richard A. O'Keefe" Sent: Sunday, August 21, 2016 11:37pm To: erlang-questions@REDACTED Subject: Re: [erlang-questions] Erlang Eddie -- son of? On 22/08/16 3:23 PM, Lloyd R. Prentice wrote: > Hello, > > I just ran across The Eddie Mission. It promises much of great potential value but appears to be dead as a dodo. According to https://sourceforge.net/projects/eddie/, the last update was in March 2013. That's not "undergoing rapid development", but it's not quite "dead as a dodo" either. Did the e-mail address for any of the core maintainers work? _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions From donpedrothird@REDACTED Mon Aug 22 18:47:39 2016 From: donpedrothird@REDACTED (John Doe) Date: Mon, 22 Aug 2016 19:47:39 +0300 Subject: [erlang-questions] Mnesia table transformation and table indexes In-Reply-To: References: Message-ID: Yes they need to be recreated, as they are bound to field index. Though likely some hack exists which allows changing the index of the field of the index in the schema. 2016-08-20 20:15 GMT+03:00 Theepan : > Hi Team, > > This sounds obvious, but wanted to confirm. > > If an Mnesia table is transformed with a new field, do the indexes of the > following fields have to be deleted and recreated? > > Thanks, > Theepan > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ola.a.andersson@REDACTED Mon Aug 22 21:32:07 2016 From: ola.a.andersson@REDACTED (Ola Andersson A) Date: Mon, 22 Aug 2016 19:32:07 +0000 Subject: [erlang-questions] Erlang Eddie -- son of? In-Reply-To: <1471882453.481320522@apps.rackspace.com> References: <9B153944-9E75-4526-BD1B-40A2EA364E6A@writersglen.com> <1471882453.481320522@apps.rackspace.com> Message-ID: If I'm not mistaken the Eddie project was originally developed internally at Ericsson and formed the embryo of what later became the BlueTail solution. I remember that I watched a demo of Eddie at the EUC in -98(?). Somehow Ericsson released Eddie as open source with the rest of Erlang/OTP, I guess. At EUC -99 H?kan Millroth of BlueTail presented a Mail Robustifier Product based on Erlang/OTP. http://www.erlang.se/euc/99/ There are several highly active people on this list who knows a lot more than me about this subject though. /OLA. > -----Original Message----- > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions- > bounces@REDACTED] On Behalf Of lloyd@REDACTED > Sent: den 22 augusti 2016 18:14 > To: Richard A. O'Keefe > Cc: erlang-questions@REDACTED > Subject: Re: [erlang-questions] Erlang Eddie -- son of? > > Thanks for your reply, Richard. > > I somehow missed the 2013 date. The last date I saw was in 2000 plus an > erlang-questions post regarding problems with install due to "bit rot." > > I didn't think to contact core maintainers. Somehow I feel like I'm imposting > when I post directly to someone I don't know. But I suppose I should get > over that. So, I will do that now. > > Thanks again, > > Lloyd > > -----Original Message----- > From: "Richard A. O'Keefe" > Sent: Sunday, August 21, 2016 11:37pm > To: erlang-questions@REDACTED > Subject: Re: [erlang-questions] Erlang Eddie -- son of? > > > > On 22/08/16 3:23 PM, Lloyd R. Prentice wrote: > > Hello, > > > > I just ran across The Eddie Mission. It promises much of great potential > value but appears to be dead as a dodo. > > According to https://sourceforge.net/projects/eddie/, > the last update was in March 2013. > That's not "undergoing rapid development", but it's not quite "dead as a > dodo" either. > > Did the e-mail address for any of the core maintainers work? > > _______________________________________________ > 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 inanun@REDACTED Mon Aug 22 22:01:30 2016 From: inanun@REDACTED (Kyungho Yun) Date: Tue, 23 Aug 2016 05:01:30 +0900 Subject: [erlang-questions] Strange performance degradation in dict when it's storing lists In-Reply-To: References: Message-ID: Hi there. The various size of return values could be confusable. So I tested original source and some modified source; value() -> lists:seq(0,255), though I couldn't get such a big value in OTP 19. But I guess GC might be the cause. and the reference of binary may use for messaging in same node. On Mon, Aug 22, 2016 at 10:53 PM, Sverker Eriksson < sverker.eriksson@REDACTED> wrote: > Looks like you measure the latency of send + dict:find + receive > that sometimes happens to get preemted by very heavy calls > to lists:delete. > > /Sverker > > > > On 08/22/2016 10:35 AM, Park, Sungjin wrote: > > I observed a strange performance degradation in dict. Let me share the > code I used in the test first. > > > -module(data). > -export([start_link/1, get/1, get_concurrent/1]). > -export([init/0]). > > start_link() -> > proc_lib:start_link(?MODULE, init, []). > > init() -> > register(?MODULE, self()), > % Initialize data: > % 0 => [], > % 1 => [1], > % 2 => [1,2] > % ... > Dict = lists:foldl( > fun (Key, Dict0) -> dict:store(Key, value(Key), Dict0) end, > dict:new(), lists:seq(0, 255) > ), > proc_lib:init_ack({ok, self()}), > loop(Dict). > > value(Key) -> > lists:seq(1, Key). > > loop(Dict) -> > receive > {get, Key, From} -> > case dict:find(Key, Dict) of > {ok, Value} -> From ! Value; > error -> From ! undefined > end; > _ -> > ok > end, > loop(Dict). > > get(Key) -> > ?MODULE ! {get, Key, self()}, > receive > Value -> Value > end. > > %% Run get N times and return average execution time. > -spec get_concurrent(integer()) -> number(). > get_concurrent(N) -> > Profiler = self(), > Workers = [ > prof_lib:spawn_link( > fun () -> > Key = erlang:system_time() rem 255, > Result = timer:tc(?MODULE, get, [Key]), > Profiler ! {self(), Result} > end > ) || _ <- lists:seq(1, N) > ], > Ts = receive_all(Workers, []), > lists:sum(Ts) / length(Ts). > > receive_all([], Ts) -> > Ts; > receive_all(Workers, Ts) -> > receive > {Worker, {T, _}} -> receive_all(lists:delete(Worker, Workers), [T | > Ts]) > end. > > > When I ran the test in the shell, I got. > > 1> data:start_link(). > {ok, <0.6497.46>} > 2> timer:tc(data, get, [5]). > {23,[1,2,3,4,5]} > > > I could get a value in 23 microseconds and expected something not too > slower results for concurrent get but, > > 3> data:get_concurrent(100000). > 19442.828 > > > The value 19442.828 microseconds seemed to be too big a value so I tested > with different values such as large binaries and tuples. And this time the > same get_concurrent(100000) gave me 200 something microseconds. > > I also tried the same with an ets instead of a dict, but there was no such > performance degradation by the value type. > > > > > _______________________________________________ > 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 lloyd@REDACTED Mon Aug 22 23:03:24 2016 From: lloyd@REDACTED (lloyd@REDACTED) Date: Mon, 22 Aug 2016 17:03:24 -0400 (EDT) Subject: [erlang-questions] =?utf-8?q?Erlang_Eddie_--_son_of=3F?= In-Reply-To: References: <9B153944-9E75-4526-BD1B-40A2EA364E6A@writersglen.com> <1471882453.481320522@apps.rackspace.com> Message-ID: <1471899804.71748490@apps.rackspace.com> Hi Ola, Thanks for the clue! Given my quick dive into the web, BlueTail has an interesting history. No doubt there is an even more fascinating story behind the web posts: Ericcson -- 1999 A group from the CS-lab then started Bluetail Ab with Jane as CEO, and sold it 18 months later for 150MUSD -> (Last Sourceforge modification of Eddie: December 15, 2000 under Erlang Public License -- EPL)) (May 28, 2000) BlueTail Ab sold to Alteon WebSystems Inc. for About $152 Million -> (October 4, 2000) Alteon Websystems sold to Nortel Networks for $7.8 billion in stock-> (February 22, 2009) Nortel Networks sold the Alteon application switching line to Radware $17.7 million Making Money from Erlang http://armstrongonsoftware.blogspot.com/2006/08/making-money-from-erlang.html Joe Armstrong http://ndcoslo.com/speaker/joe-armstrong/ The Strange Story of Erlang's Success http://community.embarcadero.com/blogs/entry/the-strange-story-of-erlangs-success-37887 So, now, I wonder what happened to Eddie in all this. It was released under an Open Source license which suggests that it can be forked and dusted off. Please excuse my naivete, but this seems like a great software contribution that deserves loving care. All the best, LRP -----Original Message----- From: "Ola Andersson A" Sent: Monday, August 22, 2016 3:32pm To: "erlang-questions@REDACTED" Cc: "lloyd@REDACTED" Subject: RE: [erlang-questions] Erlang Eddie -- son of? If I'm not mistaken the Eddie project was originally developed internally at Ericsson and formed the embryo of what later became the BlueTail solution. I remember that I watched a demo of Eddie at the EUC in -98(?). Somehow Ericsson released Eddie as open source with the rest of Erlang/OTP, I guess. At EUC -99 H?kan Millroth of BlueTail presented a Mail Robustifier Product based on Erlang/OTP. http://www.erlang.se/euc/99/ There are several highly active people on this list who knows a lot more than me about this subject though. /OLA. > -----Original Message----- > From: erlang-questions-bounces@REDACTED [mailto:erlang-questions- > bounces@REDACTED] On Behalf Of lloyd@REDACTED > Sent: den 22 augusti 2016 18:14 > To: Richard A. O'Keefe > Cc: erlang-questions@REDACTED > Subject: Re: [erlang-questions] Erlang Eddie -- son of? > > Thanks for your reply, Richard. > > I somehow missed the 2013 date. The last date I saw was in 2000 plus an > erlang-questions post regarding problems with install due to "bit rot." > > I didn't think to contact core maintainers. Somehow I feel like I'm imposting > when I post directly to someone I don't know. But I suppose I should get > over that. So, I will do that now. > > Thanks again, > > Lloyd > > -----Original Message----- > From: "Richard A. O'Keefe" > Sent: Sunday, August 21, 2016 11:37pm > To: erlang-questions@REDACTED > Subject: Re: [erlang-questions] Erlang Eddie -- son of? > > > > On 22/08/16 3:23 PM, Lloyd R. Prentice wrote: > > Hello, > > > > I just ran across The Eddie Mission. It promises much of great potential > value but appears to be dead as a dodo. > > According to https://sourceforge.net/projects/eddie/, > the last update was in March 2013. > That's not "undergoing rapid development", but it's not quite "dead as a > dodo" either. > > Did the e-mail address for any of the core maintainers work? > > _______________________________________________ > 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 jinni.park@REDACTED Tue Aug 23 03:24:19 2016 From: jinni.park@REDACTED (Park, Sungjin) Date: Tue, 23 Aug 2016 10:24:19 +0900 Subject: [erlang-questions] Strange performance degradation in dict when it's storing lists In-Reply-To: References: Message-ID: @Sverker, you are right. Still I'm curious what makes the big difference. There was no such big difference when the values were tuples rather than lists. The extra overhead you mentioned must be the same for both. @Kyungho, I tested in otp-18. Can there possibly be any VM change related with this? On Tue, Aug 23, 2016 at 5:01 AM, Kyungho Yun wrote: > Hi there. > > The various size of return values could be confusable. > So I tested original source and some modified source; value() -> > lists:seq(0,255), > though I couldn't get such a big value in OTP 19. > > But I guess GC might be the cause. > > and the reference of binary may use for messaging in same node. > > > > On Mon, Aug 22, 2016 at 10:53 PM, Sverker Eriksson < > sverker.eriksson@REDACTED> wrote: > >> Looks like you measure the latency of send + dict:find + receive >> that sometimes happens to get preemted by very heavy calls >> to lists:delete. >> >> /Sverker >> >> >> >> On 08/22/2016 10:35 AM, Park, Sungjin wrote: >> >> I observed a strange performance degradation in dict. Let me share the >> code I used in the test first. >> >> >> -module(data). >> -export([start_link/1, get/1, get_concurrent/1]). >> -export([init/0]). >> >> start_link() -> >> proc_lib:start_link(?MODULE, init, []). >> >> init() -> >> register(?MODULE, self()), >> % Initialize data: >> % 0 => [], >> % 1 => [1], >> % 2 => [1,2] >> % ... >> Dict = lists:foldl( >> fun (Key, Dict0) -> dict:store(Key, value(Key), Dict0) end, >> dict:new(), lists:seq(0, 255) >> ), >> proc_lib:init_ack({ok, self()}), >> loop(Dict). >> >> value(Key) -> >> lists:seq(1, Key). >> >> loop(Dict) -> >> receive >> {get, Key, From} -> >> case dict:find(Key, Dict) of >> {ok, Value} -> From ! Value; >> error -> From ! undefined >> end; >> _ -> >> ok >> end, >> loop(Dict). >> >> get(Key) -> >> ?MODULE ! {get, Key, self()}, >> receive >> Value -> Value >> end. >> >> %% Run get N times and return average execution time. >> -spec get_concurrent(integer()) -> number(). >> get_concurrent(N) -> >> Profiler = self(), >> Workers = [ >> prof_lib:spawn_link( >> fun () -> >> Key = erlang:system_time() rem 255, >> Result = timer:tc(?MODULE, get, [Key]), >> Profiler ! {self(), Result} >> end >> ) || _ <- lists:seq(1, N) >> ], >> Ts = receive_all(Workers, []), >> lists:sum(Ts) / length(Ts). >> >> receive_all([], Ts) -> >> Ts; >> receive_all(Workers, Ts) -> >> receive >> {Worker, {T, _}} -> receive_all(lists:delete(Worker, Workers), [T | >> Ts]) >> end. >> >> >> When I ran the test in the shell, I got. >> >> 1> data:start_link(). >> {ok, <0.6497.46>} >> 2> timer:tc(data, get, [5]). >> {23,[1,2,3,4,5]} >> >> >> I could get a value in 23 microseconds and expected something not too >> slower results for concurrent get but, >> >> 3> data:get_concurrent(100000). >> 19442.828 >> >> >> The value 19442.828 microseconds seemed to be too big a value so I tested >> with different values such as large binaries and tuples. And this time the >> same get_concurrent(100000) gave me 200 something microseconds. >> >> I also tried the same with an ets instead of a dict, but there was no such >> performance degradation by the value type. >> >> >> >> >> _______________________________________________ >> 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 >> >> > -- Park, Sungjin ------------------------------------------------------------------------------------------------------------------- Peculiar travel suggestions are dancing lessons from god. -- The Books of Bokonon ------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From jinni.park@REDACTED Tue Aug 23 03:25:28 2016 From: jinni.park@REDACTED (Park, Sungjin) Date: Tue, 23 Aug 2016 10:25:28 +0900 Subject: [erlang-questions] Strange performance degradation in dict when it's storing lists In-Reply-To: References: Message-ID: @Kyungho, could you please let me know how you changed the source? On Tue, Aug 23, 2016 at 10:24 AM, Park, Sungjin wrote: > @Sverker, you are right. Still I'm curious what makes the big > difference. There was no such big difference when the values were tuples > rather than lists. The extra overhead you mentioned must be the same for > both. > > @Kyungho, I tested in otp-18. Can there possibly be any VM change related > with this? > > > > On Tue, Aug 23, 2016 at 5:01 AM, Kyungho Yun wrote: > >> Hi there. >> >> The various size of return values could be confusable. >> So I tested original source and some modified source; value() -> >> lists:seq(0,255), >> though I couldn't get such a big value in OTP 19. >> >> But I guess GC might be the cause. >> >> and the reference of binary may use for messaging in same node. >> >> >> >> On Mon, Aug 22, 2016 at 10:53 PM, Sverker Eriksson < >> sverker.eriksson@REDACTED> wrote: >> >>> Looks like you measure the latency of send + dict:find + receive >>> that sometimes happens to get preemted by very heavy calls >>> to lists:delete. >>> >>> /Sverker >>> >>> >>> >>> On 08/22/2016 10:35 AM, Park, Sungjin wrote: >>> >>> I observed a strange performance degradation in dict. Let me share the >>> code I used in the test first. >>> >>> >>> -module(data). >>> -export([start_link/1, get/1, get_concurrent/1]). >>> -export([init/0]). >>> >>> start_link() -> >>> proc_lib:start_link(?MODULE, init, []). >>> >>> init() -> >>> register(?MODULE, self()), >>> % Initialize data: >>> % 0 => [], >>> % 1 => [1], >>> % 2 => [1,2] >>> % ... >>> Dict = lists:foldl( >>> fun (Key, Dict0) -> dict:store(Key, value(Key), Dict0) end, >>> dict:new(), lists:seq(0, 255) >>> ), >>> proc_lib:init_ack({ok, self()}), >>> loop(Dict). >>> >>> value(Key) -> >>> lists:seq(1, Key). >>> >>> loop(Dict) -> >>> receive >>> {get, Key, From} -> >>> case dict:find(Key, Dict) of >>> {ok, Value} -> From ! Value; >>> error -> From ! undefined >>> end; >>> _ -> >>> ok >>> end, >>> loop(Dict). >>> >>> get(Key) -> >>> ?MODULE ! {get, Key, self()}, >>> receive >>> Value -> Value >>> end. >>> >>> %% Run get N times and return average execution time. >>> -spec get_concurrent(integer()) -> number(). >>> get_concurrent(N) -> >>> Profiler = self(), >>> Workers = [ >>> prof_lib:spawn_link( >>> fun () -> >>> Key = erlang:system_time() rem 255, >>> Result = timer:tc(?MODULE, get, [Key]), >>> Profiler ! {self(), Result} >>> end >>> ) || _ <- lists:seq(1, N) >>> ], >>> Ts = receive_all(Workers, []), >>> lists:sum(Ts) / length(Ts). >>> >>> receive_all([], Ts) -> >>> Ts; >>> receive_all(Workers, Ts) -> >>> receive >>> {Worker, {T, _}} -> receive_all(lists:delete(Worker, Workers), [T | >>> Ts]) >>> end. >>> >>> >>> When I ran the test in the shell, I got. >>> >>> 1> data:start_link(). >>> {ok, <0.6497.46>} >>> 2> timer:tc(data, get, [5]). >>> {23,[1,2,3,4,5]} >>> >>> >>> I could get a value in 23 microseconds and expected something not too >>> slower results for concurrent get but, >>> >>> 3> data:get_concurrent(100000). >>> 19442.828 >>> >>> >>> The value 19442.828 microseconds seemed to be too big a value so I tested >>> with different values such as large binaries and tuples. And this time the >>> same get_concurrent(100000) gave me 200 something microseconds. >>> >>> I also tried the same with an ets instead of a dict, but there was no such >>> performance degradation by the value type. >>> >>> >>> >>> >>> _______________________________________________ >>> 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 >>> >>> >> > > > -- > Park, Sungjin > ------------------------------------------------------------ > ------------------------------------------------------- > Peculiar travel suggestions are dancing lessons from god. > -- The Books of Bokonon > ------------------------------------------------------------ > ------------------------------------------------------- > -- Park, Sungjin ------------------------------------------------------------------------------------------------------------------- Peculiar travel suggestions are dancing lessons from god. -- The Books of Bokonon ------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Wed Aug 24 15:16:24 2016 From: matthias@REDACTED (Matthias Lang) Date: Wed, 24 Aug 2016 15:16:24 +0200 Subject: [erlang-questions] Erlang Eddie -- son of? In-Reply-To: References: <9B153944-9E75-4526-BD1B-40A2EA364E6A@writersglen.com> Message-ID: <20160824131624.37lc4fjs6z7myfmc@corelatus.se> On 22. August 2016, Richard A. O'Keefe wrote: > > I just ran across The Eddie Mission. It promises much of great potential value but appears to be dead as a dodo. > > According to https://sourceforge.net/projects/eddie/, > the last update was in March 2013. > That's not "undergoing rapid development", but it's not > quite "dead as a dodo" either. The Wikipedia page about Elvis Presley says it was last updated a week ago, so if that's good enough to claim "not dead", then, well, you're not alone. All the evidence points to Eddie being dead: - The most recent release of eddie on sourceforge is from 15 years ago - The bug tracker has two bugs in total. Neither of which are recent. - The patch tracker has two trivial patches in total. From 2007. - Nothing's been committed to CVS for more than a decade. - One of the most recent CVS commit logs talks about Erlang R9B-1. Matt From arshadansari27@REDACTED Thu Aug 25 15:01:03 2016 From: arshadansari27@REDACTED (Arshad Ansari) Date: Thu, 25 Aug 2016 13:01:03 +0000 Subject: [erlang-questions] How to manage C ports that are suppose to handle a very high number of requests Message-ID: Hello there, I had earlier asked about how to access LuaJIT from erlang [ http://erlang.org/pipermail/erlang-questions/2016-August/089939.html ] and based on the responses, I decided to go with C port. It was working all great. Except, when I tried to call the same C-Port [luajit] code from erlang-diameter server. Since the requests were high, but not very high (approx 10K per second), the code fails with stack overflow on c side. Now I thought, I would create a seperate C port for each requests but that would mean there will be around 10K c-port processes. I'm now wondering how to handle this size of requests from the c port. Any help or direction is appreciated. Please let me know if my question is not clear. I'm attaching the code to access lua that works with single instance of c-port process. Regards Arshad /************ CODE Details *********************/ erl_com.c contains code to send/receive data from c side port.c runs the lua code and has main script.lua relay.erl starts the relay server and c port to talk to lua relay_cb.erl handles requests and communicates with lua -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: script.lua Type: text/x-lua Size: 147 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: relay.erl Type: text/x-erlang Size: 3587 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: relay_cb.erl Type: text/x-erlang Size: 3436 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: node.erl Type: text/x-erlang Size: 5422 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: port.c Type: text/x-csrc Size: 999 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: erl_comm.c Type: text/x-csrc Size: 743 bytes Desc: not available URL: From taavi@REDACTED Thu Aug 25 17:05:43 2016 From: taavi@REDACTED (Taavi Talvik) Date: Thu, 25 Aug 2016 18:05:43 +0300 Subject: [erlang-questions] How to manage C ports that are suppose to handle a very high number of requests In-Reply-To: References: Message-ID: <0708B780-D054-45CC-BEA0-C162DB25637A@uninet.ee> Maybe something like poolboy is useful for you: https://github.com/devinus/poolboy best regards, taavi > On 25 Aug 2016, at 16:01, Arshad Ansari wrote: > > Hello there, > > I had earlier asked about how to access LuaJIT from erlang [http://erlang.org/pipermail/erlang-questions/2016-August/089939.html] and based on the responses, I decided to go with C port. It was working all great. Except, when I tried to call the same C-Port [luajit] code from erlang-diameter server. Since the requests were high, but not very high (approx 10K per second), the code fails with stack overflow on c side. > > Now I thought, I would create a seperate C port for each requests but that would mean there will be around 10K c-port processes. I'm now wondering how to handle this size of requests from the c port. Any help or direction is appreciated. Please let me know if my question is not clear. I'm attaching the code to access lua that works with single instance of c-port process. > > Regards > Arshad > > /************ CODE Details *********************/ > > erl_com.c contains code to send/receive data from c side > port.c runs the lua code and has main > script.lua > relay.erl starts the relay server and c port to talk to lua > relay_cb.erl handles requests and communicates with lua > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From mjtruog@REDACTED Thu Aug 25 18:59:05 2016 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 25 Aug 2016 09:59:05 -0700 Subject: [erlang-questions] How to manage C ports that are suppose to handle a very high number of requests In-Reply-To: References: Message-ID: <57BF23D9.9080305@gmail.com> On 08/25/2016 06:01 AM, Arshad Ansari wrote: > Hello there, > > I had earlier asked about how to access LuaJIT from erlang [http://erlang.org/pipermail/erlang-questions/2016-August/089939.html ] and based on the responses, I decided to go with C port. It was working all great. Except, when I tried to call the same C-Port [luajit] code from erlang-diameter server. Since the requests were high, but not very high (approx 10K per second), the code fails with stack overflow on c side. > > Now I thought, I would create a seperate C port for each requests but that would mean there will be around 10K c-port processes. I'm now wondering how to handle this size of requests from the c port. Any help or direction is appreciated. Please let me know if my question is not clear. I'm attaching the code to access lua that works with single instance of c-port process. > You can use CloudI (http://cloudi.org) to handle more throughput with the Lua code using minimal latency. A Lua CloudI API doesn't currently exist but a basic SWIG file can create a Lua CloudI API based on the C CloudI API (using https://github.com/CloudI/CloudI/blob/develop/src/api/c/cloudi.i). However, keep in mind that any usage of an Erlang Port type is limited to roughly 30-55k req/s and this issue is not a high priority for the Erlang/OTP team (https://bugs.erlang.org/browse/ERL-140). For comparison, pure Erlang messaging can go beyond 100k req/s. Best Regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Thu Aug 25 23:47:02 2016 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Thu, 25 Aug 2016 23:47:02 +0200 Subject: [erlang-questions] Emulating phantom types maybe Message-ID: I've been wondering if I cannot tell Dialyzer that a function may only accept strings produced by a certain function, in a way emulating phantom types. While it's all a string, in such a function I expect a certain kind of string, say, lower-cased, to give a trivial example. I haven't figured out a way to encode that constraint. To be clear, the string value is just an example, and this isn't exclusively about strings. Basically, I want to subtype structurally-equivalent values. Why do I want this? I've run into a bug in the past, and this would have prevented it and also documented the code more clearly. >From what I understand, this isn't something that can be achieved with Dialyzer, or can it? So, here's a failed experiment trying to constrain need_lower/1 to accept only input of type lower/0. -type upper() :: string(). -type lower() :: string(). -spec lowercase(upper()) -> lower(). lowercase(U) -> string:to_lower(U). -spec need_lower(lower()) -> 'ok'. need_lower(_S) -> ok. %% Would be great if this wouldn't dialyze. wrong_type() -> need_lower("UPPERCASE"). From mjtruog@REDACTED Fri Aug 26 00:19:09 2016 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 25 Aug 2016 15:19:09 -0700 Subject: [erlang-questions] Emulating phantom types maybe In-Reply-To: References: Message-ID: <57BF6EDD.4010705@gmail.com> On 08/25/2016 02:47 PM, Tuncer Ayaz wrote: > I've been wondering if I cannot tell Dialyzer that a function may only > accept strings produced by a certain function, in a way emulating > phantom types. While it's all a string, in such a function I expect a > certain kind of string, say, lower-cased, to give a trivial example. I > haven't figured out a way to encode that constraint. To be clear, the > string value is just an example, and this isn't exclusively about > strings. > > Basically, I want to subtype structurally-equivalent values. > > Why do I want this? I've run into a bug in the past, and this would > have prevented it and also documented the code more clearly. > > >From what I understand, this isn't something that can be achieved with > Dialyzer, or can it? > > So, here's a failed experiment trying to constrain need_lower/1 to > accept only input of type lower/0. > > -type upper() :: string(). > -type lower() :: string(). -type ascii_lower() :: list(97..122). The potential values gets much more complex for unicode, but Erlang/OTP doesn't have unicode to_lower (it requires external dependencies like https://github.com/rambocoder/unistring). > > -spec lowercase(upper()) -> lower(). > lowercase(U) -> string:to_lower(U). > > -spec need_lower(lower()) -> 'ok'. > need_lower(_S) -> ok. > > %% Would be great if this wouldn't dialyze. > wrong_type() -> need_lower("UPPERCASE"). > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From tuncer.ayaz@REDACTED Fri Aug 26 00:32:02 2016 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 26 Aug 2016 00:32:02 +0200 Subject: [erlang-questions] Emulating phantom types maybe In-Reply-To: References: Message-ID: On 26/08/2016, Leandro Ostera wrote: > Couldn't this be achieved by specifically defining a list of characters > that are lowercased? > > -type lowercase_char() :: "a" | "b" | ... > -type lowercase_string() :: [ lowercase_char() ] If we limit it to the string example, yes, but as I wrote, this isn't about strings exclusively. So, let's ignore lower/upper and think of something like raw vs sanitized string, if we stay with strings, although there can be cases where you could specify that constraint as well. Therefore, let's not focus on strings. Sorry for the bad example. What I'm looking for is a universal way to subtype structurally-equivalent values to enforce that function needs_a/1 may only be fed input of type a/0 which may have been generated by make_a() or make_other_a(). From mjtruog@REDACTED Fri Aug 26 02:48:02 2016 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 25 Aug 2016 17:48:02 -0700 Subject: [erlang-questions] Emulating phantom types maybe In-Reply-To: References: Message-ID: <57BF91C2.50802@gmail.com> On 08/25/2016 03:32 PM, Tuncer Ayaz wrote: > On 26/08/2016, Leandro Ostera wrote: >> Couldn't this be achieved by specifically defining a list of characters >> that are lowercased? >> >> -type lowercase_char() :: "a" | "b" | ... >> -type lowercase_string() :: [ lowercase_char() ] > If we limit it to the string example, yes, but as I wrote, this > isn't about strings exclusively. > > So, let's ignore lower/upper and think of something like raw vs > sanitized string, if we stay with strings, although there can be > cases where you could specify that constraint as well. Therefore, > let's not focus on strings. Sorry for the bad example. > > What I'm looking for is a universal way to subtype > structurally-equivalent values to enforce that function needs_a/1 > may only be fed input of type a/0 which may have been generated > by make_a() or make_other_a(). > In your original email, you said "tell Dialyzer that a function may only accept strings produced by a certain function" which may be a simpler way of describing the problem, if I understand it properly. Since Erlang type specifications can only have either atoms or integers as constants (unless you consider composite type sizes of tuples and binaries (binaries with bitstring syntax)) it is likely you want to use a constant to say "this type is coming from this function". So, a simple type can be something like "{function_a, Type}" to make sure the type knows it is coming from function_a. From ok@REDACTED Fri Aug 26 03:21:15 2016 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 26 Aug 2016 13:21:15 +1200 Subject: [erlang-questions] Emulating phantom types maybe In-Reply-To: <57BF6EDD.4010705@gmail.com> References: <57BF6EDD.4010705@gmail.com> Message-ID: <61d4d406-1f79-5a17-c49a-ff84381fa609@cs.otago.ac.nz> Can I suggest taking a more fundamental view? The basic presupposition here is that we want to have values that are the same as some standard value but tagged in some way, rather like the way Ada could do type Upper_String is new String; which would create a completely distinct Upper_String type that is structurally isomorphic to String and inherits all its operations, but can't be *mixed* with String. I want to ask the question "IS a string that's all upper case REALLY a string?" In general, I don't think that's going to be true: the concatenation of two strings is a string, but the concatenation of two strings representing timestamps is not a string representing a timestamp; a substring of a string is a string, but a substring of a string representing a geographic location is a string representing a geographic location; the reversal of a string is a string, but the reversal of a string representing a British postcode is not a string representing a British postcode, and so on. I'm also thinking that Erlang is not a typeful language in the way that Haskell or even SML is, so that leaning hard on the type system might not be the best way to go. In short, I'm suggesting that something like {upper,String} or {lower,String} or whatever with a run-time check required to get at the underlying string would not only be something the type checker can help with but might be a Good Idea anyway. More generally, I note that C checkers like SPlint and Carillon let you devise your own annotations to extend the underlying type system. Long term, something like that might be nice for the Dialyzer, but there'll be a lot of other things more urgent. From tuncer.ayaz@REDACTED Fri Aug 26 03:39:20 2016 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 26 Aug 2016 03:39:20 +0200 Subject: [erlang-questions] Emulating phantom types maybe In-Reply-To: <57BF91C2.50802@gmail.com> References: <57BF91C2.50802@gmail.com> Message-ID: On 26/08/2016, Michael Truog wrote: > On 08/25/2016 03:32 PM, Tuncer Ayaz wrote: > > What I'm looking for is a universal way to subtype > > structurally-equivalent values to enforce that function needs_a/1 > > may only be fed input of type a/0 which may have been generated by > > make_a() or make_other_a(). > > In your original email, you said "tell Dialyzer that a function may > only accept strings produced by a certain function" which may be a > simpler way of describing the problem, if I understand it properly. > Since Erlang type specifications can only have either atoms or > integers as constants (unless you consider composite type sizes of > tuples and binaries (binaries with bitstring syntax)) it is likely > you want to use a constant to say "this type is coming from this > function". So, a simple type can be something like "{function_a, > Type}" to make sure the type knows it is coming from function_a. I've considered explicitly tagging it in a tuple, like {ok,Val}, {a,Val}, and this is the conventional Erlang way. However, the idea was that the values are structurally identical, and they're just the result of certain functions only. Thus, I was looking for a way to avoid the tuple, but maybe there is no way to express this in type specs, unless you maybe pass around fun objects to eval, which is a heavy weight solution. From tuncer.ayaz@REDACTED Fri Aug 26 04:03:32 2016 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 26 Aug 2016 04:03:32 +0200 Subject: [erlang-questions] Emulating phantom types maybe In-Reply-To: <61d4d406-1f79-5a17-c49a-ff84381fa609@cs.otago.ac.nz> References: <57BF6EDD.4010705@gmail.com> <61d4d406-1f79-5a17-c49a-ff84381fa609@cs.otago.ac.nz> Message-ID: On 26/08/2016, Richard A. O'Keefe wrote: > Can I suggest taking a more fundamental view? > > The basic presupposition here is that we want to have > values that are the same as some standard value but > tagged in some way, rather like the way Ada could do > > type Upper_String is new String; Right. > which would create a completely distinct Upper_String > type that is structurally isomorphic to String and > inherits all its operations, but can't be *mixed* with > String. > > I want to ask the question "IS a string that's all > upper case REALLY a string?" In general, I don't > think that's going to be true: the concatenation of > two strings is a string, but the concatenation of > two strings representing timestamps is not a string > representing a timestamp; a substring of a string is > a string, but a substring of a string representing a > geographic location is a string representing a > geographic location; the reversal of a string is a > string, but the reversal of a string representing a > British postcode is not a string representing a > British postcode, and so on. This is true, and I'm afraid my example was just bad, even though string is a typical example for phantom types. > I'm also thinking that Erlang is not a typeful language > in the way that Haskell or even SML is, so that leaning > hard on the type system might not be the best way to go. True. > In short, I'm suggesting that something like > {upper,String} or {lower,String} or whatever with a > run-time check required to get at the underlying string > would not only be something the type checker can help > with but might be a Good Idea anyway. Yeah, same conclusion in the reply to Michael. Another idea: Although it has considerably more overhead than a string() or a {'type',string()}, I thought it might be possible, and sometimes practical, to pass around fun objects, where the existing type specs should be able to express the constraint. In that scenario, the result wouldn't be a tuple or a list of characters, but a fun object that's meant to be evaluated to a string in the consumer. While this sounds like it would solve the issue, once you adopt such a style, your code base might gain enough such fun object generators that two of them will be similar enough and you'll again run into the same bug. > More generally, I note that C checkers like SPlint and > Carillon let you devise your own annotations to extend > the underlying type system. Long term, something like > that might be nice for the Dialyzer, but there'll be a > lot of other things more urgent. Anything in particular in Dialyzer that would be great to have sooner than later? From ok@REDACTED Fri Aug 26 07:03:41 2016 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 26 Aug 2016 17:03:41 +1200 Subject: [erlang-questions] Maze alternate example for Rosetta Code In-Reply-To: <56BDFAE9.6050500@vaxxine.com> References: <56BDFAE9.6050500@vaxxine.com> Message-ID: How large should Erlang code for the Rosetta "maze generation" task be? I don't know, but here's a data point. I did it in my Smalltalk. - roughly 90 lines - 12 lines of comments - 25 lines are devoted to generating the output, including terminal ESC sequences. - I used the algorithm described in the task page. - I wrote shamelessly compact code instead of well documented stuff. Maintainability shmaintainability. - I proudly avoided creating any objects other than one mutable 2D array of bytes. - It would have been better to copy the F# code. Sigh. Here's another data point: it's going to be hard to beat Haskell (67 lines). The J answer manages it because J is particularly expressive (if you can call it that...) with arrays, like its ancestor APL. Erlang is not. If you can write *maintainable* Erlang code for this problem in 120 lines, you deserve some sort of prize. (I do not call the Haskell answer particularly readable.) You could, of course, cheat a bit by copying the F# version and using the process dictionary to hold the maze. E.g., let removeWallBetween (x1,y1) (x2,y2) = if x1 <> x2 then horizWalls.[min x1 x2, y1] <- false else vertWalsl.[x1, min y1 y2] <- false => remove_wall_between(X, Y1, X, Y2) -> put({v,X,min(Y1,Y2)}, false); remove_wall_between(X1, Y, X2, Y) -> put({h,min(X1,X2),Y}, false). Not a thing I'd normally recommend, but if this is in its own process, you might get away with it. From daniel.abrahamsson@REDACTED Fri Aug 26 07:57:36 2016 From: daniel.abrahamsson@REDACTED (Daniel Abrahamsson) Date: Fri, 26 Aug 2016 07:57:36 +0200 Subject: [erlang-questions] Emulating phantom types maybe In-Reply-To: References: <57BF6EDD.4010705@gmail.com> <61d4d406-1f79-5a17-c49a-ff84381fa609@cs.otago.ac.nz> Message-ID: You can achieve something close to what you are after by using opaque types. Partly re-using your original example: -module(string_with_case). -opaque lowercase() :: string(). -opaque uppercase() :: string(). -type anycase() :: lowercase() | uppercase() | string(). -export_type([ lowercase/0 , uppercase/0 ]). -export([ uppercase/1 , lowercase/1 , need_lower/1 , concat/2 ]). -spec lowercase(anycase()) -> lowercase(). lowercase(Str) -> string:to_lower(Str). -spec uppercase(anycase()) -> uppercase(). uppercase(Str) -> string:to_upper(Str). -spec need_lower(lowercase()) -> ok. need_lower(_Lower) -> ok. -spec concat(anycase(), anycase()) -> string(). concat(A, B) -> A ++ B. Note that these two (maybe in your eyes valid) examples will NOT pass dialyzer: string_with_case:need_lower("example"). % FAILS: Breaks opaqueness of string_with_case:lowercase(). string_with_case:lowercase("test") ++ "mixing". % FAILS: Breaks opaqueness of string_with_case:lowercase(). In other words, all operations involving types uppercase() or lowercase() must take place inside the string_with_case module. If you need to operate on a lowercase() as if it were a string outside the string_with_case module, you must provide a to_string function: -spec to_string(anycase()) -> string(). to_string(X) -> X. This of course means you would have to call the lowercase/1 or uppercase/1 functions again to convert it back, should you need to use the "variant/sort specific" functions of string_with_case on the result. This is however necessary to maintain the guarantees you are trying to achieve. //Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Fri Aug 26 09:51:19 2016 From: mjtruog@REDACTED (Michael Truog) Date: Fri, 26 Aug 2016 00:51:19 -0700 Subject: [erlang-questions] Emulating phantom types maybe In-Reply-To: References: <57BF6EDD.4010705@gmail.com> <61d4d406-1f79-5a17-c49a-ff84381fa609@cs.otago.ac.nz> Message-ID: <57BFF4F7.5010000@gmail.com> On 08/25/2016 10:57 PM, Daniel Abrahamsson wrote: > You can achieve something close to what you are after by using opaque types. Partly re-using your original example: > > -module(string_with_case). > > -opaque lowercase() :: string(). > -opaque uppercase() :: string(). > -type anycase() :: lowercase() | uppercase() | string(). > > -export_type([ lowercase/0 > , uppercase/0 > ]). > > -export([ uppercase/1 > , lowercase/1 > , need_lower/1 > , concat/2 > ]). > > -spec lowercase(anycase()) -> lowercase(). > lowercase(Str) -> string:to_lower(Str). > > -spec uppercase(anycase()) -> uppercase(). > uppercase(Str) -> string:to_upper(Str). > > -spec need_lower(lowercase()) -> ok. > need_lower(_Lower) -> ok. > > -spec concat(anycase(), anycase()) -> string(). > concat(A, B) -> A ++ B. > > > Note that these two (maybe in your eyes valid) examples will NOT pass dialyzer: > > string_with_case:need_lower("example"). % FAILS: Breaks opaqueness of string_with_case:lowercase(). > > string_with_case:lowercase("test") ++ "mixing". % FAILS: Breaks opaqueness of string_with_case:lowercase(). > > In other words, all operations involving types uppercase() or lowercase() must take place inside the string_with_case module. > If you need to operate on a lowercase() as if it were a string outside the string_with_case module, you must provide a to_string function: > > -spec to_string(anycase()) -> string(). > to_string(X) -> X. > > This of course means you would have to call the lowercase/1 or uppercase/1 functions again to convert it back, should you need to > use the "variant/sort specific" functions of string_with_case on the result. This is however necessary to maintain the guarantees you are trying to achieve. > > //Daniel > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions This approach works in a closed-system that only relies on the opaque types. If the opaque types are not always used as opaque types, i.e., in a way that depends on it being a list of integers, then that will just generate dialyzer errors. Also, the fact remains that it does not actually check the contents of the list, so this approach depends on the developer always using the opaque types in the proper way (i.e., it isn't as if development errors with the opaque types will be easily caught based on the contents of the list of integers). Since software is normally not developed in complete isolation, requiring complete isolation for a solution is not helpful for any system that might want to grow in the future. -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlsson.richard@REDACTED Fri Aug 26 14:55:18 2016 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Fri, 26 Aug 2016 14:55:18 +0200 Subject: [erlang-questions] Maze alternate example for Rosetta Code In-Reply-To: References: <56BDFAE9.6050500@vaxxine.com> Message-ID: Couldn't resist - last time I did one of these was using Sinclair Basic in 1985. Aiming for compact rather than maintainable, I get the following (36 lines); however, making it pretty would only add maybe a dozen lines: %%% @author Richard Carlsson %%% @copyright (C) 2016, Richard Carlsson -module(maze). -export([print/2, build/2]). print(W, H) -> M = build(W, H), io:put_chars([[[array:get(R*(W*2+1)+C, M) || C <- lists:seq(0,W*2)], $\n] || R <- lists:seq(0,H*2)]). build(W, H) when is_integer(W), is_integer(H), W > 0, H > 0 -> M = array:new((W*2+1)*(H*2+1), {default,$X}), build(rand:uniform(W)*2-1, rand:uniform(H)*2-1, (W*2+1), (H*2+1), M). build(X, Y, W, H, M) -> move([D || {_,D} <- lists:sort(lists:zip([rand:uniform() || _<-"...."], [{0,-2},{0,2},{2,0},{-2,0}]))], X, Y, W, H, array:set(Y*W+X, $\s, M)). move([{Dx,Dy}|Ds], X, Y, W, H, M) -> X1 = X + Dx, Y1 = Y + Dy, move(Ds, X, Y, W, H, if X1 > 0, X1 < W, Y1 > 0, Y1 < H -> case array:get(Y1*W+X1, M) of $\s -> M; _ -> build(X1, Y1, W, H, array:set(((Y+Y1) div 2)*W + (X+X1) div 2, $\s, M)) end; true -> M end); move([], _X, _Y, _W, _H, M) -> M. /Richard 2016-08-26 7:03 GMT+02:00 Richard A. O'Keefe : > How large should Erlang code for the Rosetta "maze generation" > task be? I don't know, but here's a data point. I did it in > my Smalltalk. > - roughly 90 lines > - 12 lines of comments > - 25 lines are devoted to generating the output, > including terminal ESC sequences. > - I used the algorithm described in the task page. > - I wrote shamelessly compact code instead of well > documented stuff. Maintainability shmaintainability. > - I proudly avoided creating any objects other than one > mutable 2D array of bytes. > - It would have been better to copy the F# code. Sigh. > > Here's another data point: it's going to be hard to beat > Haskell (67 lines). The J answer manages it because J is > particularly expressive (if you can call it that...) with > arrays, like its ancestor APL. Erlang is not. > > If you can write *maintainable* Erlang code for this problem > in 120 lines, you deserve some sort of prize. (I do not call > the Haskell answer particularly readable.) > > You could, of course, cheat a bit by copying the F# version > and using the process dictionary to hold the maze. > E.g., > let removeWallBetween (x1,y1) (x2,y2) = > if x1 <> x2 then > horizWalls.[min x1 x2, y1] <- false > else > vertWalsl.[x1, min y1 y2] <- false > => > remove_wall_between(X, Y1, X, Y2) -> > put({v,X,min(Y1,Y2)}, false); > remove_wall_between(X1, Y, X2, Y) -> > put({h,min(X1,X2),Y}, false). > > Not a thing I'd normally recommend, but if this is in its > own process, you might get away with it. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From billeejo@REDACTED Fri Aug 26 17:46:45 2016 From: billeejo@REDACTED (Billee Kelder) Date: Fri, 26 Aug 2016 11:46:45 -0400 Subject: [erlang-questions] Unable to restart epmd, sockets stuck in close_wait Message-ID: Hi Folks, I've got a system using erlang/OTP 18.3.4.1 and rabbitmq 3.6.3. Everything is local to the system and there is no clustering. We are seeing intermittent failures when stopping-uninstalling-reinstalling-starting epmd. When this happens we also see many sockets stuck in close_wait like so: tcp 48 0 0.0.0.0:4369 0.0.0.0:* LISTEN 0 570937 1/systemd tcp 5 0 127.0.0.1:4369 127.0.0.1:37560 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:42564 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:53126 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:40222 CLOSE_WAIT 0 0 - tcp 38 0 127.0.0.1:4369 127.0.0.1:33506 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:56332 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:50511 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:45528 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:59487 CLOSE_WAIT 0 0 - tcp 4 0 127.0.0.1:4369 127.0.0.1:37506 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:41554 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:40080 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:32903 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:48851 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:35177 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:44931 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:54730 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:48311 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:39159 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:47166 CLOSE_WAIT 0 0 - tcp 2 0 127.0.0.1:4369 127.0.0.1:37541 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:38290 CLOSE_WAIT 0 0 - tcp 31 0 127.0.0.1:4369 127.0.0.1:43044 CLOSE_WAIT 0 0 - tcp 2 0 127.0.0.1:4369 127.0.0.1:37540 CLOSE_WAIT 0 0 - tcp 2 0 127.0.0.1:4369 127.0.0.1:37544 CLOSE_WAIT 0 0 - On an identical working system the output looks like this: tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN 1/systemd tcp 0 0 :4369 9.47.80.245:36368 TIME_WAIT - tcp 0 0 127.0.0.1:34836 127.0.0.1:4369 ESTABLISHED 22713/beam.smp tcp 0 0 127.0.0.1:4369 127.0.0.1:34836 ESTABLISHED 21186/epmd on the hung system: epmd -names and epmd -kill both hang indefinitely Attempting to restart epmd.socket or epmd.service gives the error epmd.socket failed to listen on sockets: Address already in use Is there any way to a) Get more information about what is causing the state to occur (so I can hopefully prevent it in the future) or b) Recover from this state (without rebooting the system)? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony@REDACTED Fri Aug 26 19:06:29 2016 From: tony@REDACTED (Tony Rogvall) Date: Fri, 26 Aug 2016 19:06:29 +0200 Subject: [erlang-questions] Maze alternate example for Rosetta Code In-Reply-To: References: <56BDFAE9.6050500@vaxxine.com> Message-ID: Nice. I did not know that you used hack games :-) I do need help to make a nice Erlang version of pacman, I did a lousy port to Erlang and it is a really bad example for anyone that want to check out the language. Please? /Tony > On 26 aug 2016, at 14:55, Richard Carlsson wrote: > > Couldn't resist - last time I did one of these was using Sinclair Basic in 1985. Aiming for compact rather than maintainable, I get the following (36 lines); however, making it pretty would only add maybe a dozen lines: > > %%% @author Richard Carlsson > %%% @copyright (C) 2016, Richard Carlsson > > -module(maze). > > -export([print/2, build/2]). > > print(W, H) -> > M = build(W, H), > io:put_chars([[[array:get(R*(W*2+1)+C, M) || C <- lists:seq(0,W*2)], $\n] > || R <- lists:seq(0,H*2)]). > > build(W, H) when is_integer(W), is_integer(H), W > 0, H > 0 -> > M = array:new((W*2+1)*(H*2+1), {default,$X}), > build(rand:uniform(W)*2-1, rand:uniform(H)*2-1, (W*2+1), (H*2+1), M). > > build(X, Y, W, H, M) -> > move([D || {_,D} <- lists:sort(lists:zip([rand:uniform() || _<-"...."], > [{0,-2},{0,2},{2,0},{-2,0}]))], > X, Y, W, H, array:set(Y*W+X, $\s, M)). > > move([{Dx,Dy}|Ds], X, Y, W, H, M) -> > X1 = X + Dx, Y1 = Y + Dy, > move(Ds, X, Y, W, H, > if X1 > 0, X1 < W, Y1 > 0, Y1 < H -> > case array:get(Y1*W+X1, M) of > $\s -> M; > _ -> build(X1, Y1, W, H, > array:set(((Y+Y1) div 2)*W + (X+X1) div 2, > $\s, M)) > end; > true -> M > end); > move([], _X, _Y, _W, _H, M) -> > M. > > > > /Richard > > 2016-08-26 7:03 GMT+02:00 Richard A. O'Keefe : > How large should Erlang code for the Rosetta "maze generation" > task be? I don't know, but here's a data point. I did it in > my Smalltalk. > - roughly 90 lines > - 12 lines of comments > - 25 lines are devoted to generating the output, > including terminal ESC sequences. > - I used the algorithm described in the task page. > - I wrote shamelessly compact code instead of well > documented stuff. Maintainability shmaintainability. > - I proudly avoided creating any objects other than one > mutable 2D array of bytes. > - It would have been better to copy the F# code. Sigh. > > Here's another data point: it's going to be hard to beat > Haskell (67 lines). The J answer manages it because J is > particularly expressive (if you can call it that...) with > arrays, like its ancestor APL. Erlang is not. > > If you can write *maintainable* Erlang code for this problem > in 120 lines, you deserve some sort of prize. (I do not call > the Haskell answer particularly readable.) > > You could, of course, cheat a bit by copying the F# version > and using the process dictionary to hold the maze. > E.g., > let removeWallBetween (x1,y1) (x2,y2) = > if x1 <> x2 then > horizWalls.[min x1 x2, y1] <- false > else > vertWalsl.[x1, min y1 y2] <- false > => > remove_wall_between(X, Y1, X, Y2) -> > put({v,X,min(Y1,Y2)}, false); > remove_wall_between(X1, Y, X2, Y) -> > put({h,min(X1,X2),Y}, false). > > Not a thing I'd normally recommend, but if this is in its > own process, you might get away with it. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: Message signed with OpenPGP using GPGMail URL: From nbartley@REDACTED Fri Aug 26 21:25:28 2016 From: nbartley@REDACTED (nato) Date: Fri, 26 Aug 2016 12:25:28 -0700 Subject: [erlang-questions] Mnesia list of keys query Message-ID: Hi List -- long time lurker, first-time poster... I can't seem to find a satisfactory answer to getting all the records from an Mnesia table, given a list of keys to match on. Much preferably, I wanted to stay clear of a match-spec solution, in favor of qlc (if even needed). There wasn't anything I found in the manual on a couple of passes going through it and my first-pass attempt just *seems* like it would be dog slow: L = ManyKeys. Fn = fun() -> do(qlc:q([ X || X <- mnesia:table(foo), lists:member(X#foo.bar_id, L) ])) end. {atomic, L2} = mnesia:transaction(Fn). From mikpelinux@REDACTED Sat Aug 27 10:57:02 2016 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Sat, 27 Aug 2016 10:57:02 +0200 Subject: [erlang-questions] Mnesia list of keys query In-Reply-To: References: Message-ID: <22465.21982.426876.713328@gargle.gargle.HOWL> nato writes: > Hi List -- long time lurker, first-time poster... > > I can't seem to find a satisfactory answer to getting all the records > from an Mnesia table, given a list of keys to match on. Much > preferably, I wanted to stay clear of a match-spec solution, in favor > of qlc (if even needed). > > There wasn't anything I found in the manual on a couple of passes > going through it and my first-pass attempt just *seems* like it would > be dog slow: > > L = ManyKeys. > Fn = fun() -> > do(qlc:q([ X || X <- mnesia:table(foo), > lists:member(X#foo.bar_id, L) ])) > end. > {atomic, L2} = mnesia:transaction(Fn). You don't say so explicitly, but I'm assuming the 'bar_id' field isn't the primary key of those 'foo' records. (If it is, then just loop over L and read each key individually.) You want a secondary index on the 'bar_id' field. See the mnesia docs for details. Without a secondary index, any solution reduces to enumerating the entire 'foo' table followed by filtering on L. That filtering is quadratic as written above (size of foo times length of L), so you may want to replace the list with a better lookup structure. From arshadansari27@REDACTED Sat Aug 27 18:05:09 2016 From: arshadansari27@REDACTED (Arshad Ansari) Date: Sat, 27 Aug 2016 16:05:09 +0000 Subject: [erlang-questions] Regarding Erlang gen_server's ability to handle requests concurrently Message-ID: Hello there, This is a generic question that I have regarding the ability of gen_server to handle requests concurrently. Does gen_server create a separate process per request (even when for each request coming from same socket connection) or does it create separate process per socket connection? If it is latter then there will be a single process responsible for handling large number of messaging coming from single socket. In that case, how to make sure that that single process can handle a very high load coming from a single connection? I hope my question is clear! Regards, Arshad -------------- next part -------------- An HTML attachment was scrubbed... URL: From ehsan.tck@REDACTED Sat Aug 27 20:12:37 2016 From: ehsan.tck@REDACTED (Ehsan Mohammadi) Date: Sat, 27 Aug 2016 18:12:37 +0000 Subject: [erlang-questions] Regarding Erlang gen_server's ability to handle requests concurrently In-Reply-To: References: Message-ID: i`m new to erlang but as far as i know you can`t share a socket in multiple process or threads so you can accept and get raw data in single server and do processing in a server pool or something like that On Sat, Aug 27, 2016 at 8:35 PM Arshad Ansari wrote: > Hello there, > > This is a generic question that I have regarding the ability of gen_server > to handle requests concurrently. Does gen_server create a separate process > per request (even when for each request coming from same socket connection) > or does it create separate process per socket connection? If it is latter > then there will be a single process responsible for handling large number > of messaging coming from single socket. In that case, how to make sure that > that single process can handle a very high load coming from a single > connection? > > I hope my question is clear! > > Regards, > Arshad > _______________________________________________ > 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 Sun Aug 28 00:00:16 2016 From: felixgallo@REDACTED (Felix Gallo) Date: Sat, 27 Aug 2016 15:00:16 -0700 Subject: [erlang-questions] Regarding Erlang gen_server's ability to handle requests concurrently In-Reply-To: References: Message-ID: Arshad -- A single gen_server instance is single-threaded, handling only one message at a time. Gen_servers are not necessarily network related; they have to work in conjunction with libraries like gen_udp and gen_tcp in order to arrange to send and receive messages on networks. It's important to know that there are a few different kinds of socket: "listen" sockets, which bind to a port on your computer's network interface and wait for new connection attempts to get made, and "client" sockets, which are sockets that can be communicated over once the connection has been formed. You can think of "client" sockets as having been peeled off a "listen" socket. Listen sockets can be shared by sending them as part of a message to another process, or by passing them as an argument to a process spawn function. In the case of tcp sockets, it's fairly natural to open a listen socket, spawn child processes, passing them the listen socket, and for each of the children to call accept(), which then returns to them a fresh new unique client socket, in order to concurrently handle many simultaneous connections. A worked example is here, in the documentation: http://erlang.org/doc/man/gen_tcp.html#Examples . Client sockets can also be shared and passed around, but since a client socket can only be read by the client socket's owning process, this is of limited utility. There are a large number of tunable parameters on your network card, in your operating system, and in erlang that you can fiddle with to obtain optimum performance if you're worried about erlang's scalability; the documentation for gen_tcp is a good place to start. Fred's excellent 'Learn You Some Erlang' book also has a great chapter on all this: http://learnyousomeerlang.com/buckets-of-sockets. F. On Sat, Aug 27, 2016 at 11:12 AM, Ehsan Mohammadi wrote: > i`m new to erlang but as far as i know you can`t share a socket in > multiple process or threads > so you can accept and get raw data in single server and do processing in a > server pool or something like that > > On Sat, Aug 27, 2016 at 8:35 PM Arshad Ansari > wrote: > >> Hello there, >> >> This is a generic question that I have regarding the ability of >> gen_server to handle requests concurrently. Does gen_server create a >> separate process per request (even when for each request coming from same >> socket connection) or does it create separate process per socket >> connection? If it is latter then there will be a single process responsible >> for handling large number of messaging coming from single socket. In that >> case, how to make sure that that single process can handle a very high load >> coming from a single connection? >> >> I hope my question is clear! >> >> Regards, >> Arshad >> _______________________________________________ >> 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 matthias@REDACTED Sun Aug 28 08:29:11 2016 From: matthias@REDACTED (Matthias Lang) Date: Sun, 28 Aug 2016 08:29:11 +0200 Subject: [erlang-questions] is anyone using a forum interface for erlang-questions? Message-ID: <20160828062910.iblf7k5ouhaxkflo@corelatus.se> Hi, I'm fixing broken links in the Erlang FAQ (http://erlang.org/faq/faq.html). 'gmane' is currently mentioned as providing a forum-like interface to the mailing list, under the broken link: http://news.gmane.org/gmane.comp.lang.erlang.general is anyone here using something similar which is worth recommending? (The reason 'gmane' is broken is tragic: https://lars.ingebrigtsen.no/2016/07/28/the-end-of-gmane/ ) Matt From pierrefenoll@REDACTED Sun Aug 28 12:01:23 2016 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Sun, 28 Aug 2016 12:01:23 +0200 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) Message-ID: We had too many discussions about style on a lengthy open source Erlang project (2600Hz's Kazoo). We have now as part of our CI checks a style-ensuring tool that formats .erl .hrl .app.src .escript in the "standard format" of Emacs' erlang-mode. https://github.com/fenollp/erlang-formatter is now in version 1. We use it daily which helps us redirect our shouting at CircleCI instead of colleagues. And shouting is certainly great to redirect http://erlang.org/pipermail/erlang-questions/2014-February/076908.html This implementation uses emacs > 23 under the hood. * It was the fastest & shortest way to implement * erlang-mode is the closest thing to a standard there is for formatting Some other tools / implementations are listed in the project's README. So far this project helped uncover 4 bugs in erlang-mode which I minified & reported. I share this in hope that this can help people & tame some shouting. A non-Emacs implementation would be amazing (probably faster, more portable). With your help this project can turn into a test bed for such an adventure! A rebar3 fmt plugin is in the works. Please tell me what you think but I don't care about your religious beliefs :) Cheers, -- Pierre Fenoll -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkbucc@REDACTED Sun Aug 28 14:06:51 2016 From: mkbucc@REDACTED (Mark Bucciarelli) Date: Sun, 28 Aug 2016 08:06:51 -0400 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: Message-ID: Hi, I had the same itch! * http://erlang.org/pipermail/erlang-questions/2016-April/088975.html * https://github.com/mbucc/erlfmt (which grew out of that thread) I use it whenever I am coding with Erlang (and it also helped expose an erl_tidy bug [1] :). Thanks, Mark [1] https://github.com/erlang/otp/commit/0969ecad9e2978bacb7b27f663cd16aa5ea6c460 On Sun, Aug 28, 2016 at 6:01 AM, Pierre Fenoll wrote: > We had too many discussions about style on a lengthy open source Erlang > project (2600Hz's Kazoo). > > We have now as part of our CI checks a style-ensuring tool that formats > .erl .hrl .app.src .escript > in the "standard format" of Emacs' erlang-mode. > > https://github.com/fenollp/erlang-formatter is now in version 1. > We use it daily which helps us redirect our shouting at CircleCI instead > of colleagues. > > And shouting is certainly great to redirect > http://erlang.org/pipermail/erlang-questions/2014-February/076908.html > > This implementation uses emacs > 23 under the hood. > * It was the fastest & shortest way to implement > * erlang-mode is the closest thing to a standard there is for formatting > Some other tools / implementations are listed in the project's README. > > So far this project helped uncover 4 bugs in erlang-mode which I minified > & reported. > > I share this in hope that this can help people & tame some shouting. > A non-Emacs implementation would be amazing (probably faster, more > portable). > With your help this project can turn into a test bed for such an adventure! > > A rebar3 fmt plugin is in the works. > > Please tell me what you think but I don't care about your religious > beliefs :) > > Cheers, > -- > Pierre Fenoll > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Blogging at markbucciarelli.com Tweeting @mbucc -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Sun Aug 28 14:27:48 2016 From: max.lapshin@REDACTED (Max Lapshin) Date: Sun, 28 Aug 2016 15:27:48 +0300 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: Message-ID: 4 spaces or 2 spaces? -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierrefenoll@REDACTED Sun Aug 28 14:53:56 2016 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Sun, 28 Aug 2016 14:53:56 +0200 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: Message-ID: Ah so I tried erl_tidy and like Tristan says over at https://github.com/tsloughter/erl_tidy : Oh boy my specs! erlang-mode does not rewrite code in the same sense as erl_tidy. Instead it behaves as if one was pressing the TAB key on each line of a file, thus only changing space to the left of the current line. Even though I like erl_tidy's "unclobbering or commas" (it turns A,B,C into A, B, C) I very much prefer erlang-mode's "preservation of \ns": it only changes the indentation characters. How do you handle the cases where erl_tidy spews out AST code instead of compilable code? @Max 4 spaces, although that is configurable somewhere. This feature needs confirmation though: that's 4. in https://github.com/fenollp/erlang-formatter#to-do Cheers, -- Pierre Fenoll On 28 August 2016 at 14:06, Mark Bucciarelli wrote: > Hi, > > I had the same itch! > > * http://erlang.org/pipermail/erlang-questions/2016-April/088975.html > > * https://github.com/mbucc/erlfmt (which grew out of that thread) > > I use it whenever I am coding with Erlang (and it also helped expose an > erl_tidy bug [1] :). > > Thanks, > > Mark > > [1] https://github.com/erlang/otp/commit/0969ecad9e2978bacb7b27f663cd16 > aa5ea6c460 > > On Sun, Aug 28, 2016 at 6:01 AM, Pierre Fenoll > wrote: > >> We had too many discussions about style on a lengthy open source Erlang >> project (2600Hz's Kazoo). >> >> We have now as part of our CI checks a style-ensuring tool that formats >> .erl .hrl .app.src .escript >> in the "standard format" of Emacs' erlang-mode. >> >> https://github.com/fenollp/erlang-formatter is now in version 1. >> We use it daily which helps us redirect our shouting at CircleCI instead >> of colleagues. >> >> And shouting is certainly great to redirect >> http://erlang.org/pipermail/erlang-questions/2014-February/076908.html >> >> This implementation uses emacs > 23 under the hood. >> * It was the fastest & shortest way to implement >> * erlang-mode is the closest thing to a standard there is for formatting >> Some other tools / implementations are listed in the project's README. >> >> So far this project helped uncover 4 bugs in erlang-mode which I minified >> & reported. >> >> I share this in hope that this can help people & tame some shouting. >> A non-Emacs implementation would be amazing (probably faster, more >> portable). >> With your help this project can turn into a test bed for such an >> adventure! >> >> A rebar3 fmt plugin is in the works. >> >> Please tell me what you think but I don't care about your religious >> beliefs :) >> >> Cheers, >> -- >> Pierre Fenoll >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > -- > Blogging at markbucciarelli.com > Tweeting @mbucc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.arnon@REDACTED Sun Aug 28 17:17:17 2016 From: alex.arnon@REDACTED (Alex Arnon) Date: Sun, 28 Aug 2016 18:17:17 +0300 Subject: [erlang-questions] Regarding Erlang gen_server's ability to handle requests concurrently In-Reply-To: References: Message-ID: Hi Arshad, It is possible for a gen_server to asynchronously reply to a call() - return {noreply, NewState} and later use gen_server:reply(From, Reply). This enables handling of multiple calls using the single gen_server thread. Of course, you'll need to keep track of all delayed replies in your State etc. etc. Note that this has nothing to do with sockets :) Cheers, Alex. On Sun, Aug 28, 2016 at 1:00 AM, Felix Gallo wrote: > Arshad -- > > A single gen_server instance is single-threaded, handling only one message > at a time. Gen_servers are not necessarily network related; they have to > work in conjunction with libraries like gen_udp and gen_tcp in order to > arrange to send and receive messages on networks. > > It's important to know that there are a few different kinds of socket: > "listen" sockets, which bind to a port on your computer's network interface > and wait for new connection attempts to get made, and "client" sockets, > which are sockets that can be communicated over once the connection has > been formed. You can think of "client" sockets as having been peeled off a > "listen" socket. > > Listen sockets can be shared by sending them as part of a message to > another process, or by passing them as an argument to a process spawn > function. In the case of tcp sockets, it's fairly natural to open a listen > socket, spawn child processes, passing them the listen socket, and for each > of the children to call accept(), which then returns to them a fresh new > unique client socket, in order to concurrently handle many simultaneous > connections. A worked example is here, in the documentation: > http://erlang.org/doc/man/gen_tcp.html#Examples . > > Client sockets can also be shared and passed around, but since a client > socket can only be read by the client socket's owning process, this is of > limited utility. > > There are a large number of tunable parameters on your network card, in > your operating system, and in erlang that you can fiddle with to obtain > optimum performance if you're worried about erlang's scalability; the > documentation for gen_tcp is a good place to start. Fred's excellent > 'Learn You Some Erlang' book also has a great chapter on all this: http:// > learnyousomeerlang.com/buckets-of-sockets. > > F. > > On Sat, Aug 27, 2016 at 11:12 AM, Ehsan Mohammadi > wrote: > >> i`m new to erlang but as far as i know you can`t share a socket in >> multiple process or threads >> so you can accept and get raw data in single server and do processing in >> a server pool or something like that >> >> On Sat, Aug 27, 2016 at 8:35 PM Arshad Ansari >> wrote: >> >>> Hello there, >>> >>> This is a generic question that I have regarding the ability of >>> gen_server to handle requests concurrently. Does gen_server create a >>> separate process per request (even when for each request coming from same >>> socket connection) or does it create separate process per socket >>> connection? If it is latter then there will be a single process responsible >>> for handling large number of messaging coming from single socket. In that >>> case, how to make sure that that single process can handle a very high load >>> coming from a single connection? >>> >>> I hope my question is clear! >>> >>> Regards, >>> Arshad >>> _______________________________________________ >>> 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 mkbucc@REDACTED Mon Aug 29 01:48:06 2016 From: mkbucc@REDACTED (Mark Bucciarelli) Date: Sun, 28 Aug 2016 19:48:06 -0400 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: Message-ID: On Sun, Aug 28, 2016 at 8:53 AM, Pierre Fenoll wrote: > Ah so I tried erl_tidy and like Tristan says over at > https://github.com/tsloughter/erl_tidy : > Oh boy my specs! > OTP-19 includes support for -spec's and -types. (see https://github.com/erlang/otp/pull/1034). Not quite pretty yet, but no data loss. :) > How do you handle the cases where erl_tidy spews out AST code instead of > compilable code? > Could you give me a specific case of what you mean? I tried erlfmt'd the entire OTP-19 erlang source tree and grepping the output for the string '{tree', but the only hits where files that included the string to start with. Any my google-foo came up empty. Thanks, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Mon Aug 29 03:06:34 2016 From: t@REDACTED (Tristan Sloughter) Date: Sun, 28 Aug 2016 18:06:34 -0700 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: Message-ID: <1472432794.2308528.708698521.47E04699@webmail.messagingengine.com> Oh good, that should be the only time it spits out AST, I think. I'll have to upgrade my rebar3 plugin to use the new OTP-19 version. Though is still ugly as you mention, so not really usable for non- generated code :( -- Tristan Sloughter t@REDACTED On Sun, Aug 28, 2016, at 04:48 PM, Mark Bucciarelli wrote: > On Sun, Aug 28, 2016 at 8:53 AM, Pierre Fenoll > wrote: >> Ah so I tried erl_tidy and like Tristan says over at >> https://github.com/tsloughter/erl_tidy : >> Oh boy my specs! > > OTP-19 includes support for -spec's and -types. (see > https://github.com/erlang/otp/pull/1034). Not quite pretty yet, but > no data loss. :) > >> >> How do you handle the cases where erl_tidy spews out AST code instead >> of compilable code? > > Could you give me a specific case of what you mean? > > I tried erlfmt'd the entire OTP-19 erlang source tree and grepping the > output for the string '{tree', but the only hits where files that > included the string to start with. Any my google-foo came up empty. > > Thanks, > > Mark > _________________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Mon Aug 29 09:28:58 2016 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Mon, 29 Aug 2016 09:28:58 +0200 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: Message-ID: <82c49349-8ebc-dd06-d39b-5430b2a27769@ericsson.com> Or perhaps one indention, and your editor/tool can set the number of spaces you prefer? On 08/28/2016 02:27 PM, Max Lapshin wrote: > 4 spaces or 2 spaces? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Mon Aug 29 16:03:21 2016 From: max.lapshin@REDACTED (Max Lapshin) Date: Mon, 29 Aug 2016 17:03:21 +0300 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: <82c49349-8ebc-dd06-d39b-5430b2a27769@ericsson.com> References: <82c49349-8ebc-dd06-d39b-5430b2a27769@ericsson.com> Message-ID: No. Tool like go fmt must force one code style without any variations. On Mon, Aug 29, 2016 at 10:28 AM, Bengt Kleberg wrote: > Or perhaps one indention, and your editor/tool can set the number of > spaces you prefer? > > On 08/28/2016 02:27 PM, Max Lapshin wrote: > > 4 spaces or 2 spaces? > > > _______________________________________________ > 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 garry@REDACTED Mon Aug 29 16:11:06 2016 From: garry@REDACTED (Garry Hodgson) Date: Mon, 29 Aug 2016 10:11:06 -0400 Subject: [erlang-questions] Erlang Eddie -- son of? In-Reply-To: <20160824131624.37lc4fjs6z7myfmc@corelatus.se> References: <9B153944-9E75-4526-BD1B-40A2EA364E6A@writersglen.com> <20160824131624.37lc4fjs6z7myfmc@corelatus.se> Message-ID: <57C4427A.4010307@research.att.com> Maybe it's pining for the fjords? On 08/24/2016 09:16 AM, Matthias Lang wrote: > On 22. August 2016, Richard A. O'Keefe wrote: > >>> I just ran across The Eddie Mission. It promises much of great potential value but appears to be dead as a dodo. >> According to https://sourceforge.net/projects/eddie/, >> the last update was in March 2013. >> That's not "undergoing rapid development", but it's not >> quite "dead as a dodo" either. > The Wikipedia page about Elvis Presley says it was last updated a week ago, > so if that's good enough to claim "not dead", then, well, you're not alone. > > All the evidence points to Eddie being dead: > > - The most recent release of eddie on sourceforge is from 15 years ago > - The bug tracker has two bugs in total. Neither of which are recent. > - The patch tracker has two trivial patches in total. From 2007. > - Nothing's been committed to CVS for more than a decade. > - One of the most recent CVS commit logs talks about Erlang R9B-1. > > Matt > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Garry Hodgson Lead Member of Technical Staff AT&T Chief Security Office (CSO) "This e-mail and any files transmitted with it are AT&T property, are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited." From arshadansari27@REDACTED Mon Aug 29 17:45:15 2016 From: arshadansari27@REDACTED (Arshad Ansari) Date: Mon, 29 Aug 2016 15:45:15 +0000 Subject: [erlang-questions] Regarding Erlang gen_server's ability to handle requests concurrently In-Reply-To: References: Message-ID: Thanks a lot to all of you guys.. Your inputs were of tremendous help. Regards, Arshad On Sun, Aug 28, 2016 at 8:47 PM Alex Arnon wrote: > Hi Arshad, > > It is possible for a gen_server to asynchronously reply to a call() - > return {noreply, NewState} and later use gen_server:reply(From, Reply). > This enables handling of multiple calls using the single gen_server > thread. Of course, you'll need to keep track of all delayed replies in your > State etc. etc. > Note that this has nothing to do with sockets :) > > Cheers, > Alex. > > > On Sun, Aug 28, 2016 at 1:00 AM, Felix Gallo wrote: > >> Arshad -- >> >> A single gen_server instance is single-threaded, handling only one >> message at a time. Gen_servers are not necessarily network related; they >> have to work in conjunction with libraries like gen_udp and gen_tcp in >> order to arrange to send and receive messages on networks. >> >> It's important to know that there are a few different kinds of socket: >> "listen" sockets, which bind to a port on your computer's network interface >> and wait for new connection attempts to get made, and "client" sockets, >> which are sockets that can be communicated over once the connection has >> been formed. You can think of "client" sockets as having been peeled off a >> "listen" socket. >> >> Listen sockets can be shared by sending them as part of a message to >> another process, or by passing them as an argument to a process spawn >> function. In the case of tcp sockets, it's fairly natural to open a listen >> socket, spawn child processes, passing them the listen socket, and for each >> of the children to call accept(), which then returns to them a fresh new >> unique client socket, in order to concurrently handle many simultaneous >> connections. A worked example is here, in the documentation: >> http://erlang.org/doc/man/gen_tcp.html#Examples . >> >> Client sockets can also be shared and passed around, but since a client >> socket can only be read by the client socket's owning process, this is of >> limited utility. >> >> There are a large number of tunable parameters on your network card, in >> your operating system, and in erlang that you can fiddle with to obtain >> optimum performance if you're worried about erlang's scalability; the >> documentation for gen_tcp is a good place to start. Fred's excellent >> 'Learn You Some Erlang' book also has a great chapter on all this: >> http://learnyousomeerlang.com/buckets-of-sockets. >> >> F. >> >> On Sat, Aug 27, 2016 at 11:12 AM, Ehsan Mohammadi >> wrote: >> >>> i`m new to erlang but as far as i know you can`t share a socket in >>> multiple process or threads >>> so you can accept and get raw data in single server and do processing in >>> a server pool or something like that >>> >>> On Sat, Aug 27, 2016 at 8:35 PM Arshad Ansari >>> wrote: >>> >>>> Hello there, >>>> >>>> This is a generic question that I have regarding the ability of >>>> gen_server to handle requests concurrently. Does gen_server create a >>>> separate process per request (even when for each request coming from same >>>> socket connection) or does it create separate process per socket >>>> connection? If it is latter then there will be a single process responsible >>>> for handling large number of messaging coming from single socket. In that >>>> case, how to make sure that that single process can handle a very high load >>>> coming from a single connection? >>>> >>>> I hope my question is clear! >>>> >>>> Regards, >>>> Arshad >>>> _______________________________________________ >>>> 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 arshadansari27@REDACTED Mon Aug 29 17:55:11 2016 From: arshadansari27@REDACTED (Arshad Ansari) Date: Mon, 29 Aug 2016 15:55:11 +0000 Subject: [erlang-questions] Amazon AWS benchmarking of erlang-diameter not upto the mark Message-ID: Hello there, Today, as a part of evalution of erlang diameter client, relay & server, I was benchmarking for requests per second. This same test was performed by me on my local network and I was able to get 30K requests per second between client and server using a single connection. However, on Aws I got to only about 11-12K requests per second. I had used c3.x4large instance with 16 cores and 30 GB ram for both client and server, which is 4 times the core I have and twice the ram I had when I was testing locally. These are compute enhanced instances to make sure I get to use core to the maximum, but I wasn't even using 60% of cores on server and 80% of cores on client. I even used the same placement group to get 10GBps network bandwidth. I can't think of any reason why there would be just a downgrade. Has anyone experienced something of this sort on Aws while benchmarking erlang? Thanks in advance for the help. Regards, Arshad -------------- next part -------------- An HTML attachment was scrubbed... URL: From rexxe98@REDACTED Mon Aug 29 19:03:29 2016 From: rexxe98@REDACTED (Andrew Berman) Date: Mon, 29 Aug 2016 17:03:29 +0000 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: <82c49349-8ebc-dd06-d39b-5430b2a27769@ericsson.com> Message-ID: As Max said, go fmt forces one code style according to one standard. I like the fact that go fmt leaves no guesswork to the developer. I would love for something like this to be a part of Erlang. On Mon, Aug 29, 2016 at 7:03 AM Max Lapshin wrote: > No. Tool like go fmt must force one code style without any variations. > > On Mon, Aug 29, 2016 at 10:28 AM, Bengt Kleberg < > bengt.kleberg@REDACTED> wrote: > >> Or perhaps one indention, and your editor/tool can set the number of >> spaces you prefer? >> >> On 08/28/2016 02:27 PM, Max Lapshin wrote: >> >> 4 spaces or 2 spaces? >> >> >> _______________________________________________ >> 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 >> >> > _______________________________________________ > 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 Mon Aug 29 21:04:54 2016 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 29 Aug 2016 22:04:54 +0300 Subject: [erlang-questions] Amazon AWS benchmarking of erlang-diameter not upto the mark In-Reply-To: References: Message-ID: <7A7253FD-1E94-44E9-9033-A357C86ACB08@gmail.com> Hello, You?ve experienced difference due to network configuration. CPU factor is important but I?ll spent more time to study network config. You have not defined to us your local network config, its latency, used operating system, networking kernel options and Erlang flags. Similarly, your AWS config is not know to us either. Best Regards, Dmitry > On Aug 29, 2016, at 6:55 PM, Arshad Ansari wrote: > > Hello there, > > Today, as a part of evalution of erlang diameter client, relay & server, I was benchmarking for requests per second. This same test was performed by me on my local network and I was able to get 30K requests per second between client and server using a single connection. However, on Aws I got to only about 11-12K requests per second. I had used c3.x4large instance with 16 cores and 30 GB ram for both client and server, which is 4 times the core I have and twice the ram I had when I was testing locally. These are compute enhanced instances to make sure I get to use core to the maximum, but I wasn't even using 60% of cores on server and 80% of cores on client. I even used the same placement group to get 10GBps network bandwidth. I can't think of any reason why there would be just a downgrade. Has anyone experienced something of this sort on Aws while benchmarking erlang? > > Thanks in advance for the help. > > Regards, > Arshad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From arshadansari27@REDACTED Mon Aug 29 21:49:50 2016 From: arshadansari27@REDACTED (Arshad Ansari) Date: Mon, 29 Aug 2016 19:49:50 +0000 Subject: [erlang-questions] Amazon AWS benchmarking of erlang-diameter not upto the mark In-Reply-To: <7A7253FD-1E94-44E9-9033-A357C86ACB08@gmail.com> References: <7A7253FD-1E94-44E9-9033-A357C86ACB08@gmail.com> Message-ID: Hello Dmitry, On my localbox I had a simple lan configuration with a single gateway/switch to internet, so I'm not sure what else there is to mention about the lan config. However; the machine configurations are as below: 1. Server-1 [4 core 4 GB] 2. Server-2 [4 core 4 GB] 3. Relay [Works as a load Balancer] [4 core 4 GB] 4. Client 1 [4 core 4 GB] 5. Client 2 [4 core 4 GB] Each machine runs a single node as mentioned. There is a single tcp socket connection between peers where alll Clients connect to Relay and Relay in turn connects with the 2 servers and acts a proxy while also balancing the request between the two servers using round robin algorithm. This connection is used to send all the request using the gen_server:call (blocking) method. Following is the erl vm params I'm using for all of the nodes: erl +A 1024 +P 134217727 +Q 134217727 -env ERL_MAX_PORTS 134217727 +K true I'm able to get around 26K req/sec on relay which divides the requests between two servers around 13K req/sec. Each and every node was utilizing near about *99%* of all the cores available on the system. This I was able to get on my local network. As for AWS, I had the following setup: 1. Server - 1 [4 core 16GB] 2. Server - 2 [4 core 16GB] 3. Relay [16 core 30GB] 4. Client [16 core 30GB] I had launched four of them as part of single placement group to remove bandwidth restriction. When I did run the nodes, the processors were *not* being utilized more than *60% *and yet the relay was getting around 12K req/sec which it was dividing between servers with each one getting around 6K req/sec. Erlang VM args were the same as mentioned above. I was using internal private IPs on AWS to connect the peers with one another to avoid bandwidth limitation that comes with public IP usage. Each of the aws instance has EBS volume attached to it. The only disk access I'm doing is to write log at the per second rate, besides accessing the ETS table for getting counter instances from each instance. I hope I've covered all there is to the configurations and also that I was clear enough. Thanks again, Regards, Arshad On Tue, Aug 30, 2016 at 12:34 AM Dmitry Kolesnikov wrote: > Hello, > > You?ve experienced difference due to network configuration. CPU factor is > important but I?ll spent more time to study network config. > > You have not defined to us your local network config, its latency, used > operating system, networking kernel options and Erlang flags. Similarly, > your AWS config is not know to us either. > > Best Regards, > Dmitry > > > > On Aug 29, 2016, at 6:55 PM, Arshad Ansari > wrote: > > > > Hello there, > > > > Today, as a part of evalution of erlang diameter client, relay & server, > I was benchmarking for requests per second. This same test was performed by > me on my local network and I was able to get 30K requests per second > between client and server using a single connection. However, on Aws I got > to only about 11-12K requests per second. I had used c3.x4large instance > with 16 cores and 30 GB ram for both client and server, which is 4 times > the core I have and twice the ram I had when I was testing locally. These > are compute enhanced instances to make sure I get to use core to the > maximum, but I wasn't even using 60% of cores on server and 80% of cores on > client. I even used the same placement group to get 10GBps network > bandwidth. I can't think of any reason why there would be just a downgrade. > Has anyone experienced something of this sort on Aws while benchmarking > erlang? > > > > Thanks in advance for the help. > > > > Regards, > > Arshad > > _______________________________________________ > > 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 Mon Aug 29 23:41:39 2016 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Mon, 29 Aug 2016 23:41:39 +0200 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: Message-ID: Thanks for sharing the project. My thoughts follow. vim-erlang-runtime[0] output is very close to erlang.el, and it doesn't suffer from some of the parsing erros of current erlang.el (as reported on bugs.erlang.org). vim might be more readily available in your CI env, if you want to automatically check for style regressions. Also, Bengt's bepp[1][2] looks useful. However, I think Vlad's sourcer might be the best base for an escript and plugin, especially because it aims to be forgiving with, say, unfinished code. This is very important for use in editors. [0] https://github.com/vim-erlang/vim-erlang-runtime [1] https://github.com/ebengt/erlang_stdin_formatter [2] https://github.com/ebengt/erlang_string_io [3] https://github.com/erlang/sourcer From vladdu55@REDACTED Tue Aug 30 09:54:26 2016 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 30 Aug 2016 09:54:26 +0200 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: Message-ID: Hi, Sourcer would have some advantages, yes, but it's still in very early stages. The goal is to have an AST as compatible as possible with the standard one, so for the time being it is less important which parser is used. For formatting syntactical correct files there should be no difference. My take on this is that the first step is to define what the right way to format code is, in form of a specification or a test suite to be passed by the formatter. A big part of this is to decide if formatting should be "indentation only" or "full rewrite" or both - there are arguments to be made for each variant. Another one is about how to indent (tabs, spaces, how many) and how wide the page is (80 characters may feel too narrow for today's monitors, but sometimes code has to be read/edited on narrow terminals). Different use cases need different configuration, I'm not sure if it's possible to have one solution to please everybody. best regards, Vlad On Mon, Aug 29, 2016 at 11:41 PM, Tuncer Ayaz wrote: > Thanks for sharing the project. My thoughts follow. > > vim-erlang-runtime[0] output is very close to erlang.el, and it > doesn't suffer from some of the parsing erros of current erlang.el (as > reported on bugs.erlang.org). vim might be more readily available in > your CI env, if you want to automatically check for style regressions. > > Also, Bengt's bepp[1][2] looks useful. > > However, I think Vlad's sourcer might be the best base for an escript > and plugin, especially because it aims to be forgiving with, say, > unfinished code. This is very important for use in editors. > > [0] https://github.com/vim-erlang/vim-erlang-runtime > > [1] https://github.com/ebengt/erlang_stdin_formatter > [2] https://github.com/ebengt/erlang_string_io > > [3] https://github.com/erlang/sourcer > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Tue Aug 30 10:59:08 2016 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 30 Aug 2016 10:59:08 +0200 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: <82c49349-8ebc-dd06-d39b-5430b2a27769@ericsson.com> Message-ID: <4c5f8149-649d-34ce-4908-61e18524514c@ericsson.com> The tool is to be applied before check in/sharing. So how I prefer to view the code all by myself should not matter. Or? bengt On 08/29/2016 04:03 PM, Max Lapshin wrote: > No. Tool like go fmt must force one code style without any variations. > > On Mon, Aug 29, 2016 at 10:28 AM, Bengt Kleberg > > wrote: > > Or perhaps one indention, and your editor/tool can set the number > of spaces you prefer? > > > On 08/28/2016 02:27 PM, Max Lapshin wrote: >> 4 spaces or 2 spaces? >> >> >> _______________________________________________ >> 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 bengt.kleberg@REDACTED Tue Aug 30 11:08:03 2016 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Tue, 30 Aug 2016 11:08:03 +0200 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: Message-ID: <06748235-e7df-be68-b875-317d182e82b1@ericsson.com> If erlfmt gave me a single, consistent, format to un-format to my liking, for my own private viewing, it would be good enough for me. These, purely private, sources would be erlfmt'ed before I release them to other viewers. gofmt is not configurable. On purpose. On 08/30/2016 09:54 AM, Vlad Dumitrescu wrote: > Hi, > > Sourcer would have some advantages, yes, but it's still in very early > stages. The goal is to have an AST as compatible as possible with the > standard one, so for the time being it is less important which parser > is used. For formatting syntactical correct files there should be no > difference. > > My take on this is that the first step is to define what the right way > to format code is, in form of a specification or a test suite to be > passed by the formatter. A big part of this is to decide if formatting > should be "indentation only" or "full rewrite" or both - there are > arguments to be made for each variant. Another one is about how to > indent (tabs, spaces, how many) and how wide the page is (80 > characters may feel too narrow for today's monitors, but sometimes > code has to be read/edited on narrow terminals). Different use cases > need different configuration, I'm not sure if it's possible to have > one solution to please everybody. > > best regards, > Vlad > > > On Mon, Aug 29, 2016 at 11:41 PM, Tuncer Ayaz > wrote: > > Thanks for sharing the project. My thoughts follow. > > vim-erlang-runtime[0] output is very close to erlang.el, and it > doesn't suffer from some of the parsing erros of current erlang.el (as > reported on bugs.erlang.org ). vim might > be more readily available in > your CI env, if you want to automatically check for style regressions. > > Also, Bengt's bepp[1][2] looks useful. > > However, I think Vlad's sourcer might be the best base for an escript > and plugin, especially because it aims to be forgiving with, say, > unfinished code. This is very important for use in editors. > > [0] https://github.com/vim-erlang/vim-erlang-runtime > > > [1] https://github.com/ebengt/erlang_stdin_formatter > > [2] https://github.com/ebengt/erlang_string_io > > > [3] https://github.com/erlang/sourcer > > _______________________________________________ > 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 pierrefenoll@REDACTED Tue Aug 30 12:56:31 2016 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Tue, 30 Aug 2016 12:56:31 +0200 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: Message-ID: <247EB58B-7160-44BF-894A-26A2AA483B52@gmail.com> > "indentation only" or "full rewrite" erl_tidy or erl_prettypr:format is missing a lot of options. For example: A long spec might get broken down into multiple lines (and that's fine). However I find it surprising (and hard to grep) that newlines are inserted right after the -spec attribute. Options to toggle such behavior are I think needed in erl_tidy. Later on we could agree on which options we want to have as standard. > On 30 Aug 2016, at 09:54, Vlad Dumitrescu wrote: > > "indentation only" or "full rewrite" From tuncer.ayaz@REDACTED Tue Aug 30 16:40:32 2016 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Tue, 30 Aug 2016 16:40:32 +0200 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: Message-ID: On 30 August 2016 at 09:54, Vlad Dumitrescu wrote: > Hi, > > Sourcer would have some advantages, yes, but it's still in very > early stages. The goal is to have an AST as compatible as possible > with the standard one, so for the time being it is less important > which parser is used. For formatting syntactical correct files there > should be no difference. > > My take on this is that the first step is to define what the right > way to format code is, in form of a specification or a test suite to > be passed by the formatter. A big part of this is to decide if > formatting should be "indentation only" or "full rewrite" or both - Erlang is an old language, and there is plenty of code written in it, so we will most definitely not be able to introduce one true style, and we don't have to. However, we can make one available which is a strict version of what erlang.el does, while allowing you to derive a customized version of the formatter. The most reasonable behavior is: 1. If no options configured, indent only. 2. If a built-in style is selected, reformat. There shouldn't be more than two built-in styles, where styl #2 is just a variation of the pre-configured style #1. Stuff that needs to be configurable: 0. Enforcing consistent use of comment syntax, (%%% vs %% vs %). 1. When to line-break and put each comma-separated item on a separate line. 2. When line-breaking, whether to use leading commas or trailing commas. I find leading commas easier to work with because they reduce editing errors and are easier to notice. 3. When to align =, ->, =>, :: 4. How many spaces should surround :: and = 5. What to do with trailing comments (single %) if it exceeds the configured column limit. Given that these things need to be done in a formatter anyway, exposing them as tunables should be easy. > there are arguments to be made for each variant. Another one is > about how to indent (tabs, spaces, how many) and how wide the page As long as it's consistent and the tools do it automatically, it's up to the owner of a code base what leading whitespace style is used, and given the large body of code out there, we cannot make an assumption when run without custom config. > is (80 characters may feel too narrow for today's monitors, but > sometimes code has to be read/edited on narrow terminals). Different Too narrow and too wide are both less reader friendly, and having column limits forces you to avoid deep nesting, which improves your code. There are developers who can work with >100 column text, and we cannot assume they don't exist, so this must be tunable even in an other fully pre-configured style. > use cases need different configuration, I'm not sure if it's > possible to have one solution to please everybody. It isn't possible, but we can provide a built-in style which has everything but the column limit hard-coded, while being a derivative of the fully customizable formatter. See above. From ok@REDACTED Wed Aug 31 03:13:40 2016 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 31 Aug 2016 13:13:40 +1200 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: References: Message-ID: <8230841d-c14f-e856-05f9-ad55a31dcc0f@cs.otago.ac.nz> On 30/08/16 7:54 PM, Vlad Dumitrescu wrote: > My take on this is that the first step is to define what the right way > to format code is, in form of a specification or a test suite to be > passed by the formatter. A big part of this is to decide if formatting > should be "indentation only" or "full rewrite" or both - there are > arguments to be made for each variant. Another one is about how to > indent (tabs, spaces, how many) and how wide the page is (80 characters > may feel too narrow for today's monitors, but sometimes code has to be > read/edited on narrow terminals). There are four important factors. (1) Natural language text formatted for ease of human reading is formatted in narrow columns. Newspapers are wide, but they use that to pack more narrow columns in, not wider ones. (2) It is often necessary to view multiple files at once. And I don't mean "have in tabs", I mean *VIEW* so that I can actually *SEE* the contents I'm working with. At the moment, for example, I have two source files and a LaTeX file open, and even at 80 columns per window the monitor is NOT wide enough to view them without frequent flicking one or another to the front. I should have made the text narrower. (3) Some people may well be trying to read stuff on tablets. Funnily enough, fondleslabs don't come with huge monitors. (Me, sometimes.) (4) Some people may be rich in years and prefer to spend their screen area on larger fonts. (Sticks hand up in air and waves it excitedly. Hooray for Cmd-Plus say I.) I can assure you that due to factors (1), (2), and (4) I do *not* find 80 characters too narrow on my 27-inch monitor. When I use an iPad (3) to read stuff, I do not find 80 columns too narrow there either. From felixgallo@REDACTED Wed Aug 31 06:13:25 2016 From: felixgallo@REDACTED (Felix Gallo) Date: Tue, 30 Aug 2016 21:13:25 -0700 Subject: [erlang-questions] inet configuration vs. name and sname Message-ID: I would like to force my node's name to be in IPV4 format, e.g., ' joe@REDACTED", rather than any hostname-related nameserved alternative. I would expect this to be possible, because erlang frequently operates in constrained environments and embedded environments where DNS is a luxury, etc., etc. Reading http://erlang.org/doc/apps/erts/inet_cfg.html I get the strong impression that this is further supposed to be possible. For example, one might construct an inet_config file that looks like this: %% erlang inetrc {resolv_conf, ""}. %% do not use a resolv.conf file. {file, hosts, "/dev/null"}. %% use a null hosts file. Note: "" throws weird error. {hosts_file, ""}. %% further, don't keep tabs on that hosts file. {cache_size, 0}. %% never care what happens with DNS caching. {lookup, [file]}. %% only look up hostnames through the empty hosts file; no dns, no native. clear_hosts. %% No hosts. Are we clear on this erlang? Are we? clear_ns. %% No nameservers. None! You cannot look up names. clear_search. %% No search domain. and yet, $ erl -kernel inetrc '"./erl_inetrc"' -name mynode Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V8.0 (abort with ^G) (mynode@REDACTED)1> inet:get_rc(). [{domain,"att.net"}, {resolv_conf,[]}, {hosts_file,[]}, {cache_size,0}, {lookup,[file]}] note that the name of the machine ('spatula') and domain ('att.net') have nevertheless been found out; and $ erl -kernel inetrc '"./erl_inetrc"' -sname mynode Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V8.0 (abort with ^G) (mynode@REDACTED)1> inet:get_rc(). [{resolv_conf,[]}, {hosts_file,[]}, {cache_size,0}, {lookup,[file]}] This makes me sad. Am I missing something or is it not possible to force the after-the-@REDACTED part of a node's name to be simply dotted quads? F. -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.a.vinogradov@REDACTED Wed Aug 31 06:49:31 2016 From: g.a.vinogradov@REDACTED (Gleb Vinogradov) Date: Wed, 31 Aug 2016 11:49:31 +0700 Subject: [erlang-questions] inet configuration vs. name and sname In-Reply-To: References: Message-ID: Hi Felix 1. after-the-@REDACTED part is just result of calling command 'hostname'. 2. Have you tried erl -name mynode@REDACTED ? Gleb 2016-08-31 11:13 GMT+07:00 Felix Gallo : > I would like to force my node's name to be in IPV4 format, e.g., ' > joe@REDACTED", rather than any hostname-related nameserved alternative. > I would expect this to be possible, because erlang frequently operates in > constrained environments and embedded environments where DNS is a luxury, > etc., etc. > > Reading http://erlang.org/doc/apps/erts/inet_cfg.html I get the strong > impression that this is further supposed to be possible. For example, one > might construct an inet_config file that looks like this: > > %% erlang inetrc > {resolv_conf, ""}. %% do not use a resolv.conf file. > {file, hosts, "/dev/null"}. %% use a null hosts file. Note: "" throws > weird error. > {hosts_file, ""}. %% further, don't keep tabs on that hosts file. > {cache_size, 0}. %% never care what happens with DNS caching. > {lookup, [file]}. %% only look up hostnames through the empty hosts file; > no dns, no native. > clear_hosts. %% No hosts. Are we clear on this erlang? Are we? > clear_ns. %% No nameservers. None! You cannot look up names. > clear_search. %% No search domain. > > and yet, > > $ erl -kernel inetrc '"./erl_inetrc"' -name mynode > Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] [smp:4:4] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V8.0 (abort with ^G) > (mynode@REDACTED)1> inet:get_rc(). > [{domain,"att.net"}, > {resolv_conf,[]}, > {hosts_file,[]}, > {cache_size,0}, > {lookup,[file]}] > > note that the name of the machine ('spatula') and domain ('att.net') have > nevertheless been found out; and > > $ erl -kernel inetrc '"./erl_inetrc"' -sname mynode > Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] [smp:4:4] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V8.0 (abort with ^G) > (mynode@REDACTED)1> inet:get_rc(). > [{resolv_conf,[]}, > {hosts_file,[]}, > {cache_size,0}, > {lookup,[file]}] > > This makes me sad. Am I missing something or is it not possible to force > the after-the-@REDACTED part of a node's name to be simply dotted quads? > > F. > > _______________________________________________ > 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 Wed Aug 31 07:25:20 2016 From: felixgallo@REDACTED (Felix Gallo) Date: Tue, 30 Aug 2016 22:25:20 -0700 Subject: [erlang-questions] inet configuration vs. name and sname In-Reply-To: References: Message-ID: Hi Gleb -- 1. yes, I know gethostname(3) somehow snuck in there despite my best efforts. The documentation suggested strongly that it wouldn't, though. I hadn't tried -name 'mynode@REDACTED' yet and to my surprise that does seem to work. That'll work for what I need; thanks! F. On Tue, Aug 30, 2016 at 9:49 PM, Gleb Vinogradov wrote: > Hi Felix > > 1. after-the-@REDACTED part is just result of calling command 'hostname'. > 2. Have you tried erl -name mynode@REDACTED ? > > Gleb > > 2016-08-31 11:13 GMT+07:00 Felix Gallo : > >> I would like to force my node's name to be in IPV4 format, e.g., ' >> joe@REDACTED", rather than any hostname-related nameserved alternative. >> I would expect this to be possible, because erlang frequently operates in >> constrained environments and embedded environments where DNS is a luxury, >> etc., etc. >> >> Reading http://erlang.org/doc/apps/erts/inet_cfg.html I get the strong >> impression that this is further supposed to be possible. For example, one >> might construct an inet_config file that looks like this: >> >> %% erlang inetrc >> {resolv_conf, ""}. %% do not use a resolv.conf file. >> {file, hosts, "/dev/null"}. %% use a null hosts file. Note: "" throws >> weird error. >> {hosts_file, ""}. %% further, don't keep tabs on that hosts file. >> {cache_size, 0}. %% never care what happens with DNS caching. >> {lookup, [file]}. %% only look up hostnames through the empty hosts >> file; no dns, no native. >> clear_hosts. %% No hosts. Are we clear on this erlang? Are we? >> clear_ns. %% No nameservers. None! You cannot look up names. >> clear_search. %% No search domain. >> >> and yet, >> >> $ erl -kernel inetrc '"./erl_inetrc"' -name mynode >> Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] [smp:4:4] >> [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V8.0 (abort with ^G) >> (mynode@REDACTED)1> inet:get_rc(). >> [{domain,"att.net"}, >> {resolv_conf,[]}, >> {hosts_file,[]}, >> {cache_size,0}, >> {lookup,[file]}] >> >> note that the name of the machine ('spatula') and domain ('att.net') >> have nevertheless been found out; and >> >> $ erl -kernel inetrc '"./erl_inetrc"' -sname mynode >> Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] [smp:4:4] >> [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V8.0 (abort with ^G) >> (mynode@REDACTED)1> inet:get_rc(). >> [{resolv_conf,[]}, >> {hosts_file,[]}, >> {cache_size,0}, >> {lookup,[file]}] >> >> This makes me sad. Am I missing something or is it not possible to force >> the after-the-@REDACTED part of a node's name to be simply dotted quads? >> >> F. >> >> _______________________________________________ >> 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 Wed Aug 31 08:44:24 2016 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 31 Aug 2016 08:44:24 +0200 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: <8230841d-c14f-e856-05f9-ad55a31dcc0f@cs.otago.ac.nz> References: <8230841d-c14f-e856-05f9-ad55a31dcc0f@cs.otago.ac.nz> Message-ID: On Wed, Aug 31, 2016 at 3:13 AM, Richard A. O'Keefe wrote: > > > On 30/08/16 7:54 PM, Vlad Dumitrescu wrote: > >> My take on this is that the first step is to define what the right way >> to format code is, in form of a specification or a test suite to be >> passed by the formatter. A big part of this is to decide if formatting >> should be "indentation only" or "full rewrite" or both - there are >> arguments to be made for each variant. Another one is about how to >> indent (tabs, spaces, how many) and how wide the page is (80 characters >> may feel too narrow for today's monitors, but sometimes code has to be >> read/edited on narrow terminals). >> > > There are four important factors. > [...] > I do *not* find 80 characters too narrow on my 27-inch monitor. > When I use an iPad (3) to read stuff, I do not find 80 columns > too narrow there either. I agree. My argument wasn't that 80 columns is bad or useless, but that some people might prefer other values. A formatter without any configuration options is bound to make some people unhappy. So I argue that the tools should be configurable. As Bengt and Tuncer pointed at, one may use a standard format when committing the code, so that the repository has an uniform format, but when checking out would like to see the code differently. It would be a waste to use two different tools for that, instead of one with different configuration. The default format should be something that most people can agree upon, because my guess is that after a while only a few will keep converting the code back and forth when editing it. best regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkbucc@REDACTED Wed Aug 31 12:32:09 2016 From: mkbucc@REDACTED (Mark Bucciarelli) Date: Wed, 31 Aug 2016 06:32:09 -0400 Subject: [erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang) In-Reply-To: <247EB58B-7160-44BF-894A-26A2AA483B52@gmail.com> References: <247EB58B-7160-44BF-894A-26A2AA483B52@gmail.com> Message-ID: [resending, this time to the list as well] On Tue, Aug 30, 2016 at 6:56 AM, Pierre Fenoll wrote: > erl_tidy or erl_prettypr:format is missing a lot of options. For example: > > A long spec might get broken down into multiple lines (and that's fine). > However I find it surprising (and hard to grep) that newlines are inserted > right after the -spec attribute. > > I think producing formatted output that matches with what people are likely to grep for is very important. The commit says getting the "new abstract tree nodes and their associated functions" right was the main priority and that contributions that fix formatting "are very welcome". In my limited experience (one PR), the Erlang team is very responsive to patches. > > Later on we could agree on which options we want to have as standard. > > BTW, I found an informative slide show [1] on the history of gofmt. This slide describes how gofmt became the standard:https://talks.golang.org/2015/ gofmt-en.slide#26 Some other bullets from the slideshow that I found interesting: * No knobs! * Missing insight: "good enough" uniform formatting style is better than having lots of different formats. * Value of style guide: Uniformity, not perfection. * Don't fret over line length control. * Instead, respect user: Consider line breaks in original source. * Single biggest mistake: comments not attached to AST nodes. Mark [1] https://talks.golang.org/2015/gofmt-en.slide#1 On Tue, Aug 30, 2016 at 6:56 AM, Pierre Fenoll wrote: > > "indentation only" or "full rewrite" > > erl_tidy or erl_prettypr:format is missing a lot of options. For example: > > A long spec might get broken down into multiple lines (and that's fine). > However I find it surprising (and hard to grep) that newlines are inserted > right after the -spec attribute. > > Options to toggle such behavior are I think needed in erl_tidy. > > Later on we could agree on which options we want to have as standard. > > > On 30 Aug 2016, at 09:54, Vlad Dumitrescu wrote: > > > > "indentation only" or "full rewrite" > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Blogging at markbucciarelli.com Tweeting @mbucc -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Wed Aug 31 14:04:08 2016 From: matthias@REDACTED (Matthias Lang) Date: Wed, 31 Aug 2016 14:04:08 +0200 Subject: [erlang-questions] how do I get emacs nXML to work with Erlang documentation? (with answer) Message-ID: <20160831120408.luf7ohljbbsrh37q@corelatus.se> Hi, I have answers, but maybe someone can improve on them. I want emacs to "behave" when editing xml from the OTP repo, e.g. emacs lib/kernel/doc/src/notes.xml emacs tells me "Using scheme /usr/share/emacs/24.5/etc/schema/docbook.rnc and isn't happy with the document.
,

and are naughty. (actually, it's the nXML mode, which is the default mode for editing XML in recent emacs versions.). Q1: What is this .rnc file emacs is looking at? A1: .rnc and .dtd are both ways of defining what an XML document can look like, with overlapping capabilities. You can automatically convert one into the other, probably losing some information. Wild speculation: someone felt embarassed that XML .dtds aren't XML themselves, which might cause the plebs to think that the empreror has no clothes. So someone invented a new format 'Relax' which did more or less what DTDs do, in XML. But 'relax' was embarassingly verbose. Someone else then invented yet another format which was actually readable. The two inventors couldn't agree on which syntax to keep, so a committee stepped in to be decisive...and chose both. Q2: Why isn't emacs looking at the .dtd? A2: No idea. The .dtd can be converted to a .rnc automatically, so nXML could do that on the fly. Maybe the nXML author wants to hasten .dtd's death. Q3: I just want to edit the file without seeing errors. How? A3: M-x rnc-set-vacuous-schema Now nXML will just check for well-formedness (e.g. your tags match up). You can also do that from the XML menu. Q4: I want to get nXML to check more than just well-formedness. How? A4: Convert the .dtd into .rnc and tell nXML to use it. Here's one way: sudo apt-get install trang // OS-specific; install 'trang' cp /home/matthias/git/otp/lib/erl_docgen/priv/dtd/* . cp /home/matthias/git/otp/lib/erl_docgen/priv/dtd_html_entities/*ent . trang chapter.dtd chapter.rnc you now have a .rnc file. You can tell emacs to use it with C-c C-s C-f chapter.rnc emacs will then dump a file in the same directory as the source to remind emacs to use 'chapter.rnc' automatically next time. For my workflow, it's easier to just use the vacuous schema. Q5: Should Erlang's documentation build process migrate from .dtd to .rnc? A5: I don't know. Wait-and-see is usually mostly painless. Matt From carmentorreslopez87@REDACTED Wed Aug 31 09:05:48 2016 From: carmentorreslopez87@REDACTED (=?utf-8?Q?Carmen_Torres_L=C3=B3pez?=) Date: Wed, 31 Aug 2016 09:05:48 +0200 Subject: [erlang-questions] concurrency bugs in Erlang Message-ID: Hello, I'm doing a research about concurrency bugs types that can be observed in languages based in actor model. I would like to know what kind of bugs can be observed frequently in Erlang? Has anyone experience a behavoir such as deadlocks, livelock, starvation, race conditions, order violation, etc.? I will appreciate any pointer of an example code that generate these bugs. Best regards, Carmen -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias@REDACTED Wed Aug 31 16:18:06 2016 From: matthias@REDACTED (Matthias Lang) Date: Wed, 31 Aug 2016 16:18:06 +0200 Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? Message-ID: <20160831141806.uviuy6ix3ldolhip@corelatus.se> Hi, Pretty much all of the "not built in to OTP" ways to connect to other languages seem to have died, i.e. - EPI (C++). Last commit 2009. - py_interface (Python). Last commit 2014. Freshest of the lot. - edtk (C). Last release 2007. - dryverl (C). Last release 2008. - erlua (Lua). Project page dead. Author's email is dead. - erlualib (last commit 2010). Github-linked company page dead. Can anyone offer some experiences or ideas why? Could it be that these types of solutions are rarely needed? Maybe NIFs are unbeatable for the "narrow interface, no state, high performance" cases and port programs with hand-rolled interfaces most of the rest. Matt From benmmurphy@REDACTED Wed Aug 31 16:21:46 2016 From: benmmurphy@REDACTED (Ben Murphy) Date: Wed, 31 Aug 2016 15:21:46 +0100 Subject: [erlang-questions] concurrency bugs in Erlang In-Reply-To: References: Message-ID: I have had experience with deadlocks and OTP gen_fsm/gen_server code. One way of thinking of gen_server is just a way of having a bunch of methods that wrap some common data under a mutex. So if you have gen_servers calling other gen_servers and then calling back into the original gen_server then you create a deadlock. If you have enough indirection then it is possible to write code that does this without realising it. We actually had this problem with an opensource library: https://github.com/iamaleksey/oserl I can't remember exactly if it was because of the library itself or how we were using it. However, we rewrote the library to handle a single smpp connection using a single gen_server process instead of using a combination of gen_fsm and a gen_server which fixed all of our deadlock issues. On Wed, Aug 31, 2016 at 8:05 AM, Carmen Torres L?pez wrote: > Hello, > > I'm doing a research about concurrency bugs types that can be observed in > languages based in actor model. I would like to know what kind of bugs can > be observed frequently in Erlang? Has anyone experience a behavoir such as > deadlocks, livelock, starvation, race conditions, order violation, etc.? > I will appreciate any pointer of an example code that generate these bugs. > > Best regards, > Carmen > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From benmmurphy@REDACTED Wed Aug 31 16:26:16 2016 From: benmmurphy@REDACTED (Ben Murphy) Date: Wed, 31 Aug 2016 15:26:16 +0100 Subject: [erlang-questions] concurrency bugs in Erlang In-Reply-To: References: Message-ID: Actually. More information here on the issue: https://github.com/iamaleksey/oserl/issues/1 On Wed, Aug 31, 2016 at 3:21 PM, Ben Murphy wrote: > I have had experience with deadlocks and OTP gen_fsm/gen_server code. > One way of thinking of gen_server is just a way of having a bunch of > methods that wrap some common data under a mutex. So if you have > gen_servers calling other gen_servers and then calling back into the > original gen_server then you create a deadlock. If you have enough > indirection then it is possible to write code that does this without > realising it. > > We actually had this problem with an opensource library: > > https://github.com/iamaleksey/oserl > > I can't remember exactly if it was because of the library itself or > how we were using it. However, we rewrote the library to handle a > single smpp connection using a single gen_server process instead of > using a combination of gen_fsm and a gen_server which fixed all of our > deadlock issues. > > On Wed, Aug 31, 2016 at 8:05 AM, Carmen Torres L?pez > wrote: >> Hello, >> >> I'm doing a research about concurrency bugs types that can be observed in >> languages based in actor model. I would like to know what kind of bugs can >> be observed frequently in Erlang? Has anyone experience a behavoir such as >> deadlocks, livelock, starvation, race conditions, order violation, etc.? >> I will appreciate any pointer of an example code that generate these bugs. >> >> Best regards, >> Carmen >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> From john.hughes@REDACTED Wed Aug 31 16:57:42 2016 From: john.hughes@REDACTED (john.hughes@REDACTED) Date: Wed, 31 Aug 2016 16:57:42 +0200 Subject: [erlang-questions] concurrency bugs in Erlang In-Reply-To: References: Message-ID: <87253350782445B2AFD8ACB72CCD38EE@JohnsTablet2014> A few years ago we used QuickCheck to track down some interesting race conditions in dets (the disk storage back end used with Erlang's database mnesia). There's a paper about it in the Erlang Workshop 2011, which you might find interesting. http://dl.acm.org/citation.cfm?id=2034667&dl=ACM&coll=DL&CFID=832433409&CFTOKEN=89856408 John -----Original Message----- From: Ben Murphy Sent: Wednesday, August 31, 2016 4:26 PM To: Carmen Torres L?pez Cc: Erlang-Questions Questions Subject: Re: [erlang-questions] concurrency bugs in Erlang Actually. More information here on the issue: https://github.com/iamaleksey/oserl/issues/1 On Wed, Aug 31, 2016 at 3:21 PM, Ben Murphy wrote: > I have had experience with deadlocks and OTP gen_fsm/gen_server code. > One way of thinking of gen_server is just a way of having a bunch of > methods that wrap some common data under a mutex. So if you have > gen_servers calling other gen_servers and then calling back into the > original gen_server then you create a deadlock. If you have enough > indirection then it is possible to write code that does this without > realising it. > > We actually had this problem with an opensource library: > > https://github.com/iamaleksey/oserl > > I can't remember exactly if it was because of the library itself or > how we were using it. However, we rewrote the library to handle a > single smpp connection using a single gen_server process instead of > using a combination of gen_fsm and a gen_server which fixed all of our > deadlock issues. > > On Wed, Aug 31, 2016 at 8:05 AM, Carmen Torres L?pez > wrote: >> Hello, >> >> I'm doing a research about concurrency bugs types that can be observed in >> languages based in actor model. I would like to know what kind of bugs >> can >> be observed frequently in Erlang? Has anyone experience a behavoir such >> as >> deadlocks, livelock, starvation, race conditions, order violation, etc.? >> I will appreciate any pointer of an example code that generate these >> bugs. >> >> Best regards, >> Carmen >> >> _______________________________________________ >> 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 pierrefenoll@REDACTED Wed Aug 31 17:06:03 2016 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Wed, 31 Aug 2016 17:06:03 +0200 Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? In-Reply-To: <20160831141806.uviuy6ix3ldolhip@corelatus.se> References: <20160831141806.uviuy6ix3ldolhip@corelatus.se> Message-ID: For Rust: - https://github.com/hansihe/Rustler 5 hours ago - https://github.com/erszcz/erlang-rust-nif 2015 Cheers, -- Pierre Fenoll On 31 August 2016 at 16:18, Matthias Lang wrote: > Hi, > > Pretty much all of the "not built in to OTP" ways to connect to other > languages seem to have died, i.e. > > - EPI (C++). Last commit 2009. > - py_interface (Python). Last commit 2014. Freshest of the lot. > - edtk (C). Last release 2007. > - dryverl (C). Last release 2008. > - erlua (Lua). Project page dead. Author's email is dead. > - erlualib (last commit 2010). Github-linked company page dead. > > Can anyone offer some experiences or ideas why? > > Could it be that these types of solutions are rarely needed? Maybe > NIFs are unbeatable for the "narrow interface, no state, high > performance" cases and port programs with hand-rolled interfaces most > of the rest. > > Matt > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vans_163@REDACTED Wed Aug 31 16:50:03 2016 From: vans_163@REDACTED (Vans S) Date: Wed, 31 Aug 2016 14:50:03 +0000 (UTC) Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? In-Reply-To: <20160831141806.uviuy6ix3ldolhip@corelatus.se> References: <20160831141806.uviuy6ix3ldolhip@corelatus.se> Message-ID: <564810887.1109458.1472655003818@mail.yahoo.com> You should really be using NIFS to interface with C, C++, Rust and others. Python is well supported, so apparently is Ruby (I only used python) through erlports. Look at the forks of erlports esp by beano,?https://github.com/beano/erlport Why would you want to use lua. Erlang is a much better replacement. And if you really need Lua then use C Nifs to load + execute the lua. Lua is so simple to integrate, you really don't need an entire library for that, just a simple C NIF. On Wednesday, August 31, 2016 10:18 AM, Matthias Lang wrote: Hi, Pretty much all of the "not built in to OTP" ways to connect to other languages seem to have died, i.e. ? - EPI (C++). Last commit 2009. ? - py_interface (Python). Last commit 2014. Freshest of the lot. ? - edtk (C). Last release 2007. ? - dryverl (C). Last release 2008. ? - erlua (Lua). Project page dead. Author's email is dead. ? - erlualib (last commit 2010). Github-linked company page dead. Can anyone offer some experiences or ideas why? Could it be that these types of solutions are rarely needed? Maybe NIFs are unbeatable for the "narrow interface, no state, high performance" cases and port programs with hand-rolled interfaces most of the rest. Matt _______________________________________________ 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 Wed Aug 31 17:36:22 2016 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 31 Aug 2016 17:36:22 +0200 Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? In-Reply-To: <20160831141806.uviuy6ix3ldolhip@corelatus.se> References: <20160831141806.uviuy6ix3ldolhip@corelatus.se> Message-ID: On 31 August 2016 at 16:18, Matthias Lang wrote: > Hi, > > Pretty much all of the "not built in to OTP" ways to connect to other > languages seem to have died, i.e. > > - EPI (C++). Last commit 2009. > - py_interface (Python). Last commit 2014. Freshest of the lot. > - edtk (C). Last release 2007. > - dryverl (C). Last release 2008. > - erlua (Lua). Project page dead. Author's email is dead. > - erlualib (last commit 2010). Github-linked company page dead. > > Can anyone offer some experiences or ideas why? > > Could it be that these types of solutions are rarely needed? Maybe > NIFs are unbeatable for the "narrow interface, no state, high > performance" cases and port programs with hand-rolled interfaces most > of the rest. https://hackage.haskell.org/package/erlang (alive) https://github.com/jlouis/erlangnode (alive; not sure how complete) https://github.com/EchoTeam/ocaml-erlang-port (very stable or abandoned) From g@REDACTED Wed Aug 31 17:50:30 2016 From: g@REDACTED (Garrett Smith) Date: Wed, 31 Aug 2016 10:50:30 -0500 Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? In-Reply-To: References: <20160831141806.uviuy6ix3ldolhip@corelatus.se> Message-ID: On Wed, Aug 31, 2016 at 10:36 AM, Tuncer Ayaz wrote: > On 31 August 2016 at 16:18, Matthias Lang wrote: >> Hi, >> >> Pretty much all of the "not built in to OTP" ways to connect to other >> languages seem to have died, i.e. >> >> - EPI (C++). Last commit 2009. >> - py_interface (Python). Last commit 2014. Freshest of the lot. >> - edtk (C). Last release 2007. >> - dryverl (C). Last release 2008. >> - erlua (Lua). Project page dead. Author's email is dead. >> - erlualib (last commit 2010). Github-linked company page dead. >> >> Can anyone offer some experiences or ideas why? >> >> Could it be that these types of solutions are rarely needed? Maybe >> NIFs are unbeatable for the "narrow interface, no state, high >> performance" cases and port programs with hand-rolled interfaces most >> of the rest. > > https://hackage.haskell.org/package/erlang (alive) > https://github.com/jlouis/erlangnode (alive; not sure how complete) > https://github.com/EchoTeam/ocaml-erlang-port (very stable or abandoned) > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions I think in these distributed scenarios the go to protocol is something language agnostic like something-over-http. Personally I would not go around trying to get other languages to speak the Erlang wire protocol. I've used the Java libraries to build nodes and they worked, but I wouldn't do it again. Instead I'd use something like 0MQ or again the ponderously inefficient but ubiquitous something-over-http. If I need to integrate with other languages more closely, I'll use the port interface. Here's a terrific example of how that can be extended into various lanauges: http://erlport.org/ Unless a NIF is simple and well established as non-crashy, I'll write performance critical code as a C port. People don't like this because of the emotionally crushing thought of serializing data over stdio. While that's laughably inefficient when compared to zippy NIFs (troll), the code remains isolated and can crash all it wants without bringing down the entire VM. It also encourages an interface design that minimizes IO -- you performed as much work as you can on either end and pass small results back and forth. From essen@REDACTED Wed Aug 31 19:26:17 2016 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Wed, 31 Aug 2016 19:26:17 +0200 Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? In-Reply-To: References: <20160831141806.uviuy6ix3ldolhip@corelatus.se> Message-ID: <0ed31f6f-75e9-09e1-dbc9-82a728c5de8b@ninenines.eu> On 08/31/2016 05:50 PM, Garrett Smith wrote: > On Wed, Aug 31, 2016 at 10:36 AM, Tuncer Ayaz wrote: >> On 31 August 2016 at 16:18, Matthias Lang wrote: >>> Hi, >>> >>> Pretty much all of the "not built in to OTP" ways to connect to other >>> languages seem to have died, i.e. >>> >>> - EPI (C++). Last commit 2009. >>> - py_interface (Python). Last commit 2014. Freshest of the lot. >>> - edtk (C). Last release 2007. >>> - dryverl (C). Last release 2008. >>> - erlua (Lua). Project page dead. Author's email is dead. >>> - erlualib (last commit 2010). Github-linked company page dead. >>> >>> Can anyone offer some experiences or ideas why? >>> >>> Could it be that these types of solutions are rarely needed? Maybe >>> NIFs are unbeatable for the "narrow interface, no state, high >>> performance" cases and port programs with hand-rolled interfaces most >>> of the rest. >> >> https://hackage.haskell.org/package/erlang (alive) >> https://github.com/jlouis/erlangnode (alive; not sure how complete) >> https://github.com/EchoTeam/ocaml-erlang-port (very stable or abandoned) >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > I think in these distributed scenarios the go to protocol is something > language agnostic like something-over-http. > > Personally I would not go around trying to get other languages to > speak the Erlang wire protocol. I've used the Java libraries to build > nodes and they worked, but I wouldn't do it again. Instead I'd use > something like 0MQ or again the ponderously inefficient but ubiquitous > something-over-http. I wouldn't dismiss HTTP as inefficient. It's inefficient for RPC, which is how most people use HTTP (even when they call it REST). But if you use HTTP entirely then you have the options of caching proxies and caching on the client side that can easily be plugged in and get rid of most issues (other issues being largely fixed by HTTP/2). -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From ilya.khaprov@REDACTED Wed Aug 31 18:36:40 2016 From: ilya.khaprov@REDACTED (Ilya Khaprov) Date: Wed, 31 Aug 2016 19:36:40 +0300 Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? Message-ID: Hello, Here is a library for writing nodes in Common Lisp: https://github.com/flambard/CLERIC. Last time I checked it worked. Ilya. From: Matthias Lang Sent: 31 ??????? 2016 ?. 17:18 To: erlang-questions@REDACTED Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? Hi, Pretty much all of the "not built in to OTP" ways to connect to other languages seem to have died, i.e. - EPI (C++). Last commit 2009. - py_interface (Python). Last commit 2014. Freshest of the lot. - edtk (C). Last release 2007. - dryverl (C). Last release 2008. - erlua (Lua). Project page dead. Author's email is dead. - erlualib (last commit 2010). Github-linked company page dead. Can anyone offer some experiences or ideas why? Could it be that these types of solutions are rarely needed? Maybe NIFs are unbeatable for the "narrow interface, no state, high performance" cases and port programs with hand-rolled interfaces most of the rest. Matt _______________________________________________ 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 Wed Aug 31 20:25:01 2016 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 31 Aug 2016 20:25:01 +0200 Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? In-Reply-To: References: <20160831141806.uviuy6ix3ldolhip@corelatus.se> Message-ID: On Wed, Aug 31, 2016 at 5:36 PM, Tuncer Ayaz wrote: > https://github.com/jlouis/erlangnode (alive; not sure how complete) > Reasonably complete. All the ground types work and have been tested, but some of the more esoteric values (Ref's) have not been checked a lot and if you send them roundtrip they might be garbled. Another bug I know is that there is no way to send a message larger than the inbound buffer (256kilobytes currently). In principle, the code should expand the buffer itself, but there is a bug which makes this not work. I have not yet investigated. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Wed Aug 31 20:46:49 2016 From: mjtruog@REDACTED (Michael Truog) Date: Wed, 31 Aug 2016 11:46:49 -0700 Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? In-Reply-To: <20160831141806.uviuy6ix3ldolhip@corelatus.se> References: <20160831141806.uviuy6ix3ldolhip@corelatus.se> Message-ID: <57C72619.2080505@gmail.com> py_interface is GPL, which may explain less use (I did https://github.com/okeuday/erlang_py/ to make sure I had a BSD licensed dependency) edtk depended on an obscure scripting language (I did https://github.com/okeuday/GEPD/ to get EDTK functionality that only depends on the preprocessor, however clang doesn't like boost preprocessor yet, haven't needed to add NIF generation to it) Other interface to language X projects that are alive include http://cloudi.org (C/C++, Erlang/Elixir, Java, JavaScript/node.js, Perl, PHP, Python and Ruby) https://github.com/okeuday/erlang_rb https://github.com/okeuday/erlang_js https://github.com/okeuday/erlang_pl https://github.com/okeuday/erlang_php On 08/31/2016 07:18 AM, Matthias Lang wrote: > Hi, > > Pretty much all of the "not built in to OTP" ways to connect to other > languages seem to have died, i.e. > > - EPI (C++). Last commit 2009. > - py_interface (Python). Last commit 2014. Freshest of the lot. > - edtk (C). Last release 2007. > - dryverl (C). Last release 2008. > - erlua (Lua). Project page dead. Author's email is dead. > - erlualib (last commit 2010). Github-linked company page dead. > > Can anyone offer some experiences or ideas why? > > Could it be that these types of solutions are rarely needed? Maybe > NIFs are unbeatable for the "narrow interface, no state, high > performance" cases and port programs with hand-rolled interfaces most > of the rest. > > Matt > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From mjtruog@REDACTED Wed Aug 31 20:49:29 2016 From: mjtruog@REDACTED (Michael Truog) Date: Wed, 31 Aug 2016 11:49:29 -0700 Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? In-Reply-To: References: <20160831141806.uviuy6ix3ldolhip@corelatus.se> Message-ID: <57C726B9.7000303@gmail.com> On 08/31/2016 08:50 AM, Garrett Smith wrote: > On Wed, Aug 31, 2016 at 10:36 AM, Tuncer Ayaz wrote: >> On 31 August 2016 at 16:18, Matthias Lang wrote: >>> Hi, >>> >>> Pretty much all of the "not built in to OTP" ways to connect to other >>> languages seem to have died, i.e. >>> >>> - EPI (C++). Last commit 2009. >>> - py_interface (Python). Last commit 2014. Freshest of the lot. >>> - edtk (C). Last release 2007. >>> - dryverl (C). Last release 2008. >>> - erlua (Lua). Project page dead. Author's email is dead. >>> - erlualib (last commit 2010). Github-linked company page dead. >>> >>> Can anyone offer some experiences or ideas why? >>> >>> Could it be that these types of solutions are rarely needed? Maybe >>> NIFs are unbeatable for the "narrow interface, no state, high >>> performance" cases and port programs with hand-rolled interfaces most >>> of the rest. >> https://hackage.haskell.org/package/erlang (alive) >> https://github.com/jlouis/erlangnode (alive; not sure how complete) >> https://github.com/EchoTeam/ocaml-erlang-port (very stable or abandoned) >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > I think in these distributed scenarios the go to protocol is something > language agnostic like something-over-http. > > Personally I would not go around trying to get other languages to > speak the Erlang wire protocol. I've used the Java libraries to build > nodes and they worked, but I wouldn't do it again. Instead I'd use > something like 0MQ or again the ponderously inefficient but ubiquitous > something-over-http. > > If I need to integrate with other languages more closely, I'll use the > port interface. Here's a terrific example of how that can be extended > into various lanauges: > > http://erlport.org/ > > Unless a NIF is simple and well established as non-crashy, I'll write > performance critical code as a C port. People don't like this because > of the emotionally crushing thought of serializing data over stdio. > While that's laughably inefficient when compared to zippy NIFs > (troll), the code remains isolated and can crash all it wants without > bringing down the entire VM. It also encourages an interface design > that minimizes IO -- you performed as much work as you can on either > end and pass small results back and forth. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > Based on https://github.com/hdima/erlport/issues/15 erlport isn't accepting changes and is dead. From g@REDACTED Wed Aug 31 20:55:15 2016 From: g@REDACTED (Garrett Smith) Date: Wed, 31 Aug 2016 13:55:15 -0500 Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? In-Reply-To: <57C726B9.7000303@gmail.com> References: <20160831141806.uviuy6ix3ldolhip@corelatus.se> <57C726B9.7000303@gmail.com> Message-ID: On Wed, Aug 31, 2016 at 1:49 PM, Michael Truog wrote: > On 08/31/2016 08:50 AM, Garrett Smith wrote: >> > Based on https://github.com/hdima/erlport/issues/15 erlport isn't accepting > changes and is dead. There aren't many Erlang projects that don't have a bus count of ~ 1 :) Nonetheless this is a very impressive project and its patterns can be applied to any language. In terms of providing access to external libraries, I'd take this route over the distributed Erlang protocol. From daniel.goertzen@REDACTED Wed Aug 31 20:57:24 2016 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Wed, 31 Aug 2016 18:57:24 +0000 Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? In-Reply-To: <20160831141806.uviuy6ix3ldolhip@corelatus.se> References: <20160831141806.uviuy6ix3ldolhip@corelatus.se> Message-ID: I think you are correct that these solutions are rarely needed. As author of NIFPP I see very little traffic at https://github.com/goertzenator/nifpp which gives me the impression that few people use it. Also there are multiple paths to integration (ports vs c-node vs NIFs) so this maybe creates fragmentation and further reduces traction for any one project. The EPI project you pointed out deals with EI which is completely orthogonal to NIFPP. And another reason is tooling. Do I need to jury rig a weird build system to make this thing go, or will it just work with rebar/erlang.mk? If it's too much hassle to use, then I'll just skip it. This is an area I've been trying to improve for Rust (https://github.com/goertzenator/rust.mk) On Wed, Aug 31, 2016 at 9:18 AM Matthias Lang wrote: > Hi, > > Pretty much all of the "not built in to OTP" ways to connect to other > languages seem to have died, i.e. > > - EPI (C++). Last commit 2009. > - py_interface (Python). Last commit 2014. Freshest of the lot. > - edtk (C). Last release 2007. > - dryverl (C). Last release 2008. > - erlua (Lua). Project page dead. Author's email is dead. > - erlualib (last commit 2010). Github-linked company page dead. > > Can anyone offer some experiences or ideas why? > > Could it be that these types of solutions are rarely needed? Maybe > NIFs are unbeatable for the "narrow interface, no state, high > performance" cases and port programs with hand-rolled interfaces most > of the rest. > > Matt > _______________________________________________ > 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 Wed Aug 31 20:58:01 2016 From: g@REDACTED (Garrett Smith) Date: Wed, 31 Aug 2016 13:58:01 -0500 Subject: [erlang-questions] Why do "interface to language X" projects all seem to die out? In-Reply-To: References: <20160831141806.uviuy6ix3ldolhip@corelatus.se> <57C726B9.7000303@gmail.com> Message-ID: On Wed, Aug 31, 2016 at 1:55 PM, Garrett Smith wrote: > On Wed, Aug 31, 2016 at 1:49 PM, Michael Truog wrote: >> On 08/31/2016 08:50 AM, Garrett Smith wrote: >>> >> Based on https://github.com/hdima/erlport/issues/15 erlport isn't accepting >> changes and is dead. > > There aren't many Erlang projects that don't have a bus count of ~ 1 :) > > Nonetheless this is a very impressive project and its patterns can be > applied to any language. > > In terms of providing access to external libraries, I'd take this > route over the distributed Erlang protocol. We're also talking about interfaces that rarely change, to someone's earlier point.