From behradz@REDACTED Wed Jan 1 21:38:04 2014 From: behradz@REDACTED (Behrad) Date: Thu, 2 Jan 2014 00:08:04 +0330 Subject: [erlang-questions] Frequent eaddrnotavail in httpc Message-ID: I randomly receive eaddrnotavail (and some socket_closed_remotely) when connecting to a remote CouchDB in a high concurrency of processing some events in my erlang process. Since there are many other http connections between my process and nodejs and redis services on the same local machine, I've increased OS's local_port_range and ERL_MAX_PORTS but still got that error. When getting the error, retrying the http request gets OK. Any other OS or Erlang specific tuning? or what? -------------- next part -------------- An HTML attachment was scrubbed... URL: From behradz@REDACTED Thu Jan 2 10:28:45 2014 From: behradz@REDACTED (Behrad Zari) Date: Thu, 2 Jan 2014 01:28:45 -0800 (PST) Subject: [erlang-questions] Frequent eaddrnotavail in httpc In-Reply-To: References: Message-ID: <24207598-eda6-4d0b-8f01-247bf589e7db@googlegroups.com> I forget to tell that I've also increased system ulimit, On Thursday, January 2, 2014 12:08:04 AM UTC+3:30, Behrad Zari wrote: > > I randomly receive eaddrnotavail (and some socket_closed_remotely) when > connecting to a remote CouchDB in a high concurrency of processing some > events in my erlang process. Since there are many other http connections > between my process and nodejs and redis services on the same local machine, > I've increased OS's local_port_range and ERL_MAX_PORTS but still got that > error. > When getting the error, retrying the http request gets OK. > > Any other OS or Erlang specific tuning? or what? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Thu Jan 2 10:54:48 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Thu, 2 Jan 2014 10:54:48 +0100 (CET) Subject: [erlang-questions] ssl issue In-Reply-To: References: Message-ID: <175243525.6557.1388656488098.JavaMail.zimbra@tpip.net> Hi Loco, The root cause of this problem is the elliptic curve used in the ECDHE key exchange. Chrome (and probably the other failing clients) support only a limited set of curves (chrome only does secp256r1, secp384r1 and secp521r1). Erlang's ECDHE support is currently hard coded to always use secp256k1. Obviously, this will not work. Excluding all ECDHE cipher suites will work around that problem. The correct fix will be to teach Erlang SSL to select the correct curve. Andreas ----- Original Message ----- > > > Hi, > > I am having an issue getting ssl to work > > Hi, > > I am having an ssl issue > > The following gist > > > https://gist.github.com/locojay/8188721 > > list?s how to install my setup (ubuntu 12.04 vagrant box, esl erlang R16B03, > ssl 5.3.2, cowboy's ssl_example on master). > > > I tested the following clients: > > > - curl, chrome , firefox, safari, python requests > > on ubuntu 12.10 and osx 10.9 mavericks > > with the following result's > > > > > CHROME | FIREFOX | SAFARI | CURL > > UBUNTU fails | fails | na | works > > OSX fails | fails(long stacktrace) | fails | fails > > > > > the gist contains server/client log?s for these options > > > > > I'm using the cowboy ssl example to demonstrate my problem. Using an other > self signed, or signed certificate results in the same issue. > > Creating a pem file of the example key, cert ca-cert and using in ejabberd > 13.12 works fine with all browser?s. > > which:applications() in ejabberd 13.12 return?s ssl 5.3.2 > > I am confused since i thought that the issue would have been the ssl app > since we have > > > cowboy ?> ranch ?> sslapp > > I am out of idea?s and would really appreciate any help > > Many thanks > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- -- Dipl. Inform. Andreas Schultz email: as@REDACTED phone: +49-391-819099-224 mobil: +49-170-2226073 ------------------- enabling your networks ------------------- Travelping GmbH phone: +49-391-819099229 Roentgenstr. 13 fax: +49-391-819099299 D-39108 Magdeburg email: info@REDACTED GERMANY web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 -------------------------------------------------------------- From aschultz@REDACTED Thu Jan 2 11:46:05 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Thu, 2 Jan 2014 11:46:05 +0100 (CET) Subject: [erlang-questions] ssl issue In-Reply-To: <175243525.6557.1388656488098.JavaMail.zimbra@tpip.net> References: <175243525.6557.1388656488098.JavaMail.zimbra@tpip.net> Message-ID: <1901338465.15653.1388659565071.JavaMail.zimbra@tpip.net> Hi, Found it, curve selection in server mode is broken in at least R16B3 and R17. Fix send in github pull request: https://github.com/erlang/otp/pull/183 The same fix also applies to R16B3. Andreas ----- Original Message ----- > Hi Loco, > > The root cause of this problem is the elliptic curve used in the ECDHE key > exchange. Chrome (and probably the other failing clients) support only a > limited set of curves (chrome only does secp256r1, secp384r1 and secp521r1). > > Erlang's ECDHE support is currently hard coded to always use secp256k1. > > Obviously, this will not work. Excluding all ECDHE cipher suites will work > around that problem. The correct fix will be to teach Erlang SSL to select > the correct curve. > > Andreas > > ----- Original Message ----- > > > > > > Hi, > > > > I am having an issue getting ssl to work > > > > Hi, > > > > I am having an ssl issue > > > > The following gist > > > > > > https://gist.github.com/locojay/8188721 > > > > list?s how to install my setup (ubuntu 12.04 vagrant box, esl erlang > > R16B03, > > ssl 5.3.2, cowboy's ssl_example on master). > > > > > > I tested the following clients: > > > > > > - curl, chrome , firefox, safari, python requests > > > > on ubuntu 12.10 and osx 10.9 mavericks > > > > with the following result's > > > > > > > > > > CHROME | FIREFOX | SAFARI | CURL > > > > UBUNTU fails | fails | na | works > > > > OSX fails | fails(long stacktrace) | fails | fails > > > > > > > > > > the gist contains server/client log?s for these options > > > > > > > > > > I'm using the cowboy ssl example to demonstrate my problem. Using an other > > self signed, or signed certificate results in the same issue. > > > > Creating a pem file of the example key, cert ca-cert and using in ejabberd > > 13.12 works fine with all browser?s. > > > > which:applications() in ejabberd 13.12 return?s ssl 5.3.2 > > > > I am confused since i thought that the issue would have been the ssl app > > since we have > > > > > > cowboy ?> ranch ?> sslapp > > > > I am out of idea?s and would really appreciate any help > > > > Many thanks > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > -- > Dipl. Inform. > Andreas Schultz > > email: as@REDACTED > phone: +49-391-819099-224 > mobil: +49-170-2226073 > > ------------------- enabling your networks ------------------- > > Travelping GmbH phone: +49-391-819099229 > Roentgenstr. 13 fax: +49-391-819099299 > D-39108 Magdeburg email: info@REDACTED > GERMANY web: http://www.travelping.com > > Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 > Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 > -------------------------------------------------------------- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- -- Dipl. Inform. Andreas Schultz email: as@REDACTED phone: +49-391-819099-224 mobil: +49-170-2226073 ------------------- enabling your networks ------------------- Travelping GmbH phone: +49-391-819099229 Roentgenstr. 13 fax: +49-391-819099299 D-39108 Magdeburg email: info@REDACTED GERMANY web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 -------------------------------------------------------------- From garazdawi@REDACTED Thu Jan 2 12:04:44 2014 From: garazdawi@REDACTED (Lukas Larsson) Date: Thu, 2 Jan 2014 12:04:44 +0100 Subject: [erlang-questions] gen_tcp/ssl send function and large binaries, should I split? In-Reply-To: References: Message-ID: Hello, As always with these things you should measure your specific scenario and see if it is worth it for you. Purely theritically[1] I would imagine that the above loop would add a little bit of overhead, mainly from the fact that the total number of function calls goes up. The C code in the inet_driver should be largely unaffected by this as it would only append the data to its own queue. I would be surprised if you could measure any difference in throughput. So I would recommend using the simpler `Transport:send(Socket, Data)` unless you actually can measure a difference. Lukas [1]: for gen_tcp, I don't know much about how ssl does things, the encryption parts could effect this. On Mon, Dec 30, 2013 at 12:58 PM, Benoit Chesneau wrote: > Hi all, > > Actually when I send a large binary I split it chunk of 64MB and loop > until the end: > > > send(<>, Transport, Socket) -> > Transport:send(Socket, Data); > send(Data, Transport, Socket) -> > Transport:send(Socket, Data). > > > But I wonder if it's really useful, Does gen_tcp:semd and ssl:send take > care about it? Should I just use `Transport:send(Socket, Data)` ? > > > - benoit > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From garazdawi@REDACTED Thu Jan 2 12:23:20 2014 From: garazdawi@REDACTED (Lukas Larsson) Date: Thu, 2 Jan 2014 12:23:20 +0100 Subject: [erlang-questions] How to get at data_dir from all/0 and groups/0 callbacks in common_test In-Reply-To: References: Message-ID: Hello, Unfortunately I don't think there is a way to do this. We've been talking for a long time about adding someway to generate and parameterize testcases for common_test, but so far there has not been enough time available to come up with a good solution. I would not consider it bad form at all to want to do this, but it is quite awkward with the currently available functionality. You could (not saying it is a good or future compatible approach) use the location of the current ?MODULE to calculate the location of the _data dir. Lukas On Sun, Dec 15, 2013 at 9:46 PM, Peer Stritzinger wrote: > I'd like to auto-generate my testcases from the files found in the > data_dir. > > Unfortunately I don't get passed a Config in my all/0 and groups/0 > testsuite callbacks. > > Is there another way of obtaining the path to data_dir in these callbacks? > > Or is it considered bad form to generate testcases from the files in > data_dir (I could still iterate over the files in data_dir in single > testcases whicht would do the same but have much worse reporting) > > Cheers, > -- Peer > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seancribbs@REDACTED Thu Jan 2 20:26:42 2014 From: seancribbs@REDACTED (Sean Cribbs) Date: Thu, 2 Jan 2014 13:26:42 -0600 Subject: [erlang-questions] Dialyzer bugs help Message-ID: Hi, I'm trying to use dialyzer to remove a few typing bugs from neotoma ( github.com/seancribbs/neotoma/tree/dialyzer) so that generated parsers will not contain them. However, I've hit a wall and need some help, I'm hoping someone here will be able to interpret these better than me (see also https://gist.github.com/seancribbs/8210317): Checking whether the PLT neotoma.plt is up-to-date... yes Proceeding with analysis... peg_includes.hrl:85: The created fun has no local return peg_includes.hrl:86: Fun application will fail since P :: none() is not a function of arity 2 peg_includes.hrl:201: The created fun has no local return neotoma.erl:52: Guard test not(is_atom(ModName::atom())) can never succeed neotoma.erl:124: Function bootstrap/0 has no local return done in 0m2.41s done (warnings were emitted) The weird thing is, the variable P on peg_includes.hrl:86 is a known type, but something is causing it to think the type cannot be resolved. Here's the function in question (the positive lookahead combinator): -spec p_assert(parse_fun()) -> parse_fun(). p_assert(P) -> fun(Input,Index) -> case P(Input,Index) of {fail,_} = Failure-> Failure; _ -> {[], Input, Index} end end. Interestingly, that combinator is not called by anything in the parser in question (a separate issue to be resolved). Thanks in advance, Sean Cribbs -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Thu Jan 2 22:09:04 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Thu, 2 Jan 2014 22:09:04 +0100 Subject: [erlang-questions] Dialyzer bugs help In-Reply-To: References: Message-ID: Hello Sean, Replied inline. Regards, -- Anthony Ramine Le 2 janv. 2014 ? 20:26, Sean Cribbs a ?crit : > Hi, > > I'm trying to use dialyzer to remove a few typing bugs from neotoma (github.com/seancribbs/neotoma/tree/dialyzer) so that generated parsers will not contain them. However, I've hit a wall and need some help, I'm hoping someone here will be able to interpret these better than me (see also https://gist.github.com/seancribbs/8210317): > > Checking whether the PLT neotoma.plt is up-to-date... yes > Proceeding with analysis... > peg_includes.hrl:85: The created fun has no local return > peg_includes.hrl:86: Fun application will fail since P :: none() is not a function of arity 2 > peg_includes.hrl:201: The created fun has no local return Still fighting these two. > neotoma.erl:52: Guard test not(is_atom(ModName::atom())) can never succeed In file/2 line 31, you pass ModuleName to atom_to_list: OutputFilename = filename:join(OutputDir, atom_to_list(ModuleName) ++ ".erl"), You then pass that it validate_params/4: validate_params(filename:absname(InputGrammar), ModuleName, TransformModule, filename:absname(OutputFilename)), After line 31, Dialyzer knows ModuleName can?t be anything but an atom. > neotoma.erl:124: Function bootstrap/0 has no local return In bootstrap/0, you use an option ?neotoma_priv_dir? which isn?t in type option(). > done in 0m2.41s > done (warnings were emitted) > > > The weird thing is, the variable P on peg_includes.hrl:86 is a known type, but something is causing it to think the type cannot be resolved. > > Here's the function in question (the positive lookahead combinator): > > -spec p_assert(parse_fun()) -> parse_fun(). > p_assert(P) -> > fun(Input,Index) -> > case P(Input,Index) of > {fail,_} = Failure-> Failure; > _ -> {[], Input, Index} > end > end. > > Interestingly, that combinator is not called by anything in the parser in question (a separate issue to be resolved). > > Thanks in advance, > > Sean Cribbs > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From n.oxyde@REDACTED Thu Jan 2 22:19:39 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Thu, 2 Jan 2014 22:19:39 +0100 Subject: [erlang-questions] Dialyzer bugs help In-Reply-To: References: Message-ID: <708607E5-592D-46BC-B6AC-61F2C7A038B5@gmail.com> Hello again Sean, hello Kostis, There is something in Dialyzer that makes it say weird stuff about unused unexported functions. -module(t). -compile({nowarn_unused_function,[p_assert/1]}). -ifdef(EXPORT). -export([p_assert/1]). -endif. p_assert(P) -> fun(Input,Index) -> case P(Input,Index) of {fail,_} = Failure -> Failure; _ -> {[], Input, Index} end end. If compiled with -DEXPORT, Dialyzer stays silent; if compiled without, Dialyzer yells. Interestingly enough, it also unexpectedly yells if compiled with +export_all. Regards, -- Anthony Ramine Le 2 janv. 2014 ? 22:09, Anthony Ramine a ?crit : > Still fighting these two. From seancribbs@REDACTED Thu Jan 2 22:49:51 2014 From: seancribbs@REDACTED (Sean Cribbs) Date: Thu, 2 Jan 2014 15:49:51 -0600 Subject: [erlang-questions] Dialyzer bugs help In-Reply-To: <708607E5-592D-46BC-B6AC-61F2C7A038B5@gmail.com> References: <708607E5-592D-46BC-B6AC-61F2C7A038B5@gmail.com> Message-ID: Thanks Anthony! Kostis replied to me privately and we found what you did -- unused functions get none() type parameters because there's no type to infer. Not sure if this is a Dialyzer bug (the function had a spec!), or just a fact-of-life. This basically raised the fact I had been hacking around tracking which combinators were used/unused in the generated parser by injecting a -compile({nowarn_unused_function, [...]}) attribute into the generated code. Shame on me! I've rectified the issue for now using macros. The other errors are more trivial. On Thu, Jan 2, 2014 at 3:19 PM, Anthony Ramine wrote: > Hello again Sean, hello Kostis, > > There is something in Dialyzer that makes it say weird stuff about unused > unexported functions. > > -module(t). > > -compile({nowarn_unused_function,[p_assert/1]}). > > -ifdef(EXPORT). > -export([p_assert/1]). > -endif. > > p_assert(P) -> > fun(Input,Index) -> > case P(Input,Index) of > {fail,_} = Failure -> Failure; > _ -> {[], Input, Index} > end > end. > > If compiled with -DEXPORT, Dialyzer stays silent; if compiled without, > Dialyzer yells. > > Interestingly enough, it also unexpectedly yells if compiled with > +export_all. > > Regards, > > -- > Anthony Ramine > > Le 2 janv. 2014 ? 22:09, Anthony Ramine a ?crit : > > > Still fighting these two. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Thu Jan 2 23:03:28 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Thu, 2 Jan 2014 23:03:28 +0100 Subject: [erlang-questions] Dialyzer bugs help In-Reply-To: References: <708607E5-592D-46BC-B6AC-61F2C7A038B5@gmail.com> Message-ID: <433F5914-9A5B-404E-88D7-F98DB2777EF0@gmail.com> Well, even if the function is unused, such a warning seems quite wrong or at least very confusing. -- Anthony Ramine Le 2 janv. 2014 ? 22:49, Sean Cribbs a ?crit : > Thanks Anthony! > > Kostis replied to me privately and we found what you did -- unused functions get none() type parameters because there's no type to infer. Not sure if this is a Dialyzer bug (the function had a spec!), or just a fact-of-life. This basically raised the fact I had been hacking around tracking which combinators were used/unused in the generated parser by injecting a -compile({nowarn_unused_function, [...]}) attribute into the generated code. Shame on me! I've rectified the issue for now using macros. > > The other errors are more trivial. > > > On Thu, Jan 2, 2014 at 3:19 PM, Anthony Ramine wrote: > Hello again Sean, hello Kostis, > > There is something in Dialyzer that makes it say weird stuff about unused unexported functions. > > -module(t). > > -compile({nowarn_unused_function,[p_assert/1]}). > > -ifdef(EXPORT). > -export([p_assert/1]). > -endif. > > p_assert(P) -> > fun(Input,Index) -> > case P(Input,Index) of > {fail,_} = Failure -> Failure; > _ -> {[], Input, Index} > end > end. > > If compiled with -DEXPORT, Dialyzer stays silent; if compiled without, Dialyzer yells. > > Interestingly enough, it also unexpectedly yells if compiled with +export_all. > > Regards, > > -- > Anthony Ramine > > Le 2 janv. 2014 ? 22:09, Anthony Ramine a ?crit : > > > Still fighting these two. > > From mjtruog@REDACTED Thu Jan 2 23:56:10 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 02 Jan 2014 14:56:10 -0800 Subject: [erlang-questions] dict() type issue Message-ID: <52C5EE8A.2060003@gmail.com> Hi! The dict() type being defined as opaque prevents it from being checked with other dictionary implementations that rely on tuples. If you do "is_tuple(D), element(1, D) =:= dict" dialyzer will complain once it realizes that D is a dict(), despite the fact it is a tuple underneath the opaque type. To help with the migration to maps, a new function is_dict/1 could help check the type during runtime, in a way that doesn't anger dialyzer. Ideally, is_dict/1 would be a guard function, but I assume that is problematic unless it was added to the erlang module. Is there any reason we wouldn't want an is_dict/1 function? Thanks, Michael From locojaydev@REDACTED Fri Jan 3 03:34:15 2014 From: locojaydev@REDACTED (Loco Jay) Date: Thu, 2 Jan 2014 21:34:15 -0500 Subject: [erlang-questions] ssl issue In-Reply-To: <1901338465.15653.1388659565071.JavaMail.zimbra@tpip.net> References: <175243525.6557.1388656488098.JavaMail.zimbra@tpip.net> <1901338465.15653.1388659565071.JavaMail.zimbra@tpip.net> Message-ID: Thank you very much On Thursday, January 2, 2014, Andreas Schultz wrote: > Hi, > > Found it, curve selection in server mode is broken in at least R16B3 and > R17. > Fix send in github pull request: https://github.com/erlang/otp/pull/183 > > The same fix also applies to R16B3. > > Andreas > > ----- Original Message ----- > > Hi Loco, > > > > The root cause of this problem is the elliptic curve used in the ECDHE > key > > exchange. Chrome (and probably the other failing clients) support only a > > limited set of curves (chrome only does secp256r1, secp384r1 and > secp521r1). > > > > Erlang's ECDHE support is currently hard coded to always use secp256k1. > > > > Obviously, this will not work. Excluding all ECDHE cipher suites will > work > > around that problem. The correct fix will be to teach Erlang SSL to > select > > the correct curve. > > > > Andreas > > > > ----- Original Message ----- > > > > > > > > > Hi, > > > > > > I am having an issue getting ssl to work > > > > > > Hi, > > > > > > I am having an ssl issue > > > > > > The following gist > > > > > > > > > https://gist.github.com/locojay/8188721 > > > > > > list?s how to install my setup (ubuntu 12.04 vagrant box, esl erlang > > > R16B03, > > > ssl 5.3.2, cowboy's ssl_example on master). > > > > > > > > > I tested the following clients: > > > > > > > > > - curl, chrome , firefox, safari, python requests > > > > > > on ubuntu 12.10 and osx 10.9 mavericks > > > > > > with the following result's > > > > > > > > > > > > > > > CHROME | FIREFOX | SAFARI | CURL > > > > > > UBUNTU fails | fails | na | works > > > > > > OSX fails | fails(long stacktrace) | fails | fails > > > > > > > > > > > > > > > the gist contains server/client log?s for these options > > > > > > > > > > > > > > > I'm using the cowboy ssl example to demonstrate my problem. Using an > other > > > self signed, or signed certificate results in the same issue. > > > > > > Creating a pem file of the example key, cert ca-cert and using in > ejabberd > > > 13.12 works fine with all browser?s. > > > > > > which:applications() in ejabberd 13.12 return?s ssl 5.3.2 > > > > > > I am confused since i thought that the issue would have been the ssl > app > > > since we have > > > > > > > > > cowboy ?> ranch ?> sslapp > > > > > > I am out of idea?s and would really appreciate any help > > > > > > Many thanks > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > -- > > -- > > Dipl. Inform. > > Andreas Schultz > > > > email: as@REDACTED > > phone: +49-391-819099-224 > > mobil: +49-170-2226073 > > > > ------------------- enabling your networks ------------------- > > > > Travelping GmbH phone: +49-391-819099229 > > Roentgenstr. 13 fax: +49-391-819099299 > > D-39108 Magdeburg email: info@REDACTED > > GERMANY web: http://www.travelping.com > > > > Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 > > Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 > > -------------------------------------------------------------- > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > -- > Dipl. Inform. > Andreas Schultz > > email: -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Fri Jan 3 09:45:59 2014 From: sergej.jurecko@REDACTED (=?UTF-8?Q?Sergej_Jure=C4=8Dko?=) Date: Fri, 3 Jan 2014 09:45:59 +0100 Subject: [erlang-questions] rebar/node_package and runner_script_dir Message-ID: hello, I'm trying to make a package with node package, but I'm running into an issue I don't quite understand. I'm looking at rcouch and riak as examples and they both have something like this in their vars.config: {runner_script_dir, "\`cd \\`dirname $0\\` && /bin/pwd\`"}. Which in the end translates env.sh from: RUNNER_SCRIPT_DIR={{runner_script_dir}} to: RUNNER_SCRIPT_DIR=/usr/bin So that script string in vars.config somehow gets executed somewhere. When I try putting that in my vars.config what I get in env.sh is: RUNNER_SCRIPT_DIR=`cd \`dirname $0\` && /bin/pwd` Anyone know what I am doing wrong or missing? Sergej -------------- next part -------------- An HTML attachment was scrubbed... URL: From vychodil.hynek@REDACTED Fri Jan 3 15:09:44 2014 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Fri, 3 Jan 2014 15:09:44 +0100 Subject: [erlang-questions] [ANN] Bignum Fibonacci generator Message-ID: Hi, there is Fibonacci number generator https://gist.github.com/pichi/8238258 if somebody interested. It's just toy thing but anyway can be useful. It works with matrix exponentiation for big numbers so works in O(M(n) log n) where M(n) is multiplication cost for number with length n. It turns out that for Erlang's bignum implementation resulting characteristic is near to linear. It computes fib of million in 2s and ten million in 172s on mine notebook. With best regards Hynek Vychodil -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Fri Jan 3 18:04:10 2014 From: mjtruog@REDACTED (Michael Truog) Date: Fri, 03 Jan 2014 09:04:10 -0800 Subject: [erlang-questions] dict() type issue In-Reply-To: <52C5EE8A.2060003@gmail.com> References: <52C5EE8A.2060003@gmail.com> Message-ID: <52C6ED8A.7060206@gmail.com> Never mind about this. I can understand why an is_dict/1 guard will never happen (dict is not a real type). The only good solution (to this type checking need in a generic API, with dict) in Erlang is to wrap all your data structure usage in a tagged tuple like {dict, dict()} despite that being odd and annoying. With the is_map/1 guard, maps can be checked as a real type, so it will be easier to use in a generic interface. On 01/02/2014 02:56 PM, Michael Truog wrote: > Hi! > > The dict() type being defined as opaque prevents it from being checked with other dictionary implementations that rely on tuples. If you do "is_tuple(D), element(1, D) =:= dict" dialyzer will complain once it realizes that D is a dict(), despite the fact it is a tuple underneath the opaque type. To help with the migration to maps, a new function is_dict/1 could help check the type during runtime, in a way that doesn't anger dialyzer. Ideally, is_dict/1 would be a guard function, but I assume that is problematic unless it was added to the erlang module. Is there any reason we wouldn't want an is_dict/1 function? > > Thanks, > Michael From sstewartgallus00@REDACTED Fri Jan 3 22:02:44 2014 From: sstewartgallus00@REDACTED (Steven Stewart-Gallus) Date: Fri, 03 Jan 2014 21:02:44 +0000 (GMT) Subject: [erlang-questions] How can I close standard input output streams and check for errors in Erlang? Message-ID: Hello Erlang-Questions! I checked on another forum previously at http://www.reddit.com/r/erlang/comments/1txf60/how_can_one_flush_and_close_standard_streams_in/ and at the Erlang IRC channel on Freenode but I couldn't get help so I've come to the mailing list. Can Erlang-Questions help me figure out how to close standard input output streams and check for errors in Erlang? I should be able to report an error if standard input and output don't close properly and return an exit code of 1 if closing standard error doesn't work. My problem: > A simple hello world program is > > -module(hello). > -author('sstewartgallus00@REDACTED'). > -export([hello_world/0]). > > hello_world() -> io:fwrite("hello, world~n") > > I can compile and run this with erl -compile hello && erl -noshell -s > hello hello_world -s init stop and it works. But what if I run it as > erl -compile hello && erl -noshell -s hello hello_world -s init stop > > /dev/full (on a Linux box)? That doesn't work correctly (correct > behaviour should be reporting a full hard disk). *I know in C and Java > I can close standard streams to flush them and check for errors but > how can I do so in Erlang? > > *Strictly speaking one can't write this program correctly in portable > C or Java either because operating system kernels like Linux defer > writes so one has to do an fsync call for absolute correctness. Thank you, Steven Stewart-Gallus From mloftis@REDACTED Sat Jan 4 18:39:12 2014 From: mloftis@REDACTED (Michael Loftis) Date: Sat, 4 Jan 2014 09:39:12 -0800 Subject: [erlang-questions] How can I close standard input output streams and check for errors in Erlang? In-Reply-To: References: Message-ID: I've been using unix and Linux for well over a decade at this point...and I've *never* heard of /dev/full, null, yes, full, no. If it doesn't exist and you're not running as root, your *shell* is going to error out before erlang is even started because it won't be able to open the device, or create it. From vinoski@REDACTED Sat Jan 4 23:37:41 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Sat, 4 Jan 2014 17:37:41 -0500 Subject: [erlang-questions] How can I close standard input output streams and check for errors in Erlang? In-Reply-To: References: Message-ID: On Sat, Jan 4, 2014 at 12:39 PM, Michael Loftis wrote: > I've been using unix and Linux for well over a decade at this > point...and I've *never* heard of /dev/full, null, yes, full, no. If > it doesn't exist and you're not running as root, your *shell* is going > to error out before erlang is even started because it won't be able to > open the device, or create it. See http://man7.org/linux/man-pages/man4/full.4.html . On my Ubuntu 12.04 box: $ ls -l /dev/full crw-rw-rw- 1 root root 1, 7 Dec 27 20:26 /dev/full $ echo 1 > /dev/full -bash: echo: write error: No space left on device --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoursurrogategod@REDACTED Mon Jan 6 00:35:05 2014 From: yoursurrogategod@REDACTED (Yves S. Garret) Date: Sun, 5 Jan 2014 18:35:05 -0500 Subject: [erlang-questions] When can you evaluate functions/operations in lists? Message-ID: Hello, Recently I tried the following: 82> io:format("~s~n", [os:cmd("ls -l")]). total 12 -rw-r--r-- 1 dai users 2692 Jan 5 18:28 input_output.beam -rw-r--r-- 1 dai users 4581 Jan 5 18:28 input_output.erl ok 83> io:format("~f~n", [20 * 20]). ** exception error: bad argument in function io:format/3 called as io:format(<0.26.0>,"~f~n",[400]) It struck me as a little odd that while I can execute system functions in a list (right before printing to console), but not system operations. Am I missing something? When can you do one, but not the other? Or have I simply misunderstood something? -------------- next part -------------- An HTML attachment was scrubbed... URL: From vychodil.hynek@REDACTED Mon Jan 6 00:42:52 2014 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Mon, 6 Jan 2014 00:42:52 +0100 Subject: [erlang-questions] When can you evaluate functions/operations in lists? In-Reply-To: References: Message-ID: The problem is not evaluation 1> io:format("~B~n", [20 * 20]). 400 ok You got error because result of 20*20 is integer and ~f expect float. The expression was already evaluated as you can see in called as io:format(<0.26.0>,"~f~n",[400]) in your error message. On Mon, Jan 6, 2014 at 12:35 AM, Yves S. Garret wrote: > Hello, > > Recently I tried the following: > > 82> io:format("~s~n", [os:cmd("ls -l")]). > total 12 > -rw-r--r-- 1 dai users 2692 Jan 5 18:28 input_output.beam > -rw-r--r-- 1 dai users 4581 Jan 5 18:28 input_output.erl > > ok > 83> io:format("~f~n", [20 * 20]). > ** exception error: bad argument > in function io:format/3 > called as io:format(<0.26.0>,"~f~n",[400]) > > It struck me as a little odd that while I can execute system functions in > a list (right before printing to console), but not system operations. Am I > missing something? When can you do one, but not the other? Or have I > simply misunderstood something? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasco@REDACTED Mon Jan 6 01:02:26 2014 From: vasco@REDACTED (Vassil Kolarov) Date: Mon, 6 Jan 2014 00:02:26 +0000 Subject: [erlang-questions] [ANN] Rivus - Erlang Complex Event Processing Message-ID: Hi all, I'd like to announce a project called 'Rivus'. The goal of the project is implementation of complex events processing application in Erlang, which uses a DSL similar to ESPER's EPL. It is in a very early stage, but could be considered sort of a "MVP". Here is the GitHub repository: https://github.com/vascokk/rivus_cep Hope you'll find it interesting and useful. Best regards, Vasco -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Mon Jan 6 02:06:06 2014 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Mon, 06 Jan 2014 02:06:06 +0100 Subject: [erlang-questions] [ANN] Rivus - Erlang Complex Event Processing Message-ID: That looks very good. One question though. You always do a gen_server call to retrieve results, any way to get them as they come, perhaps delivered every Interval? Sent from my ASUS Padfone Vassil Kolarov wrote: >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From darach@REDACTED Mon Jan 6 03:31:36 2014 From: darach@REDACTED (Darach Ennis) Date: Mon, 6 Jan 2014 03:31:36 +0100 Subject: [erlang-questions] [ANN] Rivus - Erlang Complex Event Processing In-Reply-To: References: Message-ID: Hi Vasco, [Resent to all] Looks like you're off to a good start here towards a SQL based CEP engine for Erlang/OTP. There are arguably 4 key constructs that Rivus would need to support to qualify as a CEP engine: 1. Continuous Query 2. Windows (aggregation) 3. 'Complex' pattern matching (eg: temporal patterns across streams, stream combinators, ...) 4. A domain specific language. So, Rivus would basically qualify in principle under 1, 2 and 4 here but not entirely under 3. I saw no support for combinators, temporal pattern matching, state (tables or variables), concurrency or data parallelism. However, as the syntax allows the definition of multiple correlations it could be said that simultaneity (of queries) is supported - and this is essential. A potential issue depending on your target audience is that the facilities in core erlang for expressive pattern matching and tuple processing aren't leveraged, nor is the native support for concurrency and parallelism through providing concurrency and data parallelism of queries in the DSL. StreamBase (note: I used to work for them so I'm probably biased) support concurrency and (data) parallelism in their SQL and visual (flow-based) languages and in the hands of an expert (eg: someone intimate with the runtime) is very powerful. Apama is worth looking it - its runtime was inspired by the Erlang concurrency model (allegedly) and its monitorscript language supports processes. In CEP languages and environments where these and more features are provided - it doesn't actually help the poor CEP developer - it hinders. Large complex CEP algorithms are difficult to evolve, maintain and support in most organisations. The tools typically have weak debugging and refactoring support if at all and the DSLs aren't standard and often have constructs peculiar to the lineage of the technology (it may have started out life as an active database or as a log processing tool or as a captured packet analyser ...). StreamBase, by far, has the best tooling (yup, I'm biased), IDE, debugging and refactoring support. But a significant component of any successful CEP solution is native code. A question I've been grappling with is, what are the useful bits in CEP that would be useful within Erlang as a library or service? I've experimented with what I think are the most useful two, namely: aggregate window processing and data flow algorithm definition. Rather than define a SQL to enshrine the conditions under which they can be leveraged - plain old erlang provides a richer environment for these to be used fruitfully. Why write a DSL and Erlang is a 'real language' - one that makes pattern matching easy with distribution and concurrency built in if you need it? https://github.com/darach/beam-erl Embeddable data flow library. Branch, Pipe, Combine, Filter and Transform data. https://github.com/darach/eep-erl Sliding, Tumbling, Periodic and Monotonic aggregation. In the case of aggregation once the window semantics are defined the window functions can be provided by extension (use an erlang behaviour). So you could use this to allow user defined (aggregate) functions in your SQL dialect. The SQL statements and clauses could be compiled to an intermediary form that supports a more primitive flow language and runtime making building out the CEP engine a little bit easier. This also favors plugging in user defined constructs allowing the language itself to be extended through user defined operations. I haven't implemented temporal pattern matching or interesting complex combinators because I haven't needed them myself of late. Even the window aggregation is simple. Some CEP engines allow aggregates of multiple dimensions (data, time, value, predicate expression) but these can typically be (far) more easily defined through composition. Judging from the SQL dialect syntax the need so far is for expressivity in filtering / detection based on fairly simple windowed events or windowed temporal processing of event data. Complex processing of multiple event sources against complex scenarios (eg: near real-time collusion or layering fraud detection in capital markets market abuse and surveillance) without extending the language dialect would be hard/impossible in its current form. It would be interesting to hear what the plans for the language are and if/where plain old Erlang/OTP could be leveraged to extend the capabilities of the engine. Once concern though is that aggregation windows are based on folsom, which in turn depends on ETS. If any of your queries contain large numbers of aggregate operations - you'll spend a lot of time in ETS. If your intermediate operation results aren't critical - thats a lot of overhead you can avoid by providing your own aggregation/windowing logic (or fork/steal eep-erls) Promising start to a SQL based CEP in Erlang/OTP! Thanks for sharing so early in its development! Cheers, Darach. On Mon, Jan 6, 2014 at 1:02 AM, Vassil Kolarov wrote: > Hi all, > > I'd like to announce a project called 'Rivus'. The goal of the project is > implementation of complex events processing application in Erlang, which > uses a DSL similar to ESPER's EPL. It is in a very early stage, but could > be considered sort of a "MVP". > > Here is the GitHub repository: https://github.com/vascokk/rivus_cep > > Hope you'll find it interesting and useful. > > Best regards, > Vasco > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasco@REDACTED Mon Jan 6 09:44:30 2014 From: vasco@REDACTED (Vassil Kolarov) Date: Mon, 6 Jan 2014 08:44:30 +0000 Subject: [erlang-questions] [ANN] Rivus - Erlang Complex Event Processing In-Reply-To: References: Message-ID: Hi Lo?c, This is for unit tests only. In the real-life scenario actually the gen_server itself (result_subscriber.erl) will be the consumer, so gen_server:call() won't be needed. There could be multiple consumers also. As for the delivery on specific interval - this is what I call a "batch window" and is on top of my "to do" list. Currently the result (output) is emitted on every input. Best regards, Vasco On Mon, Jan 6, 2014 at 1:06 AM, Lo?c Hoguin wrote: > That looks very good. One question though. You always do a gen_server call > to retrieve results, any way to get them as they come, perhaps delivered > every Interval? > > Sent from my ASUS Padfone > > > Vassil Kolarov wrote: > > Hi all, > > I'd like to announce a project called 'Rivus'. The goal of the project is > implementation of complex events processing application in Erlang, which > uses a DSL similar to ESPER's EPL. It is in a very early stage, but could > be considered sort of a "MVP". > > Here is the GitHub repository: https://github.com/vascokk/rivus_cep > > Hope you'll find it interesting and useful. > > Best regards, > Vasco > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasco@REDACTED Mon Jan 6 11:06:28 2014 From: vasco@REDACTED (Vassil Kolarov) Date: Mon, 6 Jan 2014 10:06:28 +0000 Subject: [erlang-questions] [ANN] Rivus - Erlang Complex Event Processing In-Reply-To: References: Message-ID: Hi Darach, Thank you for your elaborated post! Frankly speaking, this project was started by pure curiosity rather than a necessity. That is why I announced it in this early stage (may be a bit prematurely) ? to gather opinions and ideas. Data parallelism on a single query is out of scope (for now). I was more concerned about ?scaling out? scenario, but surely this is something to think about. The main goal was to have the ability to execute operations over multiple event streams, where each stream contains a single event type. Currently, only ?implicit joins? are supported in the form of ?select?. from event1, event2 where event1.paramX = event2.paramX?. That is why I am using ETS (actually provided by ?folsom?). I gave it some thinking, but failed to find how to join multiple streams without a temporary storage. On the other hand ? if there are no joins in the query, it can be done without using ETS, simply by updating aggregations on the fly, as the event arrives. That is exactly what I am working on at the moment. Btw, my background in the CEP theory is minimal (something I plan to catch up on), do the above-mentioned stream ?joins? qualify as ?stream combinators?? My immediate plans are to extend the DSL with: - ?Named windows? (similar to ESPER ones) ? basically a new streams, each one built from a query result, which can be used by other queries. - Defining the events, so that event behaviour (event1.erl and event2.erl in the test suite) to be generated automatically - Event patterns over streams and named windows - Batch (trigger result on specific time intervals) and tumbling (trigger result on specific number of inputs) windows I?ll definitely think about using eep-erl and beam-erl J Thank you again! Best regards, Vasco On Mon, Jan 6, 2014 at 2:31 AM, Darach Ennis wrote: > Hi Vasco, > > [Resent to all] > > Looks like you're off to a good start here towards a SQL based CEP engine > for Erlang/OTP. > There are arguably 4 key constructs that Rivus would need to support to > qualify as a CEP engine: > > 1. Continuous Query > 2. Windows (aggregation) > 3. 'Complex' pattern matching (eg: temporal patterns across streams, > stream combinators, ...) > 4. A domain specific language. > > So, Rivus would basically qualify in principle under 1, 2 and 4 here but > not entirely under 3. I saw > no support for combinators, temporal pattern matching, state (tables or > variables), concurrency or > data parallelism. However, as the syntax allows the definition of multiple > correlations it could be said > that simultaneity (of queries) is supported - and this is essential. > > A potential issue depending on your target audience is that the facilities > in core erlang for > expressive pattern matching and tuple processing aren't leveraged, nor is > the native support > for concurrency and parallelism through providing concurrency and data > parallelism of queries > in the DSL. StreamBase (note: I used to work for them so I'm probably > biased) support concurrency > and (data) parallelism in their SQL and visual (flow-based) languages and > in the hands of an > expert (eg: someone intimate with the runtime) is very powerful. > > Apama is worth looking it - its runtime was inspired by the Erlang > concurrency model (allegedly) > and its monitorscript language supports processes. > > In CEP languages and environments where these and more features are > provided - it doesn't > actually help the poor CEP developer - it hinders. Large complex CEP > algorithms are difficult to > evolve, maintain and support in most organisations. The tools typically > have weak debugging and > refactoring support if at all and the DSLs aren't standard and often have > constructs peculiar to the > lineage of the technology (it may have started out life as an active > database or as a log processing > tool or as a captured packet analyser ...). > > StreamBase, by far, has the best tooling (yup, I'm biased), IDE, debugging > and refactoring support. > But a significant component of any successful CEP solution is native code. > A question I've been > grappling with is, what are the useful bits in CEP that would be useful > within Erlang as a library or > service? I've experimented with what I think are the most useful two, > namely: aggregate window > processing and data flow algorithm definition. Rather than define a SQL to > enshrine the conditions > under which they can be leveraged - plain old erlang provides a richer > environment for these to be > used fruitfully. Why write a DSL and Erlang is a 'real language' - one > that makes pattern matching > easy with distribution and concurrency built in if you need it? > > https://github.com/darach/beam-erl > > Embeddable data flow library. Branch, Pipe, Combine, Filter and Transform > data. > > https://github.com/darach/eep-erl > > Sliding, Tumbling, Periodic and Monotonic aggregation. > > In the case of aggregation once the window semantics are defined the > window functions > can be provided by extension (use an erlang behaviour). So you could use > this to allow > user defined (aggregate) functions in your SQL dialect. The SQL statements > and clauses > could be compiled to an intermediary form that supports a more primitive > flow language > and runtime making building out the CEP engine a little bit easier. This > also favors plugging > in user defined constructs allowing the language itself to be extended > through user defined > operations. > > I haven't implemented temporal pattern matching or interesting complex > combinators because I haven't > needed them myself of late. Even the window aggregation is simple. Some > CEP engines allow aggregates of multiple > dimensions (data, time, value, predicate expression) but these can > typically be (far) more easily defined > through composition. > > Judging from the SQL dialect syntax the need so far is for expressivity in > filtering / detection > based on fairly simple windowed events or windowed temporal processing of > event data. Complex > processing of multiple event sources against complex scenarios (eg: near > real-time collusion or layering > fraud detection in capital markets market abuse and surveillance) without > extending the language dialect > would be hard/impossible in its current form. > > It would be interesting to hear what the plans for the language are and > if/where plain old Erlang/OTP > could be leveraged to extend the capabilities of the engine. Once concern > though is that aggregation > windows are based on folsom, which in turn depends on ETS. If any of your > queries contain large > numbers of aggregate operations - you'll spend a lot of time in ETS. If > your intermediate operation > results aren't critical - thats a lot of overhead you can avoid by > providing your own aggregation/windowing > logic (or fork/steal eep-erls) > > Promising start to a SQL based CEP in Erlang/OTP! Thanks for sharing so > early in its development! > > Cheers, > > Darach. > > > On Mon, Jan 6, 2014 at 1:02 AM, Vassil Kolarov wrote: > >> Hi all, >> >> I'd like to announce a project called 'Rivus'. The goal of the project >> is implementation of complex events processing application in Erlang, which >> uses a DSL similar to ESPER's EPL. It is in a very early stage, but could >> be considered sort of a "MVP". >> >> Here is the GitHub repository: https://github.com/vascokk/rivus_cep >> >> Hope you'll find it interesting and useful. >> >> Best regards, >> Vasco >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Mon Jan 6 11:22:41 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Mon, 6 Jan 2014 11:22:41 +0100 Subject: [erlang-questions] best source layout with multiple applications Message-ID: Hi all, I am wondering what would be the best layout to handle multiple applications in the same repository and their dependencies? I am using rebar to handle the build of the apps and the C code they are using. When I see around I can see the following layouts: riak is using - apps/app1 ... apps/appN for apps - deps/ for the defaults cloudi : - src/lib/app1 ... src/lib/appN for cloudi apps - src/external/... for deps included Erlang - lib/app1...appN for apps I am myself thinking to use - lib/app1....appN for apps - vendor/.... for deps maybe under an src/ folder. But I am curious of what others do. Any feedback is welcome :) - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From darach@REDACTED Mon Jan 6 13:41:33 2014 From: darach@REDACTED (Darach Ennis) Date: Mon, 6 Jan 2014 13:41:33 +0100 Subject: [erlang-questions] [ANN] Rivus - Erlang Complex Event Processing In-Reply-To: References: Message-ID: Hi Vasco, Combinators are, ugh, complicated. You can roughly break then down semantically: * Merge - take two (or more) partially ordered streams and create a single totally ordered resultant stream * Gather - works in concert with splitting (or scattering) a stream of events down multiple sub streams. Most implementations of this aren't tolerant of losing events that should be gathered * Pattern - Uses some form of temporal logic to define match criteria * Join - Typically windowed, find matching events in two streams by value or predicate expression * Union - the most general streaming combinator is stateless and simply passes any input events to outputs. * There are others. Union and Gather are typically more commonly found in the wild in my experience than Merge or Join but all are useful some of the time. Pattern is useful if you're checking causal order - "did event B occur after and only after event A whilst event C was non occurring" kind of thing but composition "... within the last 5 minutes / events" is king. But stateful combinators are quite common. In fact, robust data recovery is the hard part of the problem. The database community has some discipline here (CRDTs) that a distributed CEP may want to consider for first order support that doesn't get handled elegantly by most traditional CEP engines. Bloom's exploitation of out of order processing is another interesting thing that would be nice to see influencing CEP engine design. Anyway, StreamBase's SQL dialect is well documented and more complete than Esper: http://docs.streambase.com/sb73/topic/com.streambase.sb.ide.help/data/html/streamsql/ssql-dml.html The temporal pattern language may also be of interest: http://docs.streambase.com/sb73/topic/com.streambase.sb.ide.help/data/html/reference/patternquery.html IBM's SPL is also very well documented and worth exploring: http://pic.dhe.ibm.com/infocenter/streams/v2r0/index.jsp?topic=%2Fcom.ibm.swg.im.infosphere.streams.whats-new.doc%2Fdoc%2Fibminfospherestreams-whats-new-spl4.html It would certainly be worth your time surveying the many different flavors of CEP and ESP currently out there. Ultimately, the kind of streaming algorithms and continuous processing you are embarking upon will have a more significant influence. What you won't get from a lot of the lower level mechanics are the higher level flow patterns that an experienced practitioner will use but you may not always find directly in syntax... These typically influence the direction and evolution of CEP languages but as its a domain that is still very much evolving (technically) you will find quite a lot of variation. I'd advise only implementing that which you need. Its easier to extend later than remove a bad construct. A good example is multi-dimensional windows. Pretty much all CEP engines I know of that support this got the model wrong... worse, the human brain doesn't really like handling more than one dimension simultaneously so favoring a dialect that allows ease of composition of simple operations over complex operations in simple flows. Another omission in most CEP engines is good distribution, fault tolerance and clustering out of the box. By 'good' I mean with respect to some formal notion of recovery (can an algorithm or query recover precisely without loss or not). This is hard and existing CEP engines get this wrong - it turns out that solving this wasn't commercially compelling until recently - but near real-time market abuse and surveillance and continuous big data use cases need better solutions here specifically. All part of the fun of building a full blown CEP engine ... Cheers, Darach. On Mon, Jan 6, 2014 at 11:06 AM, Vassil Kolarov wrote: > Hi Darach, > > > > Thank you for your elaborated post! > > Frankly speaking, this project was started by pure curiosity rather than a > necessity. That is why I announced it in this early stage (may be a bit > prematurely) ? to gather opinions and ideas. > > Data parallelism on a single query is out of scope (for now). I was more > concerned about ?scaling out? scenario, but surely this is something to > think about. > > The main goal was to have the ability to execute operations over multiple > event streams, where each stream contains a single event type. Currently, > only ?implicit joins? are supported in the form of ?select?. from event1, > event2 where event1.paramX = event2.paramX?. That is why I am using ETS > (actually provided by ?folsom?). I gave it some thinking, but failed to > find how to join multiple streams without a temporary storage. On the other > hand ? if there are no joins in the query, it can be done without using > ETS, simply by updating aggregations on the fly, as the event arrives. That > is exactly what I am working on at the moment. > > Btw, my background in the CEP theory is minimal (something I plan to catch > up on), do the above-mentioned stream ?joins? qualify as ?stream > combinators?? > > My immediate plans are to extend the DSL with: > > > - ?Named windows? (similar to ESPER ones) ? basically a new streams, each > one built from a query result, which can be used by other queries. > > - Defining the events, so that event behaviour (event1.erl and event2.erl > in the test suite) to be generated automatically > > - Event patterns over streams and named windows > > - Batch (trigger result on specific time intervals) and tumbling (trigger > result on specific number of inputs) windows > > I?ll definitely think about using eep-erl and beam-erl J > > Thank you again! > > > > Best regards, > > Vasco > > > On Mon, Jan 6, 2014 at 2:31 AM, Darach Ennis wrote: > >> Hi Vasco, >> >> [Resent to all] >> >> Looks like you're off to a good start here towards a SQL based CEP engine >> for Erlang/OTP. >> There are arguably 4 key constructs that Rivus would need to support to >> qualify as a CEP engine: >> >> 1. Continuous Query >> 2. Windows (aggregation) >> 3. 'Complex' pattern matching (eg: temporal patterns across streams, >> stream combinators, ...) >> 4. A domain specific language. >> >> So, Rivus would basically qualify in principle under 1, 2 and 4 here but >> not entirely under 3. I saw >> no support for combinators, temporal pattern matching, state (tables or >> variables), concurrency or >> data parallelism. However, as the syntax allows the definition of >> multiple correlations it could be said >> that simultaneity (of queries) is supported - and this is essential. >> >> A potential issue depending on your target audience is that the >> facilities in core erlang for >> expressive pattern matching and tuple processing aren't leveraged, nor is >> the native support >> for concurrency and parallelism through providing concurrency and data >> parallelism of queries >> in the DSL. StreamBase (note: I used to work for them so I'm probably >> biased) support concurrency >> and (data) parallelism in their SQL and visual (flow-based) languages and >> in the hands of an >> expert (eg: someone intimate with the runtime) is very powerful. >> >> Apama is worth looking it - its runtime was inspired by the Erlang >> concurrency model (allegedly) >> and its monitorscript language supports processes. >> >> In CEP languages and environments where these and more features are >> provided - it doesn't >> actually help the poor CEP developer - it hinders. Large complex CEP >> algorithms are difficult to >> evolve, maintain and support in most organisations. The tools typically >> have weak debugging and >> refactoring support if at all and the DSLs aren't standard and often have >> constructs peculiar to the >> lineage of the technology (it may have started out life as an active >> database or as a log processing >> tool or as a captured packet analyser ...). >> >> StreamBase, by far, has the best tooling (yup, I'm biased), IDE, >> debugging and refactoring support. >> But a significant component of any successful CEP solution is native >> code. A question I've been >> grappling with is, what are the useful bits in CEP that would be useful >> within Erlang as a library or >> service? I've experimented with what I think are the most useful two, >> namely: aggregate window >> processing and data flow algorithm definition. Rather than define a SQL >> to enshrine the conditions >> under which they can be leveraged - plain old erlang provides a richer >> environment for these to be >> used fruitfully. Why write a DSL and Erlang is a 'real language' - one >> that makes pattern matching >> easy with distribution and concurrency built in if you need it? >> >> https://github.com/darach/beam-erl >> >> Embeddable data flow library. Branch, Pipe, Combine, Filter and Transform >> data. >> >> https://github.com/darach/eep-erl >> >> Sliding, Tumbling, Periodic and Monotonic aggregation. >> >> In the case of aggregation once the window semantics are defined the >> window functions >> can be provided by extension (use an erlang behaviour). So you could use >> this to allow >> user defined (aggregate) functions in your SQL dialect. The SQL >> statements and clauses >> could be compiled to an intermediary form that supports a more primitive >> flow language >> and runtime making building out the CEP engine a little bit easier. This >> also favors plugging >> in user defined constructs allowing the language itself to be extended >> through user defined >> operations. >> >> I haven't implemented temporal pattern matching or interesting complex >> combinators because I haven't >> needed them myself of late. Even the window aggregation is simple. Some >> CEP engines allow aggregates of multiple >> dimensions (data, time, value, predicate expression) but these can >> typically be (far) more easily defined >> through composition. >> >> Judging from the SQL dialect syntax the need so far is for expressivity >> in filtering / detection >> based on fairly simple windowed events or windowed temporal processing of >> event data. Complex >> processing of multiple event sources against complex scenarios (eg: near >> real-time collusion or layering >> fraud detection in capital markets market abuse and surveillance) without >> extending the language dialect >> would be hard/impossible in its current form. >> >> It would be interesting to hear what the plans for the language are and >> if/where plain old Erlang/OTP >> could be leveraged to extend the capabilities of the engine. Once concern >> though is that aggregation >> windows are based on folsom, which in turn depends on ETS. If any of your >> queries contain large >> numbers of aggregate operations - you'll spend a lot of time in ETS. If >> your intermediate operation >> results aren't critical - thats a lot of overhead you can avoid by >> providing your own aggregation/windowing >> logic (or fork/steal eep-erls) >> >> Promising start to a SQL based CEP in Erlang/OTP! Thanks for sharing so >> early in its development! >> >> Cheers, >> >> Darach. >> >> >> On Mon, Jan 6, 2014 at 1:02 AM, Vassil Kolarov wrote: >> >>> Hi all, >>> >>> I'd like to announce a project called 'Rivus'. The goal of the project >>> is implementation of complex events processing application in Erlang, which >>> uses a DSL similar to ESPER's EPL. It is in a very early stage, but could >>> be considered sort of a "MVP". >>> >>> Here is the GitHub repository: https://github.com/vascokk/rivus_cep >>> >>> Hope you'll find it interesting and useful. >>> >>> Best regards, >>> Vasco >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Mon Jan 6 14:30:05 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Mon, 6 Jan 2014 08:30:05 -0500 Subject: [erlang-questions] best source layout with multiple applications In-Reply-To: References: Message-ID: <20140106133004.GA2168@ferdair.local> I personally tend to follow the Riak structure and recommend it around for releases instead of having one top-level app and then the rest below it. I'd be open to using lib/ instead of /apps, but feel like deps/ is the best name for dependencies of the project (which aren't always about other vendors or even third party libraries -- just stuff generic enough to not be in the core project). Regards, Fred. On 01/06, Benoit Chesneau wrote: > Hi all, > > I am wondering what would be the best layout to handle multiple > applications in the same repository and their dependencies? I am using > rebar to handle the build of the apps and the C code they are using. > > > When I see around I can see the following layouts: > > riak is using > > - apps/app1 > ... > apps/appN for apps > > - deps/ for the defaults > > > cloudi : > > - src/lib/app1 > ... > src/lib/appN for cloudi apps > > - src/external/... for deps included > > Erlang > > - lib/app1...appN for apps > > > I am myself thinking to use > > - lib/app1....appN for apps > - vendor/.... for deps > > maybe under an src/ folder. > > > But I am curious of what others do. Any feedback is welcome :) > > - benoit > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From sergej.jurecko@REDACTED Mon Jan 6 14:56:09 2014 From: sergej.jurecko@REDACTED (=?UTF-8?Q?Sergej_Jure=C4=8Dko?=) Date: Mon, 6 Jan 2014 14:56:09 +0100 Subject: [erlang-questions] best source layout with multiple applications In-Reply-To: <20140106133004.GA2168@ferdair.local> References: <20140106133004.GA2168@ferdair.local> Message-ID: Use the riak way of doing things. That way rebar and node_package will work well when creating a release. Diverge too far from that and you're likely to run into issues later on. Sergej On Mon, Jan 6, 2014 at 2:30 PM, Fred Hebert wrote: > I personally tend to follow the Riak structure and recommend it around > for releases instead of having one top-level app and then the rest below > it. I'd be open to using lib/ instead of /apps, but feel like deps/ is > the best name for dependencies of the project (which aren't always about > other vendors or even third party libraries -- just stuff generic enough > to not be in the core project). > > > Regards, > Fred. > > On 01/06, Benoit Chesneau wrote: > > Hi all, > > > > I am wondering what would be the best layout to handle multiple > > applications in the same repository and their dependencies? I am using > > rebar to handle the build of the apps and the C code they are using. > > > > > > When I see around I can see the following layouts: > > > > riak is using > > > > - apps/app1 > > ... > > apps/appN for apps > > > > - deps/ for the defaults > > > > > > cloudi : > > > > - src/lib/app1 > > ... > > src/lib/appN for cloudi apps > > > > - src/external/... for deps included > > > > Erlang > > > > - lib/app1...appN for apps > > > > > > I am myself thinking to use > > > > - lib/app1....appN for apps > > - vendor/.... for deps > > > > maybe under an src/ folder. > > > > > > But I am curious of what others do. Any feedback is welcome :) > > > > - benoit > > > _______________________________________________ > > 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 seancribbs@REDACTED Mon Jan 6 18:21:29 2014 From: seancribbs@REDACTED (Sean Cribbs) Date: Mon, 6 Jan 2014 11:21:29 -0600 Subject: [erlang-questions] [ANN] Neotoma 1.7.0 Message-ID: Hi Erlangers, I'm happy to announce a long-awaited version bump to Neotoma[1]. The main feature of this release is the removal of several dialyzer type warnings in generated parsers: namely, unused parser-combinators are elided via macros. Thanks to Kostis Sagonas and Anthony Ramine for help in diagnosing these errors. Breaking Changes: If your parser uses the included line/1 or column/1 functions, you will need to define the 'line' or 'column' macros, respectively, at compile time or in your global code block. Future releases might inspect inline code blocks for usage of these functions and include them for you, but that is not present in this release. The 'neotoma_peg' module has been moved to the test/ directory as it was only used for testing the combinators. I'm sorry if anyone was using this module outside Neotoma. -------------- next part -------------- An HTML attachment was scrubbed... URL: From seancribbs@REDACTED Mon Jan 6 18:22:17 2014 From: seancribbs@REDACTED (Sean Cribbs) Date: Mon, 6 Jan 2014 11:22:17 -0600 Subject: [erlang-questions] [ANN] Neotoma 1.7.0 In-Reply-To: References: Message-ID: Woops, GMail sent my message before I was ready. Here's the link for [1] https://github.com/seancribbs/neotoma/tree/1.7.0#neotoma Cheers, Sean Cribbs On Mon, Jan 6, 2014 at 11:21 AM, Sean Cribbs wrote: > Hi Erlangers, > > I'm happy to announce a long-awaited version bump to Neotoma[1]. > > The main feature of this release is the removal of several dialyzer type > warnings in generated parsers: namely, unused parser-combinators are elided > via macros. Thanks to Kostis Sagonas and Anthony Ramine for help in > diagnosing these errors. > > Breaking Changes: > > If your parser uses the included line/1 or column/1 functions, you will > need to define the 'line' or 'column' macros, respectively, at compile time > or in your global code block. Future releases might inspect inline code > blocks for usage of these functions and include them for you, but that is > not present in this release. > > The 'neotoma_peg' module has been moved to the test/ directory as it was > only used for testing the combinators. I'm sorry if anyone was using this > module outside Neotoma. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmercer@REDACTED Mon Jan 6 20:15:32 2014 From: dmercer@REDACTED (David Mercer) Date: Mon, 6 Jan 2014 13:15:32 -0600 Subject: [erlang-questions] [ANN] Neotoma 1.7.0 In-Reply-To: References: Message-ID: <008901cf0b13$abe24290$03a6c7b0$@gmail.com> This is as an alternative to yecc, yes? Yecc if you want to specify your grammar in BNF, neotoma for PEG? Any advantages of one over the other? Cheers, DBM From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Sean Cribbs Sent: Monday, January 06, 2014 11:22 To: Erlang Questions Subject: Re: [erlang-questions] [ANN] Neotoma 1.7.0 Woops, GMail sent my message before I was ready. Here's the link for [1] https://github.com/seancribbs/neotoma/tree/1.7.0#neotoma Cheers, Sean Cribbs On Mon, Jan 6, 2014 at 11:21 AM, Sean Cribbs wrote: Hi Erlangers, I'm happy to announce a long-awaited version bump to Neotoma[1]. The main feature of this release is the removal of several dialyzer type warnings in generated parsers: namely, unused parser-combinators are elided via macros. Thanks to Kostis Sagonas and Anthony Ramine for help in diagnosing these errors. Breaking Changes: If your parser uses the included line/1 or column/1 functions, you will need to define the 'line' or 'column' macros, respectively, at compile time or in your global code block. Future releases might inspect inline code blocks for usage of these functions and include them for you, but that is not present in this release. The 'neotoma_peg' module has been moved to the test/ directory as it was only used for testing the combinators. I'm sorry if anyone was using this module outside Neotoma. -------------- next part -------------- An HTML attachment was scrubbed... URL: From seancribbs@REDACTED Mon Jan 6 20:25:20 2014 From: seancribbs@REDACTED (Sean Cribbs) Date: Mon, 6 Jan 2014 13:25:20 -0600 Subject: [erlang-questions] [ANN] Neotoma 1.7.0 In-Reply-To: <008901cf0b13$abe24290$03a6c7b0$@gmail.com> References: <008901cf0b13$abe24290$03a6c7b0$@gmail.com> Message-ID: David, Roughly, yes. I usually recommend Neotoma for smallish grammars, where regexps are insufficient but a full tokenizer/parser is overkill. I haven't spent loads of time optimizing it for memory usage and complexity, so deeply recursive grammars or ones with lots of rules tend to be slower than yecc. On the other hand, Neotoma generates parsers which are comparatively readable and, where possible, will use binary-sharing on the input. There's more about Neotoma usage on the wiki[1]. Neotoma is currently in use in myproto[2], cuttlefish[3], and rivus[4], to name a few. [1] https://github.com/seancribbs/neotoma/wiki [2] https://github.com/altenwald/myproto [3] https://github.com/basho/cuttlefish [4] https://github.com/vascokk/rivus_cep On Mon, Jan 6, 2014 at 1:15 PM, David Mercer wrote: > This is as an alternative to *yecc,* yes? *Yecc* if you want to specify > your grammar in BNF, *neotoma* for PEG? Any advantages of one over the > other? > > > > Cheers, > > > > DBM > > > > *From:* erlang-questions-bounces@REDACTED [mailto: > erlang-questions-bounces@REDACTED] *On Behalf Of *Sean Cribbs > *Sent:* Monday, January 06, 2014 11:22 > *To:* Erlang Questions > *Subject:* Re: [erlang-questions] [ANN] Neotoma 1.7.0 > > > > Woops, GMail sent my message before I was ready. Here's the link for [1] > https://github.com/seancribbs/neotoma/tree/1.7.0#neotoma > > > > Cheers, > > > > Sean Cribbs > > > > On Mon, Jan 6, 2014 at 11:21 AM, Sean Cribbs wrote: > > Hi Erlangers, > > > > I'm happy to announce a long-awaited version bump to Neotoma[1]. > > > > The main feature of this release is the removal of several dialyzer type > warnings in generated parsers: namely, unused parser-combinators are elided > via macros. Thanks to Kostis Sagonas and Anthony Ramine for help in > diagnosing these errors. > > > > Breaking Changes: > > > > If your parser uses the included line/1 or column/1 functions, you will > need to define the 'line' or 'column' macros, respectively, at compile time > or in your global code block. Future releases might inspect inline code > blocks for usage of these functions and include them for you, but that is > not present in this release. > > > > The 'neotoma_peg' module has been moved to the test/ directory as it was > only used for testing the combinators. I'm sorry if anyone was using this > module outside Neotoma. > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Tue Jan 7 13:30:30 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 7 Jan 2014 16:30:30 +0400 Subject: [erlang-questions] [ANN] Neotoma 1.7.0 In-Reply-To: References: <008901cf0b13$abe24290$03a6c7b0$@gmail.com> Message-ID: Neotoma is much, much simpler than lex+yacc. I'm using it in erlyvideo to parse nginx-like config. -------------- next part -------------- An HTML attachment was scrubbed... URL: From icfp.publicity@REDACTED Wed Jan 8 02:46:01 2014 From: icfp.publicity@REDACTED (David Van Horn) Date: Tue, 7 Jan 2014 20:46:01 -0500 Subject: [erlang-questions] ICFP 2014: Call for papers Message-ID: ===================================================================== 19th ACM SIGPLAN International Conference on Functional Programming ICFP 2014 Gothenburg, Sweden, 1-3 September 2014 http://www.icfpconference.org/icfp2014 ===================================================================== Important Dates ~~~~~~~~~~~~~~~ Submissions due: Saturday, 1 March 2014, 23:59 UTC-11 (anywhere in the world) Author response: Wednesday, 23 April, 2014 Friday, 25 April, 2014 Notification: Monday, 5 May, 2014 Final copy due: Wednesday, 11 June, 2014 Scope ~~~~~ ICFP 2014 seeks original papers on the art and science of functional programming. Submissions are invited on all topics from principles to practice, from foundations to features, and from abstraction to application. The scope includes all languages that encourage functional programming, including both purely applicative and imperative languages, as well as languages with objects, concurrency, or parallelism. Topics of interest include (but are not limited to): * Language Design: concurrency and distribution; modules; components and composition; metaprogramming; interoperability; type systems; relations to imperative, object-oriented, or logic programming * Implementation: abstract machines; virtual machines; interpretation; compilation; compile-time and run-time optimization; memory management; multi-threading; exploiting parallel hardware; interfaces to foreign functions, services, components, or low-level machine resources * Software-Development Techniques: algorithms and data structures; design patterns; specification; verification; validation; proof assistants; debugging; testing; tracing; profiling * Foundations: formal semantics; lambda calculus; rewriting; type theory; monads; continuations; control; state; effects; program verification; dependent types * Analysis and Transformation: control-flow; data-flow; abstract interpretation; partial evaluation; program calculation * Applications and Domain-Specific Languages: symbolic computing; formal-methods tools; artificial intelligence; systems programming; distributed-systems and web programming; hardware design; databases; XML processing; scientific and numerical computing; graphical user interfaces; multimedia programming; scripting; system administration; security * Education: teaching introductory programming; parallel programming; mathematical proof; algebra * Functional Pearls: elegant, instructive, and fun essays on functional programming * Experience Reports: short papers that provide evidence that functional programming really works or describe obstacles that have kept it from working If you are concerned about the appropriateness of some topic, do not hesitate to contact the program chair. Abbreviated instructions for authors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * By Saturday, 1 March 2014, 23:59 UTC-11 (anywhere in the world), submit a full paper of at most 12 pages (6 pages for an Experience Report), including bibliography and figures. The deadlines will be strictly enforced and papers exceeding the page limits will be summarily rejected. * Authors have the option to attach supplementary material to a submission, on the understanding that reviewers may choose not to look at it. * Each submission must adhere to SIGPLAN's republication policy, as explained on the web at http://www.sigplan.org/Resources/Policies/Republication * Authors of resubmitted (but previously rejected) papers have the option to attach an annotated copy of the reviews of their previous submission(s), explaining how they have addressed these previous reviews in the present submission. If a reviewer identifies him/herself as a reviewer of this previous submission and wishes to see how his/her comments have been addressed, the program chair will communicate to this reviewer the annotated copy of his/her previous review. Otherwise, no reviewer will read the annotated copies of the previous reviews. Overall, a submission will be evaluated according to its relevance, correctness, significance, originality, and clarity. It should explain its contributions in both general and technical terms, clearly identifying what has been accomplished, explaining why it is significant, and comparing it with previous work. The technical content should be accessible to a broad audience. Functional Pearls and Experience Reports are separate categories of papers that need not report original research results and must be marked as such at the time of submission. Detailed guidelines on both categories are on the conference web site. Proceedings will be published by ACM Press. Authors of accepted submissions are expected to transfer the copyright to the ACM. Presentations will be videotaped and released online if the presenter consents. The proceedings will be freely available for download from the ACM Digital Library from one week before the start of the conference until two weeks after the conference. Formatting: Submissions must be in PDF format printable in black and white on US Letter sized paper and interpretable by Ghostscript. Papers must adhere to the standard ACM conference format: two columns, nine-point font on a ten-point baseline, with columns 20pc (3.33in) wide and 54pc (9in) tall, with a column gutter of 2pc (0.33in). A suitable document template for LaTeX is available: http://www.acm.org/sigs/sigplan/authorInformation.htm Submission: Submissions will be accepted on the web at https://www.easychair.org/conferences/?conf=icfp2014 . Improved versions of a paper may be submitted at any point before the submission deadline using the same web interface. Author response: Authors will have a 72-hour period, starting at 0:00 UTC-11 on Wednesday, 23 April 2014, to read reviews and respond to them. ACM Author-Izer is a unique service that enables ACM authors to generate and post links on either their home page or institutional repository for visitors to download the definitive version of their articles from the ACM Digital Library at no charge. Downloads through Author-Izer links are captured in official ACM statistics, improving the accuracy of usage and impact measurements. Consistently linking the definitive version of ACM article should reduce user confusion over article versioning. After your article has been published and assigned to your ACM Author Profile page, please visit http://www.acm.org/publications/acm-author-izer-service to learn how to create your links for fee downloads from the ACM DL. General Chair: Johan Jeuring, Utrecht University Program Chair: Manuel Chakravarty, University of New South Wales Program Committee: Edwin Brady, University of St Andrews Derek Dreyer, Max Planck Institute for Software Systems Ralf Hinze, University of Oxford Zhenjiang Hu, National Institute of Informatics Patricia Johann, Appalachian State University Ken Larsen, University of Copenhagen Yukiyoshi Kameyama, University of Tsukuba Anil Madhavapeddy, University of Cambridge Geoffrey Mainland, Drexel University David Mazi?res, Stanford University Jay McCarthy, Brigham Young University Matthew Might, University of Utah Ulf Norell, Chalmers University of Technology Tiark Rompf, Swiss Federal Institute of Technology in Lausanne Chung-chieh Shan, Indiana University Mary Sheeran, Chalmers University of Technology Matt Sottile, Galois Don Syme, Microsoft Research Jesse Tov, Harvard University From avinash_dhumane@REDACTED Wed Jan 8 05:12:27 2014 From: avinash_dhumane@REDACTED (Avinash Dhumane) Date: Wed, 8 Jan 2014 09:42:27 +0530 Subject: [erlang-questions] Question on naming of NIF library function Message-ID: <000301cf0c27$d8685dd0$89391970$@com> I am a student of whatever the name "Erlang" stands for - programming language, operating system, database system, platform (whatever)! I am in a (mental) process of making NIF, and the two objects in front of me are: http://www.erlang.org/doc/tutorial/nif.html and http://www.erlang.org/doc/man/erl_nif.html The NIF is meant for the private consumption of my application, not to be exported for public. So, the pre & post conditions for the NIF invocation are controlled. The onward and return payload for the NIF is "binary". By looking at the examples and the pattern of the set of library functions in erl_nif, I (falsely) imagined that there would be something like enif_get_binary() for receiving and enif_make_binary() for returning, available in the library. While the latter was found and its semantics for read-only (and memory release) understood from the documentation, the former call, i.e. enif_get_binary(), was nowhere to be found. Then, I found enif_get_string() - the progression of time in the mental process is important here (at least, from a student's point of view). The thought did rise that perhaps I needed to pass a list of bytes (instead of binary) to the NIF, but the last parameter, i.e. ErlNifCharEncoding, of enif_get_string() stopped that thought, for I didn't intend to encode the bytes in ERL_NIF_LATIN1. So, I searched more, and found enif_inspect_binary() and just below it the enif_is_binary() library function. For a moment, I doubted why two calls for apparently same purpose - which is "gathered" from the naming, only to find that the former, i.e. enif_inspect_binary(), not only inspects but also initializes the ErlNifBinary structure, from where I could pick up the payload and do the needful before calling enif_make_binary() at the time of returning from NIF. I am still in a mental process, here. So, the question is: What considerations are needed, to have, specifically for NIF and in general for Erlang, to appreciate the name enif_inspect_binary() instead of enif_get_binary()? I suppose there are several such "naming" places in Erlang, and I raised this particular one only to give a play to the "why" urge in me. Thanks Avinash -------------- next part -------------- An HTML attachment was scrubbed... URL: From freza@REDACTED Wed Jan 8 05:54:34 2014 From: freza@REDACTED (Jachym Holecek) Date: Tue, 7 Jan 2014 23:54:34 -0500 Subject: [erlang-questions] Question on naming of NIF library function In-Reply-To: <000301cf0c27$d8685dd0$89391970$@com> References: <000301cf0c27$d8685dd0$89391970$@com> Message-ID: <20140108045434.GA7135@circlewave.net> # Avinash Dhumane 2014-01-07: > So, the question is: What considerations are needed, to have, specifically > for NIF and in general for Erlang, to appreciate the name > enif_inspect_binary() instead of enif_get_binary()? I suppose there are > several such "naming" places in Erlang, and I raised this particular one > only to give a play to the "why" urge in me. Sitting inside NIF code all Erlang values appear as values of opaque type ERL_NIF_TERM. While not directly accessible, these values are known to consist of two components -- type tag and payload. The enif_is_xxx() family of functions merely asses the type tag against your expectation and let you know of the outcome. The enif_get_xxx() family of functions do the same but additionally unpack the payload into a value of native C type which is fully under your management. Binaries involve additional considerations regarding access mode and ownership -- inspecting a binary (or iolist) gives you readonly capability valid only in current thread and only for the duration of this NIF call, it's a convenient view inside the value which nevertheless is fully owned by Erlang. So the difference in naming could be argued to make sense; even if I really think it's not a big deal and maybe kind of accidental. :-) BR, -- Jachym From anders.nygren@REDACTED Wed Jan 8 19:48:53 2014 From: anders.nygren@REDACTED (Anders Nygren) Date: Wed, 8 Jan 2014 12:48:53 -0600 Subject: [erlang-questions] mnesia fallbacks with local_content Message-ID: I am trying to figure out if it is possible to use mnesia fallbacks with tables with local_content. The documentation does not provide much information on this and my experiments seems to imply that it is not possible. Running erlang 5.9.1, mnesia 4.7, I have two nodes A and B. I have a table t1, that has {local_content, true}, If I take a backup on node A and install that as a fallback and then restart mnesia, the content of table t1 on node B gets replaced with the contents from t1 on node A. Is there any way to get this to work, i.e. to get the local contents restored correctly on all nodes from a fallback? /Anders -------------- next part -------------- An HTML attachment was scrubbed... URL: From emmiller@REDACTED Wed Jan 8 19:38:19 2014 From: emmiller@REDACTED (Evan Miller) Date: Wed, 8 Jan 2014 12:38:19 -0600 Subject: [erlang-questions] A farewell to Erlang Message-ID: Friends and heroes, As some of you know I run a couple of popular open-source Erlang projects (Chicago Boss, the Rails-like web framework, and ErlyDTL, the Django template library). As of today I am retiring from the projects. This retirement has been in the works for several months, so I am pleased to announce that both projects will be in good hands. ErlyDTL will be taken over by Andreas Stenius, who is an active contributor to the Zotonic project as well as to ErlyDTL. Andreas has been doing great work reconciling mainline ErlyDTL with the Zotonic fork of ErlyDTL, and I'm excited to see the code that emerges. Andreas will be the third maintainer in ErlyDTL's history; in 2009 I took over duties from Roberto Saccon, who started the project in 2007. Watch out for a 0.8 announcement from Andreas in the coming weeks. I started Chicago Boss several years ago with a vision of harnessing the power of Erlang to deliver modern websites. Most of the pieces of that vision are in place, but it still needs a bit of work before victory can be declared. I've been in charge of Chicago Boss since its inception, and I'm afraid it has become a bit larger than what one person can manage. So I'm very pleased to announce that two members of the Erlang community will be driving development from here to version 1.0. The new leadership team is Zachary Kessin and Dmitry Polyanovsky. You might know Zach from the Mostly Erlang podcast as well as the "Building Web Applications with Erlang" O'Reilly book. Although new to Chicago Boss, he'll be working on the framework full-time under the direction of Dmitry, who is a longtime CB contributor. Zach and Dmitry have been actively adding tests, docs, and error messages to Chicago Boss in order to bring the project to maturity. They were 100% responsible for the recent successful 0.8.8 and 0.8.9 releases of the framework, and I can't wait to see what's next from them. You can read my full announcement about the CB transition (including my reasons for moving on) here: https://groups.google.com/forum/#!topic/chicagoboss/ekU5gZ_Ty2o I'm happy to say that the Chicago Boss project and community are in better shape than ever, so if you like the idea of building an easy-to-use web framework in Erlang, now is a great time to get involved! By the way, the repositories have been moved off of my personal GitHub account to fresh URLs, so please update your bookmarks accordingly (assuming you still do that sort of thing): https://github.com/erlydtl/erlydtl https://github.com/ChicagoBoss On a personal note, since Chicago Boss and ErlyDTL were the only things keeping me hacking in Erlang, I'm afraid you won't have me to "kick around" anymore. I learned a tremendous amount from the Erlang community, and the two conferences I attended last year were pure geek heaven. I consider the Erlang VM to be a modern marvel of software engineering, and it was a true privilege to get to know some of the brains behind it. But there's a time for all things, and I believe it's time for me to move on to other projects. I have particularly relished my role as an iconoclast, protector of the pmods, and occasional straw-man here on the erlang-questions mailing list. If for some perverse reason you'd like to carry on my memory here, just remember 1) we all got into programming because it was fun 2) nice syntax is sometimes more important than program correctness and 3) great things often begin life as dirty hacks. So much for valediction. It's been a fun ride. Goodbye, Erlang! I'll carry the gospel of crashing wherever I go. Evan -- Evan Miller http://www.evanmiller.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From overminddl1@REDACTED Thu Jan 9 06:37:38 2014 From: overminddl1@REDACTED (OvermindDL1) Date: Wed, 8 Jan 2014 22:37:38 -0700 Subject: [erlang-questions] A farewell to Erlang In-Reply-To: References: Message-ID: You have been amazing. Thank you for everything and great luck on your future endeavors! On Jan 8, 2014 2:32 PM, "Evan Miller" wrote: > Friends and heroes, > > > As some of you know I run a couple of popular open-source Erlang projects > (Chicago Boss, the Rails-like web framework, and ErlyDTL, the Django > template library). As of today I am retiring from the projects. > > > This retirement has been in the works for several months, so I am pleased > to announce that both projects will be in good hands. ErlyDTL will be taken > over by Andreas Stenius, who is an active contributor to the Zotonic > project as well as to ErlyDTL. Andreas has been doing great work > reconciling mainline ErlyDTL with the Zotonic fork of ErlyDTL, and I'm > excited to see the code that emerges. Andreas will be the third maintainer > in ErlyDTL's history; in 2009 I took over duties from Roberto Saccon, who > started the project in 2007. Watch out for a 0.8 announcement from Andreas > in the coming weeks. > > > I started Chicago Boss several years ago with a vision of harnessing the > power of Erlang to deliver modern websites. Most of the pieces of that > vision are in place, but it still needs a bit of work before victory can be > declared. I've been in charge of Chicago Boss since its inception, and I'm > afraid it has become a bit larger than what one person can manage. So I'm > very pleased to announce that two members of the Erlang community will be > driving development from here to version 1.0. > > > The new leadership team is Zachary Kessin and Dmitry Polyanovsky. You > might know Zach from the Mostly Erlang podcast as well as the "Building Web > Applications with Erlang" O'Reilly book. Although new to Chicago Boss, > he'll be working on the framework full-time under the direction of Dmitry, > who is a longtime CB contributor. Zach and Dmitry have been actively adding > tests, docs, and error messages to Chicago Boss in order to bring the > project to maturity. They were 100% responsible for the recent successful > 0.8.8 and 0.8.9 releases of the framework, and I can't wait to see what's > next from them. > > > You can read my full announcement about the CB transition (including my > reasons for moving on) here: > > > https://groups.google.com/forum/#!topic/chicagoboss/ekU5gZ_Ty2o > > > I'm happy to say that the Chicago Boss project and community are in better > shape than ever, so if you like the idea of building an easy-to-use web > framework in Erlang, now is a great time to get involved! > > > By the way, the repositories have been moved off of my personal GitHub > account to fresh URLs, so please update your bookmarks accordingly > (assuming you still do that sort of thing): > > > https://github.com/erlydtl/erlydtl > > https://github.com/ChicagoBoss > > > On a personal note, since Chicago Boss and ErlyDTL were the only things > keeping me hacking in Erlang, I'm afraid you won't have me to "kick around" > anymore. I learned a tremendous amount from the Erlang community, and the > two conferences I attended last year were pure geek heaven. I consider the > Erlang VM to be a modern marvel of software engineering, and it was a true > privilege to get to know some of the brains behind it. But there's a time > for all things, and I believe it's time for me to move on to other projects. > > > I have particularly relished my role as an iconoclast, protector of the > pmods, and occasional straw-man here on the erlang-questions mailing list. > If for some perverse reason you'd like to carry on my memory here, just > remember 1) we all got into programming because it was fun 2) nice syntax > is sometimes more important than program correctness and 3) great things > often begin life as dirty hacks. > > > So much for valediction. It's been a fun ride. Goodbye, Erlang! I'll carry > the gospel of crashing wherever I go. > > > Evan > > -- > Evan Miller > http://www.evanmiller.org/ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dangud@REDACTED Thu Jan 9 10:24:13 2014 From: dangud@REDACTED (Dan Gudmundsson) Date: Thu, 9 Jan 2014 10:24:13 +0100 Subject: [erlang-questions] mnesia fallbacks with local_content In-Reply-To: References: Message-ID: Nope it only saves the local copy. On Wed, Jan 8, 2014 at 7:48 PM, Anders Nygren wrote: > I am trying to figure out if it is possible to use mnesia fallbacks with > tables with local_content. The documentation does not provide much > information on this and my experiments seems to imply that it is not > possible. > > Running erlang 5.9.1, mnesia 4.7, I have two nodes A and B. > > I have a table t1, that has {local_content, true}, > If I take a backup on node A and install that as a fallback and then > restart mnesia, the content of table t1 on node B gets replaced with the > contents from t1 on node A. > > Is there any way to get this to work, i.e. to get the local contents > restored correctly on all nodes from a fallback? > > /Anders > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yilmazhuseyin@REDACTED Thu Jan 9 11:00:39 2014 From: yilmazhuseyin@REDACTED (Huseyin Yilmaz) Date: Thu, 9 Jan 2014 12:00:39 +0200 Subject: [erlang-questions] Imlpementing a multi-machine application Message-ID: Hi, I have a message publisher process which will be registered to global process registry. I want this publisher to publish messages to many listener processes that are located in several different nodes. My current code sends messages to all listener processes separately ( https://github.com/huseyinyilmaz/publicator/blob/master/lib/server/src/s_channel.erl#L198), so those message will go through the network to other nodes separately even though every process gets the same message. In order to get better network performance, I thought to spawn a publisher process in every node and publish the message locally for all nodes. Is this a good implementation? I am also open to different implementation suggestions. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker.eriksson@REDACTED Thu Jan 9 11:33:28 2014 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Thu, 9 Jan 2014 11:33:28 +0100 Subject: [erlang-questions] Question on naming of NIF library function In-Reply-To: <20140108045434.GA7135@circlewave.net> References: <000301cf0c27$d8685dd0$89391970$@com> <20140108045434.GA7135@circlewave.net> Message-ID: <52CE7AF8.5080608@erix.ericsson.se> On 01/08/2014 05:54 AM, Jachym Holecek wrote: > # Avinash Dhumane 2014-01-07: >> So, the question is: What considerations are needed, to have, specifically >> for NIF and in general for Erlang, to appreciate the name >> enif_inspect_binary() instead of enif_get_binary()? I suppose there are >> several such "naming" places in Erlang, and I raised this particular one >> only to give a play to the "why" urge in me. > Sitting inside NIF code all Erlang values appear as values of opaque > type ERL_NIF_TERM. While not directly accessible, these values are > known to consist of two components -- type tag and payload. > > The enif_is_xxx() family of functions merely asses the type tag against > your expectation and let you know of the outcome. The enif_get_xxx() > family of functions do the same but additionally unpack the payload > into a value of native C type which is fully under your management. > > Binaries involve additional considerations regarding access mode > and ownership -- inspecting a binary (or iolist) gives you readonly > capability valid only in current thread and only for the duration > of this NIF call, it's a convenient view inside the value which > nevertheless is fully owned by Erlang. > > So the difference in naming could be argued to make sense; even if I > really think it's not a big deal and maybe kind of accidental. :-) > > Yes, it was a deliberate naming choice to indicate that it is an inspection of a live Erlang term where you have to consider its "readonlyness" and lifetime. /Sverker, Erlang/OTP From sina.samv@REDACTED Thu Jan 9 10:45:31 2014 From: sina.samv@REDACTED (Sina Samavati) Date: Thu, 9 Jan 2014 13:15:31 +0330 Subject: [erlang-questions] A farewell to Erlang In-Reply-To: References: Message-ID: Your works made the Erlang world a better world for web development, thanks for everything and good luck. On Wed, Jan 8, 2014 at 10:08 PM, Evan Miller wrote: > Friends and heroes, > > > As some of you know I run a couple of popular open-source Erlang projects > (Chicago Boss, the Rails-like web framework, and ErlyDTL, the Django > template library). As of today I am retiring from the projects. > > > This retirement has been in the works for several months, so I am pleased > to announce that both projects will be in good hands. ErlyDTL will be taken > over by Andreas Stenius, who is an active contributor to the Zotonic > project as well as to ErlyDTL. Andreas has been doing great work > reconciling mainline ErlyDTL with the Zotonic fork of ErlyDTL, and I'm > excited to see the code that emerges. Andreas will be the third maintainer > in ErlyDTL's history; in 2009 I took over duties from Roberto Saccon, who > started the project in 2007. Watch out for a 0.8 announcement from Andreas > in the coming weeks. > > > I started Chicago Boss several years ago with a vision of harnessing the > power of Erlang to deliver modern websites. Most of the pieces of that > vision are in place, but it still needs a bit of work before victory can be > declared. I've been in charge of Chicago Boss since its inception, and I'm > afraid it has become a bit larger than what one person can manage. So I'm > very pleased to announce that two members of the Erlang community will be > driving development from here to version 1.0. > > > The new leadership team is Zachary Kessin and Dmitry Polyanovsky. You > might know Zach from the Mostly Erlang podcast as well as the "Building Web > Applications with Erlang" O'Reilly book. Although new to Chicago Boss, > he'll be working on the framework full-time under the direction of Dmitry, > who is a longtime CB contributor. Zach and Dmitry have been actively adding > tests, docs, and error messages to Chicago Boss in order to bring the > project to maturity. They were 100% responsible for the recent successful > 0.8.8 and 0.8.9 releases of the framework, and I can't wait to see what's > next from them. > > > You can read my full announcement about the CB transition (including my > reasons for moving on) here: > > > https://groups.google.com/forum/#!topic/chicagoboss/ekU5gZ_Ty2o > > > I'm happy to say that the Chicago Boss project and community are in better > shape than ever, so if you like the idea of building an easy-to-use web > framework in Erlang, now is a great time to get involved! > > > By the way, the repositories have been moved off of my personal GitHub > account to fresh URLs, so please update your bookmarks accordingly > (assuming you still do that sort of thing): > > > https://github.com/erlydtl/erlydtl > > https://github.com/ChicagoBoss > > > On a personal note, since Chicago Boss and ErlyDTL were the only things > keeping me hacking in Erlang, I'm afraid you won't have me to "kick around" > anymore. I learned a tremendous amount from the Erlang community, and the > two conferences I attended last year were pure geek heaven. I consider the > Erlang VM to be a modern marvel of software engineering, and it was a true > privilege to get to know some of the brains behind it. But there's a time > for all things, and I believe it's time for me to move on to other projects. > > > I have particularly relished my role as an iconoclast, protector of the > pmods, and occasional straw-man here on the erlang-questions mailing list. > If for some perverse reason you'd like to carry on my memory here, just > remember 1) we all got into programming because it was fun 2) nice syntax > is sometimes more important than program correctness and 3) great things > often begin life as dirty hacks. > > > So much for valediction. It's been a fun ride. Goodbye, Erlang! I'll carry > the gospel of crashing wherever I go. > > > Evan > > -- > Evan Miller > http://www.evanmiller.org/ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hm@REDACTED Thu Jan 9 13:51:47 2014 From: hm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Mattsson?=) Date: Thu, 9 Jan 2014 13:51:47 +0100 Subject: [erlang-questions] mnesia fallbacks with local_content Message-ID: It is a bit complicated and partly undocumented. You need to do it in several steps: 1. Activate a global checkpoint (mnesia:activate_checkpoint/1). 2. Perform a local backup on each node (mnesia:backup_checkpoint/3) 3. Dectivate the checkpoint (mnesia:deactivate_checkpoint/1) 4. Install a local fallback (from the local backup) on each node (mnesia:install_fallback/2) See mnesia_log:check_backup_arg_type/2 for details of the third (partly undocumented) argument of mnesia:backup_checkpoint/3. /H?kan On Wed, Jan 8, 2014 at 7:48 PM, Anders Nygren wrote: > I am trying to figure out if it is possible to use mnesia fallbacks with > tables with local_content. The documentation does not provide much > information on this and my experiments seems to imply that it is not > possible. > > Running erlang 5.9.1, mnesia 4.7, I have two nodes A and B. > > I have a table t1, that has {local_content, true}, > If I take a backup on node A and install that as a fallback and then restart > mnesia, the content of table t1 on node B gets replaced with the contents > from t1 on node A. > > Is there any way to get this to work, i.e. to get the local contents > restored correctly on all nodes from a fallback? > > /Anders > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From hm@REDACTED Thu Jan 9 14:05:39 2014 From: hm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Mattsson?=) Date: Thu, 9 Jan 2014 14:05:39 +0100 Subject: [erlang-questions] mnesia fallbacks with local_content Message-ID: Hmm, it did not work as I expected. I encountered a bug in mnesia_checkpoint:select_writers/2. Currently it does not handle local_content tables properly. The bug implies that the local backup on the remote nodes does not include local_content tables at all. Anyone that want to do a contribution? /H?kan On Thu, Jan 9, 2014 at 1:51 PM, H?kan Mattsson wrote: > It is a bit complicated and partly undocumented. You need to do it in > several steps: > > 1. Activate a global checkpoint (mnesia:activate_checkpoint/1). > 2. Perform a local backup on each node (mnesia:backup_checkpoint/3) > 3. Dectivate the checkpoint (mnesia:deactivate_checkpoint/1) > 4. Install a local fallback (from the local backup) on each node > (mnesia:install_fallback/2) > > See mnesia_log:check_backup_arg_type/2 for details of the third > (partly undocumented) argument of mnesia:backup_checkpoint/3. > > /H?kan > > On Wed, Jan 8, 2014 at 7:48 PM, Anders Nygren wrote: >> I am trying to figure out if it is possible to use mnesia fallbacks with >> tables with local_content. The documentation does not provide much >> information on this and my experiments seems to imply that it is not >> possible. >> >> Running erlang 5.9.1, mnesia 4.7, I have two nodes A and B. >> >> I have a table t1, that has {local_content, true}, >> If I take a backup on node A and install that as a fallback and then restart >> mnesia, the content of table t1 on node B gets replaced with the contents >> from t1 on node A. >> >> Is there any way to get this to work, i.e. to get the local contents >> restored correctly on all nodes from a fallback? >> >> /Anders >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> From g@REDACTED Thu Jan 9 16:57:43 2014 From: g@REDACTED (Garrett Smith) Date: Thu, 9 Jan 2014 09:57:43 -0600 Subject: [erlang-questions] A farewell to Erlang In-Reply-To: References: Message-ID: Yeah, good luck with that. You saw Godfather III right? On Thu, Jan 9, 2014 at 3:45 AM, Sina Samavati wrote: > Your works made the Erlang world a better world for web development, thanks > for everything and good luck. > > > On Wed, Jan 8, 2014 at 10:08 PM, Evan Miller wrote: >> >> Friends and heroes, >> >> >> As some of you know I run a couple of popular open-source Erlang projects >> (Chicago Boss, the Rails-like web framework, and ErlyDTL, the Django >> template library). As of today I am retiring from the projects. >> >> >> This retirement has been in the works for several months, so I am pleased >> to announce that both projects will be in good hands. ErlyDTL will be taken >> over by Andreas Stenius, who is an active contributor to the Zotonic project >> as well as to ErlyDTL. Andreas has been doing great work reconciling >> mainline ErlyDTL with the Zotonic fork of ErlyDTL, and I'm excited to see >> the code that emerges. Andreas will be the third maintainer in ErlyDTL's >> history; in 2009 I took over duties from Roberto Saccon, who started the >> project in 2007. Watch out for a 0.8 announcement from Andreas in the coming >> weeks. >> >> >> I started Chicago Boss several years ago with a vision of harnessing the >> power of Erlang to deliver modern websites. Most of the pieces of that >> vision are in place, but it still needs a bit of work before victory can be >> declared. I've been in charge of Chicago Boss since its inception, and I'm >> afraid it has become a bit larger than what one person can manage. So I'm >> very pleased to announce that two members of the Erlang community will be >> driving development from here to version 1.0. >> >> >> The new leadership team is Zachary Kessin and Dmitry Polyanovsky. You >> might know Zach from the Mostly Erlang podcast as well as the "Building Web >> Applications with Erlang" O'Reilly book. Although new to Chicago Boss, he'll >> be working on the framework full-time under the direction of Dmitry, who is >> a longtime CB contributor. Zach and Dmitry have been actively adding tests, >> docs, and error messages to Chicago Boss in order to bring the project to >> maturity. They were 100% responsible for the recent successful 0.8.8 and >> 0.8.9 releases of the framework, and I can't wait to see what's next from >> them. >> >> >> You can read my full announcement about the CB transition (including my >> reasons for moving on) here: >> >> >> https://groups.google.com/forum/#!topic/chicagoboss/ekU5gZ_Ty2o >> >> >> I'm happy to say that the Chicago Boss project and community are in better >> shape than ever, so if you like the idea of building an easy-to-use web >> framework in Erlang, now is a great time to get involved! >> >> >> By the way, the repositories have been moved off of my personal GitHub >> account to fresh URLs, so please update your bookmarks accordingly (assuming >> you still do that sort of thing): >> >> >> https://github.com/erlydtl/erlydtl >> >> https://github.com/ChicagoBoss >> >> >> On a personal note, since Chicago Boss and ErlyDTL were the only things >> keeping me hacking in Erlang, I'm afraid you won't have me to "kick around" >> anymore. I learned a tremendous amount from the Erlang community, and the >> two conferences I attended last year were pure geek heaven. I consider the >> Erlang VM to be a modern marvel of software engineering, and it was a true >> privilege to get to know some of the brains behind it. But there's a time >> for all things, and I believe it's time for me to move on to other projects. >> >> >> I have particularly relished my role as an iconoclast, protector of the >> pmods, and occasional straw-man here on the erlang-questions mailing list. >> If for some perverse reason you'd like to carry on my memory here, just >> remember 1) we all got into programming because it was fun 2) nice syntax is >> sometimes more important than program correctness and 3) great things often >> begin life as dirty hacks. >> >> >> So much for valediction. It's been a fun ride. Goodbye, Erlang! I'll carry >> the gospel of crashing wherever I go. >> >> >> Evan >> >> >> -- >> Evan Miller >> http://www.evanmiller.org/ >> >> _______________________________________________ >> 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 carloscamachoucv@REDACTED Thu Jan 9 17:03:03 2014 From: carloscamachoucv@REDACTED (ccamacho) Date: Thu, 9 Jan 2014 08:03:03 -0800 (PST) Subject: [erlang-questions] Issues with Erlang's Yecc precedences Message-ID: <1389283383439-4655350.post@n4.nabble.com> Hi list!! First thanks for this information resource for learning Erlang XD.. I?m trying to write an Erlang parser with Yecc, but I?m having some troubles with the precedence of the semantic rules. In my case I defined the grammar, the terminal and non-terminal symbols, the rules and the associated code. This is what I wrote for testing. %File starts here stack.yrl %Grammar non terminals Nonterminals product require require1 mandatory mandatory1. %Grammar terminals Terminals 'tick' 'feature' '(' ')' 'req' 'mand' ';' 'nil'. %Initial symbol Rootsymbol product. %Operands priority Left 200 require. Left 190 require1. Left 180 mandatory. Left 170 mandatory1. Left 80 'req'. Left 60 'mand'. Left 50 ';'. %Secuence Left 40 'feature'. %Optional feature %-------------------------------------------------- %Grammar with operational rules %[req1 & req2] product -> require: '$1'. require -> feature req feature '(' feature ';' product ')' : if '$1' == '$5' -> {'$5', {'$4', '$7', '$8', {mand,1}, '$3'}}; true -> {'$5', {'$1', '$2', '$3', '$4', '$7', '$8'}} end. %[req3] product -> require1 : '$1'. require1 -> feature req feature '(' tick ')' : {nil,1}. %[mand2 & mand3] product -> mandatory : '$1'. mandatory -> '(' feature ';' product ')' mand feature : if '$2' == '$7' -> {'$2', {'$4'}}; true -> {'$2',{'$1', '$4', '$5', '$6', '$7'}} end. %[mand1] product -> mandatory1: '$1'. mandatory1 -> '(' tick ')' mand feature : {$5, {tick,1}}. %[tick] product -> feature ';' tick : {'$1', {nil,1}}. product -> nil. product -> feature ';' product : {'$1', {'$3'}}. Erlang code. %To remove brackets and return only the third parameter, right now is not used. unwrap_feature({_,_,V}) -> V. %%How to compile and use %Save this as stack.yrl %Run erl and then %yecc:yecc("stack.yrl","stack.erl"). %c(stack). %File ends here stack.yrl Now lets execute a specific term to check how rules are applied. stack:parse([{feature,1,'A'},{'req',1},{feature,1,'C'},{'(',1},{feature,1,'A'},{';',1},{feature,1,'B'},{';',1},{feature,1,'C'},{';',1},{tick,1},{')',1}]). The parser output is: {ok,{{feature,1,'A'}, {{'(',1}, {{feature,1,'B'},{{{feature,1,'C'},{nil,1}}}}, {')',1}, {mand,1}, {feature,1,'C'}}}} But I need this. I?m writing the output as long the parser process the term (like a debug output). Initial term. {feature,1,'A'},{'req',1},{feature,1,'C'},{'(',1},{feature,1,'A'},{';',1},{feature,1,'B'},{';',1},{feature,1,'C'},{';',1},{tick,1},{')',1} Rule %[req1 & req2]. (This is applied correctly ? Case '$1' == '$5') {feature,1,'A'},{{'(',1},{feature,1,'B'},{';',1},{feature,1,'C'},{';',1},{tick,1},{')',1},{mand,1},{feature,1,'C'}} Now, I don?t know what happens, but the output should be as this. Rule %[mand2 & mand3]. (Case true) {feature,1,'A'},{{feature,1,'B'},{{'(',1},{feature,1,'C'},{';',1},{tick,1},{')',1},{mand,1},{feature,1,'C'}}} Rule %[mand2 & mand3]. (Case '$2' == '$7') {feature,1,'A'},{{feature,1,'B'},{{feature,1,'C'},{{tick,1}}}} Rule %[tick] ? And final result. {feature,1,'A'},{{feature,1,'B'},{{feature,1,'C'},{{{tick,1},{nil,1}}}}} I already tried this: As is explained in Yecc manual, I was able to do this: Playing with the operator precedences. Applying precedence to rules. From the documentation (It is also possible to declare precedence for non-terminals, "one level up". This is practical when an operator is overloaded (see also example 3 below)). But it doesn?t seem to work for me. Any help??? Thanks! -- View this message in context: http://erlang.2086793.n4.nabble.com/Issues-with-Erlang-s-Yecc-precedences-tp4655350.html Sent from the Erlang Questions mailing list archive at Nabble.com. From essen@REDACTED Thu Jan 9 17:14:28 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 09 Jan 2014 17:14:28 +0100 Subject: [erlang-questions] A farewell to Erlang In-Reply-To: References: Message-ID: <52CECAE4.1030300@ninenines.eu> On 01/08/2014 07:38 PM, Evan Miller wrote: > 2) nice syntax is sometimes more important than program correctness You troll. ;) Not doing Erlang sounds like hell, but I hope you will enjoy it. -- Lo?c Hoguin http://ninenines.eu From gumm@REDACTED Thu Jan 9 18:43:34 2014 From: gumm@REDACTED (Jesse Gumm) Date: Thu, 9 Jan 2014 11:43:34 -0600 Subject: [erlang-questions] A farewell to Erlang In-Reply-To: References: Message-ID: Good luck with your adventures in statistics! And when you inevitably have to scale up massively, you'll already know the appropriate tool to direct your employees toward. See you around the big city, -Jesse -- Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm On Jan 8, 2014 3:32 PM, "Evan Miller" wrote: > Friends and heroes, > > > As some of you know I run a couple of popular open-source Erlang projects > (Chicago Boss, the Rails-like web framework, and ErlyDTL, the Django > template library). As of today I am retiring from the projects. > > > This retirement has been in the works for several months, so I am pleased > to announce that both projects will be in good hands. ErlyDTL will be taken > over by Andreas Stenius, who is an active contributor to the Zotonic > project as well as to ErlyDTL. Andreas has been doing great work > reconciling mainline ErlyDTL with the Zotonic fork of ErlyDTL, and I'm > excited to see the code that emerges. Andreas will be the third maintainer > in ErlyDTL's history; in 2009 I took over duties from Roberto Saccon, who > started the project in 2007. Watch out for a 0.8 announcement from Andreas > in the coming weeks. > > > I started Chicago Boss several years ago with a vision of harnessing the > power of Erlang to deliver modern websites. Most of the pieces of that > vision are in place, but it still needs a bit of work before victory can be > declared. I've been in charge of Chicago Boss since its inception, and I'm > afraid it has become a bit larger than what one person can manage. So I'm > very pleased to announce that two members of the Erlang community will be > driving development from here to version 1.0. > > > The new leadership team is Zachary Kessin and Dmitry Polyanovsky. You > might know Zach from the Mostly Erlang podcast as well as the "Building Web > Applications with Erlang" O'Reilly book. Although new to Chicago Boss, > he'll be working on the framework full-time under the direction of Dmitry, > who is a longtime CB contributor. Zach and Dmitry have been actively adding > tests, docs, and error messages to Chicago Boss in order to bring the > project to maturity. They were 100% responsible for the recent successful > 0.8.8 and 0.8.9 releases of the framework, and I can't wait to see what's > next from them. > > > You can read my full announcement about the CB transition (including my > reasons for moving on) here: > > > https://groups.google.com/forum/#!topic/chicagoboss/ekU5gZ_Ty2o > > > I'm happy to say that the Chicago Boss project and community are in better > shape than ever, so if you like the idea of building an easy-to-use web > framework in Erlang, now is a great time to get involved! > > > By the way, the repositories have been moved off of my personal GitHub > account to fresh URLs, so please update your bookmarks accordingly > (assuming you still do that sort of thing): > > > https://github.com/erlydtl/erlydtl > > https://github.com/ChicagoBoss > > > On a personal note, since Chicago Boss and ErlyDTL were the only things > keeping me hacking in Erlang, I'm afraid you won't have me to "kick around" > anymore. I learned a tremendous amount from the Erlang community, and the > two conferences I attended last year were pure geek heaven. I consider the > Erlang VM to be a modern marvel of software engineering, and it was a true > privilege to get to know some of the brains behind it. But there's a time > for all things, and I believe it's time for me to move on to other projects. > > > I have particularly relished my role as an iconoclast, protector of the > pmods, and occasional straw-man here on the erlang-questions mailing list. > If for some perverse reason you'd like to carry on my memory here, just > remember 1) we all got into programming because it was fun 2) nice syntax > is sometimes more important than program correctness and 3) great things > often begin life as dirty hacks. > > > So much for valediction. It's been a fun ride. Goodbye, Erlang! I'll carry > the gospel of crashing wherever I go. > > > Evan > > -- > Evan Miller > http://www.evanmiller.org/ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Thu Jan 9 18:44:42 2014 From: elbrujohalcon@REDACTED (Brujo Benavides @ Inaka) Date: Thu, 9 Jan 2014 14:44:42 -0300 Subject: [erlang-questions] Cowboy + Gun + SPDY weirdness Message-ID: <9F487A21-52B0-45E7-B717-D567B11A4ACE@inaka.net> Hi all (specially Lo?c)! I stumbled upon something quite odd when trying to implement a SPDY server with cowboy. I was using gun to run my tests (as cowboy is doing), but most of my POST tests didn?t work. After some debugging, I found out that if I make this change, the echo_body test on the spdy_SUITE in cowboy tests suddenly stops working (like my tests :)). Anybody (again, specially Lo?c :)) has any idea what is happening here? Thank you very much in advance, folks! Brujo Benavides elbrujohalcon@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Thu Jan 9 21:01:54 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Thu, 9 Jan 2014 22:01:54 +0200 Subject: [erlang-questions] raw file append issue Message-ID: <949980C3-1D35-4439-8BC8-DD9F3B236B96@gmail.com> Hello, I do re-call that there was a discussion in the thread about some nasty behaviour of file i/o but I do not able to find a reference in my mailbox. Does the following issue sound familiar to you? I have got pretty much similar issue what is depicted here: http://erlang.org/pipermail/erlang-bugs/2013-January/003288.html I do have a single process that uses raw, append only file: [raw, binary, append, exclusive, {delayed_write, 256Kb, 1000}] The process writes a chunks of 1.5 - 2KB but it does it with high frequency 10K+ per second. I am using iolists in file write: file:write(FD, [Head, Payload, Foot]). Unfortunately, sometimes read data does not match a written one. I was not able to see the problem if write load is less the 10K per second. I am using R15B03 and OS is AWS Linux (CentOS derivation). Any thought? Best Regards, Dmitry From essen@REDACTED Thu Jan 9 21:07:26 2014 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Thu, 09 Jan 2014 21:07:26 +0100 Subject: [erlang-questions] Cowboy + Gun + SPDY weirdness Message-ID: Hello, I believe you might be the first person to actually check SPDY out seriously. I wouldn't be surprised if one or two bugs persisted. On the other hand my tests still pass if I do the change you pointed out, could you try to debug things out and see what makes it fail for you? Thanks. -- Lo?c Hoguin http://ninenines.eu -------- Original Message -------- From:"Brujo Benavides @ Inaka" Sent:Thu, 09 Jan 2014 18:44:42 +0100 To:erlang-questions Subject:[erlang-questions] Cowboy + Gun + SPDY weirdness >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Thu Jan 9 21:59:32 2014 From: elbrujohalcon@REDACTED (Brujo Benavides @ Inaka) Date: Thu, 9 Jan 2014 17:59:32 -0300 Subject: [erlang-questions] Cowboy + Gun + SPDY weirdness In-Reply-To: References: Message-ID: Hi Lo?c, Happy to be the first one :) For what I?ve found, it might be related to the value of SETTINGS_INITIAL_WINDOW_SIZE in the SETTINGS control frame, but that?s all I have. On the other hand, it?s really strange that it works for you. What version of Erlang are you using? I?m on? Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V5.10.4 (abort with ^G) Cheers! On Jan 9, 2014, at 17:07, Lo?c Hoguin wrote: > Hello, > > I believe you might be the first person to actually check SPDY out seriously. I wouldn't be surprised if one or two bugs persisted. > > On the other hand my tests still pass if I do the change you pointed out, could you try to debug things out and see what makes it fail for you? > > Thanks. > > -- > Lo?c Hoguin > http://ninenines.eu > > -------- Original Message -------- > From:"Brujo Benavides @ Inaka" > Sent:Thu, 09 Jan 2014 18:44:42 +0100 > To:erlang-questions > Subject:[erlang-questions] Cowboy + Gun + SPDY weirdness > > Hi all (specially Lo?c)! > > I stumbled upon something quite odd when trying to implement a SPDY server with cowboy. I was using gun to run my tests (as cowboy is doing), but most of my POST tests didn?t work. > After some debugging, I found out that if I make this change, the echo_body test on the spdy_SUITE in cowboy tests suddenly stops working (like my tests :)). > Anybody (again, specially Lo?c :)) has any idea what is happening here? > Thank you very much in advance, folks! > > Brujo Benavides > elbrujohalcon@REDACTED > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From james.penguins@REDACTED Thu Jan 9 21:33:27 2014 From: james.penguins@REDACTED (James Lyons) Date: Thu, 9 Jan 2014 15:33:27 -0500 Subject: [erlang-questions] Cowboy SSL issues with Chrome/FF Message-ID: Using certificates from StartSSL and GoGetSSL, cowboy site fails to load on Chrome v31 with "ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED" on mac & ubuntu and FF v26 with "Error code: sec_error_invalid_key" on mac and ubuntu. Site will load in Safari properly and certificate shows as valid. Anyone seen this behavior before? Thanks! -- James Lyons -------------- next part -------------- An HTML attachment was scrubbed... URL: From sina.samv@REDACTED Thu Jan 9 21:42:53 2014 From: sina.samv@REDACTED (Sina Samavati) Date: Fri, 10 Jan 2014 00:12:53 +0330 Subject: [erlang-questions] A farewell to Erlang In-Reply-To: References: Message-ID: On Thu, Jan 9, 2014 at 7:27 PM, Garrett Smith wrote: > You saw Godfather III right? No, I didn't. -- Sina Samavati Software engineer https://github.com/s1n4 https://twitter.com/sinasamavati -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Thu Jan 9 22:23:46 2014 From: essen@REDACTED (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=) Date: Thu, 09 Jan 2014 22:23:46 +0100 Subject: [erlang-questions] Cowboy + Gun + SPDY weirdness Message-ID: It works on all supported versions from R16B to R16B03 plus maint and master branches of OTP. I'm sorry but you're pretty much on your own if I can't reproduce, though I'm here if you have questions. My advice would be to print some info about what is really sent and received and see if there's too much/not enough data. Good luck! -- Lo?c Hoguin http://ninenines.eu -------- Original Message -------- From:"Brujo Benavides @ Inaka" Sent:Thu, 09 Jan 2014 21:59:32 +0100 To:Lo?c Hoguin Cc:erlang-questions Subject:Re: [erlang-questions] Cowboy + Gun + SPDY weirdness >Hi Lo?c, > > > Happy to be the first one :) > > > For what I?ve found, it might be related to the value of SETTINGS_INITIAL_WINDOW_SIZE?in the SETTINGS control frame, but that?s all I have. > > > On the other hand, it?s really strange that it works for you. What version of Erlang are you using? I?m on? > > > Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V5.10.4 (abort with ^G) > > > Cheers! > > >On Jan 9, 2014, at 17:07, Lo?c Hoguin wrote: > > >Hello, > >I believe you might be the first person to actually check SPDY out seriously. I wouldn't be surprised if one or two bugs persisted. > >On the other hand my tests still pass if I do the change you pointed out, could you try to debug things out and see what makes it fail for you? > >Thanks. > >-- >Lo?c Hoguin >http://ninenines.eu > >-------- Original Message -------- >From:"Brujo Benavides @ Inaka" >Sent:Thu, 09 Jan 2014 18:44:42 +0100 >To:erlang-questions >Subject:[erlang-questions] Cowboy + Gun + SPDY weirdness > >Hi all (specially Lo?c)! > > > I stumbled upon something quite odd when trying to implement a SPDY server with cowboy. I was using gun to run my tests (as cowboy is doing), but most of my POST tests didn?t work. > > After some debugging, I found out that if I make?this change, the echo_body test on the spdy_SUITE in cowboy tests suddenly stops working (like my tests :)). > > Anybody (again, specially Lo?c :)) has any idea what is happening here? > > Thank you very much in advance, folks! > > >Brujo Benavides >elbrujohalcon@REDACTED > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eaitech.2013@REDACTED Thu Jan 9 22:52:21 2014 From: eaitech.2013@REDACTED (EAI Inegration) Date: Thu, 9 Jan 2014 16:52:21 -0500 Subject: [erlang-questions] How to configure Erlan with openssl on windows Message-ID: Hi , I have installed Erlang's latest version i.e. E16b03. I am using 64 bit windows 7 for rabbitMQ evaluation.I have installed cygwin with MinGW 'GCC I am following the link http://www.rabbitmq.com/ssl.html to configure rabbitMQ with SSL. I need to not configured OpenSSL with current version of erlang on my machine. I have downloaded latest openssl1.0.01.tar.gz on my machine But I am not able to understand how do i configure Erlang with this openssl If anyone could give me step by step instructions,it would be great Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From dch@REDACTED Fri Jan 10 09:12:50 2014 From: dch@REDACTED (Dave Cottlehuber) Date: Fri, 10 Jan 2014 09:12:50 +0100 Subject: [erlang-questions] Fwd: How to configure Erlan with openssl on windows In-Reply-To: References: Message-ID: Hi noname, Erlang on Windows is already built with a statically linked OpenSSL for the last couple of years at least -- no need to install an extra component. You can do the certificate generation on any platform obviously, and you can also (for testing only!) use mochiweb's included test certs https://github.com/mochi/mochiweb/tree/master/examples/https to confirm you have your Erlang side correct. A+ Dave On 9 January 2014 22:52, EAI Inegration wrote: > Hi , > > I have installed Erlang's latest version i.e. E16b03. > I am using 64 bit windows 7 for rabbitMQ evaluation.I have installed > cygwin with MinGW 'GCC > I am following the link http://www.rabbitmq.com/ssl.html to configure > rabbitMQ with SSL. > I need to not configured OpenSSL with current version of erlang on my > machine. > I have downloaded latest openssl1.0.01.tar.gz on my machine > > But I am not able to understand how do i configure Erlang with this openssl > If anyone could give me step by step instructions,it would be great > > Thanks in advance > > > _______________________________________________ > 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 Fri Jan 10 09:52:28 2014 From: ingela.andin@REDACTED (Ingela Andin) Date: Fri, 10 Jan 2014 09:52:28 +0100 Subject: [erlang-questions] Cowboy SSL issues with Chrome/FF In-Reply-To: References: Message-ID: Hi! This is problem is resolved in the latest version of the ssl application. The reason it works with some browser and not with others is that some browsers does not correctly ignore unknown ssl hello extensions, and the erlang ssl application sent an incorrect extension (which of course it should not) but a correct SSL/TLS implementation will ignored it! 1.1 SSL 5.3.2 Fixed Bugs and Malfunctions - Honors the clients advertised support of elliptic curves and no longer sends incorrect elliptic curve extension in server hello. Own Id: OTP-11370 Regards Ingela Erlang/OTP team - Ericsson AB 2014/1/9 James Lyons > Using certificates from StartSSL and GoGetSSL, cowboy site fails to load > on Chrome v31 with "ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED" on mac & ubuntu > and FF v26 with "Error code: sec_error_invalid_key" on mac and ubuntu. > > Site will load in Safari properly and certificate shows as valid. > > Anyone seen this behavior before? > > Thanks! > > -- > James Lyons > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Fri Jan 10 10:35:59 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Fri, 10 Jan 2014 10:35:59 +0100 (CET) Subject: [erlang-questions] Cowboy SSL issues with Chrome/FF In-Reply-To: References: Message-ID: <594374487.39588.1389346559639.JavaMail.zimbra@tpip.net> Hi, Also, R16B03 will attempt to use a curve in ECDHE exchanges that is not supported by Chrome. Either exclude all ECDHE ciphers from the cipher list or apply the change from https://github.com/erlang/otp/pull/183 Andreas ----- Original Message ----- > Hi! > > This is problem is resolved in the latest version of the ssl application. The > reason it works with some browser and not with others is that some browsers > does not correctly ignore unknown ssl hello extensions, and the erlang ssl > application sent an incorrect extension (which of course it should not) but > a correct SSL/TLS implementation will ignored it! > 1.1 SSL 5.3.2 > Fixed Bugs and Malfunctions > > > * > > Honors the clients advertised support of elliptic curves and no longer sends > incorrect elliptic curve extension in server hello. > > Own Id: OTP-11370 > > Regards Ingela Erlang/OTP team - Ericsson AB > > > 2014/1/9 James Lyons < james.penguins@REDACTED > > > > > Using certificates from StartSSL and GoGetSSL, cowboy site fails to load on > Chrome v31 with "ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED" on mac & ubuntu and > FF v26 with "Error code: sec_error_invalid_key" on mac and ubuntu. > > Site will load in Safari properly and certificate shows as valid. > > Anyone seen this behavior before? > > Thanks! > > -- > James Lyons > > > _______________________________________________ > 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 > -- -- Dipl. Inform. Andreas Schultz email: as@REDACTED phone: +49-391-819099-224 mobil: +49-170-2226073 ------------------- enabling your networks ------------------- Travelping GmbH phone: +49-391-819099229 Roentgenstr. 13 fax: +49-391-819099299 D-39108 Magdeburg email: info@REDACTED GERMANY web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 -------------------------------------------------------------- From andra.dinu@REDACTED Fri Jan 10 11:30:49 2014 From: andra.dinu@REDACTED (Andra Dinu) Date: Fri, 10 Jan 2014 11:30:49 +0100 (CET) Subject: [erlang-questions] " Understanding the Erlang Scheduler" free webinar In-Reply-To: <1158284076.317092.1389349587206.JavaMail.zimbra@erlang-solutions.com> Message-ID: <2042267675.317180.1389349849302.JavaMail.zimbra@erlang-solutions.com> Understanding the Erlang Scheduler Thursday, February 6, 2014 - 4PM GMT In Erlang there are different types of concurrent entities, processes, ports etc., each of which can have millions of instances, that have to be mapped out to make optimal usage of the hardware. The Erlang scheduler is a master piece in software engineering, but how does it actually go about scheduling the processes you create in your programs? This webinar will provide an overview of all the different types and explain, how the Erlang VM decides what should run where and when. In this webinar you'll learn about : * Run queues * The differences between processes, ports and timers * How the next thing to execute is chosen and * Load balancing http://www2.erlang-solutions.com/l/23452/2014-01-03/2xqk7 About the speaker: Lukas Larsson first came in contact with Erlang 2004 while studying in G?teborg. After finishing his studies he has been working with Erlang at Erlang Solutions for about 7 years in many different industries. For the last couple of years he's been a consultant at the Erlang/OTP team at Ericsson AB, mainly working on the development of the Erlang VM. -- Andra Dinu Community & Social ERLANG SOLUTIONS LTD New Loom House 101 Back Church Lane London, E1 1LU United Kingdom Tel +44(0)2076550344 Mob +44(0)7983484387 www.erlang-solutions.com From puneet@REDACTED Fri Jan 10 13:21:06 2014 From: puneet@REDACTED (puneet ahuja) Date: Fri, 10 Jan 2014 17:51:06 +0530 Subject: [erlang-questions] busy_dist_port message Message-ID: Hi, We are getting a lot of busy_dist_port messages in our production system when the load is high. On monitoring the TCP traffic, we figured that there was a momentary dip in traffic on the connection to the erlang dist ports. This was correlated with the TCP window size increasing to 400ms. This is a recurrent problem and occurs when the cluster load is high. We have ruled out any network issues between the nodes. Has anyone experienced this before? Any suggestions on what can cause the dist erlang message receiver to bottleneck? Regards, Puneet From james.penguins@REDACTED Fri Jan 10 17:41:08 2014 From: james.penguins@REDACTED (James Lyons) Date: Fri, 10 Jan 2014 11:41:08 -0500 Subject: [erlang-questions] Cowboy SSL issues with Chrome/FF In-Reply-To: <594374487.39588.1389346559639.JavaMail.zimbra@tpip.net> References: <594374487.39588.1389346559639.JavaMail.zimbra@tpip.net> Message-ID: <1A835A7D78FB40A2BE62CCDA01F5DC86@gmail.com> Ingela, Andreas, Thanks for your responses. I actually just found someone else who asked the same question a week ago (which Andreas answered), sorry for the duplication. New to the mailing list. http://erlang.org/pipermail/erlang-questions/2014-January/076385.html Thanks! -- James Lyons On Friday, January 10, 2014 at 4:35 AM, Andreas Schultz wrote: > Hi, > > Also, R16B03 will attempt to use a curve in ECDHE exchanges that is not > supported by Chrome. Either exclude all ECDHE ciphers from the cipher list > or apply the change from https://github.com/erlang/otp/pull/183 > > Andreas > > ----- Original Message ----- > > Hi! > > > > This is problem is resolved in the latest version of the ssl application. The > > reason it works with some browser and not with others is that some browsers > > does not correctly ignore unknown ssl hello extensions, and the erlang ssl > > application sent an incorrect extension (which of course it should not) but > > a correct SSL/TLS implementation will ignored it! > > 1.1 SSL 5.3.2 > > Fixed Bugs and Malfunctions > > > > > > * > > > > Honors the clients advertised support of elliptic curves and no longer sends > > incorrect elliptic curve extension in server hello. > > > > Own Id: OTP-11370 > > > > Regards Ingela Erlang/OTP team - Ericsson AB > > > > > > 2014/1/9 James Lyons < james.penguins@REDACTED (mailto:james.penguins@REDACTED) > > > > > > > > > Using certificates from StartSSL and GoGetSSL, cowboy site fails to load on > > Chrome v31 with "ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED" on mac & ubuntu and > > FF v26 with "Error code: sec_error_invalid_key" on mac and ubuntu. > > > > Site will load in Safari properly and certificate shows as valid. > > > > Anyone seen this behavior before? > > > > Thanks! > > > > -- > > James Lyons > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED (mailto:erlang-questions@REDACTED) > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED (mailto:erlang-questions@REDACTED) > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- > -- > Dipl. Inform. > Andreas Schultz > > email: as@REDACTED (mailto:as@REDACTED) > phone: +49-391-819099-224 > mobil: +49-170-2226073 > > ------------------- enabling your networks ------------------- > > Travelping GmbH phone: +49-391-819099229 > Roentgenstr. 13 fax: +49-391-819099299 > D-39108 Magdeburg email: info@REDACTED (mailto:info@REDACTED) > GERMANY web: http://www.travelping.com > > Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 > Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 > -------------------------------------------------------------- > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Fri Jan 10 18:19:12 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Fri, 10 Jan 2014 12:19:12 -0500 Subject: [erlang-questions] busy_dist_port message In-Reply-To: References: Message-ID: On Fri, Jan 10, 2014 at 7:21 AM, puneet ahuja wrote: > Hi, > > We are getting a lot of busy_dist_port messages in our production system > when the load is high. On monitoring the TCP traffic, we figured that > there was a momentary dip in traffic on the connection to the erlang dist > ports. This was correlated with the TCP window size increasing to 400ms. > This is a recurrent problem and occurs when the cluster load is high. We > have ruled out any network issues between the nodes. > > Has anyone experienced this before? Any suggestions on what can cause the > dist erlang message receiver to bottleneck? Try increasing your distribution buffer limit using the +zdbbl option. Read about the +zdbbl option to erl here: http://erlang.org/doc/man/erl.html --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From fritchie@REDACTED Sat Jan 11 00:11:55 2014 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Fri, 10 Jan 2014 17:11:55 -0600 Subject: [erlang-questions] raw file append issue In-Reply-To: Message of "Thu, 09 Jan 2014 22:01:54 +0200." <949980C3-1D35-4439-8BC8-DD9F3B236B96@gmail.com> Message-ID: <84122.1389395515@snookles.snookles.com> Dmitry Kolesnikov wrote: dk> {delayed_write, 256Kb, 1000} Hi, Dmitry. Remove that delayed_write option and you should be fine. Or move to a fixed Erlang VM. My brain is too full of wool to recall when that was fixed, but (memory) suggests that R16B03 shouldn't be vulnerable? -Scott From ddosia@REDACTED Sun Jan 12 14:47:50 2014 From: ddosia@REDACTED (Daniil Churikov) Date: Sun, 12 Jan 2014 17:47:50 +0400 Subject: [erlang-questions] [ANN] mekao - SQL constructor library Message-ID: Hello dear list! I would like to announce small library (currently under 500LoC), which intended to help in SQL queries construction. The main goal is to cover very basic type of queries, and provide mechanism to easily extend it if needed. Note that as one of the key concept is that you use records as db-data representation, otherwise it may not be useful for you. It is early alpha and I share it because it is already covers some of mine usecases and I want to catch right direction to move on. Anyway spend few minutes to check README or read some tests. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From gumm@REDACTED Sun Jan 12 18:12:05 2014 From: gumm@REDACTED (Jesse Gumm) Date: Sun, 12 Jan 2014 11:12:05 -0600 Subject: [erlang-questions] [ANN] mekao - SQL constructor library In-Reply-To: References: Message-ID: Hi Daniil, Assuming the URL for the project is https://github.com/ddosia/mekao Cool! This is very similar to an idea I'd been kicking around: using records to represent SQL query abstraction. I think records are a pretty excellent construct for this kind of composition (similar to how Nitrogen uses records to compose HTML documents and javascript) - definitely superior to string concatenation. I may find some time to play around with this project. Thanks for sharing! -Jesse On Sun, Jan 12, 2014 at 7:47 AM, Daniil Churikov wrote: > Hello dear list! > > I would like to announce small library (currently under 500LoC), which > intended to help in SQL queries construction. > The main goal is to cover very basic type of queries, and provide mechanism > to easily extend it if needed. > Note that as one of the key concept is that you use records as db-data > representation, otherwise it may not be useful for you. > > It is early alpha and I share it because it is already covers some of mine > usecases and I want to catch right direction to move on. > > Anyway spend few minutes to check README or read some tests. > > Thanks! > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Jesse Gumm Owner, Sigma Star Systems 414.940.4866 || sigma-star.com || @jessegumm From max.lapshin@REDACTED Sun Jan 12 18:27:36 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Sun, 12 Jan 2014 21:27:36 +0400 Subject: [erlang-questions] Serfdom erlang implementation (gossip client)? Message-ID: Mitchell Hashimoto (author of Vagrant and Packer) has another project, it is serf. Serf is an implementation of protocol that maintains cluster of nodes. Sounds like a replacement to erlang distribution, but it is a bit different. At first, it doesn't do any magic interconnection with transparent Pid and message passing to other nodes. It only maintains persistence of nodes in a more probabilistic manner (UDP pinging). Has anyone looked at it? Maybe someone has tried to implement it? I'm interested in this approach because it doesn't require to give full access to local system for remote user as it happens with erlang interconnect. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ddosia@REDACTED Sun Jan 12 18:41:24 2014 From: ddosia@REDACTED (Daniil Churikov) Date: Sun, 12 Jan 2014 09:41:24 -0800 (PST) Subject: [erlang-questions] [ANN] mekao - SQL constructor library In-Reply-To: References: Message-ID: <345f4807-b56f-4ae8-8682-65c56020ed9c@googlegroups.com> Hello Jesse. Thanks for giving a link, I completely forgot about that! Will be very appreciated for any feedback. ???????????, 12 ?????? 2014 ?., 21:12:05 UTC+4 ???????????? Jesse Gumm ???????: > > Hi Daniil, > > Assuming the URL for the project is https://github.com/ddosia/mekao > > Cool! This is very similar to an idea I'd been kicking around: using > records to represent SQL query abstraction. I think records are a > pretty excellent construct for this kind of composition (similar to > how Nitrogen uses records to compose HTML documents and javascript) - > definitely superior to string concatenation. > > I may find some time to play around with this project. > > Thanks for sharing! > > -Jesse > > > On Sun, Jan 12, 2014 at 7:47 AM, Daniil Churikov > > wrote: > > Hello dear list! > > > > I would like to announce small library (currently under 500LoC), which > > intended to help in SQL queries construction. > > The main goal is to cover very basic type of queries, and provide > mechanism > > to easily extend it if needed. > > Note that as one of the key concept is that you use records as db-data > > representation, otherwise it may not be useful for you. > > > > It is early alpha and I share it because it is already covers some of > mine > > usecases and I want to catch right direction to move on. > > > > Anyway spend few minutes to check README or read some tests. > > > > Thanks! > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-q...@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > Jesse Gumm > Owner, Sigma Star Systems > 414.940.4866 || sigma-star.com || @jessegumm > _______________________________________________ > erlang-questions mailing list > erlang-q...@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.elsgaard@REDACTED Sun Jan 12 20:41:59 2014 From: thomas.elsgaard@REDACTED (Thomas Elsgaard) Date: Sun, 12 Jan 2014 16:41:59 -0300 Subject: [erlang-questions] eldap:search result Message-ID: Hi list I am experimenting with eldap, but i am wondering on how to correctly get the result from an ldap search? In my module, i am doing an eldap:search ----------------- {ok, Result} = eldap:search(S, Search), eldap:close(S), io:format("Search Result: ~p~n", [Result]). ----------------- And i am getting following: ----------------- Search Result: {eldap_search_result, [{eldap_entry, "blaa,blaaa,blaa,blaa,blaa", [{"status",["available"]}]}], []} ok ----------------- So far so good, eldap is doing it's work, but what i am really interrested in is just the content of the attribute status which is "available". How can i get the status into an variable? Do i need to get it from an record, or ? Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.ashmun@REDACTED Sun Jan 12 21:50:22 2014 From: john.ashmun@REDACTED (John R. Ashmun) Date: Sun, 12 Jan 2014 12:50:22 -0800 Subject: [erlang-questions] eldap:search result In-Reply-To: References: Message-ID: I offer this approach: {ok, Result} = eldap:search(S, Search), eldap:close(S), {eldap_search_result, [{_, _, [{"status", [Status]}]}], []} = Result, & at this point, Status =:= "available", if I have successfully balanced the brackets and braces. You may wish also to match 'eldap_entry' in your assignment. Regards, John R. Ashmun On Sun, Jan 12, 2014 at 11:41 AM, Thomas Elsgaard wrote: > Hi list > > I am experimenting with eldap, but i am wondering on how to correctly get > the result from an ldap search? > > In my module, i am doing an eldap:search > > ----------------- > {ok, Result} = eldap:search(S, Search), > eldap:close(S), > io:format("Search Result: ~p~n", [Result]). > ----------------- > > And i am getting following: > > ----------------- > Search Result: {eldap_search_result, > [{eldap_entry, > "blaa,blaaa,blaa,blaa,blaa", > [{"status",["available"]}]}], > []} > ok > ----------------- > > So far so good, eldap is doing it's work, but what i am really interrested > in is just the content of the attribute status which is "available". How > can i get the status into an variable? Do i need to get it from an record, > or ? > > Thomas > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hq@REDACTED Sun Jan 12 23:55:31 2014 From: hq@REDACTED (Adam Rutkowski) Date: Sun, 12 Jan 2014 23:55:31 +0100 Subject: [erlang-questions] eldap:search result In-Reply-To: References: Message-ID: <8F1D3EC9-3F9C-44BF-BBF9-381D88E83D01@mtod.org> Hi Thomas, In this case you should include eldap's hrl file to and use records to pattern match the results. Matching records as tuples is considered a bad practice. http://www.erlang.se/doc/programming_rules.shtml#HDR23 I suggest you start with: -include_lib("eldap/include/eldap.hrl"). Note that you'll be dealing with a _list_ of entries. lists:map/2 (or list comprehension) can come in handy for further processing. Cheers, /A. On Jan 12, 2014, at 9:50 PM, John R. Ashmun wrote: > I offer this approach: > > {ok, Result} = eldap:search(S, Search), > eldap:close(S), > {eldap_search_result, [{_, _, [{"status", [Status]}]}], []} = Result, > > & at this point, Status =:= "available", if I have successfully balanced the brackets and braces. You may wish also to match 'eldap_entry' in your assignment. > > Regards, > John R. Ashmun > > > On Sun, Jan 12, 2014 at 11:41 AM, Thomas Elsgaard wrote: > Hi list > > I am experimenting with eldap, but i am wondering on how to correctly get the result from an ldap search? > > In my module, i am doing an eldap:search > > ----------------- > {ok, Result} = eldap:search(S, Search), > eldap:close(S), > io:format("Search Result: ~p~n", [Result]). > ----------------- > > And i am getting following: > > ----------------- > Search Result: {eldap_search_result, > [{eldap_entry, > "blaa,blaaa,blaa,blaa,blaa", > [{"status",["available"]}]}], > []} > ok > ----------------- > > So far so good, eldap is doing it's work, but what i am really interrested in is just the content of the attribute status which is "available". How can i get the status into an variable? Do i need to get it from an record, or ? > > Thomas > > > _______________________________________________ > 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 co7eb@REDACTED Sun Jan 12 22:11:34 2014 From: co7eb@REDACTED (=?iso-8859-15?Q?Ivan_Carmenates_Garc=EDa?=) Date: Sun, 12 Jan 2014 16:11:34 -0500 Subject: [erlang-questions] gproc github project Message-ID: <8795441.20140112161134@frcuba.co.cu> Hi all, regards, I downloaded the gproc module from github, and when I tried to compile it got this error: gproc ERROR: git describe --always --tags `git log -n 1 --pretty=format:%h .` failed with error: 128 and output: fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git so I review the sources and I found that in the /src/gproc.app.src file the vsn parameter has the value "git", I think that is prepared for online compiling or something, How can I fix it to work offline %%% -*- mode: erlang -*- %%% $Id$ %%% {application, gproc, [ {description, "GPROC"}, {vsn, git}, {id, "GPROC"}, {registered, [ ] }, %% NOTE: do not list applications which are load-only! {applications, [ kernel, stdlib ] }, {mod, {gproc_app, []} } ] }. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hq@REDACTED Mon Jan 13 00:05:52 2014 From: hq@REDACTED (Adam Rutkowski) Date: Mon, 13 Jan 2014 00:05:52 +0100 Subject: [erlang-questions] gproc github project In-Reply-To: <8795441.20140112161134@frcuba.co.cu> References: <8795441.20140112161134@frcuba.co.cu> Message-ID: <83AA4CAE-161E-4FA4-B45B-9CB4317049C7@mtod.org> Hi Ivan, I'd revert that change: https://github.com/uwiger/gproc/commit/9c8845370b1fe0f5604c80969586588823ac4b3d#diff-f31ff9063e4ffc3e7dd51b325c2741deL8 Cheers, /A. On Jan 12, 2014, at 10:11 PM, Ivan Carmenates Garc?a wrote: > Hi all, > regards, > > I downloaded the gproc module from github, and when I tried to compile it got this error: > > gproc > ERROR: git describe --always --tags `git log -n 1 --pretty=format:%h .` failed with error: 128 and output: > fatal: Not a git repository (or any of the parent directories): .git > fatal: Not a git repository (or any of the parent directories): .git > > so I review the sources and I found that in the /src/gproc.app.src file the vsn parameter has the value "git", I think that is prepared for online compiling or something, > How can I fix it to work offline > > > > > > > %%% -*- mode: erlang -*- > %%% $Id$ > %%% > > {application, gproc, > [ > {description, "GPROC"}, > {vsn, git}, > {id, "GPROC"}, > {registered, [ ] }, > %% NOTE: do not list applications which are load-only! > {applications, [ kernel, stdlib ] }, > {mod, {gproc_app, []} } > ] > }. > > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoursurrogategod@REDACTED Mon Jan 13 01:36:51 2014 From: yoursurrogategod@REDACTED (Yves S. Garret) Date: Sun, 12 Jan 2014 19:36:51 -0500 Subject: [erlang-questions] Why is the spawn_link not working? Message-ID: Hello, I've recently created the following two modules from a book: http://bin.cakephp.org/view/1356260281 http://bin.cakephp.org/view/13533081 Now, when I send Pid ! {moon, asdf}. I get the following output: 39> Pid ! {moon, w}. Received the input and sending now. Received the input to drop. {moon,w} =ERROR REPORT==== 12-Jan-2014::19:31:38 === Error in process <0.162.0> with exit value: {badarith,[{drop,fall_velocity,2,[{file,"drop.erl"},{line,27}]},{drop,drop,0,[{file,"drop.erl"},{line,17}]}]} Why am I not seeing this line run? io:format("FAILURE: ~p died because of ~p.~n~n", [Pid, Reason]); -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob@REDACTED Mon Jan 13 01:48:46 2014 From: bob@REDACTED (Bob Ippolito) Date: Sun, 12 Jan 2014 16:48:46 -0800 Subject: [erlang-questions] Why is the spawn_link not working? In-Reply-To: References: Message-ID: When two processes are linked, failures (abnormal exits) propagate from one to the other, ensuring that both die. This is not done by way of messages, but by an exit signal. These EXIT messages are only sent to processes that are trapping exits. See http://www.erlang.org/doc/reference_manual/processes.html#id83186 and refer to "Receiving Exit Signals". In your case, the code in one process fails, which causes the other process to fail, so it can't print anything because there is no more process and it never received an exit message. A solution to this problem would be to use the trap_exit process flag (as is the case with supervisors), or use a monitor instead of a link. -bob On Sun, Jan 12, 2014 at 4:36 PM, Yves S. Garret wrote: > Hello, > > I've recently created the following two modules from a book: > http://bin.cakephp.org/view/1356260281 > http://bin.cakephp.org/view/13533081 > > Now, when I send Pid ! {moon, asdf}. I get the following output: > 39> Pid ! {moon, w}. > Received the input and sending now. > Received the input to drop. > {moon,w} > > =ERROR REPORT==== 12-Jan-2014::19:31:38 === > Error in process <0.162.0> with exit value: > {badarith,[{drop,fall_velocity,2,[{file,"drop.erl"},{line,27}]},{drop,drop,0,[{file,"drop.erl"},{line,17}]}]} > > Why am I not seeing this line run? > io:format("FAILURE: ~p died because of ~p.~n~n", [Pid, Reason]); > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.beaulne@REDACTED Mon Jan 13 01:50:31 2014 From: alexandre.beaulne@REDACTED (Alexandre Beaulne) Date: Mon, 13 Jan 2014 08:50:31 +0800 Subject: [erlang-questions] Why is the spawn_link not working? In-Reply-To: References: Message-ID: To add to Bob's answer: >From the documentation : *The default behaviour when a process receives an exit signal with an exit reason other than normal, is to terminate and in turn emit exit signals with the same exit reason to its linked processes. An exit signal with reason normal is ignored. A process can be set to trap exit signals by calling:* process_flag(trap_exit, true) *When a process is trapping exits, it will not terminate when an exit signal is received. Instead, the signal is transformed into a message {'EXIT',FromPid,Reason} which is put into the mailbox of the process just like a regular message. An exception to the above is if the exit reason is kill, that is if exit(Pid,kill) has been called. This will unconditionally terminate the process, regardless of if it is trapping exit signals or not.* Usually the trap_exit flag is set in the initialization function of a process, which you could add to your drop.erl module: init() -> process_flag(trap_exit, true), drop(). and spawn the drop process with spawn_link(drop, init, []) instead of spawn_link(drop, drop, []). Note that as few processes as possible should trap exit signals. On Mon, Jan 13, 2014 at 8:36 AM, Yves S. Garret wrote: > Hello, > > I've recently created the following two modules from a book: > http://bin.cakephp.org/view/1356260281 > http://bin.cakephp.org/view/13533081 > > Now, when I send Pid ! {moon, asdf}. I get the following output: > 39> Pid ! {moon, w}. > Received the input and sending now. > Received the input to drop. > {moon,w} > > =ERROR REPORT==== 12-Jan-2014::19:31:38 === > Error in process <0.162.0> with exit value: > {badarith,[{drop,fall_velocity,2,[{file,"drop.erl"},{line,27}]},{drop,drop,0,[{file,"drop.erl"},{line,17}]}]} > > Why am I not seeing this line run? > io:format("FAILURE: ~p died because of ~p.~n~n", [Pid, Reason]); > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dm.klionsky@REDACTED Mon Jan 13 08:39:45 2014 From: dm.klionsky@REDACTED (Dmitry Klionsky) Date: Mon, 13 Jan 2014 10:39:45 +0300 Subject: [erlang-questions] gproc github project In-Reply-To: <8795441.20140112161134@frcuba.co.cu> References: <8795441.20140112161134@frcuba.co.cu> Message-ID: <52D39841.9070905@gmail.com> Hi, It seems like you downloaded the master repository as a zip archive. This way the archive doesn't contain git information and sure `git describe ...' command fails. So you get two options: change vsn manually to current commit hash or tag version or clone the git repository. On 01/13/2014 12:11 AM, Ivan Carmenates Garc?a wrote: > gproc github project Hi all, > regards, > > I downloaded the gproc module from github, and when I tried to compile > it got this error: > > gproc > ERROR: git describe --always --tags `git log -n 1 > --pretty=format:%h .` failed with error: 128 and output: > fatal: Not a git repository (or any of the parent directories): .git > fatal: Not a git repository (or any of the parent directories): .git > > so I review the sources and I found that in the /src/gproc.app.src > file the vsn parameter has the value "git", I think that is prepared > for online compiling or something, > How can I fix it to work offline > > > > > > > %%% -*- mode: erlang -*- > %%% $Id$ > %%% > > {application, gproc, > [ > {description, "GPROC"}, > {vsn, git}, > {id, "GPROC"}, > {registered, [ ] }, > %% NOTE: do not list applications which are load-only! > {applications, [ kernel, stdlib ] }, > {mod, {gproc_app, []} } > ] > }. > > > > > > > > ------------------------------------------------------------------------ > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Best regards, Dmitry Klionsky -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Mon Jan 13 11:05:42 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 13 Jan 2014 11:05:42 +0100 Subject: [erlang-questions] [ANN] mekao - SQL constructor library In-Reply-To: References: Message-ID: On Sun, Jan 12, 2014 at 2:47 PM, Daniil Churikov wrote: > I would like to announce small library (currently under 500LoC), which > intended to help in SQL queries construction. > The main goal is to cover very basic type of queries, and provide > mechanism to easily extend it if needed. > Note that as one of the key concept is that you use records as db-data > representation, otherwise it may not be useful for you. > There is an older library which does something in the same vein: https://github.com/devinus/sqerl -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Mon Jan 13 11:40:46 2014 From: ulf@REDACTED (ulf@REDACTED) Date: Mon, 13 Jan 2014 03:40:46 -0700 Subject: [erlang-questions] gproc github project Message-ID: <20140113034046.81a166872912bfb94093ba3c2c824dbf.5e3c6da64a.wbe@email16.secureserver.net> An HTML attachment was scrubbed... URL: From ddosia@REDACTED Mon Jan 13 11:57:40 2014 From: ddosia@REDACTED (Daniil Churikov) Date: Mon, 13 Jan 2014 02:57:40 -0800 (PST) Subject: [erlang-questions] [ANN] mekao - SQL constructor library In-Reply-To: References: Message-ID: <6e42ff87-12d9-4e19-8a52-70c6ae5ec95c@googlegroups.com> I saw this library when I was looking for solutions of my problem. This library have different approach: although you use records to define your query, you should write a query but in terms of internal DSL (i.e. {insert,project,[{foo,5},{baz,"bob"}]}). You still need to keep somewhere a table name "project", you need to serialize, say, your record to proplist where name of fields should be the same as columns in DB. Otherwise you need to maintain fields to columns translation as well. mekao comparable to sqerl provides more high-level abstractions, but, I suppose, not such flexible (b/c theoretically we could completely cover all SQL with internal sqerl's DSL, but then why I need to use this library if I could write plain SQL?). Jesper Louis Andersen wrote: > > On Sun, Jan 12, 2014 at 2:47 PM, Daniil Churikov > > wrote: > >> I would like to announce small library (currently under 500LoC), which >> intended to help in SQL queries construction. >> The main goal is to cover very basic type of queries, and provide >> mechanism to easily extend it if needed. >> Note that as one of the key concept is that you use records as db-data >> representation, otherwise it may not be useful for you. >> > > There is an older library which does something in the same vein: > > https://github.com/devinus/sqerl > > > -- > J. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallen@REDACTED Mon Jan 13 17:37:52 2014 From: mallen@REDACTED (Mark Allen) Date: Mon, 13 Jan 2014 10:37:52 -0600 Subject: [erlang-questions] Serfdom erlang implementation (gossip client)? In-Reply-To: References: Message-ID: I looked at the golang implementation several weeks ago, but I had the sense that the underlying serfdom network protocol was evolving too rapidly to really have a good go at writing some kind of Erlang client at this point in time. (Maybe it has settled down now - I haven't really looked again recently.) I agree that it would be really nice way to send information around to a cluster of Erlang VMs if you can tolerate how gossip protocols behave so it's definitely on my radar. If anyone else is interested in working on this, I would be willing to help :) In the meantime, if you want to see an Erlang-y implementation of a gossip protocol as a model, you could look at how Basho did its anti-entropy stuff in riak core (as one example) https://github.com/basho/riak_core/blob/develop/src/riak_core_gossip.erl (Note: this is the "develop" branch which is kind of the bleeding edge of the codebase. Try 1.4 branch if you want a "stable" view of the code.) Mark From: Max Lapshin > Date: Sunday, January 12, 2014 11:27 AM To: Erlang-Questions Questions > Subject: [erlang-questions] Serfdom erlang implementation (gossip client)? Mitchell Hashimoto (author of Vagrant and Packer) has another project, it is serf. Serf is an implementation of protocol that maintains cluster of nodes. Sounds like a replacement to erlang distribution, but it is a bit different. At first, it doesn't do any magic interconnection with transparent Pid and message passing to other nodes. It only maintains persistence of nodes in a more probabilistic manner (UDP pinging). Has anyone looked at it? Maybe someone has tried to implement it? I'm interested in this approach because it doesn't require to give full access to local system for remote user as it happens with erlang interconnect. -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Mon Jan 13 20:47:47 2014 From: erlang@REDACTED (Andreas Stenius) Date: Mon, 13 Jan 2014 20:47:47 +0100 Subject: [erlang-questions] Fwd: [ANN] ErlyDTL 0.8.0 In-Reply-To: References: Message-ID: Hi fellows, I am pleased to announce a long awaited release of ErlyDTL [1]. ErlyDTL is a template engine, which is compatible with the Django Template Language, as well as efficient, by compiling templates to Erlang modules. I am honored to take over ErlyDTL after Evan [2], and I am looking forward to work with the community to keep on improving the project up to and beyond our 1.0 milestone. Best regards, Andreas Stenius [1] https://github.com/erlydtl/erlydtl/releases [2] http://erlang.org/pipermail/erlang-questions/2014-January/076422.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From tristan.sloughter@REDACTED Mon Jan 13 22:28:31 2014 From: tristan.sloughter@REDACTED (Tristan Sloughter) Date: Mon, 13 Jan 2014 13:28:31 -0800 Subject: [erlang-questions] Serfdom erlang implementation (gossip client)? In-Reply-To: References: Message-ID: <1389648511.28210.70292781.326D2F76@webmail.messagingengine.com> Don't bother with an Erlang Serfdom client. It relies on Go RPC calls between nodes. -- Tristan Sloughter tristan.sloughter@REDACTED On Mon, Jan 13, 2014, at 08:37 AM, Mark Allen wrote: I looked at the golang implementation several weeks ago, but I had the sense that the underlying serfdom network protocol was evolving too rapidly to really have a good go at writing some kind of Erlang client at this point in time. (Maybe it has settled down now - I haven't really looked again recently.) I agree that it would be really nice way to send information around to a cluster of Erlang VMs if you can tolerate how gossip protocols behave so it's definitely on my radar. If anyone else is interested in working on this, I would be willing to help :) In the meantime, if you want to see an Erlang-y implementation of a gossip protocol as a model, you could look at how Basho did its anti-entropy stuff in riak core (as one example) [1]https://github.com/basho/riak_core/blob/develop/src/riak_core_gossip .erl (Note: this is the "develop" branch which is kind of the bleeding edge of the codebase. Try 1.4 branch if you want a "stable" view of the code.) Mark From: Max Lapshin <[2]max.lapshin@REDACTED> Date: Sunday, January 12, 2014 11:27 AM To: Erlang-Questions Questions <[3]erlang-questions@REDACTED> Subject: [erlang-questions] Serfdom erlang implementation (gossip client)? Mitchell Hashimoto (author of Vagrant and Packer) has another project, it is serf. Serf is an implementation of protocol that maintains cluster of nodes. Sounds like a replacement to erlang distribution, but it is a bit different. At first, it doesn't do any magic interconnection with transparent Pid and message passing to other nodes. It only maintains persistence of nodes in a more probabilistic manner (UDP pinging). Has anyone looked at it? Maybe someone has tried to implement it? I'm interested in this approach because it doesn't require to give full access to local system for remote user as it happens with erlang interconnect. _______________________________________________ erlang-questions mailing list [4]erlang-questions@REDACTED [5]http://erlang.org/mailman/listinfo/erlang-questions References 1. https://github.com/basho/riak_core/blob/develop/src/riak_core_gossip.erl 2. mailto:max.lapshin@REDACTED 3. mailto:erlang-questions@REDACTED 4. mailto:erlang-questions@REDACTED 5. http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoursurrogategod@REDACTED Tue Jan 14 02:26:22 2014 From: yoursurrogategod@REDACTED (Yves S. Garret) Date: Mon, 13 Jan 2014 20:26:22 -0500 Subject: [erlang-questions] Why is the spawn_link not working? In-Reply-To: References: Message-ID: Hmm... here is my updated code, but the exit that comes via a link does not seem to get trapped! http://bin.cakephp.org/view/936550339 This is what happens: http://bin.cakephp.org/view/554367077 On Sun, Jan 12, 2014 at 7:48 PM, Bob Ippolito wrote: > When two processes are linked, failures (abnormal exits) propagate from > one to the other, ensuring that both die. This is not done by way of > messages, but by an exit signal. These EXIT messages are only sent to > processes that are trapping exits. See > http://www.erlang.org/doc/reference_manual/processes.html#id83186 and > refer to "Receiving Exit Signals". > > In your case, the code in one process fails, which causes the other > process to fail, so it can't print anything because there is no more > process and it never received an exit message. A solution to this problem > would be to use the trap_exit process flag (as is the case with > supervisors), or use a monitor instead of a link. > > -bob > > > > On Sun, Jan 12, 2014 at 4:36 PM, Yves S. Garret < > yoursurrogategod@REDACTED> wrote: > >> Hello, >> >> I've recently created the following two modules from a book: >> http://bin.cakephp.org/view/1356260281 >> http://bin.cakephp.org/view/13533081 >> >> Now, when I send Pid ! {moon, asdf}. I get the following output: >> 39> Pid ! {moon, w}. >> Received the input and sending now. >> Received the input to drop. >> {moon,w} >> >> =ERROR REPORT==== 12-Jan-2014::19:31:38 === >> Error in process <0.162.0> with exit value: >> {badarith,[{drop,fall_velocity,2,[{file,"drop.erl"},{line,27}]},{drop,drop,0,[{file,"drop.erl"},{line,17}]}]} >> >> Why am I not seeing this line run? >> io:format("FAILURE: ~p died because of ~p.~n~n", [Pid, Reason]); >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.beaulne@REDACTED Tue Jan 14 03:53:40 2014 From: alexandre.beaulne@REDACTED (Alexandre Beaulne) Date: Tue, 14 Jan 2014 10:53:40 +0800 Subject: [erlang-questions] Why is the spawn_link not working? In-Reply-To: References: Message-ID: Hi again! It is not process that fails who receives the {'EXIT', Pid, Reason} signal/message, but rather the processes that are linked to the failing process. I added a print statement to you example and it behaves quite as expected: 1> Pid = spawn(mph_drop, mph_drop, []). <0.35.0> 2> Pid ! {moon, 23}. Received the input to drop. On moon, a fall of 23 meters yields a velocity of 19.19077538460069 mph. {moon,23} 3> Pid ! {moon, asdf}. Received the input to drop. Received EXIT signal from drop process, respawning! {moon,asdf} 4> =ERROR REPORT==== 14-Jan-2014::10:46:58 === Error in process <0.36.0> with exit value: {badarith,[{drop,fall_velocity,2,[{file,"drop.erl"},{line,26}]},{drop,drop,0,[{file,"drop.erl"},{line,16}]}]} Admittedly the error report is a bit confusing as everything worked as planned. On Tue, Jan 14, 2014 at 9:26 AM, Yves S. Garret wrote: > Hmm... here is my updated code, but the exit that comes via a link does > not seem to get trapped! > http://bin.cakephp.org/view/936550339 > > This is what happens: > http://bin.cakephp.org/view/554367077 > > > On Sun, Jan 12, 2014 at 7:48 PM, Bob Ippolito wrote: > >> When two processes are linked, failures (abnormal exits) propagate from >> one to the other, ensuring that both die. This is not done by way of >> messages, but by an exit signal. These EXIT messages are only sent to >> processes that are trapping exits. See >> http://www.erlang.org/doc/reference_manual/processes.html#id83186 and >> refer to "Receiving Exit Signals". >> >> In your case, the code in one process fails, which causes the other >> process to fail, so it can't print anything because there is no more >> process and it never received an exit message. A solution to this problem >> would be to use the trap_exit process flag (as is the case with >> supervisors), or use a monitor instead of a link. >> >> -bob >> >> >> >> On Sun, Jan 12, 2014 at 4:36 PM, Yves S. Garret < >> yoursurrogategod@REDACTED> wrote: >> >>> Hello, >>> >>> I've recently created the following two modules from a book: >>> http://bin.cakephp.org/view/1356260281 >>> http://bin.cakephp.org/view/13533081 >>> >>> Now, when I send Pid ! {moon, asdf}. I get the following output: >>> 39> Pid ! {moon, w}. >>> Received the input and sending now. >>> Received the input to drop. >>> {moon,w} >>> >>> =ERROR REPORT==== 12-Jan-2014::19:31:38 === >>> Error in process <0.162.0> with exit value: >>> {badarith,[{drop,fall_velocity,2,[{file,"drop.erl"},{line,27}]},{drop,drop,0,[{file,"drop.erl"},{line,17}]}]} >>> >>> Why am I not seeing this line run? >>> io:format("FAILURE: ~p died because of ~p.~n~n", [Pid, Reason]); >>> >>> _______________________________________________ >>> 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 dch@REDACTED Tue Jan 14 11:30:16 2014 From: dch@REDACTED (Dave Cottlehuber) Date: Tue, 14 Jan 2014 11:30:16 +0100 Subject: [erlang-questions] Serfdom erlang implementation (gossip client)? In-Reply-To: References: Message-ID: On 12. J?nner 2014 at 18:27:46, Max Lapshin (max.lapshin@REDACTED) wrote: > > Mitchell Hashimoto (author of Vagrant and Packer) has another > project, it > is serf. > > Serf is an implementation of protocol that maintains cluster > of nodes. > Sounds like a replacement to erlang distribution, but it is a > bit different. > > At first, it doesn't do any magic interconnection with transparent > Pid and > message passing to other nodes. It only maintains persistence > of nodes in a > more probabilistic manner (UDP pinging). > > Has anyone looked at it? Maybe someone has tried to implement > it? > > I'm interested in this approach because it doesn't require to > give full > access to local system for remote user as it happens with erlang > interconnect. Some interesting papers that might be relevant; swim:-?http://www.cs.cornell.edu/~asdas/research/dsn02-swim.pdf scuttlebutt:-?http://www.cs.cornell.edu/home/rvr/papers/flowgossip.pdf Of the two, scuttlebutt is clearly the better name. YMMV. I know of a? solid nodejs implementation?https://github.com/dominictarr/scuttlebutt but nothing for swim. -- Dave Cottlehuber Sent from my PDP11 From gordon@REDACTED Tue Jan 14 09:10:19 2014 From: gordon@REDACTED (Gordon Guthrie) Date: Tue, 14 Jan 2014 08:10:19 +0000 Subject: [erlang-questions] ANN: LuvvieScript - Erlang In The Browser Message-ID: Happy New Year Campers! Quick announcement of Version 0.1 (alpha) of LuvvieScript - a compile-to-javascript dialect of Erlang for dom scripting in the browser. *Why?* http://luvv.ie/mission.html *How?* http://luvv.ie/toolchain.html *I Wanna Start!* http://luvv.ie/getting-started.html If you have just woozily stumbled out of your Xmas cave smelling of EggNog here is a picture by way of *tl;dr*; http://luvv.ie/assets/img/ErlangInTheBrowser.png If you want a good *hate*, it is not written in Erlang but *Literate Erlang*(ooh!): https://github.com/hypernumbers/literate-erlang If you want to be kept up to date with progress follow me on twitter: *@luvviescript* or *@gordonguthrie* Yip, yip, toodle pip! Gordon -- --- Gordon Guthrie CEO vixo.com @gordonguthrie +44 (0) 7776 251669 (in Bonnie Scotland!) vixo is made in Scotland from electrons -------------- next part -------------- An HTML attachment was scrubbed... URL: From watson.timothy@REDACTED Tue Jan 14 12:41:29 2014 From: watson.timothy@REDACTED (Tim Watson) Date: Tue, 14 Jan 2014 03:41:29 -0800 (PST) Subject: [erlang-questions] foldl vs foldr and ++ In-Reply-To: <47BF1E72-9119-4E6F-AAD4-D58F3C154380@feuerlabs.com> References: <3c4ca91f-0f20-4184-b6f0-f8ac3204ab99@knuth> <9D182CD2-CD31-411F-8641-E12E003EFDD7@cs.otago.ac.nz> <47BF1E72-9119-4E6F-AAD4-D58F3C154380@feuerlabs.com> Message-ID: I tweaked your module to run via escript (just adding a simple main/1 and printing out the results of timer:tc), and I see a bit gap between foldl and foldr, whilst the hand coded version based on lists:reverse/1 is plenty fast enough: t4@REDACTED:test $ escript lr.beam 10000000 foldl: 679.103ms foldr: 43609.149ms reverse: 909.946ms t4@REDACTED:test $ evm info R16B03 compiled for x86_64-apple-darwin11.4.2, 64bit On Friday, 11 May 2012 10:27:29 UTC+1, Ulf Wiger wrote: > > > On 11 May 2012, at 04:02, Richard O'Keefe wrote: > > > This can be written more efficiently, but it's best of all > > just not to reverse the string in the first place. Keep > > the code at a level where you can see what's going on well > > enough to spot the really _big_ efficiency gains. > > And this is of course the really important difference between > foldr() and foldl(): > > - in which order do you want to process the list? > - if you build a list in the accumulator, in which order do you want it? > > For most practical purposes, one should assume that they > both both do their job efficiently. > > BR, > Ulf > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > > _______________________________________________ > erlang-questions mailing list > erlang-q...@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From langxianzhe@REDACTED Tue Jan 14 14:37:35 2014 From: langxianzhe@REDACTED (=?GB2312?B?wMnPzM7k?=) Date: Tue, 14 Jan 2014 21:37:35 +0800 Subject: [erlang-questions] Need help understanding why the Process(Pid) consumers a lot of memory and did not garbage collect Message-ID: Hi All. In recently, I ran into a problem which the Process consumers a lot of memory. There is roughly from 300M to 450 each process.? The memory will be free if invoke erlang:garbage_collect/1?So, In my view , the moemry may is not be used, and do not garbage collect. Why? I can not get it. Please give some for me. For further resolve the problem, I do some test in the simplification program. The memery is can garbage collect too(pass an hour). Test Method? 1?The R variable is about 19489 number records ??[{"author_id","users-a9KsYTIRdrq3iuAywiLRE2BGd3Y"},{"timestamp","2013-07-17 10:47:36"},{"time_int",63541277256},{"title",[233,155,133,229,133,184,231,139,172,229,136,155,232,136,170,230,181,183,229,164,169,230,150,135,229,143,176,232,133,149,232,161,168]},{"id","info-137429256786232"}]? 2?Obtain the Process of Pid (trends1@REDACTED)5> Pid = test4:get_pid() 3?The Pid state before send R data (trends1@REDACTED)7> erlang:process_info(Pid, memory). *{memory,2656}* (trends1@REDACTED)8> erlang:process_info(Pid). [{current_function,{test4,loop,0}}, {initial_call,{test4,loop,0}}, {status,waiting}, {message_queue_len,0}, {messages,[]}, {links,[]}, {dictionary,[]}, {trap_exit,false}, {error_handler,error_handler}, {priority,normal}, {group_leader,<0.31.0>}, {total_heap_size,233}, * {heap_size,233},* {stack_size,1}, {reductions,1}, {garbage_collection,[{min_bin_vheap_size,46368}, {min_heap_size,233}, {fullsweep_after,0}, {minor_gcs,0}]}, {suspending,[]}] 4? to send R Data (trends1@REDACTED)9> Pid ! {self(),R} (trends1@REDACTED)9> . {<0.52.0>, {ok,[{1, [[{"author_id","users-a9KsYTIRdrq3iuAywiLRE2BGd3Y"}, {"timestamp","2013-07-17 10...................... 5?The Pid state after send R data, The memory is increasing. (trends1@REDACTED)11> erlang:process_info(Pid, memory). *{memory,51356672}* (trends1@REDACTED)12> erlang:process_info(Pid). [{current_function,{test4,loop,0}}, {initial_call,{test4,loop,0}}, {status,waiting}, {message_queue_len,0}, {messages,[]}, {links,[]}, {dictionary,[]}, {trap_exit,false}, {error_handler,error_handler}, {priority,normal}, {group_leader,<0.31.0>}, * {total_heap_size,6419485},* * {heap_size,6419485},* {stack_size,1}, {reductions,2002}, {garbage_collection,[{min_bin_vheap_size,46368}, {min_heap_size,233}, {fullsweep_after,0}, {minor_gcs,0}]}, {suspending,[]}] 6?to send R data again. (trends1@REDACTED)13> Pid ! {self(),R}. {<0.52.0>, {ok,[{1, 7?The memory continue to increas. (trends1@REDACTED)14> erlang:process_info(Pid, memory). *{memory,125381272}* (trends1@REDACTED)15> erlang:process_info(Pid). [{current_function,{test4,loop,0}}, {initial_call,{test4,loop,0}}, {status,waiting}, {message_queue_len,0}, {messages,[]}, {links,[]}, {dictionary,[]}, {trap_exit,false}, {error_handler,error_handler}, {priority,normal}, {group_leader,<0.31.0>}, * {total_heap_size,15672560},* * {heap_size,15672560},* {stack_size,1}, {reductions,4003}, {garbage_collection,[{min_bin_vheap_size,46368}, {min_heap_size,233}, {fullsweep_after,0}, {minor_gcs,0}]}, {suspending,[]}] *I am *wondering the cause why it is can not collect, Please give me some idea. *Thanks a lot.* *(trends1@REDACTED )23> erlang:process_info(Pid, memory).{memory,195907792}* I'm running Erlang R14B04 on the unbuntu. Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]? Linux jason-lxw 3.2.0-55-generic #85-Ubuntu SMP Wed Oct 2 12:29:27 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux [1]??? 1 -module(test4). 2 -export([get_pid/0, 3 get_data/1, 4 get_pids/1, 5 loop/0]). 6 7 get_pids(L) -> 8 get_pids(0, L). 9 10 get_pids(0, L) -> 11 L; 12 get_pids(N, R) -> 13 NewR = [get_pid()|R], 14 get_pids(N-1, NewR). 15 16 get_pid()-> 17 spawn_opt(?MODULE, loop, [], [{fullsweep_after,0}]). 18 %spawn(?MODULE, loop, []). 19 20 get_data(Pid) -> 21 Pid ! {self(), get}. 22 23 loop() -> 24 receive 25 {From, Data} -> 26 From ! Data, 27 loop() 28 end. Cheers Jason -- ??????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From z@REDACTED Tue Jan 14 16:36:58 2014 From: z@REDACTED (Danil Zagoskin) Date: Tue, 14 Jan 2014 19:36:58 +0400 Subject: [erlang-questions] ANN: LuvvieScript - Erlang In The Browser In-Reply-To: References: Message-ID: Nice! By the way, did you know of this project: https://github.com/5HT/shen ? 2014/1/14 Gordon Guthrie > Happy New Year Campers! > > Quick announcement of Version 0.1 (alpha) of LuvvieScript - a > compile-to-javascript dialect of Erlang for dom scripting in the browser. > > *Why?* > http://luvv.ie/mission.html > > *How?* > http://luvv.ie/toolchain.html > > *I Wanna Start!* > http://luvv.ie/getting-started.html > > If you have just woozily stumbled out of your Xmas cave smelling of EggNog > here is a picture by way of *tl;dr*; > http://luvv.ie/assets/img/ErlangInTheBrowser.png > > If you want a good *hate*, it is not written in Erlang but *Literate > Erlang* (ooh!): > https://github.com/hypernumbers/literate-erlang > > If you want to be kept up to date with progress follow me on twitter: > *@luvviescript* or *@gordonguthrie* > > Yip, yip, toodle pip! > > Gordon > > -- > --- > Gordon Guthrie > CEO vixo.com > @gordonguthrie > +44 (0) 7776 251669 (in Bonnie Scotland!) > > vixo is made in Scotland from electrons > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- --------------------------------------------- ????? ???????? | +7 906 064 20 47 | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From gordon@REDACTED Tue Jan 14 19:34:29 2014 From: gordon@REDACTED (Gordon Guthrie) Date: Tue, 14 Jan 2014 18:34:29 +0000 Subject: [erlang-questions] ANN: LuvvieScript - Erlang In The Browser In-Reply-To: References: Message-ID: Yeah, had a long chat with the 5hen lads when I was starting out. On 14 January 2014 15:36, Danil Zagoskin wrote: > Nice! > > By the way, did you know of this project: https://github.com/5HT/shen ? > > > > 2014/1/14 Gordon Guthrie > >> Happy New Year Campers! >> >> Quick announcement of Version 0.1 (alpha) of LuvvieScript - a >> compile-to-javascript dialect of Erlang for dom scripting in the browser. >> >> *Why?* >> http://luvv.ie/mission.html >> >> *How?* >> http://luvv.ie/toolchain.html >> >> *I Wanna Start!* >> http://luvv.ie/getting-started.html >> >> If you have just woozily stumbled out of your Xmas cave smelling of >> EggNog here is a picture by way of *tl;dr*; >> http://luvv.ie/assets/img/ErlangInTheBrowser.png >> >> If you want a good *hate*, it is not written in Erlang but *Literate >> Erlang* (ooh!): >> https://github.com/hypernumbers/literate-erlang >> >> If you want to be kept up to date with progress follow me on twitter: >> *@luvviescript* or *@gordonguthrie* >> >> Yip, yip, toodle pip! >> >> Gordon >> >> -- >> --- >> Gordon Guthrie >> CEO vixo.com >> @gordonguthrie >> +44 (0) 7776 251669 (in Bonnie Scotland!) >> >> vixo is made in Scotland from electrons >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > -- > --------------------------------------------- > ????? ???????? | +7 906 064 20 47 | z@REDACTED > -- --- Gordon Guthrie CEO vixo.com @gordonguthrie +44 (0) 7776 251669 (in Bonnie Scotland!) vixo is made in Scotland from electrons -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Tue Jan 14 21:14:22 2014 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 14 Jan 2014 21:14:22 +0100 Subject: [erlang-questions] tokenising broken code Message-ID: Hello, Does anybody have a tokeniser for broken erlang code (broken means unparsable). I just want to render variables, atoms strings etc. in different colors and typefaces. So I need a tokeniser that - retains everything (comments and all) - does not do any token conversions (ie 16#abc) is not tokenised as {int,2748}, but as {integer,"16#abc"} It needs to handle broken code in a sensible way - for example if a string end quote is missing - do something sensible. Assuming that what I wants tokenises a string S into a sequence [{Tag1,S1},{Tag2,S2},...] I'd like S1 ++ S2 ++ ... = S. ie. the tokeniser should be lossless. Cheers /Joe From dparfitt@REDACTED Tue Jan 14 21:20:01 2014 From: dparfitt@REDACTED (Dave Parfitt) Date: Tue, 14 Jan 2014 15:20:01 -0500 Subject: [erlang-questions] tokenising broken code In-Reply-To: References: Message-ID: Hello Joe - Antlr 4 has an Erlang grammar that might be able to help out, if you are willing to work with Java. https://github.com/antlr/grammars-v4/blob/master/erlang/Erlang.g4 Cheers - Dave On Tue, Jan 14, 2014 at 3:14 PM, Joe Armstrong wrote: > Hello, > > Does anybody have a tokeniser for broken erlang code (broken means > unparsable). > > I just want to render variables, atoms strings etc. in different > colors and typefaces. > > So I need a tokeniser that > > - retains everything (comments and all) > - does not do any token conversions (ie 16#abc) is not tokenised > as {int,2748}, but as {integer,"16#abc"} > > It needs to handle broken code in a sensible way - for example if a > string end quote is missing - do something sensible. > > Assuming that what I wants tokenises a string S into a sequence > [{Tag1,S1},{Tag2,S2},...] I'd like S1 ++ S2 ++ ... = S. ie. the tokeniser > should be lossless. > > Cheers > > /Joe > _______________________________________________ > 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 Tue Jan 14 21:59:19 2014 From: donpedrothird@REDACTED (John Doe) Date: Wed, 15 Jan 2014 00:59:19 +0400 Subject: [erlang-questions] transactions in dets Message-ID: Hi, Is there a way (some app or whatnot) to do transactions in dets without mnesia? In my project there are many similar clusters of small dets files, independent of each other - many directories, each directory contains dets file with data and a few other dets files with some related data, statistics on this data, indexes and denormalization data, most of time all these tables are closed. Are there any more or less standard solutions to do transactional changes in each of such cluster so that data in all files inside a directory would be consistent? I really don't want to write my own versioning db engine ridden with bugs and locks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Tue Jan 14 22:17:39 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Tue, 14 Jan 2014 22:17:39 +0100 Subject: [erlang-questions] tokenising broken code In-Reply-To: References: Message-ID: Hi Joe, We have such a tokenizer in erlide. It extends erl_scanner with extra information: where necessary the string representation of the token is included. Also, the position information is the offset in the file and the length of the token (as string). The tokens include comments and whitespace (which can be filtered away with an option), but not macros (which we handle on the tier above). I think it is quite independent of the erlide code. The source is at https://github.com/erlide/erlide/blob/pu/org.erlide.kernel.ide/src/erlide_scan.erl It is easy to diff with erl_scan to see what's changed. I think our version is based on R14's erl_scan. Please let me know if it helps and/or if you have questions. best regards, Vlad On Tue, Jan 14, 2014 at 9:14 PM, Joe Armstrong wrote: > Hello, > > Does anybody have a tokeniser for broken erlang code (broken means > unparsable). > > I just want to render variables, atoms strings etc. in different > colors and typefaces. > > So I need a tokeniser that > > - retains everything (comments and all) > - does not do any token conversions (ie 16#abc) is not tokenised > as {int,2748}, but as {integer,"16#abc"} > > It needs to handle broken code in a sensible way - for example if a > string end quote is missing - do something sensible. > > Assuming that what I wants tokenises a string S into a sequence > [{Tag1,S1},{Tag2,S2},...] I'd like S1 ++ S2 ++ ... = S. ie. the tokeniser > should be lossless. > > Cheers > > /Joe > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From langxianzhe@REDACTED Wed Jan 15 08:18:21 2014 From: langxianzhe@REDACTED (=?GB2312?B?wMnPzM7k?=) Date: Wed, 15 Jan 2014 15:18:21 +0800 Subject: [erlang-questions] Need help understanding why the Process(Pid) consumers a lot of memory and did not garbage collect In-Reply-To: References: Message-ID: I will appreciate If anyone can reply to me . 2014/1/14 ??? > Hi All. > In recently, I ran into a problem which the Process consumers a lot of > memory. There is roughly from 300M to 450 each process.? > The memory will be free if invoke erlang:garbage_collect/1?So, In my view > , the moemry may is not be used, and do not garbage collect. Why? I can not > get it. Please give some for me. > For further resolve the problem, I do some test in the simplification > program. The memery is can garbage collect too(pass an hour). > Test Method? > 1?The R variable is about 19489 number records > ??[{"author_id","users-a9KsYTIRdrq3iuAywiLRE2BGd3Y"},{"timestamp","2013-07-17 > 10:47:36"},{"time_int",63541277256},{"title",[233,155,133,229,133,184,231,139,172,229,136,155,232,136,170,230,181,183,229,164,169,230,150,135,229,143,176,232,133,149,232,161,168]},{"id","info-137429256786232"}]? > 2?Obtain the Process of Pid > (trends1@REDACTED)5> Pid = test4:get_pid() > 3?The Pid state before send R data > (trends1@REDACTED)7> erlang:process_info(Pid, memory). > *{memory,2656}* > (trends1@REDACTED)8> erlang:process_info(Pid). > [{current_function,{test4,loop,0}}, > {initial_call,{test4,loop,0}}, > {status,waiting}, > {message_queue_len,0}, > {messages,[]}, > {links,[]}, > {dictionary,[]}, > {trap_exit,false}, > {error_handler,error_handler}, > {priority,normal}, > {group_leader,<0.31.0>}, > {total_heap_size,233}, > * {heap_size,233},* > {stack_size,1}, > {reductions,1}, > {garbage_collection,[{min_bin_vheap_size,46368}, > {min_heap_size,233}, > {fullsweep_after,0}, > {minor_gcs,0}]}, > {suspending,[]}] > > 4? to send R Data > (trends1@REDACTED)9> Pid ! {self(),R} > (trends1@REDACTED)9> . > {<0.52.0>, > {ok,[{1, > [[{"author_id","users-a9KsYTIRdrq3iuAywiLRE2BGd3Y"}, > {"timestamp","2013-07-17 10...................... > 5?The Pid state after send R data, The memory is increasing. > (trends1@REDACTED)11> erlang:process_info(Pid, memory). > *{memory,51356672}* > (trends1@REDACTED)12> erlang:process_info(Pid). > [{current_function,{test4,loop,0}}, > {initial_call,{test4,loop,0}}, > {status,waiting}, > {message_queue_len,0}, > {messages,[]}, > {links,[]}, > {dictionary,[]}, > {trap_exit,false}, > {error_handler,error_handler}, > {priority,normal}, > {group_leader,<0.31.0>}, > * {total_heap_size,6419485},* > * {heap_size,6419485},* > {stack_size,1}, > {reductions,2002}, > {garbage_collection,[{min_bin_vheap_size,46368}, > {min_heap_size,233}, > {fullsweep_after,0}, > {minor_gcs,0}]}, > {suspending,[]}] > 6?to send R data again. > (trends1@REDACTED)13> Pid ! {self(),R}. > {<0.52.0>, > {ok,[{1, > 7?The memory continue to increas. > (trends1@REDACTED)14> erlang:process_info(Pid, memory). > *{memory,125381272}* > (trends1@REDACTED)15> erlang:process_info(Pid). > [{current_function,{test4,loop,0}}, > {initial_call,{test4,loop,0}}, > {status,waiting}, > {message_queue_len,0}, > {messages,[]}, > {links,[]}, > {dictionary,[]}, > {trap_exit,false}, > {error_handler,error_handler}, > {priority,normal}, > {group_leader,<0.31.0>}, > * {total_heap_size,15672560},* > * {heap_size,15672560},* > {stack_size,1}, > {reductions,4003}, > {garbage_collection,[{min_bin_vheap_size,46368}, > {min_heap_size,233}, > {fullsweep_after,0}, > {minor_gcs,0}]}, > {suspending,[]}] > > *I am *wondering the cause why it is can not collect, Please give me > some idea. *Thanks a lot.* > > *(trends1@REDACTED )23> > erlang:process_info(Pid, memory).{memory,195907792} * > > I'm running Erlang R14B04 on the unbuntu. > Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:4:4] [rq:4] > [async-threads:0] [hipe] [kernel-poll:false]? > Linux jason-lxw 3.2.0-55-generic #85-Ubuntu SMP Wed Oct 2 12:29:27 UTC > 2013 x86_64 x86_64 x86_64 GNU/Linux > > [1]??? > 1 -module(test4). > 2 -export([get_pid/0, > 3 get_data/1, > 4 get_pids/1, > 5 loop/0]). > 6 > 7 get_pids(L) -> > 8 get_pids(0, L). > 9 > 10 get_pids(0, L) -> > 11 L; > 12 get_pids(N, R) -> > 13 NewR = [get_pid()|R], > 14 get_pids(N-1, NewR). > 15 > 16 get_pid()-> > 17 spawn_opt(?MODULE, loop, [], [{fullsweep_after,0}]). > 18 %spawn(?MODULE, loop, []). > > 19 > 20 get_data(Pid) -> > 21 Pid ! {self(), get}. > 22 > 23 loop() -> > 24 receive > 25 {From, Data} -> > 26 From ! Data, > 27 loop() > 28 end. > > > Cheers > Jason > -- > ??????????????? > -- ??????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Wed Jan 15 08:23:50 2014 From: sergej.jurecko@REDACTED (Sergej Jurecko) Date: Wed, 15 Jan 2014 08:23:50 +0100 Subject: [erlang-questions] Need help understanding why the Process(Pid) consumers a lot of memory and did not garbage collect In-Reply-To: References: Message-ID: You are probably running into issues addressed here: https://blog.heroku.com/archives/2013/11/7/logplex-down-the-rabbit-hole Sergej On Jan 15, 2014, at 8:18 AM, ??? wrote: > I will appreciate If anyone can reply to me . > > > 2014/1/14 ??? > Hi All. > In recently, I ran into a problem which the Process consumers a lot of memory. There is roughly from 300M to 450 each process.? > The memory will be free if invoke erlang:garbage_collect/1?So, In my view , the moemry may is not be used, and do not garbage collect. Why? I can not get it. Please give some for me. > For further resolve the problem, I do some test in the simplification program. The memery is can garbage collect too(pass an hour). > Test Method? > 1?The R variable is about 19489 number records > ??[{"author_id","users-a9KsYTIRdrq3iuAywiLRE2BGd3Y"},{"timestamp","2013-07-17 10:47:36"},{"time_int",63541277256},{"title",[233,155,133,229,133,184,231,139,172,229,136,155,232,136,170,230,181,183,229,164,169,230,150,135,229,143,176,232,133,149,232,161,168]},{"id","info-137429256786232"}]? > 2?Obtain the Process of Pid > (trends1@REDACTED)5> Pid = test4:get_pid() > 3?The Pid state before send R data > (trends1@REDACTED)7> erlang:process_info(Pid, memory). > {memory,2656} > (trends1@REDACTED)8> erlang:process_info(Pid). > [{current_function,{test4,loop,0}}, > {initial_call,{test4,loop,0}}, > {status,waiting}, > {message_queue_len,0}, > {messages,[]}, > {links,[]}, > {dictionary,[]}, > {trap_exit,false}, > {error_handler,error_handler}, > {priority,normal}, > {group_leader,<0.31.0>}, > {total_heap_size,233}, > {heap_size,233}, > {stack_size,1}, > {reductions,1}, > {garbage_collection,[{min_bin_vheap_size,46368}, > {min_heap_size,233}, > {fullsweep_after,0}, > {minor_gcs,0}]}, > {suspending,[]}] > > 4? to send R Data > (trends1@REDACTED)9> Pid ! {self(),R} > (trends1@REDACTED)9> . > {<0.52.0>, > {ok,[{1, > [[{"author_id","users-a9KsYTIRdrq3iuAywiLRE2BGd3Y"}, > {"timestamp","2013-07-17 10...................... > 5?The Pid state after send R data, The memory is increasing. > (trends1@REDACTED)11> erlang:process_info(Pid, memory). > {memory,51356672} > (trends1@REDACTED)12> erlang:process_info(Pid). > [{current_function,{test4,loop,0}}, > {initial_call,{test4,loop,0}}, > {status,waiting}, > {message_queue_len,0}, > {messages,[]}, > {links,[]}, > {dictionary,[]}, > {trap_exit,false}, > {error_handler,error_handler}, > {priority,normal}, > {group_leader,<0.31.0>}, > {total_heap_size,6419485}, > {heap_size,6419485}, > {stack_size,1}, > {reductions,2002}, > {garbage_collection,[{min_bin_vheap_size,46368}, > {min_heap_size,233}, > {fullsweep_after,0}, > {minor_gcs,0}]}, > {suspending,[]}] > 6?to send R data again. > (trends1@REDACTED)13> Pid ! {self(),R}. > {<0.52.0>, > {ok,[{1, > 7?The memory continue to increas. > (trends1@REDACTED)14> erlang:process_info(Pid, memory). > {memory,125381272} > (trends1@REDACTED)15> erlang:process_info(Pid). > [{current_function,{test4,loop,0}}, > {initial_call,{test4,loop,0}}, > {status,waiting}, > {message_queue_len,0}, > {messages,[]}, > {links,[]}, > {dictionary,[]}, > {trap_exit,false}, > {error_handler,error_handler}, > {priority,normal}, > {group_leader,<0.31.0>}, > {total_heap_size,15672560}, > {heap_size,15672560}, > {stack_size,1}, > {reductions,4003}, > {garbage_collection,[{min_bin_vheap_size,46368}, > {min_heap_size,233}, > {fullsweep_after,0}, > {minor_gcs,0}]}, > {suspending,[]}] > > I am wondering the cause why it is can not collect, Please give me some idea. Thanks a lot. > (trends1@REDACTED)23> erlang:process_info(Pid, memory). > {memory,195907792} > > > I'm running Erlang R14B04 on the unbuntu. > Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]? > Linux jason-lxw 3.2.0-55-generic #85-Ubuntu SMP Wed Oct 2 12:29:27 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux > > [1]??? > 1 -module(test4). > 2 -export([get_pid/0, > 3 get_data/1, > 4 get_pids/1, > 5 loop/0]). > 6 > 7 get_pids(L) -> > 8 get_pids(0, L). > 9 > 10 get_pids(0, L) -> > 11 L; > 12 get_pids(N, R) -> > 13 NewR = [get_pid()|R], > 14 get_pids(N-1, NewR). > 15 > 16 get_pid()-> > 17 spawn_opt(?MODULE, loop, [], [{fullsweep_after,0}]). > 18 %spawn(?MODULE, loop, []). > 19 > 20 get_data(Pid) -> > 21 Pid ! {self(), get}. > 22 > 23 loop() -> > 24 receive > 25 {From, Data} -> > 26 From ! Data, > 27 loop() > 28 end. > > > Cheers > Jason > -- > ??????????????? > > > > -- > ??????????????? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From Ola.Backstrom@REDACTED Wed Jan 15 09:58:23 2014 From: Ola.Backstrom@REDACTED (=?utf-8?B?T2xhICBCw6Rja3N0csO2bQ==?=) Date: Wed, 15 Jan 2014 08:58:23 +0000 Subject: [erlang-questions] Need help understanding why the Process(Pid) consumers a lot of memory and did not garbage collect In-Reply-To: References: Message-ID: <2af6bb2db09f41e6898602914a88492a@exsrvfe.ls.local> I just briefly read your post so I might have missed something, but here?s some comments. It looks like you?re sending really large messages, I can?t read from your mail how large, but 19489 times 200 bytes (just an example) would be 2Mb. That is rather unusual. Could you test making the tail call a full module call: {From, Data} -> From ! Data, test4:loop() Just to check if that have any influence on GC. The other thing is that you should be careful to empty the process ?mailbox? by using an other-clause in receive: receive {From, Data} -> From ! Data, loop() Other -> exit({got_unhandled_message, Other} end. I?d suggest to use a gen_server so you don?t need to bother too much. /Ola From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of ??? Sent: den 15 januari 2014 08:18 To: Erlang (E-mail) Subject: Re: [erlang-questions] Need help understanding why the Process(Pid) consumers a lot of memory and did not garbage collect I will appreciate If anyone can reply to me . 2014/1/14 ??? > Hi All. In recently, I ran into a problem which the Process consumers a lot of memory. There is roughly from 300M to 450 each process.? The memory will be free if invoke erlang:garbage_collect/1?So, In my view , the moemry may is not be used, and do not garbage collect. Why? I can not get it. Please give some for me. For further resolve the problem, I do some test in the simplification program. The memery is can garbage collect too(pass an hour). Test Method? 1?The R variable is about 19489 number records ??[{"author_id","users-a9KsYTIRdrq3iuAywiLRE2BGd3Y"},{"timestamp","2013-07-17 10:47:36"},{"time_int",63541277256},{"title",[233,155,133,229,133,184,231,139,172,229,136,155,232,136,170,230,181,183,229,164,169,230,150,135,229,143,176,232,133,149,232,161,168]},{"id","info-137429256786232"}]? 2?Obtain the Process of Pid (trends1@REDACTED)5> Pid = test4:get_pid() 3?The Pid state before send R data (trends1@REDACTED)7> erlang:process_info(Pid, memory). {memory,2656} (trends1@REDACTED)8> erlang:process_info(Pid). [{current_function,{test4,loop,0}}, {initial_call,{test4,loop,0}}, {status,waiting}, {message_queue_len,0}, {messages,[]}, {links,[]}, {dictionary,[]}, {trap_exit,false}, {error_handler,error_handler}, {priority,normal}, {group_leader,<0.31.0>}, {total_heap_size,233}, {heap_size,233}, {stack_size,1}, {reductions,1}, {garbage_collection,[{min_bin_vheap_size,46368}, {min_heap_size,233}, {fullsweep_after,0}, {minor_gcs,0}]}, {suspending,[]}] 4? to send R Data (trends1@REDACTED)9> Pid ! {self(),R} (trends1@REDACTED)9> . {<0.52.0>, {ok,[{1, [[{"author_id","users-a9KsYTIRdrq3iuAywiLRE2BGd3Y"}, {"timestamp","2013-07-17 10...................... 5?The Pid state after send R data, The memory is increasing. (trends1@REDACTED)11> erlang:process_info(Pid, memory). {memory,51356672} (trends1@REDACTED)12> erlang:process_info(Pid). [{current_function,{test4,loop,0}}, {initial_call,{test4,loop,0}}, {status,waiting}, {message_queue_len,0}, {messages,[]}, {links,[]}, {dictionary,[]}, {trap_exit,false}, {error_handler,error_handler}, {priority,normal}, {group_leader,<0.31.0>}, {total_heap_size,6419485}, {heap_size,6419485}, {stack_size,1}, {reductions,2002}, {garbage_collection,[{min_bin_vheap_size,46368}, {min_heap_size,233}, {fullsweep_after,0}, {minor_gcs,0}]}, {suspending,[]}] 6?to send R data again. (trends1@REDACTED)13> Pid ! {self(),R}. {<0.52.0>, {ok,[{1, 7?The memory continue to increas. (trends1@REDACTED)14> erlang:process_info(Pid, memory). {memory,125381272} (trends1@REDACTED)15> erlang:process_info(Pid). [{current_function,{test4,loop,0}}, {initial_call,{test4,loop,0}}, {status,waiting}, {message_queue_len,0}, {messages,[]}, {links,[]}, {dictionary,[]}, {trap_exit,false}, {error_handler,error_handler}, {priority,normal}, {group_leader,<0.31.0>}, {total_heap_size,15672560}, {heap_size,15672560}, {stack_size,1}, {reductions,4003}, {garbage_collection,[{min_bin_vheap_size,46368}, {min_heap_size,233}, {fullsweep_after,0}, {minor_gcs,0}]}, {suspending,[]}] I am wondering the cause why it is can not collect, Please give me some idea. Thanks a lot. (trends1@REDACTED)23> erlang:process_info(Pid, memory). {memory,195907792} I'm running Erlang R14B04 on the unbuntu. Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]? Linux jason-lxw 3.2.0-55-generic #85-Ubuntu SMP Wed Oct 2 12:29:27 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux [1]??? 1 -module(test4). 2 -export([get_pid/0, 3 get_data/1, 4 get_pids/1, 5 loop/0]). 6 7 get_pids(L) -> 8 get_pids(0, L). 9 10 get_pids(0, L) -> 11 L; 12 get_pids(N, R) -> 13 NewR = [get_pid()|R], 14 get_pids(N-1, NewR). 15 16 get_pid()-> 17 spawn_opt(?MODULE, loop, [], [{fullsweep_after,0}]). 18 %spawn(?MODULE, loop, []). 19 20 get_data(Pid) -> 21 Pid ! {self(), get}. 22 23 loop() -> 24 receive 25 {From, Data} -> 26 From ! Data, 27 loop() 28 end. Cheers Jason -- ??????????????? -- ??????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jlnavarro111@REDACTED Wed Jan 15 12:56:36 2014 From: jlnavarro111@REDACTED (Jose Luis Navarro) Date: Wed, 15 Jan 2014 12:56:36 +0100 Subject: [erlang-questions] Erlang libphonenumber wrapper Message-ID: Hi all, I want announce the first version of elibphonenumber, this library is a wrapper for use libphonenumber calls through Erlang https://github.com/artefactop/elibphonenumber Pull request are welcome :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshua__lim@REDACTED Wed Jan 15 14:45:29 2014 From: joshua__lim@REDACTED (Joshua Lim) Date: Wed, 15 Jan 2014 13:45:29 +0000 Subject: [erlang-questions] escript: exception error: no match of right hand side value {error, enoent} Message-ID: Hi, I encountered the above error while trying to build a RabbitMQ plugin using MinGW/MSYS on Windows 7 (64 bit). I'm using Erlang v5.10.3 (32 bit). I'm able to run RabbitMQ on my system. As this error subject has been brought up at RabbitMQ newsgroup in 2012, but without a definite solution so I thought I might try to post on Erlang newsgroup instead. The full error is as follows and the complete code for generate_deps can be found here - http://pastebin.com/N4HVz8z1 Please let me know I can fix the problem. Thank you very much. Ps. I've also tried using CYGWIN but it returns another error - escript: Failed to open file: /home/Fujitsu/rabbitmq/build-source/rabbitmq-public-umbrella/generate_deps Fujitsu@REDACTED /d/RabbitMQ/build-source/rabbitmq-public-umbrella/presence-exchange-master$ make[elided] generate depsescript: exception error: no match of right hand side value {error,enoent} in function generate_deps__escript__1389__793192__493000:detect_deps/5 (d:/RabbitMQ/build-source/rabbitmq-public-umbrella/generate_deps, line 40) in call from generate_deps__escript__1389__793192__493000:'-main/1-fun-0-'/6 (d:/RabbitMQ/build-source/rabbitmq-public-umbrella/generate_deps, line 19) in call from lists:foldl/3 (lists.erl, line 1248) in call from generate_deps__escript__1389__793192__493000:main/1 (d:/RabbitMQ/build-source/rabbitmq-public-umbrella/generate_deps, line 17) in call from escript:run/2 (escript.erl, line 747) in call from escript:start/1 (escript.erl, line 277) in call from init:start_it/1 (init.erl, line 1054) in call from init:start_em/1 (init.erl, line 1034)[elided] generate depsescript: exception error: no match of right hand side value {error,enoent} in function generate_deps__escript__1389__793194__76000:detect_deps/5 (d:/RabbitMQ/build-source/rabbitmq-public-umbrella/generate_deps, line 40) in call from generate_deps__escript__1389__793194__76000:'-main/1-fun-0-'/6 (d:/RabbitMQ/build-source/rabbitmq-public-umbrella/generate_deps, line 19) in call from lists:foldl/3 (lists.erl, line 1248) in call from generate_deps__escript__1389__793194__76000:main/1 (d:/RabbitMQ/build-source/rabbitmq-public-umbrella/generate_deps, line 17) in call from escript:run/2 (escript.erl, line 747) in call from escript:start/1 (escript.erl, line 277) in call from init:start_it/1 (init.erl, line 1054) in call from init:start_em/1 (init.erl, line 1034)rm -rf ../rabbitmq-erlang-client/distmake -C ../rabbitmq-erlang-clientmake[1]: Entering directory `/d/RabbitMQ/build-source/rabbitmq-public-umbrella/rabbitmq-erlang-client'rm -f deps.mkecho src/amqp_auth_mechanisms.erl:src/amqp_channel.erl:src/amqp_channel_sup.erl:src/amqp_channel_sup_sup.erl:src/amqp_channels_manager.erl:src/amqp_client.erl:src/amqp_connection.erl:src/amqp_connection_sup.erl:src/amqp_connection_type_sup.erl:src/amqp_direct_connectierl:src/amqp_gen_connection.erl:src/amqp_gen_consumer.erl:src/amqp_main_reader.erl:src/amqp_network_connection.erl:src/amqp_rpc_client.erl:src/amqp_rpc_server.erl:src/amqp_selective_consumer.erl:src/amqp_sup.erl:src/amqp_uri.erl:src/rabbit_routing_util.erl:src/uri_parinclude/amqp_client_internal.hrl:include/amqp_gen_consumer_spec.hrl:include/rabbit_routing_prefixes.hrl: | escript ../rabbitmq-server/generate_deps deps.mk ebinmake[1]: Leaving directory `/d/RabbitMQ/build-source/rabbitmq-public-umbrella/rabbitmq-erlang-client'make[1]: Entering directory `/d/RabbitMQ/build-source/rabbitmq-public-umbrella/rabbitmq-erlang-client'escript ../rabbitmq-server/generate_app rabbit_common.app.in rabbit_common.app srcsed 's/%%VSN%%/0.0.0/' rabbit_common.app > rabbit_common.app.tmp && mv rabbit_common.app.tmp rabbit_common.appmkdir -p distrm -f dist/rabbit_common-0.0.0.ezmake -C ../rabbitmq-servermake[2]: Entering directory `/d/RabbitMQ/build-source/rabbitmq-public-umbrella/rabbitmq-server'make[2]: Nothing to be done for `all'.make[2]: Leaving directory `/d/RabbitMQ/build-source/rabbitmq-public-umbrella/rabbitmq-server'rm -rf dist/rabbit_common-0.0.0mkdir -p dist/rabbit_common-0.0.0/includemkdir -p dist/rabbit_common-0.0.0/ebincp rabbit_common.app dist/rabbit_common-0.0.0/ebin/( cp ../rabbitmq-server/ebin/app_utils.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/credit_flow.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/pmon.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/gen_s.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/mirrored_supervisor.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/priority_queue.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_backing_queue.beam dist/rabbit_common-0.0.0/r/ebin/rabbit_basic.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_binary_generator.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_binary_parser.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_channel_interceptor.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_runtime_parameter.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_command_assembl/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_exchange_type.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_exchange_decorator.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_auth_backend.beam dist/rabbit_commonq-server/ebin/rabbit_auth_mechanism.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_framing_amqp_0_8.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_framing_amqp_0_9_1.beam dist/rabbit_common-0.0.0/ebin/ ); ( cpheartbeat.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_misc.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_msg_store_index.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_net.beam; ( cp ../rabbitmq-server/ebin/rabbit_nodes.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_policy_validator.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_reader.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ..ter.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_event.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_queue_collector.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_queue_decoratoebin/ ); ( cp ../rabbitmq-server/ebin/rabbit_amqqueue.beam dist/rabbit_common-0.0.0/ebin/ ); ( cp ../rabbitmq-server/ebin/supervisor2.beam dist/rabbit_common-0.0.0/ebin/ );cp ../rabbitmq-server/include/*.hrl dist/rabbit_common-0.0.0/include/(cd dist; zip -q -r rabbit_common-0.0.0.ez rabbit_common-0.0.0)mkdir -p depsrm -rf deps/rabbit_common-0.0.0mkdir -p deps/rabbit_common-0.0.0unzip -q -o dist/rabbit_common-0.0.0.ez -d depsERL_LIBS=deps:dist erlc -I include -pa ebin -o ebin -Wall -v +debug_info -Duse_specs src/amqp_auth_mechanisms.erl{error_logger,{{2014,1,15},{21,40,35}},std_error,"File operation error: eio. Target: deps:dist. Function: list_dir. Process: code_server."} =ERROR REPORT==== 16-Jan-2014::05:40:35 ===File operation error: eio. Target: deps:dist. Function: list_dir. Process: code_server.d://RabbitMQ/BUILD-~1/RABBIT~3/RA9B14~1/include/amqp_client.hrl:20: can't find include lib "rabbit_common/include/rabbit.hrl"d://RabbitMQ/BUILD-~1/RABBIT~3/RA9B14~1/include/amqp_client.hrl:21: can't find include lib "rabbit_common/include/rabbit_framing.hrl"d://RabbitMQ/BUILD-~1/RABBIT~3/RA9B14~1/include/amqp_client.hrl:23: record 'P_basic' undefinedmake[1]: *** [ebin/amqp_auth_mechanisms.beam] Error 1make[1]: Leaving directory `/d/RabbitMQ/build-source/rabbitmq-public-umbrella/rabbitmq-erlang-client'make: *** [../rabbitmq-erlang-client/dist/.done.0.0.0] Error 2 Fujitsu@REDACTED /d/RabbitMQ/build-source/rabbitmq-public-umbrella/presence-exchange-master$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattevans123@REDACTED Wed Jan 15 18:48:46 2014 From: mattevans123@REDACTED (Matthew Evans) Date: Wed, 15 Jan 2014 12:48:46 -0500 Subject: [erlang-questions] transactions in dets In-Reply-To: References: Message-ID: Hi Have you looked at the global module? Specifically global:trans http://www.erlang.org/doc/man/global.html Date: Wed, 15 Jan 2014 00:59:19 +0400 From: donpedrothird@REDACTED To: erlang-questions@REDACTED Subject: [erlang-questions] transactions in dets Hi,Is there a way (some app or whatnot) to do transactions in dets without mnesia? In my project there are many similar clusters of small dets files, independent of each other - many directories, each directory contains dets file with data and a few other dets files with some related data, statistics on this data, indexes and denormalization data, most of time all these tables are closed. Are there any more or less standard solutions to do transactional changes in each of such cluster so that data in all files inside a directory would be consistent? I really don't want to write my own versioning db engine ridden with bugs and locks. _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Wed Jan 15 18:53:13 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Wed, 15 Jan 2014 18:53:13 +0100 (CET) Subject: [erlang-questions] transactions in dets In-Reply-To: References: Message-ID: <284682266.56391.1389808393256.JavaMail.zimbra@tpip.net> Hi, Well, not the most performant, but serializing all db access through one gen_server process should be the simplest solution. Andreas ----- Original Message ----- > Hi, > Is there a way (some app or whatnot) to do transactions in dets without > mnesia? In my project there are many similar clusters of small dets files, > independent of each other - many directories, each directory contains dets > file with data and a few other dets files with some related data, statistics > on this data, indexes and denormalization data, most of time all these > tables are closed. Are there any more or less standard solutions to do > transactional changes in each of such cluster so that data in all files > inside a directory would be consistent? I really don't want to write my own > versioning db engine ridden with bugs and locks. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- -- Dipl. Inform. Andreas Schultz From donpedrothird@REDACTED Wed Jan 15 20:51:41 2014 From: donpedrothird@REDACTED (Evgeny M) Date: Wed, 15 Jan 2014 11:51:41 -0800 (PST) Subject: [erlang-questions] transactions in dets In-Reply-To: <284682266.56391.1389808393256.JavaMail.zimbra@tpip.net> References: <284682266.56391.1389808393256.JavaMail.zimbra@tpip.net> Message-ID: > Well, not the most performant, but serializing all db access through one > gen_server process > should be the simplest solution. > Yes, this was the first thing I thought about, but it still does not guarantee consistency in case of a sudden node crash Have you looked at the global module? Specifically global:trans > > This was the second thing i thought, I didn't know about this function and wrote its' analog again myself. But again, it does not guarantee consistency in case of node crash -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoursurrogategod@REDACTED Thu Jan 16 02:40:56 2014 From: yoursurrogategod@REDACTED (Yves S. Garret) Date: Wed, 15 Jan 2014 20:40:56 -0500 Subject: [erlang-questions] Debugger is very unstable Message-ID: Hello, I have a problem with the debugger. I'm running ArchLinux and installed erlang using pacman (the default package manager.) Whenever I debugger:start(), the window shows up and when I move my mouse around it (even a few milimeters), the windows vanishes and I see the following error report: http://bin.cakephp.org/view/1891808660 Also, in pacman, I tried installing the wxWidgets bindings for erlang (hoping that that would work, apparently not so much?) if that helps to know. Is there a way to make the debugger more stable? -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoursurrogategod@REDACTED Thu Jan 16 03:26:24 2014 From: yoursurrogategod@REDACTED (Yves S. Garret) Date: Wed, 15 Jan 2014 21:26:24 -0500 Subject: [erlang-questions] Fwd: Debugger is very unstable In-Reply-To: References: Message-ID: Would using dbg inside of Erlang work just as well for debugging? Am I _obligated_ to use the GUI debugger? ---------- Forwarded message ---------- From: Yves S. Garret Date: Wed, Jan 15, 2014 at 8:40 PM Subject: Debugger is very unstable To: "erlang-questions@REDACTED" Hello, I have a problem with the debugger. I'm running ArchLinux and installed erlang using pacman (the default package manager.) Whenever I debugger:start(), the window shows up and when I move my mouse around it (even a few milimeters), the windows vanishes and I see the following error report: http://bin.cakephp.org/view/1891808660 Also, in pacman, I tried installing the wxWidgets bindings for erlang (hoping that that would work, apparently not so much?) if that helps to know. Is there a way to make the debugger more stable? -------------- next part -------------- An HTML attachment was scrubbed... URL: From kjw0188@REDACTED Thu Jan 16 00:51:17 2014 From: kjw0188@REDACTED (Kelly Wong) Date: Wed, 15 Jan 2014 15:51:17 -0800 Subject: [erlang-questions] foldl vs foldr and ++ In-Reply-To: References: <3c4ca91f-0f20-4184-b6f0-f8ac3204ab99@knuth> <9D182CD2-CD31-411F-8641-E12E003EFDD7@cs.otago.ac.nz> <47BF1E72-9119-4E6F-AAD4-D58F3C154380@feuerlabs.com> Message-ID: Did you make sure to run it with -mode(compile). ? If you don't the script will be interpreted, and could throw off performance tests. Kelly Wong On Tue, Jan 14, 2014 at 3:41 AM, Tim Watson wrote: > I tweaked your module to run via escript (just adding a simple main/1 and > printing out the results of timer:tc), and I see a bit gap between foldl > and foldr, whilst the hand coded version based on lists:reverse/1 is plenty > fast enough: > > t4@REDACTED:test $ escript lr.beam 10000000 > foldl: 679.103ms > foldr: 43609.149ms > reverse: 909.946ms > t4@REDACTED:test $ evm info > R16B03 compiled for x86_64-apple-darwin11.4.2, 64bit > > On Friday, 11 May 2012 10:27:29 UTC+1, Ulf Wiger wrote: >> >> >> On 11 May 2012, at 04:02, Richard O'Keefe wrote: >> >> > This can be written more efficiently, but it's best of all >> > just not to reverse the string in the first place. Keep >> > the code at a level where you can see what's going on well >> > enough to spot the really _big_ efficiency gains. >> >> And this is of course the really important difference between >> foldr() and foldl(): >> >> - in which order do you want to process the list? >> - if you build a list in the accumulator, in which order do you want it? >> >> For most practical purposes, one should assume that they >> both both do their job efficiently. >> >> BR, >> Ulf >> >> Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. >> http://feuerlabs.com >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-q...@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dangud@REDACTED Thu Jan 16 08:22:34 2014 From: dangud@REDACTED (Dan Gudmundsson) Date: Thu, 16 Jan 2014 08:22:34 +0100 Subject: [erlang-questions] Fwd: Debugger is very unstable In-Reply-To: References: Message-ID: The gs part of the debugger is removed in R17 so you better get wxWidgets up and running. That said, I broke wx in R16B03 so the debugger don't work anyway, a patch is on the way.. /Dan On Thu, Jan 16, 2014 at 3:26 AM, Yves S. Garret wrote: > Would using dbg inside of Erlang work just as well for debugging? Am I > _obligated_ to use the GUI debugger? > > > ---------- Forwarded message ---------- > From: Yves S. Garret > Date: Wed, Jan 15, 2014 at 8:40 PM > Subject: Debugger is very unstable > To: "erlang-questions@REDACTED" > > > Hello, > > I have a problem with the debugger. I'm running ArchLinux and installed > erlang using pacman (the default package manager.) Whenever I > debugger:start(), the window shows up and when I move my mouse around it > (even a few milimeters), the windows vanishes and I see the following error > report: > http://bin.cakephp.org/view/1891808660 > > Also, in pacman, I tried installing the wxWidgets bindings for erlang > (hoping that that would work, apparently not so much?) if that helps to > know. > > Is there a way to make the debugger more stable? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From desired.mta@REDACTED Thu Jan 16 09:10:17 2014 From: desired.mta@REDACTED (=?UTF-8?B?TW90aWVqdXMgSmFrxaF0eXM=?=) Date: Thu, 16 Jan 2014 09:10:17 +0100 Subject: [erlang-questions] transactions in dets In-Reply-To: References: <284682266.56391.1389808393256.JavaMail.zimbra@tpip.net> Message-ID: <52D793E9.7050107@gmail.com> 2014.01.15 20:51, Evgeny M ra??: > > Well, not the most performant, but serializing all db access through > one gen_server process > should be the simplest solution. > > > Yes, this was the first thing I thought about, but it still does not > guarantee consistency in case of a sudden node crash > > Have you looked at the global module? Specifically global:trans > > This was the second thing i thought, I didn't know about this function > and wrote its' analog again myself. But again, it does not > guarantee consistency in case of node crash > > Have you looked at mnesia checkpoints? If you don't mind high overhead, this might work. Otherwise you'll have to think about an external ACID database. Motiejus [1]: http://www.erlang.org/doc/apps/mnesia/Mnesia_chap7.html From watson.timothy@REDACTED Thu Jan 16 11:22:25 2014 From: watson.timothy@REDACTED (Tim Watson) Date: Thu, 16 Jan 2014 10:22:25 +0000 Subject: [erlang-questions] foldl vs foldr and ++ In-Reply-To: References: <3c4ca91f-0f20-4184-b6f0-f8ac3204ab99@knuth> <9D182CD2-CD31-411F-8641-E12E003EFDD7@cs.otago.ac.nz> <47BF1E72-9119-4E6F-AAD4-D58F3C154380@feuerlabs.com> Message-ID: <8026E457-07CA-435D-8FD6-09A39C8A54F6@gmail.com> I compiled the module with erlc and ran it via 'escript lr.beam' - doesn't that have the same effect? On 15 Jan 2014, at 23:51, Kelly Wong wrote: > Did you make sure to run it with -mode(compile). ? If you don't the script will be interpreted, and could throw off performance tests. > > Kelly Wong > > > On Tue, Jan 14, 2014 at 3:41 AM, Tim Watson wrote: > I tweaked your module to run via escript (just adding a simple main/1 and printing out the results of timer:tc), and I see a bit gap between foldl and foldr, whilst the hand coded version based on lists:reverse/1 is plenty fast enough: > > t4@REDACTED:test $ escript lr.beam 10000000 > foldl: 679.103ms > foldr: 43609.149ms > reverse: 909.946ms > t4@REDACTED:test $ evm info > R16B03 compiled for x86_64-apple-darwin11.4.2, 64bit > > On Friday, 11 May 2012 10:27:29 UTC+1, Ulf Wiger wrote: > > On 11 May 2012, at 04:02, Richard O'Keefe wrote: > > > This can be written more efficiently, but it's best of all > > just not to reverse the string in the first place. Keep > > the code at a level where you can see what's going on well > > enough to spot the really _big_ efficiency gains. > > And this is of course the really important difference between > foldr() and foldl(): > > - in which order do you want to process the list? > - if you build a list in the accumulator, in which order do you want it? > > For most practical purposes, one should assume that they > both both do their job efficiently. > > BR, > Ulf > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > > _______________________________________________ > erlang-questions mailing list > erlang-q...@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hm@REDACTED Thu Jan 16 12:08:54 2014 From: hm@REDACTED (=?ISO-8859-1?Q?H=E5kan_Mattsson?=) Date: Thu, 16 Jan 2014 12:08:54 +0100 Subject: [erlang-questions] foldl vs foldr and ++ In-Reply-To: <8026E457-07CA-435D-8FD6-09A39C8A54F6@gmail.com> References: <3c4ca91f-0f20-4184-b6f0-f8ac3204ab99@knuth> <9D182CD2-CD31-411F-8641-E12E003EFDD7@cs.otago.ac.nz> <47BF1E72-9119-4E6F-AAD4-D58F3C154380@feuerlabs.com> <8026E457-07CA-435D-8FD6-09A39C8A54F6@gmail.com> Message-ID: Yes, it has the same effect. /H?kan On Thu, Jan 16, 2014 at 11:22 AM, Tim Watson wrote: > I compiled the module with erlc and ran it via 'escript lr.beam' - doesn't > that have the same effect? > > On 15 Jan 2014, at 23:51, Kelly Wong wrote: > > Did you make sure to run it with -mode(compile). ? If you don't the script > will be interpreted, and could throw off performance tests. > > Kelly Wong > > > On Tue, Jan 14, 2014 at 3:41 AM, Tim Watson > wrote: >> >> I tweaked your module to run via escript (just adding a simple main/1 and >> printing out the results of timer:tc), and I see a bit gap between foldl and >> foldr, whilst the hand coded version based on lists:reverse/1 is plenty fast >> enough: >> >> t4@REDACTED:test $ escript lr.beam 10000000 >> foldl: 679.103ms >> foldr: 43609.149ms >> reverse: 909.946ms >> t4@REDACTED:test $ evm info >> R16B03 compiled for x86_64-apple-darwin11.4.2, 64bit >> >> On Friday, 11 May 2012 10:27:29 UTC+1, Ulf Wiger wrote: >>> >>> >>> On 11 May 2012, at 04:02, Richard O'Keefe wrote: >>> >>> > This can be written more efficiently, but it's best of all >>> > just not to reverse the string in the first place. Keep >>> > the code at a level where you can see what's going on well >>> > enough to spot the really _big_ efficiency gains. >>> >>> And this is of course the really important difference between >>> foldr() and foldl(): >>> >>> - in which order do you want to process the list? >>> - if you build a list in the accumulator, in which order do you want it? >>> >>> For most practical purposes, one should assume that they >>> both both do their job efficiently. >>> >>> BR, >>> Ulf >>> >>> Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. >>> http://feuerlabs.com >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-q...@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From drormein@REDACTED Thu Jan 16 16:00:42 2014 From: drormein@REDACTED (Dror Mein) Date: Thu, 16 Jan 2014 07:00:42 -0800 (PST) Subject: [erlang-questions] flymake include dir Message-ID: <1389884442.90482.YahooMailNeo@web164504.mail.gq1.yahoo.com> not completely an erlang question: I've tried to hack my code with the elisp from here: http://blog.erlware.org/2012/05/15/getting-flymake-and-rebar-to-play-nice/ and I can't get it to work.? I've copied this code inside .emacs under the (require 'erlang-flymake) and I have a rebar.config in the top of my project directory?and It's not working.? so I've tried perhaps to do this simpler.? I've got a rebar.config file that has {erl_opts, [{i, path\to\include\dir} ]} I want a simple elisp code that looks something like this: (set (make-local-variable 'compile-command) "rebar compile") thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From andra.dinu@REDACTED Thu Jan 16 16:08:09 2014 From: andra.dinu@REDACTED (Andra Dinu) Date: Thu, 16 Jan 2014 16:08:09 +0100 (CET) Subject: [erlang-questions] Erlang Factory San Francisco Bay Area 6-7 March: programme complete, EB ends on 11 Feb In-Reply-To: <1195232013.461376.1389884641103.JavaMail.zimbra@erlang-solutions.com> Message-ID: <1042701305.461507.1389884889712.JavaMail.zimbra@erlang-solutions.com> The conference programme for the Erlang factory SF Bay Area is now complete. Mike Williams, co-inventor of the Erlang programming language, will deliver the first keynote. Elixir?s inventor, Jos? Valim ? also a Ruby on Rails Core Team member, will give a joint keynote with Dave Thomas - author of The Pragmatic Programmer. As a premiere, the conference will have an entire track dedicated to the Elixir programming language. Other speakers include Bruce Tate - author of 7 Languages in 7 Weeks, Dave Thomas - author of The Pragmatic Programmer, Bob Ippolito - founder of Mochi Media and Erlang hacker, Rick Reed - software engineer at WhatsApp, Brett Cameron - senior software architect with HP?s corporate Cloud S, Stu Bailey - CTO of Infoblox, Erik Stenman - chief scientist at Klarna, Duncan McGregor-senior manager at Rackspace and many more. Full programme can be seen here: http://www.erlang-factory.com/conference/show/conference-6/home/#programme Early Bird rates end on 11 February http://www.erlang-factory.com/conference/show/conference-6/home/#home Besides the already traditional Erlang courses, this year participants are also offered courses on Elixir, Cowboy, Riak and Kazoo. -- Andra Dinu Community & Social ERLANG SOLUTIONS LTD New Loom House 101 Back Church Lane London, E1 1LU United Kingdom Tel +44(0)2076550344 Mob +44(0)7983484387 www.erlang-solutions.com From watson.timothy@REDACTED Thu Jan 16 16:14:07 2014 From: watson.timothy@REDACTED (Tim Watson) Date: Thu, 16 Jan 2014 15:14:07 +0000 Subject: [erlang-questions] flymake include dir In-Reply-To: <1389884442.90482.YahooMailNeo@web164504.mail.gq1.yahoo.com> References: <1389884442.90482.YahooMailNeo@web164504.mail.gq1.yahoo.com> Message-ID: It works for me: https://raw.github.com/hyperthunk/bashtools/master/.emacs The only caveat is that `M-x compile' tends to only work if you run it from the project's root directory. Cheers, Tim On 16 Jan 2014, at 15:00, Dror Mein wrote: > not completely an erlang question: > > I've tried to hack my code with the elisp from here: > > http://blog.erlware.org/2012/05/15/getting-flymake-and-rebar-to-play-nice/ > > and I can't get it to work. > I've copied this code inside .emacs under the (require 'erlang-flymake) and I have a rebar.config in the top of my project directory and It's not working. > > so I've tried perhaps to do this simpler. > I've got a rebar.config file that has {erl_opts, [{i, path\to\include\dir} ]} > I want a simple elisp code that looks something like this: > (set (make-local-variable 'compile-command) "rebar compile") > > thanks > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus@REDACTED Thu Jan 16 16:31:43 2014 From: magnus@REDACTED (Magnus Henoch) Date: Thu, 16 Jan 2014 15:31:43 +0000 Subject: [erlang-questions] flymake include dir In-Reply-To: <1389884442.90482.YahooMailNeo@web164504.mail.gq1.yahoo.com> (Dror Mein's message of "Thu, 16 Jan 2014 07:00:42 -0800 (PST)") References: <1389884442.90482.YahooMailNeo@web164504.mail.gq1.yahoo.com> Message-ID: Dror Mein writes: > not completely an erlang question: > > I've tried to hack my code with the elisp from here: > > http://blog.erlware.org/2012/05/15/getting-flymake-and-rebar-to-play-nice/ I used that code earlier, and was mostly happy with it but found it somewhat slow. (Also, it gets into an infinite loop on OSX. You need to add "Volumes" to the list of directories not to recurse into, alongside "." and "..".) Now I'm using the following piece of elisp, which completely ignores the Rebar configuration but gets it right for most projects I work with: (defun mh-simple-get-deps-code-path-dirs () ;; Why complicate things? (and (buffer-file-name) (let ((default-directory (file-name-directory (buffer-file-name)))) (file-expand-wildcards "../../*/ebin")))) (defun mh-simple-get-deps-include-dirs () (list "../include")) (setq erlang-flymake-get-code-path-dirs-function 'mh-simple-get-deps-code-path-dirs erlang-flymake-get-include-dirs-function 'mh-simple-get-deps-include-dirs) Also at: https://github.com/legoscia/dotemacs/blob/master/dotemacs.org#try-harder-to-find-include-files-in-flymake Regards, Magnus From rich.neswold@REDACTED Thu Jan 16 17:39:34 2014 From: rich.neswold@REDACTED (Rich Neswold) Date: Thu, 16 Jan 2014 10:39:34 -0600 Subject: [erlang-questions] List comprehension question Message-ID: Hello, This morning I became aware of a (powerful) feature of list comprehensions. Take the following example: [ X + Y || {X, Y} <- L]. If we set L to [{1,2}, ok, {1,3}], we get the result [3,4] instead of a pattern match exception (as I was expecting.) This means that list comprehensions give you a "free" lists:filter/2 in the generator expressions! I've looked through the OTP documentation, quite a few Stack Overflow questions, and several list comprehension tutorials and none of them explicitly state that generator expressions filter elements that don't match their pattern. The web pages emphasize generators and guards are like combinations of lists:map and lists:filter, which isn't exactly correct. For instance, the above example is not the same as: lists:map(fun ({X, Y}) -> X + Y end, L). but is more equivalent to: lists:foldr(fun ({X, Y}, Acc) -> [X + Y | Acc]; (_, Acc) -> Acc end, [], L). Is this an expected, but undocumented, feature of list comprehensions? Or am I in "undefined behavior" territory? -- Rich From jose.valim@REDACTED Thu Jan 16 17:51:16 2014 From: jose.valim@REDACTED (=?ISO-8859-1?Q?Jos=E9_Valim?=) Date: Thu, 16 Jan 2014 17:51:16 +0100 Subject: [erlang-questions] List comprehension question In-Reply-To: References: Message-ID: It is definitely a public feature of list comprehensions. Maybe a pull request should be sent to the list comprehensions page updating the docs and adding nice examples? :) *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Lead Developer On Thu, Jan 16, 2014 at 5:39 PM, Rich Neswold wrote: > Hello, > > This morning I became aware of a (powerful) feature of list > comprehensions. Take the following example: > > [ X + Y || {X, Y} <- L]. > > If we set L to [{1,2}, ok, {1,3}], we get the result [3,4] instead of > a pattern match exception (as I was expecting.) This means that list > comprehensions give you a "free" lists:filter/2 in the generator > expressions! > > I've looked through the OTP documentation, quite a few Stack Overflow > questions, and several list comprehension tutorials and none of them > explicitly state that generator expressions filter elements that don't > match their pattern. The web pages emphasize generators and guards are > like combinations of lists:map and lists:filter, which isn't exactly > correct. For instance, the above example is not the same as: > > lists:map(fun ({X, Y}) -> X + Y end, L). > > but is more equivalent to: > > lists:foldr(fun ({X, Y}, Acc) -> [X + Y | Acc]; > (_, Acc) -> Acc > end, [], L). > > Is this an expected, but undocumented, feature of list comprehensions? > Or am I in "undefined behavior" territory? > > -- > Rich > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amindfv@REDACTED Thu Jan 16 17:55:12 2014 From: amindfv@REDACTED (amindfv@REDACTED) Date: Thu, 16 Jan 2014 11:55:12 -0500 Subject: [erlang-questions] List comprehension question In-Reply-To: References: Message-ID: This is intentional. I use a pattern like this a lot: -type foo :: {'a', string()} | {'b', string()}. Foos() -> [{a, "hello"}, {b, "goodbye"}]. As() -> [ S || {a, S} <- Foos() ]. % ["hello"] Tom El Jan 16, 2014, a las 11:39, Rich Neswold escribi?: > Hello, > > This morning I became aware of a (powerful) feature of list > comprehensions. Take the following example: > > [ X + Y || {X, Y} <- L]. > > If we set L to [{1,2}, ok, {1,3}], we get the result [3,4] instead of > a pattern match exception (as I was expecting.) This means that list > comprehensions give you a "free" lists:filter/2 in the generator > expressions! > > I've looked through the OTP documentation, quite a few Stack Overflow > questions, and several list comprehension tutorials and none of them > explicitly state that generator expressions filter elements that don't > match their pattern. The web pages emphasize generators and guards are > like combinations of lists:map and lists:filter, which isn't exactly > correct. For instance, the above example is not the same as: > > lists:map(fun ({X, Y}) -> X + Y end, L). > > but is more equivalent to: > > lists:foldr(fun ({X, Y}, Acc) -> [X + Y | Acc]; > (_, Acc) -> Acc > end, [], L). > > Is this an expected, but undocumented, feature of list comprehensions? > Or am I in "undefined behavior" territory? > > -- > Rich > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From dmkolesnikov@REDACTED Thu Jan 16 17:58:27 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Thu, 16 Jan 2014 18:58:27 +0200 Subject: [erlang-questions] List comprehension question In-Reply-To: References: Message-ID: Hello, There is also very powerful feature called binary comprehensive http://user.it.uu.se/~pergu/papers/erlang05.pdf - Dmitry On Jan 16, 2014, at 6:39 PM, Rich Neswold wrote: > Hello, > > This morning I became aware of a (powerful) feature of list > comprehensions. Take the following example: > > [ X + Y || {X, Y} <- L]. > > If we set L to [{1,2}, ok, {1,3}], we get the result [3,4] instead of > a pattern match exception (as I was expecting.) This means that list > comprehensions give you a "free" lists:filter/2 in the generator > expressions! > > I've looked through the OTP documentation, quite a few Stack Overflow > questions, and several list comprehension tutorials and none of them > explicitly state that generator expressions filter elements that don't > match their pattern. The web pages emphasize generators and guards are > like combinations of lists:map and lists:filter, which isn't exactly > correct. For instance, the above example is not the same as: > > lists:map(fun ({X, Y}) -> X + Y end, L). > > but is more equivalent to: > > lists:foldr(fun ({X, Y}, Acc) -> [X + Y | Acc]; > (_, Acc) -> Acc > end, [], L). > > Is this an expected, but undocumented, feature of list comprehensions? > Or am I in "undefined behavior" territory? > > -- > Rich > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From amindfv@REDACTED Thu Jan 16 17:58:45 2014 From: amindfv@REDACTED (amindfv@REDACTED) Date: Thu, 16 Jan 2014 11:58:45 -0500 Subject: [erlang-questions] List comprehension question In-Reply-To: References: Message-ID: <4AA83BCF-6A32-43B9-929F-818A52A677AE@gmail.com> Or! You can write: [ A || A = {a, _} <- Foos() ] Both of these examples work in Haskell also. Tom El Jan 16, 2014, a las 11:55, amindfv@REDACTED escribi?: > This is intentional. I use a pattern like this a lot: > > -type foo :: {'a', string()} | {'b', string()}. > > Foos() -> [{a, "hello"}, {b, "goodbye"}]. > > As() -> [ S || {a, S} <- Foos() ]. % ["hello"] > > Tom > > > El Jan 16, 2014, a las 11:39, Rich Neswold escribi?: > >> Hello, >> >> This morning I became aware of a (powerful) feature of list >> comprehensions. Take the following example: >> >> [ X + Y || {X, Y} <- L]. >> >> If we set L to [{1,2}, ok, {1,3}], we get the result [3,4] instead of >> a pattern match exception (as I was expecting.) This means that list >> comprehensions give you a "free" lists:filter/2 in the generator >> expressions! >> >> I've looked through the OTP documentation, quite a few Stack Overflow >> questions, and several list comprehension tutorials and none of them >> explicitly state that generator expressions filter elements that don't >> match their pattern. The web pages emphasize generators and guards are >> like combinations of lists:map and lists:filter, which isn't exactly >> correct. For instance, the above example is not the same as: >> >> lists:map(fun ({X, Y}) -> X + Y end, L). >> >> but is more equivalent to: >> >> lists:foldr(fun ({X, Y}, Acc) -> [X + Y | Acc]; >> (_, Acc) -> Acc >> end, [], L). >> >> Is this an expected, but undocumented, feature of list comprehensions? >> Or am I in "undefined behavior" territory? >> >> -- >> Rich >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From rich.neswold@REDACTED Thu Jan 16 18:07:19 2014 From: rich.neswold@REDACTED (Rich Neswold) Date: Thu, 16 Jan 2014 11:07:19 -0600 Subject: [erlang-questions] List comprehension question In-Reply-To: <4AA83BCF-6A32-43B9-929F-818A52A677AE@gmail.com> References: <4AA83BCF-6A32-43B9-929F-818A52A677AE@gmail.com> Message-ID: >> El Jan 16, 2014, a las 11:39, Rich Neswold escribi?: >>> This morning I became aware of a (powerful) feature of list >>> comprehensions. >>> >>> Is this an expected, but undocumented, feature of list comprehensions? >>> Or am I in "undefined behavior" territory? Thank you for all your prompt replies! I've got some code simplification to do... -- Rich From ivan@REDACTED Thu Jan 16 18:08:21 2014 From: ivan@REDACTED (Ivan Uemlianin) Date: Thu, 16 Jan 2014 17:08:21 +0000 Subject: [erlang-questions] List comprehension question In-Reply-To: References: Message-ID: <52D81205.9070600@llaisdy.com> I interpret the "{X,Y} <- L" as a filter type expression, as well as a generator, equivalent to something like "Z <- L, {X,Y} = Z". Ivan On 16/01/2014 16:39, Rich Neswold wrote: > Hello, > > This morning I became aware of a (powerful) feature of list > comprehensions. Take the following example: > > [ X + Y || {X, Y} <- L]. > > If we set L to [{1,2}, ok, {1,3}], we get the result [3,4] instead of > a pattern match exception (as I was expecting.) This means that list > comprehensions give you a "free" lists:filter/2 in the generator > expressions! > > I've looked through the OTP documentation, quite a few Stack Overflow > questions, and several list comprehension tutorials and none of them > explicitly state that generator expressions filter elements that don't > match their pattern. The web pages emphasize generators and guards are > like combinations of lists:map and lists:filter, which isn't exactly > correct. For instance, the above example is not the same as: > > lists:map(fun ({X, Y}) -> X + Y end, L). > > but is more equivalent to: > > lists:foldr(fun ({X, Y}, Acc) -> [X + Y | Acc]; > (_, Acc) -> Acc > end, [], L). > > Is this an expected, but undocumented, feature of list comprehensions? > Or am I in "undefined behavior" territory? > > -- > Rich > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- ============================================================ Ivan A. Uemlianin PhD Llaisdy Speech Technology Research and Development ivan@REDACTED www.llaisdy.com llaisdy.wordpress.com github.com/llaisdy www.linkedin.com/in/ivanuemlianin festina lente ============================================================ From darach@REDACTED Thu Jan 16 18:16:13 2014 From: darach@REDACTED (Darach Ennis) Date: Thu, 16 Jan 2014 17:16:13 +0000 Subject: [erlang-questions] List comprehension question In-Reply-To: <4AA83BCF-6A32-43B9-929F-818A52A677AE@gmail.com> References: <4AA83BCF-6A32-43B9-929F-818A52A677AE@gmail.com> Message-ID: Similarly, bit comprehensions can benefit also, but not as useful as flexibly as the list comprehension case: [ X + Y || << X:8, Y:8 >> <= << 1:8, 2:8, 3:8, 4:8, 0:1 >> ]. %% discards final byte [ X + Y || << X:8, Y:8, Z:8 >> <= << 1:8, 2:8, 0:8, 3:8, 4:8, 0:8, 1:8 >> ]. %% discards every 3rd byte and trailing [ X + Y || << 1:8, Y:8, Z:8 >> <= << 1:8, 2:8, 0:8, 3:8, 4:8, 0:8, 1:8 >> ]. %% discards every 3rd byte and trailing [ X + Y || << X:8, Y:8, Z:8 >> <= << 1:8, 2:8, 0:8, 3:8, 4:8, 0:8, 1:8 >>, X =:= 1 ]. %% discards pair except matching structure with 1st byte =:= 1 Cheers, Darach. On Thu, Jan 16, 2014 at 4:58 PM, wrote: > Or! You can write: > > [ A || A = {a, _} <- Foos() ] > > Both of these examples work in Haskell also. > > Tom > > > El Jan 16, 2014, a las 11:55, amindfv@REDACTED escribi?: > > > This is intentional. I use a pattern like this a lot: > > > > -type foo :: {'a', string()} | {'b', string()}. > > > > Foos() -> [{a, "hello"}, {b, "goodbye"}]. > > > > As() -> [ S || {a, S} <- Foos() ]. % ["hello"] > > > > Tom > > > > > > El Jan 16, 2014, a las 11:39, Rich Neswold > escribi?: > > > >> Hello, > >> > >> This morning I became aware of a (powerful) feature of list > >> comprehensions. Take the following example: > >> > >> [ X + Y || {X, Y} <- L]. > >> > >> If we set L to [{1,2}, ok, {1,3}], we get the result [3,4] instead of > >> a pattern match exception (as I was expecting.) This means that list > >> comprehensions give you a "free" lists:filter/2 in the generator > >> expressions! > >> > >> I've looked through the OTP documentation, quite a few Stack Overflow > >> questions, and several list comprehension tutorials and none of them > >> explicitly state that generator expressions filter elements that don't > >> match their pattern. The web pages emphasize generators and guards are > >> like combinations of lists:map and lists:filter, which isn't exactly > >> correct. For instance, the above example is not the same as: > >> > >> lists:map(fun ({X, Y}) -> X + Y end, L). > >> > >> but is more equivalent to: > >> > >> lists:foldr(fun ({X, Y}, Acc) -> [X + Y | Acc]; > >> (_, Acc) -> Acc > >> end, [], L). > >> > >> Is this an expected, but undocumented, feature of list comprehensions? > >> Or am I in "undefined behavior" territory? > >> > >> -- > >> Rich > >> _______________________________________________ > >> 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 drormein@REDACTED Thu Jan 16 18:20:18 2014 From: drormein@REDACTED (Dror Mein) Date: Thu, 16 Jan 2014 09:20:18 -0800 (PST) Subject: [erlang-questions] flymake include dir In-Reply-To: References: <1389884442.90482.YahooMailNeo@web164504.mail.gq1.yahoo.com> Message-ID: <1389892818.26770.YahooMailNeo@web164502.mail.gq1.yahoo.com> It works! thanks On Thursday, January 16, 2014 5:33 PM, Magnus Henoch wrote: Dror Mein writes: > not completely an erlang question: > > I've tried to hack my code with the elisp from here: > > http://blog.erlware.org/2012/05/15/getting-flymake-and-rebar-to-play-nice/ I used that code earlier, and was mostly happy with it but found it somewhat slow.? (Also, it gets into an infinite loop on OSX.? You need to add "Volumes" to the list of directories not to recurse into, alongside "." and "..".)? Now I'm using the following piece of elisp, which completely ignores the Rebar configuration but gets it right for most projects I work with: (defun mh-simple-get-deps-code-path-dirs () ? ;; Why complicate things? ? (and (buffer-file-name) ? ? ? (let ((default-directory (file-name-directory (buffer-file-name)))) ? ? ? ? (file-expand-wildcards "../../*/ebin")))) (defun mh-simple-get-deps-include-dirs () ? (list "../include")) (setq erlang-flymake-get-code-path-dirs-function 'mh-simple-get-deps-code-path-dirs ? ? ? erlang-flymake-get-include-dirs-function 'mh-simple-get-deps-include-dirs) Also at: https://github.com/legoscia/dotemacs/blob/master/dotemacs.org#try-harder-to-find-include-files-in-flymake Regards, Magnus -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Thu Jan 16 18:59:20 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 16 Jan 2014 12:59:20 -0500 Subject: [erlang-questions] List comprehension question In-Reply-To: References: Message-ID: <20140116175919.GI18664@ferdair.local> Learn You Some Erlang mentions that feature! In the list comprehensions section of the first chapter (http://learnyousomeerlang.com/starting-out-for-real#list-comprehensions) the following example is used: Note that the generator expressions coupled with pattern matching also act as a filter: 6> Weather = [{toronto, rain}, {montreal, storms}, {london, fog}, 6> {paris, sun}, {boston, fog}, {vancouver, snow}]. [{toronto,rain}, {montreal,storms}, {london,fog}, {paris,sun}, {boston,fog}, {vancouver,snow}] 7> FoggyPlaces = [X || {X, fog} <- Weather]. [london,boston] If an element of the list 'Weather' doesn't match the {X, fog} pattern, it's simply ignored in the list comprehension whereas the = operator would have thrown an exception. Binary comprehensions are introduced in the same chapter. Regards, Fred. On 01/16, Rich Neswold wrote: > Hello, > > This morning I became aware of a (powerful) feature of list > comprehensions. Take the following example: > > [ X + Y || {X, Y} <- L]. > > If we set L to [{1,2}, ok, {1,3}], we get the result [3,4] instead of > a pattern match exception (as I was expecting.) This means that list > comprehensions give you a "free" lists:filter/2 in the generator > expressions! > > I've looked through the OTP documentation, quite a few Stack Overflow > questions, and several list comprehension tutorials and none of them > explicitly state that generator expressions filter elements that don't > match their pattern. The web pages emphasize generators and guards are > like combinations of lists:map and lists:filter, which isn't exactly > correct. For instance, the above example is not the same as: > > lists:map(fun ({X, Y}) -> X + Y end, L). > > but is more equivalent to: > > lists:foldr(fun ({X, Y}, Acc) -> [X + Y | Acc]; > (_, Acc) -> Acc > end, [], L). > > Is this an expected, but undocumented, feature of list comprehensions? > Or am I in "undefined behavior" territory? > > -- > Rich > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From vladimir.kirichenko@REDACTED Thu Jan 16 19:41:15 2014 From: vladimir.kirichenko@REDACTED (Volodymyr Kyrychenko) Date: Thu, 16 Jan 2014 20:41:15 +0200 Subject: [erlang-questions] [ANN] ebt - erlang build tool Message-ID: <52D827CB.6040105@gmail.com> Hello, Erlangers EBT is tool for building erlang project with dependency management. Features: * build projects based on OTP Design principles * multimodule projects support * dependencies with http repositories * binary (EZ) packages * otp releases * multiple build profiles support * multiple build configuration hierarchies Any critics, discussions, suggestions, and help will be appreciated. Sources: https://github.com/vladimirk/ebt Tutorial: https://github.com/vladimirk/ebt/blob/develop/README.md Repo with some opensource packages: http://code.google.com/p/erlang-build-tool/downloads/list Public build service is on the way, but here some configs for well known libraries and some scripts those could be easily deployed for building private repository: https://github.com/vladimirk/ebt-build-service/tree/master/projects Discussion group: https://groups.google.com/forum/#!forum/erlang-build-tool Help with repository hosting will be very appreciated! Enjoy! -- Volodymyr Kyrychenko From sean@REDACTED Thu Jan 16 19:15:46 2014 From: sean@REDACTED (Sean Cribbs) Date: Thu, 16 Jan 2014 12:15:46 -0600 Subject: [erlang-questions] Proposal: reinstate pre-built PLT for Dialyzer Message-ID: Hi Erlangers, Ages ago, OTP shipped with a pre-built PLT for dialyzer, which was removed reasons forgotten by most of us (probably the time/cost of building it). Nowadays, because dialyzer is much improved (parallelism!) and our computers are faster and have more cores, a PLT for all of the standard library might only take a few minutes to build. We've been increasing our usage of dialyzer at Basho and I have felt that it seems extremely wasteful and unnecessary to build a partial PLT of the standard library for every single project, when that information only changes across OTP releases. I feel the Erlang/OTP build process should include building a PLT that encompasses the entire standard library. Aside from the reduced cost of building PLTs for every different app, this may encourage others to start using dialyzer on their projects. I'm offering to do the work to make this happen, but I need a little guidance on where to start. I've looked at the dialyzer Makefile from an older release where the PLT was included, but I'm concerned the project structure has changed enough that the rules there no longer apply. It seems the dialyzer runtime itself might also need to be tweaked to automatically include the prebuilt PLT. Looking forward to hearing your thoughts and direction. Cheers! -- Sean Cribbs Software Engineer Basho Technologies, Inc. http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.neswold@REDACTED Thu Jan 16 21:20:17 2014 From: rich.neswold@REDACTED (Rich Neswold) Date: Thu, 16 Jan 2014 14:20:17 -0600 Subject: [erlang-questions] List comprehension question In-Reply-To: <20140116175919.GI18664@ferdair.local> References: <20140116175919.GI18664@ferdair.local> Message-ID: On Thu, Jan 16, 2014 at 11:59 AM, Fred Hebert wrote: > Learn You Some Erlang mentions that feature! Excellent! How did I miss it?!? Thanks for the link, -- Rich From rich.neswold@REDACTED Thu Jan 16 21:23:37 2014 From: rich.neswold@REDACTED (Rich Neswold) Date: Thu, 16 Jan 2014 14:23:37 -0600 Subject: [erlang-questions] List comprehension question In-Reply-To: References: <4AA83BCF-6A32-43B9-929F-818A52A677AE@gmail.com> Message-ID: On Thu, Jan 16, 2014 at 11:16 AM, Darach Ennis wrote: > Similarly, bit comprehensions can benefit also, but not as useful and > flexibly as the list comprehension case: Wow! Thanks for the examples! I know some code I wrote that could benefit from this, as well. -- Rich From daniel.goertzen@REDACTED Thu Jan 16 23:50:29 2014 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Thu, 16 Jan 2014 16:50:29 -0600 Subject: [erlang-questions] r17a or updated maps branch? Message-ID: I would like to do some development using the maps feature from the branch "egil/maps/eep-implementation", however that branch seems to have inherited some crypto breakage from wherever it was branched from. Is there going to be a R17A release soon? If not, is there a chance we could have updates merged into egil/maps/eep-implementation? Or a rebase onto something more stable? I know, I know, this is an experimental feature and I'm not supposed to using it yet. :) But my release target is many months away and the benefits of maps for this project outweigh the hazards of its experimental status. Thanks, Dan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidnwelton@REDACTED Fri Jan 17 09:44:58 2014 From: davidnwelton@REDACTED (David Welton) Date: Fri, 17 Jan 2014 09:44:58 +0100 Subject: [erlang-questions] Fwd: [ANN] ErlyDTL 0.8.0 In-Reply-To: References: Message-ID: > I am honored to take over ErlyDTL after Evan [2], and I am looking forward > to work with the community to keep on improving the project up to and beyond > our 1.0 milestone. Thanks for taking that on! That code is very important to anyone doing 'web stuff' with Erlang. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From davidnwelton@REDACTED Fri Jan 17 10:17:02 2014 From: davidnwelton@REDACTED (David Welton) Date: Fri, 17 Jan 2014 10:17:02 +0100 Subject: [erlang-questions] Mixing casts and calls Message-ID: Hi, I am working with a system that looks like this: C node <=======> Erlang <========> Java Node And we're looking at good ways to integrate everything. For instance, we want the Java node to be able to do a simple query that ends up getting some data from the C node, say, the version it's running or something like that. Since the Java code needs to be simple, we want to do the equivalent of rpc:call(hw_server, get_version, []) and wait for the answer. It shouldn't take long, and timeouts or whatever can be handled by Java in that case. However, to interact with the C node, the gen_server that manages it would want to do something like: {any, 'c@REDACTED'} ! get_version And then get the answer via handle_info. But if we're going to transform what is essentiall a 'call' - hw_server:get_version() - into a cast/response, somewhere there's got to be a receive. For instance: get_version() -> Ref = make_ref(), gen_server:cast(hw_server, {get_version, Ref}), receive {Ref, version, Version} -> Version end This feels like I've left OTP behind though. We could put the receive in the handle_cast for the gen_server, but then that's going to block the whole thing on one call, which strikes me as a bad idea, although I guess it could also be used to protect the C node if it were unable to process more than one thing at once. Another approach would be to further work with our Java guy to have him send and receive the messages, but we were kind of hoping to hide some of the complexity from that part of the system. Thank you, -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From rtrlists@REDACTED Fri Jan 17 10:37:44 2014 From: rtrlists@REDACTED (Robert Raschke) Date: Fri, 17 Jan 2014 09:37:44 +0000 Subject: [erlang-questions] Mixing casts and calls In-Reply-To: References: Message-ID: Hi David, sounds a bit like you want to treat your C node as a resource, and that's a perfect match for a gen_server. I would simply hide all interaction with the C node *inside* the gen_server. Your send/receive to the C node could therefore be handled completely inside a gen_server call. You would still have the top level function get_version(), but that would only do the gen_server:call, and the handle_call then does the send to the C node and waits for the answer with a receive. Hoe that makes sense, Robby On 17 January 2014 09:17, David Welton wrote: > Hi, > > I am working with a system that looks like this: > > C node <=======> Erlang <========> Java Node > > And we're looking at good ways to integrate everything. > > For instance, we want the Java node to be able to do a simple query > that ends up getting some data from the C node, say, the version it's > running or something like that. > > Since the Java code needs to be simple, we want to do the equivalent > of rpc:call(hw_server, get_version, []) and wait for the answer. It > shouldn't take long, and timeouts or whatever can be handled by Java > in that case. > > However, to interact with the C node, the gen_server that manages it > would want to do something like: > > {any, 'c@REDACTED'} ! get_version > > And then get the answer via handle_info. > > But if we're going to transform what is essentiall a 'call' - > hw_server:get_version() - into a cast/response, somewhere there's got > to be a receive. For instance: > > get_version() -> > Ref = make_ref(), > gen_server:cast(hw_server, {get_version, Ref}), > receive > {Ref, version, Version} -> > Version > end > > This feels like I've left OTP behind though. > > We could put the receive in the handle_cast for the gen_server, but > then that's going to block the whole thing on one call, which strikes > me as a bad idea, although I guess it could also be used to protect > the C node if it were unable to process more than one thing at once. > > Another approach would be to further work with our Java guy to have > him send and receive the messages, but we were kind of hoping to hide > some of the complexity from that part of the system. > > Thank you, > -- > David N. Welton > > http://www.welton.it/davidw/ > > http://www.dedasys.com/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.abrahamsson@REDACTED Fri Jan 17 10:27:58 2014 From: daniel.abrahamsson@REDACTED (Daniel Abrahamsson) Date: Fri, 17 Jan 2014 10:27:58 +0100 Subject: [erlang-questions] Mixing casts and calls In-Reply-To: References: Message-ID: Assuming your Erlang node handles the RPC call from the Java node with a gen_server, why not respond with {no_reply, ...} to the Java-server, send an asynchronous request to the C-server, handle the response in a handle_info, and then reply to the Java-server with gen_server:reply/2? This way, you leave all the timeout handling to the Java-node. The issue with this approach is that you must find a way to preserve the >From argument to your handle_call callback, so that you can pass it on to gen_server:reply/2 at a later stage, but that might be an easier problem to solve. //Daniel On Fri, Jan 17, 2014 at 10:17 AM, David Welton wrote: > Hi, > > I am working with a system that looks like this: > > C node <=======> Erlang <========> Java Node > > And we're looking at good ways to integrate everything. > > For instance, we want the Java node to be able to do a simple query > that ends up getting some data from the C node, say, the version it's > running or something like that. > > Since the Java code needs to be simple, we want to do the equivalent > of rpc:call(hw_server, get_version, []) and wait for the answer. It > shouldn't take long, and timeouts or whatever can be handled by Java > in that case. > > However, to interact with the C node, the gen_server that manages it > would want to do something like: > > {any, 'c@REDACTED'} ! get_version > > And then get the answer via handle_info. > > But if we're going to transform what is essentiall a 'call' - > hw_server:get_version() - into a cast/response, somewhere there's got > to be a receive. For instance: > > get_version() -> > Ref = make_ref(), > gen_server:cast(hw_server, {get_version, Ref}), > receive > {Ref, version, Version} -> > Version > end > > This feels like I've left OTP behind though. > > We could put the receive in the handle_cast for the gen_server, but > then that's going to block the whole thing on one call, which strikes > me as a bad idea, although I guess it could also be used to protect > the C node if it were unable to process more than one thing at once. > > Another approach would be to further work with our Java guy to have > him send and receive the messages, but we were kind of hoping to hide > some of the complexity from that part of the system. > > Thank you, > -- > David N. Welton > > http://www.welton.it/davidw/ > > http://www.dedasys.com/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Fri Jan 17 11:26:50 2014 From: elbrujohalcon@REDACTED (Brujo Benavides @ Inaka) Date: Fri, 17 Jan 2014 07:26:50 -0300 Subject: [erlang-questions] Mixing casts and calls In-Reply-To: References: Message-ID: <309F8980-83AD-48F0-8D97-034E5B9E28AA@inaka.net> Hi David, I?m not sure, but you might be interested in using this library on your Java node: https://github.com/inaka/jinterface_stdlib It provides abstract classes like OtpGenServer with which you can implement ?gen_servers? in Java and then you can just use gen_server:call or gen_server:cast from your Erlang node to communicate with them. On Jan 17, 2014, at 6:17, David Welton wrote: > Hi, > > I am working with a system that looks like this: > > C node <=======> Erlang <========> Java Node > > And we're looking at good ways to integrate everything. > > For instance, we want the Java node to be able to do a simple query > that ends up getting some data from the C node, say, the version it's > running or something like that. > > Since the Java code needs to be simple, we want to do the equivalent > of rpc:call(hw_server, get_version, []) and wait for the answer. It > shouldn't take long, and timeouts or whatever can be handled by Java > in that case. > > However, to interact with the C node, the gen_server that manages it > would want to do something like: > > {any, 'c@REDACTED'} ! get_version > > And then get the answer via handle_info. > > But if we're going to transform what is essentiall a 'call' - > hw_server:get_version() - into a cast/response, somewhere there's got > to be a receive. For instance: > > get_version() -> > Ref = make_ref(), > gen_server:cast(hw_server, {get_version, Ref}), > receive > {Ref, version, Version} -> > Version > end > > This feels like I've left OTP behind though. > > We could put the receive in the handle_cast for the gen_server, but > then that's going to block the whole thing on one call, which strikes > me as a bad idea, although I guess it could also be used to protect > the C node if it were unable to process more than one thing at once. > > Another approach would be to further work with our Java guy to have > him send and receive the messages, but we were kind of hoping to hide > some of the complexity from that part of the system. > > Thank you, > -- > David N. Welton > > http://www.welton.it/davidw/ > > http://www.dedasys.com/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From Alexey.Saltanov@REDACTED Fri Jan 17 11:37:30 2014 From: Alexey.Saltanov@REDACTED (Saltanov, Alexey) Date: Fri, 17 Jan 2014 10:37:30 +0000 Subject: [erlang-questions] Erlang node crashes due to message queue despite the large amount of free memory. Message-ID: <0589296B5BCDDA4A8F5CEB3F8739A81576F0B734@SRV-EXCHMBX2.billing.ru> I have simple Erlang echo server: loop() -> receive {From, Request} -> erlang:send(From, Request), loop() end. This echo server started on the Server1. And I have some client application (Basho Bench test): run(send, _KeyGen, ValueGen, State) -> Msg = ValueGen(), erlang:send(State#state.address, {{State#state.reg_name, node()}, {self(), Msg}}), {ok, State}. Wihich sends many messages to the echo server. When I started client application on the Server2 I've found the crash of the echo server. =erl_crash_dump:0.2 Wed Jan 15 17:04:26 2014 Slogan: eheap_alloc: Cannot allocate 949152844 bytes of memory (of type "heap"). System version: Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] [smp:8:8] [async-threads:10] [kernel-poll:false] Compiled: Wed Dec 11 16:19:29 2013 Taints: crypto Atoms: 16134 =memory total: 4131605472 processes: 2386433264 processes_used: 2386409264 system: 1745172208 atom: 463441 atom_used: 446760 binary: 501624 code: 11870105 ets: 274696 low: 3429068696 But the Server1 had 30 Gb free RAM and 16 Gb free swap space before I started the echo server, and I saw with the "top" command that my echo server allocated only 5 Gb RAM and really used only about 2 Gb. Why the message queue cannot use more server memory? Some information about the Server1 configuration. $ uname -a Linux 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux $ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.3 (Santiago) $ top top - 12:27:01 up 2 days, 22:14, 1 user, load average: 0.00, 0.00, 0.00 Tasks: 310 total, 1 running, 309 sleeping, 0 stopped, 0 zombie Cpu(s): 0.1%us, 0.1%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 33011268k total, 868152k used, 32143116k free, 132708k buffers Swap: 16777208k total, 0k used, 16777208k free, 172772k cached I also tested memory allocation for the big binary data on the same Server1 node: Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] [smp:8:8] [async-threads:10] [kernel-poll:false] Eshell V5.10.3 (abort with ^G) 1> Z1=fun(N)-> X=lists:map(fun(I)-> binary:copy(<<1>>,1073741824) end, lists:seq(1,N)), io:format("mem: ~p~n", [memory()]), length(X) end. #Fun 2> Z1(10). mem: [{total,10758494488}, {processes,4659176}, {processes_used,4659176}, {system,10753835312}, {atom,194289}, {atom_used,174684}, {binary,10737518424}, {code,4012558}, {ets,172744}, {low,4057440}] 10 3>Z2=fun(N)-> X=lists:map(fun(I)-> binary:copy(<<1>>,1024) end, lists:seq(1,N)), io:format("mem: ~p~n", [memory()]), length(X) end. #Fun 4>Z2(10485760). 4> Z2(10485760). mem: [{total,11973197304}, {processes,795606312}, {processes_used,795606312}, {system,11177590992}, {atom,194289}, {atom_used,174744}, {binary,11161273768}, {code,4012558}, {ets,172744}, {low,4057440}] 10485760 And this test completed successfully. But on the same server my echo server crashes when it is used only 4 Gb of the memory. Has the messages queue its own limit? -------------- next part -------------- An HTML attachment was scrubbed... URL: From valentin@REDACTED Fri Jan 17 12:52:02 2014 From: valentin@REDACTED (Valentin Micic) Date: Fri, 17 Jan 2014 13:52:02 +0200 Subject: [erlang-questions] Erlang node crashes due to message queue despite the large amount of free memory. In-Reply-To: <0589296B5BCDDA4A8F5CEB3F8739A81576F0B734@SRV-EXCHMBX2.billing.ru> References: <0589296B5BCDDA4A8F5CEB3F8739A81576F0B734@SRV-EXCHMBX2.billing.ru> Message-ID: Have you considered switching from 32-bit erlang to 64-bit? V/ On 17 Jan 2014, at 12:37 PM, Saltanov, Alexey wrote: > I have simple Erlang echo server: > loop() -> > receive > {From, Request} -> > erlang:send(From, Request), > loop() > end. > This echo server started on the Server1. > > And I have some client application (Basho Bench test): > run(send, _KeyGen, ValueGen, State) -> > Msg = ValueGen(), > erlang:send(State#state.address, {{State#state.reg_name, node()}, {self(), Msg}}), > {ok, State}. > Wihich sends many messages to the echo server. > > When I started client application on the Server2 I've found the crash of the echo server. > =erl_crash_dump:0.2 > Wed Jan 15 17:04:26 2014 > Slogan: eheap_alloc: Cannot allocate 949152844 bytes of memory (of type "heap"). > System version: Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] [smp:8:8] [async-threads:10] [kernel-poll:false] > Compiled: Wed Dec 11 16:19:29 2013 > Taints: crypto > Atoms: 16134 > =memory > total: 4131605472 > processes: 2386433264 > processes_used: 2386409264 > system: 1745172208 > atom: 463441 > atom_used: 446760 > binary: 501624 > code: 11870105 > ets: 274696 > low: 3429068696 > > But the Server1 had 30 Gb free RAM and 16 Gb free swap space before I started the echo server, > and I saw with the "top" command that my echo server allocated only 5 Gb RAM and really used only about 2 Gb. > Why the message queue cannot use more server memory? > > Some information about the Server1 configuration. > $ uname -a > Linux 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux > > $ cat /etc/redhat-release > Red Hat Enterprise Linux Server release 6.3 (Santiago) > > $ top > top - 12:27:01 up 2 days, 22:14, 1 user, load average: 0.00, 0.00, 0.00 > Tasks: 310 total, 1 running, 309 sleeping, 0 stopped, 0 zombie > Cpu(s): 0.1%us, 0.1%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st > Mem: 33011268k total, 868152k used, 32143116k free, 132708k buffers > Swap: 16777208k total, 0k used, 16777208k free, 172772k cached > > I also tested memory allocation for the big binary data on the same Server1 node: > Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] [smp:8:8] [async-threads:10] [kernel-poll:false] > Eshell V5.10.3 (abort with ^G) > 1> Z1=fun(N)-> X=lists:map(fun(I)-> binary:copy(<<1>>,1073741824) end, lists:seq(1,N)), io:format("mem: ~p~n", [memory()]), length(X) end. > #Fun > 2> Z1(10). > mem: [{total,10758494488}, > {processes,4659176}, > {processes_used,4659176}, > {system,10753835312}, > {atom,194289}, > {atom_used,174684}, > {binary,10737518424}, > {code,4012558}, > {ets,172744}, > {low,4057440}] > 10 > 3>Z2=fun(N)-> X=lists:map(fun(I)-> binary:copy(<<1>>,1024) end, lists:seq(1,N)), io:format("mem: ~p~n", [memory()]), length(X) end. > #Fun > 4>Z2(10485760). > 4> Z2(10485760). > mem: [{total,11973197304}, > {processes,795606312}, > {processes_used,795606312}, > {system,11177590992}, > {atom,194289}, > {atom_used,174744}, > {binary,11161273768}, > {code,4012558}, > {ets,172744}, > {low,4057440}] > 10485760 > > And this test completed successfully. But on the same server my echo server crashes when it is used only 4 Gb of the memory. > Has the messages queue its own limit? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From me@REDACTED Fri Jan 17 12:56:42 2014 From: me@REDACTED (Xiao Jia) Date: Fri, 17 Jan 2014 19:56:42 +0800 Subject: [erlang-questions] internal error in lint_module Message-ID: (I posted this to erlang-bugs as well, but it may deserve some discussions here.) I was writing a parse_transform module using erl_syntax_lib:mapfold, but both R16B03 and R15B03-1 give the following error even if the parse_transform module does nothing: z.erl:none: internal error in lint_module; crash reason: {badarg,[{erl_scan,set_attr, [line,function,#Fun], [{file,"erl_scan.erl"},{line,418}]}, ... (see https://gist.github.com/stfairy/8471800 for full error) File z.erl: -module(z). -compile({parse_transform, zt}). -export([f/1]). f(_) -> z. File zt.erl: -module(zt). -export([parse_transform/2]). parse_transform(AST, _Options) -> [parse(T) || T <- AST]. parse({function, _, _, _, _} = T) -> case erl_syntax_lib:mapfold(fun foobar/2, something, T) of {T1, _} -> T1; _ -> T end; parse(T) -> T. foobar(T, S) -> {T, S}. $ erlc zt.erl $ erlc -pa . z.erl btw, I am a little confused why parse_transform modules are usually named as "zt"... -- Regards, Xiao Jia From me@REDACTED Fri Jan 17 13:01:00 2014 From: me@REDACTED (Xiao Jia) Date: Fri, 17 Jan 2014 20:01:00 +0800 Subject: [erlang-questions] Erlang node crashes due to message queue despite the large amount of free memory. In-Reply-To: References: <0589296B5BCDDA4A8F5CEB3F8739A81576F0B734@SRV-EXCHMBX2.billing.ru> Message-ID: > Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] [smp:8:8] > [async-threads:10] [kernel-poll:false] Try to compile a 64-bit version instead, *without* halfword. I encountered a similar error with R15 long time ago. From Alexey.Saltanov@REDACTED Fri Jan 17 13:04:35 2014 From: Alexey.Saltanov@REDACTED (Saltanov, Alexey) Date: Fri, 17 Jan 2014 12:04:35 +0000 Subject: [erlang-questions] Erlang node crashes due to message queue despite the large amount of free memory. In-Reply-To: References: <0589296B5BCDDA4A8F5CEB3F8739A81576F0B734@SRV-EXCHMBX2.billing.ru> Message-ID: <0589296B5BCDDA4A8F5CEB3F8739A81576F0B9F8@SRV-EXCHMBX2.billing.ru> Erlang builds 64-bit by default on the x86_64. From: Valentin Micic [mailto:valentin@REDACTED] Sent: Friday, January 17, 2014 3:52 PM To: Saltanov, Alexey Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Erlang node crashes due to message queue despite the large amount of free memory. Have you considered switching from 32-bit erlang to 64-bit? V/ On 17 Jan 2014, at 12:37 PM, Saltanov, Alexey wrote: I have simple Erlang echo server: loop() -> receive {From, Request} -> erlang:send(From, Request), loop() end. This echo server started on the Server1. And I have some client application (Basho Bench test): run(send, _KeyGen, ValueGen, State) -> Msg = ValueGen(), erlang:send(State#state.address, {{State#state.reg_name, node()}, {self(), Msg}}), {ok, State}. Wihich sends many messages to the echo server. When I started client application on the Server2 I've found the crash of the echo server. =erl_crash_dump:0.2 Wed Jan 15 17:04:26 2014 Slogan: eheap_alloc: Cannot allocate 949152844 bytes of memory (of type "heap"). System version: Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] [smp:8:8] [async-threads:10] [kernel-poll:false] Compiled: Wed Dec 11 16:19:29 2013 Taints: crypto Atoms: 16134 =memory total: 4131605472 processes: 2386433264 processes_used: 2386409264 system: 1745172208 atom: 463441 atom_used: 446760 binary: 501624 code: 11870105 ets: 274696 low: 3429068696 But the Server1 had 30 Gb free RAM and 16 Gb free swap space before I started the echo server, and I saw with the "top" command that my echo server allocated only 5 Gb RAM and really used only about 2 Gb. Why the message queue cannot use more server memory? Some information about the Server1 configuration. $ uname -a Linux 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux $ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.3 (Santiago) $ top top - 12:27:01 up 2 days, 22:14, 1 user, load average: 0.00, 0.00, 0.00 Tasks: 310 total, 1 running, 309 sleeping, 0 stopped, 0 zombie Cpu(s): 0.1%us, 0.1%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 33011268k total, 868152k used, 32143116k free, 132708k buffers Swap: 16777208k total, 0k used, 16777208k free, 172772k cached I also tested memory allocation for the big binary data on the same Server1 node: Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] [smp:8:8] [async-threads:10] [kernel-poll:false] Eshell V5.10.3 (abort with ^G) 1> Z1=fun(N)-> X=lists:map(fun(I)-> binary:copy(<<1>>,1073741824) end, lists:seq(1,N)), io:format("mem: ~p~n", [memory()]), length(X) end. #Fun 2> Z1(10). mem: [{total,10758494488}, {processes,4659176}, {processes_used,4659176}, {system,10753835312}, {atom,194289}, {atom_used,174684}, {binary,10737518424}, {code,4012558}, {ets,172744}, {low,4057440}] 10 3>Z2=fun(N)-> X=lists:map(fun(I)-> binary:copy(<<1>>,1024) end, lists:seq(1,N)), io:format("mem: ~p~n", [memory()]), length(X) end. #Fun 4>Z2(10485760). 4> Z2(10485760). mem: [{total,11973197304}, {processes,795606312}, {processes_used,795606312}, {system,11177590992}, {atom,194289}, {atom_used,174744}, {binary,11161273768}, {code,4012558}, {ets,172744}, {low,4057440}] 10485760 And this test completed successfully. But on the same server my echo server crashes when it is used only 4 Gb of the memory. Has the messages queue its own limit? _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Fri Jan 17 14:01:58 2014 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 17 Jan 2014 14:01:58 +0100 Subject: [erlang-questions] Erlang node crashes due to message queue despite the large amount of free memory. In-Reply-To: <0589296B5BCDDA4A8F5CEB3F8739A81576F0B734@SRV-EXCHMBX2.billing.ru> References: <0589296B5BCDDA4A8F5CEB3F8739A81576F0B734@SRV-EXCHMBX2.billing.ru> Message-ID: Hello, As Xiao Jia pointed out, the problem is that you are running the halfword emulator. In the halfword emulator a tradeoff is made where all term pointers are shrunk to 32 bit and thus the memory footprint shrinks, however as a consequence of this the total memory of all process heaps cannot be greater than 4GB. It is this limit that you are hitting. The halfword emulator is mainly useful when you have a lot of data in ets tables, and not so much in the process heap. Lukas On Fri, Jan 17, 2014 at 11:37 AM, Saltanov, Alexey < Alexey.Saltanov@REDACTED> wrote: > I have simple Erlang echo server: > loop() -> > receive > {From, Request} -> > erlang:send(From, Request), > loop() > end. > This echo server started on the Server1. > > And I have some client application (Basho Bench test): > run(send, _KeyGen, ValueGen, State) -> > Msg = ValueGen(), > erlang:send(State#state.address, {{State#state.reg_name, node()}, > {self(), Msg}}), > {ok, State}. > Wihich sends many messages to the echo server. > > When I started client application on the Server2 I've found the crash of > the echo server. > =erl_crash_dump:0.2 > Wed Jan 15 17:04:26 2014 > Slogan: eheap_alloc: Cannot allocate 949152844 bytes of memory (of type > "heap"). > System version: Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] > [smp:8:8] [async-threads:10] [kernel-poll:false] > Compiled: Wed Dec 11 16:19:29 2013 > Taints: crypto > Atoms: 16134 > =memory > total: 4131605472 > processes: 2386433264 > processes_used: 2386409264 > system: 1745172208 > atom: 463441 > atom_used: 446760 > binary: 501624 > code: 11870105 > ets: 274696 > low: 3429068696 > > But the Server1 had 30 Gb free RAM and 16 Gb free swap space before I > started the echo server, > and I saw with the "top" command that my echo server allocated only 5 Gb > RAM and really used only about 2 Gb. > Why the message queue cannot use more server memory? > > Some information about the Server1 configuration. > $ uname -a > Linux 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 > x86_64 x86_64 GNU/Linux > > $ cat /etc/redhat-release > Red Hat Enterprise Linux Server release 6.3 (Santiago) > > $ top > top - 12:27:01 up 2 days, 22:14, 1 user, load average: 0.00, 0.00, 0.00 > Tasks: 310 total, 1 running, 309 sleeping, 0 stopped, 0 zombie > Cpu(s): 0.1%us, 0.1%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, > 0.0%st > Mem: 33011268k total, 868152k used, 32143116k free, 132708k buffers > Swap: 16777208k total, 0k used, 16777208k free, 172772k cached > > I also tested memory allocation for the big binary data on the same > Server1 node: > Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] [smp:8:8] > [async-threads:10] [kernel-poll:false] > Eshell V5.10.3 (abort with ^G) > 1> Z1=fun(N)-> X=lists:map(fun(I)-> binary:copy(<<1>>,1073741824) end, > lists:seq(1,N)), io:format("mem: ~p~n", [memory()]), length(X) end. > #Fun > 2> Z1(10). > mem: [{total,10758494488}, > {processes,4659176}, > {processes_used,4659176}, > {system,10753835312}, > {atom,194289}, > {atom_used,174684}, > {binary,10737518424}, > {code,4012558}, > {ets,172744}, > {low,4057440}] > 10 > 3>Z2=fun(N)-> X=lists:map(fun(I)-> binary:copy(<<1>>,1024) end, > lists:seq(1,N)), io:format("mem: ~p~n", [memory()]), length(X) end. > #Fun > 4>Z2(10485760). > 4> Z2(10485760). > mem: [{total,11973197304}, > {processes,795606312}, > {processes_used,795606312}, > {system,11177590992}, > {atom,194289}, > {atom_used,174744}, > {binary,11161273768}, > {code,4012558}, > {ets,172744}, > {low,4057440}] > 10485760 > > And this test completed successfully. But on the same server my echo > server crashes when it is used only 4 Gb of the memory. > Has the messages queue its own limit? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alexey.Saltanov@REDACTED Fri Jan 17 14:07:40 2014 From: Alexey.Saltanov@REDACTED (Saltanov, Alexey) Date: Fri, 17 Jan 2014 13:07:40 +0000 Subject: [erlang-questions] Erlang node crashes due to message queue despite the large amount of free memory. In-Reply-To: References: <0589296B5BCDDA4A8F5CEB3F8739A81576F0B734@SRV-EXCHMBX2.billing.ru> Message-ID: <0589296B5BCDDA4A8F5CEB3F8739A81576F0BA65@SRV-EXCHMBX2.billing.ru> Thank you! I will try to compile Erlang without halfword and try the my test again. But I have one more question. How could I allocate 10 Gb and 20 Gb memory for binary data on the same node? From: garazdawi@REDACTED [mailto:garazdawi@REDACTED] On Behalf Of Lukas Larsson Sent: Friday, January 17, 2014 5:02 PM To: Saltanov, Alexey Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Erlang node crashes due to message queue despite the large amount of free memory. Hello, As Xiao Jia pointed out, the problem is that you are running the halfword emulator. In the halfword emulator a tradeoff is made where all term pointers are shrunk to 32 bit and thus the memory footprint shrinks, however as a consequence of this the total memory of all process heaps cannot be greater than 4GB. It is this limit that you are hitting. The halfword emulator is mainly useful when you have a lot of data in ets tables, and not so much in the process heap. Lukas On Fri, Jan 17, 2014 at 11:37 AM, Saltanov, Alexey > wrote: I have simple Erlang echo server: loop() -> receive {From, Request} -> erlang:send(From, Request), loop() end. This echo server started on the Server1. And I have some client application (Basho Bench test): run(send, _KeyGen, ValueGen, State) -> Msg = ValueGen(), erlang:send(State#state.address, {{State#state.reg_name, node()}, {self(), Msg}}), {ok, State}. Wihich sends many messages to the echo server. When I started client application on the Server2 I've found the crash of the echo server. =erl_crash_dump:0.2 Wed Jan 15 17:04:26 2014 Slogan: eheap_alloc: Cannot allocate 949152844 bytes of memory (of type "heap"). System version: Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] [smp:8:8] [async-threads:10] [kernel-poll:false] Compiled: Wed Dec 11 16:19:29 2013 Taints: crypto Atoms: 16134 =memory total: 4131605472 processes: 2386433264 processes_used: 2386409264 system: 1745172208 atom: 463441 atom_used: 446760 binary: 501624 code: 11870105 ets: 274696 low: 3429068696 But the Server1 had 30 Gb free RAM and 16 Gb free swap space before I started the echo server, and I saw with the "top" command that my echo server allocated only 5 Gb RAM and really used only about 2 Gb. Why the message queue cannot use more server memory? Some information about the Server1 configuration. $ uname -a Linux 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux $ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.3 (Santiago) $ top top - 12:27:01 up 2 days, 22:14, 1 user, load average: 0.00, 0.00, 0.00 Tasks: 310 total, 1 running, 309 sleeping, 0 stopped, 0 zombie Cpu(s): 0.1%us, 0.1%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 33011268k total, 868152k used, 32143116k free, 132708k buffers Swap: 16777208k total, 0k used, 16777208k free, 172772k cached I also tested memory allocation for the big binary data on the same Server1 node: Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] [smp:8:8] [async-threads:10] [kernel-poll:false] Eshell V5.10.3 (abort with ^G) 1> Z1=fun(N)-> X=lists:map(fun(I)-> binary:copy(<<1>>,1073741824) end, lists:seq(1,N)), io:format("mem: ~p~n", [memory()]), length(X) end. #Fun 2> Z1(10). mem: [{total,10758494488}, {processes,4659176}, {processes_used,4659176}, {system,10753835312}, {atom,194289}, {atom_used,174684}, {binary,10737518424}, {code,4012558}, {ets,172744}, {low,4057440}] 10 3>Z2=fun(N)-> X=lists:map(fun(I)-> binary:copy(<<1>>,1024) end, lists:seq(1,N)), io:format("mem: ~p~n", [memory()]), length(X) end. #Fun 4>Z2(10485760). 4> Z2(10485760). mem: [{total,11973197304}, {processes,795606312}, {processes_used,795606312}, {system,11177590992}, {atom,194289}, {atom_used,174744}, {binary,11161273768}, {code,4012558}, {ets,172744}, {low,4057440}] 10485760 And this test completed successfully. But on the same server my echo server crashes when it is used only 4 Gb of the memory. Has the messages queue its own limit? _______________________________________________ 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 Fri Jan 17 14:15:24 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Fri, 17 Jan 2014 15:15:24 +0200 Subject: [erlang-questions] erlang pg client and redshift Message-ID: <15FCA410-230A-4620-9A13-518DC1461DA0@gmail.com> Hello, Does any one successfully used AWS RedShift from Erlang. It uses postgres as an interface. I've been trying to use following Erlang libraries: https://github.com/wg/epgsql https://github.com/semiocast/pgsql None of them works reliably. The SSL connection is terminated while query runs. However, native sql works fine. - Dmitry From Alexey.Saltanov@REDACTED Fri Jan 17 14:20:09 2014 From: Alexey.Saltanov@REDACTED (Saltanov, Alexey) Date: Fri, 17 Jan 2014 13:20:09 +0000 Subject: [erlang-questions] Erlang node crashes due to message queue despite the large amount of free memory. In-Reply-To: <0589296B5BCDDA4A8F5CEB3F8739A81576F0BA65@SRV-EXCHMBX2.billing.ru> References: <0589296B5BCDDA4A8F5CEB3F8739A81576F0B734@SRV-EXCHMBX2.billing.ru> <0589296B5BCDDA4A8F5CEB3F8739A81576F0BA65@SRV-EXCHMBX2.billing.ru> Message-ID: <0589296B5BCDDA4A8F5CEB3F8739A81576F0BA9A@SRV-EXCHMBX2.billing.ru> I have got it. I allocated chunks not more than 1 Gb each one and I think that is an answer for my question. From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Saltanov, Alexey Sent: Friday, January 17, 2014 5:08 PM To: Lukas Larsson Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Erlang node crashes due to message queue despite the large amount of free memory. Thank you! I will try to compile Erlang without halfword and try the my test again. But I have one more question. How could I allocate 10 Gb and 20 Gb memory for binary data on the same node? From: garazdawi@REDACTED [mailto:garazdawi@REDACTED] On Behalf Of Lukas Larsson Sent: Friday, January 17, 2014 5:02 PM To: Saltanov, Alexey Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Erlang node crashes due to message queue despite the large amount of free memory. Hello, As Xiao Jia pointed out, the problem is that you are running the halfword emulator. In the halfword emulator a tradeoff is made where all term pointers are shrunk to 32 bit and thus the memory footprint shrinks, however as a consequence of this the total memory of all process heaps cannot be greater than 4GB. It is this limit that you are hitting. The halfword emulator is mainly useful when you have a lot of data in ets tables, and not so much in the process heap. Lukas On Fri, Jan 17, 2014 at 11:37 AM, Saltanov, Alexey > wrote: I have simple Erlang echo server: loop() -> receive {From, Request} -> erlang:send(From, Request), loop() end. This echo server started on the Server1. And I have some client application (Basho Bench test): run(send, _KeyGen, ValueGen, State) -> Msg = ValueGen(), erlang:send(State#state.address, {{State#state.reg_name, node()}, {self(), Msg}}), {ok, State}. Wihich sends many messages to the echo server. When I started client application on the Server2 I've found the crash of the echo server. =erl_crash_dump:0.2 Wed Jan 15 17:04:26 2014 Slogan: eheap_alloc: Cannot allocate 949152844 bytes of memory (of type "heap"). System version: Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] [smp:8:8] [async-threads:10] [kernel-poll:false] Compiled: Wed Dec 11 16:19:29 2013 Taints: crypto Atoms: 16134 =memory total: 4131605472 processes: 2386433264 processes_used: 2386409264 system: 1745172208 atom: 463441 atom_used: 446760 binary: 501624 code: 11870105 ets: 274696 low: 3429068696 But the Server1 had 30 Gb free RAM and 16 Gb free swap space before I started the echo server, and I saw with the "top" command that my echo server allocated only 5 Gb RAM and really used only about 2 Gb. Why the message queue cannot use more server memory? Some information about the Server1 configuration. $ uname -a Linux 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux $ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.3 (Santiago) $ top top - 12:27:01 up 2 days, 22:14, 1 user, load average: 0.00, 0.00, 0.00 Tasks: 310 total, 1 running, 309 sleeping, 0 stopped, 0 zombie Cpu(s): 0.1%us, 0.1%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 33011268k total, 868152k used, 32143116k free, 132708k buffers Swap: 16777208k total, 0k used, 16777208k free, 172772k cached I also tested memory allocation for the big binary data on the same Server1 node: Erlang R16B02 (erts-5.10.3) [source] [64-bit halfword] [smp:8:8] [async-threads:10] [kernel-poll:false] Eshell V5.10.3 (abort with ^G) 1> Z1=fun(N)-> X=lists:map(fun(I)-> binary:copy(<<1>>,1073741824) end, lists:seq(1,N)), io:format("mem: ~p~n", [memory()]), length(X) end. #Fun 2> Z1(10). mem: [{total,10758494488}, {processes,4659176}, {processes_used,4659176}, {system,10753835312}, {atom,194289}, {atom_used,174684}, {binary,10737518424}, {code,4012558}, {ets,172744}, {low,4057440}] 10 3>Z2=fun(N)-> X=lists:map(fun(I)-> binary:copy(<<1>>,1024) end, lists:seq(1,N)), io:format("mem: ~p~n", [memory()]), length(X) end. #Fun 4>Z2(10485760). 4> Z2(10485760). mem: [{total,11973197304}, {processes,795606312}, {processes_used,795606312}, {system,11177590992}, {atom,194289}, {atom_used,174744}, {binary,11161273768}, {code,4012558}, {ets,172744}, {low,4057440}] 10485760 And this test completed successfully. But on the same server my echo server crashes when it is used only 4 Gb of the memory. Has the messages queue its own limit? _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidnwelton@REDACTED Fri Jan 17 15:31:03 2014 From: davidnwelton@REDACTED (David Welton) Date: Fri, 17 Jan 2014 15:31:03 +0100 Subject: [erlang-questions] erlang pg client and redshift In-Reply-To: <15FCA410-230A-4620-9A13-518DC1461DA0@gmail.com> References: <15FCA410-230A-4620-9A13-518DC1461DA0@gmail.com> Message-ID: Hi > https://github.com/wg/epgsql I find the mabrek fork of that works a bit better for some things, although it seems to be a situation where everyone forks willy-nilly without much coordination, so it's hard to tell... -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From daniel.goertzen@REDACTED Fri Jan 17 15:41:48 2014 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Fri, 17 Jan 2014 08:41:48 -0600 Subject: [erlang-questions] r17a or updated maps branch? In-Reply-To: References: Message-ID: I was able to overcome the crypto problem by cherry picking 94576fd "crypto: Fix bug in change_basename" into my tree. I am still looking forward to R17, but I am no longer stuck. Cheers, Dan. On Thu, Jan 16, 2014 at 4:50 PM, Daniel Goertzen wrote: > I would like to do some development using the maps feature from the branch > "egil/maps/eep-implementation", however that branch seems to have inherited > some crypto breakage from wherever it was branched from. > > Is there going to be a R17A release soon? If not, is there a chance we > could have updates merged into egil/maps/eep-implementation? Or a rebase > onto something more stable? > > I know, I know, this is an experimental feature and I'm not supposed to > using it yet. :) But my release target is many months away and the > benefits of maps for this project outweigh the hazards of its experimental > status. > > Thanks, > Dan. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vances@REDACTED Fri Jan 17 15:42:09 2014 From: vances@REDACTED (Vance Shipley) Date: Fri, 17 Jan 2014 20:12:09 +0530 Subject: [erlang-questions] Start Conditions in Lexical Analyzer Generator (leex) Message-ID: <20140117144208.GC15885@aluminium.local> I've never tried using leex before but since the job at hand is to parse a language file, where the reference implementation uses flex, it seemed like porting their lex input file for use with leex would be the way to go. However I got stuck right away in that leex doesn't seem to support "start conditions": http://flex.sourceforge.net/manual/Start-Conditions.html#Start-Conditions Am I missing something? -- -Vance From dmkolesnikov@REDACTED Fri Jan 17 15:53:34 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Fri, 17 Jan 2014 16:53:34 +0200 Subject: [erlang-questions] Start Conditions in Lexical Analyzer Generator (leex) In-Reply-To: <20140117144208.GC15885@aluminium.local> References: <20140117144208.GC15885@aluminium.local> Message-ID: <9BEA6991-1898-401D-9C76-C941EC5EFE94@gmail.com> Hello, Probably, I've missed something? The start condition is the literal part of lex regex. e.g. Definitions. WSS = [\x20\x09\x0A\x0D]+ VAR = [a-zA-Z.]+ Rules. {if{WSS}{VAR}} : {token, {'if', TokenLine, TokenChars}}. this matches token is it starts with if - Dmitry On Jan 17, 2014, at 4:42 PM, Vance Shipley wrote: > I've never tried using leex before but since the job at hand is > to parse a language file, where the reference implementation uses > flex, it seemed like porting their lex input file for use with leex > would be the way to go. > > However I got stuck right away in that leex doesn't seem to support > "start conditions": > > http://flex.sourceforge.net/manual/Start-Conditions.html#Start-Conditions > > Am I missing something? > > -- > -Vance > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From H.Li@REDACTED Fri Jan 17 22:05:51 2014 From: H.Li@REDACTED (H.Li@REDACTED) Date: Fri, 17 Jan 2014 21:05:51 -0000 (GMT) Subject: [erlang-questions] cpu_topology on Mac OS X In-Reply-To: References: <0589296B5BCDDA4A8F5CEB3F8739A81576F0B734@SRV-EXCHMBX2.billing.ru> Message-ID: Hi All, I wonder if anybody knows how to get the cpu_topology on Max OS X. It seems that erlang:system_info(cpu_topology) just returns 'undefined'. Many Thanks! Kind Regards, Huiqing From erlang@REDACTED Fri Jan 17 22:16:22 2014 From: erlang@REDACTED (Andreas Stenius) Date: Fri, 17 Jan 2014 22:16:22 +0100 Subject: [erlang-questions] [erlang-patches] Proposal: reinstate pre-built PLT for Dialyzer In-Reply-To: References: Message-ID: +1. 2014/1/16 Sean Cribbs > Hi Erlangers, > > Ages ago, OTP shipped with a pre-built PLT for dialyzer, which was removed > reasons forgotten by most of us (probably the time/cost of building it). > Nowadays, because dialyzer is much improved (parallelism!) and our > computers are faster and have more cores, a PLT for all of the standard > library might only take a few minutes to build. > > We've been increasing our usage of dialyzer at Basho and I have felt that > it seems extremely wasteful and unnecessary to build a partial PLT of the > standard library for every single project, when that information only > changes across OTP releases. I feel the Erlang/OTP build process should > include building a PLT that encompasses the entire standard library. Aside > from the reduced cost of building PLTs for every different app, this may > encourage others to start using dialyzer on their projects. > > I'm offering to do the work to make this happen, but I need a little > guidance on where to start. I've looked at the dialyzer Makefile from an > older release where the PLT was included, but I'm concerned the project > structure has changed enough that the rules there no longer apply. It seems > the dialyzer runtime itself might also need to be tweaked to automatically > include the prebuilt PLT. > > Looking forward to hearing your thoughts and direction. Cheers! > > -- > Sean Cribbs > Software Engineer > Basho Technologies, Inc. > http://basho.com/ > > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://erlang.org/mailman/listinfo/erlang-patches > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From flw@REDACTED Fri Jan 17 22:31:39 2014 From: flw@REDACTED (Florian Waas) Date: Fri, 17 Jan 2014 13:31:39 -0800 Subject: [erlang-questions] erlang pg client and redshift In-Reply-To: <15FCA410-230A-4620-9A13-518DC1461DA0@gmail.com> References: <15FCA410-230A-4620-9A13-518DC1461DA0@gmail.com> Message-ID: If you're running R161 or older you will hit OTP-11228 which terminates your SSL connection during renegotiations. Got nothing to do with the client you're using. Fixed in R16B2. HTH, -fl. On Fri, Jan 17, 2014 at 5:15 AM, Dmitry Kolesnikov wrote: > Hello, > > Does any one successfully used AWS RedShift from Erlang. > It uses postgres as an interface. I've been trying to use following Erlang > libraries: > > https://github.com/wg/epgsql > https://github.com/semiocast/pgsql > > None of them works reliably. The SSL connection is terminated while query > runs. > However, native sql works fine. > > - Dmitry > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From me@REDACTED Sat Jan 18 02:25:28 2014 From: me@REDACTED (Xiao Jia) Date: Sat, 18 Jan 2014 09:25:28 +0800 Subject: [erlang-questions] Start Conditions in Lexical Analyzer Generator (leex) In-Reply-To: <9BEA6991-1898-401D-9C76-C941EC5EFE94@gmail.com> References: <20140117144208.GC15885@aluminium.local> <9BEA6991-1898-401D-9C76-C941EC5EFE94@gmail.com> Message-ID: On Fri, Jan 17, 2014 at 10:53 PM, Dmitry Kolesnikov wrote: > Hello, > > Probably, I've missed something? The start condition is the literal part of lex regex. > e.g. > > Definitions. > > WSS = [\x20\x09\x0A\x0D]+ > VAR = [a-zA-Z.]+ > > Rules. > > {if{WSS}{VAR}} : {token, {'if', TokenLine, TokenChars}}. > > this matches token is it starts with if That's probably not what Vance Shipley wants. Using start conditions is sort of moving between state machines. See below example excerpted from http://flex.sourceforge.net/manual/Start-Conditions.html#Start-Conditions "/*" BEGIN(comment); [^*\n]* /* eat anything that's not a '*' */ "*"+[^*/\n]* /* eat up '*'s not followed by '/'s */ \n ++line_num; "*"+"/" BEGIN(INITIAL); > > - Dmitry > > On Jan 17, 2014, at 4:42 PM, Vance Shipley wrote: > >> I've never tried using leex before but since the job at hand is >> to parse a language file, where the reference implementation uses >> flex, it seemed like porting their lex input file for use with leex >> would be the way to go. >> >> However I got stuck right away in that leex doesn't seem to support >> "start conditions": >> >> http://flex.sourceforge.net/manual/Start-Conditions.html#Start-Conditions >> >> Am I missing something? >From http://erlang.org/doc/man/leex.html rules have the following format: : . and apparently start conditions are not regular expressions... so probably there is no support for that. -- Regards, Xiao Jia From jinni.park@REDACTED Sat Jan 18 15:25:59 2014 From: jinni.park@REDACTED (Park, Sungjin) Date: Sat, 18 Jan 2014 23:25:59 +0900 Subject: [erlang-questions] gproc dynamic clustering Message-ID: Hi all, I surveyed the problem briefly and found an answer http://erlang.2086793.n4.nabble.com/Gproc-in-a-dynamic-cluster-td3705356.htmlhere and tested like. -- from node 1 -- (node1@REDACTED)1> application:start(gproc). (node1@REDACTED)2> gproc:reg({p,g,shell}). -- from node 2 -- (node2@REDACTED)1> net_adm:ping(node1@REDACTED). (node2@REDACTED)2> application:start(gproc). (node2@REDACTED)3> gproc:reg({p,g,shell}). ** exception exit: {timeout,{gen_leader,leader_call, [gproc_dist, {reg,{p,g,shell},undefined,<0.49.0>}]}} in function gen_leader:leader_call/2 (src/gen_leader.erl, line 359) in call from gproc_dist:leader_call/1 (src/gproc_dist.erl, line 708) in call from gproc:reg/1 (src/gproc.erl, line 605) As you can find here, I couldn't register to the resource created before clustering. After several trial, I found out that I had to restart gproc application from node1. It means that when I join 10th node to a cluster this way, I have to restart the gproc applications in all 9 nodes and register all the resources again. Have I done something wrong? Or is there any way to avoid this? -- Park, Sungjin ------------------------------------------------------------------------------------------------------------------- Peculiar travel suggestions are dancing lessons from god. -- The Books of Bokonon ------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From baliulia@REDACTED Sat Jan 18 16:54:48 2014 From: baliulia@REDACTED (=?UTF-8?B?SWduYXMgVnnFoW5pYXVza2Fz?=) Date: Sat, 18 Jan 2014 16:54:48 +0100 Subject: [erlang-questions] [erlang-patches] Proposal: reinstate pre-built PLT for Dialyzer In-Reply-To: References: Message-ID: <52DAA3C8.4050903@gmail.com> On 01/16/2014 07:15 PM, Sean Cribbs wrote: > We've been increasing our usage of dialyzer at Basho and I have felt > that it seems extremely wasteful and unnecessary to build a partial > PLT of the standard library for every single project, when that > information only changes across OTP releases. +1 also, but doesn't the `--add_to_plt` flag resolve the problem you describe of having to build the PLT for every single project? You build once the "global" / OTP plt, and then just append the needed things from specific projects from that to obtain new PLTs. -- Ignas From sean@REDACTED Sat Jan 18 18:31:39 2014 From: sean@REDACTED (Sean Cribbs) Date: Sat, 18 Jan 2014 11:31:39 -0600 Subject: [erlang-questions] [erlang-patches] Proposal: reinstate pre-built PLT for Dialyzer In-Reply-To: <52DAA3C8.4050903@gmail.com> References: <52DAA3C8.4050903@gmail.com> Message-ID: Sure, but my point is that there _is no global PLT_. OTP should have one shipped in its standard library. On Sat, Jan 18, 2014 at 9:54 AM, Ignas Vy?niauskas wrote: > On 01/16/2014 07:15 PM, Sean Cribbs wrote: > > We've been increasing our usage of dialyzer at Basho and I have felt > > that it seems extremely wasteful and unnecessary to build a partial > > PLT of the standard library for every single project, when that > > information only changes across OTP releases. > > +1 also, but doesn't the `--add_to_plt` flag resolve the problem you > describe of having to build the PLT for every single project? > > You build once the "global" / OTP plt, and then just append the needed > things from specific projects from that to obtain new PLTs. > > -- > Ignas > -- Sean Cribbs Software Engineer Basho Technologies, Inc. http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoursurrogategod@REDACTED Sun Jan 19 03:25:02 2014 From: yoursurrogategod@REDACTED (Yves S. Garret) Date: Sat, 18 Jan 2014 21:25:02 -0500 Subject: [erlang-questions] Can't create schema in Mnesia Message-ID: Hello all, I have the following code: http://bin.cakephp.org/view/2135184996 When I compile and reload the records, this is what happens: 14> c(mnesia). {ok,mnesia} 15> rr("records.hrl"). [planemo,tower] 16> mnesia:setup(). ** exception error: undefined function mnesia:create_schema/1 in function mnesia:setup/0 (mnesia.erl, line 25) The function _does_ exist in the mnesia module. I checked the docs and I'm running 16B03, so it's there. But why this error? Also, I have an another question. Lets say I'm testing some code and I comment out where I'm calling a function (located in the same file.) How can I tell the compiler to not worry about this file not being called? I know I can for variables such as _Variable, but methods? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob@REDACTED Sun Jan 19 03:32:47 2014 From: bob@REDACTED (Bob Ippolito) Date: Sat, 18 Jan 2014 18:32:47 -0800 Subject: [erlang-questions] Can't create schema in Mnesia In-Reply-To: References: Message-ID: Rename the module to something other than mnesia, there's a flat module namespace and only one module named mnesia can be loaded at a time. On Saturday, January 18, 2014, Yves S. Garret wrote: > Hello all, > > I have the following code: > http://bin.cakephp.org/view/2135184996 > > When I compile and reload the records, this is what happens: > > 14> c(mnesia). > {ok,mnesia} > 15> rr("records.hrl"). > [planemo,tower] > 16> mnesia:setup(). > ** exception error: undefined function mnesia:create_schema/1 > in function mnesia:setup/0 (mnesia.erl, line 25) > > The function _does_ exist in the mnesia module. I checked the docs and > I'm running 16B03, so it's there. But why this error? > > Also, I have an another question. Lets say I'm testing some code and I > comment out where I'm calling a function (located in the same file.) How > can I tell the compiler to not worry about this file not being called? I > know I can for variables such as _Variable, but methods? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoursurrogategod@REDACTED Sun Jan 19 03:35:57 2014 From: yoursurrogategod@REDACTED (Yves S. Garret) Date: Sat, 18 Jan 2014 21:35:57 -0500 Subject: [erlang-questions] Can't create schema in Mnesia In-Reply-To: References: Message-ID: Done, no change: 19> c(mnes). {ok,mnes} 20> rr("records.hrl"). [planemo,tower] 21> mnes:setup(). ** exception error: undefined function mnesia:create_schema/1 in function mnes:setup/0 (mnes.erl, line 24) Here is records.hrl: http://bin.cakephp.org/view/1897069453 On Sat, Jan 18, 2014 at 9:32 PM, Bob Ippolito wrote: > Rename the module to something other than mnesia, there's a flat module > namespace and only one module named mnesia can be loaded at a time. > > > On Saturday, January 18, 2014, Yves S. Garret > wrote: > >> Hello all, >> >> I have the following code: >> http://bin.cakephp.org/view/2135184996 >> >> When I compile and reload the records, this is what happens: >> >> 14> c(mnesia). >> {ok,mnesia} >> 15> rr("records.hrl"). >> [planemo,tower] >> 16> mnesia:setup(). >> ** exception error: undefined function mnesia:create_schema/1 >> in function mnesia:setup/0 (mnesia.erl, line 25) >> >> The function _does_ exist in the mnesia module. I checked the docs and >> I'm running 16B03, so it's there. But why this error? >> >> Also, I have an another question. Lets say I'm testing some code and I >> comment out where I'm calling a function (located in the same file.) How >> can I tell the compiler to not worry about this file not being called? I >> know I can for variables such as _Variable, but methods? >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ludovic@REDACTED Sun Jan 19 03:38:38 2014 From: ludovic@REDACTED (Ludovic Demblans) Date: Sun, 19 Jan 2014 03:38:38 +0100 Subject: [erlang-questions] Can't create schema in Mnesia In-Reply-To: References: Message-ID: Hi, Could give us what is the result of rp(lists:sort(mnesia:module_info(exports))). in the shell ? Maybe the mnesia library is not installed ? - lud Le Sun, 19 Jan 2014 03:35:57 +0100, Yves S. Garret a ?crit: > Done, no change: > > 19> c(mnes). > {ok,mnes} > 20> rr("records.hrl"). > [planemo,tower] > 21> mnes:setup(). > ** exception error: undefined function mnesia:create_schema/1 > in function mnes:setup/0 (mnes.erl, line 24) > > Here is records.hrl: > http://bin.cakephp.org/view/1897069453 > > > On Sat, Jan 18, 2014 at 9:32 PM, Bob Ippolito wrote: > >> Rename the module to something other than mnesia, there's a flat module >> namespace and only one module named mnesia can be loaded at a time. >> >> >> On Saturday, January 18, 2014, Yves S. Garret >> >> wrote: >> >>> Hello all, >>> >>> I have the following code: >>> http://bin.cakephp.org/view/2135184996 >>> >>> When I compile and reload the records, this is what happens: >>> >>> 14> c(mnesia). >>> {ok,mnesia} >>> 15> rr("records.hrl"). >>> [planemo,tower] >>> 16> mnesia:setup(). >>> ** exception error: undefined function mnesia:create_schema/1 >>> in function mnesia:setup/0 (mnesia.erl, line 25) >>> >>> The function _does_ exist in the mnesia module. I checked the docs and >>> I'm running 16B03, so it's there. But why this error? >>> >>> Also, I have an another question. Lets say I'm testing some code and I >>> comment out where I'm calling a function (located in the same file.) >>> How >>> can I tell the compiler to not worry about this file not being >>> called? I >>> know I can for variables such as _Variable, but methods? >>> >> -- Utilisant le logiciel de courrier r?volutionnaire d'Opera : http://www.opera.com/mail/ From bob@REDACTED Sun Jan 19 03:46:14 2014 From: bob@REDACTED (Bob Ippolito) Date: Sat, 18 Jan 2014 18:46:14 -0800 Subject: [erlang-questions] Can't create schema in Mnesia In-Reply-To: References: Message-ID: Make sure to remove the mnesia.beam from your last experiment. On Saturday, January 18, 2014, Ludovic Demblans wrote: > Hi, > > Could give us what is the result of rp(lists:sort(mnesia:module_info(exports))). > in the shell ? > > Maybe the mnesia library is not installed ? > > - lud > > Le Sun, 19 Jan 2014 03:35:57 +0100, Yves S. Garret < > yoursurrogategod@REDACTED> a ?crit: > > Done, no change: >> >> 19> c(mnes). >> {ok,mnes} >> 20> rr("records.hrl"). >> [planemo,tower] >> 21> mnes:setup(). >> ** exception error: undefined function mnesia:create_schema/1 >> in function mnes:setup/0 (mnes.erl, line 24) >> >> Here is records.hrl: >> http://bin.cakephp.org/view/1897069453 >> >> >> On Sat, Jan 18, 2014 at 9:32 PM, Bob Ippolito wrote: >> >> Rename the module to something other than mnesia, there's a flat module >>> namespace and only one module named mnesia can be loaded at a time. >>> >>> >>> On Saturday, January 18, 2014, Yves S. Garret < >>> yoursurrogategod@REDACTED> >>> wrote: >>> >>> Hello all, >>>> >>>> I have the following code: >>>> http://bin.cakephp.org/view/2135184996 >>>> >>>> When I compile and reload the records, this is what happens: >>>> >>>> 14> c(mnesia). >>>> {ok,mnesia} >>>> 15> rr("records.hrl"). >>>> [planemo,tower] >>>> 16> mnesia:setup(). >>>> ** exception error: undefined function mnesia:create_schema/1 >>>> in function mnesia:setup/0 (mnesia.erl, line 25) >>>> >>>> The function _does_ exist in the mnesia module. I checked the docs and >>>> I'm running 16B03, so it's there. But why this error? >>>> >>>> Also, I have an another question. Lets say I'm testing some code and I >>>> comment out where I'm calling a function (located in the same file.) >>>> How >>>> can I tell the compiler to not worry about this file not being called? >>>> I >>>> know I can for variables such as _Variable, but methods? >>>> >>>> >>> > > -- > Utilisant le logiciel de courrier r?volutionnaire d'Opera : > http://www.opera.com/mail/ > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoursurrogategod@REDACTED Sun Jan 19 04:03:35 2014 From: yoursurrogategod@REDACTED (Yves S. Garret) Date: Sat, 18 Jan 2014 22:03:35 -0500 Subject: [erlang-questions] Fwd: Can't create schema in Mnesia In-Reply-To: References: Message-ID: @ *Ludovic Demblans, sure.* 29> rp(lists:sort(mnesia:module_info(exports))). [{module_info,0},{module_info,1},{setup,0}] ok ---------- Forwarded message ---------- From: Yves S. Garret Date: Sat, Jan 18, 2014 at 9:35 PM Subject: Re: [erlang-questions] Can't create schema in Mnesia To: Bob Ippolito Cc: "erlang-questions@REDACTED" Done, no change: 19> c(mnes). {ok,mnes} 20> rr("records.hrl"). [planemo,tower] 21> mnes:setup(). ** exception error: undefined function mnesia:create_schema/1 in function mnes:setup/0 (mnes.erl, line 24) Here is records.hrl: http://bin.cakephp.org/view/1897069453 On Sat, Jan 18, 2014 at 9:32 PM, Bob Ippolito wrote: > Rename the module to something other than mnesia, there's a flat module > namespace and only one module named mnesia can be loaded at a time. > > > On Saturday, January 18, 2014, Yves S. Garret > wrote: > >> Hello all, >> >> I have the following code: >> http://bin.cakephp.org/view/2135184996 >> >> When I compile and reload the records, this is what happens: >> >> 14> c(mnesia). >> {ok,mnesia} >> 15> rr("records.hrl"). >> [planemo,tower] >> 16> mnesia:setup(). >> ** exception error: undefined function mnesia:create_schema/1 >> in function mnesia:setup/0 (mnesia.erl, line 25) >> >> The function _does_ exist in the mnesia module. I checked the docs and >> I'm running 16B03, so it's there. But why this error? >> >> Also, I have an another question. Lets say I'm testing some code and I >> comment out where I'm calling a function (located in the same file.) How >> can I tell the compiler to not worry about this file not being called? I >> know I can for variables such as _Variable, but methods? >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoursurrogategod@REDACTED Sun Jan 19 04:05:27 2014 From: yoursurrogategod@REDACTED (Yves S. Garret) Date: Sat, 18 Jan 2014 22:05:27 -0500 Subject: [erlang-questions] Fwd: Can't create schema in Mnesia In-Reply-To: References: Message-ID: @ Bob Ippolito, I tried that, the same result, the same error as described previously. ---------- Forwarded message ---------- From: Yves S. Garret Date: Sat, Jan 18, 2014 at 10:03 PM Subject: Fwd: [erlang-questions] Can't create schema in Mnesia To: "erlang-questions@REDACTED" @ *Ludovic Demblans, sure.* 29> rp(lists:sort(mnesia:module_info(exports))). [{module_info,0},{module_info,1},{setup,0}] ok ---------- Forwarded message ---------- From: Yves S. Garret Date: Sat, Jan 18, 2014 at 9:35 PM Subject: Re: [erlang-questions] Can't create schema in Mnesia To: Bob Ippolito Cc: "erlang-questions@REDACTED" Done, no change: 19> c(mnes). {ok,mnes} 20> rr("records.hrl"). [planemo,tower] 21> mnes:setup(). ** exception error: undefined function mnesia:create_schema/1 in function mnes:setup/0 (mnes.erl, line 24) Here is records.hrl: http://bin.cakephp.org/view/1897069453 On Sat, Jan 18, 2014 at 9:32 PM, Bob Ippolito wrote: > Rename the module to something other than mnesia, there's a flat module > namespace and only one module named mnesia can be loaded at a time. > > > On Saturday, January 18, 2014, Yves S. Garret > wrote: > >> Hello all, >> >> I have the following code: >> http://bin.cakephp.org/view/2135184996 >> >> When I compile and reload the records, this is what happens: >> >> 14> c(mnesia). >> {ok,mnesia} >> 15> rr("records.hrl"). >> [planemo,tower] >> 16> mnesia:setup(). >> ** exception error: undefined function mnesia:create_schema/1 >> in function mnesia:setup/0 (mnesia.erl, line 25) >> >> The function _does_ exist in the mnesia module. I checked the docs and >> I'm running 16B03, so it's there. But why this error? >> >> Also, I have an another question. Lets say I'm testing some code and I >> comment out where I'm calling a function (located in the same file.) How >> can I tell the compiler to not worry about this file not being called? I >> know I can for variables such as _Variable, but methods? >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob@REDACTED Sun Jan 19 04:37:17 2014 From: bob@REDACTED (Bob Ippolito) Date: Sat, 18 Jan 2014 19:37:17 -0800 Subject: [erlang-questions] Fwd: Can't create schema in Mnesia In-Reply-To: References: Message-ID: I think you should check again, I believe you have made a mistake. You will only get this error and see that output if you have a mnesia.beam on the code path that is not the one that ships with Erlang. Having only a setup/0 export makes it extremely likely that this is the original mnesia.beam that would be produced from the mnesia.erl that you pasted earlier in this thread. Try evaluating code:which(mnesia). If it doesn't show the same directory as code:which(mnesia_locker) then you will know which beam file to delete. On Sat, Jan 18, 2014 at 7:05 PM, Yves S. Garret wrote: > @ Bob Ippolito, I tried that, the same result, the same error as described > previously. > > ---------- Forwarded message ---------- > From: Yves S. Garret > Date: Sat, Jan 18, 2014 at 10:03 PM > Subject: Fwd: [erlang-questions] Can't create schema in Mnesia > To: "erlang-questions@REDACTED" > > > @ *Ludovic Demblans, sure.* > > 29> rp(lists:sort(mnesia:module_info(exports))). > [{module_info,0},{module_info,1},{setup,0}] > ok > > > ---------- Forwarded message ---------- > From: Yves S. Garret > Date: Sat, Jan 18, 2014 at 9:35 PM > Subject: Re: [erlang-questions] Can't create schema in Mnesia > To: Bob Ippolito > Cc: "erlang-questions@REDACTED" > > > Done, no change: > > 19> c(mnes). > {ok,mnes} > 20> rr("records.hrl"). > [planemo,tower] > 21> mnes:setup(). > > ** exception error: undefined function mnesia:create_schema/1 > in function mnes:setup/0 (mnes.erl, line 24) > > Here is records.hrl: > http://bin.cakephp.org/view/1897069453 > > > On Sat, Jan 18, 2014 at 9:32 PM, Bob Ippolito wrote: > >> Rename the module to something other than mnesia, there's a flat module >> namespace and only one module named mnesia can be loaded at a time. >> >> >> On Saturday, January 18, 2014, Yves S. Garret >> wrote: >> >>> Hello all, >>> >>> I have the following code: >>> http://bin.cakephp.org/view/2135184996 >>> >>> When I compile and reload the records, this is what happens: >>> >>> 14> c(mnesia). >>> {ok,mnesia} >>> 15> rr("records.hrl"). >>> [planemo,tower] >>> 16> mnesia:setup(). >>> ** exception error: undefined function mnesia:create_schema/1 >>> in function mnesia:setup/0 (mnesia.erl, line 25) >>> >>> The function _does_ exist in the mnesia module. I checked the docs and >>> I'm running 16B03, so it's there. But why this error? >>> >>> Also, I have an another question. Lets say I'm testing some code and I >>> comment out where I'm calling a function (located in the same file.) How >>> can I tell the compiler to not worry about this file not being called? I >>> know I can for variables such as _Variable, but methods? >>> >> > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Sun Jan 19 09:08:19 2014 From: erlang@REDACTED (Andreas Stenius) Date: Sun, 19 Jan 2014 09:08:19 +0100 Subject: [erlang-questions] [ANN] ErlyDTL v0.8.1 Message-ID: Hi, A new release of ErlyDTL has been released into the wild [1]. This release is a clean-up release with a bunch of minor issues squeezed out. Amongst the highlights are: Improved options for error reporting, new auto_escape compile option for django purists, cleaned out some warnings given by Dialyzer and some major improvements to the generated code for for-loops. Best regards, Andreas [1] https://github.com/erlydtl/erlydtl/releases/latest -------------- next part -------------- An HTML attachment was scrubbed... URL: From avinash_dhumane@REDACTED Sun Jan 19 11:28:12 2014 From: avinash_dhumane@REDACTED (Avinash Dhumane) Date: Sun, 19 Jan 2014 15:58:12 +0530 Subject: [erlang-questions] Question on "selective receive" Message-ID: <003c01cf1501$29bc9890$7d35c9b0$@com> Can the timeout clause not have a guard too? If it can, what are the semantics of it? I mean, if the timeout occurs but guard evaluates to false, what happens to receive? Does it continue to block? If it cannot, why? Thanks Avinash -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoursurrogategod@REDACTED Sun Jan 19 14:30:42 2014 From: yoursurrogategod@REDACTED (Yves S. Garret) Date: Sun, 19 Jan 2014 08:30:42 -0500 Subject: [erlang-questions] Fwd: Can't create schema in Mnesia In-Reply-To: References: Message-ID: You're absolutely right. The paths were totally different. I restarted the Erlang virtual machine and it works well now. Thank you. On Sat, Jan 18, 2014 at 10:37 PM, Bob Ippolito wrote: > I think you should check again, I believe you have made a mistake. You > will only get this error and see that output if you have a mnesia.beam on > the code path that is not the one that ships with Erlang. Having only a > setup/0 export makes it extremely likely that this is the original > mnesia.beam that would be produced from the mnesia.erl that you pasted > earlier in this thread. > > Try evaluating code:which(mnesia). If it doesn't show the same directory > as code:which(mnesia_locker) then you will know which beam file to delete. > > > On Sat, Jan 18, 2014 at 7:05 PM, Yves S. Garret < > yoursurrogategod@REDACTED> wrote: > >> @ Bob Ippolito, I tried that, the same result, the same error as >> described previously. >> >> ---------- Forwarded message ---------- >> From: Yves S. Garret >> Date: Sat, Jan 18, 2014 at 10:03 PM >> Subject: Fwd: [erlang-questions] Can't create schema in Mnesia >> To: "erlang-questions@REDACTED" >> >> >> @ *Ludovic Demblans, sure.* >> >> 29> rp(lists:sort(mnesia:module_info(exports))). >> [{module_info,0},{module_info,1},{setup,0}] >> ok >> >> >> ---------- Forwarded message ---------- >> From: Yves S. Garret >> Date: Sat, Jan 18, 2014 at 9:35 PM >> Subject: Re: [erlang-questions] Can't create schema in Mnesia >> To: Bob Ippolito >> Cc: "erlang-questions@REDACTED" >> >> >> Done, no change: >> >> 19> c(mnes). >> {ok,mnes} >> 20> rr("records.hrl"). >> [planemo,tower] >> 21> mnes:setup(). >> >> ** exception error: undefined function mnesia:create_schema/1 >> in function mnes:setup/0 (mnes.erl, line 24) >> >> Here is records.hrl: >> http://bin.cakephp.org/view/1897069453 >> >> >> On Sat, Jan 18, 2014 at 9:32 PM, Bob Ippolito wrote: >> >>> Rename the module to something other than mnesia, there's a flat module >>> namespace and only one module named mnesia can be loaded at a time. >>> >>> >>> On Saturday, January 18, 2014, Yves S. Garret < >>> yoursurrogategod@REDACTED> wrote: >>> >>>> Hello all, >>>> >>>> I have the following code: >>>> http://bin.cakephp.org/view/2135184996 >>>> >>>> When I compile and reload the records, this is what happens: >>>> >>>> 14> c(mnesia). >>>> {ok,mnesia} >>>> 15> rr("records.hrl"). >>>> [planemo,tower] >>>> 16> mnesia:setup(). >>>> ** exception error: undefined function mnesia:create_schema/1 >>>> in function mnesia:setup/0 (mnesia.erl, line 25) >>>> >>>> The function _does_ exist in the mnesia module. I checked the docs and >>>> I'm running 16B03, so it's there. But why this error? >>>> >>>> Also, I have an another question. Lets say I'm testing some code and I >>>> comment out where I'm calling a function (located in the same file.) How >>>> can I tell the compiler to not worry about this file not being called? I >>>> know I can for variables such as _Variable, but methods? >>>> >>> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyron.zerafa@REDACTED Sun Jan 19 19:32:24 2014 From: tyron.zerafa@REDACTED (Tyron Zerafa) Date: Sun, 19 Jan 2014 19:32:24 +0100 Subject: [erlang-questions] Percept2 and gen_server messages Message-ID: Hi all, I am trying to use Percept2 to find out the communication overhead of a gen_server process. However, when I'm analyzing the "*.dat" generated I'm only finding the following for my gen_server process (code below): msgs_recv = 1 avg_size_msgs_recv = 18 msgs_sent = 1 avg_size_msgs_sent = 72 We are communicating with this server both via messages (ServerPid ! {test}) and the gen_server:call/2 Are we missing something here? Shouldn't the request/ replies be recorded as msgs? %% gen_server code -module(test_percept_1). -behaviour(gen_server). -define(SERVER, ?MODULE). -export([ init/1, handle_call/3, start_link/0, handle_info/2 , ..... ]). start_profiling() -> percept2:profile("data.dat", {test_percept_1,start_link, []},[all]). stop_profiling() -> percept2:stop(). start_link() -> case gen_server:start_link({local, ?SERVER}, ?SERVER, [], []) of {ok, Pid} -> io:format("Gen_server started: ~p on node: ~p. ~n",[Pid,node()]), {ok,Pid}; Other -> io:format("Error starting ~p: ~p. ~n",[?SERVER,Other]), {error, Other} end. init([]) -> {ok,[]}. .... handle_call({test},_From,State)-> {reply,"This is a test string",State}. ..... handle_info(_, State) -> {noreply,state}. ..... -- Best Regards, Tyron Zerafa -------------- next part -------------- An HTML attachment was scrubbed... URL: From H.Li@REDACTED Sun Jan 19 22:22:35 2014 From: H.Li@REDACTED (H.Li@REDACTED) Date: Sun, 19 Jan 2014 21:22:35 -0000 (GMT) Subject: [erlang-questions] Percept2 and gen_server messages In-Reply-To: References: Message-ID: <0928ab3df7be131701382feb56192c41.squirrel@webmail.cs.kent.ac.uk> Hi Tyron, Percept2 monitors both types of communications (via explicit message passing and the gen_server:call/2). The reason that you got only one message send/receive is that the 'start_link' function you profiled returned immediately after the gen_server has been started, so the process you saw was the process that started the gen_server process, not the gen_server process itself. Kind Regards, Huiqing > Hi all, > > I am trying to use Percept2 to find out the communication overhead of > a > gen_server process. However, when I'm analyzing the "*.dat" generated I'm > only finding the following for my gen_server process (code below): > msgs_recv = 1 > avg_size_msgs_recv = 18 > msgs_sent = 1 > avg_size_msgs_sent = 72 > > We are communicating with this server both via messages (ServerPid ! > {test}) and the gen_server:call/2 > > Are we missing something here? Shouldn't the request/ replies be recorded > as msgs? > > > > > > > > > %% gen_server code > -module(test_percept_1). > > -behaviour(gen_server). > > -define(SERVER, ?MODULE). > > -export([ > init/1, > handle_call/3, > start_link/0, > handle_info/2 , > ..... > ]). > > start_profiling() -> > percept2:profile("data.dat", {test_percept_1,start_link, []},[all]). > stop_profiling() -> > percept2:stop(). > start_link() -> > case gen_server:start_link({local, ?SERVER}, ?SERVER, [], []) of > {ok, Pid} -> > io:format("Gen_server started: ~p on node: ~p. ~n",[Pid,node()]), > {ok,Pid}; > Other -> > io:format("Error starting ~p: ~p. ~n",[?SERVER,Other]), > {error, Other} > end. > init([]) -> {ok,[]}. > > .... > > handle_call({test},_From,State)-> > {reply,"This is a test string",State}. > > ..... > handle_info(_, State) -> > {noreply,state}. > > ..... > > > > -- > Best Regards, > Tyron Zerafa > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From ludovic@REDACTED Sun Jan 19 23:57:16 2014 From: ludovic@REDACTED (Ludovic Demblans) Date: Sun, 19 Jan 2014 23:57:16 +0100 Subject: [erlang-questions] Question on "selective receive" In-Reply-To: <003c01cf1501$29bc9890$7d35c9b0$@com> References: <003c01cf1501$29bc9890$7d35c9b0$@com> Message-ID: Hi, You are talking about the 'after' clause of a receive expression. It can only have integers as clauses, starting from 0 to infinity, and a special value 'infinity' literally, which is the default. So it cannot fail, these are not guards, it is just a time in milliseconds, and the receive expression value is the 'after' clause value if no pattern of the receive clause is satisfied in the duration. (sorry for bad englih, i hope this is readable ;) ) Le Sun, 19 Jan 2014 11:28:12 +0100, Avinash Dhumane a ?crit: > Can the timeout clause not have a guard too? > > > If it can, what are the semantics of it? I mean, if the timeout occurs > but > guard evaluates to false, what happens to receive? Does it continue to > block? > > > If it cannot, why? > > > Thanks > > Avinash > -- Utilisant le logiciel de courrier r?volutionnaire d'Opera : http://www.opera.com/mail/ From me@REDACTED Mon Jan 20 01:49:44 2014 From: me@REDACTED (Xiao Jia) Date: Mon, 20 Jan 2014 08:49:44 +0800 Subject: [erlang-questions] internal error in lint_module In-Reply-To: References: Message-ID: Yes you are right! :-D I changed it to foobar(T, S) -> {erl_syntax:revert(T), S}. and it works now. Thanks! On Sun, Jan 19, 2014 at 11:12 PM, Sina Samavati wrote: > It is not a bug. > > "AST" in parse_transform/2 is a list of abstract forms but the output > of erl_syntax_lib:mapfold/3 is a syntax tree (namely, that "T1"), > that's why it throws some errors because parse_transform/2 should > return a list of abstract forms. > You can give a *list* of syntax trees to erl_syntax:revert_forms/1 to > get a *list* of abstract forms. > > On Fri, Jan 17, 2014 at 3:26 PM, Xiao Jia wrote: >> (I posted this to erlang-bugs as well, but it may deserve some >> discussions here.) >> >> I was writing a parse_transform module using erl_syntax_lib:mapfold, >> but both R16B03 and R15B03-1 give the following error even if the >> parse_transform module does nothing: >> >> >> z.erl:none: internal error in lint_module; >> crash reason: {badarg,[{erl_scan,set_attr, >> [line,function,#Fun], >> [{file,"erl_scan.erl"},{line,418}]}, >> ... >> (see https://gist.github.com/stfairy/8471800 for full error) >> >> >> File z.erl: >> >> >> -module(z). >> -compile({parse_transform, zt}). >> -export([f/1]). >> f(_) -> z. >> >> >> File zt.erl: >> >> >> -module(zt). >> -export([parse_transform/2]). >> >> parse_transform(AST, _Options) -> >> [parse(T) || T <- AST]. >> >> parse({function, _, _, _, _} = T) -> >> case erl_syntax_lib:mapfold(fun foobar/2, something, T) of >> {T1, _} -> T1; >> _ -> T >> end; >> parse(T) -> T. >> >> foobar(T, S) -> {T, S}. >> >> >> $ erlc zt.erl >> $ erlc -pa . z.erl >> >> >> >> btw, I am a little confused why parse_transform modules are usually >> named as "zt"... >> >> >> -- >> Regards, >> Xiao Jia >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > Sina Samavati > Software engineer > > https://github.com/s1n4 > https://twitter.com/sinasamavati -- Regards, Xiao Jia From yoursurrogategod@REDACTED Mon Jan 20 03:12:52 2014 From: yoursurrogategod@REDACTED (Yves S. Garret) Date: Sun, 19 Jan 2014 21:12:52 -0500 Subject: [erlang-questions] Fwd: Can't create schema in Mnesia In-Reply-To: References: Message-ID: I know that this is somewhat on a tangent, but if someone could please answer this question, I'd really appreciate it. "Also, I have an another question. Lets say I'm testing some code and I comment out where I'm calling a function (located in the same file.) How can I tell the compiler to not worry about this file not being called? I know I can for variables such as _Variable, but methods?" Is that even possible? On Sat, Jan 18, 2014 at 10:37 PM, Bob Ippolito wrote: > I think you should check again, I believe you have made a mistake. You > will only get this error and see that output if you have a mnesia.beam on > the code path that is not the one that ships with Erlang. Having only a > setup/0 export makes it extremely likely that this is the original > mnesia.beam that would be produced from the mnesia.erl that you pasted > earlier in this thread. > > Try evaluating code:which(mnesia). If it doesn't show the same directory > as code:which(mnesia_locker) then you will know which beam file to delete. > > > On Sat, Jan 18, 2014 at 7:05 PM, Yves S. Garret < > yoursurrogategod@REDACTED> wrote: > >> @ Bob Ippolito, I tried that, the same result, the same error as >> described previously. >> >> ---------- Forwarded message ---------- >> From: Yves S. Garret >> Date: Sat, Jan 18, 2014 at 10:03 PM >> Subject: Fwd: [erlang-questions] Can't create schema in Mnesia >> To: "erlang-questions@REDACTED" >> >> >> @ *Ludovic Demblans, sure.* >> >> 29> rp(lists:sort(mnesia:module_info(exports))). >> [{module_info,0},{module_info,1},{setup,0}] >> ok >> >> >> ---------- Forwarded message ---------- >> From: Yves S. Garret >> Date: Sat, Jan 18, 2014 at 9:35 PM >> Subject: Re: [erlang-questions] Can't create schema in Mnesia >> To: Bob Ippolito >> Cc: "erlang-questions@REDACTED" >> >> >> Done, no change: >> >> 19> c(mnes). >> {ok,mnes} >> 20> rr("records.hrl"). >> [planemo,tower] >> 21> mnes:setup(). >> >> ** exception error: undefined function mnesia:create_schema/1 >> in function mnes:setup/0 (mnes.erl, line 24) >> >> Here is records.hrl: >> http://bin.cakephp.org/view/1897069453 >> >> >> On Sat, Jan 18, 2014 at 9:32 PM, Bob Ippolito wrote: >> >>> Rename the module to something other than mnesia, there's a flat module >>> namespace and only one module named mnesia can be loaded at a time. >>> >>> >>> On Saturday, January 18, 2014, Yves S. Garret < >>> yoursurrogategod@REDACTED> wrote: >>> >>>> Hello all, >>>> >>>> I have the following code: >>>> http://bin.cakephp.org/view/2135184996 >>>> >>>> When I compile and reload the records, this is what happens: >>>> >>>> 14> c(mnesia). >>>> {ok,mnesia} >>>> 15> rr("records.hrl"). >>>> [planemo,tower] >>>> 16> mnesia:setup(). >>>> ** exception error: undefined function mnesia:create_schema/1 >>>> in function mnesia:setup/0 (mnesia.erl, line 25) >>>> >>>> The function _does_ exist in the mnesia module. I checked the docs and >>>> I'm running 16B03, so it's there. But why this error? >>>> >>>> Also, I have an another question. Lets say I'm testing some code and I >>>> comment out where I'm calling a function (located in the same file.) How >>>> can I tell the compiler to not worry about this file not being called? I >>>> know I can for variables such as _Variable, but methods? >>>> >>> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob@REDACTED Mon Jan 20 03:22:33 2014 From: bob@REDACTED (Bob Ippolito) Date: Sun, 19 Jan 2014 18:22:33 -0800 Subject: [erlang-questions] Fwd: Can't create schema in Mnesia In-Reply-To: References: Message-ID: If you use a fully qualified M:F(A) style call, then the compiler won't try and verify that it exists. 1> fun () -> x:this_definitely_does_not_exist() end. #Fun To have the compiler ignore whether a function is used or not, you can use -compile(export_all). This should really only be enabled sparingly during development (and perhaps conditionally compiled in for tests). On Sun, Jan 19, 2014 at 6:12 PM, Yves S. Garret wrote: > I know that this is somewhat on a tangent, but if someone could please > answer this question, I'd really appreciate it. > > > "Also, I have an another question. Lets say I'm testing some code and I > comment out where I'm calling a function (located in the same file.) How > can I tell the compiler to not worry about this file not being called? I > know I can for variables such as _Variable, but methods?" > > Is that even possible? > > > On Sat, Jan 18, 2014 at 10:37 PM, Bob Ippolito wrote: > >> I think you should check again, I believe you have made a mistake. You >> will only get this error and see that output if you have a mnesia.beam on >> the code path that is not the one that ships with Erlang. Having only a >> setup/0 export makes it extremely likely that this is the original >> mnesia.beam that would be produced from the mnesia.erl that you pasted >> earlier in this thread. >> >> Try evaluating code:which(mnesia). If it doesn't show the same directory >> as code:which(mnesia_locker) then you will know which beam file to delete. >> >> >> On Sat, Jan 18, 2014 at 7:05 PM, Yves S. Garret < >> yoursurrogategod@REDACTED> wrote: >> >>> @ Bob Ippolito, I tried that, the same result, the same error as >>> described previously. >>> >>> ---------- Forwarded message ---------- >>> From: Yves S. Garret >>> Date: Sat, Jan 18, 2014 at 10:03 PM >>> Subject: Fwd: [erlang-questions] Can't create schema in Mnesia >>> To: "erlang-questions@REDACTED" >>> >>> >>> @ *Ludovic Demblans, sure.* >>> >>> 29> rp(lists:sort(mnesia:module_info(exports))). >>> [{module_info,0},{module_info,1},{setup,0}] >>> ok >>> >>> >>> ---------- Forwarded message ---------- >>> From: Yves S. Garret >>> Date: Sat, Jan 18, 2014 at 9:35 PM >>> Subject: Re: [erlang-questions] Can't create schema in Mnesia >>> To: Bob Ippolito >>> Cc: "erlang-questions@REDACTED" >>> >>> >>> Done, no change: >>> >>> 19> c(mnes). >>> {ok,mnes} >>> 20> rr("records.hrl"). >>> [planemo,tower] >>> 21> mnes:setup(). >>> >>> ** exception error: undefined function mnesia:create_schema/1 >>> in function mnes:setup/0 (mnes.erl, line 24) >>> >>> Here is records.hrl: >>> http://bin.cakephp.org/view/1897069453 >>> >>> >>> On Sat, Jan 18, 2014 at 9:32 PM, Bob Ippolito wrote: >>> >>>> Rename the module to something other than mnesia, there's a flat module >>>> namespace and only one module named mnesia can be loaded at a time. >>>> >>>> >>>> On Saturday, January 18, 2014, Yves S. Garret < >>>> yoursurrogategod@REDACTED> wrote: >>>> >>>>> Hello all, >>>>> >>>>> I have the following code: >>>>> http://bin.cakephp.org/view/2135184996 >>>>> >>>>> When I compile and reload the records, this is what happens: >>>>> >>>>> 14> c(mnesia). >>>>> {ok,mnesia} >>>>> 15> rr("records.hrl"). >>>>> [planemo,tower] >>>>> 16> mnesia:setup(). >>>>> ** exception error: undefined function mnesia:create_schema/1 >>>>> in function mnesia:setup/0 (mnesia.erl, line 25) >>>>> >>>>> The function _does_ exist in the mnesia module. I checked the docs >>>>> and I'm running 16B03, so it's there. But why this error? >>>>> >>>>> Also, I have an another question. Lets say I'm testing some code and >>>>> I comment out where I'm calling a function (located in the same file.) How >>>>> can I tell the compiler to not worry about this file not being called? I >>>>> know I can for variables such as _Variable, but methods? >>>>> >>>> >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sina.samv@REDACTED Sun Jan 19 16:12:18 2014 From: sina.samv@REDACTED (Sina Samavati) Date: Sun, 19 Jan 2014 18:42:18 +0330 Subject: [erlang-questions] internal error in lint_module In-Reply-To: References: Message-ID: It is not a bug. "AST" in parse_transform/2 is a list of abstract forms but the output of erl_syntax_lib:mapfold/3 is a syntax tree (namely, that "T1"), that's why it throws some errors because parse_transform/2 should return a list of abstract forms. You can give a *list* of syntax trees to erl_syntax:revert_forms/1 to get a *list* of abstract forms. On Fri, Jan 17, 2014 at 3:26 PM, Xiao Jia wrote: > (I posted this to erlang-bugs as well, but it may deserve some > discussions here.) > > I was writing a parse_transform module using erl_syntax_lib:mapfold, > but both R16B03 and R15B03-1 give the following error even if the > parse_transform module does nothing: > > > z.erl:none: internal error in lint_module; > crash reason: {badarg,[{erl_scan,set_attr, > [line,function,#Fun], > [{file,"erl_scan.erl"},{line,418}]}, > ... > (see https://gist.github.com/stfairy/8471800 for full error) > > > File z.erl: > > > -module(z). > -compile({parse_transform, zt}). > -export([f/1]). > f(_) -> z. > > > File zt.erl: > > > -module(zt). > -export([parse_transform/2]). > > parse_transform(AST, _Options) -> > [parse(T) || T <- AST]. > > parse({function, _, _, _, _} = T) -> > case erl_syntax_lib:mapfold(fun foobar/2, something, T) of > {T1, _} -> T1; > _ -> T > end; > parse(T) -> T. > > foobar(T, S) -> {T, S}. > > > $ erlc zt.erl > $ erlc -pa . z.erl > > > > btw, I am a little confused why parse_transform modules are usually > named as "zt"... > > > -- > Regards, > Xiao Jia > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Sina Samavati Software engineer https://github.com/s1n4 https://twitter.com/sinasamavati From dmkolesnikov@REDACTED Mon Jan 20 11:06:50 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 20 Jan 2014 12:06:50 +0200 Subject: [erlang-questions] Start Conditions in Lexical Analyzer Generator (leex) In-Reply-To: References: <20140117144208.GC15885@aluminium.local> <9BEA6991-1898-401D-9C76-C941EC5EFE94@gmail.com> Message-ID: <11F2259F-40B6-407B-91E5-74B4345FBA33@gmail.com> Hello, Right? I think there is not a straight path from flex to Erlang leex. Instead of porting flex input rules, I would take a look into flex interim results and try to map them to leex. - Dmitry On 18 Jan 2014, at 03:25, Xiao Jia wrote: > On Fri, Jan 17, 2014 at 10:53 PM, Dmitry Kolesnikov > wrote: >> Hello, >> >> Probably, I've missed something? The start condition is the literal part of lex regex. >> e.g. >> >> Definitions. >> >> WSS = [\x20\x09\x0A\x0D]+ >> VAR = [a-zA-Z.]+ >> >> Rules. >> >> {if{WSS}{VAR}} : {token, {'if', TokenLine, TokenChars}}. >> >> this matches token is it starts with if > > That's probably not what Vance Shipley wants. Using start conditions > is sort of moving between state machines. See below example excerpted > from http://flex.sourceforge.net/manual/Start-Conditions.html#Start-Conditions > > > "/*" BEGIN(comment); > > [^*\n]* /* eat anything that's not a '*' */ > "*"+[^*/\n]* /* eat up '*'s not followed by '/'s */ > \n ++line_num; > "*"+"/" BEGIN(INITIAL); > > >> >> - Dmitry >> >> On Jan 17, 2014, at 4:42 PM, Vance Shipley wrote: >> >>> I've never tried using leex before but since the job at hand is >>> to parse a language file, where the reference implementation uses >>> flex, it seemed like porting their lex input file for use with leex >>> would be the way to go. >>> >>> However I got stuck right away in that leex doesn't seem to support >>> "start conditions": >>> >>> http://flex.sourceforge.net/manual/Start-Conditions.html#Start-Conditions >>> >>> Am I missing something? > > > From http://erlang.org/doc/man/leex.html rules have the following format: > > : . > > and apparently start conditions are not regular expressions... so > probably there is no support for that. > > > -- > Regards, > Xiao Jia -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex@REDACTED Mon Jan 20 14:46:05 2014 From: alex@REDACTED (Aleksandar Radulovic) Date: Mon, 20 Jan 2014 14:46:05 +0100 Subject: [erlang-questions] [ANN] aberth - a generic BERT-RPC server Message-ID: Hello, I've just released aberth[1], a generic server/library for easy building of BERT-RPC [2] services. It enables you to expose regular Erlang modules as bert-rpc services. I think its a nice alternative to ernie [3], written by Tom Preston-Werner. This is a first public release and it supports both synchronous (call) and asynchronous (cast) calls. Support for informational ({info}) packets is built-in, but right now I'm figuring out the best and most elegant way to pass those packets to handlers (erlang modules). That should be ironed out rather shortly. It uses barrel [4] for accepting and pooling TCP connections, which also provides very low latency for accepting connections and nice scalability as well. Hattip to Benoit Chesneau! I've set a list of enhancements as issues in Github - support for streaming requests and responses, support for caching and better logging. If you don't find those use of those, you can start using aberth straight away. Included in the release is a demo OTP app to illustrate aberth's use. Take it for a spin and let me know what you think. Any feedback is greatly appreciated! [1] https://github.com/a13x/aberth [2] http://bert-rpc.org/ [3] https://github.com/mojombo/ernie [4] https://github.com/benoitc/barrel Cheers, alex -- a lex 13 x http://a13x.net | @a13xnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Mon Jan 20 21:12:24 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 20 Jan 2014 22:12:24 +0200 Subject: [erlang-questions] erlang pg client and redshift In-Reply-To: References: <15FCA410-230A-4620-9A13-518DC1461DA0@gmail.com> Message-ID: <19D7C063-9A6A-46F2-BDC5-6307B58530D4@gmail.com> Hello, Yes, you are right that major issue is termination of SSL connection. Unfortunately, R16B03 did not help anyhow. I?ve tried this on multiple platform (Linux, OS X) and used various ciphers. This happens on very long query that takes about 5 min to evaluate. =ERROR REPORT==== 20-Jan-2014::22:07:09 === ** Generic server <0.75.0> terminating ** Last message in was {ssl_closed, {sslsocket, {gen_tcp,#Port<0.6578>,tls_connection}, <0.79.0>}} ** When Server state == {state,<0.74.0>,ssl, {sslsocket, {gen_tcp,#Port<0.6578>,tls_connection}, <0.79.0>}, <<>>} ** Reason for termination == ** sock_closed =ERROR REPORT==== 20-Jan-2014::22:07:09 === ** State machine <0.74.0> terminating ** Last message in was {'EXIT',<0.75.0>,sock_closed} ** When State == querying ** Data == {state,undefined,<0.75.0>,3600000, [{<<"client_encoding">>,<<"UNICODE">>}, {<<"datestyle">>,<<"ISO, MDY">>}, {<<"gconf_case_sensitive">>,<<"on">>}, {<<"integer_datetimes">>,<<"on">>}, {<<"is_superuser">>,<<"on">>}, {<<"server_encoding">>,<<"UNICODE">>}, {<<"server_version">>,<<"8.0.2">>}, {<<"session_authorization">>,<<"sa">>}, {<<"TimeZone">>,<<"UTC">>}, {<<"timezone_abbreviations">>,<<"Default">>}, {<<"padb_version">>,<<".">>}, {<<"padb_revision">>,<<>>}, {<<"max_numeric_precision">>,<<"38">>}, {<<"max_varchar_size">>,<<"65535">>}], undefined, {<0.38.0>,#Ref<0.0.0.241>}, undefined, {3453,1382948247}, {statement,[], [...], [int4,int4]}, 73} ** Reason for termination = ** sock_closed ** exception exit: sock_closed On 17 Jan 2014, at 23:31, Florian Waas wrote: > If you're running R161 or older you will hit OTP-11228 which terminates your SSL connection during renegotiations. Got nothing to do with the client you're using. Fixed in R16B2. > > HTH, > -fl. > > > On Fri, Jan 17, 2014 at 5:15 AM, Dmitry Kolesnikov wrote: > Hello, > > Does any one successfully used AWS RedShift from Erlang. > It uses postgres as an interface. I've been trying to use following Erlang libraries: > > https://github.com/wg/epgsql > https://github.com/semiocast/pgsql > > None of them works reliably. The SSL connection is terminated while query runs. > However, native sql works fine. > > - Dmitry > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Tue Jan 21 02:00:35 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Tue, 21 Jan 2014 14:00:35 +1300 Subject: [erlang-questions] Start Conditions in Lexical Analyzer Generator (leex) In-Reply-To: <11F2259F-40B6-407B-91E5-74B4345FBA33@gmail.com> References: <20140117144208.GC15885@aluminium.local> <9BEA6991-1898-401D-9C76-C941EC5EFE94@gmail.com> <11F2259F-40B6-407B-91E5-74B4345FBA33@gmail.com> Message-ID: On 20/01/2014, at 11:06 PM, Dmitry Kolesnikov wrote: > Instead of porting flex input rules, I would take a look into flex interim results and try to map them to leex. Or better still, take a step _right_ back and look at the basic problem. Sometimes programmers using Lex or Flex use start conditions when they don't need to. PL/I-style comments are a good example of this. It's _easier_ to process them using start conditions, but it's _possible_ to process them without. Using start conditions: > "/*" BEGIN(comment); > > [^*\n]* /* eat anything that's not a '*' */ > "*"+[^*/\n]* /* eat up '*'s not followed by '/'s */ > \n ++line_num; > "*"+"/" BEGIN(INITIAL); Not using them: "/*"[^*]*"*"+([^/*][^*]*"*"+)*"/" { line_num += count_nls(yytext); } From vances@REDACTED Tue Jan 21 04:01:11 2014 From: vances@REDACTED (Vance Shipley) Date: Tue, 21 Jan 2014 08:31:11 +0530 Subject: [erlang-questions] Start Conditions in Lexical Analyzer Generator (leex) In-Reply-To: <11F2259F-40B6-407B-91E5-74B4345FBA33@gmail.com> References: <20140117144208.GC15885@aluminium.local> <9BEA6991-1898-401D-9C76-C941EC5EFE94@gmail.com> <11F2259F-40B6-407B-91E5-74B4345FBA33@gmail.com> Message-ID: <20140121030110.GB3813@aluminium.motivity.ca> On Mon, Jan 20, 2014 at 12:06:50PM +0200, Dmitry Kolesnikov wrote: } I think there is not a straight path from flex to Erlang leex. I looked way ack to Unix 7th Edition in 1978 and see that the original lex also included start conditions: http://cm.bell-labs.com/7thEdMan/v7vol2b.pdf (second paper) -- -Vance From avinash_dhumane@REDACTED Tue Jan 21 08:25:14 2014 From: avinash_dhumane@REDACTED (Avinash Dhumane) Date: Tue, 21 Jan 2014 12:55:14 +0530 Subject: [erlang-questions] Question on "selective receive" In-Reply-To: <003c01cf1501$29bc9890$7d35c9b0$@com> References: <003c01cf1501$29bc9890$7d35c9b0$@com> Message-ID: <000001cf1679$ee7199f0$cb54cdd0$@com> Just thought of sharing the information that Joe's book (pp 143-144, under section "Receive with Timeout Value of Zero/Infinity") answers this question. I had gone over these paragraphs several times in the past, but it is only after confronted with a real life situation where these constructs require application of mind that these small paragraphs illumined their real meaning. Oh, Erlang - you're beauty!! From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-bounces@REDACTED] On Behalf Of Avinash Dhumane Sent: 19 January 2014 15:58 To: erlang-questions@REDACTED Subject: [erlang-questions] Question on "selective receive" Can the timeout clause not have a guard too? If it can, what are the semantics of it? I mean, if the timeout occurs but guard evaluates to false, what happens to receive? Does it continue to block? If it cannot, why? Thanks Avinash -------------- next part -------------- An HTML attachment was scrubbed... URL: From pillai.sharmila@REDACTED Tue Jan 21 10:21:24 2014 From: pillai.sharmila@REDACTED (Sharmila Pillai) Date: Tue, 21 Jan 2014 09:21:24 +0000 Subject: [erlang-questions] diameter_sctp problem Message-ID: Hi, I'm encountering an error when using DIAMETER over SCTP. I turned on dbg tracing, and this is what I see. (<0.527.0>) call diameter_sctp:send(10,Bin,{transport,<0.526.0>,accept,#Port<0.10834>,96747,undefined,{16,10},2}) (<0.527.0>) call diameter_sctp:send(#Port<0.10834>,96747,10,Bin) (<0.527.0>) call diameter_sctp:x({send,einval}) (<0.527.0>) exception_from {diameter_sctp,x,1} {exit,{shutdown,{send,einval}}} (<0.527.0>) exception_from {diameter_sctp,send,4} {exit,{shutdown,{send,einval}}} (<0.527.0>) exception_from {diameter_sctp,send,3} {exit,{shutdown,{send,einval}}} (<0.527.0>) exception_from {diameter_sctp,send,2} {exit,{shutdown,{send,einval}}} (<0.527.0>) exception_from {diameter_sctp,transition,2} {exit,{shutdown,{send,einval}}} (<0.527.0>) exception_from {diameter_sctp,t,2} {exit,{shutdown,{send,einval}}} (<0.527.0>) exception_from {diameter_sctp,handle_info,2} {exit,{shutdown,{send,einval}}} (<0.527.0>) call diameter_sctp:terminate({shutdown,{send,einval}},{transport,<0.526.0>,accept,#Port<0.10834>,96747,undefined,{16,10},2}) (<0.527.0>) call diameter_sctp:close(#Port<0.10834>,96747) (<0.527.0>) returned from diameter_sctp:close/2 -> ok (<0.527.0>) returned from diameter_sctp:terminate/2 -> ok (<0.315.0>) call diameter_sctp:handle_info({'DOWN',#Ref<0.0.0.47966>,process,<0.527.0>,{shutdown,{send,einval}}},{listener,#Ref<0.0.0.1361>,#Port<0.4307>,2,786532, I'm not sure why {error, einval} is being returned when a response is being sent on the SCTP connection. If I look at the packet capture, it looks like an SCTP SHUTDOWN is being sent back. Any pointers please? Thanks, Sharmila -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Tue Jan 21 10:43:56 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 21 Jan 2014 10:43:56 +0100 Subject: [erlang-questions] cpu_topology on Mac OS X In-Reply-To: References: <0589296B5BCDDA4A8F5CEB3F8739A81576F0B734@SRV-EXCHMBX2.billing.ru> Message-ID: Hi Huiqing, To the best of my knowledge, it is not possible to query the CPU topology on OSX. Neither is it possible to bind schedulers to cores on OSX. On Fri, Jan 17, 2014 at 10:05 PM, wrote: > Hi All, > > I wonder if anybody knows how to get the cpu_topology on Max OS X. It seems > that erlang:system_info(cpu_topology) just returns 'undefined'. Many > Thanks! > > Kind Regards, > Huiqing > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anders.otp@REDACTED Tue Jan 21 13:15:59 2014 From: anders.otp@REDACTED (Anders Svensson) Date: Tue, 21 Jan 2014 13:15:59 +0100 Subject: [erlang-questions] diameter_sctp problem In-Reply-To: References: Message-ID: Hi Sharmilla. On Tue, Jan 21, 2014 at 10:21 AM, Sharmila Pillai wrote: > Hi, > > I'm encountering an error when using DIAMETER over SCTP. > > I turned on dbg tracing, and this is what I see. > > (<0.527.0>) call > diameter_sctp:send(10,Bin,{transport,<0.526.0>,accept,#Port<0.10834>,96747,undefined,{16,10},2}) The stream identifier here (first argument) looks to be equal to the number of outbound streams, which is 1 more than the maximal stream identifier. Are you setting the stream identifier explicitly when sending? /Anders, Erlang/OTP > (<0.527.0>) call diameter_sctp:send(#Port<0.10834>,96747,10,Bin) > (<0.527.0>) call diameter_sctp:x({send,einval}) > (<0.527.0>) exception_from {diameter_sctp,x,1} > {exit,{shutdown,{send,einval}}} > (<0.527.0>) exception_from {diameter_sctp,send,4} > {exit,{shutdown,{send,einval}}} > (<0.527.0>) exception_from {diameter_sctp,send,3} > {exit,{shutdown,{send,einval}}} > (<0.527.0>) exception_from {diameter_sctp,send,2} > {exit,{shutdown,{send,einval}}} > (<0.527.0>) exception_from {diameter_sctp,transition,2} > {exit,{shutdown,{send,einval}}} > (<0.527.0>) exception_from {diameter_sctp,t,2} > {exit,{shutdown,{send,einval}}} > (<0.527.0>) exception_from {diameter_sctp,handle_info,2} > {exit,{shutdown,{send,einval}}} > (<0.527.0>) call > diameter_sctp:terminate({shutdown,{send,einval}},{transport,<0.526.0>,accept,#Port<0.10834>,96747,undefined,{16,10},2}) > (<0.527.0>) call diameter_sctp:close(#Port<0.10834>,96747) > (<0.527.0>) returned from diameter_sctp:close/2 -> ok > (<0.527.0>) returned from diameter_sctp:terminate/2 -> ok > (<0.315.0>) call > diameter_sctp:handle_info({'DOWN',#Ref<0.0.0.47966>,process,<0.527.0>,{shutdown,{send,einval}}},{listener,#Ref<0.0.0.1361>,#Port<0.4307>,2,786532, > > I'm not sure why {error, einval} is being returned when a response is being > sent on the SCTP connection. If I look at the packet capture, it looks like > an SCTP SHUTDOWN is being sent back. Any pointers please? > > Thanks, > Sharmila > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From anders.otp@REDACTED Tue Jan 21 17:42:21 2014 From: anders.otp@REDACTED (Anders Svensson) Date: Tue, 21 Jan 2014 17:42:21 +0100 Subject: [erlang-questions] diameter_sctp problem In-Reply-To: References: Message-ID: Hi Sharmilla. On Tue, Jan 21, 2014 at 2:29 PM, Sharmila Pillai wrote: > Hi Anders, > > No, I am not setting the stream identifier explicitly. The SID in the > request is 10 and the diameter module seems to put that in the response as > well? Indeed it does, which is just plain wrong. It's the fact that you have a more inbound streams than outbound streams that causes you to run into the fault. You can work around it when replying to a request by explicitly setting transport_data = undefined in a diameter_packet record containing the answer message. A fix should make its way to github by next week. Thanks for the report. /Anders, Erlang/OTP > > regards, > Sharmila. > > > On Tue, Jan 21, 2014 at 12:15 PM, Anders Svensson > wrote: >> >> Hi Sharmilla. >> >> On Tue, Jan 21, 2014 at 10:21 AM, Sharmila Pillai >> wrote: >> > Hi, >> > >> > I'm encountering an error when using DIAMETER over SCTP. >> > >> > I turned on dbg tracing, and this is what I see. >> > >> > (<0.527.0>) call >> > >> > diameter_sctp:send(10,Bin,{transport,<0.526.0>,accept,#Port<0.10834>,96747,undefined,{16,10},2}) >> >> The stream identifier here (first argument) looks to be equal to the >> number of outbound streams, which is 1 more than the maximal stream >> identifier. Are you setting the stream identifier explicitly when >> sending? >> >> /Anders, Erlang/OTP >> >> >> > (<0.527.0>) call diameter_sctp:send(#Port<0.10834>,96747,10,Bin) >> > (<0.527.0>) call diameter_sctp:x({send,einval}) >> > (<0.527.0>) exception_from {diameter_sctp,x,1} >> > {exit,{shutdown,{send,einval}}} >> > (<0.527.0>) exception_from {diameter_sctp,send,4} >> > {exit,{shutdown,{send,einval}}} >> > (<0.527.0>) exception_from {diameter_sctp,send,3} >> > {exit,{shutdown,{send,einval}}} >> > (<0.527.0>) exception_from {diameter_sctp,send,2} >> > {exit,{shutdown,{send,einval}}} >> > (<0.527.0>) exception_from {diameter_sctp,transition,2} >> > {exit,{shutdown,{send,einval}}} >> > (<0.527.0>) exception_from {diameter_sctp,t,2} >> > {exit,{shutdown,{send,einval}}} >> > (<0.527.0>) exception_from {diameter_sctp,handle_info,2} >> > {exit,{shutdown,{send,einval}}} >> > (<0.527.0>) call >> > >> > diameter_sctp:terminate({shutdown,{send,einval}},{transport,<0.526.0>,accept,#Port<0.10834>,96747,undefined,{16,10},2}) >> > (<0.527.0>) call diameter_sctp:close(#Port<0.10834>,96747) >> > (<0.527.0>) returned from diameter_sctp:close/2 -> ok >> > (<0.527.0>) returned from diameter_sctp:terminate/2 -> ok >> > (<0.315.0>) call >> > >> > diameter_sctp:handle_info({'DOWN',#Ref<0.0.0.47966>,process,<0.527.0>,{shutdown,{send,einval}}},{listener,#Ref<0.0.0.1361>,#Port<0.4307>,2,786532, >> > >> > I'm not sure why {error, einval} is being returned when a response is >> > being >> > sent on the SCTP connection. If I look at the packet capture, it looks >> > like >> > an SCTP SHUTDOWN is being sent back. Any pointers please? >> > >> > Thanks, >> > Sharmila >> > >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > > > From davidnwelton@REDACTED Tue Jan 21 17:49:32 2014 From: davidnwelton@REDACTED (David Welton) Date: Tue, 21 Jan 2014 17:49:32 +0100 Subject: [erlang-questions] Mixing casts and calls In-Reply-To: References: Message-ID: > Assuming your Erlang node handles the RPC call from the Java node with a gen_server, why not respond with {no_reply, ...} to the Java-server, send an asynchronous request to the C-server, handle the response in a handle_info, and then reply to the Java-server with gen_server:reply/2? This way, you leave all the timeout handling to the Java-node. > > The issue with this approach is that you must find a way to preserve the >From argument to your handle_call callback, so that you can pass it on to gen_server:reply/2 at a later stage, but that might be an easier problem to solve. I had overlooked/not thought of that, so that is a pretty good solution and relatively clean from our point of view. Thank you! -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From pillai.sharmila@REDACTED Tue Jan 21 14:29:00 2014 From: pillai.sharmila@REDACTED (Sharmila Pillai) Date: Tue, 21 Jan 2014 13:29:00 +0000 Subject: [erlang-questions] diameter_sctp problem In-Reply-To: References: Message-ID: Hi Anders, No, I am not setting the stream identifier explicitly. The SID in the request is 10 and the diameter module seems to put that in the response as well? regards, Sharmila. On Tue, Jan 21, 2014 at 12:15 PM, Anders Svensson wrote: > Hi Sharmilla. > > On Tue, Jan 21, 2014 at 10:21 AM, Sharmila Pillai > wrote: > > Hi, > > > > I'm encountering an error when using DIAMETER over SCTP. > > > > I turned on dbg tracing, and this is what I see. > > > > (<0.527.0>) call > > > diameter_sctp:send(10,Bin,{transport,<0.526.0>,accept,#Port<0.10834>,96747,undefined,{16,10},2}) > > The stream identifier here (first argument) looks to be equal to the > number of outbound streams, which is 1 more than the maximal stream > identifier. Are you setting the stream identifier explicitly when > sending? > > /Anders, Erlang/OTP > > > > (<0.527.0>) call diameter_sctp:send(#Port<0.10834>,96747,10,Bin) > > (<0.527.0>) call diameter_sctp:x({send,einval}) > > (<0.527.0>) exception_from {diameter_sctp,x,1} > > {exit,{shutdown,{send,einval}}} > > (<0.527.0>) exception_from {diameter_sctp,send,4} > > {exit,{shutdown,{send,einval}}} > > (<0.527.0>) exception_from {diameter_sctp,send,3} > > {exit,{shutdown,{send,einval}}} > > (<0.527.0>) exception_from {diameter_sctp,send,2} > > {exit,{shutdown,{send,einval}}} > > (<0.527.0>) exception_from {diameter_sctp,transition,2} > > {exit,{shutdown,{send,einval}}} > > (<0.527.0>) exception_from {diameter_sctp,t,2} > > {exit,{shutdown,{send,einval}}} > > (<0.527.0>) exception_from {diameter_sctp,handle_info,2} > > {exit,{shutdown,{send,einval}}} > > (<0.527.0>) call > > > diameter_sctp:terminate({shutdown,{send,einval}},{transport,<0.526.0>,accept,#Port<0.10834>,96747,undefined,{16,10},2}) > > (<0.527.0>) call diameter_sctp:close(#Port<0.10834>,96747) > > (<0.527.0>) returned from diameter_sctp:close/2 -> ok > > (<0.527.0>) returned from diameter_sctp:terminate/2 -> ok > > (<0.315.0>) call > > > diameter_sctp:handle_info({'DOWN',#Ref<0.0.0.47966>,process,<0.527.0>,{shutdown,{send,einval}}},{listener,#Ref<0.0.0.1361>,#Port<0.4307>,2,786532, > > > > I'm not sure why {error, einval} is being returned when a response is > being > > sent on the SCTP connection. If I look at the packet capture, it looks > like > > an SCTP SHUTDOWN is being sent back. Any pointers please? > > > > Thanks, > > Sharmila > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Tue Jan 21 21:04:41 2014 From: sergej.jurecko@REDACTED (Sergej Jurecko) Date: Tue, 21 Jan 2014 21:04:41 +0100 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database Message-ID: <0444266B-3D4E-48CC-B4BA-961362C39853@gmail.com> hello, I'm happy to announce the first public release of ActorDB. ActorDB is a distributed SQL database. It combines the query capabilities of relational SQL databases with the scalability of a KV store. More info at: https://github.com/biokoda/actordb How to configure and run: https://github.com/biokoda/actordb/blob/master/CONFIGURE.md deb package: https://s3-eu-west-1.amazonaws.com/biokoda/actordb_0.5-1_amd64.deb osx package: https://s3-eu-west-1.amazonaws.com/biokoda/actordb-0.5-OSX-x86_64.tar.gz more packages to come... thank you, Sergej Jure?ko -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean@REDACTED Tue Jan 21 21:16:05 2014 From: sean@REDACTED (Sean Cribbs) Date: Tue, 21 Jan 2014 14:16:05 -0600 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database In-Reply-To: <0444266B-3D4E-48CC-B4BA-961362C39853@gmail.com> References: <0444266B-3D4E-48CC-B4BA-961362C39853@gmail.com> Message-ID: I'm curious, what level of isolation does ActorDB run at, and how is it enforced? On Tue, Jan 21, 2014 at 2:04 PM, Sergej Jurecko wrote: > hello, > > I'm happy to announce the first public release of ActorDB. > > ActorDB is a distributed SQL database. It combines the query capabilities > of relational SQL databases with the scalability of a KV store. > > More info at: https://github.com/biokoda/actordb > How to configure and run: > https://github.com/biokoda/actordb/blob/master/CONFIGURE.md > deb package: > https://s3-eu-west-1.amazonaws.com/biokoda/actordb_0.5-1_amd64.deb > osx package: > https://s3-eu-west-1.amazonaws.com/biokoda/actordb-0.5-OSX-x86_64.tar.gz > more packages to come... > > > thank you, > Sergej Jure?ko > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Sean Cribbs Software Engineer Basho Technologies, Inc. http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Tue Jan 21 21:34:09 2014 From: sergej.jurecko@REDACTED (Sergej Jurecko) Date: Tue, 21 Jan 2014 21:34:09 +0100 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database In-Reply-To: References: <0444266B-3D4E-48CC-B4BA-961362C39853@gmail.com> Message-ID: Every actor is an erlang process on each of node of its cluster, one of which is master and that master executes all reads and writes. Until a write is commited no reads or writes are allowed to that actor. The master erlang process queues all calls. We may loosen that a bit in the future. Allow reads to be executed on slaves if master is locked for write. Sergej On Jan 21, 2014, at 9:16 PM, Sean Cribbs wrote: > I'm curious, what level of isolation does ActorDB run at, and how is it enforced? > > > On Tue, Jan 21, 2014 at 2:04 PM, Sergej Jurecko wrote: > hello, > > I'm happy to announce the first public release of ActorDB. > > ActorDB is a distributed SQL database. It combines the query capabilities of relational SQL databases with the scalability of a KV store. > > More info at: https://github.com/biokoda/actordb > How to configure and run: https://github.com/biokoda/actordb/blob/master/CONFIGURE.md > deb package: https://s3-eu-west-1.amazonaws.com/biokoda/actordb_0.5-1_amd64.deb > osx package: https://s3-eu-west-1.amazonaws.com/biokoda/actordb-0.5-OSX-x86_64.tar.gz > more packages to come... > > > thank you, > Sergej Jure?ko > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- > Sean Cribbs > Software Engineer > Basho Technologies, Inc. > http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ludovic@REDACTED Tue Jan 21 23:02:52 2014 From: ludovic@REDACTED (Ludovic Demblans) Date: Tue, 21 Jan 2014 23:02:52 +0100 Subject: [erlang-questions] Mixing casts and calls In-Reply-To: References: Message-ID: To preserve the from argument you could just, in your handle_call, spawn a process : handle_call(what_version, From, State=#state{cnode=CNode}) -> Self = self(), spawn(fun() -> Reply = cnode_handler:call(what_version, CNode), Self ! {cnode_reply,Reply,From} end), {noreply, State}. handle_info({cnode_reply, Reply, From},State) -> gen_server:reply(From,Reply), {noreply,State}. Seems it could work. Le Fri, 17 Jan 2014 10:27:58 +0100, Daniel Abrahamsson a ?crit: > Assuming your Erlang node handles the RPC call from the Java node with a > gen_server, why not respond with {no_reply, ...} to the Java-server, send > an asynchronous request to the C-server, handle the response in a > handle_info, and then reply to the Java-server with gen_server:reply/2? > This way, you leave all the timeout handling to the Java-node. > > The issue with this approach is that you must find a way to preserve the > From argument to your handle_call callback, so that you can pass it on to > gen_server:reply/2 at a later stage, but that might be an easier problem > to > solve. > > //Daniel > > > On Fri, Jan 17, 2014 at 10:17 AM, David Welton > wrote: > >> Hi, >> >> I am working with a system that looks like this: >> >> C node <=======> Erlang <========> Java Node >> >> And we're looking at good ways to integrate everything. >> >> For instance, we want the Java node to be able to do a simple query >> that ends up getting some data from the C node, say, the version it's >> running or something like that. >> >> Since the Java code needs to be simple, we want to do the equivalent >> of rpc:call(hw_server, get_version, []) and wait for the answer. It >> shouldn't take long, and timeouts or whatever can be handled by Java >> in that case. >> >> However, to interact with the C node, the gen_server that manages it >> would want to do something like: >> >> {any, 'c@REDACTED'} ! get_version >> >> And then get the answer via handle_info. >> >> But if we're going to transform what is essentiall a 'call' - >> hw_server:get_version() - into a cast/response, somewhere there's got >> to be a receive. For instance: >> >> get_version() -> >> Ref = make_ref(), >> gen_server:cast(hw_server, {get_version, Ref}), >> receive >> {Ref, version, Version} -> >> Version >> end >> >> This feels like I've left OTP behind though. >> >> We could put the receive in the handle_cast for the gen_server, but >> then that's going to block the whole thing on one call, which strikes >> me as a bad idea, although I guess it could also be used to protect >> the C node if it were unable to process more than one thing at once. >> >> Another approach would be to further work with our Java guy to have >> him send and receive the messages, but we were kind of hoping to hide >> some of the complexity from that part of the system. >> >> Thank you, >> -- >> David N. Welton >> >> http://www.welton.it/davidw/ >> >> http://www.dedasys.com/ >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> -- Utilisant le logiciel de courrier r?volutionnaire d'Opera : http://www.opera.com/mail/ From james@REDACTED Tue Jan 21 23:06:55 2014 From: james@REDACTED (James Aimonetti) Date: Tue, 21 Jan 2014 14:06:55 -0800 Subject: [erlang-questions] Mixing casts and calls In-Reply-To: References: Message-ID: <52DEEF7F.7010400@2600hz.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 You can call gen_server:reply/2 directly from the spawned process, afaik. No need to send the response back to the gen_server to do the reply. ... spawn(fun() -> gen_server:reply(From, cnode_handler:call(what_version, CNode)) end), ... On 01/21/2014 02:02 PM, Ludovic Demblans wrote: > To preserve the from argument you could just, in your handle_call, > spawn a process : > > > handle_call(what_version, From, State=#state{cnode=CNode}) -> Self > = self(), spawn(fun() -> Reply = cnode_handler:call(what_version, > CNode), Self ! {cnode_reply,Reply,From} end), {noreply, State}. > > handle_info({cnode_reply, Reply, From},State) -> > gen_server:reply(From,Reply), {noreply,State}. > > > Seems it could work. > > > > Le Fri, 17 Jan 2014 10:27:58 +0100, Daniel Abrahamsson > a ?crit: > >> Assuming your Erlang node handles the RPC call from the Java node >> with a gen_server, why not respond with {no_reply, ...} to the >> Java-server, send an asynchronous request to the C-server, handle >> the response in a handle_info, and then reply to the Java-server >> with gen_server:reply/2? This way, you leave all the timeout >> handling to the Java-node. >> >> The issue with this approach is that you must find a way to >> preserve the From argument to your handle_call callback, so that >> you can pass it on to gen_server:reply/2 at a later stage, but >> that might be an easier problem to solve. >> >> //Daniel >> >> >> On Fri, Jan 17, 2014 at 10:17 AM, David Welton >> wrote: >> >>> Hi, >>> >>> I am working with a system that looks like this: >>> >>> C node <=======> Erlang <========> Java Node >>> >>> And we're looking at good ways to integrate everything. >>> >>> For instance, we want the Java node to be able to do a simple >>> query that ends up getting some data from the C node, say, the >>> version it's running or something like that. >>> >>> Since the Java code needs to be simple, we want to do the >>> equivalent of rpc:call(hw_server, get_version, []) and wait for >>> the answer. It shouldn't take long, and timeouts or whatever >>> can be handled by Java in that case. >>> >>> However, to interact with the C node, the gen_server that >>> manages it would want to do something like: >>> >>> {any, 'c@REDACTED'} ! get_version >>> >>> And then get the answer via handle_info. >>> >>> But if we're going to transform what is essentiall a 'call' - >>> hw_server:get_version() - into a cast/response, somewhere >>> there's got to be a receive. For instance: >>> >>> get_version() -> Ref = make_ref(), gen_server:cast(hw_server, >>> {get_version, Ref}), receive {Ref, version, Version} -> >>> Version end >>> >>> This feels like I've left OTP behind though. >>> >>> We could put the receive in the handle_cast for the gen_server, >>> but then that's going to block the whole thing on one call, >>> which strikes me as a bad idea, although I guess it could also >>> be used to protect the C node if it were unable to process more >>> than one thing at once. >>> >>> Another approach would be to further work with our Java guy to >>> have him send and receive the messages, but we were kind of >>> hoping to hide some of the complexity from that part of the >>> system. >>> >>> Thank you, -- David N. Welton >>> >>> http://www.welton.it/davidw/ >>> >>> http://www.dedasys.com/ >>> _______________________________________________ >>> erlang-questions mailing list erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> > > - -- James Aimonetti Lead Systems Architect "I thought I fixed that" 2600Hz | http://2600hz.com sip:james@REDACTED tel:415.886.7905 irc:mc_ @ freenode -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlLe738ACgkQ54NxaUq7OmCnzwD+JmvOrFAhvuMnoTOkGwEzUvOw 0WwjnwmZbCMvRCnrTN4A/1QHZC7Z+36B0qsiglOs3SKlen0QexYGk0Fyak9Ol4CX =cYK7 -----END PGP SIGNATURE----- From rexxe98@REDACTED Wed Jan 22 00:10:21 2014 From: rexxe98@REDACTED (Andrew Berman) Date: Tue, 21 Jan 2014 15:10:21 -0800 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database In-Reply-To: References: <0444266B-3D4E-48CC-B4BA-961362C39853@gmail.com> Message-ID: Wow, this looks great! Is this being used in a production environment at all? Thanks, Andrew On Tue, Jan 21, 2014 at 12:34 PM, Sergej Jurecko wrote: > Every actor is an erlang process on each of node of its cluster, one of > which is master and that master executes all reads and writes. > Until a write is commited no reads or writes are allowed to that actor. > The master erlang process queues all calls. > We may loosen that a bit in the future. Allow reads to be executed on > slaves if master is locked for write. > > > Sergej > > On Jan 21, 2014, at 9:16 PM, Sean Cribbs wrote: > > I'm curious, what level of isolation does ActorDB run at, and how is it > enforced? > > > On Tue, Jan 21, 2014 at 2:04 PM, Sergej Jurecko wrote: > >> hello, >> >> I'm happy to announce the first public release of ActorDB. >> >> ActorDB is a distributed SQL database. It combines the query capabilities >> of relational SQL databases with the scalability of a KV store. >> >> More info at: https://github.com/biokoda/actordb >> How to configure and run: >> https://github.com/biokoda/actordb/blob/master/CONFIGURE.md >> deb package: >> https://s3-eu-west-1.amazonaws.com/biokoda/actordb_0.5-1_amd64.deb >> osx package: >> https://s3-eu-west-1.amazonaws.com/biokoda/actordb-0.5-OSX-x86_64.tar.gz >> more packages to come... >> >> >> thank you, >> Sergej Jure?ko >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > -- > Sean Cribbs > Software Engineer > Basho Technologies, Inc. > http://basho.com/ > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Wed Jan 22 04:33:28 2014 From: sergej.jurecko@REDACTED (Sergej Jurecko) Date: Wed, 22 Jan 2014 04:33:28 +0100 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database In-Reply-To: References: <0444266B-3D4E-48CC-B4BA-961362C39853@gmail.com> Message-ID: Not yet but it's stable. Which is why we decided to release it to the public. We are building our products on top of it at the moment. Sergej On Jan 22, 2014, at 12:10 AM, Andrew Berman wrote: > Wow, this looks great! Is this being used in a production environment at all? > > Thanks, > > Andrew > > > On Tue, Jan 21, 2014 at 12:34 PM, Sergej Jurecko wrote: > Every actor is an erlang process on each of node of its cluster, one of which is master and that master executes all reads and writes. > Until a write is commited no reads or writes are allowed to that actor. The master erlang process queues all calls. > We may loosen that a bit in the future. Allow reads to be executed on slaves if master is locked for write. > > > Sergej > > On Jan 21, 2014, at 9:16 PM, Sean Cribbs wrote: > >> I'm curious, what level of isolation does ActorDB run at, and how is it enforced? >> >> >> On Tue, Jan 21, 2014 at 2:04 PM, Sergej Jurecko wrote: >> hello, >> >> I'm happy to announce the first public release of ActorDB. >> >> ActorDB is a distributed SQL database. It combines the query capabilities of relational SQL databases with the scalability of a KV store. >> >> More info at: https://github.com/biokoda/actordb >> How to configure and run: https://github.com/biokoda/actordb/blob/master/CONFIGURE.md >> deb package: https://s3-eu-west-1.amazonaws.com/biokoda/actordb_0.5-1_amd64.deb >> osx package: https://s3-eu-west-1.amazonaws.com/biokoda/actordb-0.5-OSX-x86_64.tar.gz >> more packages to come... >> >> >> thank you, >> Sergej Jure?ko >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> >> -- >> Sean Cribbs >> Software Engineer >> Basho Technologies, Inc. >> http://basho.com/ > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Wed Jan 22 07:22:23 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 22 Jan 2014 10:22:23 +0400 Subject: [erlang-questions] How to redirect lager_console_backend to remsh-ed node Message-ID: Is it possible to add console backend to lager and capture all output to screen when I connect to node via remsh? Looks like it is related to group leaders but group leader is a property of whole lager_event, not of exact handler. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyron.zerafa@REDACTED Wed Jan 22 08:19:41 2014 From: tyron.zerafa@REDACTED (Tyron Zerafa) Date: Wed, 22 Jan 2014 08:19:41 +0100 Subject: [erlang-questions] Percept2 and gen_server messages In-Reply-To: <0928ab3df7be131701382feb56192c41.squirrel@webmail.cs.kent.ac.uk> References: <0928ab3df7be131701382feb56192c41.squirrel@webmail.cs.kent.ac.uk> Message-ID: That did the trick, I changed the function which I was profiling and everything worked like charm :) Cheers On Sun, Jan 19, 2014 at 10:22 PM, wrote: > Hi Tyron, > > Percept2 monitors both types of communications (via explicit message > passing and the gen_server:call/2). The reason that you got only one > message send/receive is that the 'start_link' function you profiled > returned immediately after the gen_server has been started, so the process > you saw was the process that started the gen_server process, not the > gen_server process itself. > > Kind Regards, > Huiqing > > > Hi all, > > > > I am trying to use Percept2 to find out the communication overhead of > > a > > gen_server process. However, when I'm analyzing the "*.dat" generated I'm > > only finding the following for my gen_server process (code below): > > msgs_recv = 1 > > avg_size_msgs_recv = 18 > > msgs_sent = 1 > > avg_size_msgs_sent = 72 > > > > We are communicating with this server both via messages (ServerPid ! > > {test}) and the gen_server:call/2 > > > > Are we missing something here? Shouldn't the request/ replies be recorded > > as msgs? > > > > > > > > > > > > > > > > > > %% gen_server code > > -module(test_percept_1). > > > > -behaviour(gen_server). > > > > -define(SERVER, ?MODULE). > > > > -export([ > > init/1, > > handle_call/3, > > start_link/0, > > handle_info/2 , > > ..... > > ]). > > > > start_profiling() -> > > percept2:profile("data.dat", {test_percept_1,start_link, []},[all]). > > stop_profiling() -> > > percept2:stop(). > > start_link() -> > > case gen_server:start_link({local, ?SERVER}, ?SERVER, [], []) of > > {ok, Pid} -> > > io:format("Gen_server started: ~p on node: ~p. ~n",[Pid,node()]), > > {ok,Pid}; > > Other -> > > io:format("Error starting ~p: ~p. ~n",[?SERVER,Other]), > > {error, Other} > > end. > > init([]) -> {ok,[]}. > > > > .... > > > > handle_call({test},_From,State)-> > > {reply,"This is a test string",State}. > > > > ..... > > handle_info(_, State) -> > > {noreply,state}. > > > > ..... > > > > > > > > -- > > Best Regards, > > Tyron Zerafa > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- Best Regards, Tyron Zerafa -------------- next part -------------- An HTML attachment was scrubbed... URL: From barcojie@REDACTED Wed Jan 22 09:37:41 2014 From: barcojie@REDACTED (Barco You) Date: Wed, 22 Jan 2014 16:37:41 +0800 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database In-Reply-To: References: <0444266B-3D4E-48CC-B4BA-961362C39853@gmail.com> Message-ID: Any benchmark with other SQL DB, such as mysql and postgres? Barco On Wed, Jan 22, 2014 at 11:33 AM, Sergej Jurecko wrote: > Not yet but it's stable. Which is why we decided to release it to the > public. > We are building our products on top of it at the moment. > > > Sergej > > > On Jan 22, 2014, at 12:10 AM, Andrew Berman wrote: > > Wow, this looks great! Is this being used in a production environment at > all? > > Thanks, > > Andrew > > > On Tue, Jan 21, 2014 at 12:34 PM, Sergej Jurecko > wrote: > >> Every actor is an erlang process on each of node of its cluster, one of >> which is master and that master executes all reads and writes. >> Until a write is commited no reads or writes are allowed to that actor. >> The master erlang process queues all calls. >> We may loosen that a bit in the future. Allow reads to be executed on >> slaves if master is locked for write. >> >> >> Sergej >> >> On Jan 21, 2014, at 9:16 PM, Sean Cribbs wrote: >> >> I'm curious, what level of isolation does ActorDB run at, and how is it >> enforced? >> >> >> On Tue, Jan 21, 2014 at 2:04 PM, Sergej Jurecko > > wrote: >> >>> hello, >>> >>> I'm happy to announce the first public release of ActorDB. >>> >>> ActorDB is a distributed SQL database. It combines the query >>> capabilities of relational SQL databases with the scalability of a KV store. >>> >>> More info at: https://github.com/biokoda/actordb >>> How to configure and run: >>> https://github.com/biokoda/actordb/blob/master/CONFIGURE.md >>> deb package: >>> https://s3-eu-west-1.amazonaws.com/biokoda/actordb_0.5-1_amd64.deb >>> osx package: >>> https://s3-eu-west-1.amazonaws.com/biokoda/actordb-0.5-OSX-x86_64.tar.gz >>> more packages to come... >>> >>> >>> thank you, >>> Sergej Jure?ko >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> >> -- >> Sean Cribbs >> Software Engineer >> Basho Technologies, Inc. >> http://basho.com/ >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Wed Jan 22 10:13:47 2014 From: sergej.jurecko@REDACTED (=?UTF-8?Q?Sergej_Jure=C4=8Dko?=) Date: Wed, 22 Jan 2014 10:13:47 +0100 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database In-Reply-To: References: <0444266B-3D4E-48CC-B4BA-961362C39853@gmail.com> Message-ID: Not yet. It's not really an apples to apples comparison however. Traditional monolithic SQL DBs are designed to maximize performance of a single machine. ActorDB being a distributed DB is designed for maximum scalability. That is distributing load over many machines without single points of failure or global locks. Sergej On Wed, Jan 22, 2014 at 9:37 AM, Barco You wrote: > Any benchmark with other SQL DB, such as mysql and postgres? > > > Barco > > > On Wed, Jan 22, 2014 at 11:33 AM, Sergej Jurecko > wrote: > >> Not yet but it's stable. Which is why we decided to release it to the >> public. >> We are building our products on top of it at the moment. >> >> >> Sergej >> >> >> On Jan 22, 2014, at 12:10 AM, Andrew Berman wrote: >> >> Wow, this looks great! Is this being used in a production environment at >> all? >> >> Thanks, >> >> Andrew >> >> >> On Tue, Jan 21, 2014 at 12:34 PM, Sergej Jurecko < >> sergej.jurecko@REDACTED> wrote: >> >>> Every actor is an erlang process on each of node of its cluster, one of >>> which is master and that master executes all reads and writes. >>> Until a write is commited no reads or writes are allowed to that actor. >>> The master erlang process queues all calls. >>> We may loosen that a bit in the future. Allow reads to be executed on >>> slaves if master is locked for write. >>> >>> >>> Sergej >>> >>> On Jan 21, 2014, at 9:16 PM, Sean Cribbs wrote: >>> >>> I'm curious, what level of isolation does ActorDB run at, and how is it >>> enforced? >>> >>> >>> On Tue, Jan 21, 2014 at 2:04 PM, Sergej Jurecko < >>> sergej.jurecko@REDACTED> wrote: >>> >>>> hello, >>>> >>>> I'm happy to announce the first public release of ActorDB. >>>> >>>> ActorDB is a distributed SQL database. It combines the query >>>> capabilities of relational SQL databases with the scalability of a KV store. >>>> >>>> More info at: https://github.com/biokoda/actordb >>>> How to configure and run: >>>> https://github.com/biokoda/actordb/blob/master/CONFIGURE.md >>>> deb package: >>>> https://s3-eu-west-1.amazonaws.com/biokoda/actordb_0.5-1_amd64.deb >>>> osx package: >>>> https://s3-eu-west-1.amazonaws.com/biokoda/actordb-0.5-OSX-x86_64.tar.gz >>>> more packages to come... >>>> >>>> >>>> thank you, >>>> Sergej Jure?ko >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >>> >>> -- >>> Sean Cribbs >>> Software Engineer >>> Basho Technologies, Inc. >>> http://basho.com/ >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Wed Jan 22 12:45:23 2014 From: roger@REDACTED (Roger Lipscombe) Date: Wed, 22 Jan 2014 11:45:23 +0000 Subject: [erlang-questions] Erlang shell hangs at Ctrl+G, Q -- how to debug? Message-ID: Occasionally, when I attempt to terminate my Erlang shell by using Ctrl+G, Q, it hangs. How can I debug what's causing this? Thanks, Roger. From dmkolesnikov@REDACTED Wed Jan 22 16:21:46 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Wed, 22 Jan 2014 17:21:46 +0200 Subject: [erlang-questions] dets i/o by pid Message-ID: Hello, This is both announcement and request for comments. The internal DETS architecture uses process per bucket instance but process pid is hidden behind dets registry. It am really curious why it so. The direct usage of PID would benefit in many cases (e.g. sharding, distributed i/o, etc). I would agree that remote dets i/o cannot be guaranteed and would require a substantial effort from an application. However, many application would benefit from best-effort pid based dets i/o. On another hand, any one can implement a process wrapper over dets but what is the point of doing this if dets bucket is already a process. Any thoughts on the subject? I?ve made simple application that implements a subset of dets interface but uses pid. https://github.com/fogfish/d3 - Dmitry From valery.meleshkin@REDACTED Wed Jan 22 22:19:25 2014 From: valery.meleshkin@REDACTED (Valery Meleshkin) Date: Thu, 23 Jan 2014 01:19:25 +0400 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database (Sergej Jurecko) In-Reply-To: References: Message-ID: <309CCC64-D378-4D8C-80AE-250EDC3D543D@gmail.com> Hi Sergej, Which algorithms were used to build it? How its architecture looks like? How testing process looks like? Specifically I?m interested in the details of replication, inter-actor transaction coordination, replica placement and membership service (e.g. raft/paxos/2pc/ 2pc over paxos ensembles/?). -- Sincerely, (Mr.) Valery Meleshkin From sergej.jurecko@REDACTED Thu Jan 23 06:51:18 2014 From: sergej.jurecko@REDACTED (Sergej Jurecko) Date: Thu, 23 Jan 2014 06:51:18 +0100 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database (Sergej Jurecko) In-Reply-To: <309CCC64-D378-4D8C-80AE-250EDC3D543D@gmail.com> References: <309CCC64-D378-4D8C-80AE-250EDC3D543D@gmail.com> Message-ID: <426F55E5-3EBF-4457-8C0B-77655E555C10@gmail.com> Hello, I am writing an article on this topic at the moment. It should be posted somewhere either tomorrow or monday. I will reply with it once it is posted. Sergej On Jan 22, 2014, at 10:19 PM, Valery Meleshkin wrote: > Hi Sergej, > > Which algorithms were used to build it? How its architecture looks like? How testing process looks like? > Specifically I?m interested in the details of replication, inter-actor transaction coordination, replica placement and membership service (e.g. raft/paxos/2pc/ 2pc over paxos ensembles/?). > > -- > Sincerely, > (Mr.) Valery Meleshkin > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From vances@REDACTED Thu Jan 23 15:54:41 2014 From: vances@REDACTED (Vance Shipley) Date: Thu, 23 Jan 2014 20:24:41 +0530 Subject: [erlang-questions] Dynamic Code and Atoms Message-ID: <20140123145441.GA13510@aluminium.local> I am finding that when I dynamically build a function with a very large number of clauses the emulator crashes while compilig (cmpile:forms/2) after hitting the atom table limit. Looking at a erl_crash_.dump I can see that it was filling up the atom table with 'corN' where N is an ever increasing number. Is this a design limitation? -- -Vance From tuncer.ayaz@REDACTED Thu Jan 23 16:18:59 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Thu, 23 Jan 2014 16:18:59 +0100 Subject: [erlang-questions] [erlang-patches] Proposal: reinstate pre-built PLT for Dialyzer In-Reply-To: References: Message-ID: On Thu, Jan 16, 2014 at 7:15 PM, Sean Cribbs wrote: > Hi Erlangers, > > Ages ago, OTP shipped with a pre-built PLT for dialyzer, which was > removed reasons forgotten by most of us (probably the time/cost of > building it). Nowadays, because dialyzer is much improved > (parallelism!) and our computers are faster and have more cores, a > PLT for all of the standard library might only take a few minutes to > build. > > We've been increasing our usage of dialyzer at Basho and I have felt > that it seems extremely wasteful and unnecessary to build a partial > PLT of the standard library for every single project, when that > information only changes across OTP releases. I feel the Erlang/OTP > build process should include building a PLT that encompasses the > entire standard library. Aside from the reduced cost of building > PLTs for every different app, this may encourage others to start > using dialyzer on their projects. How do you define the standard library? I mean, why not include all libs/apps? I usually build a comprehensive PLT for each OTP release and unfortunately that uncovers type errors which should not be shipped in a release :(. > I'm offering to do the work to make this happen, but I need a little > guidance on where to start. I've looked at the dialyzer Makefile > from an older release where the PLT was included, but I'm concerned > the project structure has changed enough that the rules there no > longer apply. It seems the dialyzer runtime itself might also need > to be tweaked to automatically include the prebuilt PLT. > > Looking forward to hearing your thoughts and direction. Cheers! >From what I recall, a PLT references the beam files with absolute filenames. This might pose a problem you'd have to solve first. From n.oxyde@REDACTED Thu Jan 23 16:21:33 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Thu, 23 Jan 2014 16:21:33 +0100 Subject: [erlang-questions] Dynamic Code and Atoms In-Reply-To: <20140123145441.GA13510@aluminium.local> References: <20140123145441.GA13510@aluminium.local> Message-ID: <19A9D7ED-3EDB-4897-AE87-34A83C373595@gmail.com> Yes and no, the atom table being limited in size is by design (cf. EEP20). What are you compiling, though, to reach such a limit? That sounds completely insane to me. -- Anthony Ramine Le 23 janv. 2014 ? 15:54, Vance Shipley a ?crit : > I am finding that when I dynamically build a function with > a very large number of clauses the emulator crashes while > compilig (cmpile:forms/2) after hitting the atom table limit. > Looking at a erl_crash_.dump I can see that it was filling up > the atom table with 'corN' where N is an ever increasing number. > > Is this a design limitation? > > -- > -Vance > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From sean@REDACTED Thu Jan 23 16:31:59 2014 From: sean@REDACTED (Sean Cribbs) Date: Thu, 23 Jan 2014 09:31:59 -0600 Subject: [erlang-questions] [erlang-patches] Proposal: reinstate pre-built PLT for Dialyzer In-Reply-To: References: Message-ID: On Thu, Jan 23, 2014 at 9:18 AM, Tuncer Ayaz wrote: > > How do you define the standard library? I mean, why not include > all libs/apps? > Yes, that is exactly what I mean. Anything that ships with OTP and is not explicitly disabled or skipped by the build process should be included. > > I usually build a comprehensive PLT for each OTP release and > unfortunately that uncovers type errors which should not be shipped in > a release :(. > > And we should be fixing those! :D > From what I recall, a PLT references the beam files with absolute > filenames. This might pose a problem you'd have to solve first. > Thank you for pointing that out. I'll look into that. -- Sean Cribbs Software Engineer Basho Technologies, Inc. http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Thu Jan 23 16:34:56 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Thu, 23 Jan 2014 16:34:56 +0100 Subject: [erlang-questions] Dynamic Code and Atoms In-Reply-To: References: <20140123145441.GA13510@aluminium.local> <01A088BB-82AD-4B6E-81CB-A827737A6FD0@gmail.com> Message-ID: Sorry I didn?t reply to all the first time, putting the list back in the loop. Probably this problem was never encountered before. Do you really need to do whatever you are doing like this? -- Anthony Ramine Le 23 janv. 2014 ? 16:29, Vance Shipley a ?crit : > I'm well aware of the limits on the atom table, how to change it and that it's not garbage collected. > > I'm not creating these atoms in my abstract forms. It appears to be core Erlang (cerl) which is creating atoms. > On Jan 23, 2014 8:50 PM, "Anthony Ramine" wrote: > Yes and no, the atom table being limited in size is by design (cf. EEP20). > > What are you compiling, though, to reach such a limit? That sounds completely insane to me. > > -- > Anthony Ramine > > Le 23 janv. 2014 ? 15:54, Vance Shipley a ?crit : > > > I am finding that when I dynamically build a function with > > a very large number of clauses the emulator crashes while > > compilig (cmpile:forms/2) after hitting the atom table limit. > > Looking at a erl_crash_.dump I can see that it was filling up > > the atom table with 'corN' where N is an ever increasing number. > > > > Is this a design limitation? > > > > -- > > -Vance > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > From tuncer.ayaz@REDACTED Thu Jan 23 16:56:43 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Thu, 23 Jan 2014 16:56:43 +0100 Subject: [erlang-questions] [erlang-patches] Proposal: reinstate pre-built PLT for Dialyzer In-Reply-To: References: Message-ID: On Thu, Jan 23, 2014 at 4:31 PM, Sean Cribbs wrote: > On Thu, Jan 23, 2014 at 9:18 AM, Tuncer Ayaz wrote: >> >> >> How do you define the standard library? I mean, why not include all >> libs/apps? > > > Yes, that is exactly what I mean. Anything that ships with OTP and > is not explicitly disabled or skipped by the build process should be > included. > >> >> >> I usually build a comprehensive PLT for each OTP release and >> unfortunately that uncovers type errors which should not be shipped >> in a release :(. >> > > And we should be fixing those! :D See https://github.com/erlang/otp/pull/166. Unfortunately the one issue that needs discussion and decision-making by the OTP team has been reported and gone unfixed for a couple releases. See http://erlang.org/pipermail/erlang-bugs/2013-September/003765.html >> From what I recall, a PLT references the beam files with absolute >> filenames. This might pose a problem you'd have to solve first. > > > Thank you for pointing that out. I'll look into that. BTW, assuming this gets off the ground, would you suggest distributing the PLT with the tarball or in the git tree? I think the src tarball and maybe a separate tarball make more sense. For reference, my local R16B03 PLT is 4MB. This would also be in line with other generated files like configure scripts (what's generated vs what's edited). In the git tree it would only make sense to be included in a tagged tree, but that may be confusing, so release tarballs make the most sense to me. From tuncer.ayaz@REDACTED Thu Jan 23 17:05:52 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Thu, 23 Jan 2014 17:05:52 +0100 Subject: [erlang-questions] erlc: interesting error message Message-ID: I just stumbled upon an interesting erlc error message. It's not a big issue, but when I saw the error I wondered if this is desired behavior. I mean, is this something that can and should be improved to provide a more descriptive error message? Thoughts? $ cat foo.erl -module(foo). -include("foo.hrl"). -export([foo/0]). foo() -> io:format("foo"). $ cat foo.hrl -define(FOO, bar). baz $ erlc foo.erl foo.hrl:3: syntax error before: $ erl 1> compile:file("foo.erl", [return]). {error,[{"foo.hrl", [{3,erl_parse,["syntax error before: ",[]]}]}], []} Same message if you append "foo\n" to foo.erl: $ cat foo.erl -module(foo). -include("foo.hrl"). -export([foo/0]). foo() -> io:format("foo."). foo $ erlc foo.erl foo.erl:8: syntax error before: $ erl 1> compile:file("foo.erl",[return]). {error,[{"foo.erl", [{8,erl_parse,["syntax error before: ",[]]}]}, {"foo.hrl",[{3,erl_parse,["syntax error before: ",[]]}]}], []} As a test I've replaced line 2 in foo.hrl with "foo\n": $ cat foo.hrl -define(FOO, bar). foo baz $ erlc foo.erl foo.erl:8: syntax error before: foo.hrl:3: syntax error before: baz $ erl 1> compile:file("foo.erl",[return]). {error,[{"foo.erl", [{8,erl_parse,["syntax error before: ",[]]}]}, {"foo.hrl",[{3,erl_parse,["syntax error before: ","baz"]}]}], []} From davidnwelton@REDACTED Thu Jan 23 16:43:28 2014 From: davidnwelton@REDACTED (David Welton) Date: Thu, 23 Jan 2014 16:43:28 +0100 Subject: [erlang-questions] Generating fake data with PropEr? Message-ID: Hi, Is there a way to simply use PropEr to generate some fake data? For instance proper_types:integer() returns some kind of generator. How do I grab an integer from that? Thanks, -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From davidnwelton@REDACTED Thu Jan 23 17:01:55 2014 From: davidnwelton@REDACTED (David Welton) Date: Thu, 23 Jan 2014 17:01:55 +0100 Subject: [erlang-questions] Generating fake data with PropEr? In-Reply-To: References: Message-ID: It looks like this may do what I want: proper_gen:generate(proper_types:integer()) - where integer can be anything, including the types I have defined myself. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ From vances@REDACTED Thu Jan 23 17:08:57 2014 From: vances@REDACTED (Vance Shipley) Date: Thu, 23 Jan 2014 21:38:57 +0530 Subject: [erlang-questions] Dynamic Code and Atoms In-Reply-To: References: <20140123145441.GA13510@aluminium.local> <01A088BB-82AD-4B6E-81CB-A827737A6FD0@gmail.com> Message-ID: I don't necessarily need to do what I am doing, it just works quite well ... up to a point. The alternative involves a lot of list processing. Clause head matching on the other hand is really fast. My challenge is to match a very large number of patterns and to do it very fast and with the lowest cost. On Jan 23, 2014 9:04 PM, "Anthony Ramine" wrote: > Sorry I didn?t reply to all the first time, putting the list back in the > loop. > > Probably this problem was never encountered before. Do you really need to > do whatever you are doing like this? > > -- > Anthony Ramine > > Le 23 janv. 2014 ? 16:29, Vance Shipley a ?crit : > > > I'm well aware of the limits on the atom table, how to change it and > that it's not garbage collected. > > > > I'm not creating these atoms in my abstract forms. It appears to be core > Erlang (cerl) which is creating atoms. > > On Jan 23, 2014 8:50 PM, "Anthony Ramine" wrote: > > Yes and no, the atom table being limited in size is by design (cf. > EEP20). > > > > What are you compiling, though, to reach such a limit? That sounds > completely insane to me. > > > > -- > > Anthony Ramine > > > > Le 23 janv. 2014 ? 15:54, Vance Shipley a ?crit : > > > > > I am finding that when I dynamically build a function with > > > a very large number of clauses the emulator crashes while > > > compilig (cmpile:forms/2) after hitting the atom table limit. > > > Looking at a erl_crash_.dump I can see that it was filling up > > > the atom table with 'corN' where N is an ever increasing number. > > > > > > Is this a design limitation? > > > > > > -- > > > -Vance > > > _______________________________________________ > > > 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 Thu Jan 23 17:16:04 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Thu, 23 Jan 2014 17:16:04 +0100 Subject: [erlang-questions] erlc: module definition requirement Message-ID: Is there a technical reason why a module without a -module(name) definition should not be accepted by compile:file/2? As it stands, filename and module definition of a module have to match, so why not remove the module definition requirement? I'm only talking about user edited .erl files. From sean@REDACTED Thu Jan 23 17:19:39 2014 From: sean@REDACTED (Sean Cribbs) Date: Thu, 23 Jan 2014 10:19:39 -0600 Subject: [erlang-questions] [erlang-patches] Proposal: reinstate pre-built PLT for Dialyzer In-Reply-To: References: Message-ID: On Thu, Jan 23, 2014 at 9:56 AM, Tuncer Ayaz wrote: > BTW, assuming this gets off the ground, would you suggest distributing > the PLT with the tarball or in the git tree? I think the src tarball > and maybe a separate tarball make more sense. For reference, my local > R16B03 PLT is 4MB. This would also be in line with other generated > files like configure scripts (what's generated vs what's edited). In > the git tree it would only make sense to be included in a tagged tree, > but that may be confusing, so release tarballs make the most sense to > me. > Neither. If you build OTP from source, it would be built during the normal build/install process. If you download a prebuilt binary package (Windows or something from ESL or a distribution maintainer), the PLT should be included in that package. -- Sean Cribbs Software Engineer Basho Technologies, Inc. http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Thu Jan 23 17:34:15 2014 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Thu, 23 Jan 2014 17:34:15 +0100 Subject: [erlang-questions] [erlang-patches] Proposal: reinstate pre-built PLT for Dialyzer In-Reply-To: References: Message-ID: On Thu, Jan 23, 2014 at 5:19 PM, Sean Cribbs wrote: > On Thu, Jan 23, 2014 at 9:56 AM, Tuncer Ayaz wrote: >> >> BTW, assuming this gets off the ground, would you suggest >> distributing the PLT with the tarball or in the git tree? I think >> the src tarball and maybe a separate tarball make more sense. For >> reference, my local R16B03 PLT is 4MB. This would also be in line >> with other generated files like configure scripts (what's generated >> vs what's edited). In the git tree it would only make sense to be >> included in a tagged tree, but that may be confusing, so release >> tarballs make the most sense to me. > > > Neither. If you build OTP from source, it would be built during the > normal build/install process. If you download a prebuilt binary > package (Windows or something from ESL or a distribution > maintainer), the PLT should be included in that package. That sounds good to me. From kostis@REDACTED Thu Jan 23 17:50:49 2014 From: kostis@REDACTED (Kostis Sagonas) Date: Thu, 23 Jan 2014 18:50:49 +0200 Subject: [erlang-questions] Generating fake data with PropEr? In-Reply-To: References: Message-ID: <52E14869.7090706@cs.ntua.gr> On 01/23/2014 05:43 PM, David Welton wrote: > Is there a way to simply use PropEr to generate some fake data? > > For instance proper_types:integer() returns some kind of generator. > How do I grab an integer from that? Not sure what you mean by "fake data", but probably you want to look at function proper_gen:pick/1. For example: 1> {ok, Term1} = proper_gen:pick(proper_types:term()). {ok,-4} 2> {ok, Term2} = proper_gen:pick(proper_types:term()). {ok,[{},4,-4,{},'?\001?_?','?J\017 {ok, Term3} = proper_gen:pick(proper_types:term()). {ok,<<175,33,22,98:7>>} 4> {ok, Term4} = proper_gen:pick(proper_types:term()). {ok,{{{}}, 4.374964496007777,-10.012426131156456,'\200',5,31, 6.465840726473675,'?\211k',-6.991691962714067}} You can of course pass to this function any type. Kostis From rvirding@REDACTED Thu Jan 23 19:42:47 2014 From: rvirding@REDACTED (Robert Virding) Date: Thu, 23 Jan 2014 19:42:47 +0100 Subject: [erlang-questions] erlc: module definition requirement In-Reply-To: References: Message-ID: My reply to the same question in a comment to my latest blog: That was a long time ago but I seem to remember that the "-module" came first. This was part of the syntax and how you defined a module. The requirement that the module name and the file name be the same came later and is actually part of the libraries, both the compiler and the code server. The compiler saves the BEAM code in a file with the same name as the module while the code server assumes that the code in a BEAM is for a module with the same name as the file. It would be easy for the compiler to save the BEAM in a file with the same name as the module. This would need no change to the code server. What you would need to do is take away the warning/correction in emacs. Seeing I view them, the module definition and the file name requirements, as being different types of properties I don't think we should remove the module definition. Changing the handling of the file names I would have nothing against. It really doesn't worry me either way. That's my opinion anyway. Robert On 23 January 2014 17:16, Tuncer Ayaz wrote: > Is there a technical reason why a module without a -module(name) > definition should not be accepted by compile:file/2? > > As it stands, filename and module definition of a module have to > match, so why not remove the module definition requirement? > > I'm only talking about user edited .erl files. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Fri Jan 24 03:12:53 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 24 Jan 2014 15:12:53 +1300 Subject: [erlang-questions] erlc: interesting error message In-Reply-To: References: Message-ID: <52CB7604-C0FB-44A2-BFCE-E1F895372E24@cs.otago.ac.nz> On 24/01/2014, at 5:05 AM, Tuncer Ayaz wrote: [When there is a syntax error at the end of a file, you get a message : syntax error before: ] Thoughts? It would clearly be more helpful if it said syntax error before: end of file. Grepping in the sources, I see a lot of ["syntax error before: ", yecctoken2string(Token)] occurrences. It looks as though yecctoken2string({'$end',_}) -> []; could be replaced by yecctoken2string({'$end',_}) -> "end of file"; If I'm right about where this is coming from, there are lots of instances of it and they should probably all be fixed. From avinash_dhumane@REDACTED Fri Jan 24 07:11:32 2014 From: avinash_dhumane@REDACTED (Avinash Dhumane) Date: Fri, 24 Jan 2014 11:41:32 +0530 Subject: [erlang-questions] Question on 'reuseaddr' semantics on Windows XP Message-ID: <001801cf18cb$21fab560$65f02020$@com> I have following: {ok, Socket} = gen_udp:open(54321, [binary, {active, true}, {reuseaddr, true}]), ok = inet:setopts(Socket, [{add_membership,{{233, 1, 2, 5}, {0, 0, 0, 0}}}]), On first use, it succeeds. While first socket is in use, opening another socket results in 'eaddrinuse' error, in spite of {reuseaddr, true}. I referred to past question: http://erlang.org/pipermail/erlang-questions/2013-September/075275.html. And, also the background: http://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and- so-reuseport-how-do-they-differ-do-they-mean-t I gather that the error should not occur for multicast use case. But still, since it does occur, hence is this question (repeated). Any resolution? This is on Windows XP SP3. Thanks Avinash -------------- next part -------------- An HTML attachment was scrubbed... URL: From ferenc.holzhauser@REDACTED Fri Jan 24 10:46:00 2014 From: ferenc.holzhauser@REDACTED (Ferenc Holzhauser) Date: Fri, 24 Jan 2014 10:46:00 +0100 Subject: [erlang-questions] Is -on_load() still experimental? Anyone using it? Message-ID: Hi, Recently stumbled into the -on_load() directive. It seems nice to replace manual work (when possible) e.g. when a live update of a library module needs some environment/configuration change on the running system. doc: http://www.erlang.org/doc/reference_manual/code_loading.html#id84676 It says it is experimental (since R13B03). After trying, it appears to be doing what I think it supposed to but looking at this note in the doc I'm not sure how safe it is to use in production. Could somebody advise? Thanks in advance, Ferenc -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.valim@REDACTED Fri Jan 24 10:48:52 2014 From: jose.valim@REDACTED (=?ISO-8859-1?Q?Jos=E9_Valim?=) Date: Fri, 24 Jan 2014 10:48:52 +0100 Subject: [erlang-questions] Is -on_load() still experimental? Anyone using it? In-Reply-To: References: Message-ID: I have used this feature for a while without running into troubles. The only known issue, which has been reported, is that it fails when compiling the module with Erlang HiPE. *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Lead Developer On Fri, Jan 24, 2014 at 10:46 AM, Ferenc Holzhauser < ferenc.holzhauser@REDACTED> wrote: > Hi, > > Recently stumbled into the -on_load() directive. It seems nice to replace > manual work (when possible) e.g. when a live update of a library module > needs some environment/configuration change on the running system. > > doc: http://www.erlang.org/doc/reference_manual/code_loading.html#id84676 > > It says it is experimental (since R13B03). > After trying, it appears to be doing what I think it supposed to but > looking at this note in the doc I'm not sure how safe it is to use in > production. > > Could somebody advise? > > Thanks in advance, > Ferenc > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Fri Jan 24 15:55:41 2014 From: sergej.jurecko@REDACTED (Sergej Jurecko) Date: Fri, 24 Jan 2014 15:55:41 +0100 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database (Sergej Jurecko) In-Reply-To: <309CCC64-D378-4D8C-80AE-250EDC3D543D@gmail.com> References: <309CCC64-D378-4D8C-80AE-250EDC3D543D@gmail.com> Message-ID: <8965068E-EF90-4520-B329-59F71F0350DE@gmail.com> hello, We've put up a documentation page with more info. http://www.actordb.com/docs.html Hopefully it answers more questions than it raises. If not fire away. Sergej On Jan 22, 2014, at 10:19 PM, Valery Meleshkin wrote: > Hi Sergej, > > Which algorithms were used to build it? How its architecture looks like? How testing process looks like? > Specifically I?m interested in the details of replication, inter-actor transaction coordination, replica placement and membership service (e.g. raft/paxos/2pc/ 2pc over paxos ensembles/?). > > -- > Sincerely, > (Mr.) Valery Meleshkin > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Fri Jan 24 17:33:32 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Fri, 24 Jan 2014 11:33:32 -0500 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database (Sergej Jurecko) In-Reply-To: <8965068E-EF90-4520-B329-59F71F0350DE@gmail.com> References: <309CCC64-D378-4D8C-80AE-250EDC3D543D@gmail.com> <8965068E-EF90-4520-B329-59F71F0350DE@gmail.com> Message-ID: <20140124163331.GN18664@ferdair.local> I'm curious about a few things: - You mention using ACID for transactions, but later mention "The master does periodic rebroadcasts of state. Eventually it will correct itself. But it had bad data for X seconds" This points towards an eventually consistent solution, not a fully consistent one. - There is, during your leader election (picking local max) and many times around the text: "A successful 2 phase commit means a majority of nodes." This sounds like a majority-based consensus, but the 2PC algorithm usually waits for *all* participants to have agreed. Unless you're adding majority-reads as a constraints, it sounds like you're going to be breaking ACID in the first place, and that you're not actually using 2PC, but a quorum-based consensus algorithm. - It's unclear how 'majority' is determined. Is it a majority of all the nodes *expected* in the cluster, or a majority of the nodes *currently* in the cluster? How does this deal with netsplits? - No mention of timeout. Do you have a threshold under which a master gets de-elected for taking too long to respond? Is there an assumption here about timeouts vs. failures and how to tell them apart? Under such a scenario, how do two nodes who think of each other as masters detect the case and resolve it? - How do these mechanism keep working following a netsplit during a multi-shard transaction? - When you redirect requests, are you doing the redirection as a proxy, or asking to retry directly? In the former case, what happens if the proxy node dies, but not the master actually doing the request? Or vice-versa, what if the client dies, but not the proxy node? - What happens to requests being sent during a shard migration that hasn't yet completed? There's probably more to ask, but yeah. Distributed systems are fun and hard! Regards, Fred. On 01/24, Sergej Jurecko wrote: > hello, > > We've put up a documentation page with more info. > > http://www.actordb.com/docs.html > > Hopefully it answers more questions than it raises. If not fire away. > > > Sergej > > On Jan 22, 2014, at 10:19 PM, Valery Meleshkin wrote: > > > Hi Sergej, > > > > Which algorithms were used to build it? How its architecture looks like? How testing process looks like? > > Specifically I?m interested in the details of replication, inter-actor transaction coordination, replica placement and membership service (e.g. raft/paxos/2pc/ 2pc over paxos ensembles/?). > > > > -- > > Sincerely, > > (Mr.) Valery Meleshkin > > > > > > > > _______________________________________________ > > 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 ferenc.holzhauser@REDACTED Fri Jan 24 18:18:51 2014 From: ferenc.holzhauser@REDACTED (Ferenc Holzhauser) Date: Fri, 24 Jan 2014 18:18:51 +0100 Subject: [erlang-questions] Is -on_load() still experimental? Anyone using it? In-Reply-To: References: Message-ID: Hi Jose, Thanks for the information. Sounds comforting (not using HiPE). Regards, Ferenc On 24 January 2014 10:48, Jos? Valim wrote: > I have used this feature for a while without running into troubles. The > only known issue, which has been reported, is that it fails when compiling > the module with Erlang HiPE. > > > > *Jos? Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Lead Developer > > > On Fri, Jan 24, 2014 at 10:46 AM, Ferenc Holzhauser < > ferenc.holzhauser@REDACTED> wrote: > >> Hi, >> >> Recently stumbled into the -on_load() directive. It seems nice to replace >> manual work (when possible) e.g. when a live update of a library module >> needs some environment/configuration change on the running system. >> >> doc: http://www.erlang.org/doc/reference_manual/code_loading.html#id84676 >> >> >> It says it is experimental (since R13B03). >> After trying, it appears to be doing what I think it supposed to but >> looking at this note in the doc I'm not sure how safe it is to use in >> production. >> >> Could somebody advise? >> >> Thanks in advance, >> Ferenc >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Fri Jan 24 18:35:18 2014 From: sergej.jurecko@REDACTED (Sergej Jurecko) Date: Fri, 24 Jan 2014 18:35:18 +0100 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database (Sergej Jurecko) In-Reply-To: <20140124163331.GN18664@ferdair.local> References: <309CCC64-D378-4D8C-80AE-250EDC3D543D@gmail.com> <8965068E-EF90-4520-B329-59F71F0350DE@gmail.com> <20140124163331.GN18664@ferdair.local> Message-ID: Answers inline. On Jan 24, 2014, at 5:33 PM, Fred Hebert wrote: > I'm curious about a few things: > > - You mention using ACID for transactions, but later mention "The master > does periodic rebroadcasts of state. Eventually it will correct > itself. But it had bad data for X seconds" > > This points towards an eventually consistent solution, not a fully > consistent one. > Global state is separate from transactions to actors. Actors are consistent. Change of configuration when initiated by user is eventually consistent. > - There is, during your leader election (picking local max) and many > times around the text: "A successful 2 phase commit means a majority > of nodes." > > This sounds like a majority-based consensus, but the 2PC algorithm > usually waits for *all* participants to have agreed. Unless you're > adding majority-reads as a constraints, it sounds like you're going to > be breaking ACID in the first place, and that you're not actually > using 2PC, but a quorum-based consensus algorithm. > Yes you are right. We will rephrase. > - It's unclear how 'majority' is determined. Is it a majority of all the > nodes *expected* in the cluster, or a majority of the nodes > *currently* in the cluster? How does this deal with netsplits? Majority of nodes expected in the cluster. So a three node cluster is going to tolerate 1 missing node. Nodes can go missing for a period of time or they can shut down. Their missed writes will cause a restore operation for actors whose writes they did not execute. > > - No mention of timeout. Do you have a threshold under which a master > gets de-elected for taking too long to respond? Is there an assumption > here about timeouts vs. failures and how to tell them apart? Under > such a scenario, how do two nodes who think of each other as masters > detect the case and resolve it? > When it comes to actors themselves there are no timeouts. If a node receives a nodedown message, all slave actors whose master seems to be gone are told to close. If a read/write request comes from a client, it will force a master election if there is none. For global state it responds to a nodedown message. This is admittedly a part of the system which needs more testing. > - How do these mechanism keep working following a netsplit during a > multi-shard transaction? Transaction is done from some server. If that server can reach all actors and those actors have a majority in their clusters it will succeed. If any of those actors do not have a majority transaction will fail. If transaction manager reached the point of committing transaction, but was no longer able to contact actors to tell them to commit, actors themselves will eventually call back to check if it is committed or not. The entire procedure is described in chapter 2.2.3 of documentation. > > - When you redirect requests, are you doing the redirection as a proxy, > or asking to retry directly? In the former case, what happens if the > proxy node dies, but not the master actually doing the request? Or > vice-versa, what if the client dies, but not the proxy node? > As a proxy. If the proxy or client died, transaction will either be committed or not. Like postgres. > - What happens to requests being sent during a shard migration that > hasn't yet completed? > Shard migration is done actor-by-actor. If it hits an actor after migration, request will be redirected to new cluster. If it hits during copy it depends on the phase of copy. Before sending the last packet all writes will be committed. Copying an actor locks it only once it has sent the entire db. After it has sent last packet it waits for confirmation that copy was successful. If it receives it, all requests that have been queued during lock are responded with a redirect. > There's probably more to ask, but yeah. Distributed systems are fun and > hard! > > Regards, > Fred. > > On 01/24, Sergej Jurecko wrote: >> hello, >> >> We've put up a documentation page with more info. >> >> http://www.actordb.com/docs.html >> >> Hopefully it answers more questions than it raises. If not fire away. >> >> >> Sergej >> >> On Jan 22, 2014, at 10:19 PM, Valery Meleshkin wrote: >> >>> Hi Sergej, >>> >>> Which algorithms were used to build it? How its architecture looks like? How testing process looks like? >>> Specifically I?m interested in the details of replication, inter-actor transaction coordination, replica placement and membership service (e.g. raft/paxos/2pc/ 2pc over paxos ensembles/?). >>> >>> -- >>> Sincerely, >>> (Mr.) Valery Meleshkin >>> >>> >>> >>> _______________________________________________ >>> 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 freza@REDACTED Fri Jan 24 18:58:22 2014 From: freza@REDACTED (Jachym Holecek) Date: Fri, 24 Jan 2014 12:58:22 -0500 Subject: [erlang-questions] Is -on_load() still experimental? Anyone using it? In-Reply-To: References: Message-ID: <20140124175822.GA17752@circlewave.net> Hi Ferenc, # Ferenc Holzhauser 2014-01-24: > Recently stumbled into the -on_load() directive. It seems nice to replace > manual work (when possible) e.g. when a live update of a library module > needs some environment/configuration change on the running system. > > doc: http://www.erlang.org/doc/reference_manual/code_loading.html#id84676 > > It says it is experimental (since R13B03). > After trying, it appears to be doing what I think it supposed to but > looking at this note in the doc I'm not sure how safe it is to use in > production. > > Could somebody advise? It is clearly not safe to use in production because that's what EXPERIMENTAL means. Also, the -on_load() functionality has been introduced to support automatic NIF loading (not that this was a problem that really needed solving, IMHO). Have you investigated if it really fits your use case well? This snippet from documentation would unsettle me just a little bit on a live system: "A process that calls any function in a module whose on_load function has not yet returned will be suspended until the on_load function has returned." It doesn't specify if this applies just to initial loading of a module or also to runtime code updates, system behaviour in the latter case could be disastrous. Further, automatic configuration changes are a touchy topic. What if some- thing goes wrong in the middle of your automatic update, and you end up with inconsistent state? How do you rollback then? Especially if the whole stuff is hidden where Operations won't see it? Personally, I'd advise to solve boring problems in boring ways... BR, -- Jachym From jose.valim@REDACTED Fri Jan 24 19:16:13 2014 From: jose.valim@REDACTED (=?ISO-8859-1?Q?Jos=E9_Valim?=) Date: Fri, 24 Jan 2014 19:16:13 +0100 Subject: [erlang-questions] Is -on_load() still experimental? Anyone using it? In-Reply-To: <20140124175822.GA17752@circlewave.net> References: <20140124175822.GA17752@circlewave.net> Message-ID: Just to clarify, after Jachym's e-mail, I have been using -on_load exactly to load NIFs and that's the scenario it has been shown to work in my case. YMMV. *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Lead Developer On Fri, Jan 24, 2014 at 6:58 PM, Jachym Holecek wrote: > Hi Ferenc, > > # Ferenc Holzhauser 2014-01-24: > > Recently stumbled into the -on_load() directive. It seems nice to replace > > manual work (when possible) e.g. when a live update of a library module > > needs some environment/configuration change on the running system. > > > > doc: > http://www.erlang.org/doc/reference_manual/code_loading.html#id84676 > > > > It says it is experimental (since R13B03). > > After trying, it appears to be doing what I think it supposed to but > > looking at this note in the doc I'm not sure how safe it is to use in > > production. > > > > Could somebody advise? > > It is clearly not safe to use in production because that's what > EXPERIMENTAL > means. > > Also, the -on_load() functionality has been introduced to support automatic > NIF loading (not that this was a problem that really needed solving, IMHO). > Have you investigated if it really fits your use case well? This snippet > from documentation would unsettle me just a little bit on a live system: > > "A process that calls any function in a module whose on_load function > has not yet returned will be suspended until the on_load function has > returned." > > It doesn't specify if this applies just to initial loading of a module or > also to runtime code updates, system behaviour in the latter case could > be disastrous. > > Further, automatic configuration changes are a touchy topic. What if some- > thing goes wrong in the middle of your automatic update, and you end up > with inconsistent state? How do you rollback then? Especially if the > whole stuff is hidden where Operations won't see it? > > Personally, I'd advise to solve boring problems in boring ways... > > BR, > -- Jachym > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ferenc.holzhauser@REDACTED Fri Jan 24 19:44:27 2014 From: ferenc.holzhauser@REDACTED (Ferenc Holzhauser) Date: Fri, 24 Jan 2014 19:44:27 +0100 Subject: [erlang-questions] Is -on_load() still experimental? Anyone using it? In-Reply-To: References: <20140124175822.GA17752@circlewave.net> Message-ID: Hi, Thanks again for your insights and concerns. Configuration change was an (apparently bad) example that I thought was close enough to my case that is a bit more extensive to explain. I didn't think it was relevant for what I was curious about and didn't want to bore the list with it. I've done some testing including system start and code (re)load an it did what I need without issues What actually triggered me to ask the list is that it has been marked experimental since R13B03 (a bit over 4 years now), Perhaps my real questions should have been: Is this feature being looked at? Is there any intention to remove the experimental mark one day? Regards, Ferenc On 24 January 2014 19:16, Jos? Valim wrote: > Just to clarify, after Jachym's e-mail, I have been using -on_load exactly > to load NIFs and that's the scenario it has been shown to work in my case. > YMMV. > > > > *Jos? Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Lead Developer > > > On Fri, Jan 24, 2014 at 6:58 PM, Jachym Holecek wrote: > >> Hi Ferenc, >> >> # Ferenc Holzhauser 2014-01-24: >> > Recently stumbled into the -on_load() directive. It seems nice to >> replace >> > manual work (when possible) e.g. when a live update of a library module >> > needs some environment/configuration change on the running system. >> > >> > doc: >> http://www.erlang.org/doc/reference_manual/code_loading.html#id84676 >> > >> > It says it is experimental (since R13B03). >> > After trying, it appears to be doing what I think it supposed to but >> > looking at this note in the doc I'm not sure how safe it is to use in >> > production. >> > >> > Could somebody advise? >> >> It is clearly not safe to use in production because that's what >> EXPERIMENTAL >> means. >> >> Also, the -on_load() functionality has been introduced to support >> automatic >> NIF loading (not that this was a problem that really needed solving, >> IMHO). >> Have you investigated if it really fits your use case well? This snippet >> from documentation would unsettle me just a little bit on a live system: >> >> "A process that calls any function in a module whose on_load function >> has not yet returned will be suspended until the on_load function has >> returned." >> >> It doesn't specify if this applies just to initial loading of a module or >> also to runtime code updates, system behaviour in the latter case could >> be disastrous. >> >> Further, automatic configuration changes are a touchy topic. What if some- >> thing goes wrong in the middle of your automatic update, and you end up >> with inconsistent state? How do you rollback then? Especially if the >> whole stuff is hidden where Operations won't see it? >> >> Personally, I'd advise to solve boring problems in boring ways... >> >> BR, >> -- Jachym >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Fri Jan 24 20:22:58 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Fri, 24 Jan 2014 14:22:58 -0500 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database (Sergej Jurecko) In-Reply-To: References: <309CCC64-D378-4D8C-80AE-250EDC3D543D@gmail.com> <8965068E-EF90-4520-B329-59F71F0350DE@gmail.com> <20140124163331.GN18664@ferdair.local> Message-ID: <20140124190621.GO18664@ferdair.local> On 01/24, Sergej Jurecko wrote: > Answers inline. > > Global state is separate from transactions to actors. Actors are consistent. Change of configuration when initiated by user is eventually consistent. > Does this mean there's a risk of configuration changes not making it out properly, but nodes still connecting? i.e. this could potentially lead to your nodes not seeing a majority where there should be one, or the exact opposite? In most of the papers I have read (and in systems like Riak), the opposite is often true: you actually want strong consistency when modifying the cluster, and eventual one is tolerable otherwise. This seems like a funny (and risky) choice. > > Yes you are right. We will rephrase. > How do you ensure that quorum consensus works with ACID? Is it doing majority reads? It would be important to describe it right. > > Majority of nodes expected in the cluster. So a three node cluster is going to tolerate 1 missing node. Nodes can go missing for a period of time or they can shut down. Their missed writes will cause a restore operation for actors whose writes they did not execute. > I can see how that works. An interestign question is what happens if all nodes go down, and need to be booted back up. Is there a way to reload from incompletely booted nodes? I assume that by default you only allow to copy from healthy nodes in the cluster, but if all of them became unhealthy, there has to be a way to restore state back -- otherwise all nodes will be waiting for all peers to come back up, and you're more or less deadlocked. > > When it comes to actors themselves there are no timeouts. If a node receives a nodedown message, all slave actors whose master seems to be gone are told to close. If a read/write request comes from a client, it will force a master election if there is none. > For global state it responds to a nodedown message. This is admittedly a part of the system which needs more testing. > That is a timeout. The question is how long does it take for a timeout to be seen as a failure, more or less. You do not keep waiting forever, and therefore you have timeouts. I'm not sure what you mean by 'all slaves are told to close' -- would that conflict with the idea that any of 3 nodes can fail? I'm going with the assumption that the slave nodes stay up if they are to re-elect a master. A tricky issue there is that you may have asymetric netsplits. For example, it's possible that your client can talk to the master, but that the masters and slaves cannot communicate together. At that point you have a master node that gets requests from the client, and a set of slaves that elect a master among themselves. Depending on how things work, it is possible that both masters may receive queries at the same time. When the network issue is resolved, you currently have 3 nodes, two of which believe they are masters, one of the masters which may be lagging behind one of the nodes it expects to be a slave. That kind of conflict resolution should be considered. > > Transaction is done from some server. If that server can reach all actors and those actors have a majority in their clusters it will succeed. If any of those actors do not have a majority transaction will fail. If transaction manager reached the point of committing transaction, but was no longer able to contact actors to tell them to commit, actors themselves will eventually call back to check if it is committed or not. The entire procedure is described in chapter 2.2.3 of documentation. > Fair enough, although here the client is also part of the system. The client will not know whether it failed or not in some cases, but I'm guessing this is fair play for most relational databases, including players like Postgres. > > As a proxy. If the proxy or client died, transaction will either be committed or not. Like postgres. > I think this is the same consideration as the previous point. I guess the question/recommendation here is to be able to make a clear distinction to the user of the database on whether the transaction clearly succeeded, clearly failed, or that you actually do not know, and to be careful not to report a timeout/failed proxy as a failure, in which case one could believe the transaction is safe to retry. > > Shard migration is done actor-by-actor. If it hits an actor after migration, request will be redirected to new cluster. If it hits during copy it depends on the phase of copy. Before sending the last packet all writes will be committed. Copying an actor locks it only once it has sent the entire db. After it has sent last packet it waits for confirmation that copy was successful. If it receives it, all requests that have been queued during lock are responded with a redirect. > Anything specific happens if the node it was transfering to dies? I'm guessing here the lock isn't there indefinitely? In which case, be careful because it could be one of them damn netsplits, and you suddenly have duplicated shards that both believe they are canonical! Regards, Fred. From erlangprogram@REDACTED Fri Jan 24 21:40:37 2014 From: erlangprogram@REDACTED (Samuel X) Date: Fri, 24 Jan 2014 15:40:37 -0500 Subject: [erlang-questions] erlang diameter dictionary In-Reply-To: References: Message-ID: Hello Anders, How are you? I have a question about modifying diameter dictionary. For example, for diameter CCR message, if I want to change "Service-Context-Id" from mandatory to non mandatory property so I don't have to fill this property in the CCR message, I changed the file rfc4006_cc.dia as following: 1. Service-Context-Id 461 UTF8String - 2. Change from {Service-Context-id} to [Service-Context-Id] and move it below {CC-Request-Number} in CCR message definition Then I used diameterc to generate new erlang files accordingly. The files look good and I was able to compile. By the way, I include the diameter library source code from OTP release R16B03 into the project, just in order to debug the diameter easily. I filled the CCR message as below: CCR = #diameter_rfc4006_cc_CCR{ 'Session-Id' = diameter:session_id(?L(who)), 'Auth-Application-Id' = 16777238, 'CC-Request-Type' = ?'DIAMETER_RFC4006_CC_CC-REQUEST-TYPE_INITIAL_REQUEST', 'CC-Request-Number' = 0 }, diameter:call(Name, ?APP_CCR_ALIAS, CCR, []). When I run from the erlang shell R16B03, I got the encoding error like this: why: {diameter_codec,encode, {{mandatory_avp_missing,'CC-Request-Type','CCR'}, [{diameter_gen_rfc4006_cc,encode_avps,2, [{file, "/usr/lib/erlang/lib/diameter-1.5/include/diameter_gen.hrl"}, {line,59}]}, {diameter_codec,e,2, [{file,"src/diameter_codec.erl"},{line,120}]}, {diameter_codec,encode,2, [{file,"src/diameter_codec.erl"},{line,71}]}, {diameter_traffic,encode,3, [{file,"src/diameter_traffic.erl"},{line,1481}]}, {diameter_traffic,send_R,6, [{file,"src/diameter_traffic.erl"},{line,1320}]}, {diameter_traffic,'-send_request/4-fun-0-',6, [{file,"src/diameter_traffic.erl"},{line,1094}]}]}} who: <0.62.0> what: {diameter_codec,encode, [diameter_gen_rfc4006_cc, {diameter_packet, {diameter_header,1,undefined,undefined,undefined, 398339147,398339147,undefined,undefined,undefined, undefined}, undefined, {diameter_rfc4006_cc_CCR, ["who",";","1452024187",";","1",";","nonode@REDACTED"], "centos","example.com","example.com",16777238, undefined,1,0, ["centos"], [],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[], []}, undefined,[],undefined}]} {error,encode} I don't really understand why getting this error or the error information is a little bit confusing me. Am I doing right to modify the dictionary file? What is the proper way to do that? What is best way of debugging the diameter library? Can you give me some hints? Thanks a lot! Samuel On Sat, Mar 23, 2013 at 7:11 AM, Anders Svensson wrote: > On Fri, Mar 22, 2013 at 7:52 PM, S X wrote: > > Hi Anders, > > > > Sorry, I think I understand now. You told me the solution. Just use '[ > ]'. > > > > Anyhow, many thanks! > > > > By the way, since 3588 is obsolete, can I use 6733 while compile other > > dictionaries? > > Yes. /Anders > > > > > > Thanks! > > > > Samuel > > > > > > On Fri, Mar 22, 2013 at 2:46 PM, S X wrote: > >> > >> Hi Anders, > >> > >> Thanks for your quick response. But I still don't get why the DH is > being > >> interpreted as a list of Destination-Host values ( Is it because the > define > >> "avp_arity('CCR', 'Destination-Host') -> {0, 1};"). > >> > >> And if it is treated as a list, how come it has a length greater than > 1, I > >> just set it once in prepare_request. > >> > >> What should I do to correct it? Or which document should I read more > >> carefully to understand this properly? > >> > >> Thanks a lot! > >> > >> Samuel > >> > >> > >> On Fri, Mar 22, 2013 at 1:27 PM, Anders Svensson > >> wrote: > >>> > >>> Hi Samuel > >>> > >>> On Fri, Mar 22, 2013 at 5:55 PM, S X wrote: > >>> > Thanks a lot, Anders, > >>> > > >>> > I think I overlooked what the meaning of the configurable ID tag (4) > in > >>> > the > >>> > dia file is , which is supposed to be the important application ID to > >>> > be > >>> > used in the configuration. Your suggestion about the prefix is also > >>> > right. > >>> > But now I am just learning erlang diameter library. > >>> > > >>> > I just try to follow the sample RAR message style, and am still > having > >>> > issue > >>> > with sending CCR message. The client configuration now is: > >>> > > >>> > -define(SERVICE(Name), [{'Origin-Host', ?L(Name) ++ ".example.com"}, > >>> > {'Origin-Realm', "example.com"}, > >>> > {'Vendor-Id', 193}, > >>> > {'Product-Name', "Client"}, > >>> > {'Auth-Application-Id', > >>> > [?DIAMETER_APP_ID_CCRA]}, > >>> > {application, [{alias, ?APP_CCR_ALIAS}, > >>> > {dictionary, > >>> > ?DIAMETER_DICT_CCRA}, > >>> > {module, client_cb_ccra}]}]). > >>> > > >>> > Try to send CCR message: > >>> > > >>> > call(Name) -> > >>> > SId = diameter:session_id(?L(Name)), > >>> > CCR = #diameter_base_rfc4006_cc_CCR{ > >>> > 'Session-Id' = SId, > >>> > 'Service-Context-Id' = "Test", > >>> > 'CC-Request-Type' = > >>> > ?'DIAMETER_BASE_RFC4006_CC_CC-REQUEST-TYPE_INITIAL_REQUEST', > >>> > 'CC-Request-Number' = 0, > >>> > 'Auth-Application-Id' = ?DIAMETER_APP_ID_CCRA, > >>> > 'User-Name' = "Me"}, > >>> > diameter:call(Name, ?APP_CCR_ALIAS, CCR, []). > >>> > > >>> > > >>> > In the client callback module: > >>> > > >>> > prepare_request(#diameter_packet{msg = Rec}, _, {_, Caps}) -> > >>> > #diameter_caps{origin_host = {OH, DH}, > >>> > origin_realm = {OR, DR}} > >>> > = Caps, > >>> > > >>> > {send, Rec#diameter_base_rfc4006_cc_CCR{'Origin-Host' = OH, > >>> > 'Origin-Realm' = OR, > >>> > 'Destination-Host' = DH, > >>> > 'Destination-Realm' = DR}}. > >>> > > >>> > I got the error about AVP property: > >>> > > >>> > =ERROR REPORT==== 22-Mar-2013::00:17:31 === > >>> > why: {diameter_codec,encode, > >>> > {{repeated_avp_excessive_arity,'Destination-Host',1, > >>> > "server.example.com",'CCR'}, > >>> > >>> This is because Destination-Host is optional in CCR and AVP's are > >>> encoded differently in a message record depending on whether or not > >>> there can be exactly one occurrence: if so then the field value should > >>> be the AVP value, if not then a list of AVP values. That is, your CCR > >>> record should have > >>> > >>> 'Destination-Host' = [DH], > >>> > >>> in this case. > >>> > >>> > [{diameter_gen_base_rfc4006_cc,encode_avps,2, > >>> > > >>> > [{file,"diameter_gen_base_rfc4006_cc.erl"},{line,47}]}, > >>> > > >>> > {diameter_codec,e,2,[{file,"diameter_codec.erl"},{line,112}]}, > >>> > {diameter_codec,encode,2, > >>> > [{file,"diameter_codec.erl"},{line,63}]}, > >>> > {diameter_traffic,encode,3, > >>> > [{file,"diameter_traffic.erl"},{line,1437}]}, > >>> > {diameter_traffic,send_R,6, > >>> > [{file,"diameter_traffic.erl"},{line,1276}]}, > >>> > {diameter_traffic,'-send_request/4-fun-0-',4, > >>> > [{file,"diameter_traffic.erl"},{line,1050}]}]}} > >>> > who: <0.180.0> > >>> > what: {diameter_codec,encode, > >>> > [diameter_gen_base_rfc4006_cc, > >>> > {diameter_packet, > >>> > {diameter_header,1,undefined,undefined,undefined, > >>> > > >>> > 1330492780,1330492780,undefined,undefined,undefined, > >>> > undefined}, > >>> > undefined, > >>> > {diameter_base_rfc4006_cc_CCR, > >>> > > >>> > ["client",";","1425429748",";","2",";","nonode@REDACTED"], > >>> > > >>> > "client.example.com","example.com","example.com",4, > >>> > > >>> > "Test",1,0,"server.example.com","Me",[],[],[],[],[],[], > >>> > [],[],[],[],[],[],[],[],[],[],[],[]}, > >>> > undefined,[],undefined}]} > >>> > > >>> > My understanding is that the client callback prepare_request sets the > >>> > "Destination-Host" (retrievd via the CER/A done at earilier stage) in > >>> > the > >>> > CCR message. So I should set it right. But seems I still > misunderstand > >>> > something. Does the error information "repeated_avp_excessive_arity" > >>> > mean " > >>> > 0-1 Zero or one instance of the AVP MAY be present in the message. It > >>> > is > >>> > >>> Yes, exactly. In your case your DH is being interpreted as list of > >>> Destination-Host values, and "excessive arity" is a result of that > >>> list having length greater than 1. > >>> > >>> /Anders, Erlang/OTP > >>> > >>> > >>> > considered an error if there is more than one instance of the AVP" > >>> > according > >>> > to rfc4006 spec? The erlang error message is not that > straightforward, > >>> > really confusing newbies:). > >>> > > >>> > Do you have any hints? (I hope I could provide some ramp up steps > for > >>> > other > >>> > people to learn with erlang diameter library after making it work^_^) > >>> > > >>> > Many thanks, > >>> > > >>> > Samuel > >>> > > >>> > > >>> > > >>> > On Thu, Mar 21, 2013 at 8:59 AM, Anders Svensson < > anders.otp@REDACTED> > >>> > wrote: > >>> >> > >>> >> On Thu, Mar 21, 2013 at 2:55 AM, S X > wrote: > >>> >> > Hello, > >>> >> > > >>> >> > Sorry, I still have some problems with sending CCR/CCA messages. > I > >>> >> > didn't > >>> >> > quite get how to configure multiple diameter applications though > it > >>> >> > seems > >>> >> > clear when I read the diameter protocol. > >>> >> > > >>> >> > Based on the sample diameter code, I made the following changes, > >>> >> > diameter_gen_base_rfc4006_cc is the dictionary generated with > >>> >> > rfc4006_cc.dia: > >>> >> > $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Client > >>> >> > $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ > >>> >> > > >>> >> > -define(SVC_NAME, ?MODULE). > >>> >> > -define(APP_ALIAS, ?MODULE). > >>> >> > -define(CALLBACK_MOD, client_cb). > >>> >> > -define(DIAMETER_DICT_CCRA, diameter_gen_base_rfc4006_cc). > >>> >> > > >>> >> > -define(L, atom_to_list). > >>> >> > > >>> >> > -define(SERVICE(Name), [{'Origin-Host', ?L(Name) ++ ".example.com > "}, > >>> >> > {'Origin-Realm', "example.com"}, > >>> >> > {'Vendor-Id', 0}, > >>> >> > {'Product-Name', "Client"}, > >>> >> > {'Auth-Application-Id', > >>> >> > [?DIAMETER_APP_ID_COMMON]}, > >>> >> > {application, [{alias, ?APP_ALIAS}, > >>> >> > {dictionary, > >>> >> > ?DIAMETER_DICT_CCRA}, > >>> >> > {module, > ?CALLBACK_MOD}]}]). > >>> >> > > >>> >> > > >>> >> > > >>> >> > $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Server > >>> >> > $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ > >>> >> > > >>> >> > -define(DIAMETER_DICT_CCRA, diameter_gen_base_rfc4006_cc). > >>> >> > > >>> >> > init(State) -> > >>> >> > SvcName = ?MODULE, > >>> >> > SvcOpts = [{'Origin-Host', atom_to_list(SvcName) ++ > >>> >> > ".example.com"}, > >>> >> > {'Origin-Realm', "example.com"}, > >>> >> > {'Vendor-Id', 193}, > >>> >> > {'Product-Name', "Server"}, > >>> >> > {'Auth-Application-Id', > [?DIAMETER_APP_ID_COMMON]}, > >>> >> > {application, [{alias, ?MODULE}, > >>> >> > {dictionary, ?DIAMETER_DICT_CCRA}, > >>> >> > {module, server_cb}]}], > >>> >> > TransportOpts = [{transport_module, diameter_tcp}, > >>> >> > {transport_config, [{reuseaddr, true}, > >>> >> > {ip, {127,0,0,1}}, {port, 3868}]}], > >>> >> > diameter:start(), > >>> >> > diameter:start_service(SvcName, SvcOpts), > >>> >> > diameter:add_transport(SvcName, {listen, TransportOpts}), > >>> >> > erlang:display("Set up diameter server completed!"), > >>> >> > {ok, State}. > >>> >> > > >>> >> > > >>> >> > > >>> >> > I changed the callbacks client_cb and server_cb to handle CCR/CCA > >>> >> > messages. > >>> >> > > >>> >> > > >>> >> > However, I got the following errors "app_not_configured". It seems > >>> >> > the > >>> >> > configuration for applications is incorrect. How should I > configure > >>> >> > the > >>> >> > service properly? My understanding is I want to reuse CER/CEA as > >>> >> > default > >>> >> > authorization application, but the erlang diameter doesn't explain > >>> >> > how > >>> >> > to do > >>> >> > it. Or my understanding is incorrect at all. > >>> >> > >>> >> The problem is a mismatch between the application and capabilities > >>> >> configuration in your SvcOpts: the 'Auth-Application-Id' tuple > >>> >> specifies the Application Id's that are advertised in the outgoing > >>> >> CER/CEA (that diameter itself sends) while 'applications' specifies > >>> >> corresponding dictionary modules. In your case, advertising the > common > >>> >> application (0) during capabilities exchange but backing it up with > a > >>> >> dictionary that implement CC (4) is what causes things to go south. > >>> >> > >>> >> What you want is something like this: > >>> >> > >>> >> {'Auth-Application-Id', [0,4]}, > >>> >> {application, [{alias, cc}, > >>> >> {dictionary, diameter_gen_base_rfc4006}, > >>> >> {module, [server_cb, cc]}], > >>> >> {application, [{alias, base}, > >>> >> {dictionary, diameter_gen_base_rfc6733}, > >>> >> {module, [server_cb, base]}]} > >>> >> > >>> >> That is, advertise both application with the Auth-Application-Id > >>> >> config and configure corresponding dictionaries with 'application' > >>> >> config. You might prefer two different callback modules (instead of > an > >>> >> extra argument) but the point is to match your advertised > capabilities > >>> >> with your configured dictionaries. > >>> >> > >>> >> On a side note, you shouldn't use a diameter prefix on your own > >>> >> dictionaries, so as not to collide with something diameter does in > the > >>> >> future. > >>> >> > >>> >> /Anders, Erlang/OTP > >>> >> > >>> >> > > >>> >> > =ERROR REPORT==== 20-Mar-2013::21:40:50 === > >>> >> > ** Generic server <0.3841.0> terminating > >>> >> > ** Last message in was {diameter, > >>> >> > {recv, > >>> >> > > >>> >> > <<1,0,0,124,128,0,1,1,0,0,0,0,101,222,1,72, > >>> >> > > >>> >> > 101,222,1,72,0,0,1,8,64,0,0,26,99,108,105, > >>> >> > > >>> >> > 101,110,116,46,101,120,97,109,112,108,101, > >>> >> > > >>> >> > 46,99,111,109,0,0,0,0,1,40,64,0,0,19,101, > >>> >> > > >>> >> > 120,97,109,112,108,101,46,99,111,109,0,0,0, > >>> >> > > >>> >> > 1,1,64,0,0,14,0,1,127,0,0,1,0,0,0,0,1,10,64, > >>> >> > > >>> >> > 0,0,12,0,0,0,193,0,0,1,13,0,0,0,14,67,108, > >>> >> > > >>> >> > 105,101,110,116,0,0,0,0,1,2,64,0,0,12,0,0,0, > >>> >> > 0>>}} > >>> >> > ** When Server state == > >>> >> > {state,recv_CER,accept,<0.3840.0>,<0.3842.0>, > >>> >> > diameter_gen_base_rfc3588, > >>> >> > {diameter_service,<0.50.0>, > >>> >> > {diameter_caps," > server.example.com", > >>> >> > "example.com", > >>> >> > [{127,0,0,1}], > >>> >> > 193,"Server",[],[], > >>> >> > [0], > >>> >> > [],[],[],[],[]}, > >>> >> > [{diameter_app,server, > >>> >> > diameter_gen_base_rfc4006_cc, > >>> >> > [server_cb], > >>> >> > server,4,false, > >>> >> > [{answer_errors,report}, > >>> >> > > >>> >> > {request_errors,answer_3xxx}]}]}, > >>> >> > false,exit} > >>> >> > ** Reason for termination == > >>> >> > ** {{badmatch,{error,{app_not_configured,0}}}, > >>> >> > [{diameter_peer_fsm,recv_CER,2, > >>> >> > > >>> >> > [{file,"src/diameter_peer_fsm.erl"},{line,849}]}, > >>> >> > {diameter_peer_fsm,build_answer,3, > >>> >> > > >>> >> > [{file,"src/diameter_peer_fsm.erl"},{line,680}]}, > >>> >> > {diameter_peer_fsm,send_answer,3, > >>> >> > > >>> >> > [{file,"src/diameter_peer_fsm.erl"},{line,647}]}, > >>> >> > {diameter_peer_fsm,handle_info,2, > >>> >> > > >>> >> > [{file,"src/diameter_peer_fsm.erl"},{line,292}]}, > >>> >> > > {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,607}]}, > >>> >> > > >>> >> > {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} > >>> >> > > >>> >> > > >>> >> > Could you give me some hints on this issue? The erlang debugger is > >>> >> > not > >>> >> > easy > >>> >> > to use and call stack information is hard to read (when I show the > >>> >> > trace > >>> >> > window, all the buttons for step/next/continue become invisible). > >>> >> > The > >>> >> > diameter guidance explains the concept but no clear steps about > >>> >> > configuration. > >>> >> > > >>> >> > > >>> >> > Many thanks! > >>> >> > > >>> >> > Samuel > >>> >> > > >>> >> > > >>> >> > > >>> >> > On Tue, Mar 12, 2013 at 12:10 PM, S X > >>> >> > wrote: > >>> >> >> > >>> >> >> Hello, Anders & Andre, > >>> >> >> > >>> >> >> Thanks a lot for your quick responses and suggestions, which help > >>> >> >> me > >>> >> >> start > >>> >> >> to exploring Erlang world ^_^ > >>> >> >> > >>> >> >> I was able to generate based on the file rfc4006_cc.dia under the > >>> >> >> diameter/examples/dict folders. And understand a bit why and how > >>> >> >> Erlang > >>> >> >> diameter protocol dictionaries are organized and maintained. > >>> >> >> > >>> >> >> Many thanks and talk to you later! > >>> >> >> > >>> >> >> Samuel > >>> >> >> > >>> >> >> > >>> >> >> On Tue, Mar 12, 2013 at 7:44 AM, Anders Svensson > >>> >> >> > >>> >> >> wrote: > >>> >> >>> > >>> >> >>> Btw, there's an RFC 4006 dictionary (and a few more) under > >>> >> >>> diameter/examples/dict in the repo. > >>> >> >>> > >>> >> >>> /Anders, Erlang/OTP > >>> >> >>> > >>> >> >>> On Tue, Mar 12, 2013 at 10:32 AM, Andr? Graf > > >>> >> >>> wrote: > >>> >> >>> > Hello S(?) > >>> >> >>> > > >>> >> >>> > You have to come up with your own .dia file if the message > types > >>> >> >>> > are > >>> >> >>> > not covered in the .dia files provided by Erlang. Your own > .dia > >>> >> >>> > file > >>> >> >>> > will typically include the '@inherits > >>> >> >>> > diameter_gen_base_rfc3588' > >>> >> >>> > clause which imports the basic avp's from rfc3588. You then > have > >>> >> >>> > to > >>> >> >>> > provide the missing avp's for your CCR/CCA message types, and > >>> >> >>> > also > >>> >> >>> > define these messages. Thanks to the format of a .dia file it > is > >>> >> >>> > pretty much copy-pasting from the rfc4006. Once your .dia file > >>> >> >>> > is > >>> >> >>> > ready, you use diameterc to generate the .erl and .hrl file. > >>> >> >>> > > >>> >> >>> > Hope that helped! > >>> >> >>> > > >>> >> >>> > BR/Andr? > >>> >> >>> > > >>> >> >>> > > >>> >> >>> > > >>> >> >>> > On 12 March 2013 04:58, S X wrote: > >>> >> >>> >> Hello, > >>> >> >>> >> > >>> >> >>> >> I am new to Erlang and Diameter protocol. Wish someone could > >>> >> >>> >> provide > >>> >> >>> >> some > >>> >> >>> >> suggestions on how to utilize the diameter library properly > in > >>> >> >>> >> Erlang. > >>> >> >>> >> > >>> >> >>> >> For example, I want to send/receive some Gx messages, like > CCR > >>> >> >>> >> (Credit > >>> >> >>> >> Control Request), CCA(Credit Control Answer messages. But I > >>> >> >>> >> notice > >>> >> >>> >> that > >>> >> >>> >> there are some predefined messages in erlang diameter > library. > >>> >> >>> >> As > >>> >> >>> >> my > >>> >> >>> >> understanding, should use the utility diameterc to generate > >>> >> >>> >> erlang > >>> >> >>> >> header/source files based on dia files. There are few dia > files > >>> >> >>> >> under > >>> >> >>> >> otp/lib/diameter/src/dict folder, like acct_rfc6733.dia, > >>> >> >>> >> base_rfc3588.dia, > >>> >> >>> >> relay.dia, base_accounting.dia, base_rfc6733.dia. Those > files > >>> >> >>> >> don't > >>> >> >>> >> have > >>> >> >>> >> the definitions for Gx. > >>> >> >>> >> > >>> >> >>> >> How should I generate or where can I obtain dia files which > >>> >> >>> >> have > >>> >> >>> >> support for > >>> >> >>> >> CCR/CCA message format? Are the dia files proprietary or > >>> >> >>> >> manufacturer > >>> >> >>> >> specific? Can I generate with the 3GPP spec? What are the > >>> >> >>> >> proper > >>> >> >>> >> steps? > >>> >> >>> >> > >>> >> >>> >> Thanks a lot! > >>> >> >>> >> > >>> >> >>> >> S > >>> >> >>> >> > >>> >> >>> >> > >>> >> >>> >> _______________________________________________ > >>> >> >>> >> 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 mrtndimitrov@REDACTED Fri Jan 24 21:50:40 2014 From: mrtndimitrov@REDACTED (Martin Koroudjiev) Date: Fri, 24 Jan 2014 22:50:40 +0200 Subject: [erlang-questions] Is there a graph DB written in Erlang? Message-ID: <52E2D220.3030807@gmail.com> Hi, Erlang seems such a perfect fit for a graph DB that I was pretty sure there is one but after searching for a while I don't seem to find one. I actually found Phoebus but there is no work on it for more than 3 years. Does anyone use it? Is it production ready? Thanks for helping me out. Martin From sergej.jurecko@REDACTED Fri Jan 24 22:31:29 2014 From: sergej.jurecko@REDACTED (Sergej Jurecko) Date: Fri, 24 Jan 2014 22:31:29 +0100 Subject: [erlang-questions] [ANN] ActorDB a distributed SQL database (Sergej Jurecko) In-Reply-To: <20140124190621.GO18664@ferdair.local> References: <309CCC64-D378-4D8C-80AE-250EDC3D543D@gmail.com> <8965068E-EF90-4520-B329-59F71F0350DE@gmail.com> <20140124163331.GN18664@ferdair.local> <20140124190621.GO18664@ferdair.local> Message-ID: On Jan 24, 2014, at 8:22 PM, Fred Hebert wrote: > > Does this mean there's a risk of configuration changes not making it out > properly, but nodes still connecting? i.e. this could potentially lead > to your nodes not seeing a majority where there should be one, or the > exact opposite? > > In most of the papers I have read (and in systems like Riak), the > opposite is often true: you actually want strong consistency when > modifying the cluster, and eventual one is tolerable otherwise. This > seems like a funny (and risky) choice. > Nodes that have not claimed any shards are inactive. The only communication they will receive are periodic state broadcasts. If master does not get a majority confirmation of commit, it will itself not commit and the system will eventually correct itself. It does leave a chance of that commit to propagate to the rest of the cluster: master went down before committing itself, the node that has committed has highest rank of all once a majority of nodes are connected back and it becomes master. Global state change guarantees that when it says state has been saved, it actually has been. If it returns error, it leaves a small window of chance that state will propagate once network corrects itself. But that is actually ok. Because every save to global state is of the nature that it needs to succeed. If it does not, it will be tried periodically until it does. When a shard has been moved to another node and that node is ready to tell all other nodes it is new owner, there is no going back. It must eventually be succeed. It is an unusual choice I admit. If we find fault in it, it will be changed. > > How do you ensure that quorum consensus works with ACID? Is it doing > majority reads? It would be important to describe it right. Writes and reads are done by master. Master does not process any writes or reads until it has quorum. Requests will be queued if master needs to restore db from other nodes. > > I can see how that works. An interestign question is what happens if all > nodes go down, and need to be booted back up. Is there a way to reload > from incompletely booted nodes? I assume that by default you only allow > to copy from healthy nodes in the cluster, but if all of them became > unhealthy, there has to be a way to restore state back -- otherwise all > nodes will be waiting for all peers to come back up, and you're more or > less deadlocked. Global state contains name of master node. Once there are enough nodes online and if master is one of them, it will remain master. If master is not, it will be determined. The node that becomes master is considered to have valid state. > > That is a timeout. The question is how long does it take for a timeout > to be seen as a failure, more or less. You do not keep waiting forever, > and therefore you have timeouts. Heh whoops, yeah that was dumb of me. > I'm not sure what you mean by 'all slaves are told to close' -- would > that conflict with the idea that any of 3 nodes can fail? I'm going with > the assumption that the slave nodes stay up if they are to re-elect a > master. Calls to actors are calls to gen_server. If result of gen_server call is that it died with normal exit, call will restart actor and continue to do it until it either receives some other answer other than normal exit. So actors are reactionary to calls requests. Once started anew, they will contact other nodes in cluster to figure out master. > > A tricky issue there is that you may have asymetric netsplits. For > example, it's possible that your client can talk to the master, but that > the masters and slaves cannot communicate together. At that point you > have a master node that gets requests from the client, and a set of > slaves that elect a master among themselves. Depending on how things > work, it is possible that both masters may receive queries at the same > time. Yes but writes will succeed only on the two nodes that have elected a new master because they have majority. > > When the network issue is resolved, you currently have 3 nodes, two of > which believe they are masters, one of the masters which may be lagging > behind one of the nodes it expects to be a slave. That kind of conflict > resolution should be considered. Any node that receives a write request from the wrong node (what it thinks is master) will reinitialize itself to check other nodes. Which will cause it to figure out who is the right master. If it was master previously, it will back down. > > I think this is the same consideration as the previous point. I guess > the question/recommendation here is to be able to make a clear > distinction to the user of the database on whether the transaction > clearly succeeded, clearly failed, or that you actually do not know, and > to be careful not to report a timeout/failed proxy as a failure, in > which case one could believe the transaction is safe to retry. Yes you are right thank you. Timeout on proxy is an oversight. At the moment a proxy timeout will be considered a failure. We are limited by mysqls error messages however, hopefully it has something that applies. > > Anything specific happens if the node it was transfering to dies? I'm > guessing here the lock isn't there indefinitely? It's there until tcp connection is open and it is waiting for response. Without a successful response nothing happens. The origin actor remains unchanged. > > In which case, be careful because it could be one of them damn > netsplits, and you suddenly have duplicated shards that both believe > they are canonical! > You've uncovered a bug. Thank you. A fix should be quite straightforward. > Regards, > Fred. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From desired.mta@REDACTED Sat Jan 25 23:28:00 2014 From: desired.mta@REDACTED (=?UTF-8?Q?Motiejus_Jak=C5=A1tys?=) Date: Sat, 25 Jan 2014 23:28:00 +0100 Subject: [erlang-questions] jinterface is attempting to build even on --without-javac Message-ID: Dear List, I am building R16B on armv7hl and want to skip building jinterface. I pass `--without-javac` to ./configure, but it still attempts to build it and fails with an error: === Leaving application sasl make[2]: Leaving directory `/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/sasl' make[2]: Entering directory `/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface' === Entering application jinterface make[3]: Entering directory `/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface/java_src' make[4]: Entering directory `/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface/java_src/com/ericsson/otp/erlang' if [ ! -d "/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface/priv/" ];then mkdir "/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface/priv/"; fi CLASSPATH=/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface/java_src/ -d /home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface/priv/ OtpAuthException.java /bin/sh: -d: command not found CLASSPATH=/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface/java_src/ -d /home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface/priv/ OtpErlangDecodeException.java make[4]: *** [/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface/priv/com/ericsson/otp/erlang/OtpAuthException.class] Error 127 make[4]: *** Waiting for unfinished jobs.... /bin/sh: -d: command not found make[4]: *** [/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface/priv/com/ericsson/otp/erlang/OtpErlangDecodeException.class] Error 127 make[4]: Leaving directory `/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface/java_src/com/ericsson/otp/erlang' make[3]: *** [opt] Error 2 make[3]: Leaving directory `/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface/java_src' make[2]: *** [opt] Error 2 make[2]: Leaving directory `/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib/jinterface' make[1]: *** [opt] Error 2 make[1]: Leaving directory `/home/abuild/rpmbuild/BUILD/otp_src_R16B/lib' make: *** [tertiary_bootstrap_build] Error 2 How should I properly disable jinterface? Full build log: http://m.jakstys.lt/jinterface_build_failure.txt Full build tree: https://build.merproject.org/package/files?package=erlang&project=home%3Amotiejus%3Abranches%3Ahome%3Asledge%3Asandbox Regards, Motiejus From ok@REDACTED Mon Jan 27 01:31:38 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 27 Jan 2014 13:31:38 +1300 Subject: [erlang-questions] Is -on_load() still experimental? Anyone using it? In-Reply-To: <20140124175822.GA17752@circlewave.net> References: <20140124175822.GA17752@circlewave.net> Message-ID: <2842C0B0-A6E9-4C79-8A44-11679C735C41@cs.otago.ac.nz> There is a long history behind things like -on_load(), and it's largely a long history of pain and woe. Just recently, for example, I've been reading about the problems this can cause in .NET. There is a minor problem of controlling the order in which -on_load code is executed. Section 10.2.1 of the Ada 2012 standard, for example, describes pragma Elaborate(library_unit_name{, library_unit_name}...); which says that each of the named library units must be fully initialised before this one comes up. In my own Smalltalk system, where the equivalent of a module is a class, I found it necessary to add an initializeAfter: 'class...' property to control the initialisation order, and I remain grateful to the Ada designers for showing me what exactly what I needed. (The usual symptom was something crashing in initialisation because the I/O subsystem wasn't up yet.) The major problem is when there are dependency cycles so that there isn't _any_ consistent order. Suppose we have two modules, ping and pong. The -on_load code for ping needs to call something in pong. The -on-load code for pong needs to call something in ping. OOPS. It's way too easy to get into that situation (*especially* in Java and .NET, where the result isn't a lockup but a mess). It should be possible to build tools that will detect -on_load cycles. Not until such tools are deployed AND there is a way to state load order dependencies in a module that uses it could -on_load be anything but experimental. It requires serious inspection to make sure there are no cycles and no order dependencies if you use that feature. Oh yeah, there's another issue which used to bite me a lot in Interlisp-D, and that's modules that could be loaded but not *re*loaded. The example in the manual bothers me because - it doesn't say "here's how to leave the NIFs alone if they're already loaded and right" - it doesn't say "here's how to unload the NIFs and load new versions if they're already loaded and wrong." - it doesn't even say "here's how your -on_load code can find out which situation it's in" One of the reasons for using Erlang is to support fix-and- reload in running systems, and while -on_load isn't *necessarily* incompatible with that, -on_load hands you the tools you need for *you* to make your code unreloadable. At a minimum, I would want to see -on_load(Name/1). allowed with Name being called as Name(load) or Name(reload) but I'm sure someone can think up something better. From anders.otp@REDACTED Mon Jan 27 10:52:48 2014 From: anders.otp@REDACTED (Anders Svensson) Date: Mon, 27 Jan 2014 10:52:48 +0100 Subject: [erlang-questions] erlang diameter dictionary In-Reply-To: References: Message-ID: Hi Samuel. > How are you? Still kicking, thanks. :) > I have a question about modifying diameter dictionary. For example, for > diameter CCR message, if I want to change "Service-Context-Id" from > mandatory to non mandatory property so I don't have to fill this property in > the CCR message, I changed the file rfc4006_cc.dia as following: > > 1. Service-Context-Id 461 UTF8String - > 2. Change from {Service-Context-id} to [Service-Context-Id] and move it > below {CC-Request-Number} in CCR message definition Easy enough to do but if you send a CCR without Service-Context-Id to a node expecting an RFC 4006 CCR then the request is likely to be rejected. 1.3.3 of RFC 6733 requires a new Command Code when making this specific modification. > Then I used diameterc to generate new erlang files accordingly. The files > look good and I was able to compile. By the way, I include the diameter > library source code from OTP release R16B03 into the project, just in order > to debug the diameter easily. > > I filled the CCR message as below: Just a couple of pointers before getting to the actual issue ... > CCR = #diameter_rfc4006_cc_CCR{ It's not a good idea to use diameter as a prefix here in case diameter itself ships with a this dictionary one day. > 'Session-Id' = diameter:session_id(?L(who)), > 'Auth-Application-Id' = 16777238, > 'CC-Request-Type' = > ?'DIAMETER_RFC4006_CC_CC-REQUEST-TYPE_INITIAL_REQUEST', These long macro names are truly hideous, at least if you like to be able to maintain readable line lengths. (78 characters in my book.) At best I'd redefine those I want to use. Eg. -define(INITIAL, ?'DIAMETER_RFC4006_CC_CC-REQUEST-TYPE_INITIAL_REQUEST'). > 'CC-Request-Number' = 0 > }, > diameter:call(Name, ?APP_CCR_ALIAS, CCR, []). > > When I run from the erlang shell R16B03, I got the encoding error like this: > > why: {diameter_codec,encode, > {{mandatory_avp_missing,'CC-Request-Type','CCR'}, I suspect you haven't recompiled your source file after modifying the dictionary. Records are just tuples, and fields in the record notation are mapped to tuple indices using the record definition known to the source in question. If the source creating the record above has the "old" definition then the fields set as CC-Request-Type and CC-Request-Number will be in the positions in which the "new" dictionary module expects to find CC-Request-Number and Service-Context-Id, leading to the "missing" CC-Request-Type error. That is, you need to recompile any source that includes a generated hrl, in addition to loading the new dictionary module. > [{diameter_gen_rfc4006_cc,encode_avps,2, > [{file, > > "/usr/lib/erlang/lib/diameter-1.5/include/diameter_gen.hrl"}, > {line,59}]}, > {diameter_codec,e,2, > [{file,"src/diameter_codec.erl"},{line,120}]}, > {diameter_codec,encode,2, > [{file,"src/diameter_codec.erl"},{line,71}]}, > {diameter_traffic,encode,3, > [{file,"src/diameter_traffic.erl"},{line,1481}]}, > {diameter_traffic,send_R,6, > [{file,"src/diameter_traffic.erl"},{line,1320}]}, > {diameter_traffic,'-send_request/4-fun-0-',6, > [{file,"src/diameter_traffic.erl"},{line,1094}]}]}} > who: <0.62.0> > what: {diameter_codec,encode, > [diameter_gen_rfc4006_cc, > {diameter_packet, > {diameter_header,1,undefined,undefined,undefined, > 398339147,398339147,undefined,undefined,undefined, > undefined}, > undefined, > {diameter_rfc4006_cc_CCR, > ["who",";","1452024187",";","1",";","nonode@REDACTED"], > "centos","example.com","example.com",16777238, > undefined,1,0, > ["centos"], > > > [],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[], > []}, > undefined,[],undefined}]} > {error,encode} > > I don't really understand why getting this error or the error information is > a little bit confusing me. > Am I doing right to modify the dictionary file? What is the proper way to do > that? Nothing wrong with the modification, aside from the fact that you're straying from RFC 4006 Credit-Control as I mentioned above. > What is best way of debugging the diameter library? Can you give me some > hints? In this case it's just confusion over record definitions I think, and these are always confusing until you realize that different code might have different record definitions. You can see the record being encoded by tracing on diameter_codec:encode/2 for example, which would show the unexpected positions of CC-Request-Type and CC-Request-Number relative to your dictionary definition. /Anders, Erlang/OTP > > Thanks a lot! > > Samuel > > > On Sat, Mar 23, 2013 at 7:11 AM, Anders Svensson > wrote: >> >> On Fri, Mar 22, 2013 at 7:52 PM, S X wrote: >> > Hi Anders, >> > >> > Sorry, I think I understand now. You told me the solution. Just use '[ >> > ]'. >> > >> > Anyhow, many thanks! >> > >> > By the way, since 3588 is obsolete, can I use 6733 while compile other >> > dictionaries? >> >> Yes. /Anders >> >> >> > >> > Thanks! >> > >> > Samuel >> > >> > >> > On Fri, Mar 22, 2013 at 2:46 PM, S X wrote: >> >> >> >> Hi Anders, >> >> >> >> Thanks for your quick response. But I still don't get why the DH is >> >> being >> >> interpreted as a list of Destination-Host values ( Is it because the >> >> define >> >> "avp_arity('CCR', 'Destination-Host') -> {0, 1};"). >> >> >> >> And if it is treated as a list, how come it has a length greater than >> >> 1, I >> >> just set it once in prepare_request. >> >> >> >> What should I do to correct it? Or which document should I read more >> >> carefully to understand this properly? >> >> >> >> Thanks a lot! >> >> >> >> Samuel >> >> >> >> >> >> On Fri, Mar 22, 2013 at 1:27 PM, Anders Svensson >> >> wrote: >> >>> >> >>> Hi Samuel >> >>> >> >>> On Fri, Mar 22, 2013 at 5:55 PM, S X wrote: >> >>> > Thanks a lot, Anders, >> >>> > >> >>> > I think I overlooked what the meaning of the configurable ID tag (4) >> >>> > in >> >>> > the >> >>> > dia file is , which is supposed to be the important application ID >> >>> > to >> >>> > be >> >>> > used in the configuration. Your suggestion about the prefix is also >> >>> > right. >> >>> > But now I am just learning erlang diameter library. >> >>> > >> >>> > I just try to follow the sample RAR message style, and am still >> >>> > having >> >>> > issue >> >>> > with sending CCR message. The client configuration now is: >> >>> > >> >>> > -define(SERVICE(Name), [{'Origin-Host', ?L(Name) ++ ".example.com"}, >> >>> > {'Origin-Realm', "example.com"}, >> >>> > {'Vendor-Id', 193}, >> >>> > {'Product-Name', "Client"}, >> >>> > {'Auth-Application-Id', >> >>> > [?DIAMETER_APP_ID_CCRA]}, >> >>> > {application, [{alias, ?APP_CCR_ALIAS}, >> >>> > {dictionary, >> >>> > ?DIAMETER_DICT_CCRA}, >> >>> > {module, client_cb_ccra}]}]). >> >>> > >> >>> > Try to send CCR message: >> >>> > >> >>> > call(Name) -> >> >>> > SId = diameter:session_id(?L(Name)), >> >>> > CCR = #diameter_base_rfc4006_cc_CCR{ >> >>> > 'Session-Id' = SId, >> >>> > 'Service-Context-Id' = "Test", >> >>> > 'CC-Request-Type' = >> >>> > ?'DIAMETER_BASE_RFC4006_CC_CC-REQUEST-TYPE_INITIAL_REQUEST', >> >>> > 'CC-Request-Number' = 0, >> >>> > 'Auth-Application-Id' = ?DIAMETER_APP_ID_CCRA, >> >>> > 'User-Name' = "Me"}, >> >>> > diameter:call(Name, ?APP_CCR_ALIAS, CCR, []). >> >>> > >> >>> > >> >>> > In the client callback module: >> >>> > >> >>> > prepare_request(#diameter_packet{msg = Rec}, _, {_, Caps}) -> >> >>> > #diameter_caps{origin_host = {OH, DH}, >> >>> > origin_realm = {OR, DR}} >> >>> > = Caps, >> >>> > >> >>> > {send, Rec#diameter_base_rfc4006_cc_CCR{'Origin-Host' = OH, >> >>> > 'Origin-Realm' = OR, >> >>> > 'Destination-Host' = DH, >> >>> > 'Destination-Realm' = DR}}. >> >>> > >> >>> > I got the error about AVP property: >> >>> > >> >>> > =ERROR REPORT==== 22-Mar-2013::00:17:31 === >> >>> > why: {diameter_codec,encode, >> >>> > {{repeated_avp_excessive_arity,'Destination-Host',1, >> >>> > "server.example.com",'CCR'}, >> >>> >> >>> This is because Destination-Host is optional in CCR and AVP's are >> >>> encoded differently in a message record depending on whether or not >> >>> there can be exactly one occurrence: if so then the field value should >> >>> be the AVP value, if not then a list of AVP values. That is, your CCR >> >>> record should have >> >>> >> >>> 'Destination-Host' = [DH], >> >>> >> >>> in this case. >> >>> >> >>> > [{diameter_gen_base_rfc4006_cc,encode_avps,2, >> >>> > >> >>> > [{file,"diameter_gen_base_rfc4006_cc.erl"},{line,47}]}, >> >>> > >> >>> > {diameter_codec,e,2,[{file,"diameter_codec.erl"},{line,112}]}, >> >>> > {diameter_codec,encode,2, >> >>> > [{file,"diameter_codec.erl"},{line,63}]}, >> >>> > {diameter_traffic,encode,3, >> >>> > [{file,"diameter_traffic.erl"},{line,1437}]}, >> >>> > {diameter_traffic,send_R,6, >> >>> > [{file,"diameter_traffic.erl"},{line,1276}]}, >> >>> > {diameter_traffic,'-send_request/4-fun-0-',4, >> >>> > [{file,"diameter_traffic.erl"},{line,1050}]}]}} >> >>> > who: <0.180.0> >> >>> > what: {diameter_codec,encode, >> >>> > [diameter_gen_base_rfc4006_cc, >> >>> > {diameter_packet, >> >>> > {diameter_header,1,undefined,undefined,undefined, >> >>> > >> >>> > 1330492780,1330492780,undefined,undefined,undefined, >> >>> > undefined}, >> >>> > undefined, >> >>> > {diameter_base_rfc4006_cc_CCR, >> >>> > >> >>> > ["client",";","1425429748",";","2",";","nonode@REDACTED"], >> >>> > >> >>> > "client.example.com","example.com","example.com",4, >> >>> > >> >>> > "Test",1,0,"server.example.com","Me",[],[],[],[],[],[], >> >>> > [],[],[],[],[],[],[],[],[],[],[],[]}, >> >>> > undefined,[],undefined}]} >> >>> > >> >>> > My understanding is that the client callback prepare_request sets >> >>> > the >> >>> > "Destination-Host" (retrievd via the CER/A done at earilier stage) >> >>> > in >> >>> > the >> >>> > CCR message. So I should set it right. But seems I still >> >>> > misunderstand >> >>> > something. Does the error information "repeated_avp_excessive_arity" >> >>> > mean " >> >>> > 0-1 Zero or one instance of the AVP MAY be present in the message. >> >>> > It >> >>> > is >> >>> >> >>> Yes, exactly. In your case your DH is being interpreted as list of >> >>> Destination-Host values, and "excessive arity" is a result of that >> >>> list having length greater than 1. >> >>> >> >>> /Anders, Erlang/OTP >> >>> >> >>> >> >>> > considered an error if there is more than one instance of the AVP" >> >>> > according >> >>> > to rfc4006 spec? The erlang error message is not that >> >>> > straightforward, >> >>> > really confusing newbies:). >> >>> > >> >>> > Do you have any hints? (I hope I could provide some ramp up steps >> >>> > for >> >>> > other >> >>> > people to learn with erlang diameter library after making it >> >>> > work^_^) >> >>> > >> >>> > Many thanks, >> >>> > >> >>> > Samuel >> >>> > >> >>> > >> >>> > >> >>> > On Thu, Mar 21, 2013 at 8:59 AM, Anders Svensson >> >>> > >> >>> > wrote: >> >>> >> >> >>> >> On Thu, Mar 21, 2013 at 2:55 AM, S X >> >>> >> wrote: >> >>> >> > Hello, >> >>> >> > >> >>> >> > Sorry, I still have some problems with sending CCR/CCA messages. >> >>> >> > I >> >>> >> > didn't >> >>> >> > quite get how to configure multiple diameter applications though >> >>> >> > it >> >>> >> > seems >> >>> >> > clear when I read the diameter protocol. >> >>> >> > >> >>> >> > Based on the sample diameter code, I made the following changes, >> >>> >> > diameter_gen_base_rfc4006_cc is the dictionary generated with >> >>> >> > rfc4006_cc.dia: >> >>> >> > $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Client >> >>> >> > $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >> >>> >> > >> >>> >> > -define(SVC_NAME, ?MODULE). >> >>> >> > -define(APP_ALIAS, ?MODULE). >> >>> >> > -define(CALLBACK_MOD, client_cb). >> >>> >> > -define(DIAMETER_DICT_CCRA, diameter_gen_base_rfc4006_cc). >> >>> >> > >> >>> >> > -define(L, atom_to_list). >> >>> >> > >> >>> >> > -define(SERVICE(Name), [{'Origin-Host', ?L(Name) ++ >> >>> >> > ".example.com"}, >> >>> >> > {'Origin-Realm', "example.com"}, >> >>> >> > {'Vendor-Id', 0}, >> >>> >> > {'Product-Name', "Client"}, >> >>> >> > {'Auth-Application-Id', >> >>> >> > [?DIAMETER_APP_ID_COMMON]}, >> >>> >> > {application, [{alias, ?APP_ALIAS}, >> >>> >> > {dictionary, >> >>> >> > ?DIAMETER_DICT_CCRA}, >> >>> >> > {module, >> >>> >> > ?CALLBACK_MOD}]}]). >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Server >> >>> >> > $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >> >>> >> > >> >>> >> > -define(DIAMETER_DICT_CCRA, diameter_gen_base_rfc4006_cc). >> >>> >> > >> >>> >> > init(State) -> >> >>> >> > SvcName = ?MODULE, >> >>> >> > SvcOpts = [{'Origin-Host', atom_to_list(SvcName) ++ >> >>> >> > ".example.com"}, >> >>> >> > {'Origin-Realm', "example.com"}, >> >>> >> > {'Vendor-Id', 193}, >> >>> >> > {'Product-Name', "Server"}, >> >>> >> > {'Auth-Application-Id', >> >>> >> > [?DIAMETER_APP_ID_COMMON]}, >> >>> >> > {application, [{alias, ?MODULE}, >> >>> >> > {dictionary, ?DIAMETER_DICT_CCRA}, >> >>> >> > {module, server_cb}]}], >> >>> >> > TransportOpts = [{transport_module, diameter_tcp}, >> >>> >> > {transport_config, [{reuseaddr, true}, >> >>> >> > {ip, {127,0,0,1}}, {port, 3868}]}], >> >>> >> > diameter:start(), >> >>> >> > diameter:start_service(SvcName, SvcOpts), >> >>> >> > diameter:add_transport(SvcName, {listen, TransportOpts}), >> >>> >> > erlang:display("Set up diameter server completed!"), >> >>> >> > {ok, State}. >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > I changed the callbacks client_cb and server_cb to handle CCR/CCA >> >>> >> > messages. >> >>> >> > >> >>> >> > >> >>> >> > However, I got the following errors "app_not_configured". It >> >>> >> > seems >> >>> >> > the >> >>> >> > configuration for applications is incorrect. How should I >> >>> >> > configure >> >>> >> > the >> >>> >> > service properly? My understanding is I want to reuse CER/CEA as >> >>> >> > default >> >>> >> > authorization application, but the erlang diameter doesn't >> >>> >> > explain >> >>> >> > how >> >>> >> > to do >> >>> >> > it. Or my understanding is incorrect at all. >> >>> >> >> >>> >> The problem is a mismatch between the application and capabilities >> >>> >> configuration in your SvcOpts: the 'Auth-Application-Id' tuple >> >>> >> specifies the Application Id's that are advertised in the outgoing >> >>> >> CER/CEA (that diameter itself sends) while 'applications' specifies >> >>> >> corresponding dictionary modules. In your case, advertising the >> >>> >> common >> >>> >> application (0) during capabilities exchange but backing it up with >> >>> >> a >> >>> >> dictionary that implement CC (4) is what causes things to go south. >> >>> >> >> >>> >> What you want is something like this: >> >>> >> >> >>> >> {'Auth-Application-Id', [0,4]}, >> >>> >> {application, [{alias, cc}, >> >>> >> {dictionary, diameter_gen_base_rfc4006}, >> >>> >> {module, [server_cb, cc]}], >> >>> >> {application, [{alias, base}, >> >>> >> {dictionary, diameter_gen_base_rfc6733}, >> >>> >> {module, [server_cb, base]}]} >> >>> >> >> >>> >> That is, advertise both application with the Auth-Application-Id >> >>> >> config and configure corresponding dictionaries with 'application' >> >>> >> config. You might prefer two different callback modules (instead of >> >>> >> an >> >>> >> extra argument) but the point is to match your advertised >> >>> >> capabilities >> >>> >> with your configured dictionaries. >> >>> >> >> >>> >> On a side note, you shouldn't use a diameter prefix on your own >> >>> >> dictionaries, so as not to collide with something diameter does in >> >>> >> the >> >>> >> future. >> >>> >> >> >>> >> /Anders, Erlang/OTP >> >>> >> >> >>> >> > >> >>> >> > =ERROR REPORT==== 20-Mar-2013::21:40:50 === >> >>> >> > ** Generic server <0.3841.0> terminating >> >>> >> > ** Last message in was {diameter, >> >>> >> > {recv, >> >>> >> > >> >>> >> > <<1,0,0,124,128,0,1,1,0,0,0,0,101,222,1,72, >> >>> >> > >> >>> >> > 101,222,1,72,0,0,1,8,64,0,0,26,99,108,105, >> >>> >> > >> >>> >> > 101,110,116,46,101,120,97,109,112,108,101, >> >>> >> > >> >>> >> > 46,99,111,109,0,0,0,0,1,40,64,0,0,19,101, >> >>> >> > >> >>> >> > 120,97,109,112,108,101,46,99,111,109,0,0,0, >> >>> >> > >> >>> >> > 1,1,64,0,0,14,0,1,127,0,0,1,0,0,0,0,1,10,64, >> >>> >> > >> >>> >> > 0,0,12,0,0,0,193,0,0,1,13,0,0,0,14,67,108, >> >>> >> > >> >>> >> > 105,101,110,116,0,0,0,0,1,2,64,0,0,12,0,0,0, >> >>> >> > 0>>}} >> >>> >> > ** When Server state == >> >>> >> > {state,recv_CER,accept,<0.3840.0>,<0.3842.0>, >> >>> >> > diameter_gen_base_rfc3588, >> >>> >> > {diameter_service,<0.50.0>, >> >>> >> > >> >>> >> > {diameter_caps,"server.example.com", >> >>> >> > "example.com", >> >>> >> > [{127,0,0,1}], >> >>> >> > 193,"Server",[],[], >> >>> >> > [0], >> >>> >> > [],[],[],[],[]}, >> >>> >> > [{diameter_app,server, >> >>> >> > >> >>> >> > diameter_gen_base_rfc4006_cc, >> >>> >> > [server_cb], >> >>> >> > server,4,false, >> >>> >> > [{answer_errors,report}, >> >>> >> > >> >>> >> > {request_errors,answer_3xxx}]}]}, >> >>> >> > false,exit} >> >>> >> > ** Reason for termination == >> >>> >> > ** {{badmatch,{error,{app_not_configured,0}}}, >> >>> >> > [{diameter_peer_fsm,recv_CER,2, >> >>> >> > >> >>> >> > [{file,"src/diameter_peer_fsm.erl"},{line,849}]}, >> >>> >> > {diameter_peer_fsm,build_answer,3, >> >>> >> > >> >>> >> > [{file,"src/diameter_peer_fsm.erl"},{line,680}]}, >> >>> >> > {diameter_peer_fsm,send_answer,3, >> >>> >> > >> >>> >> > [{file,"src/diameter_peer_fsm.erl"},{line,647}]}, >> >>> >> > {diameter_peer_fsm,handle_info,2, >> >>> >> > >> >>> >> > [{file,"src/diameter_peer_fsm.erl"},{line,292}]}, >> >>> >> > >> >>> >> > {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,607}]}, >> >>> >> > >> >>> >> > {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} >> >>> >> > >> >>> >> > >> >>> >> > Could you give me some hints on this issue? The erlang debugger >> >>> >> > is >> >>> >> > not >> >>> >> > easy >> >>> >> > to use and call stack information is hard to read (when I show >> >>> >> > the >> >>> >> > trace >> >>> >> > window, all the buttons for step/next/continue become invisible). >> >>> >> > The >> >>> >> > diameter guidance explains the concept but no clear steps about >> >>> >> > configuration. >> >>> >> > >> >>> >> > >> >>> >> > Many thanks! >> >>> >> > >> >>> >> > Samuel >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> > On Tue, Mar 12, 2013 at 12:10 PM, S X >> >>> >> > wrote: >> >>> >> >> >> >>> >> >> Hello, Anders & Andre, >> >>> >> >> >> >>> >> >> Thanks a lot for your quick responses and suggestions, which >> >>> >> >> help >> >>> >> >> me >> >>> >> >> start >> >>> >> >> to exploring Erlang world ^_^ >> >>> >> >> >> >>> >> >> I was able to generate based on the file rfc4006_cc.dia under >> >>> >> >> the >> >>> >> >> diameter/examples/dict folders. And understand a bit why and how >> >>> >> >> Erlang >> >>> >> >> diameter protocol dictionaries are organized and maintained. >> >>> >> >> >> >>> >> >> Many thanks and talk to you later! >> >>> >> >> >> >>> >> >> Samuel >> >>> >> >> >> >>> >> >> >> >>> >> >> On Tue, Mar 12, 2013 at 7:44 AM, Anders Svensson >> >>> >> >> >> >>> >> >> wrote: >> >>> >> >>> >> >>> >> >>> Btw, there's an RFC 4006 dictionary (and a few more) under >> >>> >> >>> diameter/examples/dict in the repo. >> >>> >> >>> >> >>> >> >>> /Anders, Erlang/OTP >> >>> >> >>> >> >>> >> >>> On Tue, Mar 12, 2013 at 10:32 AM, Andr? Graf >> >>> >> >>> >> >>> >> >>> wrote: >> >>> >> >>> > Hello S(?) >> >>> >> >>> > >> >>> >> >>> > You have to come up with your own .dia file if the message >> >>> >> >>> > types >> >>> >> >>> > are >> >>> >> >>> > not covered in the .dia files provided by Erlang. Your own >> >>> >> >>> > .dia >> >>> >> >>> > file >> >>> >> >>> > will typically include the '@inherits >> >>> >> >>> > diameter_gen_base_rfc3588' >> >>> >> >>> > clause which imports the basic avp's from rfc3588. You then >> >>> >> >>> > have >> >>> >> >>> > to >> >>> >> >>> > provide the missing avp's for your CCR/CCA message types, and >> >>> >> >>> > also >> >>> >> >>> > define these messages. Thanks to the format of a .dia file it >> >>> >> >>> > is >> >>> >> >>> > pretty much copy-pasting from the rfc4006. Once your .dia >> >>> >> >>> > file >> >>> >> >>> > is >> >>> >> >>> > ready, you use diameterc to generate the .erl and .hrl file. >> >>> >> >>> > >> >>> >> >>> > Hope that helped! >> >>> >> >>> > >> >>> >> >>> > BR/Andr? >> >>> >> >>> > >> >>> >> >>> > >> >>> >> >>> > >> >>> >> >>> > On 12 March 2013 04:58, S X wrote: >> >>> >> >>> >> Hello, >> >>> >> >>> >> >> >>> >> >>> >> I am new to Erlang and Diameter protocol. Wish someone could >> >>> >> >>> >> provide >> >>> >> >>> >> some >> >>> >> >>> >> suggestions on how to utilize the diameter library properly >> >>> >> >>> >> in >> >>> >> >>> >> Erlang. >> >>> >> >>> >> >> >>> >> >>> >> For example, I want to send/receive some Gx messages, like >> >>> >> >>> >> CCR >> >>> >> >>> >> (Credit >> >>> >> >>> >> Control Request), CCA(Credit Control Answer messages. But I >> >>> >> >>> >> notice >> >>> >> >>> >> that >> >>> >> >>> >> there are some predefined messages in erlang diameter >> >>> >> >>> >> library. >> >>> >> >>> >> As >> >>> >> >>> >> my >> >>> >> >>> >> understanding, should use the utility diameterc to generate >> >>> >> >>> >> erlang >> >>> >> >>> >> header/source files based on dia files. There are few dia >> >>> >> >>> >> files >> >>> >> >>> >> under >> >>> >> >>> >> otp/lib/diameter/src/dict folder, like acct_rfc6733.dia, >> >>> >> >>> >> base_rfc3588.dia, >> >>> >> >>> >> relay.dia, base_accounting.dia, base_rfc6733.dia. Those >> >>> >> >>> >> files >> >>> >> >>> >> don't >> >>> >> >>> >> have >> >>> >> >>> >> the definitions for Gx. >> >>> >> >>> >> >> >>> >> >>> >> How should I generate or where can I obtain dia files which >> >>> >> >>> >> have >> >>> >> >>> >> support for >> >>> >> >>> >> CCR/CCA message format? Are the dia files proprietary or >> >>> >> >>> >> manufacturer >> >>> >> >>> >> specific? Can I generate with the 3GPP spec? What are the >> >>> >> >>> >> proper >> >>> >> >>> >> steps? >> >>> >> >>> >> >> >>> >> >>> >> Thanks a lot! >> >>> >> >>> >> >> >>> >> >>> >> S >> >>> >> >>> >> >> >>> >> >>> >> >> >>> >> >>> >> _______________________________________________ >> >>> >> >>> >> 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 alex.gerdes@REDACTED Mon Jan 27 11:24:18 2014 From: alex.gerdes@REDACTED (Alex Gerdes) Date: Mon, 27 Jan 2014 11:24:18 +0100 Subject: [erlang-questions] Imported function as argument Message-ID: Hello, I recently bumped into the following issue. I expected that it was possible to use an imported function as argument in a higher-order function. For example: -module(bla). -compile(export_all). -import(lists, [reverse/1, map/2]). foo(Xss) -> map(fun reverse/1, Xss). However, the compiler complains that reverse/1 is undefined: 1> c(bla). bla.erl:8: function reverse/1 undefined error Is it mandatory to give the fully qualified function name for an external function when it is used as argument in a higher-order function? Best regards, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From francesco@REDACTED Mon Jan 27 11:48:51 2014 From: francesco@REDACTED (Francesco Cesarini) Date: Mon, 27 Jan 2014 10:48:51 +0000 Subject: [erlang-questions] Last call for OSCON proposals. January 30 is almost here. In-Reply-To: <1390816992.8807.0.215012@post.oreilly.com> References: <1390816992.8807.0.215012@post.oreilly.com> Message-ID: <52E63993.6060600@erlang-solutions.com> Hi All, if any of you are thinking of presenting at a non Erlang conference this year, I would warmly suggest OSCON, in Portland this July. Thousands of delegates from all over the world, over a dozen parallel tracks, lots of talk about open source, but not enough on functional programming. This will hopefully change. News for this year is that one of the co-chairs is Simon St. Laurent, senior editor at O'Reilly and author of Introducing Erlang. I'm on the program committee as well. Needless to say that we want to see Erlang and Elixir represented in force, with case studies, intros, tutorials and open source libraries. If we get a strong Erlang program, we will schedule an Erlang Factory Lite in conjunction with OSCON. But most important right now is to get the proposals in by January 30th. If you have any questions, ask me or email the list. Cheers, Francesco -------- Original Message -------- Subject: Last call for OSCON proposals. January 30 is almost here. Date: Mon, 27 Jan 2014 02:03:12 -0800 From: O'Reilly Open Source Convention To: francesco@REDACTED O'Reilly Open Source Convention View in browser O'Reilly Open Source Convention Hello Francesco, Although OSCON 2014 is still months away, there's an important OSCON deadline coming up fast. January 30 is the deadline for submitting your proposal to speak. We encourage you to submit a proposal to share your open source knowledge and experiences with others. You don't need to be a guru or experienced speaker. We're looking for interesting stories told in interesting ways, fascinating demos, and provocative ideas. In addition to looking at open source tools and technologies---that is, all the parts of the open source stack---this year we'll discuss open source in a broader context: where it fits in today's workplace, "open" as a guiding philosophy, open hardware, and security and open source code. Find the full details here , including how to write a winning proposal. You may also want to read Simon St. Laurent's post on Proposing a Compelling OSCON Talk for tips on how to intrigue proposal reviewers and attendees alike. Speaking at OSCON is a rewarding experience and a great way to share with the open source community. Carve out some time right now to get your proposal in; you'll be glad you did. We can't guarantee that you'll be an open source superstar once you speak, but you'll be well on your way. Looking forward to hearing from you, Simon St. Laurent, Matthew McCullough, and Sarah Novotny OSCON Program Chairs A Special Thanks to our Sponsors Premier Diamond Sponsor Bluehost Titanium Sponsor Citrix Systems For exhibition and sponsorship opportunities at OSCON, contact Sharon Cordesse at scordesse@REDACTED or (707) 827-7065 O'Reilly Open Source Convention oscon.com You are receiving this message because you attended a previous OSCON conference or have expressed an interest in an open source related technology. Keep up on all things O'Reilly by signing up for our email newsletters, product alerts, and promotions at elists.oreilly.com . To ensure delivery to your inbox (not bulk or junk folders), please add oreilly@REDACTED to your address book. To unsubscribe from all email announcements from O'Reilly, click here . O'Reilly Media, Inc. 1005 Gravenstein Highway North, Sebastopol, CA 95472 (800) 889--8969 or (707) 827--7019 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn@REDACTED Mon Jan 27 11:57:27 2014 From: bjorn@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Mon, 27 Jan 2014 11:57:27 +0100 Subject: [erlang-questions] Is -on_load() still experimental? Anyone using it? In-Reply-To: References: Message-ID: On Fri, Jan 24, 2014 at 10:46 AM, Ferenc Holzhauser < ferenc.holzhauser@REDACTED> wrote: > Hi, > > Recently stumbled into the -on_load() directive. It seems nice to replace > manual work (when possible) e.g. when a live update of a library module > needs some environment/configuration change on the running system. > > doc: http://www.erlang.org/doc/reference_manual/code_loading.html#id84676 > > It says it is experimental (since R13B03). > After trying, it appears to be doing what I think it supposed to but > looking at this note in the doc I'm not sure how safe it is to use in > production. > > We don't recommend using it for anything except loading NIF libraries. We will update the documentation to say that. /Bj?rn -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Mon Jan 27 14:05:34 2014 From: g@REDACTED (Garrett Smith) Date: Mon, 27 Jan 2014 07:05:34 -0600 Subject: [erlang-questions] Last call for OSCON proposals. January 30 is almost here. In-Reply-To: <52E63993.6060600@erlang-solutions.com> References: <1390816992.8807.0.215012@post.oreilly.com> <52E63993.6060600@erlang-solutions.com> Message-ID: Ah, thanks for this! Oddly, having spoken there the last two years, I didn't get anything from them re the CFP. On Jan 27, 2014 4:49 AM, "Francesco Cesarini" < francesco@REDACTED> wrote: > Hi All, > > if any of you are thinking of presenting at a non Erlang conference this > year, I would warmly suggest OSCON, in Portland this July. Thousands of > delegates from all over the world, over a dozen parallel tracks, lots of > talk about open source, but not enough on functional programming. This will > hopefully change. News for this year is that one of the co-chairs is Simon > St. Laurent, senior editor at O'Reilly and author of Introducing Erlang. > I'm on the program committee as well. Needless to say that we want to see > Erlang and Elixir represented in force, with case studies, intros, > tutorials and open source libraries. > > If we get a strong Erlang program, we will schedule an Erlang Factory Lite > in conjunction with OSCON. But most important right now is to get the > proposals in by January 30th. If you have any questions, ask me or email > the list. > > Cheers, > Francesco > > > -------- Original Message -------- Subject: Last call for OSCON > proposals. January 30 is almost here. Date: Mon, 27 Jan 2014 02:03:12 > -0800 From: O'Reilly Open Source Convention To: > francesco@REDACTED > > View in browser > [image: O'Reilly Open Source Convention] > > > Hello Francesco, > > Although OSCON 2014is still months away, there's an important OSCON deadline coming up fast. > January 30 is the deadline for submitting your proposal to speak. > > We encourage you to submit a proposal to share your open source knowledge > and experiences with others. You don't need to be a guru or experienced > speaker. We?re looking for interesting stories told in interesting ways, > fascinating demos, and provocative ideas. > > In addition to looking at open source tools and technologies?that is, all > the parts of the open source stack?this year we'll discuss open source in a > broader context: where it fits in today's workplace, "open" as a guiding > philosophy, open hardware, and security and open source code. Find the full > details here, > including how to write a winning proposal. You may also want to read Simon > St. Laurent's post on Proposing a Compelling OSCON Talkfor tips on how to intrigue proposal reviewers and attendees alike. > > Speaking at OSCON is a rewarding experience and a great way to share with > the open source community. Carve out some time right now to get your > proposal in; you'll be glad you did. We can't guarantee that you'll be an > open source superstar once you speak, but you'll be well on your way. > > Looking forward to hearing from you, > > Simon St. Laurent, Matthew McCullough, and Sarah Novotny > OSCON Program Chairs > > A Special Thanks to our Sponsors > Premier Diamond Sponsor [image: Bluehost] Titanium > Sponsor [image: Citrix Systems] > > For exhibition and sponsorship opportunities at OSCON, contact Sharon > Cordesse at scordesse@REDACTED or (707) 827-7065 > O'Reilly Open Source Convention > oscon.com > > You are receiving this message because you attended a previous OSCON > conference or have expressed an interest in an open source related > technology. Keep up on all things O'Reilly by signing up for our email > newsletters, product alerts, and promotions at elists.oreilly.com. > To ensure delivery to your inbox (not bulk or junk folders), please add > oreilly@REDACTED to your address book. > > To unsubscribe from all email announcements from O'Reilly, click here. > > > O'Reilly Media, Inc. 1005 Gravenstein Highway North, Sebastopol, CA 95472 > (800) 889?8969 or (707) 827?7019 > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve@REDACTED Mon Jan 27 14:40:46 2014 From: steve@REDACTED (Steve Strong) Date: Mon, 27 Jan 2014 14:40:46 +0100 Subject: [erlang-questions] API / Database / Server Programmer Wanted Message-ID: Hi All, A friend of mine runs a startup that is building a comprehensive Events / Listings database, and they are on the hunt for an Erlang developer to help them move their platform forward. Details in the attached PDF, please drop me an email if you are interested in being put in touch with them. Cheers, Steve -- Steve Strong Sent with Sparrow (http://www.sparrowmailapp.com/?sig) -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: API Programmer.pdf Type: application/pdf Size: 39889 bytes Desc: not available URL: From kenneth.lundin@REDACTED Mon Jan 27 16:04:52 2014 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Mon, 27 Jan 2014 16:04:52 +0100 Subject: [erlang-questions] OTP R16B03-1 has been released Message-ID: Erlang/OTP R16B03-1 has been released. OTP R16B03-1 is a service release which corrects a few issues found in the R16B03 release. The corrections are: - The ODBC application was missing in the prebuilt Windows installers. - 3 corrections in the SSL application: - Add missing validation of the server_name_indication option and test for its explicit use. - Elliptic curve selection in server mode now properly selects a curve suggested by the client, if possible. - Bug in the TLS hello extension handling caused the server to behave as it did not understand secure renegotiation. - In the syntax_tools application a bug was introduced which broke reverting of local funs. This is now corrected (thanks to Anthony Ramine) - wx - Solved a problem which caused the debugger to crash when closing a Window. Fixed static linking on Mac. - xmerl - Fixed a problem in the SAX parser when the header of the next document was appearing in the buffer when using xmerl_sax_parser:stream/2 function. You can find the README file with more detailed info at http://www.erlang.org/download/otp_src_R16B03-1.readme You can download the full source distribution from http://www.erlang.org/download/otp_src_R16B03-1.tar.gz Note: To unpack the TAR archive you need a GNU TAR compatible program. For installation instructions please read the README that is part of the distribution. You can also find this release at the official Erlang/OTP Git-repository at Github here: https://github.com/erlang/otp tagged *OTP_R16B03-1* The Windows binary distribution can be downloaded from http://www.erlang.org/download/otp_win32_R16B03-1.exe http://www.erlang.org/download/otp_win64_R16B03-1.exe On-line documentation can be found at http://www.erlang.org/doc/. You can also download the complete HTML documentation or the Unix manual files http://www.erlang.org/download/otp_doc_html_R16B03-1.tar.gz http://www.erlang.org/download/otp_doc_man_R16B03-1.tar.gz We also want to thank those that sent us patches, suggestions and bug reports, The Erlang/OTP Team at Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From karol.urbanski@REDACTED Mon Jan 27 17:47:47 2014 From: karol.urbanski@REDACTED (Karol Urbanski) Date: Mon, 27 Jan 2014 17:47:47 +0100 Subject: [erlang-questions] R16B03-1 binary packages for CentOS, Debian, Mac, Ubuntu and Windows Message-ID: <20140127164722.GA684@dex.erlang-solutions.com> Hello, You can find our binary packages for the newest Erlang release (R16B03-1) at http://www.erlang-solutions.com/downloads/download-erlang-otp The systems we provide the packages for are CentOS6, Mac OS X Snow Leopard and newer, Debian 7.0.0 and Ubuntu 13.10/13.04/12.04, with more to come in the following days. Best regards, Karol Urbanski From max.lapshin@REDACTED Mon Jan 27 21:03:27 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 28 Jan 2014 00:03:27 +0400 Subject: [erlang-questions] =?utf-8?q?=5BANN=5D_pulsedb=3A_storage_for_tim?= =?utf-8?q?e_series_=E2=80=94_library_and_daemon?= Message-ID: Hi. I want to announce our library that I've extracted from flussonic (former erlyvideo): https://github.com/flussonic/pulsedb You can save uniform time series (ordered list of (utc,integer) pairs) with this library with second step and read later for building graphics. This library was designed to be a replacement for http://opentsdb.net/ It is important to understand that it is not a storage for events, it is not a replacement for statsd. It cannot work with events that happen non-uniformly in time. Right now it has following feature set: 1) you can store data with following structure: metric_name utc int_value tag1=value1,tag2=value2 2) you can query data from metrics with different names and tell how to filter by tags: sum:total_clients{datacenter=dc01} 3) it uses own file format for storing data on disk. Right now it uses about 190 kb per one day for storing one metrics (about 2 bytes per value) 4) it can write data with non-monotonic timestamps (really cool, comparing to others!) 5) you can use it as a library in your software or as a service. 6) you can subscribe to live feeds with the same aggregation as in reading from disk. I don't know who else has such feature. 7) it has cool network protocol that uses not more than 13 bytes for single data point (metric name, utc and value) 8) it can be used in a server mode with external authorization and with websockets feed for real-time graphic. It can be compared with rrd, whisper (graphite) or opentsdb. It is closer to opentsdb by features, because it can have many time series under same name, and distinguish them by tags. I've written some docs for using it as a library and will later document server mode. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji@REDACTED Tue Jan 28 00:57:43 2014 From: kenji@REDACTED (Kenji Rikitake) Date: Tue, 28 Jan 2014 08:57:43 +0900 Subject: [erlang-questions] OTP R16B03-1 has been released In-Reply-To: References: Message-ID: <20140127235743.GA41884@k2r.org> Just a quick note as of 27-JAN-2014 2355UTC: * The HTML documentation file under http://www.erlang.org/download.html is linked against R16B01 (note: ZERO ONE) archive. The correct URL for the HTML doc file is: http://www.erlang.org/download/otp_doc_html_R16B03-1.tar.gz * http://www.erlang.org/download/MD5 does not have the references for the R16B03-1 files. Please rebuild the MD5 file. Thanks for the release! Kenji Rikitake ++> Kenneth Lundin [2014-01-27 16:04:52 +0100]: > Erlang/OTP R16B03-1 has been released. From dmkolesnikov@REDACTED Tue Jan 28 09:52:34 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Tue, 28 Jan 2014 10:52:34 +0200 Subject: [erlang-questions] io_lib:format R16B03 performance and jsx impact Message-ID: <0BD99FE9-36B0-4355-BB3C-BFE90A5FD9EF@gmail.com> Hello, I?d like to catch up with potential performance issue with io_lib and jsx at R16B03. In the nutshell, the performance of my system is dropped significantly (-50% - 60%) when I?ve upgraded from R15B03 to R16B03. Profiling indicates one pain point with jsx, especially float to json conversion. io_lib:format("~p", [Float]) I?ve get rid of floats to integers and issue is gone. - Dmitry From max.lapshin@REDACTED Tue Jan 28 10:05:21 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 28 Jan 2014 13:05:21 +0400 Subject: [erlang-questions] io_lib:format R16B03 performance and jsx impact In-Reply-To: <0BD99FE9-36B0-4355-BB3C-BFE90A5FD9EF@gmail.com> References: <0BD99FE9-36B0-4355-BB3C-BFE90A5FD9EF@gmail.com> Message-ID: btw, why io_lib:format is so slow? simple changing it to nif with fprintf reduces cpu a lot. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Tue Jan 28 10:54:01 2014 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 28 Jan 2014 10:54:01 +0100 Subject: [erlang-questions] io_lib:format R16B03 performance and jsx impact In-Reply-To: References: <0BD99FE9-36B0-4355-BB3C-BFE90A5FD9EF@gmail.com> Message-ID: Hello, The code for formatting float when doing it through io_lib:format it written in pure Erlang. The reason that io_lib:format is implemented in Erlang is because it allows much greater cross platform formatting capabilities, alas at the cost of performance. Why you see a performance drop in between R15B03 to R16B03 I don't know, if you could create a minimal reproducible benchmark that shows the difference that would be great. If you want to have a speedy conversion of something you know is a float to a textual format you should use float_to_list/binary as that is meant to be a fast conversion, but with less flexibility. Lukas On Tue, Jan 28, 2014 at 10:05 AM, Max Lapshin wrote: > btw, why io_lib:format is so slow? simple changing it to nif with fprintf > reduces cpu a lot. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth.lundin@REDACTED Tue Jan 28 13:04:28 2014 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Tue, 28 Jan 2014 13:04:28 +0100 Subject: [erlang-questions] OTP R16B03-1 has been released In-Reply-To: <20140127235743.GA41884@k2r.org> References: <20140127235743.GA41884@k2r.org> Message-ID: Both the the link to documentation and the MD5 file are corrected now. /Kenneth Lundin , Erlang/OTP Ericsson On Tue, Jan 28, 2014 at 12:57 AM, Kenji Rikitake wrote: > Just a quick note as of 27-JAN-2014 2355UTC: > > * The HTML documentation file under > http://www.erlang.org/download.html > is linked against R16B01 (note: ZERO ONE) archive. > The correct URL for the HTML doc file is: > http://www.erlang.org/download/otp_doc_html_R16B03-1.tar.gz > > * http://www.erlang.org/download/MD5 > does not have the references for the R16B03-1 files. > Please rebuild the MD5 file. > > Thanks for the release! > > Kenji Rikitake > > ++> Kenneth Lundin [2014-01-27 16:04:52 +0100]: > > Erlang/OTP R16B03-1 has been released. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Tue Jan 28 16:04:26 2014 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 28 Jan 2014 19:04:26 +0400 Subject: [erlang-questions] What can lead to disksup timeout and failure: Message-ID: https://gist.github.com/maxlapshin/8669197 2014-01-28 07:40:11 =ERROR REPORT==== ** Generic server disksup terminating ** Last message in was timeout ** When Server state == {state,80,1800000,{unix,linux},[],#Port<0.102799>} ** Reason for termination == ** {badarg,[{erlang,port_close,[#Port<0.102799>],[]},{disksup,terminate,2,[{file,"disksup.erl"},{line,164}]},{gen_server,terminate,6,[{file,"gen_server.erl"},{line,719}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} 2014-01-28 07:40:11 =CRASH REPORT==== crasher: initial call: disksup:init/1 pid: <0.20756.3> registered_name: disksup exception exit: {{badarg,[{erlang,port_close,[#Port<0.102799>],[]},{disksup,terminate,2,[{file,"disksup.erl"},{line,164}]},{gen_server,terminate,6,[{file,"gen_server.erl"},{line,719}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]},[{gen_server,terminate,6,[{file,"gen_server.erl"},{line,722}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} ancestors: [os_mon_sup,<0.125.0>] messages: [] links: [<0.126.0>] dictionary: [] trap_exit: true status: running heap_size: 610 stack_size: 27 reductions: 346 neighbours: 2014-01-28 07:40:11 =SUPERVISOR REPORT==== Supervisor: {local,os_mon_sup} Context: child_terminated Reason: {badarg,[{erlang,port_close,[#Port<0.102799>],[]},{disksup,terminate,2,[{file,"disksup.erl"},{line,164}]},{gen_server,terminate,6,[{file,"gen_server.erl"},{line,719}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} Offender: [{pid,<0.20756.3>},{name,disksup},{mfargs,{disksup,start_link,[]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}] 2014-01-28 07:40:11 =SUPERVISOR REPORT==== Supervisor: {local,os_mon_sup} Context: shutdown Reason: reached_max_restart_intensity Offender: [{pid,<0.20756.3>},{name,disksup},{mfargs,{disksup,start_link,[]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}] After this erlang application dies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Tue Jan 28 16:57:43 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Tue, 28 Jan 2014 17:57:43 +0200 Subject: [erlang-questions] io_lib:format R16B03 performance and jsx impact In-Reply-To: References: <0BD99FE9-36B0-4355-BB3C-BFE90A5FD9EF@gmail.com> Message-ID: Hello, Here I?ve compiled a small project to benchmark the issue: git clone https://github.com/fogfish/fjsx make make run (fjsx@REDACTED)1> fjsx:run(). My results are following: R15B03: min 2.9K, avg 3.1K, max 3.3K R16B03: min 2.7K, avg 2.8K, max 3.0K (In production I do much more staff, it shown even worse degradation) I run the test on virtual machine, cent os 6 x86_64 with 4 virtual CPU (underlying HW MacBook Pro i5, 2.5GHz). Virtual CPU vendor_id : GenuineIntel cpu family : 6 model : 58 model name : Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz stepping : 9 cpu MHz : 2535.252 cache size : 6144 KB physical id : 0 siblings : 4 core id : 3 cpu cores : 4 apicid : 3 initial apicid : 3 fpu : yes fpu_exception : yes cpuid level : 5 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good pni ssse3 lahf_lm bogomips : 5070.50 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: otp configuration is identical for R15 and R16 R15B03: config.log $ ./configure --prefix=/usr/local/otp_R15B03 --enable-threads --enable-smp-support --enable-kernel-poll --enable-hipe --disable-dynamic-ssl-lib --with-ssl=/usr/local/ssl --enable-native-libs R16B03: config.log $ ./configure --prefix=/usr/local/otp_R16B03 --enable-threads --enable-smp-support --enable-kernel-poll --enable-hipe --disable-dynamic-ssl-lib --with-ssl=/usr/local/ssl --enable-native-libs I have not run the test on real HW: - my mac?s OTP configurations are different R16B03 enables --enable-darwin-64bit therefor it outperforms R15 - my production is virtual machines I?ve been using eep to profile the issue. You can go same to compare R16 and R15 differences. Best Regards, Dmitry On 28 Jan 2014, at 11:54, Lukas Larsson wrote: > Hello, > > The code for formatting float when doing it through io_lib:format it written in pure Erlang. The reason that io_lib:format is implemented in Erlang is because it allows much greater cross platform formatting capabilities, alas at the cost of performance. > > Why you see a performance drop in between R15B03 to R16B03 I don't know, if you could create a minimal reproducible benchmark that shows the difference that would be great. > > If you want to have a speedy conversion of something you know is a float to a textual format you should use float_to_list/binary as that is meant to be a fast conversion, but with less flexibility. > > Lukas > > > On Tue, Jan 28, 2014 at 10:05 AM, Max Lapshin wrote: > btw, why io_lib:format is so slow? simple changing it to nif with fprintf reduces cpu a lot. > > _______________________________________________ > 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 Tue Jan 28 17:18:41 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Tue, 28 Jan 2014 18:18:41 +0200 Subject: [erlang-questions] ssl get server certificates Message-ID: Hello, I was trying to google the issue and browse through the list archive but have not found an answer to my questions. I am trying to read all certificates transmitted by server during SSL negotiation. It looks for me that ssl:peercert(?) returns only ?leaf? certificate. e.g. I am doing https://www.google.com connection. Wireshark shows multiple certificate(s) with total size about 7K but ssl:percent(?) returns only 1.1K ?leaf? certification. May be one option is custom verify_certificate implementation!? - Dmitry From lukas@REDACTED Tue Jan 28 17:50:21 2014 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 28 Jan 2014 17:50:21 +0100 Subject: [erlang-questions] io_lib:format R16B03 performance and jsx impact In-Reply-To: References: <0BD99FE9-36B0-4355-BB3C-BFE90A5FD9EF@gmail.com> Message-ID: Hello, The performance loss seems to be unrelated to whether it is integer or float. What seems to make the difference is the size of the data created. The textual size of 50 floats are about 3 times larger than the size of the integers you use in the benchmark. If you change it so that erts_debug:size(Floats) is the same for both the floop and iloop (i changed iloop seq from 50 to 162) you see the same drop in speed inbetween R15B03 and R16B. So most probably the performance decrease has something to do with either changes in memory allocation or garbage collection. I don't really know what it could be and don't have the time right now to look into it. If you want to help figure out what it is, then doing a git bisect in between R15B03 and R16B and getting the exact commit that introduced the performance loss would be a great help. As a side note, using float_to_list(Float) instead of hd(io_lib:format("~p",[Float])) in jsx_to_json.erl more than trippled the number of floats encoded per second (10kps vs 35kps) and using float_to_list(Float,[{decimals,4},compact]) doubled that again, giving a total of 7.6 times greater performance (10kps vs 76kps). Lukas On Tue, Jan 28, 2014 at 4:57 PM, Dmitry Kolesnikov wrote: > Hello, > > Here I've compiled a small project to benchmark the issue: > > git clone https://github.com/fogfish/fjsx > make > make run > (fjsx@REDACTED)1> fjsx:run(). > > My results are following: > R15B03: min 2.9K, avg 3.1K, max 3.3K > R16B03: min 2.7K, avg 2.8K, max 3.0K > > (In production I do much more staff, it shown even worse degradation) > > I run the test on virtual machine, cent os 6 x86_64 with 4 virtual CPU > (underlying HW MacBook Pro i5, 2.5GHz). > Virtual CPU > vendor_id : GenuineIntel > cpu family : 6 > model : 58 > model name : Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz > stepping : 9 > cpu MHz : 2535.252 > cache size : 6144 KB > physical id : 0 > siblings : 4 > core id : 3 > cpu cores : 4 > apicid : 3 > initial apicid : 3 > fpu : yes > fpu_exception : yes > cpuid level : 5 > wp : yes > flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat > pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc > rep_good pni ssse3 lahf_lm > bogomips : 5070.50 > clflush size : 64 > cache_alignment : 64 > address sizes : 36 bits physical, 48 bits virtual > power management: > > otp configuration is identical for R15 and R16 > > R15B03: config.log > $ ./configure --prefix=/usr/local/otp_R15B03 --enable-threads > --enable-smp-support --enable-kernel-poll --enable-hipe > --disable-dynamic-ssl-lib --with-ssl=/usr/local/ssl --enable-native-libs > > R16B03: config.log > $ ./configure --prefix=/usr/local/otp_R16B03 --enable-threads > --enable-smp-support --enable-kernel-poll --enable-hipe > --disable-dynamic-ssl-lib --with-ssl=/usr/local/ssl --enable-native-libs > > I have not run the test on real HW: > - my mac's OTP configurations are different R16B03 > enables --enable-darwin-64bit therefor it outperforms R15 > - my production is virtual machines > > I've been using eep to profile the issue. You can go same to compare R16 > and R15 differences. > > Best Regards, > Dmitry > > On 28 Jan 2014, at 11:54, Lukas Larsson wrote: > > Hello, > > The code for formatting float when doing it through io_lib:format it > written in pure Erlang. The reason that io_lib:format is implemented in > Erlang is because it allows much greater cross platform formatting > capabilities, alas at the cost of performance. > > Why you see a performance drop in between R15B03 to R16B03 I don't know, > if you could create a minimal reproducible benchmark that shows the > difference that would be great. > > If you want to have a speedy conversion of something you know is a float > to a textual format you should use float_to_list/binary as that is meant to > be a fast conversion, but with less flexibility. > > Lukas > > > On Tue, Jan 28, 2014 at 10:05 AM, Max Lapshin wrote: > >> btw, why io_lib:format is so slow? simple changing it to nif with fprintf >> reduces cpu a lot. >> >> _______________________________________________ >> 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 andrew@REDACTED Tue Jan 28 17:52:01 2014 From: andrew@REDACTED (Andrew Thompson) Date: Tue, 28 Jan 2014 11:52:01 -0500 Subject: [erlang-questions] ssl get server certificates In-Reply-To: References: Message-ID: <20140128165201.GF9655@hijacked.us> On Tue, Jan 28, 2014 at 06:18:41PM +0200, Dmitry Kolesnikov wrote: > Hello, > > I was trying to google the issue and browse through the list archive but have not found an answer to my questions. > I am trying to read all certificates transmitted by server during SSL negotiation. > It looks for me that ssl:peercert(?) returns only ?leaf? certificate. > > e.g. I am doing https://www.google.com connection. Wireshark shows multiple certificate(s) with total size about 7K but ssl:percent(?) returns only 1.1K ?leaf? certification. > > May be one option is custom verify_certificate implementation!? > Yes a custom verify function is passed all the certificates the server provides to verify the chain: https://github.com/Vagabond/erl_crl_example/blob/master/src/client.erl#L90-L99 valid_peer is the peer certificate and valid are the server certificates. Andrew From ferenc.holzhauser@REDACTED Tue Jan 28 18:37:26 2014 From: ferenc.holzhauser@REDACTED (Ferenc Holzhauser) Date: Tue, 28 Jan 2014 18:37:26 +0100 Subject: [erlang-questions] Is -on_load() still experimental? Anyone using it? In-Reply-To: References: Message-ID: Thanks. The behaviour is quite neatly described in the documentation. If there is no intention to change it (which is probably the case by now) then perhaps it is also an idea to remove the experimental warning or replace it with a more appropriate one about correct use. The name of the directive is deceptive enough to bring the unwary to ideas and eventually make them break things. If well understood then it can be useful to trigger other things than NIF loading but I also think that the documentation should generally discourage that. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryankbrown@REDACTED Tue Jan 28 22:55:00 2014 From: ryankbrown@REDACTED (Ryan Brown) Date: Tue, 28 Jan 2014 14:55:00 -0700 Subject: [erlang-questions] Differences between crypto service on OS X and Linux Message-ID: I have an application that uses the crypto service crypto:aes_cbc_128_encrypt/3 method to encrypt a cmac key for authorization. It seems to work fine on my ubuntu machine and servers but does not match when I run the same code on my Macbook pro with Mountain Lion. I'm not 100% sure this is the culprit but it appears to be the low-hanging fruit. Although, I cannot think of a reason there would be a difference. Best regards, Ryan -- -rb -------------- next part -------------- An HTML attachment was scrubbed... URL: From zoha.qamer@REDACTED Wed Jan 29 18:39:50 2014 From: zoha.qamer@REDACTED (Zoha Qamar) Date: Wed, 29 Jan 2014 22:39:50 +0500 Subject: [erlang-questions] Creating node problem Message-ID: Dear all , I making server and client node in Erlang emulator R16B3 , but i am keep getting error on the first line , i am using win7 , 64bit my command is werl -name zoha@REDACTED or werl -name zoha@REDACTED ( copying from host file of window 's ) or its direct IP werl -name zoha@REDACTED but what ever i put Ip or host name , i keep getting error , * 1: syntax error before: zoha@REDACTED or * 1: syntax error before: zoha@REDACTED or * 1: syntax error before: zoha@REDACTED pls help me out where i am wrong any administration privilege issue , firewall issue ?? -- "*Agar Tum Seedhay rastay pe ho aur kisi Mushkil ka samna nahe ker rahay to kuch dair k liyay socho k kahin tum kuch ghalt to nahe ker rahay kyon k seedha rasta to mushkilaat se bhar pur hota hy*" *Hazrat Imam Ali (A.S) * -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Wed Jan 29 18:50:31 2014 From: lukas@REDACTED (Lukas Larsson) Date: Wed, 29 Jan 2014 18:50:31 +0100 Subject: [erlang-questions] Creating node problem In-Reply-To: References: Message-ID: Hello, What terminal are you using to start werl? I've tried "werl -name hello@REDACTED" on win xp, win 7 in both cmd.exe and cygwin and it works for me. Looking at the error message, maybe it can be solved by quoting the name? i.e. werl -name "hello@REDACTED"? Lukas On Wed, Jan 29, 2014 at 6:39 PM, Zoha Qamar wrote: > > Dear all , > > > I making server and client node in Erlang emulator R16B3 , but i am keep > getting error on the first line , i am using win7 , 64bit my command is > > werl -name zoha@REDACTED > > or > > > werl -name zoha@REDACTED ( copying from host file of > window 's ) > > or its direct IP > > werl -name zoha@REDACTED > > but what ever i put Ip or host name , i keep getting error , > > * 1: syntax error before: zoha@REDACTED > or > > * 1: syntax error before: zoha@REDACTED > > or > > * 1: syntax error before: zoha@REDACTED > > > pls help me out where i am wrong any administration privilege issue , > firewall issue ?? > -- > "*Agar Tum Seedhay rastay pe ho aur kisi Mushkil ka samna nahe ker rahay to > kuch dair k liyay socho k kahin tum kuch ghalt to nahe ker rahay kyon k > seedha rasta to mushkilaat se bhar pur hota hy*" *Hazrat Imam Ali (A.S) * > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andra.dinu@REDACTED Thu Jan 30 11:34:58 2014 From: andra.dinu@REDACTED (Andra Dinu) Date: Thu, 30 Jan 2014 11:34:58 +0100 (CET) Subject: [erlang-questions] Erlang User Conference Stockholm 9-10 June: Call for Talks now open Message-ID: <658142867.907249.1391078098539.JavaMail.zimbra@erlang-solutions.com> EUC2014 will take place on 9-10 June and will be followed by one day of tutorials on 11 June and 3 days of expert training on 11-13 June. http://www.erlang-factory.com/conference/EUC2014 The deadline for talk proposals is 10 March. If you are interested in giving a talk or tutorial, submit your talk here: https://docs.google.com/spreadsheet/viewform?formkey=dGVPT0ZLTDRjWVJ3czd2UGprZG90anc6MA#gid=0 Preliminary track titles: Case Studies & Architecture , Meta-programming with Elixir, DevOps, Cool Tools & Gadgets, Next Generation Databases & Analytics, Scalability & Multi-core, Infrastructure & Distribution, Erlang VM. -- Andra Dinu Community & Social ERLANG SOLUTIONS LTD New Loom House 101 Back Church Lane London, E1 1LU United Kingdom Tel +44(0)2076550344 Mob +44(0)7983484387 www.erlang-solutions.com From atulatri2004@REDACTED Thu Jan 30 13:25:19 2014 From: atulatri2004@REDACTED (atul atri) Date: Thu, 30 Jan 2014 17:55:19 +0530 Subject: [erlang-questions] Halp! We're getting this SSL / ASN1 error Message-ID: Hi, I am also getting same error. (link: http://erlang.org/pipermail/erlang-questions/2013-January/071930.html) can someone provide solution for this issue? Upgrading erlang does not seems a solution at the moment. Thanks & Regards, Atul Atri. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Thu Jan 30 13:30:51 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Thu, 30 Jan 2014 14:30:51 +0200 Subject: [erlang-questions] Halp! We're getting this SSL / ASN1 error In-Reply-To: References: Message-ID: <65B3EAF0-3A4F-46BF-92E8-4FBCDC0849A2@gmail.com> Hello, It works fine on Mac and Linux R16B03 (I am using own erlang build from sources) - Dmitry On 30 Jan 2014, at 14:25, atul atri wrote: > Hi, > > I am also getting same error. (link: http://erlang.org/pipermail/erlang-questions/2013-January/071930.html) > > can someone provide solution for this issue? Upgrading erlang does not seems a solution at the moment. > > Thanks & Regards, > Atul Atri. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From atulatri2004@REDACTED Thu Jan 30 13:33:54 2014 From: atulatri2004@REDACTED (atul atri) Date: Thu, 30 Jan 2014 18:03:54 +0530 Subject: [erlang-questions] Halp! We're getting this SSL / ASN1 error Message-ID: Hi, I am also getting same error. can someone provide solution for this issue? Upgrading erlang does not seem a solution at the moment. Thanks & Regards, Atul Atri. -------------- next part -------------- An HTML attachment was scrubbed... URL: From atulatri2004@REDACTED Thu Jan 30 13:38:19 2014 From: atulatri2004@REDACTED (atul atri) Date: Thu, 30 Jan 2014 18:08:19 +0530 Subject: [erlang-questions] Halp! We're getting this SSL / ASN1 error In-Reply-To: <65B3EAF0-3A4F-46BF-92E8-4FBCDC0849A2@gmail.com> References: <65B3EAF0-3A4F-46BF-92E8-4FBCDC0849A2@gmail.com> Message-ID: Hi, I am getting this issue with version R14B04. With R15B it works fine. We are getting this issue in production and upgrading erlang is not a solution as it will cause downtime. It would be great if someone could provide some patch or workaround. Thanks & Regards, Atul Atri. On Thu, Jan 30, 2014 at 6:00 PM, Dmitry Kolesnikov wrote: > Hello, > > It works fine on Mac and Linux R16B03 (I am using own erlang build from > sources) > > - Dmitry > > On 30 Jan 2014, at 14:25, atul atri wrote: > > Hi, > > I am also getting same error. (link: > http://erlang.org/pipermail/erlang-questions/2013-January/071930.html) > > can someone provide solution for this issue? Upgrading erlang does not > seems a solution at the moment. > > Thanks & Regards, > Atul Atri. > _______________________________________________ > 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 Thu Jan 30 13:42:34 2014 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Thu, 30 Jan 2014 14:42:34 +0200 Subject: [erlang-questions] Halp! We're getting this SSL / ASN1 error In-Reply-To: References: <65B3EAF0-3A4F-46BF-92E8-4FBCDC0849A2@gmail.com> Message-ID: Hello, I would not look for patch. I hardly believe that you can updated R14 ssl/asn to R16 ssl/asn applications w/o significant issues. Try to use proxy in the middle that terminates SSL connection. - Dmitry On 30 Jan 2014, at 14:38, atul atri wrote: > Hi, > > I am getting this issue with version R14B04. With R15B it works fine. > > We are getting this issue in production and upgrading erlang is not a solution as it will cause downtime. It would be great if someone could provide some patch or workaround. > > Thanks & Regards, > Atul Atri. > > > On Thu, Jan 30, 2014 at 6:00 PM, Dmitry Kolesnikov wrote: > Hello, > > It works fine on Mac and Linux R16B03 (I am using own erlang build from sources) > > - Dmitry > > On 30 Jan 2014, at 14:25, atul atri wrote: > >> Hi, >> >> I am also getting same error. (link: http://erlang.org/pipermail/erlang-questions/2013-January/071930.html) >> >> can someone provide solution for this issue? Upgrading erlang does not seems a solution at the moment. >> >> Thanks & Regards, >> Atul Atri. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From atulatri2004@REDACTED Thu Jan 30 13:47:39 2014 From: atulatri2004@REDACTED (atul atri) Date: Thu, 30 Jan 2014 18:17:39 +0530 Subject: [erlang-questions] Halp! We're getting this SSL / ASN1 error In-Reply-To: References: <65B3EAF0-3A4F-46BF-92E8-4FBCDC0849A2@gmail.com> Message-ID: Hi, I think this is a issue with asn1 parser. If this issue is not big and if small source code twitch in asn1 module can fix this issue, that would be great. Thanks & Regards, Atul Atri. On Thu, Jan 30, 2014 at 6:12 PM, Dmitry Kolesnikov wrote: > Hello, > > I would not look for patch. I hardly believe that you can updated R14 > ssl/asn to R16 ssl/asn applications w/o significant issues. Try to use > proxy in the middle that terminates SSL connection. > > - Dmitry > > > On 30 Jan 2014, at 14:38, atul atri wrote: > > Hi, > > I am getting this issue with version R14B04. With R15B it works fine. > > We are getting this issue in production and upgrading erlang is not a > solution as it will cause downtime. It would be great if someone could > provide some patch or workaround. > > Thanks & Regards, > Atul Atri. > > > On Thu, Jan 30, 2014 at 6:00 PM, Dmitry Kolesnikov > wrote: > >> Hello, >> >> It works fine on Mac and Linux R16B03 (I am using own erlang build from >> sources) >> >> - Dmitry >> >> On 30 Jan 2014, at 14:25, atul atri wrote: >> >> Hi, >> >> I am also getting same error. (link: >> http://erlang.org/pipermail/erlang-questions/2013-January/071930.html) >> >> can someone provide solution for this issue? Upgrading erlang does not >> seems a solution at the moment. >> >> Thanks & Regards, >> Atul Atri. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kraythe@REDACTED Thu Jan 30 17:19:45 2014 From: kraythe@REDACTED (kraythe .) Date: Thu, 30 Jan 2014 10:19:45 -0600 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. Message-ID: Ok right up front, I'm a Java Guru, not a Scala or Erlang one. What that means is that I know more than most debs about the core java language, but enough to know where the problems are. And certainly java has many issues but it also has massive momentum. I think one of the issues with Java can be expressed in one little programming puzzle I came across recently: *In a relevant language, create an array of 1000 numbers. Initialize all of the values in the array to zero. Create two threads that run concurrently and which increment each element of the array one time.* Interesting? The solution in Scala that I came up with is the following. def mtmap[A](data : List[A], threads: Int, f: (A) => A) = { import scala.concurrent.{ExecutionContext, Future, Await} implicit val executor = java.util.concurrent.Executors.newFixedThreadPool(threads) implicit val context = ExecutionContext.fromExecutorService(executor) val futures : Future[List[A]]= Future.traverse(data)(x => Future{f(x)}) import scala.concurrent.duration._ import scala.language.postfixOps val results : List[A] = Await.result(futures, 1 minute) results } Just thinking of doing this in Java will bring up some of the big problems with Java; I will leave it as a mental exercise for the reader. The problem is that Scala inherits some of them from the JVM and that has made me look into Erlang. The goal being to select a language for the development of a concurrent TCP/IP based application with thousands of users interacting in a small space. So far I think the contenders I have are Scala with Akka or Erlang. And yes, I know there are evangelists to both and I will post this to an Scala list to get their feedback as well (or something similar). Now, right up front I am not peeing on either language. They both rock or they wouldn't be on the list. The question is which should win the prize. There is no going back once development is 1000 hours down the road. *Scala: * *Pros:* 1. Based on Java Ecosystem so easier to staff because good Java devs can convert to Scala. 2. Decent tools (which are getting better). Many libraries. 3. Static typing with type inference. *Cons:* 1. Based on Java Ecosystem and inherit the problems of that ecosystem (i.e. immutable is a function of the design of a class, not of the language so it can't be guaranteed.), Also library code under the hood is not as rigorous as scala code in enforcing immutability so at some point you are rolling dice here. 2. Scala is also more heavyweight than Erlang when it comes to spawning thousands of processes. Erlang was built from the ground up to do concurrency. For Scala its an Akka bolt on can carries the Java threading nightmare (shared memory, etc). 3. Scala is not as fast. My server will be doing billions of vector math calculations per day and they have to be in the terms of milliseconds of latency. It has to be that if I have a user R in the server at position V where V is a vector, I need to calculate all other actors within 50 units and get that answer in milliseconds so that only the network latency is the bottleneck. Some of this can be helped with algorithms like spatial grids and so on but still we are looking at a couple of hundred vector math calls per second. 4. Scala is harder to hook up to dozens of nodes and move actors from node x to node y than Erlang, mainly because that was one of the design goals of Erlang. *Erlang:* *Pros:* 1. Built for concurrency. Can handle dozens of hardware nodes, build massive applications of the kind I am trying to deploy. Think of 100k users connecting to the cluster with a TCP connection and interacting over that connection which interacts with any or all of the other 100k actors. 2. Built from the ground up with immutability in mind. Immutability is a language feature, not compromisable. Its not JVM based and so is not under the same issues as Java is. 3. There is merit in the thought that static typing is sometimes a hinderance to a language. *Cons:* 1. The tools are, well frankly, garbage. Sorry, in 2014 to be pushed back to coding with VIM and makefiles is primitive. Rebar is crytptic and just the pet project of a guy on GIT. Compared to Gradle, Maven and even (though I don't care for it much) SBT, rebar is ... lacking. I want to spend time working on my business logic, not fighting tools. There are plugins for eclipse and intellij but they have minimal functionality and i keep reverting back to vim. 2. Much harder to staff than Scala because it is not Java based. 3. Fewer general purpose libraries and no major central repositories. I don't want to write code to create JSON, that isnt part of my business scope. I will pick that one of the shelf If i can. 4. Records as the only structured data type is ... annoying. The problem I have is I can't find the perfect solution. Erlang is compelling but also is Scala. Opinions? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaron.l.france@REDACTED Thu Jan 30 17:26:37 2014 From: aaron.l.france@REDACTED (Aaron France) Date: Thu, 30 Jan 2014 17:26:37 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: Message-ID: Then what about Clojure? You can stay on the jvm, use Java code and it has a focus on concurrency. Whilst it fails hard on fault tolerance it could be an escape hatch for those stuck with the jvm Aaron On 30 Jan 2014 17:22, "kraythe ." wrote: > Ok right up front, I'm a Java Guru, not a Scala or Erlang one. What that > means is that I know more than most debs about the core java language, but > enough to know where the problems are. And certainly java has many issues > but it also has massive momentum. I think one of the issues with Java can > be expressed in one little programming puzzle I came across recently: > > *In a relevant language, create an array of 1000 numbers. Initialize all > of the values in the array to zero. Create two threads that run > concurrently and which increment each element of the array one time.* > > > Interesting? The solution in Scala that I came up with is the following. > > def mtmap[A](data : List[A], threads: Int, f: (A) => A) = { > import scala.concurrent.{ExecutionContext, Future, Await} > implicit val executor = > java.util.concurrent.Executors.newFixedThreadPool(threads) > implicit val context = ExecutionContext.fromExecutorService(executor) > val futures : Future[List[A]]= Future.traverse(data)(x => Future{f(x)}) > import scala.concurrent.duration._ > import scala.language.postfixOps > val results : List[A] = Await.result(futures, 1 minute) > results > } > > > Just thinking of doing this in Java will bring up some of the big problems > with Java; I will leave it as a mental exercise for the reader. The problem > is that Scala inherits some of them from the JVM and that has made me look > into Erlang. The goal being to select a language for the development of a > concurrent TCP/IP based application with thousands of users interacting in > a small space. > > So far I think the contenders I have are Scala with Akka or Erlang. And > yes, I know there are evangelists to both and I will post this to an Scala > list to get their feedback as well (or something similar). Now, right up > front I am not peeing on either language. They both rock or they wouldn't > be on the list. The question is which should win the prize. There is no > going back once development is 1000 hours down the road. > > *Scala: * > *Pros:* > > 1. Based on Java Ecosystem so easier to staff because good Java devs > can convert to Scala. > 2. Decent tools (which are getting better). Many libraries. > 3. Static typing with type inference. > > *Cons:* > > 1. Based on Java Ecosystem and inherit the problems of that ecosystem > (i.e. immutable is a function of the design of a class, not of the language > so it can't be guaranteed.), Also library code under the hood is not as > rigorous as scala code in enforcing immutability so at some point you are > rolling dice here. > 2. Scala is also more heavyweight than Erlang when it comes to > spawning thousands of processes. Erlang was built from the ground up to do > concurrency. For Scala its an Akka bolt on can carries the Java threading > nightmare (shared memory, etc). > 3. Scala is not as fast. My server will be doing billions of vector > math calculations per day and they have to be in the terms of milliseconds > of latency. It has to be that if I have a user R in the server at position > V where V is a vector, I need to calculate all other actors within 50 units > and get that answer in milliseconds so that only the network latency is the > bottleneck. Some of this can be helped with algorithms like spatial grids > and so on but still we are looking at a couple of hundred vector math calls > per second. > 4. Scala is harder to hook up to dozens of nodes and move actors from > node x to node y than Erlang, mainly because that was one of the design > goals of Erlang. > > > *Erlang:* > *Pros:* > > 1. Built for concurrency. Can handle dozens of hardware nodes, build > massive applications of the kind I am trying to deploy. Think of 100k users > connecting to the cluster with a TCP connection and interacting over that > connection which interacts with any or all of the other 100k actors. > 2. Built from the ground up with immutability in mind. Immutability is > a language feature, not compromisable. Its not JVM based and so is not > under the same issues as Java is. > 3. There is merit in the thought that static typing is sometimes a > hinderance to a language. > > *Cons:* > > 1. The tools are, well frankly, garbage. Sorry, in 2014 to be pushed > back to coding with VIM and makefiles is primitive. Rebar is crytptic and > just the pet project of a guy on GIT. Compared to Gradle, Maven and even > (though I don't care for it much) SBT, rebar is ... lacking. I want to > spend time working on my business logic, not fighting tools. There are > plugins for eclipse and intellij but they have minimal functionality and i > keep reverting back to vim. > 2. Much harder to staff than Scala because it is not Java based. > 3. Fewer general purpose libraries and no major central repositories. > I don't want to write code to create JSON, that isnt part of my business > scope. I will pick that one of the shelf If i can. > 4. Records as the only structured data type is ... annoying. > > > The problem I have is I can't find the perfect solution. Erlang is > compelling but also is Scala. > > Opinions? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tty.erlang@REDACTED Thu Jan 30 17:35:29 2014 From: tty.erlang@REDACTED (T Ty) Date: Thu, 30 Jan 2014 16:35:29 +0000 Subject: [erlang-questions] Creating node problem In-Reply-To: References: Message-ID: Use single quotes werl -name 'hello@REDACTED' Also note with Windows hostname are case-insensitive while Erlang treat them as case-sensitive. This is especially important when setting hostnames in the Erlang shell. On Wed, Jan 29, 2014 at 5:50 PM, Lukas Larsson wrote: > Hello, > > What terminal are you using to start werl? I've tried "werl -name > hello@REDACTED" on win xp, win 7 in both cmd.exe and cygwin and it works > for me. > > Looking at the error message, maybe it can be solved by quoting the name? > i.e. werl -name "hello@REDACTED"? > > Lukas > > > On Wed, Jan 29, 2014 at 6:39 PM, Zoha Qamar wrote: > >> >> Dear all , >> >> >> I making server and client node in Erlang emulator R16B3 , but i am keep >> getting error on the first line , i am using win7 , 64bit my command is >> >> werl -name zoha@REDACTED >> >> or >> >> >> werl -name zoha@REDACTED ( copying from host file of >> window 's ) >> >> or its direct IP >> >> werl -name zoha@REDACTED >> >> but what ever i put Ip or host name , i keep getting error , >> >> * 1: syntax error before: zoha@REDACTED >> or >> >> * 1: syntax error before: zoha@REDACTED >> >> or >> >> * 1: syntax error before: zoha@REDACTED >> >> >> pls help me out where i am wrong any administration privilege issue , >> firewall issue ?? >> -- >> "*Agar Tum Seedhay rastay pe ho aur kisi Mushkil ka samna nahe ker rahay >> to >> kuch dair k liyay socho k kahin tum kuch ghalt to nahe ker rahay kyon k >> seedha rasta to mushkilaat se bhar pur hota hy*" *Hazrat Imam Ali (A.S) * >> >> >> _______________________________________________ >> 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 essen@REDACTED Thu Jan 30 17:46:19 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 30 Jan 2014 17:46:19 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: Message-ID: <52EA81DB.4060108@ninenines.eu> Some replies inline. On 01/30/2014 05:19 PM, kraythe . wrote: > Ok right up front, I'm a Java Guru, not a Scala or Erlang one. What that > means is that I know more than most debs about the core java language, > but enough to know where the problems are. And certainly java has many > issues but it also has massive momentum. I think one of the issues with > Java can be expressed in one little programming puzzle I came across > recently: > > /In a relevant language, create an array of 1000 numbers. Initialize > all of the values in the array to zero. Create two threads that run > concurrently and which increment each element of the array one time./ That's not the kind of problem Erlang solves. That specific problem requires a parallel solution, not a concurrent one. Plus Erlang processes are isolated so they don't have access to the same data without a third party (another process, an ets table, ..). Really for that kind of problem I would instead suggest something like Haskell or OpenCL. > The goal being to select a language for > the development of a concurrent TCP/IP based application with thousands > of users interacting in a small space. Well that's completely different from your problem. And that's actually something you get pretty much for free with Erlang. I had no problem getting 10K connections with absolutely no load on the server in a production application. And since there was two of them, that means 20K connections, no load and about no distributed programming required. > 2. Built from the ground up with immutability in mind. Immutability is > a language feature, not compromisable. Its not JVM based and so is > not under the same issues as Java is. Immutability is a language and VM feature. You can have a mutable language on top of the BEAM VM, Elixir is an example of that. > 1. The tools are, well frankly, garbage. Sorry, in 2014 to be pushed > back to coding with VIM and makefiles is primitive. Rebar is > crytptic and just the pet project of a guy on GIT. Compared to > Gradle, Maven and even (though I don't care for it much) SBT, rebar > is ... lacking. I want to spend time working on my business logic, > not fighting tools. There are plugins for eclipse and intellij > but they have minimal functionality and i keep reverting back to vim. Well that's very much your opinion. Many would say Eclipse and the Java ecosystem is garbage. I use Makefiles, and when I pull my project from github the only thing I need to do is type 'make' and wait for it to fetch dependencies, compile everything and generate the release which I can then send to any server and it will just work with no extra configuration or package needed (not even Erlang!). All this in just under a minute. I would definitely not call that primitive. > 3. Fewer general purpose libraries and no major central repositories. > I don't want to write code to create JSON, that isnt part of my > business scope. I will pick that one of the shelf If i can. Well good for you then because there's about a dozen JSON libraries. > 4. Records as the only structured data type is ... annoying. Maps are coming. They're even in master now. Besides them you also have proplists, dicts, sets, etc. etc. Erlang comes with tons of structured data types, they just don't have a special syntax. Maps have their own syntax, though. > The problem I have is I can't find the perfect solution. Erlang is > compelling but also is Scala. > > Opinions? If you like Java so much, use it, but do note that because of the global GC your application will have to stop for a few seconds from time to time, which is problematic when you have 100k users doing stuff (and the more users you have, the bigger the problem). Erlang has per-process GC so this particular issue doesn't happen. Personally that's a deal breaker. -- Lo?c Hoguin http://ninenines.eu From sean@REDACTED Thu Jan 30 17:46:46 2014 From: sean@REDACTED (Sean Cribbs) Date: Thu, 30 Jan 2014 10:46:46 -0600 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: Message-ID: *In a relevant language, create an array of 1000 numbers. Initialize all of the values in the array to zero. Create two threads that run concurrently and which increment each element of the array one time.* Sometimes the framing of the problem is the problem. In Erlang, which has no shared memory (except maybe ETS? But that's an entirely different issue), and no mutability, you would make two processes with lists of 1000 0's, which would map them into 1's. Maybe if they all need to be 2's, you might have a pipeline/chain of processes, each receiving messages and incrementing by 1. The issue is really the framing of the problem doesn't make sense in Erlang. 1. The tools are, well frankly, garbage. Sorry, in 2014 to be pushed back to coding with VIM and makefiles is primitive. Rebar is crytptic and just the pet project of a guy on GIT. Compared to Gradle, Maven and even (though I don't care for it much) SBT, rebar is ... lacking. I want to spend time working on my business logic, not fighting tools. There are plugins for eclipse and intellij but they have minimal functionality and i keep reverting back to vim. This is really just a matter of familiarity. Yes, rebar could be better, I know because I use it every day. However, you might be surprised at how mature the OTP ecosystem is (it has 10 years on Java, by the way). IDEs are not the way to go with Erlang generally, but Emacs has support for Wrangler which does automated refactoring and Distel which lets you fire up and interact with Erlang nodes directly from the editor (including debugging!), and much more. Dialyzer lets you introduce gradual typing into your program so you can find many bugs, a thing I've grown attached to lately. It seems you are just comfortable in your IDE. When you started doing Java or Scala were you immediately familiar with all the tools in its ecosystem? I doubt it. Any new language ecosystem will have its own ramp-up time. 1. Much harder to staff than Scala because it is not Java based. Actually we have found this to be an advantage. Yes, it's harder to find *any* programmer, but *good* programmers will try out new things because they have an interest in learning and are adaptable. Head-count isn't always the answer. One of our best Erlang devs at Basho came from a shop where he did mostly Clojure. I think our CTO Justin Sheehy said it more eloquently here: http://basho.com/erlang-at-basho-five-years-later/ 1. Fewer general purpose libraries and no major central repositories. I don't want to write code to create JSON, that isnt part of my business scope. I will pick that one of the shelf If i can. Erlang/OTP contains most of what you need, but there are also plenty of libraries for mundane things like JSON codecs, etc, and often the top Erlang projects use them already! Many times a quick search on Github or Google will help you find what you need. 1. Records as the only structured data type is ... annoying. Records aren't "structured data types", they're a compile-time syntax sugar over tagged tuples. I suspect this criticism comes from your background as an OO programmer. I hope you won't dismiss Erlang for the wrong reasons. Yes, it is a totally different world from JVM projects, but it's one I have enjoyed working in for a long time. On Thu, Jan 30, 2014 at 10:26 AM, Aaron France wrote: > Then what about Clojure? > > You can stay on the jvm, use Java code and it has a focus on concurrency. > > Whilst it fails hard on fault tolerance it could be an escape hatch for > those stuck with the jvm > > Aaron > On 30 Jan 2014 17:22, "kraythe ." wrote: > >> Ok right up front, I'm a Java Guru, not a Scala or Erlang one. What that >> means is that I know more than most debs about the core java language, but >> enough to know where the problems are. And certainly java has many issues >> but it also has massive momentum. I think one of the issues with Java can >> be expressed in one little programming puzzle I came across recently: >> >> *In a relevant language, create an array of 1000 numbers. Initialize all >> of the values in the array to zero. Create two threads that run >> concurrently and which increment each element of the array one time.* >> >> >> Interesting? The solution in Scala that I came up with is the following. >> >> def mtmap[A](data : List[A], threads: Int, f: (A) => A) = { >> import scala.concurrent.{ExecutionContext, Future, Await} >> implicit val executor = >> java.util.concurrent.Executors.newFixedThreadPool(threads) >> implicit val context = ExecutionContext.fromExecutorService(executor) >> val futures : Future[List[A]]= Future.traverse(data)(x => Future{f(x)}) >> import scala.concurrent.duration._ >> import scala.language.postfixOps >> val results : List[A] = Await.result(futures, 1 minute) >> results >> } >> >> >> Just thinking of doing this in Java will bring up some of the big >> problems with Java; I will leave it as a mental exercise for the reader. >> The problem is that Scala inherits some of them from the JVM and that has >> made me look into Erlang. The goal being to select a language for the >> development of a concurrent TCP/IP based application with thousands of >> users interacting in a small space. >> >> So far I think the contenders I have are Scala with Akka or Erlang. And >> yes, I know there are evangelists to both and I will post this to an Scala >> list to get their feedback as well (or something similar). Now, right up >> front I am not peeing on either language. They both rock or they wouldn't >> be on the list. The question is which should win the prize. There is no >> going back once development is 1000 hours down the road. >> >> *Scala: * >> *Pros:* >> >> 1. Based on Java Ecosystem so easier to staff because good Java devs >> can convert to Scala. >> 2. Decent tools (which are getting better). Many libraries. >> 3. Static typing with type inference. >> >> *Cons:* >> >> 1. Based on Java Ecosystem and inherit the problems of that ecosystem >> (i.e. immutable is a function of the design of a class, not of the language >> so it can't be guaranteed.), Also library code under the hood is not as >> rigorous as scala code in enforcing immutability so at some point you are >> rolling dice here. >> 2. Scala is also more heavyweight than Erlang when it comes to >> spawning thousands of processes. Erlang was built from the ground up to do >> concurrency. For Scala its an Akka bolt on can carries the Java threading >> nightmare (shared memory, etc). >> 3. Scala is not as fast. My server will be doing billions of vector >> math calculations per day and they have to be in the terms of milliseconds >> of latency. It has to be that if I have a user R in the server at position >> V where V is a vector, I need to calculate all other actors within 50 units >> and get that answer in milliseconds so that only the network latency is the >> bottleneck. Some of this can be helped with algorithms like spatial grids >> and so on but still we are looking at a couple of hundred vector math calls >> per second. >> 4. Scala is harder to hook up to dozens of nodes and move actors from >> node x to node y than Erlang, mainly because that was one of the design >> goals of Erlang. >> >> >> *Erlang:* >> *Pros:* >> >> 1. Built for concurrency. Can handle dozens of hardware nodes, build >> massive applications of the kind I am trying to deploy. Think of 100k users >> connecting to the cluster with a TCP connection and interacting over that >> connection which interacts with any or all of the other 100k actors. >> 2. Built from the ground up with immutability in mind. Immutability >> is a language feature, not compromisable. Its not JVM based and so is not >> under the same issues as Java is. >> 3. There is merit in the thought that static typing is sometimes a >> hinderance to a language. >> >> *Cons:* >> >> 1. The tools are, well frankly, garbage. Sorry, in 2014 to be pushed >> back to coding with VIM and makefiles is primitive. Rebar is crytptic and >> just the pet project of a guy on GIT. Compared to Gradle, Maven and even >> (though I don't care for it much) SBT, rebar is ... lacking. I want to >> spend time working on my business logic, not fighting tools. There are >> plugins for eclipse and intellij but they have minimal functionality and i >> keep reverting back to vim. >> 2. Much harder to staff than Scala because it is not Java based. >> 3. Fewer general purpose libraries and no major central repositories. >> I don't want to write code to create JSON, that isnt part of my business >> scope. I will pick that one of the shelf If i can. >> 4. Records as the only structured data type is ... annoying. >> >> >> The problem I have is I can't find the perfect solution. Erlang is >> compelling but also is Scala. >> >> Opinions? >> >> _______________________________________________ >> 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 > > -- Sean Cribbs Software Engineer Basho Technologies, Inc. http://basho.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Thu Jan 30 17:48:35 2014 From: sergej.jurecko@REDACTED (Sergej Jurecko) Date: Thu, 30 Jan 2014 17:48:35 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: Message-ID: Addressing the cons: 1. You're looking at it from a Java developers perspective. Java, C# and others have well developed tools, because without them those platforms would be unbearable to develop for. I don't know about others, but rebar has been working just fine for me. I write code in sublime and don't miss anything. This speaks to the strength of the platform. You can get very very far without needing any special tools. 2. Yep 3. Yeah there is no central repository. But google does a fine job of finding various libraries. For json especially. 4. Until frames/maps arrive in R17. There is also one pro for Erlang when compared to Java/C# that is rarely mentioned. Once you are proficient with the language the code is very readable much shorter. Makes it easier to work with your code and understand what your dependencies are doing. Sergej On Jan 30, 2014, at 5:19 PM, kraythe . wrote: > Ok right up front, I'm a Java Guru, not a Scala or Erlang one. What that means is that I know more than most debs about the core java language, but enough to know where the problems are. And certainly java has many issues but it also has massive momentum. I think one of the issues with Java can be expressed in one little programming puzzle I came across recently: > > In a relevant language, create an array of 1000 numbers. Initialize all of the values in the array to zero. Create two threads that run concurrently and which increment each element of the array one time. > > Interesting? The solution in Scala that I came up with is the following. > > def mtmap[A](data : List[A], threads: Int, f: (A) => A) = { > import scala.concurrent.{ExecutionContext, Future, Await} > implicit val executor = java.util.concurrent.Executors.newFixedThreadPool(threads) > implicit val context = ExecutionContext.fromExecutorService(executor) > val futures : Future[List[A]]= Future.traverse(data)(x => Future{f(x)}) > import scala.concurrent.duration._ > import scala.language.postfixOps > val results : List[A] = Await.result(futures, 1 minute) > results > } > > Just thinking of doing this in Java will bring up some of the big problems with Java; I will leave it as a mental exercise for the reader. The problem is that Scala inherits some of them from the JVM and that has made me look into Erlang. The goal being to select a language for the development of a concurrent TCP/IP based application with thousands of users interacting in a small space. > > So far I think the contenders I have are Scala with Akka or Erlang. And yes, I know there are evangelists to both and I will post this to an Scala list to get their feedback as well (or something similar). Now, right up front I am not peeing on either language. They both rock or they wouldn't be on the list. The question is which should win the prize. There is no going back once development is 1000 hours down the road. > > Scala: > Pros: > Based on Java Ecosystem so easier to staff because good Java devs can convert to Scala. > Decent tools (which are getting better). Many libraries. > Static typing with type inference. > Cons: > Based on Java Ecosystem and inherit the problems of that ecosystem (i.e. immutable is a function of the design of a class, not of the language so it can't be guaranteed.), Also library code under the hood is not as rigorous as scala code in enforcing immutability so at some point you are rolling dice here. > Scala is also more heavyweight than Erlang when it comes to spawning thousands of processes. Erlang was built from the ground up to do concurrency. For Scala its an Akka bolt on can carries the Java threading nightmare (shared memory, etc). > Scala is not as fast. My server will be doing billions of vector math calculations per day and they have to be in the terms of milliseconds of latency. It has to be that if I have a user R in the server at position V where V is a vector, I need to calculate all other actors within 50 units and get that answer in milliseconds so that only the network latency is the bottleneck. Some of this can be helped with algorithms like spatial grids and so on but still we are looking at a couple of hundred vector math calls per second. > Scala is harder to hook up to dozens of nodes and move actors from node x to node y than Erlang, mainly because that was one of the design goals of Erlang. > > Erlang: > Pros: > Built for concurrency. Can handle dozens of hardware nodes, build massive applications of the kind I am trying to deploy. Think of 100k users connecting to the cluster with a TCP connection and interacting over that connection which interacts with any or all of the other 100k actors. > Built from the ground up with immutability in mind. Immutability is a language feature, not compromisable. Its not JVM based and so is not under the same issues as Java is. > There is merit in the thought that static typing is sometimes a hinderance to a language. > Cons: > The tools are, well frankly, garbage. Sorry, in 2014 to be pushed back to coding with VIM and makefiles is primitive. Rebar is crytptic and just the pet project of a guy on GIT. Compared to Gradle, Maven and even (though I don't care for it much) SBT, rebar is ... lacking. I want to spend time working on my business logic, not fighting tools. There are plugins for eclipse and intellij but they have minimal functionality and i keep reverting back to vim. > Much harder to staff than Scala because it is not Java based. > Fewer general purpose libraries and no major central repositories. I don't want to write code to create JSON, that isnt part of my business scope. I will pick that one of the shelf If i can. > Records as the only structured data type is ... annoying. > > The problem I have is I can't find the perfect solution. Erlang is compelling but also is Scala. > > Opinions? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Thu Jan 30 17:58:19 2014 From: ulf@REDACTED (Ulf Wiger) Date: Thu, 30 Jan 2014 17:58:19 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: Message-ID: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> On 30 Jan 2014, at 17:19, kraythe . wrote: > The tools are, well frankly, garbage. Sorry, in 2014 to be pushed back to coding with VIM and makefiles is primitive. So use Emacs. ;-) Seriously, there are a few reasons why the tools are garbage compared to e.g. the Java community?s, but here?s the main reason: For one thing, they are not needed as much. I once participated in a code kata track, where (as it happened) the same problem was solved in several different languages. The idea was to let the audience lead, but the only ones who did that were I and the Ruby guy - and we and the Clojure guy were the only ones who completed the task on time. This, even though we stuck to Emacs and had no other fancy tools. The Java team and the C# guy ran out of time. The Java guys - two experts, pair programming rather than involving the audience - ripped through with IntelliJ, but still didn?t finish the task on time. Still, it was amazing to see what the tool could do. Talking to some Java experts afterwards, the consensus seemed to be that ?yeah, the tools are fantastic, but the problem is that you?re dead in the water without them?. Also, some complaints were raised that the tool support distances you as a developer from the raw implementation, especially when the tool automatically generates a lot of your code for you. To some extent, this also applies to the libs question. You might well get done faster even if you end up having to do work that you wouldn?t have to in Java, since writing your own lib in Erlang can often be less work than using an existing lib in Java. ;-) Since most Erlang programmers are quite comfortable using Emacs or Vim, it?s hard to get traction for a tool development project. There have been attempts, but overall, most (?) Erlang devs don?t feel that they need such tools to be productive. But mostly, the things to look for are the major snags - the ones that could kill your project. How much support can you get from the respective communities for the kind of application you have in mind? How mature are the components you will have to rely on? Etc. Depending on your application domain, the anwers to those questions are likely to vary. BR, Ulf W Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.valim@REDACTED Thu Jan 30 18:01:46 2014 From: jose.valim@REDACTED (=?ISO-8859-1?Q?Jos=E9_Valim?=) Date: Thu, 30 Jan 2014 18:01:46 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: <52EA81DB.4060108@ninenines.eu> References: <52EA81DB.4060108@ninenines.eu> Message-ID: > > Immutability is a language and VM feature. You can have a mutable language > on top of the BEAM VM, Elixir is an example of that. > Small correction: immutability is a VM feature. Elixir has the same amount of mutability as Erlang. It is common to confuse rebinding with mutability but it is still compiled to static single assignment. -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve@REDACTED Thu Jan 30 18:12:50 2014 From: steve@REDACTED (Steve Strong) Date: Thu, 30 Jan 2014 18:12:50 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> Message-ID: I'll chip in on the part about the tooling - I was a C# / Visual Studio dev for 10+ years when I switched to erlang. For the first perhaps 4 weeks, I missed hitting 'dot' and having the computer tell me what to do; then I started noticing that I was actually remembering what stuff did, rather than relying on the IDE. I also found the build tool chain awkward, but it turned out that 'make' was rather good - and the total lack of black magic made it obvious how to fix build / release issues when they did occur (ignoring here the rather arcane syntax for retool!) Within a couple of months I've no doubt that I was more productive than I'd been in Visual Studio, and now, 3+ years on, you'd have to pay me significant sums of money to go back to those 'advanced' tools. Cheers, Steve On 30 Jan 2014 17:58, "Ulf Wiger" wrote: > > On 30 Jan 2014, at 17:19, kraythe . wrote: > > > 1. The tools are, well frankly, garbage. Sorry, in 2014 to be pushed > back to coding with VIM and makefiles is primitive. > > So use Emacs. ;-) > > Seriously, there are a few reasons why the tools are garbage compared to > e.g. the Java community's, but here's the main reason: > > For one thing, they are not needed as much. I once participated in a code > kata track, where (as it happened) the same problem was solved in several > different languages. The idea was to let the audience lead, but the only > ones who did that were I and the Ruby guy - and we and the Clojure guy were > the only ones who completed the task on time. This, even though we stuck to > Emacs and had no other fancy tools. The Java team and the C# guy ran out of > time. > > The Java guys - two experts, pair programming rather than involving the > audience - ripped through with IntelliJ, but still didn't finish the task > on time. Still, it was amazing to see what the tool could do. Talking to > some Java experts afterwards, the consensus seemed to be that "yeah, the > tools are fantastic, but the problem is that you're dead in the water > without them". Also, some complaints were raised that the tool support > distances you as a developer from the raw implementation, especially when > the tool automatically generates a lot of your code for you. > > To some extent, this also applies to the libs question. You might well get > done faster even if you end up having to do work that you wouldn't have to > in Java, since writing your own lib in Erlang can often be less work than > using an existing lib in Java. ;-) > > Since most Erlang programmers are quite comfortable using Emacs or Vim, > it's hard to get traction for a tool development project. There have been > attempts, but overall, most (?) Erlang devs don't feel that they need such > tools to be productive. > > But mostly, the things to look for are the major snags - the ones that > could kill your project. How much support can you get from the respective > communities for the kind of application you have in mind? How mature are > the components you will have to rely on? Etc. > > Depending on your application domain, the anwers to those questions are > likely to vary. > > BR, > Ulf W > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > http://feuerlabs.com > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve@REDACTED Thu Jan 30 19:49:21 2014 From: steve@REDACTED (Steve Strong) Date: Thu, 30 Jan 2014 19:49:21 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> Message-ID: <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> I?m an emacs guy, and most of what you want is in there - however, completely understand the pain in switching editors, so some vim-specific comments below... -- Steve Strong Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, 30 January 2014 at 19:10, kraythe . wrote: > I would pose a couple of questions tool wise then. Keep in mind that there are likely answers to these questions I don't know so please don't detect attitude but rather inquisitiveness. With my tools I want the following as a must: > > 1) Code completion. Sorry but I can't be bothered to type the same flipping method name in its entirety 40 times. > looks like vim can do this: http://blogs.gnome.org/lharris/2008/07/20/code-completion-with-vim-7/. I?m sure there are other options as well... > > 2) Redeploy in running app or quick restart. I worked a tutorial on a rebar based application and then when I changed it I had to do: > > --> (ctrl-G) q > $ myapp stop > $ myapp start > $ myapp attach > > > Try something like https://github.com/rustyio/sync (reloads beam files whenever they change) combined with something like https://github.com/mynyml/watchr (watches a directory, and runs a command (such as ?make?) whenever anything changes). That way, you save the file and then test the results. No need to stop / start the VM in the majority of cases. Even better would be to have a test suite rather than an interactive prompt and just have the tests automatically execute. > > That is a development cycle that would drive me NUTS. > > 3) Automatic dependency fetching. I understand rebar can do some of this but how do I fix versions of modules and so on? Do I have to compile every third party lib? rebar.config (and erlang.mk is you wanted a pure make approach) can both fetch deps, and both support fixing the version of the deps that are pulled, by tab, by branch, by commit hash etc. And yes, you do need to compile them - but the occasional ?rebar compile? doesn?t seem much overhead. > > 3) Syntax coloring. (VIM color codes a file so that is there, emacs I don't know AT ALL.) I don?t know of any editor that doesn?t do this - even github displays syntax colouring on erlang files. > > 4) Editor easiness, files window, project overview, configuration, etc. not a user of VIM (emacs does this stuff just fine), but a single google search reveals http://vimdoc.sourceforge.net/htmldoc/windows.html - which suggests it can do pretty much everything > > 5) Refactoring. This is one of the tools I am reluctant to give up. If I change the signature of a method I do not want to have to go change 40 files manually. NO thanks. This is something that?s harder - there?s a plugin for Emacs called Wrangler that can do some refactoring, don?t know of anything for VIM. That said, although I?m an emacs guy, I don?t bother with Wrangler. If changing a method signature means I have to edit 40 other files, then I think I?ve got *much* bigger problems. The insanely good refactoring support in Visual Studio (particularly with Resharper) enables the hiding of a multitude of sins, allowing code to become far too closely coupled without noticing until way too late in development. Not having that kind of support makes me write better code in the first place. The only time I?d be needing to edit a lot of files is if I?m changing so very low level utility - typically, these tend to be so trivial that they rarely if ever change, so it?s not often a problem. > > It could be I have to learn Emacs. Being a vi guy for 20 years, that will take some adaptation I can tell you. > I certainly wouldn?t suggest switching editors - although the religious zealots will insist that one is far better than the other, the reality (imo) is that both are highly capable and can do the bulk of what people need with a few hours work on google and with the configuration. Hope that helps! Cheers, Steve > LinkedIn: http://www.linkedin.com/pub/robert-simmons/40/852/a39 > > > > > On Thu, Jan 30, 2014 at 11:12 AM, Steve Strong wrote: > > I'll chip in on the part about the tooling - I was a C# / Visual Studio dev for 10+ years when I switched to erlang. For the first perhaps 4 weeks, I missed hitting 'dot' and having the computer tell me what to do; then I started noticing that I was actually remembering what stuff did, rather than relying on the IDE. > > I also found the build tool chain awkward, but it turned out that 'make' was rather good - and the total lack of black magic made it obvious how to fix build / release issues when they did occur (ignoring here the rather arcane syntax for retool!) > > Within a couple of months I've no doubt that I was more productive than I'd been in Visual Studio, and now, 3+ years on, you'd have to pay me significant sums of money to go back to those 'advanced' tools. > > Cheers, > > Steve > > On 30 Jan 2014 17:58, "Ulf Wiger" wrote: > > > > > > On 30 Jan 2014, at 17:19, kraythe . wrote: > > > > The tools are, well frankly, garbage. Sorry, in 2014 to be pushed back to coding with VIM and makefiles is primitive. > > > So use Emacs. ;-) > > > > > > Seriously, there are a few reasons why the tools are garbage compared to e.g. the Java community?s, but here?s the main reason: > > > > > > For one thing, they are not needed as much. I once participated in a code kata track, where (as it happened) the same problem was solved in several different languages. The idea was to let the audience lead, but the only ones who did that were I and the Ruby guy - and we and the Clojure guy were the only ones who completed the task on time. This, even though we stuck to Emacs and had no other fancy tools. The Java team and the C# guy ran out of time. > > > > > > The Java guys - two experts, pair programming rather than involving the audience - ripped through with IntelliJ, but still didn?t finish the task on time. Still, it was amazing to see what the tool could do. Talking to some Java experts afterwards, the consensus seemed to be that ?yeah, the tools are fantastic, but the problem is that you?re dead in the water without them?. Also, some complaints were raised that the tool support distances you as a developer from the raw implementation, especially when the tool automatically generates a lot of your code for you. > > > To some extent, this also applies to the libs question. You might well get done faster even if you end up having to do work that you wouldn?t have to in Java, since writing your own lib in Erlang can often be less work than using an existing lib in Java. ;-) > > > > > > Since most Erlang programmers are quite comfortable using Emacs or Vim, it?s hard to get traction for a tool development project. There have been attempts, but overall, most (?) Erlang devs don?t feel that they need such tools to be productive. > > > > > > But mostly, the things to look for are the major snags - the ones that could kill your project. How much support can you get from the respective communities for the kind of application you have in mind? How mature are the components you will have to rely on? Etc. > > > > > > Depending on your application domain, the anwers to those questions are likely to vary. > > > > > > BR, > > > Ulf W > > > > > > Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. > > > http://feuerlabs.com > > > > > > > > > > > > > > > > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED (mailto:erlang-questions@REDACTED) > > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From freza@REDACTED Thu Jan 30 20:19:19 2014 From: freza@REDACTED (Jachym Holecek) Date: Thu, 30 Jan 2014 14:19:19 -0500 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: <20140130191919.GA3720@circlewave.net> # Steve Strong 2014-01-30: > > It could be I have to learn Emacs. Being a vi guy for 20 years, that > > will take some adaptation I can tell you. > > I certainly wouldn?t suggest switching editors - although the religious > zealots will insist that one is far better than the other, the reality > (imo) is that both are highly capable and can do the bulk of what people > need with a few hours work on google and with the configuration. FWIW the Viper mode of Emacs provides tolerable (not ideal) Vi emulation, so you don't necessarily have to change habits if you decide to give Emacs a go. BR, -- Jachym From essen@REDACTED Thu Jan 30 20:49:05 2014 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 30 Jan 2014 20:49:05 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <52EA81DB.4060108@ninenines.eu> Message-ID: <52EAACB1.5020405@ninenines.eu> CCing back the mailing list as I would like my response to be archived for future users. On 01/30/2014 07:22 PM, kraythe . wrote: > /In a relevant language, create an array of 1000 numbers. > Initialize > > all of the values in the array to zero. Create two threads > that run > concurrently and which increment each element of the array > one time./ > > > That's not the kind of problem Erlang solves. That specific problem > requires a parallel solution, not a concurrent one. Plus Erlang > processes are isolated so they don't have access to the same data > without a third party (another process, an ets table, ..). Really > for that kind of problem I would instead suggest something like > Haskell or OpenCL. > > > I put that in only as an example of why NOT java. But I would be > interested in your take on how to solve it in erlang. Theoretically > parallel = concurrent. The only question is how to break up the task to > federate it. Shared memory is one way, but not the only way. Introducing > more than one language to this mix is something I would like to avoid. Well I would simply not use Erlang for it. Erlang is good at pretty much anything except CPU-bound problems. Thankfully these are very specific to certain fields and types of applications so Erlang does the job just fine most of the time. If I had that kind of problem to solve inside my application I would use Erlang to manage OpenCL or similar. Erlang is very good at running in a mixed environment, including C libraries, external programs, and can easily speak to any other language thanks to C/Java nodes. So there's really no need to bother trying to solve that problem efficiently in Erlang. Just use something more appropriate and make Erlang speak to it. > Naturally its my opinion. :) One subject to change I might add. Either > the tools are not there or not readily findable. A critique of Erlang is > that if you don't make the ecosystem accessible, you inhibit adoption. > IMHO there should be a "getting started in erlang" tutorial that takes > you from nothing installed to setting up tool set to your first app > running and then modified. I googled until my fingers bled and found > nothing like that, only other smaller tutorials and entirely language > and shell tutorials (which were great btw). That "new to erlang? Start > here," tutorial should be prominent on the first page of erlang.org > . You come from a very different world, most languages don't have their specific IDE and graphical tools to do things. Erlang does come with an Emacs mode (http://www.erlang.org/doc/apps/tools/erlang_mode_chapter.html) but that's only good for Emacs people. The shell tutorials are the best getting started you'll get. Erlang is unique, there's absolutely nothing that comes close to it, you have to learn how it works before you can get started. And the shell can be used to learn a lot of it. One time I spent the first day of teaching a 3 days training using nothing but the shell. If you want a getting started to OTP applications and releases, you can take a look at this: http://ninenines.eu/docs/en/cowboy/HEAD/guide/getting_started/ - That's pretty much what a "getting started with writing Erlang applications" would look like, and as you can see it doesn't cover much of what is covered when learning Erlang. > 3. Fewer general purpose libraries and no major central > repositories. > > I don't want to write code to create JSON, that isnt part of my > business scope. I will pick that one of the shelf If i can. > > > Well good for you then because there's about a dozen JSON libraries. > > > Oh good. I googled for a vector math library. In java I can go to a > maven Repo and get an index of thousands of libs. Where is the erlang > equivalent ? And do I have to compile them? Can I just use the binary > beam files? Like I said earlier, CPU-bound operations, write a binding to a C vector math library and call it from Erlang. Erlang code is almost exclusively obtained from source. There are no central repository, despite many attempts, for two main reasons: * It is very common to run your own fork of a project with a specific set of additions, fixes or performance improvements you can't live without. * What you push to production is called a release, and is a self contained package containing everything your node needs to run. You can just push it to a new system without anything Erlang installed, start the release and it just works (you might still need openssl on some OS). What follows from that is that you won't install much Erlang libraries, you just mark them as dependencies to your release and the build tool fetches everything as needed. To illustrate, I do have a package index file in my erlang.mk build tool, but no open source author sent a PR to put their project there. (Of course this index file has other uses so it's not a wasted feature.) The package manager question comes back regularly, and there's a new one from time to time, but what these projects try to solve is generally what they think is a technical issue of previous package managers that failed to get traction, while the actual issue is entirely cultural. > Maps would be good and solve much of my record tuple annoyance. +1 for > that. What I would really want, though, is a constrained map. A map > where I can bind the keys to only a certain set of atoms. Records aren't > too horrible except their syntax is ... weird. You can create a map with a default for all the keys you accept and then update using only := which requires the key to already exist in the map. -- Lo?c Hoguin http://ninenines.eu From vladdu55@REDACTED Thu Jan 30 21:23:55 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 30 Jan 2014 21:23:55 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: <52EAACB1.5020405@ninenines.eu> References: <52EA81DB.4060108@ninenines.eu> <52EAACB1.5020405@ninenines.eu> Message-ID: On Thu, Jan 30, 2014 at 8:49 PM, Lo?c Hoguin wrote: > You come from a very different world, most languages don't have their > specific IDE and graphical tools to do things. Erlang does come with an > Emacs mode (http://www.erlang.org/doc/apps/tools/erlang_mode_chapter.html) > but that's only good for Emacs people. > Just a gentle reminder: there is an IDE for Erlang, http://erlide.org. It can do a lot of helpful things, among others integration with the debugger and with Wrangler. It's based on Eclipse, so it's on the heavy side, and the list of things to be done is long, but I'm working hard to improve it. The next big thing (coming soon!) will be building with make/emake/rebar, so that more projects can use it. If anybody tries it, even if it doesn't get many stars, please let me know what is bad and what is missing, with a use case or two. I can only do a few things at a time and it would be best if these were what people need the most. best regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Thu Jan 30 21:42:59 2014 From: erlang@REDACTED (Joe Armstrong) Date: Thu, 30 Jan 2014 21:42:59 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: Message-ID: On Thu, Jan 30, 2014 at 5:19 PM, kraythe . wrote: > Ok right up front, I'm a Java Guru, not a Scala or Erlang one. What that > means is that I know more than most debs about the core java language, but > enough to know where the problems are. And certainly java has many issues > but it also has massive momentum. I think one of the issues with Java can > be expressed in one little programming puzzle I came across recently: > > *In a relevant language, create an array of 1000 numbers. Initialize all > of the values in the array to zero. Create two threads that run > concurrently and which increment each element of the array one time.* > > > Interesting? The solution in Scala that I came up with is the following. > > def mtmap[A](data : List[A], threads: Int, f: (A) => A) = { > import scala.concurrent.{ExecutionContext, Future, Await} > implicit val executor = > java.util.concurrent.Executors.newFixedThreadPool(threads) > implicit val context = ExecutionContext.fromExecutorService(executor) > val futures : Future[List[A]]= Future.traverse(data)(x => Future{f(x)}) > import scala.concurrent.duration._ > import scala.language.postfixOps > val results : List[A] = Await.result(futures, 1 minute) > results > } > > > Just thinking of doing this in Java will bring up some of the big problems > with Java; I will leave it as a mental exercise for the reader. The problem > is that Scala inherits some of them from the JVM and that has made me look > into Erlang. The goal being to select a language for the development of a > concurrent TCP/IP based application with thousands of users interacting in > a small space. > A benchmark that tells you how concurrent array updates works won't tell you anything about well sockets work. Erlang was explicitly designed for managing thousands of simultaneous sessions (ie telecomms applications) - (that's why things like WhatsApp is programmed in Erlang) try Googling "whatsapp+erlang". Java was designed for set-top boxes - both languages are good for what they were designed to be good at. Consequently Erlang is good at handling large numbers of parallel connections and java is really good for set-top boxes. Both languages suck when used outside their design domains. So Erlang is crap at programming small memory footprint embedded devices and java is not stunning good at handling concurrency. > > So far I think the contenders I have are Scala with Akka or Erlang. And > yes, I know there are evangelists to both and I will post this to an Scala > list to get their feedback as well (or something similar). Now, right up > front I am not peeing on either language. They both rock or they wouldn't > be on the list. The question is which should win the prize. There is no > going back once development is 1000 hours down the road. > > *Scala: * > *Pros:* > > 1. Based on Java Ecosystem so easier to staff because good Java devs > can convert to Scala. > 2. Decent tools (which are getting better). Many libraries. > 3. Static typing with type inference. > > *Cons:* > > 1. Based on Java Ecosystem and inherit the problems of that ecosystem > (i.e. immutable is a function of the design of a class, not of the language > so it can't be guaranteed.), Also library code under the hood is not as > rigorous as scala code in enforcing immutability so at some point you are > rolling dice here. > 2. Scala is also more heavyweight than Erlang when it comes to > spawning thousands of processes. Erlang was built from the ground up to do > concurrency. For Scala its an Akka bolt on can carries the Java threading > nightmare (shared memory, etc). > > How about millions of processes - "thousands" of processes is in the "tiny" league table > > 1. > 2. Scala is not as fast. My server will be doing billions of vector > math calculations per day and they have to be in the terms of milliseconds > of latency. It has to be that if I have a user R in the server at position > V where V is a vector, I need to calculate all other actors within 50 units > and get that answer in milliseconds so that only the network latency is the > bottleneck. Some of this can be helped with algorithms like spatial grids > and so on but still we are looking at a couple of hundred vector math calls > per second. > > I don't get a feeling for what "billions of vector math calculations per day" means. How long does one "vector math calculation" take - or is this what you were trying to measure? If you're doing really heavy number crunching Julia seems the way to go. Julia is outperforming Fortran on many benchmarks - and Fortran always set the gold standard for number crunching. Something like Erlang for orchestration, Julia for number crunching and 0MQ for messaging would be what I'd look at. > 1. Scala is harder to hook up to dozens of nodes and move actors from > node x to node y than Erlang, mainly because that was one of the design > goals of Erlang. > > > *Erlang:* > *Pros:* > > 1. Built for concurrency. Can handle dozens of hardware nodes, build > massive applications of the kind I am trying to deploy. Think of 100k users > connecting to the cluster with a TCP connection and interacting over that > connection which interacts with any or all of the other 100k actors. > 2. Built from the ground up with immutability in mind. Immutability is > a language feature, not compromisable. Its not JVM based and so is not > under the same issues as Java is. > > What's immutability got to do with anything? If you want to do fast vector operations things like Fortran is king - and that's mutable as hell. The kind of immutability that Erlang has is for reasons of fault tolerance - we don't want programs to crash and run wild - fast math needs mutable structures > > 1. There is merit in the thought that static typing is sometimes a > hinderance to a language. > > *Cons:* > > 1. The tools are, well frankly, garbage. Sorry, in 2014 to be pushed > back to coding with VIM and makefiles is primitive. Rebar is crytptic and > just the pet project of a guy on GIT. Compared to Gradle, Maven and even > (though I don't care for it much) SBT, rebar is ... lacking. I want to > spend time working on my business logic, not fighting tools. There are > plugins for eclipse and intellij but they have minimal functionality and i > keep reverting back to vim. > > Tools are no substitute for thought. None of the tools you mention help me think - the thing that takes time in programming is deciding exactly what problem to solve. Once you know you can usually knock out the program in a few hours. The best tool we have is (or course) maths - ie logical reasoning and proofs. The average programmer produces about 10 lines of code per day, but they might write hundreds or even thousands of lines of code per day that never makes it to the final product. If they knew what to do they could just write these ten lines in a few minutes, but they don't know so they have to write thousands of lines to help try and figure out what the problem is. It also creates the illusion of work and they can get paid for it. The big problem in programming is understanding the problem. "programming is understanding" The tools we have today are no better than they were 40 years ago. My brain is still far far better at debugging that any fancy tool. I have no idea my brain works - all I know is that I often work on a problem and then give up. I go to sleep and wake up with the solution. Now that is far far better than *any* IDE on the planet. I like to spend my time figuring out *exactly* how things related to my applications, there would be no point in figuring out (say) eclipse works - since editing text is not a problem for me - I'm happy with emacs - and even happier with a pen and paper (which boots far quicker, is far more portable, and far more flexible) I spend 65% of my programming time fixing stuff that I need that is broken. Every time a program does not install or work exactly as advertised I have to pull it apart and fix it. None of these tools are of any use when they break. Rebar/Maven/Git etc are great when they work. Even emacs is crashing randomly on my mac - the problem is not the tools but that fact that broken tools take a long time to fix. (this is why I try to use as little as possible - emacs, make and bash, do it for me) In the good old days programmers could talk to each other - everybody who could program knew how to write makefile and bash scripts. Now a guy who speaks Maven is floored when sent a rakefile. And as for eclipse etc. these are unbelievably horrible. > 1. Much harder to staff than Scala because it is not Java based. > 2. Fewer general purpose libraries and no major central repositories. > I don't want to write code to create JSON, that isnt part of my business > scope. I will pick that one of the shelf If i can. > > It's often far quicker to write code than a) find a library b) install it c) fix the bugs in the library. Creating JSON is trivial: io:format("{'firstname':'joe', 'lastname':'armstring'}"). Parsing it is a wee bit messy. > 1. Records as the only structured data type is ... annoying. > > > The problem I have is I can't find the perfect solution. Erlang is > compelling but also is Scala. > > Opinions? > There is no easy path. - choose your languages - write the benchmarks in all the languages - measure - don't believe what other people say - base the results on your personal experience - understand your problem - write a detailed English description of the problem and give to to your friends - get them to read it and explain the problem back to you There are also tradeoff to consider. You want super fast math (this implies mutable data) You want safety (this implies non-mutable data) You mention JSON (implies inefficient data transfer) You want massive communication etc. These pull in different directions. Cheers /Joe > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Thu Jan 30 22:13:42 2014 From: erlang@REDACTED (Joe Armstrong) Date: Thu, 30 Jan 2014 22:13:42 +0100 Subject: [erlang-questions] 0MQ libraries Message-ID: Is anybody working on upgrading the 0MQ libraries for erlang to the latest version of 0QM. /Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.goertzen@REDACTED Thu Jan 30 22:17:33 2014 From: daniel.goertzen@REDACTED (Daniel Goertzen) Date: Thu, 30 Jan 2014 15:17:33 -0600 Subject: [erlang-questions] SNMP agent: modifying vacm, community, etc Message-ID: I am working on an snmp agent and trying to figure out the 'proper' way to locally edit tables like vacm, community, usm, etc. 1. One approach is to keep modifying config files through the snmpa_config module and then call configure() on the appropriate mib module to reload the config. 2. Another approach is to try to do everything through the appropriate mib module, but in general they only provide add and delete operations (I need to be able to see what is there). 3. There are the MIBs for these tables on which I could use SNMP get/set, but I do not want them loaded so I cannot use this. I am left with #1 which seems clunky but should get the job done for me. If there is a better way I would love to hear about it. Hiccups aside, I am in awe of the Erlang SNMP application. The SNMP protocol is simply horrifying, but this app handles it all. Cheers, Dan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Thu Jan 30 22:58:08 2014 From: g@REDACTED (Garrett Smith) Date: Thu, 30 Jan 2014 15:58:08 -0600 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: Message-ID: On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong wrote: > Is anybody working on upgrading the 0MQ libraries for erlang to > the latest version of 0QM. I would be tempted to upgrade them, but I've wanted to have an external C port implementation of the 0MQ bindings for a while and so created this: https://github.com/gar1t/erlang-czmq In my three years of experience with the 0MQ bindings, it's been (historically) very easy to crash the Erlang VM. For my applications, speed will never justify the cost of taking an entire node down. The CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10 times slower). I'm sure they can be made much faster, but my thinking is that running multiple external ports could alleviate this. Speed kills. This code is not running in production, but it will be soon. The CZMQ API in my opinion is the right target for new 0MQ bindings, regardless of how they're implemented. Pieter Hintjen's rationale for writing CZMQ is here: https://github.com/zeromq/czmq#scope-and-goals Garrett From mjtruog@REDACTED Thu Jan 30 23:06:44 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 30 Jan 2014 14:06:44 -0800 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: Message-ID: <52EACCF4.7060006@gmail.com> The normal repository is https://github.com/zeromq/erlzmq2 and that works with the v2 and v3 ZeroMQ. I haven't tried erlzmq2 with v4, but a fork here has tried it https://github.com/mkrentovskiy/erlzmq2 . There should be more features that require integration, based on the list of features in v4 ZeroMQ, however, the new features in v4 seem to be experimental (e.g., encryption support), so a more conservative choice would be to stick with v3 until the ZeroMQ v4 features get properly tested with a stable API in a later v4 ZeroMQ release. On 01/30/2014 01:13 PM, Joe Armstrong wrote: > Is anybody working on upgrading the 0MQ libraries for erlang to > the latest version of 0QM. > > /Joe > > > _______________________________________________ > 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 Thu Jan 30 23:15:54 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 30 Jan 2014 14:15:54 -0800 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: Message-ID: <52EACF1A.2000901@gmail.com> On 01/30/2014 01:58 PM, Garrett Smith wrote: > On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong wrote: >> Is anybody working on upgrading the 0MQ libraries for erlang to >> the latest version of 0QM. > I would be tempted to upgrade them, but I've wanted to have an > external C port implementation of the 0MQ bindings for a while and so > created this: > > https://github.com/gar1t/erlang-czmq > > In my three years of experience with the 0MQ bindings, it's been > (historically) very easy to crash the Erlang VM. For my applications, > speed will never justify the cost of taking an entire node down. The > CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10 > times slower). I'm sure they can be made much faster, but my thinking > is that running multiple external ports could alleviate this. > > Speed kills. > > This code is not running in production, but it will be soon. > > The CZMQ API in my opinion is the right target for new 0MQ bindings, > regardless of how they're implemented. Pieter Hintjen's rationale for > writing CZMQ is here: > > https://github.com/zeromq/czmq#scope-and-goals > > Garrett > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > Yes, but https://github.com/gar1t/erlang-czmq has a GPLv3 license, while https://github.com/zeromq/erlzmq2 has a BSD license, so that can also affect the choice. erlang-czmq appears impossible to use in any commercial way, including in a service (due to it being v3 of the GPL). So, that is a concern, aside from it being slow. Though, I am not a lawyer, I am not giving legal advice. From bchesneau@REDACTED Thu Jan 30 23:18:41 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Thu, 30 Jan 2014 23:18:41 +0100 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <52EACF1A.2000901@gmail.com> References: <52EACF1A.2000901@gmail.com> Message-ID: On Thu, Jan 30, 2014 at 11:15 PM, Michael Truog wrote: > On 01/30/2014 01:58 PM, Garrett Smith wrote: > >> On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong wrote: >> >>> Is anybody working on upgrading the 0MQ libraries for erlang to >>> the latest version of 0QM. >>> >> I would be tempted to upgrade them, but I've wanted to have an >> external C port implementation of the 0MQ bindings for a while and so >> created this: >> >> https://github.com/gar1t/erlang-czmq >> >> In my three years of experience with the 0MQ bindings, it's been >> (historically) very easy to crash the Erlang VM. For my applications, >> speed will never justify the cost of taking an entire node down. The >> CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10 >> times slower). I'm sure they can be made much faster, but my thinking >> is that running multiple external ports could alleviate this. >> >> Speed kills. >> >> This code is not running in production, but it will be soon. >> >> The CZMQ API in my opinion is the right target for new 0MQ bindings, >> regardless of how they're implemented. Pieter Hintjen's rationale for >> writing CZMQ is here: >> >> https://github.com/zeromq/czmq#scope-and-goals >> >> Garrett >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > Yes, but https://github.com/gar1t/erlang-czmq has a GPLv3 license, while > https://github.com/zeromq/erlzmq2 has a BSD license, so that can also > affect the choice. erlang-czmq appears impossible to use in any commercial > way, including in a service (due to it being v3 of the GPL). So, that is a > concern, aside from it being slow. Though, I am not a lawyer, I am not > giving legal advice. indeed. It should probably better to use LGPL3 if you want to make sure to get the changes on your lib or MPL2 if you want to keep a little the spirit of the gpl. So it doesn't have any possible side-effect on the code using the library. - benoit > > _______________________________________________ > 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 Thu Jan 30 23:19:34 2014 From: g@REDACTED (Garrett Smith) Date: Thu, 30 Jan 2014 16:19:34 -0600 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <52EACF1A.2000901@gmail.com> References: <52EACF1A.2000901@gmail.com> Message-ID: > Yes, but https://github.com/gar1t/erlang-czmq has a GPLv3 license, while > https://github.com/zeromq/erlzmq2 has a BSD license, so that can also affect > the choice. erlang-czmq appears impossible to use in any commercial way, > including in a service (due to it being v3 of the GPL). So, that is a > concern, aside from it being slow. Though, I am not a lawyer, I am not > giving legal advice. This was not a deliberate decision -- I'm happy to change it :) Suggestions? From bchesneau@REDACTED Thu Jan 30 23:20:40 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Thu, 30 Jan 2014 23:20:40 +0100 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: Message-ID: On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith wrote: > On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong wrote: > > Is anybody working on upgrading the 0MQ libraries for erlang to > > the latest version of 0QM. > > I would be tempted to upgrade them, but I've wanted to have an > external C port implementation of the 0MQ bindings for a while and so > created this: > > https://github.com/gar1t/erlang-czmq Pretty nice ! > > > In my three years of experience with the 0MQ bindings, it's been > (historically) very easy to crash the Erlang VM. For my applications, > speed will never justify the cost of taking an entire node down. The > CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10 > times slower). I'm sure they can be made much faster, but my thinking > is that running multiple external ports could alleviate this. > > Speed kills. > What do you mean? I like better to have a stable solution? How did you benchmarked it? > This code is not running in production, but it will be soon. > The CZMQ API in my opinion is the right target for new 0MQ bindings, > regardless of how they're implemented. Pieter Hintjen's rationale for > writing CZMQ is here: > > https://github.com/zeromq/czmq#scope-and-goals > > Garrett > _______________________________________________ > 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 Thu Jan 30 23:22:20 2014 From: g@REDACTED (Garrett Smith) Date: Thu, 30 Jan 2014 16:22:20 -0600 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: Message-ID: On Thu, Jan 30, 2014 at 4:20 PM, Benoit Chesneau wrote: > On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith wrote: > >> Speed kills. > > What do you mean? I like better to have a stable solution? How did you > benchmarked it? We are in agreement on stability :) There's a benchmark tool in the library. Garrett From mjtruog@REDACTED Thu Jan 30 23:46:28 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 30 Jan 2014 14:46:28 -0800 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: Message-ID: <52EAD644.4030500@gmail.com> On 01/30/2014 02:22 PM, Garrett Smith wrote: > On Thu, Jan 30, 2014 at 4:20 PM, Benoit Chesneau wrote: > >> On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith wrote: >> >>> Speed kills. >> What do you mean? I like better to have a stable solution? How did you >> benchmarked it? > We are in agreement on stability :) > > There's a benchmark tool in the library. > > Garrett > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > I guess your concerns about stability are confusing. The main issues are bugs within the ZeroMQ source code: https://zeromq.jira.com/browse/LIBZMQ-478 https://zeromq.jira.com/browse/LIBZMQ-496 The LIBZMQ-496 was fixed in 3.2.3 while LIBZMQ-478 remains unresolved. I see no reason to doubt the stability of erlzmq2, since these errors are handled in a way that causes no instability within the Erlang VM. The erlzmq2 is using a separate thread, so it doesn't have the Erlang scheduler lock-up issue that remains a problem for all long-running NIF/BIF functions. So, what instability are you referring to? From mahesh@REDACTED Thu Jan 30 23:59:06 2014 From: mahesh@REDACTED (Mahesh Paolini-Subramanya) Date: Thu, 30 Jan 2014 17:59:06 -0500 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <52EAD644.4030500@gmail.com> References: <52EAD644.4030500@gmail.com> Message-ID: The main thing I used to see was VM memory exhaustion due to 0MQ being just too damn fast. But that was more of a "No AQM in my code" issue :-) Sent via smoke signals... Mahesh Paolini-Subramanya That tall bald Indian guy... On Jan 30, 2014 5:46 PM, "Michael Truog" wrote: > On 01/30/2014 02:22 PM, Garrett Smith wrote: > >> On Thu, Jan 30, 2014 at 4:20 PM, Benoit Chesneau >> wrote: >> >> On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith wrote: >>> >>> Speed kills. >>>> >>> What do you mean? I like better to have a stable solution? How did you >>> benchmarked it? >>> >> We are in agreement on stability :) >> >> There's a benchmark tool in the library. >> >> Garrett >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> I guess your concerns about stability are confusing. The main issues > are bugs within the ZeroMQ source code: > https://zeromq.jira.com/browse/LIBZMQ-478 > https://zeromq.jira.com/browse/LIBZMQ-496 > > The LIBZMQ-496 was fixed in 3.2.3 while LIBZMQ-478 remains unresolved. I > see no reason to doubt the stability of erlzmq2, since these errors are > handled in a way that causes no instability within the Erlang VM. The > erlzmq2 is using a separate thread, so it doesn't have the Erlang scheduler > lock-up issue that remains a problem for all long-running NIF/BIF functions. > > So, what instability are you referring to? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tristan.sloughter@REDACTED Fri Jan 31 00:15:57 2014 From: tristan.sloughter@REDACTED (Tristan Sloughter) Date: Thu, 30 Jan 2014 15:15:57 -0800 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: <52EACF1A.2000901@gmail.com> Message-ID: <1391123757.32484.77454241.2372BFE5@webmail.messagingengine.com> Why would it not allow you to use it in a service because it is GPLv3? Maybe you are confusing GPLv3 with the AGPL? -- Tristan Sloughter tristan.sloughter@REDACTED On Thu, Jan 30, 2014, at 02:19 PM, Garrett Smith wrote: > > Yes, but https://github.com/gar1t/erlang-czmq has a GPLv3 license, while > > https://github.com/zeromq/erlzmq2 has a BSD license, so that can also affect > > the choice. erlang-czmq appears impossible to use in any commercial way, > > including in a service (due to it being v3 of the GPL). So, that is a > > concern, aside from it being slow. Though, I am not a lawyer, I am not > > giving legal advice. > > This was not a deliberate decision -- I'm happy to change it :) > > Suggestions? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From bchesneau@REDACTED Fri Jan 31 00:18:56 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Fri, 31 Jan 2014 00:18:56 +0100 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <1391123757.32484.77454241.2372BFE5@webmail.messagingengine.com> References: <52EACF1A.2000901@gmail.com> <1391123757.32484.77454241.2372BFE5@webmail.messagingengine.com> Message-ID: On Fri, Jan 31, 2014 at 12:15 AM, Tristan Sloughter < tristan.sloughter@REDACTED> wrote: > Why would it not allow you to use it in a service because it is GPLv3? > Maybe you are confusing GPLv3 with the AGPL? > in a service it is not a problem. It's more likely a problem when you want to ship your code and make sure it is not polluted by another license. Which is not possible with the GPL3. - benoit > > -- > Tristan Sloughter > tristan.sloughter@REDACTED > > On Thu, Jan 30, 2014, at 02:19 PM, Garrett Smith wrote: > > > Yes, but https://github.com/gar1t/erlang-czmq has a GPLv3 license, > while > > > https://github.com/zeromq/erlzmq2 has a BSD license, so that can also > affect > > > the choice. erlang-czmq appears impossible to use in any commercial > way, > > > including in a service (due to it being v3 of the GPL). So, that is a > > > concern, aside from it being slow. Though, I am not a lawyer, I am not > > > giving legal advice. > > > > This was not a deliberate decision -- I'm happy to change it :) > > > > Suggestions? > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksoe@REDACTED Fri Jan 31 00:30:05 2014 From: eriksoe@REDACTED (=?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?=) Date: Fri, 31 Jan 2014 00:30:05 +0100 Subject: [erlang-questions] Creating node problem In-Reply-To: References: Message-ID: Are you writing those commands in the Erlang shell? They don't go there - they're for the windows shell, for starting the Erlang one. Regards, Erik S?e S?rensen Den 29/01/2014 18.41 skrev "Zoha Qamar" : > > Dear all , > > > I making server and client node in Erlang emulator R16B3 , but i am keep > getting error on the first line , i am using win7 , 64bit my command is > > werl -name zoha@REDACTED > > or > > > werl -name zoha@REDACTED ( copying from host file of > window 's ) > > or its direct IP > > werl -name zoha@REDACTED > > but what ever i put Ip or host name , i keep getting error , > > * 1: syntax error before: zoha@REDACTED > or > > * 1: syntax error before: zoha@REDACTED > > or > > * 1: syntax error before: zoha@REDACTED > > > pls help me out where i am wrong any administration privilege issue , > firewall issue ?? > -- > "*Agar Tum Seedhay rastay pe ho aur kisi Mushkil ka samna nahe ker rahay to > kuch dair k liyay socho k kahin tum kuch ghalt to nahe ker rahay kyon k > seedha rasta to mushkilaat se bhar pur hota hy*" *Hazrat Imam Ali (A.S) * > > > _______________________________________________ > 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 Fri Jan 31 00:31:02 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 30 Jan 2014 15:31:02 -0800 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <1391123757.32484.77454241.2372BFE5@webmail.messagingengine.com> References: <52EACF1A.2000901@gmail.com> <1391123757.32484.77454241.2372BFE5@webmail.messagingengine.com> Message-ID: <52EAE0B6.3060208@gmail.com> On 01/30/2014 03:15 PM, Tristan Sloughter wrote: > Why would it not allow you to use it in a service because it is GPLv3? > Maybe you are confusing GPLv3 with the AGPL? > You are right, originally they wanted to close the service loophole in GPLv3, but they didn't, that got closed in AGPLv3. I just try to avoid all GPL use due to the various other restrictions on commercial use, so these may blur in my mind a bit, since the general direction is meant to prevent closed-source use, though GPLv3 isn't a version that does that for services. (I am not a lawyer, not giving legal advice... don't sue me) From g@REDACTED Fri Jan 31 01:56:17 2014 From: g@REDACTED (Garrett Smith) Date: Thu, 30 Jan 2014 18:56:17 -0600 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <52EAE0B6.3060208@gmail.com> References: <52EACF1A.2000901@gmail.com> <1391123757.32484.77454241.2372BFE5@webmail.messagingengine.com> <52EAE0B6.3060208@gmail.com> Message-ID: How about no license? How do I delete this file? On Thu, Jan 30, 2014 at 5:31 PM, Michael Truog wrote: > On 01/30/2014 03:15 PM, Tristan Sloughter wrote: >> >> Why would it not allow you to use it in a service because it is GPLv3? >> Maybe you are confusing GPLv3 with the AGPL? >> > You are right, originally they wanted to close the service loophole in > GPLv3, but they didn't, that got closed in AGPLv3. I just try to avoid all > GPL use due to the various other restrictions on commercial use, so these > may blur in my mind a bit, since the general direction is meant to prevent > closed-source use, though GPLv3 isn't a version that does that for services. > (I am not a lawyer, not giving legal advice... don't sue me) > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From mahesh@REDACTED Fri Jan 31 02:12:25 2014 From: mahesh@REDACTED (Mahesh Paolini-Subramanya) Date: Thu, 30 Jan 2014 20:12:25 -0500 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: <52EACF1A.2000901@gmail.com> <1391123757.32484.77454241.2372BFE5@webmail.messagingengine.com> <52EAE0B6.3060208@gmail.com> Message-ID: ?No License? means that you retain all?rights - and also means that it is pretty much unusable by anyone else! cheers Mahesh Paolini-Subramanya That tall bald Indian guy.. Google+? |?Blog?? |?Twitter? |?LinkedIn On January 30, 2014 at 7:56:47 PM, Garrett Smith (g@REDACTED) wrote: How about no license? How do I delete this file? On Thu, Jan 30, 2014 at 5:31 PM, Michael Truog wrote: > On 01/30/2014 03:15 PM, Tristan Sloughter wrote: >> >> Why would it not allow you to use it in a service because it is GPLv3? >> Maybe you are confusing GPLv3 with the AGPL? >> > You are right, originally they wanted to close the service loophole in > GPLv3, but they didn't, that got closed in AGPLv3. I just try to avoid all > GPL use due to the various other restrictions on commercial use, so these > may blur in my mind a bit, since the general direction is meant to prevent > closed-source use, though GPLv3 isn't a version that does that for services. > (I am not a lawyer, not giving legal advice... don't sue me) > > _______________________________________________ > 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 g@REDACTED Fri Jan 31 02:17:17 2014 From: g@REDACTED (Garrett Smith) Date: Thu, 30 Jan 2014 19:17:17 -0600 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: <52EACF1A.2000901@gmail.com> <1391123757.32484.77454241.2372BFE5@webmail.messagingengine.com> <52EAE0B6.3060208@gmail.com> Message-ID: Wait! My project doesn't even have a license file. What are we even talking about here? CZMQ/0MQ is dual licensed GPL/LGPL. I'll use those, if that's okay with Tristan. Don't want that guy up in my grill. On Thu, Jan 30, 2014 at 7:12 PM, Mahesh Paolini-Subramanya wrote: > 'No License' means that you retain all rights - and also means that it is > pretty much unusable by anyone else! > > cheers > Mahesh Paolini-Subramanya > That tall bald Indian guy.. > Google+ | Blog | Twitter | LinkedIn > > On January 30, 2014 at 7:56:47 PM, Garrett Smith (g@REDACTED) wrote: > > How about no license? How do I delete this file? > > On Thu, Jan 30, 2014 at 5:31 PM, Michael Truog wrote: >> On 01/30/2014 03:15 PM, Tristan Sloughter wrote: >>> >>> Why would it not allow you to use it in a service because it is GPLv3? >>> Maybe you are confusing GPLv3 with the AGPL? >>> >> You are right, originally they wanted to close the service loophole in >> GPLv3, but they didn't, that got closed in AGPLv3. I just try to avoid all >> GPL use due to the various other restrictions on commercial use, so these >> may blur in my mind a bit, since the general direction is meant to prevent >> closed-source use, though GPLv3 isn't a version that does that for >> services. >> (I am not a lawyer, not giving legal advice... don't sue me) >> >> _______________________________________________ >> 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 mahesh@REDACTED Fri Jan 31 02:24:08 2014 From: mahesh@REDACTED (Mahesh Paolini-Subramanya) Date: Thu, 30 Jan 2014 20:24:08 -0500 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: <52EACF1A.2000901@gmail.com> <1391123757.32484.77454241.2372BFE5@webmail.messagingengine.com> <52EAE0B6.3060208@gmail.com> Message-ID: Yeah, you can't trust Tristan__ ... On Thu, Jan 30, 2014 at 8:17 PM, Garrett Smith wrote: > Wait! My project doesn't even have a license file. What are we even > talking about here? > > CZMQ/0MQ is dual licensed GPL/LGPL. I'll use those, if that's okay > with Tristan. Don't want that guy up in my grill. > > On Thu, Jan 30, 2014 at 7:12 PM, Mahesh Paolini-Subramanya > wrote: > > 'No License' means that you retain all rights - and also means that it is > > pretty much unusable by anyone else! > > > > cheers > > Mahesh Paolini-Subramanya > > That tall bald Indian guy.. > > Google+ | Blog | Twitter | LinkedIn > > > > On January 30, 2014 at 7:56:47 PM, Garrett Smith (g@REDACTED) wrote: > > > > How about no license? How do I delete this file? > > > > On Thu, Jan 30, 2014 at 5:31 PM, Michael Truog > wrote: > >> On 01/30/2014 03:15 PM, Tristan Sloughter wrote: > >>> > >>> Why would it not allow you to use it in a service because it is GPLv3? > >>> Maybe you are confusing GPLv3 with the AGPL? > >>> > >> You are right, originally they wanted to close the service loophole in > >> GPLv3, but they didn't, that got closed in AGPLv3. I just try to avoid > all > >> GPL use due to the various other restrictions on commercial use, so > these > >> may blur in my mind a bit, since the general direction is meant to > prevent > >> closed-source use, though GPLv3 isn't a version that does that for > >> services. > >> (I am not a lawyer, not giving legal advice... don't sue me) > >> > >> _______________________________________________ > >> 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 > -- *Mahesh Paolini-Subramanya That tall bald Indian guy..* *Google+ | Blog | Twitter | LinkedIn * -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Fri Jan 31 02:38:21 2014 From: mjtruog@REDACTED (Michael Truog) Date: Thu, 30 Jan 2014 17:38:21 -0800 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: <52EACF1A.2000901@gmail.com> <1391123757.32484.77454241.2372BFE5@webmail.messagingengine.com> <52EAE0B6.3060208@gmail.com> Message-ID: <52EAFE8D.1070008@gmail.com> Talking about this type of stuff in the code: https://github.com/gar1t/erlang-czmq/blob/master/c_src/czmq_port.c#L4 On 01/30/2014 05:17 PM, Garrett Smith wrote: > Wait! My project doesn't even have a license file. What are we even > talking about here? > > CZMQ/0MQ is dual licensed GPL/LGPL. I'll use those, if that's okay > with Tristan. Don't want that guy up in my grill. > > On Thu, Jan 30, 2014 at 7:12 PM, Mahesh Paolini-Subramanya > wrote: >> 'No License' means that you retain all rights - and also means that it is >> pretty much unusable by anyone else! >> >> cheers >> Mahesh Paolini-Subramanya >> That tall bald Indian guy.. >> Google+ | Blog | Twitter | LinkedIn >> >> On January 30, 2014 at 7:56:47 PM, Garrett Smith (g@REDACTED) wrote: >> >> How about no license? How do I delete this file? >> >> On Thu, Jan 30, 2014 at 5:31 PM, Michael Truog wrote: >>> On 01/30/2014 03:15 PM, Tristan Sloughter wrote: >>>> Why would it not allow you to use it in a service because it is GPLv3? >>>> Maybe you are confusing GPLv3 with the AGPL? >>>> >>> You are right, originally they wanted to close the service loophole in >>> GPLv3, but they didn't, that got closed in AGPLv3. I just try to avoid all >>> GPL use due to the various other restrictions on commercial use, so these >>> may blur in my mind a bit, since the general direction is meant to prevent >>> closed-source use, though GPLv3 isn't a version that does that for >>> services. >>> (I am not a lawyer, not giving legal advice... don't sue me) >>> >>> _______________________________________________ >>> 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 tristan.sloughter@REDACTED Fri Jan 31 02:56:42 2014 From: tristan.sloughter@REDACTED (Tristan Sloughter) Date: Thu, 30 Jan 2014 17:56:42 -0800 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: <52EACF1A.2000901@gmail.com> <1391123757.32484.77454241.2372BFE5@webmail.messagingengine.com> <52EAE0B6.3060208@gmail.com> Message-ID: <1391133402.415.77499037.37FD8099@webmail.messagingengine.com> http://24.media.tumblr.com/tumblr_md6siikYor1qztlyqo1_500.gif -- Tristan Sloughter tristan.sloughter@REDACTED On Thu, Jan 30, 2014, at 05:24 PM, Mahesh Paolini-Subramanya wrote: Yeah, you can't trust Tristan__ ... On Thu, Jan 30, 2014 at 8:17 PM, Garrett Smith <[1]g@REDACTED> wrote: Wait! My project doesn't even have a license file. What are we even talking about here? CZMQ/0MQ is dual licensed GPL/LGPL. I'll use those, if that's okay with Tristan. Don't want that guy up in my grill. On Thu, Jan 30, 2014 at 7:12 PM, Mahesh Paolini-Subramanya <[2]mahesh@REDACTED> wrote: > 'No License' means that you retain all rights - and also means that it is > pretty much unusable by anyone else! > > cheers > Mahesh Paolini-Subramanya > That tall bald Indian guy.. > Google+ | Blog | Twitter | LinkedIn > > On January 30, 2014 at 7:56:47 PM, Garrett Smith ([3]g@REDACTED) wrote: > > How about no license? How do I delete this file? > > On Thu, Jan 30, 2014 at 5:31 PM, Michael Truog <[4]mjtruog@REDACTED> wrote: >> On 01/30/2014 03:15 PM, Tristan Sloughter wrote: >>> >>> Why would it not allow you to use it in a service because it is GPLv3? >>> Maybe you are confusing GPLv3 with the AGPL? >>> >> You are right, originally they wanted to close the service loophole in >> GPLv3, but they didn't, that got closed in AGPLv3. I just try to avoid all >> GPL use due to the various other restrictions on commercial use, so these >> may blur in my mind a bit, since the general direction is meant to prevent >> closed-source use, though GPLv3 isn't a version that does that for >> services. >> (I am not a lawyer, not giving legal advice... don't sue me) >> >> _______________________________________________ >> erlang-questions mailing list >> [5]erlang-questions@REDACTED >> [6]http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > [7]erlang-questions@REDACTED > [8]http://erlang.org/mailman/listinfo/erlang-questions -- [9]Mahesh Paolini-Subramanya That tall bald Indian guy.. [10]Google+ | [11]Blog | [12]Twitter | [13]LinkedIn _______________________________________________ erlang-questions mailing list [14]erlang-questions@REDACTED [15]http://erlang.org/mailman/listinfo/erlang-questions References 1. mailto:g@REDACTED 2. mailto:mahesh@REDACTED 3. mailto:g@REDACTED 4. mailto:mjtruog@REDACTED 5. mailto:erlang-questions@REDACTED 6. http://erlang.org/mailman/listinfo/erlang-questions 7. mailto:erlang-questions@REDACTED 8. http://erlang.org/mailman/listinfo/erlang-questions 9. http://www.gravatar.com/avatar/204a87f81a0d9764c1f3364f53e8facf.png 10. https://plus.google.com/u/0/108074935470209044442/posts 11. http://dieswaytoofast.blogspot.com/ 12. https://twitter.com/dieswaytoofast 13. http://www.linkedin.com/in/dieswaytoofast 14. mailto:erlang-questions@REDACTED 15. http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Fri Jan 31 03:08:45 2014 From: g@REDACTED (Garrett Smith) Date: Thu, 30 Jan 2014 20:08:45 -0600 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <52EAFE8D.1070008@gmail.com> References: <52EACF1A.2000901@gmail.com> <1391123757.32484.77454241.2372BFE5@webmail.messagingengine.com> <52EAE0B6.3060208@gmail.com> <52EAFE8D.1070008@gmail.com> Message-ID: Ugh... I'll fix this. Thanks! On Jan 30, 2014 7:38 PM, "Michael Truog" wrote: > Talking about this type of stuff in the code: > https://github.com/gar1t/erlang-czmq/blob/master/c_src/czmq_port.c#L4 > > On 01/30/2014 05:17 PM, Garrett Smith wrote: > >> Wait! My project doesn't even have a license file. What are we even >> talking about here? >> >> CZMQ/0MQ is dual licensed GPL/LGPL. I'll use those, if that's okay >> with Tristan. Don't want that guy up in my grill. >> >> On Thu, Jan 30, 2014 at 7:12 PM, Mahesh Paolini-Subramanya >> wrote: >> >>> 'No License' means that you retain all rights - and also means that it is >>> pretty much unusable by anyone else! >>> >>> cheers >>> Mahesh Paolini-Subramanya >>> That tall bald Indian guy.. >>> Google+ | Blog | Twitter | LinkedIn >>> >>> On January 30, 2014 at 7:56:47 PM, Garrett Smith (g@REDACTED) wrote: >>> >>> How about no license? How do I delete this file? >>> >>> On Thu, Jan 30, 2014 at 5:31 PM, Michael Truog >>> wrote: >>> >>>> On 01/30/2014 03:15 PM, Tristan Sloughter wrote: >>>> >>>>> Why would it not allow you to use it in a service because it is GPLv3? >>>>> Maybe you are confusing GPLv3 with the AGPL? >>>>> >>>>> You are right, originally they wanted to close the service loophole in >>>> GPLv3, but they didn't, that got closed in AGPLv3. I just try to avoid >>>> all >>>> GPL use due to the various other restrictions on commercial use, so >>>> these >>>> may blur in my mind a bit, since the general direction is meant to >>>> prevent >>>> closed-source use, though GPLv3 isn't a version that does that for >>>> services. >>>> (I am not a lawyer, not giving legal advice... don't sue me) >>>> >>>> _______________________________________________ >>>> 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 ok@REDACTED Fri Jan 31 03:13:55 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 31 Jan 2014 15:13:55 +1300 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: Message-ID: On 31/01/2014, at 5:19 AM, kraythe . wrote: > In a relevant language, create an array of 1000 numbers. Initialize all of the values in the array to zero. Create two threads that run concurrently and which increment each element of the array one time. Does that mean something like a := (1 to: 1000) collect: [:each | 0]. b := [1 to: a size do: [:i | a at: i atomicUpdate: [:x | x + 1]]. b fork. b fork. (Bog standard Smalltalk except for #at:atomicUpdate:, which is exclusive to my Smalltalk implementation, but would fit easily enough into others and was trivial to implement.) The Scala version is, well, it makes me even fonder of Smalltalk... The thing is that this exercise is a very imperative one. > > Scala: > Pros: > ? Based on Java Ecosystem so easier to staff because good Java devs can convert to Scala. Scala is different enough from Java that I think anyone who can adapt to Scala can adapt to Erlang about as easily. Data would be nice of course. > ? Decent tools (which are getting better). Many libraries. > ? Static typing with type inference. Erlang has the Dialyzer. I often think that if you *need* powerful modern tools to work with a language, your language is doing something wrong. > ? Fewer general purpose libraries and no major central repositories. I don't want to write code to create JSON, that isnt part of my business scope. I will pick that one of the shelf If i can. There are plenty of JSON libraries; your only problem is choosing the shelf to pick one off. > ? Records as the only structured data type is ... annoying. You may have missed the announcement of maps. From dcartt@REDACTED Fri Jan 31 03:37:38 2014 From: dcartt@REDACTED (David Cartt) Date: Thu, 30 Jan 2014 18:37:38 -0800 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. Message-ID: On 30 Jan 2014 17:22, "kraythe ." <> wrote: > I think one of the issues with Java can be expressed in one little programming puzzle I came across recently: > > *In a relevant language, create an array of 1000 numbers. Initialize all of > the values in the array to zero. Create two threads that run concurrently > and which increment each element of the array one time.* This puzzle is a great example of how much Erlang differs from other languages, and how thinking about a problem in terms of using Erlang design principles differs from using a traditional approach. Very shortly after I started thinking about a solution in Erlang, I thought: "Wait, now why do you want to do this?". It just didn't seem anything like a real problem that Erlang would be used to solve. The puzzle could be representing two very different problems. First, a low-level, high performance, very constrained application like a hardware driver or math calculation, for which Erlang is not applicable. Or second, a system keeping track of a large number of independent states along with a number of processes simultaneously interacting with those states. That's something Erlang excels at and is trivial to solve with no concurrency issues. Just for fun, lets make it a bit more challenging and say the system is tracking X number of states, with Y number of processes interacting with those states, spread across Z number of networked machines. Load balance X states and Y processes across Z machines, and all X, Y, and Z are dynamically changing. That's a puzzle that's pretty easy to do in Erlang but would be a huge project in other languages. > *Erlang:* > *Cons:* > 1. The tools are, well frankly, garbage. Sorry, in 2014 to be pushed > back to coding with VIM and makefiles is primitive. Rebar is crytptic and > just the pet project of a guy on GIT. Compared to Gradle, Maven and even > (though I don't care for it much) SBT, rebar is ... lacking. I want to > spend time working on my business logic, not fighting tools. There are > plugins for eclipse and intellij but they have minimal functionality and i > keep reverting back to vim. Those powerful build tools are great, after taking the time to learn them, until the time they stop working and you're left wondering what went wrong. I really like Erlide but a couple of times something in that massive pile of code that is Eclipse plus Erlide has stopped working and taken a huge amount of time figuring out what. VIM, makefiles, and bash are primitive, and that's their strength. They're all simple and comprehendable. > 2. Much harder to staff than Scala because it is not Java based. This could actually be an Erlang advantage because Erlang self-selects better programmers. It's radically different (what interested me in the first place), takes a lot of work to get what it's about (all of it loads of fun to learn for that very reason!), and isn't trendy (who cares - I want something that solves large scale, fault tolerant, business critical, distributed, concurrent, real world problems). Learning Erlang takes a lot of effort - misery for someone who doesn't love programming but fun and rewarding for someone who does. > 3. Fewer general purpose libraries and no major central repositories. > I don't want to write code to create JSON, that isnt part of my business > scope. I will pick that one of the shelf If i can. There are lots of libraries, certainly many for dealing with JSON. No need for a central repository - just do a web search. > 4. Records as the only structured data type is ... annoying. That's probably for the best because most likely if you're coding in Erlang using a shared structure across multiple source files then there are better ways of doing it, and good reasons for doing so. If you really need to, use property lists, which have no shared structure to keep synchronized across multiple files/processes/machines/versions. The obvious struct/class OOP design of traditional languages is transformed in Erlang/OTP in to something much more powerful, maintainable, and far better at dealing with complexity. -David Cartt From ok@REDACTED Fri Jan 31 05:29:19 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 31 Jan 2014 17:29:19 +1300 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: On 31/01/2014, at 7:49 AM, Steve Strong wrote: > On Thursday, 30 January 2014 at 19:10, kraythe . wrote: >> 1) Code completion. Sorry but I can't be bothered to type the same flipping method name in its entirety 40 times. There are three causes for "completion" in languages like Prolog and Erlang: (a) Definitions with multiple clauses. Your editor should be able to turn "add a clause" into a single command. (b) Recursion. Your editor should be able to turn "add a recursive call" into a single command (basically the same as (a), just different stuff wrapped around it). A programming style using higher order procedures can eliminate a lot of this. (c) Repetitive patterns of code. A programming style using higher order procedures can eliminate a lot of this. There's a thing I find myself saying more and more often: Why can't I see the structure? I was reviewing a page or two of Prolog code for someone the other day. By the end of three hours, I'd made some progress, but I was troubled. The code was clean, but it wasn't OBVIOUS. What finally dawned on me would have been instantly obvious to a real functional programmer: the code was an interweaving of a "compute argmax of a partial function over a finite domain" and "here is this partial function". Actually introducing the higher order function in question let me explore several ways of implementing that *without* any effect on the rest of the code. Breaking the specific partial function out and naming it let me see that memoising *that* function -- which hadn't previously existed -- stood an excellent chance of reducing the overall cost of the algorithm down *hugely*. So I say, if you find yourself _wanting_ a method name to appear 40 times in a day's work, you are doing something badly wrong. For another data point, as part of building up my Smalltalk skills, I used to pick up Java code and rewrite it in Smalltalk. There were two invariable results: first, the code would shrink by about a factor of six, and second, it would become painfully obvious that the original code was really really bad design, and that in a *good* OO design, most of the classes wouldn't just shrink, they'd disappear. A good part of this is down to Smalltalk's support for and extensive use of higher order functions from day 1. > > 3) Syntax coloring. (VIM color codes a file so that is there, emacs I don't know AT ALL.) To which Steve Strong replied > I don?t know of any editor that doesn?t do this - > even github displays syntax colouring on erlang files. My own text editor doesn't do syntax colouring. Frankly, I hate syntax colouring. I could give you a long rant about why. One big issue is that the name is a lie. It's *lexical* colouring; the colour depends on what kind of token something is. But I can *see* that. If you offered me an editor where calls to functions whose definitions had been edited recently were brightly coloured, or where the functions imported from a particular module were brightly coloured, or where slicing was used to colour the places where a particular variable could be *changed* and *used*, I'd find that really really helpful. Why waste colour telling me something that is already obvious at a glance? I once came across a compiler (written in Finland) where several passes had had to be woven together because of the language it was written in, so they had coloured each declaration and statement according to which pass it was logically part of. Now _that's_ good use of colour! > From ok@REDACTED Fri Jan 31 05:56:57 2014 From: ok@REDACTED (Richard A. O'Keefe) Date: Fri, 31 Jan 2014 17:56:57 +1300 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: <5F373637-2C13-4A32-B984-1757FEBBCE29@cs.otago.ac.nz> I'd like to point out that static type systems are not always the help you might expect. Here's a puzzle from Jon Skeet's blog: using System; class X { static int M(Func x, object y) { return 1; } static int M(Func< X, byte> x, string y) { return 2; } const int Value = 1000; static void Main() { var a = M(X => (byte)X.Value, null)); unchecked { Console.WriteLine(a); Console.WriteLine(M(X => (byte)X.Value, null)); } } } The expression M(X => (byte)X.Value, null) is the same sequence of tokens in each case. The same identifiers are in scope. The output is 1 2 The explanation makes my head hurt. From kraythe@REDACTED Fri Jan 31 07:25:17 2014 From: kraythe@REDACTED (kraythe .) Date: Fri, 31 Jan 2014 00:25:17 -0600 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: Well I think after seeing the arguments and the response of the community I am trending seriously towards Erlang. I will probably make the mental investment to learn and become good with emacs. And then move on from there. I may still have a ton of questions. I would still, for example, love to know who to 'reload' my application once it is started. On Fri, Jan 31, 2014 at 12:24 AM, kraythe . wrote: > Well I think after seeing the arguments and the response of the community > I am trending seriously towards Erlang. I will probably make the mental > investment to learn and become good with emacs. And then move on from > there. I may still have a ton of questions. I would still, for example, > love to know who to 'reload' my application once it is started. > > *Robert Simmons Jr. MSc. - Lead Java Architect @ EA* > *Author of: Hardcore Java (2003) and Maintainable Java (2012)* > *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39 > * > > > On Thu, Jan 30, 2014 at 10:29 PM, Richard A. O'Keefe wrote: > >> >> On 31/01/2014, at 7:49 AM, Steve Strong wrote: >> > On Thursday, 30 January 2014 at 19:10, kraythe . wrote: >> >> 1) Code completion. Sorry but I can't be bothered to type the same >> flipping method name in its entirety 40 times. >> >> >> There are three causes for "completion" in languages like >> Prolog and Erlang: >> >> (a) Definitions with multiple clauses. >> Your editor should be able to turn "add a clause" into a >> single command. >> >> (b) Recursion. >> Your editor should be able to turn "add a recursive call" >> into a single command (basically the same as (a), just >> different stuff wrapped around it). >> >> A programming style using higher order procedures can >> eliminate a lot of this. >> >> (c) Repetitive patterns of code. >> >> A programming style using higher order procedures can >> eliminate a lot of this. >> >> There's a thing I find myself saying more and more often: >> >> Why can't I see the structure? >> >> I was reviewing a page or two of Prolog code for someone the >> other day. By the end of three hours, I'd made some progress, >> but I was troubled. The code was clean, but it wasn't OBVIOUS. >> What finally dawned on me would have been instantly obvious to >> a real functional programmer: the code was an interweaving of >> a "compute argmax of a partial function over a finite domain" >> and "here is this partial function". Actually introducing the >> higher order function in question let me explore several ways >> of implementing that *without* any effect on the rest of the >> code. Breaking the specific partial function out and naming >> it let me see that memoising *that* function -- which hadn't >> previously existed -- stood an excellent chance of reducing >> the overall cost of the algorithm down *hugely*. >> >> So I say, if you find yourself _wanting_ a method name to >> appear 40 times in a day's work, you are doing something >> badly wrong. >> >> For another data point, as part of building up my Smalltalk >> skills, I used to pick up Java code and rewrite it in Smalltalk. >> There were two invariable results: first, the code would >> shrink by about a factor of six, and second, it would become >> painfully obvious that the original code was really really >> bad design, and that in a *good* OO design, most of the >> classes wouldn't just shrink, they'd disappear. A good part >> of this is down to Smalltalk's support for and extensive use >> of higher order functions from day 1. >> >> > >> > 3) Syntax coloring. (VIM color codes a file so that is there, emacs I >> don't know AT ALL.) >> To which Steve Strong replied >> > I don't know of any editor that doesn't do this - >> > even github displays syntax colouring on erlang files. >> >> My own text editor doesn't do syntax colouring. >> Frankly, I hate syntax colouring. I could give you >> a long rant about why. One big issue is that the >> name is a lie. It's *lexical* colouring; the colour >> depends on what kind of token something is. But I >> can *see* that. If you offered me an editor where >> calls to functions whose definitions had been edited >> recently were brightly coloured, or where the functions >> imported from a particular module were brightly coloured, >> or where slicing was used to colour the places where a >> particular variable could be *changed* and *used*, I'd >> find that really really helpful. Why waste colour >> telling me something that is already obvious at a glance? >> I once came across a compiler (written in Finland) where >> several passes had had to be woven together because of >> the language it was written in, so they had coloured >> each declaration and statement according to which pass >> it was logically part of. Now _that's_ good use of colour! >> >> > >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.eugene.turner@REDACTED Fri Jan 31 07:50:04 2014 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Fri, 31 Jan 2014 15:50:04 +0900 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: One thing I've gotten out of this excellent thread: given what some people (but not Joe, I guess) want out of a programming environment, and what some people like in programming languages (Joe, for example), somebody should do an Erlide for Elixir. Regards, Michael Turner Executive Director Project Persephone K-1 bldg 3F 7-2-6 Nishishinjuku Shinjuku-ku Tokyo 160-0023 Tel: +81 (3) 6890-1140 Fax: +81 (3) 6890-1158 Mobile: +81 (90) 5203-8682 turner@REDACTED http://www.projectpersephone.org/ "Love does not consist in gazing at each other, but in looking outward together in the same direction." -- Antoine de Saint-Exup?ry On Fri, Jan 31, 2014 at 3:25 PM, kraythe . wrote: > Well I think after seeing the arguments and the response of the community I > am trending seriously towards Erlang. I will probably make the mental > investment to learn and become good with emacs. And then move on from there. > I may still have a ton of questions. I would still, for example, love to > know who to 'reload' my application once it is started. > > > On Fri, Jan 31, 2014 at 12:24 AM, kraythe . wrote: >> >> Well I think after seeing the arguments and the response of the community >> I am trending seriously towards Erlang. I will probably make the mental >> investment to learn and become good with emacs. And then move on from there. >> I may still have a ton of questions. I would still, for example, love to >> know who to 'reload' my application once it is started. >> >> Robert Simmons Jr. MSc. - Lead Java Architect @ EA >> Author of: Hardcore Java (2003) and Maintainable Java (2012) >> LinkedIn: http://www.linkedin.com/pub/robert-simmons/40/852/a39 >> >> >> On Thu, Jan 30, 2014 at 10:29 PM, Richard A. O'Keefe >> wrote: >>> >>> >>> On 31/01/2014, at 7:49 AM, Steve Strong wrote: >>> > On Thursday, 30 January 2014 at 19:10, kraythe . wrote: >>> >> 1) Code completion. Sorry but I can't be bothered to type the same >>> >> flipping method name in its entirety 40 times. >>> >>> >>> There are three causes for "completion" in languages like >>> Prolog and Erlang: >>> >>> (a) Definitions with multiple clauses. >>> Your editor should be able to turn "add a clause" into a >>> single command. >>> >>> (b) Recursion. >>> Your editor should be able to turn "add a recursive call" >>> into a single command (basically the same as (a), just >>> different stuff wrapped around it). >>> >>> A programming style using higher order procedures can >>> eliminate a lot of this. >>> >>> (c) Repetitive patterns of code. >>> >>> A programming style using higher order procedures can >>> eliminate a lot of this. >>> >>> There's a thing I find myself saying more and more often: >>> >>> Why can't I see the structure? >>> >>> I was reviewing a page or two of Prolog code for someone the >>> other day. By the end of three hours, I'd made some progress, >>> but I was troubled. The code was clean, but it wasn't OBVIOUS. >>> What finally dawned on me would have been instantly obvious to >>> a real functional programmer: the code was an interweaving of >>> a "compute argmax of a partial function over a finite domain" >>> and "here is this partial function". Actually introducing the >>> higher order function in question let me explore several ways >>> of implementing that *without* any effect on the rest of the >>> code. Breaking the specific partial function out and naming >>> it let me see that memoising *that* function -- which hadn't >>> previously existed -- stood an excellent chance of reducing >>> the overall cost of the algorithm down *hugely*. >>> >>> So I say, if you find yourself _wanting_ a method name to >>> appear 40 times in a day's work, you are doing something >>> badly wrong. >>> >>> For another data point, as part of building up my Smalltalk >>> skills, I used to pick up Java code and rewrite it in Smalltalk. >>> There were two invariable results: first, the code would >>> shrink by about a factor of six, and second, it would become >>> painfully obvious that the original code was really really >>> bad design, and that in a *good* OO design, most of the >>> classes wouldn't just shrink, they'd disappear. A good part >>> of this is down to Smalltalk's support for and extensive use >>> of higher order functions from day 1. >>> >>> > >>> > 3) Syntax coloring. (VIM color codes a file so that is there, emacs I >>> > don't know AT ALL.) >>> To which Steve Strong replied >>> > I don't know of any editor that doesn't do this - >>> > even github displays syntax colouring on erlang files. >>> >>> My own text editor doesn't do syntax colouring. >>> Frankly, I hate syntax colouring. I could give you >>> a long rant about why. One big issue is that the >>> name is a lie. It's *lexical* colouring; the colour >>> depends on what kind of token something is. But I >>> can *see* that. If you offered me an editor where >>> calls to functions whose definitions had been edited >>> recently were brightly coloured, or where the functions >>> imported from a particular module were brightly coloured, >>> or where slicing was used to colour the places where a >>> particular variable could be *changed* and *used*, I'd >>> find that really really helpful. Why waste colour >>> telling me something that is already obvious at a glance? >>> I once came across a compiler (written in Finland) where >>> several passes had had to be woven together because of >>> the language it was written in, so they had coloured >>> each declaration and statement according to which pass >>> it was logically part of. Now _that's_ good use of colour! >>> >>> > >> >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From erlang@REDACTED Fri Jan 31 08:12:04 2014 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 31 Jan 2014 08:12:04 +0100 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: Message-ID: Let me pitch a silly idea at you. Why don't we just use gen_tcp and interact with 0MQ peers using the wire-line protocol. Erlang is good at getting data in and out of sockets, and good at parsing binary packets. This method is safe and efficient. I mailed Pieter Hintjens about this and he thought this was perfectly doable. I'm not suggesting implementing all the protocols and transports to start with just the REQ - REP protocols of TCP Pieter suggest looking at https://github.com/zeromq/zmtp https://github.com/zeromq/libzmq/blob/master/tests/test_stream.cpp These implement the wire-line protocol on top of tcp rather than through the 0mz library so its easier to see whats going on. Now I haven't a clue if this is a silly idea or not - but a few hours tinkering should be enough to implement the REQ-REP protocols and make some performance measurements - and that would tell me if it's worth implementing more protocols and transports. The difficulty of this is not writing the code - but understanding the wire-line protocol but I think Pieter has done a good job here, there are a load of RFCs at the 0MQ web site. ( actually all I want to do is get Erlang talking to Julia - Julia speaks 0MQ and I found that I couldn't build the Erlang 0MQ bindings with the latest 0MQ - so I'm again back to "fixing stuff thats broken" in order to do what I want. I don't really want to have to re-implement the 0MQ wire-line protocol to do this - but it does seem easier than fixing up the broken library and maintaining it (I guess it's easier since I only need a fraction of the entire protocol)) Comments /Joe On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith wrote: > On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong wrote: > > Is anybody working on upgrading the 0MQ libraries for erlang to > > the latest version of 0QM. > > I would be tempted to upgrade them, but I've wanted to have an > external C port implementation of the 0MQ bindings for a while and so > created this: > > https://github.com/gar1t/erlang-czmq > > In my three years of experience with the 0MQ bindings, it's been > (historically) very easy to crash the Erlang VM. For my applications, > speed will never justify the cost of taking an entire node down. The > CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10 > times slower). I'm sure they can be made much faster, but my thinking > is that running multiple external ports could alleviate this. > > Speed kills. > > This code is not running in production, but it will be soon. > > The CZMQ API in my opinion is the right target for new 0MQ bindings, > regardless of how they're implemented. Pieter Hintjen's rationale for > writing CZMQ is here: > > https://github.com/zeromq/czmq#scope-and-goals > > Garrett > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Fri Jan 31 08:28:30 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 31 Jan 2014 08:28:30 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: On Fri, Jan 31, 2014 at 7:50 AM, Michael Turner < michael.eugene.turner@REDACTED> wrote: > One thing I've gotten out of this excellent thread: given what some > people (but not Joe, I guess) want out of a programming environment, > and what some people like in programming languages (Joe, for example), > somebody should do an Erlide for Elixir. > That's on my list too, but so far there are other things with higher priority. The good news is that many things can be shared with the Erlang support. regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Fri Jan 31 08:45:36 2014 From: bchesneau@REDACTED (Benoit Chesneau) Date: Fri, 31 Jan 2014 08:45:36 +0100 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: Message-ID: On Fri, Jan 31, 2014 at 8:12 AM, Joe Armstrong wrote: > Let me pitch a silly idea at you. > > Why don't we just use gen_tcp and interact with 0MQ peers using the > wire-line protocol. Erlang is good at getting data in and out of sockets, > and good at parsing binary packets. > > This method is safe and efficient. I mailed Pieter Hintjens about this > and he thought this was perfectly doable. > > I'm not suggesting implementing all the protocols and transports to start > with > just the REQ - REP protocols of TCP > > Pieter suggest looking at > > https://github.com/zeromq/zmtp > https://github.com/zeromq/libzmq/blob/master/tests/test_stream.cpp > > These implement the wire-line protocol on top of tcp rather than through > the > 0mz library so its easier to see whats going on. > > Now I haven't a clue if this is a silly idea or not - but a few hours > tinkering > should be enough to implement the REQ-REP protocols and make some > performance > measurements - and that would tell me if it's worth implementing more > protocols > and transports. > > The difficulty of this is not writing the code - but understanding the > wire-line protocol > but I think Pieter has done a good job here, there are a load of RFCs at > the 0MQ web site. > > ( actually all I want to do is get Erlang talking to Julia - Julia speaks > 0MQ and I found that I > couldn't build the Erlang 0MQ bindings with the latest 0MQ - so I'm again > back to > "fixing stuff thats broken" in order to do what I want. I don't really > want to have to re-implement > the 0MQ wire-line protocol to do this - but it does seem easier than > fixing up the broken library > and maintaining it (I guess it's easier since I only need a fraction of > the entire protocol)) > > Comments > > /Joe > > gen_zmq was doing that but it wasn't update since a long time: https://github.com/RoadRunnr/gen_zmq Maybe a good start? - benoit > > > On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith wrote: > >> On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong wrote: >> > Is anybody working on upgrading the 0MQ libraries for erlang to >> > the latest version of 0QM. >> >> I would be tempted to upgrade them, but I've wanted to have an >> external C port implementation of the 0MQ bindings for a while and so >> created this: >> >> https://github.com/gar1t/erlang-czmq >> >> In my three years of experience with the 0MQ bindings, it's been >> (historically) very easy to crash the Erlang VM. For my applications, >> speed will never justify the cost of taking an entire node down. The >> CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10 >> times slower). I'm sure they can be made much faster, but my thinking >> is that running multiple external ports could alleviate this. >> >> Speed kills. >> >> This code is not running in production, but it will be soon. >> >> The CZMQ API in my opinion is the right target for new 0MQ bindings, >> regardless of how they're implemented. Pieter Hintjen's rationale for >> writing CZMQ is here: >> >> https://github.com/zeromq/czmq#scope-and-goals >> >> Garrett >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Fri Jan 31 08:49:40 2014 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 31 Jan 2014 08:49:40 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: On Fri, Jan 31, 2014 at 7:50 AM, Michael Turner < michael.eugene.turner@REDACTED> wrote: > One thing I've gotten out of this excellent thread: given what some > people (but not Joe, I guess) want out of a programming environment, > What I want in a programming environment would take a book to describe. For starters, I would like it to be precisely documented. It should be textual not GUI based - the reason for this is automation - I cannot easily automate things if they are GUI based. I can automate things if they are text based. Also It's very difficult to describe what to do in a GUI - the descriptions need pictures to tell you what to do. I currently think Knuth was right. The version numbering of TeX (using successive digits of Pi) is brilliant TeX it at version 3.14159265 - Knuth also pays a reward (in cash) for every new bug. The reward doubles for each new error. This scheme means that the project will be abandoned if there are more then 15 or so bugs - because the version number would be too long, and the cost too great - and it probably should be abandoned if it had this number of errors. Knuths way of working - Literate programming - with patch files - enforces an incredibly disciplined way of working. TeX (as a literate program) is just about the only example I know of a large complex program that is understandable and has no known errors. TeX was produced without fancy editors and revision control systems and IDEs and all that stuff. The only downside of Knuths way is that it takes a long time to write the program. At a guess 80% of software costs are in maintenance of legacy code - so in the long term Knuthian development pays off. Being early to market with buggy software is however the way to make money. What earns you most money in the short term costs you most in the long term. TeX is interesting in a sense that (say) eclipse is not. I feel it is possible to learn how TeX works (aside I have started on this journey "Hello \end" is a minimal TeX program that I can understand. All I need to do is understand what the primitives do, and then how the macro expansion works, ... ) There is no way I can understand something like eclipse - there is no documentation of what it does and how it works - only documentation of how to use it. I only like doing things I can understand. emacs is in the TeX category - I can "in principle" read the code and see what it does (another aside - reading code to see what it does is highly overrated - reading my own code that I wrote years ago is difficult - reading other peoples code is doubly difficult - reading undocumented code in a language I don't really understand to fix a bug that I didn't want to fix into order to solve a problem that I do want to solve is an incredible waste of time - and that's why I like Kuthian rigour in software) Nowhere have I said that this is easy - but I believe that IDEs etc make matters worse by hiding what should not be hidden. If it's such a mess that it needs tool support to write then the solution is to clean up the mess not provide tools to hide the mess. As I said - I could write a book on this :-) Cheers /Joe > and what some people like in programming languages (Joe, for example), > somebody should do an Erlide for Elixir. > > Regards, > Michael Turner > Executive Director > Project Persephone > K-1 bldg 3F > 7-2-6 Nishishinjuku > Shinjuku-ku Tokyo 160-0023 > Tel: +81 (3) 6890-1140 > Fax: +81 (3) 6890-1158 > Mobile: +81 (90) 5203-8682 > turner@REDACTED > http://www.projectpersephone.org/ > > "Love does not consist in gazing at each other, but in looking outward > together in the same direction." -- Antoine de Saint-Exup?ry > > > On Fri, Jan 31, 2014 at 3:25 PM, kraythe . wrote: > > Well I think after seeing the arguments and the response of the > community I > > am trending seriously towards Erlang. I will probably make the mental > > investment to learn and become good with emacs. And then move on from > there. > > I may still have a ton of questions. I would still, for example, love to > > know who to 'reload' my application once it is started. > > > > > > On Fri, Jan 31, 2014 at 12:24 AM, kraythe . wrote: > >> > >> Well I think after seeing the arguments and the response of the > community > >> I am trending seriously towards Erlang. I will probably make the mental > >> investment to learn and become good with emacs. And then move on from > there. > >> I may still have a ton of questions. I would still, for example, love to > >> know who to 'reload' my application once it is started. > >> > >> Robert Simmons Jr. MSc. - Lead Java Architect @ EA > >> Author of: Hardcore Java (2003) and Maintainable Java (2012) > >> LinkedIn: http://www.linkedin.com/pub/robert-simmons/40/852/a39 > >> > >> > >> On Thu, Jan 30, 2014 at 10:29 PM, Richard A. O'Keefe > > >> wrote: > >>> > >>> > >>> On 31/01/2014, at 7:49 AM, Steve Strong wrote: > >>> > On Thursday, 30 January 2014 at 19:10, kraythe . wrote: > >>> >> 1) Code completion. Sorry but I can't be bothered to type the same > >>> >> flipping method name in its entirety 40 times. > >>> > >>> > >>> There are three causes for "completion" in languages like > >>> Prolog and Erlang: > >>> > >>> (a) Definitions with multiple clauses. > >>> Your editor should be able to turn "add a clause" into a > >>> single command. > >>> > >>> (b) Recursion. > >>> Your editor should be able to turn "add a recursive call" > >>> into a single command (basically the same as (a), just > >>> different stuff wrapped around it). > >>> > >>> A programming style using higher order procedures can > >>> eliminate a lot of this. > >>> > >>> (c) Repetitive patterns of code. > >>> > >>> A programming style using higher order procedures can > >>> eliminate a lot of this. > >>> > >>> There's a thing I find myself saying more and more often: > >>> > >>> Why can't I see the structure? > >>> > >>> I was reviewing a page or two of Prolog code for someone the > >>> other day. By the end of three hours, I'd made some progress, > >>> but I was troubled. The code was clean, but it wasn't OBVIOUS. > >>> What finally dawned on me would have been instantly obvious to > >>> a real functional programmer: the code was an interweaving of > >>> a "compute argmax of a partial function over a finite domain" > >>> and "here is this partial function". Actually introducing the > >>> higher order function in question let me explore several ways > >>> of implementing that *without* any effect on the rest of the > >>> code. Breaking the specific partial function out and naming > >>> it let me see that memoising *that* function -- which hadn't > >>> previously existed -- stood an excellent chance of reducing > >>> the overall cost of the algorithm down *hugely*. > >>> > >>> So I say, if you find yourself _wanting_ a method name to > >>> appear 40 times in a day's work, you are doing something > >>> badly wrong. > >>> > >>> For another data point, as part of building up my Smalltalk > >>> skills, I used to pick up Java code and rewrite it in Smalltalk. > >>> There were two invariable results: first, the code would > >>> shrink by about a factor of six, and second, it would become > >>> painfully obvious that the original code was really really > >>> bad design, and that in a *good* OO design, most of the > >>> classes wouldn't just shrink, they'd disappear. A good part > >>> of this is down to Smalltalk's support for and extensive use > >>> of higher order functions from day 1. > >>> > >>> > > >>> > 3) Syntax coloring. (VIM color codes a file so that is there, emacs I > >>> > don't know AT ALL.) > >>> To which Steve Strong replied > >>> > I don't know of any editor that doesn't do this - > >>> > even github displays syntax colouring on erlang files. > >>> > >>> My own text editor doesn't do syntax colouring. > >>> Frankly, I hate syntax colouring. I could give you > >>> a long rant about why. One big issue is that the > >>> name is a lie. It's *lexical* colouring; the colour > >>> depends on what kind of token something is. But I > >>> can *see* that. If you offered me an editor where > >>> calls to functions whose definitions had been edited > >>> recently were brightly coloured, or where the functions > >>> imported from a particular module were brightly coloured, > >>> or where slicing was used to colour the places where a > >>> particular variable could be *changed* and *used*, I'd > >>> find that really really helpful. Why waste colour > >>> telling me something that is already obvious at a glance? > >>> I once came across a compiler (written in Finland) where > >>> several passes had had to be woven together because of > >>> the language it was written in, so they had coloured > >>> each declaration and statement according to which pass > >>> it was logically part of. Now _that's_ good use of colour! > >>> > >>> > > >> > >> > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Fri Jan 31 08:53:17 2014 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 31 Jan 2014 08:53:17 +0100 Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: Message-ID: Yes - Google didn't suggest this. Did anybody do any performance measurements on this? /Joe On Fri, Jan 31, 2014 at 8:45 AM, Benoit Chesneau wrote: > > > > On Fri, Jan 31, 2014 at 8:12 AM, Joe Armstrong wrote: > >> Let me pitch a silly idea at you. >> >> Why don't we just use gen_tcp and interact with 0MQ peers using the >> wire-line protocol. Erlang is good at getting data in and out of sockets, >> and good at parsing binary packets. >> >> This method is safe and efficient. I mailed Pieter Hintjens about this >> and he thought this was perfectly doable. >> >> I'm not suggesting implementing all the protocols and transports to start >> with >> just the REQ - REP protocols of TCP >> >> Pieter suggest looking at >> >> https://github.com/zeromq/zmtp >> https://github.com/zeromq/libzmq/blob/master/tests/test_stream.cpp >> >> These implement the wire-line protocol on top of tcp rather than through >> the >> 0mz library so its easier to see whats going on. >> >> Now I haven't a clue if this is a silly idea or not - but a few hours >> tinkering >> should be enough to implement the REQ-REP protocols and make some >> performance >> measurements - and that would tell me if it's worth implementing more >> protocols >> and transports. >> >> The difficulty of this is not writing the code - but understanding the >> wire-line protocol >> but I think Pieter has done a good job here, there are a load of RFCs at >> the 0MQ web site. >> >> ( actually all I want to do is get Erlang talking to Julia - Julia speaks >> 0MQ and I found that I >> couldn't build the Erlang 0MQ bindings with the latest 0MQ - so I'm again >> back to >> "fixing stuff thats broken" in order to do what I want. I don't really >> want to have to re-implement >> the 0MQ wire-line protocol to do this - but it does seem easier than >> fixing up the broken library >> and maintaining it (I guess it's easier since I only need a fraction of >> the entire protocol)) >> >> Comments >> >> /Joe >> >> > gen_zmq was doing that but it wasn't update since a long time: > > https://github.com/RoadRunnr/gen_zmq > > Maybe a good start? > > - benoit > > >> >> >> On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith wrote: >> >>> On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong wrote: >>> > Is anybody working on upgrading the 0MQ libraries for erlang to >>> > the latest version of 0QM. >>> >>> I would be tempted to upgrade them, but I've wanted to have an >>> external C port implementation of the 0MQ bindings for a while and so >>> created this: >>> >>> https://github.com/gar1t/erlang-czmq >>> >>> In my three years of experience with the 0MQ bindings, it's been >>> (historically) very easy to crash the Erlang VM. For my applications, >>> speed will never justify the cost of taking an entire node down. The >>> CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10 >>> times slower). I'm sure they can be made much faster, but my thinking >>> is that running multiple external ports could alleviate this. >>> >>> Speed kills. >>> >>> This code is not running in production, but it will be soon. >>> >>> The CZMQ API in my opinion is the right target for new 0MQ bindings, >>> regardless of how they're implemented. Pieter Hintjen's rationale for >>> writing CZMQ is here: >>> >>> https://github.com/zeromq/czmq#scope-and-goals >>> >>> Garrett >>> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Fri Jan 31 09:44:54 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Fri, 31 Jan 2014 09:44:54 +0100 (CET) Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: Message-ID: <629555314.52646.1391157894357.JavaMail.zimbra@tpip.net> Hi, I have a pure Erlang implementation that is based on zMQ v2 at https://github.com/RoadRunnr/gen_zmq It is more of a POC and might not even build right now since some the dependencies have evolved. I got stuck when trying to control the queuing behavior on tcp socket, gen_tcp hides too much details of the underlying socket and the buffering in it also doesn't help. Andreas ----- Original Message ----- > Is anybody working on upgrading the 0MQ libraries for erlang to > the latest version of 0QM. > > /Joe > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- -- Dipl. Inform. Andreas Schultz From aschultz@REDACTED Fri Jan 31 09:47:41 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Fri, 31 Jan 2014 09:47:41 +0100 (CET) Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: Message-ID: <2029482514.52715.1391158061241.JavaMail.zimbra@tpip.net> Hi, ----- Original Message ----- > Yes - Google didn't suggest this. > > Did anybody do any performance measurements on this? Not yet, didn't have time for it :-( Andreas > > /Joe > > > On Fri, Jan 31, 2014 at 8:45 AM, Benoit Chesneau < bchesneau@REDACTED > > wrote: > > > > > > > On Fri, Jan 31, 2014 at 8:12 AM, Joe Armstrong < erlang@REDACTED > wrote: > > > > Let me pitch a silly idea at you. > > Why don't we just use gen_tcp and interact with 0MQ peers using the > wire-line protocol. Erlang is good at getting data in and out of sockets, > and good at parsing binary packets. > > This method is safe and efficient. I mailed Pieter Hintjens about this > and he thought this was perfectly doable. > > I'm not suggesting implementing all the protocols and transports to start > with > just the REQ - REP protocols of TCP > > Pieter suggest looking at > > https://github.com/zeromq/zmtp > https://github.com/zeromq/libzmq/blob/master/tests/test_stream.cpp > > These implement the wire-line protocol on top of tcp rather than through the > 0mz library so its easier to see whats going on. > > Now I haven't a clue if this is a silly idea or not - but a few hours > tinkering > should be enough to implement the REQ-REP protocols and make some performance > measurements - and that would tell me if it's worth implementing more > protocols > and transports. > > The difficulty of this is not writing the code - but understanding the > wire-line protocol > but I think Pieter has done a good job here, there are a load of RFCs at the > 0MQ web site. > > ( actually all I want to do is get Erlang talking to Julia - Julia speaks 0MQ > and I found that I > couldn't build the Erlang 0MQ bindings with the latest 0MQ - so I'm again > back to > "fixing stuff thats broken" in order to do what I want. I don't really want > to have to re-implement > the 0MQ wire-line protocol to do this - but it does seem easier than fixing > up the broken library > and maintaining it (I guess it's easier since I only need a fraction of the > entire protocol)) > > Comments > > /Joe > > > gen_zmq was doing that but it wasn't update since a long time: > > https://github.com/RoadRunnr/gen_zmq > > Maybe a good start? > > - benoit > > > > > > On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith < g@REDACTED > wrote: > > > > On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong < erlang@REDACTED > wrote: > > Is anybody working on upgrading the 0MQ libraries for erlang to > > the latest version of 0QM. > > I would be tempted to upgrade them, but I've wanted to have an > external C port implementation of the 0MQ bindings for a while and so > created this: > > https://github.com/gar1t/erlang-czmq > > In my three years of experience with the 0MQ bindings, it's been > (historically) very easy to crash the Erlang VM. For my applications, > speed will never justify the cost of taking an entire node down. The > CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10 > times slower). I'm sure they can be made much faster, but my thinking > is that running multiple external ports could alleviate this. > > Speed kills. > > This code is not running in production, but it will be soon. > > The CZMQ API in my opinion is the right target for new 0MQ bindings, > regardless of how they're implemented. Pieter Hintjen's rationale for > writing CZMQ is here: > > https://github.com/zeromq/czmq#scope-and-goals > > Garrett > > > _______________________________________________ > 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 > -- -- Dipl. Inform. Andreas Schultz email: as@REDACTED phone: +49-391-819099-224 mobil: +49-170-2226073 ------------------- enabling your networks ------------------- Travelping GmbH phone: +49-391-819099229 Roentgenstr. 13 fax: +49-391-819099299 D-39108 Magdeburg email: info@REDACTED GERMANY web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 -------------------------------------------------------------- From aschultz@REDACTED Fri Jan 31 10:28:07 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Fri, 31 Jan 2014 10:28:07 +0100 (CET) Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: Message-ID: <1877364547.52882.1391160487524.JavaMail.zimbra@tpip.net> BTW: We have a small workshop with Pieter Hintjens on Feb, 10th in Berlin on exactly how to best support 0MQ in Erlang for our own projects. Depending on the outcome, this will most likely mean that we are going to upgrade gen_zmq to the latest zmtp wire protocol. Andreas ----- Original Message ----- > > > > On Fri, Jan 31, 2014 at 8:12 AM, Joe Armstrong < erlang@REDACTED > wrote: > > > > Let me pitch a silly idea at you. > > Why don't we just use gen_tcp and interact with 0MQ peers using the > wire-line protocol. Erlang is good at getting data in and out of sockets, > and good at parsing binary packets. > > This method is safe and efficient. I mailed about this > and he thought this was perfectly doable. > > I'm not suggesting implementing all the protocols and transports to start > with > just the REQ - REP protocols of TCP > > Pieter suggest looking at > > https://github.com/zeromq/zmtp > https://github.com/zeromq/libzmq/blob/master/tests/test_stream.cpp > > These implement the wire-line protocol on top of tcp rather than through the > 0mz library so its easier to see whats going on. > > Now I haven't a clue if this is a silly idea or not - but a few hours > tinkering > should be enough to implement the REQ-REP protocols and make some performance > measurements - and that would tell me if it's worth implementing more > protocols > and transports. > > The difficulty of this is not writing the code - but understanding the > wire-line protocol > but I think Pieter has done a good job here, there are a load of RFCs at the > 0MQ web site. > > ( actually all I want to do is get Erlang talking to Julia - Julia speaks 0MQ > and I found that I > couldn't build the Erlang 0MQ bindings with the latest 0MQ - so I'm again > back to > "fixing stuff thats broken" in order to do what I want. I don't really want > to have to re-implement > the 0MQ wire-line protocol to do this - but it does seem easier than fixing > up the broken library > and maintaining it (I guess it's easier since I only need a fraction of the > entire protocol)) > > Comments > > /Joe > > > gen_zmq was doing that but it wasn't update since a long time: > > https://github.com/RoadRunnr/gen_zmq > > Maybe a good start? > > - benoit > > > > > > On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith < g@REDACTED > wrote: > > > > On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong < erlang@REDACTED > wrote: > > Is anybody working on upgrading the 0MQ libraries for erlang to > > the latest version of 0QM. > > I would be tempted to upgrade them, but I've wanted to have an > external C port implementation of the 0MQ bindings for a while and so > created this: > > https://github.com/gar1t/erlang-czmq > > In my three years of experience with the 0MQ bindings, it's been > (historically) very easy to crash the Erlang VM. For my applications, > speed will never justify the cost of taking an entire node down. The > CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10 > times slower). I'm sure they can be made much faster, but my thinking > is that running multiple external ports could alleviate this. > > Speed kills. > > This code is not running in production, but it will be soon. > > The CZMQ API in my opinion is the right target for new 0MQ bindings, > regardless of how they're implemented. Pieter Hintjen's rationale for > writing CZMQ is here: > > https://github.com/zeromq/czmq#scope-and-goals > > Garrett > > > _______________________________________________ > 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 > -- -- Dipl. Inform. Andreas Schultz From magnus@REDACTED Fri Jan 31 11:30:40 2014 From: magnus@REDACTED (Magnus Henoch) Date: Fri, 31 Jan 2014 10:30:40 +0000 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: (Richard A. O'Keefe's message of "Fri, 31 Jan 2014 17:29:19 +1300") References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: "Richard A. O'Keefe" writes: >> 3) Syntax coloring. (VIM color codes a file so that is there, emacs I don't know AT ALL.) > To which Steve Strong replied >> I don?t know of any editor that doesn?t do this - >> even github displays syntax colouring on erlang files. > > My own text editor doesn't do syntax colouring. > Frankly, I hate syntax colouring. I could give you > a long rant about why. One big issue is that the > name is a lie. It's *lexical* colouring; the colour > depends on what kind of token something is. But I > can *see* that. If you offered me an editor where > calls to functions whose definitions had been edited > recently were brightly coloured, or where the functions > imported from a particular module were brightly coloured, > or where slicing was used to colour the places where a > particular variable could be *changed* and *used*, I'd > find that really really helpful. Why waste colour > telling me something that is already obvious at a glance? > [...] I feel I should mention, in case any Emacs users missed it, that the Emacs Erlang mode recently took a small step in this direction. It is now possible to have different colours for the function name in a function definition depending on whether the function is exported or not (though the default settings use the same colour for both cases). Set erlang-font-lock-exported-function-name-face to suit your taste. Regards, Magnus From vladdu55@REDACTED Fri Jan 31 11:40:21 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 31 Jan 2014 11:40:21 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: Hi Joe, On Fri, Jan 31, 2014 at 8:49 AM, Joe Armstrong wrote: > On Fri, Jan 31, 2014 at 7:50 AM, Michael Turner < > michael.eugene.turner@REDACTED> wrote: > >> One thing I've gotten out of this excellent thread: given what some >> people (but not Joe, I guess) want out of a programming environment, >> > > What I want in a programming environment would take a book to describe. > > For starters, I would like it to be precisely documented. > > It should be textual not GUI based - the reason for this is automation - I > cannot > easily automate things if they are GUI based. I can automate things if > they are text based. > Also It's very difficult to describe what to do in a GUI - the > descriptions need pictures > to tell you what to do. > > I currently think Knuth was right. > With all due respect to you and Donald Knuth, there is something in your text (above and below) that makes me feel confused. Maybe it's just me and then it's ok (for the rest of the world, at least), but maybe not. I don't know if I will be able to express what this confusion is about, but I will try. Maybe you meant something else than I understood and I'd love to get it right. It got a bit long, sorry about that. Look for "****" for the TL;DR --- Why does automating something have anything to do with that thing being textual or graphical? vim runs in a console, but also as gVim (graphical). The same can be said about emacs and XEmacs. Eclipse can be run in headless mode (but I admit that there are rather few tools that work in that mode). To me, a tool can be automatable at two levels: it can be run from the command line and it might return meaningful data that some other tool can process further. I don't see what this has anything to do with the tool being textual or graphical. These parts are just the presentation layer... Whether we want it or not, to the human brain images are lower level than text or speech. We can't read text files directly, we interpret the graphical representation of that text, be it on a console or a window. Some people can handle abstractions in their heads more easily than others. The latter category will need help, possibly in the form of tools to visualize the code (or whatever). If you are from the former category, more power to you, but that doesn't mean that it works for all people. It feels a bit like Usain Bolt saying "Bicycles? They are utterly useless, I can run faster than that and it's better to one's health". In my opinion, what a programming environment brings to the table is multiple ways to look at the code, to quickly see what is going on. It also provides a toolbox of utilities that can be used to process the code. I find it largely irrelevant if the environment is a GUI or not, I only need it to give me the information I need in the format that is best suited for me. It's the same kind of help one gets from a debugger: one could run the code in one's head and look for where the problem is, but it's much more effective with a tool that shows the system's exact state, not to mention that one can ask for a colleague or two to look at it. Taking a TeX example, wouldn't you find it helpful to have a window alongside your editor that show in real time how the document is rendered, without the need to run "tex mydoc.tex | pdfview&" (or whatever) yourself once in a while? Once you start to use more and more complicated macros, wouldn't be useful to be able to see the documentation for these, maybe to be able choose between a couple of similarly named ones? Or in Erlang (and doing some wishful thinking), wouldn't it be useful if one could actually _see_ in real time the network of processes in a node, how they are linked/monitoring each other, how they communicate, which ones are growing large or seem deadlocked, zoom out for a bird-eye view or in for details? Or more realistically, running some tests and get diagrams of the process communication, where selecting a message could show details and the code where it is sent and received? In my humble opinion, it sure would beat scrolling through wades of logs and code... As a user, one shouldn't need to understand how the environment works (you think Eclipse is complex, I think Emacs is; it's a matter of what we are accustomed to). Of course, this changes when I need to do something that the environment doesn't support. But even so, there is always the fallback of doing it as if no IDE was available, so I don't think that having an IDE can make things worse. That said, existing IDEs have widely different pros and cons, weaknesses and strengths. None is perfect and one of the main reasons that none can be perfect for everybody is that each developer has different needs and expectations. Make it too narrow and only few will use it. Make it too broad and the plethora of setting to tweak will make most people ignore them (thus the development effort is wasted). **** My vision for an IDE is that there should be a core of (narrow) tools cooperating to provide a broad functionality for processing source code and delivering useful data from the code base, tools that are agnostic of any way of interacting with it or of presenting the results. Think of it as syntax_tools on super-steroids. These tools can then be used by emacs, or Eclipse, or vim, or from scripts, or whatever. I am aiming for that with erlide, but it's a long way to go. **** --- Knuth could do this amazing thing with TeX (practically no bugs) for all the reasons you stated, but also because he set very strict boundaries for what TeX is and can do. Basically, he not only froze the specifications, he set them in stone. If that would have been enough, would there have been a need for XeTeX, pdfTeX, laTeX and other tools that extend and improve the basic TeX? Would it have been possible to keep the bug levels as low if these extensions and improvements had been part of the core TeX? Your example of "hello \end" being easy to understand is misleading. So is "echo 'hello'" or "printf 'hello'" or "System.out.println("hello");" (the latter with some boilerplate removed). What is interesting is whether a real-life example is easy to understand. You say "it's just a matter of understanding what the primitives do", but isn't this exactly the difficult part with everything? "Just understanding" might mean a lot of work and time and effort... Given a complex document typeset in plain TeX (i.e without any macro libraries and containing Unicode text), the code is going quickly to get more that one can hold in one's head and I doubt that it's going to be just as easy to understand, even if one would understand perfectly what each primitive does. I venture to state that it would probably be just as easy or difficult as it would be for any well-designed programming language. As a matter of fact, because TeX macros can define their own syntax too, it might make the result more difficult to read (given that not all macros are written by Donald Knuth himself). best regards, Vlad > The version numbering of TeX (using successive digits of Pi) is brilliant > TeX it at version 3.14159265 - Knuth also pays a reward (in cash) for > every new bug. The reward > doubles for each new error. > > This scheme means that the project will be abandoned if there are more > then 15 or so bugs - because the > version number would be too long, and the cost too great - and it probably > should be abandoned > if it had this number of errors. > > Knuths way of working - Literate programming - with patch files - enforces > an incredibly disciplined way > of working. TeX (as a literate program) is just about the only example I > know of a large complex program > that is understandable and has no known errors. > > TeX was produced without fancy editors and revision control systems and > IDEs and all that stuff. > > The only downside of Knuths way is that it takes a long time to write the > program. > > At a guess 80% of software costs are in maintenance of legacy code - so in > the long term > Knuthian development pays off. Being early to market with buggy software > is however the > way to make money. What earns you most money in the short term costs you > most in the long term. > > TeX is interesting in a sense that (say) eclipse is not. I feel it is > possible to learn how TeX works > > (aside I have started on this journey > "Hello \end" > is a minimal TeX program that I can understand. All I need to do is > understand what > the primitives do, and then how the macro expansion works, ... > ) > > There is no way I can understand something like eclipse - there is no > documentation of what it does and how > it works - only documentation of how to use it. > > I only like doing things I can understand. > > emacs is in the TeX category - I can "in principle" read the code and see > what it does > > (another aside - reading code to see what it does is highly overrated - > reading my own code > that I wrote years ago is difficult - reading other peoples code is doubly > difficult - reading undocumented > code in a language I don't really understand to fix a bug that I didn't > want to fix into order to solve a problem > that I do want to solve is an incredible waste of time - and that's why I > like Kuthian rigour in software) > > Nowhere have I said that this is easy - but I believe that IDEs etc make > matters worse by hiding > what should not be hidden. If it's such a mess that it needs tool support > to write then the solution is > to clean up the mess not provide tools to hide the mess. > > As I said - I could write a book on this :-) > > Cheers > > /Joe > > >> and what some people like in programming languages (Joe, for example), >> somebody should do an Erlide for Elixir. >> >> Regards, >> Michael Turner >> Executive Director >> Project Persephone >> K-1 bldg 3F >> 7-2-6 Nishishinjuku >> Shinjuku-ku Tokyo 160-0023 >> Tel: +81 (3) 6890-1140 >> Fax: +81 (3) 6890-1158 >> Mobile: +81 (90) 5203-8682 >> turner@REDACTED >> http://www.projectpersephone.org/ >> >> "Love does not consist in gazing at each other, but in looking outward >> together in the same direction." -- Antoine de Saint-Exup?ry >> >> >> On Fri, Jan 31, 2014 at 3:25 PM, kraythe . wrote: >> > Well I think after seeing the arguments and the response of the >> community I >> > am trending seriously towards Erlang. I will probably make the mental >> > investment to learn and become good with emacs. And then move on from >> there. >> > I may still have a ton of questions. I would still, for example, love to >> > know who to 'reload' my application once it is started. >> > >> > >> > On Fri, Jan 31, 2014 at 12:24 AM, kraythe . wrote: >> >> >> >> Well I think after seeing the arguments and the response of the >> community >> >> I am trending seriously towards Erlang. I will probably make the mental >> >> investment to learn and become good with emacs. And then move on from >> there. >> >> I may still have a ton of questions. I would still, for example, love >> to >> >> know who to 'reload' my application once it is started. >> >> >> >> Robert Simmons Jr. MSc. - Lead Java Architect @ EA >> >> Author of: Hardcore Java (2003) and Maintainable Java (2012) >> >> LinkedIn: http://www.linkedin.com/pub/robert-simmons/40/852/a39 >> >> >> >> >> >> On Thu, Jan 30, 2014 at 10:29 PM, Richard A. O'Keefe < >> ok@REDACTED> >> >> wrote: >> >>> >> >>> >> >>> On 31/01/2014, at 7:49 AM, Steve Strong wrote: >> >>> > On Thursday, 30 January 2014 at 19:10, kraythe . wrote: >> >>> >> 1) Code completion. Sorry but I can't be bothered to type the same >> >>> >> flipping method name in its entirety 40 times. >> >>> >> >>> >> >>> There are three causes for "completion" in languages like >> >>> Prolog and Erlang: >> >>> >> >>> (a) Definitions with multiple clauses. >> >>> Your editor should be able to turn "add a clause" into a >> >>> single command. >> >>> >> >>> (b) Recursion. >> >>> Your editor should be able to turn "add a recursive call" >> >>> into a single command (basically the same as (a), just >> >>> different stuff wrapped around it). >> >>> >> >>> A programming style using higher order procedures can >> >>> eliminate a lot of this. >> >>> >> >>> (c) Repetitive patterns of code. >> >>> >> >>> A programming style using higher order procedures can >> >>> eliminate a lot of this. >> >>> >> >>> There's a thing I find myself saying more and more often: >> >>> >> >>> Why can't I see the structure? >> >>> >> >>> I was reviewing a page or two of Prolog code for someone the >> >>> other day. By the end of three hours, I'd made some progress, >> >>> but I was troubled. The code was clean, but it wasn't OBVIOUS. >> >>> What finally dawned on me would have been instantly obvious to >> >>> a real functional programmer: the code was an interweaving of >> >>> a "compute argmax of a partial function over a finite domain" >> >>> and "here is this partial function". Actually introducing the >> >>> higher order function in question let me explore several ways >> >>> of implementing that *without* any effect on the rest of the >> >>> code. Breaking the specific partial function out and naming >> >>> it let me see that memoising *that* function -- which hadn't >> >>> previously existed -- stood an excellent chance of reducing >> >>> the overall cost of the algorithm down *hugely*. >> >>> >> >>> So I say, if you find yourself _wanting_ a method name to >> >>> appear 40 times in a day's work, you are doing something >> >>> badly wrong. >> >>> >> >>> For another data point, as part of building up my Smalltalk >> >>> skills, I used to pick up Java code and rewrite it in Smalltalk. >> >>> There were two invariable results: first, the code would >> >>> shrink by about a factor of six, and second, it would become >> >>> painfully obvious that the original code was really really >> >>> bad design, and that in a *good* OO design, most of the >> >>> classes wouldn't just shrink, they'd disappear. A good part >> >>> of this is down to Smalltalk's support for and extensive use >> >>> of higher order functions from day 1. >> >>> >> >>> > >> >>> > 3) Syntax coloring. (VIM color codes a file so that is there, emacs >> I >> >>> > don't know AT ALL.) >> >>> To which Steve Strong replied >> >>> > I don't know of any editor that doesn't do this - >> >>> > even github displays syntax colouring on erlang files. >> >>> >> >>> My own text editor doesn't do syntax colouring. >> >>> Frankly, I hate syntax colouring. I could give you >> >>> a long rant about why. One big issue is that the >> >>> name is a lie. It's *lexical* colouring; the colour >> >>> depends on what kind of token something is. But I >> >>> can *see* that. If you offered me an editor where >> >>> calls to functions whose definitions had been edited >> >>> recently were brightly coloured, or where the functions >> >>> imported from a particular module were brightly coloured, >> >>> or where slicing was used to colour the places where a >> >>> particular variable could be *changed* and *used*, I'd >> >>> find that really really helpful. Why waste colour >> >>> telling me something that is already obvious at a glance? >> >>> I once came across a compiler (written in Finland) where >> >>> several passes had had to be woven together because of >> >>> the language it was written in, so they had coloured >> >>> each declaration and statement according to which pass >> >>> it was logically part of. Now _that's_ good use of colour! >> >>> >> >>> > >> >> >> >> >> > >> > >> > _______________________________________________ >> > 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 erlang@REDACTED Fri Jan 31 12:10:42 2014 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 31 Jan 2014 12:10:42 +0100 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <1877364547.52882.1391160487524.JavaMail.zimbra@tpip.net> References: <1877364547.52882.1391160487524.JavaMail.zimbra@tpip.net> Message-ID: On Fri, Jan 31, 2014 at 10:28 AM, Andreas Schultz wrote: > BTW: We have a small workshop with Pieter Hintjens on Feb, 10th in Berlin > on exactly how to best support 0MQ in Erlang for our own projects. > Great - say hello to Pieter from me > > Depending on the outcome, this will most likely mean that we are going to > upgrade gen_zmq to the latest zmtp wire protocol. > Brilliant - great news /Joe > > Andreas > > ----- Original Message ----- > > > > > > > > On Fri, Jan 31, 2014 at 8:12 AM, Joe Armstrong < erlang@REDACTED > > wrote: > > > > > > > > Let me pitch a silly idea at you. > > > > Why don't we just use gen_tcp and interact with 0MQ peers using the > > wire-line protocol. Erlang is good at getting data in and out of sockets, > > and good at parsing binary packets. > > > > This method is safe and efficient. I mailed about this > > and he thought this was perfectly doable. > > > > I'm not suggesting implementing all the protocols and transports to start > > with > > just the REQ - REP protocols of TCP > > > > Pieter suggest looking at > > > > https://github.com/zeromq/zmtp > > https://github.com/zeromq/libzmq/blob/master/tests/test_stream.cpp > > > > These implement the wire-line protocol on top of tcp rather than through > the > > 0mz library so its easier to see whats going on. > > > > Now I haven't a clue if this is a silly idea or not - but a few hours > > tinkering > > should be enough to implement the REQ-REP protocols and make some > performance > > measurements - and that would tell me if it's worth implementing more > > protocols > > and transports. > > > > The difficulty of this is not writing the code - but understanding the > > wire-line protocol > > but I think Pieter has done a good job here, there are a load of RFCs at > the > > 0MQ web site. > > > > ( actually all I want to do is get Erlang talking to Julia - Julia > speaks 0MQ > > and I found that I > > couldn't build the Erlang 0MQ bindings with the latest 0MQ - so I'm again > > back to > > "fixing stuff thats broken" in order to do what I want. I don't really > want > > to have to re-implement > > the 0MQ wire-line protocol to do this - but it does seem easier than > fixing > > up the broken library > > and maintaining it (I guess it's easier since I only need a fraction of > the > > entire protocol)) > > > > Comments > > > > /Joe > > > > > > gen_zmq was doing that but it wasn't update since a long time: > > > > https://github.com/RoadRunnr/gen_zmq > > > > Maybe a good start? > > > > - benoit > > > > > > > > > > > > On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith < g@REDACTED > wrote: > > > > > > > > On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong < erlang@REDACTED > > wrote: > > > Is anybody working on upgrading the 0MQ libraries for erlang to > > > the latest version of 0QM. > > > > I would be tempted to upgrade them, but I've wanted to have an > > external C port implementation of the 0MQ bindings for a while and so > > created this: > > > > https://github.com/gar1t/erlang-czmq > > > > In my three years of experience with the 0MQ bindings, it's been > > (historically) very easy to crash the Erlang VM. For my applications, > > speed will never justify the cost of taking an entire node down. The > > CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10 > > times slower). I'm sure they can be made much faster, but my thinking > > is that running multiple external ports could alleviate this. > > > > Speed kills. > > > > This code is not running in production, but it will be soon. > > > > The CZMQ API in my opinion is the right target for new 0MQ bindings, > > regardless of how they're implemented. Pieter Hintjen's rationale for > > writing CZMQ is here: > > > > https://github.com/zeromq/czmq#scope-and-goals > > > > Garrett > > > > > > _______________________________________________ > > 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 > > > > -- > -- > Dipl. Inform. > Andreas Schultz > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Fri Jan 31 12:13:01 2014 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 31 Jan 2014 12:13:01 +0100 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <2029482514.52715.1391158061241.JavaMail.zimbra@tpip.net> References: <2029482514.52715.1391158061241.JavaMail.zimbra@tpip.net> Message-ID: On Fri, Jan 31, 2014 at 9:47 AM, Andreas Schultz wrote: > Hi, > > ----- Original Message ----- > > Yes - Google didn't suggest this. > > > > Did anybody do any performance measurements on this? > > Not yet, didn't have time for it :-( > Shame .. Can you make a quick measurement? - I'm not talking super scientific stuff - just a quick indication of how fast RPCs go compared to the NIF implementations /Joe > > Andreas > > > > > /Joe > > > > > > On Fri, Jan 31, 2014 at 8:45 AM, Benoit Chesneau < bchesneau@REDACTED > > > wrote: > > > > > > > > > > > > > > On Fri, Jan 31, 2014 at 8:12 AM, Joe Armstrong < erlang@REDACTED > > wrote: > > > > > > > > Let me pitch a silly idea at you. > > > > Why don't we just use gen_tcp and interact with 0MQ peers using the > > wire-line protocol. Erlang is good at getting data in and out of sockets, > > and good at parsing binary packets. > > > > This method is safe and efficient. I mailed Pieter Hintjens about this > > and he thought this was perfectly doable. > > > > I'm not suggesting implementing all the protocols and transports to start > > with > > just the REQ - REP protocols of TCP > > > > Pieter suggest looking at > > > > https://github.com/zeromq/zmtp > > https://github.com/zeromq/libzmq/blob/master/tests/test_stream.cpp > > > > These implement the wire-line protocol on top of tcp rather than through > the > > 0mz library so its easier to see whats going on. > > > > Now I haven't a clue if this is a silly idea or not - but a few hours > > tinkering > > should be enough to implement the REQ-REP protocols and make some > performance > > measurements - and that would tell me if it's worth implementing more > > protocols > > and transports. > > > > The difficulty of this is not writing the code - but understanding the > > wire-line protocol > > but I think Pieter has done a good job here, there are a load of RFCs at > the > > 0MQ web site. > > > > ( actually all I want to do is get Erlang talking to Julia - Julia > speaks 0MQ > > and I found that I > > couldn't build the Erlang 0MQ bindings with the latest 0MQ - so I'm again > > back to > > "fixing stuff thats broken" in order to do what I want. I don't really > want > > to have to re-implement > > the 0MQ wire-line protocol to do this - but it does seem easier than > fixing > > up the broken library > > and maintaining it (I guess it's easier since I only need a fraction of > the > > entire protocol)) > > > > Comments > > > > /Joe > > > > > > gen_zmq was doing that but it wasn't update since a long time: > > > > https://github.com/RoadRunnr/gen_zmq > > > > Maybe a good start? > > > > - benoit > > > > > > > > > > > > On Thu, Jan 30, 2014 at 10:58 PM, Garrett Smith < g@REDACTED > wrote: > > > > > > > > On Thu, Jan 30, 2014 at 3:13 PM, Joe Armstrong < erlang@REDACTED > > wrote: > > > Is anybody working on upgrading the 0MQ libraries for erlang to > > > the latest version of 0QM. > > > > I would be tempted to upgrade them, but I've wanted to have an > > external C port implementation of the 0MQ bindings for a while and so > > created this: > > > > https://github.com/gar1t/erlang-czmq > > > > In my three years of experience with the 0MQ bindings, it's been > > (historically) very easy to crash the Erlang VM. For my applications, > > speed will never justify the cost of taking an entire node down. The > > CZMQ bindings I have here are quite slow relative to erlzmq2 (~ 5 - 10 > > times slower). I'm sure they can be made much faster, but my thinking > > is that running multiple external ports could alleviate this. > > > > Speed kills. > > > > This code is not running in production, but it will be soon. > > > > The CZMQ API in my opinion is the right target for new 0MQ bindings, > > regardless of how they're implemented. Pieter Hintjen's rationale for > > writing CZMQ is here: > > > > https://github.com/zeromq/czmq#scope-and-goals > > > > Garrett > > > > > > _______________________________________________ > > 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 > > > > -- > -- > Dipl. Inform. > Andreas Schultz > > email: as@REDACTED > phone: +49-391-819099-224 > mobil: +49-170-2226073 > > ------------------- enabling your networks ------------------- > > Travelping GmbH phone: +49-391-819099229 > Roentgenstr. 13 fax: +49-391-819099299 > D-39108 Magdeburg email: info@REDACTED > GERMANY web: http://www.travelping.com > > Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 > Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 > -------------------------------------------------------------- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Fri Jan 31 12:16:12 2014 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 31 Jan 2014 12:16:12 +0100 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <629555314.52646.1391157894357.JavaMail.zimbra@tpip.net> References: <629555314.52646.1391157894357.JavaMail.zimbra@tpip.net> Message-ID: On Fri, Jan 31, 2014 at 9:44 AM, Andreas Schultz wrote: > Hi, > > I have a pure Erlang implementation that is based on zMQ v2 at > https://github.com/RoadRunnr/gen_zmq > > It is more of a POC and might not even build right now since some > the dependencies have evolved. > > I got stuck when trying to control the queuing behavior on tcp socket, > gen_tcp hides too much details of the underlying socket and the buffering > in it also doesn't help. > Great - you have exposed a problem in gen_tcp. That's really great. There are many people on this list who can help you with this. /Joe > > Andreas > > ----- Original Message ----- > > Is anybody working on upgrading the 0MQ libraries for erlang to > > the latest version of 0QM. > > > > /Joe > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > -- > Dipl. Inform. > Andreas Schultz > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Fri Jan 31 12:28:10 2014 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Fri, 31 Jan 2014 12:28:10 +0100 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <629555314.52646.1391157894357.JavaMail.zimbra@tpip.net> References: <629555314.52646.1391157894357.JavaMail.zimbra@tpip.net> Message-ID: On Fri, Jan 31, 2014 at 9:44 AM, Andreas Schultz wrote: > I got stuck when trying to control the queuing behavior on tcp socket, > gen_tcp hides too much details of the underlying socket and the buffering > in it also doesn't help. > Can you remember what specifically your problem was? What controls do you need on the socket in order for it to behave "correctly"? What do you mean by queueing behaviour? What do you mean by buffering? -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Fri Jan 31 13:00:43 2014 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 31 Jan 2014 13:00:43 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: On Fri, Jan 31, 2014 at 11:40 AM, Vlad Dumitrescu wrote: > Hi Joe, > > On Fri, Jan 31, 2014 at 8:49 AM, Joe Armstrong wrote: > >> On Fri, Jan 31, 2014 at 7:50 AM, Michael Turner < >> michael.eugene.turner@REDACTED> wrote: >> >>> One thing I've gotten out of this excellent thread: given what some >>> people (but not Joe, I guess) want out of a programming environment, >>> >> >> What I want in a programming environment would take a book to describe. >> >> For starters, I would like it to be precisely documented. >> >> It should be textual not GUI based - the reason for this is automation - >> I cannot >> easily automate things if they are GUI based. I can automate things if >> they are text based. >> Also It's very difficult to describe what to do in a GUI - the >> descriptions need pictures >> to tell you what to do. >> >> I currently think Knuth was right. >> > > With all due respect to you and Donald Knuth, there is something in your > text (above and below) that makes me feel confused. Maybe it's just me and > then it's ok (for the rest of the world, at least), but maybe not. I don't > know if I will be able to express what this confusion is about, but I will > try. Maybe you meant something else than I understood and I'd love to get > it right. > > It got a bit long, sorry about that. Look for "****" for the TL;DR > > --- > Why does automating something have anything to do with that thing being > textual or graphical? vim runs in a console, but also as gVim (graphical). > The same can be said about emacs and XEmacs. Eclipse can be run in headless > mode (but I admit that there are rather few tools that work in that mode). > To me, a tool can be automatable at two levels: it can be run from the > command line and it might return meaningful data that some other tool can > process further. I don't see what this has anything to do with the tool > being textual or graphical. These parts are just the presentation layer... > I guess I'd like to be able to run eclipse headless (whatever that means) I just want to enter things in a file using my favorite editor and then say (in the command line) > do_the_stuff_in_the_file and get a file back with stuff I can read. The stuff in the file will tell me what went wrong. It's an added bonus if both the inputs and outputs are easy to parse. This way I can automate everything with programs that manipulate files. I don't know how to write a program that "clicks on buttons inside eclipse" > > Whether we want it or not, to the human brain images are lower level than > text or speech. We can't read text files directly, we interpret the > graphical representation of that text, be it on a console or a window. Some > people can handle abstractions in their heads more easily than others. The > latter category will need help, possibly in the form of tools to visualize > the code (or whatever). If you are from the former category, more power to > you, but that doesn't mean that it works for all people. It feels a bit > like Usain Bolt saying "Bicycles? They are utterly useless, I can run > faster than that and it's better to one's health". > > In my opinion, what a programming environment brings to the table is > multiple ways to look at the code, to quickly see what is going on. It also > provides a toolbox of utilities that can be used to process the code. I > find it largely irrelevant if the environment is a GUI or not, I only need > it to give me the information I need in the format that is best suited for > me. > > It's the same kind of help one gets from a debugger: one could run the > code in one's head and look for where the problem is, but it's much more > effective with a tool that shows the system's exact state, not to mention > that one can ask for a colleague or two to look at it. > I don't use debuggers. I write all the information I think I need into a file and study this (in emacs :-) and I cam mail this to a colleague if I want to. > > Taking a TeX example, wouldn't you find it helpful to have a window > alongside your editor that show in real time how the document is rendered, > without the need to run "tex mydoc.tex | pdfview&" (or whatever) yourself > once in a while? Once you start to use more and more complicated macros, > wouldn't be useful to be able to see the documentation for these, maybe to > be able choose between a couple of similarly named ones? > Not really - I did try something like this. I make lots of small changes while editing and I know that the program is not ready to be run. I do use TeX but (of course) I use a program to generate the TeX from an emacs org file The only time I look at the TeX is when there's a bug in the translation program. > > Or in Erlang (and doing some wishful thinking), wouldn't it be useful if > one could actually _see_ in real time the network of processes in a node, > how they are linked/monitoring each other, how they communicate, which ones > are growing large or seem deadlocked, zoom out for a bird-eye view or in > for details? Or more realistically, running some tests and get diagrams of > the process communication, where selecting a message could show details and > the code where it is sent and received? In my humble opinion, it sure would > beat scrolling through wades of logs and code... > It would be nice to "see" processes in some sense - stop time and wander around as it were. I actually use pencil and paper for a lot of this. It's very time consuming to enter diagrams into a computers. Some kind of pad computer that could turn sketched circles and arrows into programs would be fantastic > > As a user, one shouldn't need to understand how the environment works (you > think Eclipse is complex, I think Emacs is; it's a matter of what we are > accustomed to). Of course, this changes when I need to do something that > the environment doesn't support. But even so, there is always the fallback > of doing it as if no IDE was available, so I don't think that having an IDE > can make things worse. > Both emacs and Eclipse are very complex - If I were a IDE fan I guess I'd go for smalltalk since I have a feeling that one day I might get my head around how it worked. If I could just click on anything in eclipse and bring up the code that created the GUI control I'd be happier. I actually rather like Javascript and how it can manipulate the DOM, it's easy to just do view-source in the browser and see how things work. Just because you can see it doesn't mean you can understand it, but javascript can be nicely written :-) I think an eclipse like thing in HTML5 would be great - especially since it would make collaborate editing etc. easier. > > That said, existing IDEs have widely different pros and cons, weaknesses > and strengths. None is perfect and one of the main reasons that none can be > perfect for everybody is that each developer has different needs and > expectations. Make it too narrow and only few will use it. Make it too > broad and the plethora of setting to tweak will make most people ignore > them (thus the development effort is wasted). > > **** > My vision for an IDE is that there should be a core of (narrow) tools > cooperating to provide a broad functionality for processing source code and > delivering useful data from the code base, tools that are agnostic of any > way of interacting with it or of presenting the results. Think of it as > syntax_tools on super-steroids. These tools can then be used by emacs, or > Eclipse, or vim, or from scripts, or whatever. I am aiming for that with > erlide, but it's a long way to go. > **** > > That would be nice. > --- > Knuth could do this amazing thing with TeX (practically no bugs) for all > the reasons you stated, but also because he set very strict boundaries for > what TeX is and can do. Basically, he not only froze the specifications, he > set them in stone. If that would have been enough, would there have been a > need for XeTeX, pdfTeX, laTeX and other tools that extend and improve the > basic TeX? Would it have been possible to keep the bug levels as low if > these extensions and improvements had been part of the core TeX? > > Your example of "hello \end" being easy to understand is misleading. So is > "echo 'hello'" or "printf 'hello'" or "System.out.println("hello");" (the > latter with some boilerplate removed). What is interesting is whether a > real-life example is easy to understand. You say "it's just a matter of > understanding what the primitives do", but isn't this exactly the difficult > part with everything? "Just understanding" might mean a lot of work and > time and effort... Given a complex document typeset in plain TeX (i.e > without any macro libraries and containing Unicode text), the code is going > quickly to get more that one can hold in one's head and I doubt that it's > going to be just as easy to understand, even if one would understand > perfectly what each primitive does. I venture to state that it would > probably be just as easy or difficult as it would be for any well-designed > programming language. As a matter of fact, because TeX macros can define > their own syntax too, it might make the result more difficult to read > (given that not all macros are written by Donald Knuth himself). > > Mastering TeX I guess would take a few years of study. It wouldn't be any fun if it were easy. We (programmers) are like trappist monks studying the holy scrolls Cheers /Joe > best regards, > Vlad > > > > > > >> The version numbering of TeX (using successive digits of Pi) is brilliant >> TeX it at version 3.14159265 - Knuth also pays a reward (in cash) for >> every new bug. The reward >> doubles for each new error. >> >> This scheme means that the project will be abandoned if there are more >> then 15 or so bugs - because the >> version number would be too long, and the cost too great - and it >> probably should be abandoned >> if it had this number of errors. >> >> Knuths way of working - Literate programming - with patch files - >> enforces an incredibly disciplined way >> of working. TeX (as a literate program) is just about the only example I >> know of a large complex program >> that is understandable and has no known errors. >> >> TeX was produced without fancy editors and revision control systems and >> IDEs and all that stuff. >> >> The only downside of Knuths way is that it takes a long time to write the >> program. >> >> At a guess 80% of software costs are in maintenance of legacy code - so >> in the long term >> Knuthian development pays off. Being early to market with buggy software >> is however the >> way to make money. What earns you most money in the short term costs you >> most in the long term. >> >> TeX is interesting in a sense that (say) eclipse is not. I feel it is >> possible to learn how TeX works >> >> (aside I have started on this journey >> "Hello \end" >> is a minimal TeX program that I can understand. All I need to do is >> understand what >> the primitives do, and then how the macro expansion works, ... >> ) >> >> There is no way I can understand something like eclipse - there is no >> documentation of what it does and how >> it works - only documentation of how to use it. >> >> I only like doing things I can understand. >> >> emacs is in the TeX category - I can "in principle" read the code and see >> what it does >> >> (another aside - reading code to see what it does is highly overrated - >> reading my own code >> that I wrote years ago is difficult - reading other peoples code is >> doubly difficult - reading undocumented >> code in a language I don't really understand to fix a bug that I didn't >> want to fix into order to solve a problem >> that I do want to solve is an incredible waste of time - and that's why I >> like Kuthian rigour in software) >> >> Nowhere have I said that this is easy - but I believe that IDEs etc make >> matters worse by hiding >> what should not be hidden. If it's such a mess that it needs tool support >> to write then the solution is >> to clean up the mess not provide tools to hide the mess. >> >> As I said - I could write a book on this :-) >> >> Cheers >> >> /Joe >> >> >>> and what some people like in programming languages (Joe, for example), >>> somebody should do an Erlide for Elixir. >>> >>> Regards, >>> Michael Turner >>> Executive Director >>> Project Persephone >>> K-1 bldg 3F >>> 7-2-6 Nishishinjuku >>> Shinjuku-ku Tokyo 160-0023 >>> Tel: +81 (3) 6890-1140 >>> Fax: +81 (3) 6890-1158 >>> Mobile: +81 (90) 5203-8682 >>> turner@REDACTED >>> http://www.projectpersephone.org/ >>> >>> "Love does not consist in gazing at each other, but in looking outward >>> together in the same direction." -- Antoine de Saint-Exup?ry >>> >>> >>> On Fri, Jan 31, 2014 at 3:25 PM, kraythe . wrote: >>> > Well I think after seeing the arguments and the response of the >>> community I >>> > am trending seriously towards Erlang. I will probably make the mental >>> > investment to learn and become good with emacs. And then move on from >>> there. >>> > I may still have a ton of questions. I would still, for example, love >>> to >>> > know who to 'reload' my application once it is started. >>> > >>> > >>> > On Fri, Jan 31, 2014 at 12:24 AM, kraythe . wrote: >>> >> >>> >> Well I think after seeing the arguments and the response of the >>> community >>> >> I am trending seriously towards Erlang. I will probably make the >>> mental >>> >> investment to learn and become good with emacs. And then move on from >>> there. >>> >> I may still have a ton of questions. I would still, for example, love >>> to >>> >> know who to 'reload' my application once it is started. >>> >> >>> >> Robert Simmons Jr. MSc. - Lead Java Architect @ EA >>> >> Author of: Hardcore Java (2003) and Maintainable Java (2012) >>> >> LinkedIn: http://www.linkedin.com/pub/robert-simmons/40/852/a39 >>> >> >>> >> >>> >> On Thu, Jan 30, 2014 at 10:29 PM, Richard A. O'Keefe < >>> ok@REDACTED> >>> >> wrote: >>> >>> >>> >>> >>> >>> On 31/01/2014, at 7:49 AM, Steve Strong wrote: >>> >>> > On Thursday, 30 January 2014 at 19:10, kraythe . wrote: >>> >>> >> 1) Code completion. Sorry but I can't be bothered to type the same >>> >>> >> flipping method name in its entirety 40 times. >>> >>> >>> >>> >>> >>> There are three causes for "completion" in languages like >>> >>> Prolog and Erlang: >>> >>> >>> >>> (a) Definitions with multiple clauses. >>> >>> Your editor should be able to turn "add a clause" into a >>> >>> single command. >>> >>> >>> >>> (b) Recursion. >>> >>> Your editor should be able to turn "add a recursive call" >>> >>> into a single command (basically the same as (a), just >>> >>> different stuff wrapped around it). >>> >>> >>> >>> A programming style using higher order procedures can >>> >>> eliminate a lot of this. >>> >>> >>> >>> (c) Repetitive patterns of code. >>> >>> >>> >>> A programming style using higher order procedures can >>> >>> eliminate a lot of this. >>> >>> >>> >>> There's a thing I find myself saying more and more often: >>> >>> >>> >>> Why can't I see the structure? >>> >>> >>> >>> I was reviewing a page or two of Prolog code for someone the >>> >>> other day. By the end of three hours, I'd made some progress, >>> >>> but I was troubled. The code was clean, but it wasn't OBVIOUS. >>> >>> What finally dawned on me would have been instantly obvious to >>> >>> a real functional programmer: the code was an interweaving of >>> >>> a "compute argmax of a partial function over a finite domain" >>> >>> and "here is this partial function". Actually introducing the >>> >>> higher order function in question let me explore several ways >>> >>> of implementing that *without* any effect on the rest of the >>> >>> code. Breaking the specific partial function out and naming >>> >>> it let me see that memoising *that* function -- which hadn't >>> >>> previously existed -- stood an excellent chance of reducing >>> >>> the overall cost of the algorithm down *hugely*. >>> >>> >>> >>> So I say, if you find yourself _wanting_ a method name to >>> >>> appear 40 times in a day's work, you are doing something >>> >>> badly wrong. >>> >>> >>> >>> For another data point, as part of building up my Smalltalk >>> >>> skills, I used to pick up Java code and rewrite it in Smalltalk. >>> >>> There were two invariable results: first, the code would >>> >>> shrink by about a factor of six, and second, it would become >>> >>> painfully obvious that the original code was really really >>> >>> bad design, and that in a *good* OO design, most of the >>> >>> classes wouldn't just shrink, they'd disappear. A good part >>> >>> of this is down to Smalltalk's support for and extensive use >>> >>> of higher order functions from day 1. >>> >>> >>> >>> > >>> >>> > 3) Syntax coloring. (VIM color codes a file so that is there, >>> emacs I >>> >>> > don't know AT ALL.) >>> >>> To which Steve Strong replied >>> >>> > I don't know of any editor that doesn't do this - >>> >>> > even github displays syntax colouring on erlang files. >>> >>> >>> >>> My own text editor doesn't do syntax colouring. >>> >>> Frankly, I hate syntax colouring. I could give you >>> >>> a long rant about why. One big issue is that the >>> >>> name is a lie. It's *lexical* colouring; the colour >>> >>> depends on what kind of token something is. But I >>> >>> can *see* that. If you offered me an editor where >>> >>> calls to functions whose definitions had been edited >>> >>> recently were brightly coloured, or where the functions >>> >>> imported from a particular module were brightly coloured, >>> >>> or where slicing was used to colour the places where a >>> >>> particular variable could be *changed* and *used*, I'd >>> >>> find that really really helpful. Why waste colour >>> >>> telling me something that is already obvious at a glance? >>> >>> I once came across a compiler (written in Finland) where >>> >>> several passes had had to be woven together because of >>> >>> the language it was written in, so they had coloured >>> >>> each declaration and statement according to which pass >>> >>> it was logically part of. Now _that's_ good use of colour! >>> >>> >>> >>> > >>> >> >>> >> >>> > >>> > >>> > _______________________________________________ >>> > 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 ph@REDACTED Fri Jan 31 12:55:25 2014 From: ph@REDACTED (Pieter Hintjens) Date: Fri, 31 Jan 2014 12:55:25 +0100 Subject: [erlang-questions] CZMQ licensing Message-ID: Hi people, Joe pointed me to the thread on erlang-CZMQ and licensing. Just to clarify. CZMQ is not dual-licensed. The licensing on CZMQ is LGPLv3+static link exception, the same as libzmq and as most of the ZeroMQ projects. This license explicitly allows bundling of the compiled code with commercial applications under whatever license the user wants. It removes the LGPL/GPL requirements on such bundles (static links). This is what I'd recommend for erlang-CZMQ too. It means taking COPYING and COPYING.LESSER (since LGPLv3 is a patch on GPLv3) from CZMQ or libzmq. Mahesh is correct: without an explicit license, one cannot use a software project, unless one is the owner. -Pieter Ps. native Erlang ZMTP would be fantastic. We've done this in Java and .NET, and it's been very positive for those communities. From erlang@REDACTED Fri Jan 31 13:05:03 2014 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 31 Jan 2014 13:05:03 +0100 Subject: [erlang-questions] CZMQ licensing In-Reply-To: References: Message-ID: Hi Pieter, Welcome to the Erlang list. Great to see you here. /Joe On Fri, Jan 31, 2014 at 12:55 PM, Pieter Hintjens wrote: > Hi people, > > Joe pointed me to the thread on erlang-CZMQ and licensing. > > Just to clarify. > > CZMQ is not dual-licensed. > > The licensing on CZMQ is LGPLv3+static link exception, the same as > libzmq and as most of the ZeroMQ projects. This license explicitly > allows bundling of the compiled code with commercial applications > under whatever license the user wants. It removes the LGPL/GPL > requirements on such bundles (static links). > > This is what I'd recommend for erlang-CZMQ too. It means taking > COPYING and COPYING.LESSER (since LGPLv3 is a patch on GPLv3) from > CZMQ or libzmq. > > Mahesh is correct: without an explicit license, one cannot use a > software project, unless one is the owner. > > -Pieter > > Ps. native Erlang ZMTP would be fantastic. We've done this in Java and > .NET, and it's been very positive for those communities. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zoha.qamer@REDACTED Fri Jan 31 13:29:05 2014 From: zoha.qamer@REDACTED (Zoha Qamar) Date: Fri, 31 Jan 2014 17:29:05 +0500 Subject: [erlang-questions] Creating node problem In-Reply-To: References: Message-ID: Yes i was silly , n was making them from ERlang emulator , later on i read its from cmd.exe On Fri, Jan 31, 2014 at 4:30 AM, Erik S?e S?rensen wrote: > Are you writing those commands in the Erlang shell? > They don't go there - they're for the windows shell, for starting the > Erlang one. > Regards, > Erik S?e S?rensen > Den 29/01/2014 18.41 skrev "Zoha Qamar" : > >> >> Dear all , >> >> >> I making server and client node in Erlang emulator R16B3 , but i am keep >> getting error on the first line , i am using win7 , 64bit my command is >> >> werl -name zoha@REDACTED >> >> or >> >> >> werl -name zoha@REDACTED ( copying from host file of >> window 's ) >> >> or its direct IP >> >> werl -name zoha@REDACTED >> >> but what ever i put Ip or host name , i keep getting error , >> >> * 1: syntax error before: zoha@REDACTED >> or >> >> * 1: syntax error before: zoha@REDACTED >> >> or >> >> * 1: syntax error before: zoha@REDACTED >> >> >> pls help me out where i am wrong any administration privilege issue , >> firewall issue ?? >> -- >> "*Agar Tum Seedhay rastay pe ho aur kisi Mushkil ka samna nahe ker rahay >> to >> kuch dair k liyay socho k kahin tum kuch ghalt to nahe ker rahay kyon k >> seedha rasta to mushkilaat se bhar pur hota hy*" *Hazrat Imam Ali (A.S) * >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> -- "*Agar Tum Seedhay rastay pe ho aur kisi Mushkil ka samna nahe ker rahay to kuch dair k liyay socho k kahin tum kuch ghalt to nahe ker rahay kyon k seedha rasta to mushkilaat se bhar pur hota hy*" *Hazrat Imam Ali (A.S) * -------------- next part -------------- An HTML attachment was scrubbed... URL: From huss01@REDACTED Fri Jan 31 13:53:29 2014 From: huss01@REDACTED (=?ISO-8859-1?Q?H=E5kan_Huss?=) Date: Fri, 31 Jan 2014 13:53:29 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: Just thought I'd interrupt the IDE war^H^H^Hdiscussion and pick up the "reload" question. Hot code loading is one of the fundamental parts of Erlang, so reloading by restarting the entire node is normally not necessary. During development and testing (and in emergencies on running customer sites :-) when only one or a few modules have changed it would normally be sufficient to do 'make' (or 'rebar compile' or what have you), copying the .beam files to the affected node(s), opening a shell connected to the node and loading the new versions of the modules with the shell command l (or nl in the distributed case) and that's it. The new code is running without any need for restarts. Of course, if the new code changes data representation or APIs, or there are processes that are running long-lived calls to the affected modules there may be additional steps. Then I might use the application/release upgrade support that OTP offers even in development. And when upgrading a production system this is of course always a good way. It takes some work to understand the appup/relup support, but it is well invested effort. Regards, /H?kan 2014-01-31 kraythe . : > Well I think after seeing the arguments and the response of the community > I am trending seriously towards Erlang. I will probably make the mental > investment to learn and become good with emacs. And then move on from > there. I may still have a ton of questions. I would still, for example, > love to know who to 'reload' my application once it is started. > > > On Fri, Jan 31, 2014 at 12:24 AM, kraythe . wrote: > >> Well I think after seeing the arguments and the response of the community >> I am trending seriously towards Erlang. I will probably make the mental >> investment to learn and become good with emacs. And then move on from >> there. I may still have a ton of questions. I would still, for example, >> love to know who to 'reload' my application once it is started. >> >> *Robert Simmons Jr. MSc. - Lead Java Architect @ EA* >> *Author of: Hardcore Java (2003) and Maintainable Java (2012)* >> *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39 >> * >> >> >> On Thu, Jan 30, 2014 at 10:29 PM, Richard A. O'Keefe wrote: >> >>> >>> On 31/01/2014, at 7:49 AM, Steve Strong wrote: >>> > On Thursday, 30 January 2014 at 19:10, kraythe . wrote: >>> >> 1) Code completion. Sorry but I can't be bothered to type the same >>> flipping method name in its entirety 40 times. >>> >>> >>> There are three causes for "completion" in languages like >>> Prolog and Erlang: >>> >>> (a) Definitions with multiple clauses. >>> Your editor should be able to turn "add a clause" into a >>> single command. >>> >>> (b) Recursion. >>> Your editor should be able to turn "add a recursive call" >>> into a single command (basically the same as (a), just >>> different stuff wrapped around it). >>> >>> A programming style using higher order procedures can >>> eliminate a lot of this. >>> >>> (c) Repetitive patterns of code. >>> >>> A programming style using higher order procedures can >>> eliminate a lot of this. >>> >>> There's a thing I find myself saying more and more often: >>> >>> Why can't I see the structure? >>> >>> I was reviewing a page or two of Prolog code for someone the >>> other day. By the end of three hours, I'd made some progress, >>> but I was troubled. The code was clean, but it wasn't OBVIOUS. >>> What finally dawned on me would have been instantly obvious to >>> a real functional programmer: the code was an interweaving of >>> a "compute argmax of a partial function over a finite domain" >>> and "here is this partial function". Actually introducing the >>> higher order function in question let me explore several ways >>> of implementing that *without* any effect on the rest of the >>> code. Breaking the specific partial function out and naming >>> it let me see that memoising *that* function -- which hadn't >>> previously existed -- stood an excellent chance of reducing >>> the overall cost of the algorithm down *hugely*. >>> >>> So I say, if you find yourself _wanting_ a method name to >>> appear 40 times in a day's work, you are doing something >>> badly wrong. >>> >>> For another data point, as part of building up my Smalltalk >>> skills, I used to pick up Java code and rewrite it in Smalltalk. >>> There were two invariable results: first, the code would >>> shrink by about a factor of six, and second, it would become >>> painfully obvious that the original code was really really >>> bad design, and that in a *good* OO design, most of the >>> classes wouldn't just shrink, they'd disappear. A good part >>> of this is down to Smalltalk's support for and extensive use >>> of higher order functions from day 1. >>> >>> > >>> > 3) Syntax coloring. (VIM color codes a file so that is there, emacs I >>> don't know AT ALL.) >>> To which Steve Strong replied >>> > I don't know of any editor that doesn't do this - >>> > even github displays syntax colouring on erlang files. >>> >>> My own text editor doesn't do syntax colouring. >>> Frankly, I hate syntax colouring. I could give you >>> a long rant about why. One big issue is that the >>> name is a lie. It's *lexical* colouring; the colour >>> depends on what kind of token something is. But I >>> can *see* that. If you offered me an editor where >>> calls to functions whose definitions had been edited >>> recently were brightly coloured, or where the functions >>> imported from a particular module were brightly coloured, >>> or where slicing was used to colour the places where a >>> particular variable could be *changed* and *used*, I'd >>> find that really really helpful. Why waste colour >>> telling me something that is already obvious at a glance? >>> I once came across a compiler (written in Finland) where >>> several passes had had to be woven together because of >>> the language it was written in, so they had coloured >>> each declaration and statement according to which pass >>> it was logically part of. Now _that's_ good use of colour! >>> >>> > >>> >> >> > > _______________________________________________ > 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 Fri Jan 31 13:55:03 2014 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Fri, 31 Jan 2014 13:55:03 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: On Fri, Jan 31, 2014 at 1:00 PM, Joe Armstrong wrote: > On Fri, Jan 31, 2014 at 11:40 AM, Vlad Dumitrescu wrote: > >> Hi Joe, >> On Fri, Jan 31, 2014 at 8:49 AM, Joe Armstrong wrote: >> >>> On Fri, Jan 31, 2014 at 7:50 AM, Michael Turner < >>> michael.eugene.turner@REDACTED> wrote: >>> >>>> One thing I've gotten out of this excellent thread: given what some >>>> people (but not Joe, I guess) want out of a programming environment, >>>> >>> >>> What I want in a programming environment would take a book to describe. >>> >>> For starters, I would like it to be precisely documented. >>> >>> It should be textual not GUI based - the reason for this is automation - >>> I cannot >>> easily automate things if they are GUI based. I can automate things if >>> they are text based. >>> Also It's very difficult to describe what to do in a GUI - the >>> descriptions need pictures >>> to tell you what to do. >>> >>> >>> Why does automating something have anything to do with that thing being >> textual or graphical? vim runs in a console, but also as gVim (graphical). >> The same can be said about emacs and XEmacs. Eclipse can be run in headless >> mode (but I admit that there are rather few tools that work in that mode). >> To me, a tool can be automatable at two levels: it can be run from the >> command line and it might return meaningful data that some other tool can >> process further. I don't see what this has anything to do with the tool >> being textual or graphical. These parts are just the presentation layer... >> > > I guess I'd like to be able to run eclipse headless (whatever that means) > It means that there is no GUI. "eclipse -application myapp" gives stdout data, or creates files or whatever. Of course, there are few tools that are available like that, but my point was that it is possible. I suppose there isn't enough pressure from the users? > I just want to enter things in a file using my favorite editor and then > say (in the command line) > > do_the_stuff_in_the_file > and get a file back with stuff I can read. The stuff in the file will tell > me what went wrong. > It's an added bonus if both the inputs and outputs are easy to parse. > This way I can automate everything with programs that manipulate files. > This is kind of what my "IDE-as-a-set-of-core-tools" vision aims at too. Point the tool at a project and let it build a (conceptual) database over the whole code (all files, libraries, documentation, etc). Then have a bunch of utilities that can refine and process this data, resulting in diagrams and reports (xref, code outlines, process dependencies), local information for editors (autocompletion, code pattern suggestions, relevant docs), new code (refactorings), and more. At a higher level, the tools could try to understand what the code does and so provide runtime support (runtime process/thread/object dependencies and interactions, debugging). Some of these tools exist already as separate entities, but there's a lot of duplication of work and no synergy[*]. An IDE can make use of the common things that all these tools need so that the tool makers can focus on writing new and better tools instead of writing yet another parser or such. I'm in the camp that rather buys a wheel from a wheel-maker than building one myself from scratch even if I could, I think it's a better use of the effort. You mention pen-and-paper diagrams. These are perfect when designing, I use that a lot too, but they only show what one wants to implement. How can one be sure that the result follows that diagram? Wouldn't it be useful to be able to let tools draw a diagram of what it really looks like and compare it with the original one? Just because IDEs don't do that today, it doesn't necessarily mean that IDEs are evil. They just need work and input from users. :-) [*] This word has lost a lot of the hype from 10 or 15 years ago, so I think it's safe to use once again. regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From torben.lehoff@REDACTED Fri Jan 31 14:32:14 2014 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Fri, 31 Jan 2014 14:32:14 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: In that case: welcome to the wonderful world of Erlang! One thing that I think you will see after a while of working with Erlang is how simple and small the language is. Some of the concepts regarding supervision and fail fast takes a bit of time to wrap your head around, but the language itself is small and easy to understand. Ericsson designed it like that. Simplicity is good - a quote from Hoare's Turing Award Lecture: If our basic tool, the language is which we design and code our programs, is also complicated, the language itself becomes part of the problem rather than part of its solution. Read the whole thing - it is a marvel of software engineering insights. Erlang allows you to focus on the hard parts - how to solve the problem. Any person that claims that Scala is simple needs some sort of mental examination. Don't get me wrong - you can do wonderful things in Scala, but you have to be a wizard of it to get that done. It is bloated with a number of concepts that I'm not sure works out well for the average programmer. The last paragraph can also be read with C++ substituted for Scala ;-) Cheers, Torben p.s. you can steal some Emacs stuff from my standard set-up: https://github.com/lehoff/lehoff-emacs On 31 January 2014 07:25, kraythe . wrote: > Well I think after seeing the arguments and the response of the community > I am trending seriously towards Erlang. I will probably make the mental > investment to learn and become good with emacs. And then move on from > there. I may still have a ton of questions. I would still, for example, > love to know who to 'reload' my application once it is started. > > > On Fri, Jan 31, 2014 at 12:24 AM, kraythe . wrote: > >> Well I think after seeing the arguments and the response of the community >> I am trending seriously towards Erlang. I will probably make the mental >> investment to learn and become good with emacs. And then move on from >> there. I may still have a ton of questions. I would still, for example, >> love to know who to 'reload' my application once it is started. >> >> *Robert Simmons Jr. MSc. - Lead Java Architect @ EA* >> *Author of: Hardcore Java (2003) and Maintainable Java (2012)* >> *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39 >> * >> >> >> On Thu, Jan 30, 2014 at 10:29 PM, Richard A. O'Keefe wrote: >> >>> >>> On 31/01/2014, at 7:49 AM, Steve Strong wrote: >>> > On Thursday, 30 January 2014 at 19:10, kraythe . wrote: >>> >> 1) Code completion. Sorry but I can't be bothered to type the same >>> flipping method name in its entirety 40 times. >>> >>> >>> There are three causes for "completion" in languages like >>> Prolog and Erlang: >>> >>> (a) Definitions with multiple clauses. >>> Your editor should be able to turn "add a clause" into a >>> single command. >>> >>> (b) Recursion. >>> Your editor should be able to turn "add a recursive call" >>> into a single command (basically the same as (a), just >>> different stuff wrapped around it). >>> >>> A programming style using higher order procedures can >>> eliminate a lot of this. >>> >>> (c) Repetitive patterns of code. >>> >>> A programming style using higher order procedures can >>> eliminate a lot of this. >>> >>> There's a thing I find myself saying more and more often: >>> >>> Why can't I see the structure? >>> >>> I was reviewing a page or two of Prolog code for someone the >>> other day. By the end of three hours, I'd made some progress, >>> but I was troubled. The code was clean, but it wasn't OBVIOUS. >>> What finally dawned on me would have been instantly obvious to >>> a real functional programmer: the code was an interweaving of >>> a "compute argmax of a partial function over a finite domain" >>> and "here is this partial function". Actually introducing the >>> higher order function in question let me explore several ways >>> of implementing that *without* any effect on the rest of the >>> code. Breaking the specific partial function out and naming >>> it let me see that memoising *that* function -- which hadn't >>> previously existed -- stood an excellent chance of reducing >>> the overall cost of the algorithm down *hugely*. >>> >>> So I say, if you find yourself _wanting_ a method name to >>> appear 40 times in a day's work, you are doing something >>> badly wrong. >>> >>> For another data point, as part of building up my Smalltalk >>> skills, I used to pick up Java code and rewrite it in Smalltalk. >>> There were two invariable results: first, the code would >>> shrink by about a factor of six, and second, it would become >>> painfully obvious that the original code was really really >>> bad design, and that in a *good* OO design, most of the >>> classes wouldn't just shrink, they'd disappear. A good part >>> of this is down to Smalltalk's support for and extensive use >>> of higher order functions from day 1. >>> >>> > >>> > 3) Syntax coloring. (VIM color codes a file so that is there, emacs I >>> don't know AT ALL.) >>> To which Steve Strong replied >>> > I don't know of any editor that doesn't do this - >>> > even github displays syntax colouring on erlang files. >>> >>> My own text editor doesn't do syntax colouring. >>> Frankly, I hate syntax colouring. I could give you >>> a long rant about why. One big issue is that the >>> name is a lie. It's *lexical* colouring; the colour >>> depends on what kind of token something is. But I >>> can *see* that. If you offered me an editor where >>> calls to functions whose definitions had been edited >>> recently were brightly coloured, or where the functions >>> imported from a particular module were brightly coloured, >>> or where slicing was used to colour the places where a >>> particular variable could be *changed* and *used*, I'd >>> find that really really helpful. Why waste colour >>> telling me something that is already obvious at a glance? >>> I once came across a compiler (written in Finland) where >>> several passes had had to be woven together because of >>> the language it was written in, so they had coloured >>> each declaration and statement according to which pass >>> it was logically part of. Now _that's_ good use of colour! >>> >>> > >>> >> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- http://www.linkedin.com/in/torbenhoffmann @LeHoff -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Fri Jan 31 14:53:34 2014 From: mononcqc@REDACTED (Fred Hebert) Date: Fri, 31 Jan 2014 08:53:34 -0500 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: <20140131135334.GA91282@ferdair.local> On 01/31, kraythe . wrote: > Well I think after seeing the arguments and the response of the community I > am trending seriously towards Erlang. I will probably make the mental > investment to learn and become good with emacs. And then move on from > there. I may still have a ton of questions. I would still, for example, > love to know who to 'reload' my application once it is started. > > First of all, Erlang has two ways to call functions: local calls, and fully qualified calls. Basically, the local calls happen whenever you call a function internally within a module (`f(x)'), and fully qualified calls hapen when you call a function and prefix it with its module name (`my_mod:f(x)'). There are special cases for this around closures and anonymous functions, but it's not necessary to understand it just yet. For all basic code management, Erlang has what is more or less a process (Erlang process) running and managing a table of all modules currently loaded in the VM. Each module can have 0, 1, or two versions of a module loaded: - 0: module isn't loaded - 1: only a current version is loaded - 2: a current version and an old version are loaded. Let's focus on having one module loaded first. When you have one module loaded, and then ask to load a new version of the module (done through compiling, calling `l(Module)' from the shell, or through the `code' module), the current version becomes the 'old' version, and the new one becomes the 'current' version. Every single process, by default, will keep calling the 'old' version within local calls if they were in a local 'scope' for it already. When you do a fully-qualified function call, you *always* get the newest version. The mechanism is shown in http://learnyousomeerlang.com/designing-a-concurrent-application#hot-code-loving, with an image explaining what I mean here. Code reloading can be forced or controlled within a process by restraining when a fully qualified call is made: -module(hotload). -export([server/1, upgrade/1]). server(State) -> receive update -> NewState = ?MODULE:upgrade(State), ?MODULE:server(NewState); %% loop in the new version of the module SomeMessage -> %% do something here server(State) %% stay in the same version no matter what. end. upgrade(OldState) -> %% transform and return the state here. This requires understanding a bit of Erlang already. Now what happens when we already have two modules loaded and we load a third one? If we have processes still running code from the 'old' module, The Erlang VM more or less assumes it was an orphaned process and brutally kills it. Otherwise (or once all the orphans are kileld), the old copy is simply garbage collected. For large scale systems using the OTP framework, this mechanism often ends up not giving enough control to predictably upgrade to new versions of the software. In such cases, the `sys' module can be used to suspend individual processes and force them to adopt new code before resuming them, and the entire thing can be wrapped in a concept called a `relup' (which depends on you having build a `release'). The principles for relups and the `sys' modules are covered in http://learnyousomeerlang.com/relups#the-hiccups-of-appups-and-relups if you want a peek preview -- it's gonna be a while before relups are a concern once you begin learning the language. Regards, Fred. From roger@REDACTED Fri Jan 31 15:23:45 2014 From: roger@REDACTED (Roger Lipscombe) Date: Fri, 31 Jan 2014 14:23:45 +0000 Subject: [erlang-questions] "erlang-src" package upgrade breaks "syntax_tools" and rebar builds Message-ID: This morning, I let apt-get upgrade install a new "erlang-src" package. This has broken rebar. Specifically, I get the error message: ERROR: compile failed while processing /home/roger/Source/rebar/rebar: {'EXIT',{undef,[{epp_dodger,parse_file,["src/rebar_core.erl"],[]}, {rebar_erlc_compiler,compile_priority,1, [{file,"src/rebar_erlc_compiler.erl"}, {line,470}]}, That is: rebar fails to compile other things, but (here) is also seen failing to compile itself. Upon investigation, I discover that I have both "/usr/lib/erlang/lib/syntax_tools-1.6.12" and "/usr/lib/erlang/lib/syntax_tools-1.6.13". The "-1.6.12" directory contains "ebin", but no "src", and the "-1.6.13" directory contains "src", but no "ebin". It would appear that my installation is using the newer one, and failing to find the .beam files. So, some questions: 1. How do I (on Linux Mint 15, so basically Ubuntu) figure out which APT repository the .deb file came from? This so that I can lay blame appropriately. 2. I'd like to roll back the "erlang-src" package that broke this, but it appears to have the same version number as the previous one both are "1:16.b.3". Any idea how I do this? 3. Can I simply delete the offending, newer, directory? 4. If not, how do I get the binaries for "-1.6.13"? 5. Or: how do I compile the source to do that myself? My feeling is that Erlang Solutions have repackaged "erlang-src", and somehow bumped the version number so that it got upgraded (not that I can tell the difference), but that, for some reason, I'm not seeing the corresponding "erlang-syntax-tools" upgrade, which would contain the "ebin" directory. Help? Thanks, Roger. From attila.r.nohl@REDACTED Fri Jan 31 16:44:40 2014 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Fri, 31 Jan 2014 16:44:40 +0100 Subject: [erlang-questions] SNMP agent: modifying vacm, community, etc In-Reply-To: References: Message-ID: 2014-01-30 Daniel Goertzen : > I am working on an snmp agent and trying to figure out the 'proper' way to > locally edit tables like vacm, community, usm, etc. > > 1. One approach is to keep modifying config files through the snmpa_config > module and then call configure() on the appropriate mib module to reload the > config. > > 2. Another approach is to try to do everything through the appropriate mib > module, but in general they only provide add and delete operations (I need > to be able to see what is there). You might want to read directly the mnesia tables to get the configured targets. Of course, this is not nice. From g@REDACTED Fri Jan 31 17:56:45 2014 From: g@REDACTED (Garrett Smith) Date: Fri, 31 Jan 2014 10:56:45 -0600 Subject: [erlang-questions] CZMQ licensing In-Reply-To: References: Message-ID: Pieter, Welcome! On Fri, Jan 31, 2014 at 5:55 AM, Pieter Hintjens wrote: > CZMQ is not dual-licensed. Oops! > The licensing on CZMQ is LGPLv3+static link exception, the same as > libzmq and as most of the ZeroMQ projects. This license explicitly > allows bundling of the compiled code with commercial applications > under whatever license the user wants. It removes the LGPL/GPL > requirements on such bundles (static links). > > This is what I'd recommend for erlang-CZMQ too. It means taking > COPYING and COPYING.LESSER (since LGPLv3 is a patch on GPLv3) from > CZMQ or libzmq. Done! I will direct all attorney questions your way ;) > Mahesh is correct: without an explicit license, one cannot use a > software project, unless one is the owner. Eh, he's always right. Whatever. > -Pieter Garrett From g@REDACTED Fri Jan 31 18:05:25 2014 From: g@REDACTED (Garrett Smith) Date: Fri, 31 Jan 2014 11:05:25 -0600 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <2029482514.52715.1391158061241.JavaMail.zimbra@tpip.net> References: <2029482514.52715.1391158061241.JavaMail.zimbra@tpip.net> Message-ID: On Fri, Jan 31, 2014 at 2:47 AM, Andreas Schultz wrote: > Hi, > > ----- Original Message ----- >> Yes - Google didn't suggest this. >> >> Did anybody do any performance measurements on this? > > Not yet, didn't have time for it :-( I don't know if this is helpful or not to the question of benchmarking, but I've created a very simple behavior to compare erlang-czmq with erlzmq: https://github.com/gar1t/erlang-czmq/blob/master/src/zmq_gen_benchmark.erl There are two flavors of this - one for each library being benchmarked: https://github.com/gar1t/erlang-czmq/blob/master/src/erlzmq_benchmark.erl https://github.com/gar1t/erlang-czmq/blob/master/src/czmq_benchmark.erl In your Berlin workshop (tempted to travel for this :), if this topic comes up, maybe this could be helpful to run some quick tests. I'm very happy to help with this in any way! Garrett From aschultz@REDACTED Fri Jan 31 18:43:38 2014 From: aschultz@REDACTED (Andreas Schultz) Date: Fri, 31 Jan 2014 18:43:38 +0100 (CET) Subject: [erlang-questions] 0MQ libraries In-Reply-To: References: <629555314.52646.1391157894357.JavaMail.zimbra@tpip.net> Message-ID: <801508237.55533.1391190218356.JavaMail.zimbra@tpip.net> Hi, ----- Original Message ----- > On Fri, Jan 31, 2014 at 9:44 AM, Andreas Schultz wrote: > > > I got stuck when trying to control the queuing behavior on tcp socket, > > gen_tcp hides too much details of the underlying socket and the buffering > > in it also doesn't help. > > > > Can you remember what specifically your problem was? What controls do you > need on the socket in order for it to behave "correctly"? What do you mean > by queueing behaviour? What do you mean by buffering? gen_tcp buffers data internal (in the inet code) when it can't sent it immediately, I haven't found a way to query to amount of data buffered or force a flush of the buffers. My specific problem was that after a connection abort, I would not know how many of the previous messages where actually sent. It can happen that there are for example 1000 messages buffered in gen_tcp when it decides that the remote side has died. As far as I understood the 0MQ semantics, I should then try to reestablish the connection and transmit the pending messages. Without knowing how much was buffered in gen_tcp, that is not possible. Andreas > > > -- > J. > -- -- Dipl. Inform. Andreas Schultz From attila.r.nohl@REDACTED Fri Jan 31 19:03:51 2014 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Fri, 31 Jan 2014 19:03:51 +0100 Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: Message-ID: 2014-01-30 kraythe . : [...] > The tools are, well frankly, garbage. Sorry, in 2014 to be pushed back to > coding with VIM and makefiles is primitive. Rebar is crytptic and just the > pet project of a guy on GIT. Compared to Gradle, Maven and even (though I > don't care for it much) SBT, rebar is ... lacking. I want to spend time > working on my business logic, not fighting tools. There are plugins for > eclipse and intellij but they have minimal functionality and i keep > reverting back to vim. In some sense you're right, in some sense not. In a previous project our "integration build" was quite slow, when behaviors were modified, everything was recompiled because our Makefiles lacked proper dependencies. So some automatic dependecy generator would be nice (I don't know what rebar does). On the other hand in the normal development workflow I extremely rarely used make - the server code was running, I've made a vim function to connect to the server (it was running reshd, see http://www.lysator.liu.se/~tab/erlang/reshd/) and compile the currently opened file - under five seconds the new module was loaded in the running system and this five seconds contains typing :make . So vim is actually quite powerful in the right hands, with ctags you can navigate in the code, autocomplete identifiers, compile, etc. What missing is some kind of quick documentation lookup, because the Erlang standard library API is infamously inconsistent (find-like operations return [], no_value, false or crash when element not found, the container is the first or last parameter, etc.). For refactoring there's RefactorErl (http://plc.inf.elte.hu/erlang/refactorerl-features.html), but I haven't really used it. Even though I did a lot of refactoring, I didn't need that much tool support. From peerst@REDACTED Fri Jan 31 20:10:13 2014 From: peerst@REDACTED (Peer Stritzinger) Date: Fri, 31 Jan 2014 20:10:13 +0100 Subject: [erlang-questions] Dynamic Code and Atoms References: <20140123145441.GA13510@aluminium.local> Message-ID: You can increase the maximum number of atoms by passing the +t option to the emulator: http://www.erlang.org/doc/efficiency_guide/advanced.html#atoms Not sure how to pass emulator options to erlc but you can use something like: erl +t -compile Mod1 Mod2 or also use -make if you want to. Cheers, -- Peer On 2014-01-23 16:38:57 +0000, Vance Shipley said: > I don't necessarily need to do what I am doing, it just works quite > well ... up to a point. The alternative involves a lot of list > processing. Clause head matching on the other hand is really fast. My > challenge is to match a very large number of patterns and to do it very > fast and with the lowest cost. > On Jan 23, 2014 9:04 PM, "Anthony Ramine" wrote: > Sorry I didn?t reply to all the first time, putting the list back in the loop. > > Probably this problem was never encountered before. Do you really need > to do whatever you are doing like this? > > -- > Anthony Ramine > > Le 23 janv. 2014 ? 16:29, Vance Shipley a ?crit : > > > I'm well aware of the limits on the atom table, how to change it and > that it's not garbage collected. > > > > I'm not creating these atoms in my abstract forms. It appears to be > core Erlang (cerl) which is creating atoms. > > On Jan 23, 2014 8:50 PM, "Anthony Ramine" wrote: > > Yes and no, the atom table being limited in size is by design (cf. EEP20). > > > > What are you compiling, though, to reach such a limit? That sounds > completely insane to me. > > > > -- > > Anthony Ramine > > > > Le 23 janv. 2014 ? 15:54, Vance Shipley a ?crit : > > > > > I am finding that when I dynamically build a function with > > > a very large number of clauses the emulator crashes while > > > compilig (cmpile:forms/2) after hitting the atom table limit. > > > Looking at a erl_crash_.dump I can see that it was filling up > > > the atom table with 'corN' where N is an ever increasing number. > > > > > > Is this a design limitation? > > > > > > -- > > > ? ? ? -Vance > > > _______________________________________________ > > > erlang-questions mailing list > > > erlang-questions@REDACTED > > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksoe@REDACTED Fri Jan 31 21:24:33 2014 From: eriksoe@REDACTED (=?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?=) Date: Fri, 31 Jan 2014 21:24:33 +0100 Subject: [erlang-questions] 0MQ libraries In-Reply-To: <801508237.55533.1391190218356.JavaMail.zimbra@tpip.net> References: <629555314.52646.1391157894357.JavaMail.zimbra@tpip.net> <801508237.55533.1391190218356.JavaMail.zimbra@tpip.net> Message-ID: Either that's not correct, or the protocol is not reliable. I hope the first :-) The buffer in inet is only the tip of the amount of data which have been sent but may not have received - the OS has (unqueriable) buffers, and there may be data in transit on the physical level. Possibly I've misunderstood your description of the problem, but either way, when it comes to TCP, you're not supposed to be able to get unsent data back once you've passed it down to lower layers... Den 31/01/2014 18.43 skrev "Andreas Schultz" : > Hi, > > ----- Original Message ----- > > On Fri, Jan 31, 2014 at 9:44 AM, Andreas Schultz > wrote: > > > > > I got stuck when trying to control the queuing behavior on tcp socket, > > > gen_tcp hides too much details of the underlying socket and the > buffering > > > in it also doesn't help. > > > > > > > Can you remember what specifically your problem was? What controls do you > > need on the socket in order for it to behave "correctly"? What do you > mean > > by queueing behaviour? What do you mean by buffering? > > gen_tcp buffers data internal (in the inet code) when it can't sent it > immediately, > I haven't found a way to query to amount of data buffered or force a flush > of the > buffers. > > My specific problem was that after a connection abort, I would not know how > many of the previous messages where actually sent. > It can happen that there are for example 1000 messages buffered in gen_tcp > when > it decides that the remote side has died. As far as I understood the 0MQ > semantics, > I should then try to reestablish the connection and transmit the pending > messages. > Without knowing how much was buffered in gen_tcp, that is not possible. > > Andreas > > > > > > > -- > > J. > > > > -- > -- > Dipl. Inform. > Andreas Schultz > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kraythe@REDACTED Fri Jan 31 22:35:51 2014 From: kraythe@REDACTED (kraythe .) Date: Fri, 31 Jan 2014 15:35:51 -0600 Subject: [erlang-questions] Documentation on Binding a C library to Erlang Message-ID: Greetings, I am a newbie to erlang. I am interested in binding a c library that I have as source (that I have written) to Erlang. In Java I would use JNI. In Erlang I don't know. Can anyone point me at where the docs are for this? Especially a tutorial. Google has been unrevealing and i have been through hundreds of dead ends. Thanks in advance. -- Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Fri Jan 31 22:42:02 2014 From: vinoski@REDACTED (Steve Vinoski) Date: Fri, 31 Jan 2014 16:42:02 -0500 Subject: [erlang-questions] Documentation on Binding a C library to Erlang In-Reply-To: References: Message-ID: On Fri, Jan 31, 2014 at 4:35 PM, kraythe . wrote: > Greetings, I am a newbie to erlang. I am interested in binding a c library > that I have as source (that I have written) to Erlang. In Java I would use > JNI. In Erlang I don't know. Can anyone point me at where the docs are for > this? Especially a tutorial. Google has been unrevealing and i have been > through hundreds of dead ends. > If you really want the C library running together with the Erlang VM, you'll write either a set of native implemented functions (NIFs) or a linked-in driver. See the links below. http://www.erlang.org/doc/tutorial/nif.html http://www.erlang.org/doc/man/erl_nif.html http://www.erlang.org/doc/apps/erts/driver.html http://www.erlang.org/doc/man/erl_driver.html --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth.lundin@REDACTED Fri Jan 31 22:51:45 2014 From: kenneth.lundin@REDACTED (Kenneth Lundin) Date: Fri, 31 Jan 2014 22:51:45 +0100 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0-rc1 has been released. Message-ID: Erlang/OTP 17.0-rc1 has been released. This is an alpha release, which will be followed by a planned beta release about a month later and a final OTP 17.0 product release in the end of March 26, 2014. Between the alpha and beta and final release there will be new updates of the master branch with corrections and minor new features. Occasionally there might be new tags which we in that case will communicate and ask you to test. Erlang/OTP 17.0 is a new major release with new features, quite a few (characteristics) improvements, as well as some incompatibilities. See the README file and the documentation for more details. We would like to ask you to download and test the alpha release and send us your feedback as soon as possible, so that we can make the necessary corrections before OTP 17.0-rc2 and OTP 17.0, respectively. The release contains many changes; thus, some unexpected incompatibilities or issues may have slipped through our tests. Please try to build and run your current products/applications and let us know about any problems. Note! The new datatype MAP is not properly documented yet but the EEP 43 http://www.erlang.org/eeps/eep-0043.html will provide a good start. Also note that it is a limited implementation of maps implemented so far: - no variable keys are allowed - native code can not be generated for modules using maps Some other highlights of the release are: - Maps, a new dictionary data type (experimental) - A more natural mapping from ASN.1 OCTET STRING and BIT STRING to Erlang types, and other ASN.1 improvements and optimizations - The {active, N} socket option for TCP, UDP, and SCTP - A new (optional) scheduler utilization balancing mechanism - Migration of memory carriers has been enabled by default on all ERTS internal memory allocators - Increased garbage collection tenure rate - Experimental "dirty schedulers" functionality - Funs can now be given names - Miscellaneous unicode support enhancements - A new, semantic version scheme for OTP and its applications You can find the README file with more detailed info at http://www.erlang.org/download/otp_src_17.0-rc1.readme You can download the full source distribution from http://www.erlang.org/download/otp_src_17.0-rc1.tar.gz http://www.erlang.org/download/otp_src_17.0-rc1.readme (this file) Note: To unpack the TAR archive you need a GNU TAR compatible program. For installation instructions please read the README that is part of the distribution. You can also find this release at the official Erlang/OTP Git-repository at Github here: https://github.com/erlang/otp tagged *OTP_17.0-rc1* The Windows binary distribution can be downloaded from http://www.erlang.org/download/otp_win32_17.0-rc1.exe http://www.erlang.org/download/otp_win64_17.0-rc1.exe On-line documentation can be found at http://www.erlang.org/doc/. You can also download the complete HTML documentation or the Unix manual files http://www.erlang.org/download/otp_doc_html_17.0-rc1.tar.gz http://www.erlang.org/download/otp_doc_man_17.0-rc1.tar.gz We also want to thank those that sent us patches, suggestions and bug reports. The Erlang/OTP Team at Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.oxyde@REDACTED Fri Jan 31 23:30:29 2014 From: n.oxyde@REDACTED (Anthony Ramine) Date: Fri, 31 Jan 2014 23:30:29 +0100 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0-rc1 has been released. In-Reply-To: References: Message-ID: <2EA8BDCE-8F74-4339-98BE-2A7C6BD3EEBB@gmail.com> For those wondering, the syntax is: F = fun Fact(0) -> 1; Fact(N) when N > 0 -> N * Fact(N - 1) end, F(6). Regards, -- Anthony Ramine Le 31 janv. 2014 ? 22:51, Kenneth Lundin a ?crit : > - Funs can now be given names From thomasl_erlang@REDACTED Fri Jan 31 23:57:26 2014 From: thomasl_erlang@REDACTED (Thomas Lindgren) Date: Fri, 31 Jan 2014 14:57:26 -0800 (PST) Subject: [erlang-questions] The quest for the perfect programming language for massive concurrency. In-Reply-To: References: <89DAA09F-64B0-4565-A73C-784B5E8EB4C6@feuerlabs.com> <8883B14026CD4CB38E71BEB9DFE5BF67@srstrong.com> Message-ID: <1391209046.8442.YahooMailNeo@web140105.mail.bf1.yahoo.com> The basics of reloading your app or modules: - the simple way while developing is to write l(modulename). in the erlang shell to reload modulename for that VM. - if you want to be more sophisticated about it, dig into how OTP applications work There are also a number of hacks that let you reload all changed modules. Here's one: https://github.com/thomasl/erlang-repl-utils Best, Thomas On Friday, January 31, 2014 7:25 AM, kraythe . wrote: Well I think after seeing the arguments and the response of the community I am trending seriously towards Erlang. I will probably make the mental investment to learn and become good with emacs. And then move on from there. I may still have a ton of questions. I would still, for example, love to know who to 'reload' my application once it is started. > > > > >On Fri, Jan 31, 2014 at 12:24 AM, kraythe . wrote: > >Well I think after seeing the arguments and the response of the community I am trending seriously towards Erlang. I will probably make the mental investment to learn and become good with emacs. And then move on from there. I may still have a ton of questions. I would still, for example, love to know who to 'reload' my application once it is started. >> >> >>Robert Simmons Jr. MSc. - Lead Java Architect @ EA >>Author of: Hardcore Java (2003) and Maintainable Java (2012) >>LinkedIn:?http://www.linkedin.com/pub/robert-simmons/40/852/a39 >> >> >> >>On Thu, Jan 30, 2014 at 10:29 PM, Richard A. O'Keefe wrote: >> >> >>>On 31/01/2014, at 7:49 AM, Steve Strong wrote: >>>> On Thursday, 30 January 2014 at 19:10, kraythe . wrote: >>> >>>>> 1) Code completion. Sorry but I can't be bothered to type the same flipping method name in its entirety 40 times. >>> >>> >>>There are three causes for "completion" in languages like >>>Prolog and Erlang: >>> >>>(a) Definitions with multiple clauses. >>>? ? Your editor should be able to turn "add a clause" into a >>>? ? single command. >>> >>>(b) Recursion. >>>? ? Your editor should be able to turn "add a recursive call" >>>? ? into a single command (basically the same as (a), just >>>? ? different stuff wrapped around it). >>> >>>? ? A programming style using higher order procedures can >>>? ? eliminate a lot of this. >>> >>>(c) Repetitive patterns of code. >>> >>>? ? A programming style using higher order procedures can >>>? ? eliminate a lot of this. >>> >>>There's a thing I find myself saying more and more often: >>> >>>? ? ? ? Why can't I see the structure? >>> >>>I was reviewing a page or two of Prolog code for someone the >>>other day. ?By the end of three hours, I'd made some progress, >>>but I was troubled. ?The code was clean, but it wasn't OBVIOUS. >>>What finally dawned on me would have been instantly obvious to >>>a real functional programmer: ?the code was an interweaving of >>>a "compute argmax of a partial function over a finite domain" >>>and "here is this partial function". ?Actually introducing the >>>higher order function in question let me explore several ways >>>of implementing that *without* any effect on the rest of the >>>code. ?Breaking the specific partial function out and naming >>>it let me see that memoising *that* function -- which hadn't >>>previously existed -- stood an excellent chance of reducing >>>the overall cost of the algorithm down *hugely*. >>> >>>So I say, if you find yourself _wanting_ a method name to >>>appear 40 times in a day's work, you are doing something >>>badly wrong. >>> >>>For another data point, as part of building up my Smalltalk >>>skills, I used to pick up Java code and rewrite it in Smalltalk. >>>There were two invariable results: ?first, the code would >>>shrink by about a factor of six, and second, it would become >>>painfully obvious that the original code was really really >>>bad design, and that in a *good* OO design, most of the >>>classes wouldn't just shrink, they'd disappear. ?A good part >>>of this is down to Smalltalk's support for and extensive use >>>of higher order functions from day 1. >>> >>> >>>> >>>> 3) Syntax coloring. (VIM color codes a file so that is there, emacs I don't know AT ALL.) >>>To which Steve Strong replied >>> >>>> I don?t know of any editor that doesn?t do this - >>>> even github displays syntax colouring on erlang files. >>> >>>My own text editor doesn't do syntax colouring. >>>Frankly, I hate syntax colouring. ?I could give you >>>a long rant about why. ?One big issue is that the >>>name is a lie. ?It's *lexical* colouring; the colour >>>depends on what kind of token something is. ?But I >>>can *see* that. ?If you offered me an editor where >>>calls to functions whose definitions had been edited >>>recently were brightly coloured, or where the functions >>>imported from a particular module were brightly coloured, >>>or where slicing was used to colour the places where a >>>particular variable could be *changed* and *used*, I'd >>>find that really really helpful. ?Why waste colour >>>telling me something that is already obvious at a glance? >>>I once came across a compiler (written in Finland) where >>>several passes had had to be woven together because of >>>the language it was written in, so they had coloured >>>each declaration and statement according to which pass >>>it was logically part of. ?Now _that's_ good use of colour! >>> >>>> >>> >> > >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt_hoffman@REDACTED Fri Jan 31 23:11:35 2014 From: matt_hoffman@REDACTED (Matt Hoffman) Date: Fri, 31 Jan 2014 22:11:35 +0000 Subject: [erlang-questions] Erlang/Scala Data Storage & Analysis Team Message-ID: <72D64D6B9C860B4CA78498D6F4F8BEFDBE992E0B@oasslcexm03.oaifield.onasgn.com> Hello All, I had a conversation with an engineer who wasn't open to new opportunities but was kind enough to suggest I try this list. I wasn't able to find any info requesting jobs not be shared so... here I go. I'm helping a Chicago product team grow as they design and architect their data storage & analysis product and would be happy to talk with anyone on the list interested in new functional programming opportunities. There is openness to remote work for candidates who've had a volume of experience working remotely (you'd be their first so they'd look to you to get their remote infrastructure set). Chicago is preferred because they're a pretty collaborative team and enjoy working together in office. They've come through an international accelerator, have funding, and they have a great start on hiring a talented team (I've placed two of their engineers so perhaps I'm biased). You're probably a great fit for them if you've had experience with/have interest in distributed systems, functional programming, and you enjoy solving complex data problems. They're probably a great fit for you if you enjoy being involved in fundamental product decisions, working with very smart engineers, and you want a degree of ownership of your work. They look to hire self-managed engineers who see beyond their own production to how their decisions impact overall design and architecture. I'd be happy to share details if you find any interest in what I've mentioned so far. Working with me is pretty easy -- I am not a sales-y recruiter. I'm interested in helping candidates find an improvement above and beyond their current job and helping them through the interview process. Feel free to reach out as it's convenient. Best regards, Matt __________________________________ Matthew Hoffman Senior Recruiting Specialist Centerpoint a division of Oxford Global Resources 135 S LaSalle St Suite 3010 Chicago, IL 60603 312.750.1598 Office 312.726.3895 FAX matt_hoffman@REDACTED www.oxfordcorp.com Oxford Europe NYSE: ASGN The Right Talent. Right Now.(r) The information transmitted, including attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this e-mail in error, please notify the sender immediately by replying to the message and deleting the material from your computer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan.strigler@REDACTED Fri Jan 31 23:45:36 2014 From: stefan.strigler@REDACTED (Stefan Strigler) Date: Fri, 31 Jan 2014 23:45:36 +0100 Subject: [erlang-questions] [ANN] Erlang/OTP 17.0-rc1 has been released. In-Reply-To: <2EA8BDCE-8F74-4339-98BE-2A7C6BD3EEBB@gmail.com> References: <2EA8BDCE-8F74-4339-98BE-2A7C6BD3EEBB@gmail.com> Message-ID: <8F68CDF4-7FFF-4CD8-8088-9ED4E0DFDB39@gmail.com> Pun intended? On 31.01.2014, at 23:30, Anthony Ramine wrote: > For those wondering, the syntax is: > > F = fun Fact(0) -> 1; Fact(N) when N > 0 -> N * Fact(N - 1) end, ^^^^^^^^^^ > F(6). > > Regards, > > -- > Anthony Ramine > > Le 31 janv. 2014 ? 22:51, Kenneth Lundin a ?crit : > >> - Funs can now be given names > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions