From per.melin@REDACTED Thu Jul 1 00:23:33 2010 From: per.melin@REDACTED (Per Melin) Date: Thu, 1 Jul 2010 00:23:33 +0200 Subject: [erlang-questions] RE: TCP performance In-Reply-To: References: Message-ID: On Fri, Jun 18, 2010 at 10:21 PM, Chris Hicks wrote: > Of course maybe my test case is too naive? I'm basically just > bombarding the tcp connection from a single process as I figured > it would give me a clear enough indication of how long it would > take to handle the connections. >From my experience I'd say that you should be able to do at least a couple of thousand connects per second. My first suggestion would be to increase the backlog option of gen_tcp:listen/2 to 1000. Your code looks like it will fire off connects faster than they can be accepted, and once that queue grows past the max backlog the requests will be dropped and retried, which kills your performance. From comptekki@REDACTED Thu Jul 1 00:43:31 2010 From: comptekki@REDACTED (Wes James) Date: Wed, 30 Jun 2010 16:43:31 -0600 Subject: [erlang-questions] Re: try catch scope In-Reply-To: <20100630141731.GA12774@erix.ericsson.se> References: <848w5wybwl.fsf@linux-b2a3.site> <20100630141731.GA12774@erix.ericsson.se> Message-ID: On Wed, Jun 30, 2010 at 8:17 AM, Raimo Niskanen wrote: > On Wed, Jun 30, 2010 at 07:33:39AM -0600, Wes James wrote: >> Mangus, >> >> Thanks! This is much better! >> >> has_query(A) -> >> ? ? ? try >> ? ? ? ? ? ? ? yaws_api:parse_query(A) /= [] >> ? ? ? catch >> ? ? ? ? ? ? ? _:_ -> false >> ? ? ? end. >> >> -wes > > This might be even clearer (separating the right and wrong cases): > > has_query(A) -> > ? ?try yaws_api:parse_query(A) of > ? ? ? ?[] -> false; > ? ? ? ?_ -> true % Were you supposed to return true for this case? > ? ?catch > ? ? ? ?error:_ -> false % Only cathes runtime errors, not exit/1. > ? ?end. > Thanks. This works too. Bottom line, is I want to show the default search page even if the parse_query call throws an error. Maybe someone is trying to insert bad chars or such in to the URL to try to reveal something or even hack the system, etc. thx, -wes From ok@REDACTED Thu Jul 1 06:04:49 2010 From: ok@REDACTED (Richard O'Keefe) Date: Thu, 1 Jul 2010 16:04:49 +1200 Subject: [erlang-questions] Re: Compare XML string In-Reply-To: <4C29DBC5.8080903@nm.ru> References: <4C29DBC5.8080903@nm.ru> Message-ID: <94DF6F13-2007-4393-AC1A-74BFDDD6ADDC@cs.otago.ac.nz> On Jun 29, 2010, at 11:40 PM, Dmitry Belyaev wrote: > First of all, what does author want to compare: plain strings or xml > documents? > > If documents (or parts of documents) then what about order of > attributes and child elements? Does it matter? A structure-based XML application shouldn't care what the order of attributes is. (In particular, given that XML, like SGML before it, allows defaulting of attributes, I don't believe there is any definition anywhere of where the defaulted attributes would go in any sequence.) Here's what I'm getting at: f% cat foo.xml ]> The two instances of look different, but after defaulting, they have the same values for all attributes: f% xmls foo.xml | qe -hr {document,[{root,"-"}],[ {foo,[],[ {bar,[{y,"Y"},{x,"X"}],[]}, {bar,[{y,"Y"},{x,"X"}],[]}]}]}. This tool-chain ends up putting attributes in reverse alphabetic order. (xmls puts them in alphabetic order after defaulting, then qe, being rather lazy internally, reverses them.) > > > >> code=\"102\">Authentication Successful ... >>> Exp String: >>> >> code=\"102\">Authentication Successful ... >>> >>> Eq 2: >>> Given String >>> >> code=\"102\">Authentication Successful ... >>> >> status=\"offline\" custom=\"Is offline\" group=\"Friends\" >>> blocked=\"no\"/> >>> >>> Expected: >>> Authentication >>> Successful ... >>> >> status=\"online\" custom=\"Is offline\" group=\"Friends\" >>> blocked=\"no\"/> >>> >>> Regards, >>> Sandeep >>> >>> ________________________________________________________________ >>> erlang-questions (at) erlang.org mailing list. >>> Seehttp://www.erlang.org/faq.html >>> To unsubscribe; mailto:erlang-questions-unsubscr...@REDACTED >>> >> ________________________________________________________________ >> erlang-questions (at) erlang.org mailing list. >> See http://www.erlang.org/faq.html >> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED >> >> >> > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From antoine.koener@REDACTED Thu Jul 1 14:18:33 2010 From: antoine.koener@REDACTED (Antoine Koener) Date: Thu, 1 Jul 2010 14:18:33 +0200 Subject: [erlang-questions] binary expression with fixed and variable fields In-Reply-To: <201006291922003122229@its3.ch> References: <201006291922003122229@its3.ch> Message-ID: On Tue, Jun 29, 2010 at 7:22 PM, info wrote: > Hi all, > I have a string composed of several fixed and variable fields. I would like > to parse this string as binary expression. > I checked the example with an IP datagram (the variable fields are to the > end ...): > > <> > > If the size3 of the field3 is variable,how to parse the string ? > Fields Size must be determined before the match or within the match. see http://erlang.org/doc/programming_examples/bit_syntax.html#id2261909 > > <> but after ? > > If a field is empty, how to detect it ? > Use another binary expression. case Bin of <> -> ; <> -> ; _ -> % catch all others ok end > If a char (e.g comma) is between each field, is it always possible to use > the binary syntax ? > Just use the "," notation: <> Long binary strings are used whenever the binary holds enough information for itself, when you need to "parse" and not "match" you may use smaller binary strings. Taken from some kind of code of mine: -define( UINT32(X), X:32/native-unsigned). -define( UINT16(X), X:16/native-unsigned). action(5522146, _Function, << ?UINT32(Hwnd), ?UINT16(Size), Title:Size/binary, ?UINT32(X), ?UINT32(Y), ?UINT32(Cx), ?UINT32(Cy)>>, Pid) -> %io:format("~p: ~s, ~p ~p ~p~n", [?MODULE, Function, Pid, Hwnd, Title ]), my 2 cents. From bile@REDACTED Thu Jul 1 17:32:10 2010 From: bile@REDACTED (bile@REDACTED) Date: Thu, 1 Jul 2010 11:32:10 -0400 Subject: Pretty print terms from erl_call Message-ID: <20100701113210.0b201349@otis> I've been fooling around with erl_call and am wondering if there is any simple way to get it to pretty print the string returned by the -a call? Is the way the shell pretty prints documented anywhere? From info@REDACTED Thu Jul 1 18:49:08 2010 From: info@REDACTED (info) Date: Thu, 1 Jul 2010 18:49:08 +0200 Subject: [erlang-questions] binary expression with fixed and variablefields References: <201006291922003122229@its3.ch>, Message-ID: <201007011849079531993@its3.ch> On Tue, Jun 29, 2010 at 7:22 PM, info wrote: Hi all, I have a string composed of several fixed and variable fields. I would like to parse this string as binary expression. I checked the example with an IP datagram (the variable fields are to the end ...): <> If the size3 of the field3 is variable,how to parse the string ? Fields Size must be determined before the match or within the match. see http://erlang.org/doc/programming_examples/bit_syntax.html#id2261909 The general question is: shall I use the bit syntax to extract each field or shall I use the token method ? After extraction with the bit syntax, each field will be integer. I must convert again in string if I want to compare with something. I don't see what I win or what I lost ! What is the more efficient in Erlang ? I read in this forum to evict the string syntax because of the "bad" representation of the char in erlang. <> but after ? If a field is empty, how to detect it ? Use another binary expression. case Bin of <> -> ; <> -> ; _ -> % catch all others ok end How can I know if the field3 is empty? by the size of the full string. But if 2 fields are empty, it's impossible. And if the field3 and the field4 are empty, you will have four versions in your case (2 power N) ! If a char (e.g comma) is between each field, is it always possible to use the binary syntax ? Just use the "," notation: <> What is "better" in Erlang: "," or _:8 Long binary strings are used whenever the binary holds enough information for itself, when you need to "parse" and not "match" you may use smaller binary strings. Taken from some kind of code of mine: -define( UINT32(X), X:32/native-unsigned). -define( UINT16(X), X:16/native-unsigned). action(5522146, _Function, << ?UINT32(Hwnd), ?UINT16(Size), Title:Size/binary, ?UINT32(X), ?UINT32(Y), ?UINT32(Cx), ?UINT32(Cy)>>, Pid) -> %io:format("~p: ~s, ~p ~p ~p~n", [?MODULE, Function, Pid, Hwnd, Title ]), my 2 cents. From rzezeski@REDACTED Thu Jul 1 21:22:34 2010 From: rzezeski@REDACTED (Ryan Zezeski) Date: Thu, 1 Jul 2010 15:22:34 -0400 Subject: Stream entity body in inets httpd Message-ID: Is there any way to either get the entity body as a binary or stream the entity body from an HTTP request to inets? I'm working on an application that needs to be able to accept a PUT request for CSVs over 160M in size. When I send the request to inets the Erlang VM quickly uses up all my free memory (~5GB). My guess this is because inets puts the entity body in a list, rather than keeping it as a binary. I spent some time looking through the source code, but didn't see any way to change this behavior. It looks to be hardcoded. -Ryan From steven.charles.davis@REDACTED Fri Jul 2 02:58:34 2010 From: steven.charles.davis@REDACTED (Steve Davis) Date: Thu, 1 Jul 2010 17:58:34 -0700 (PDT) Subject: binary expression with fixed and variablefields In-Reply-To: <201007011849079531993@its3.ch> References: <201006291922003122229@its3.ch>, <201007011849079531993@its3.ch> Message-ID: On a related note, I find it curious that there's the following limitation forcing you to manually calculate the size of an already known binary: 1> <<"a", _/binary>> = <<"abc">>. <<"abc">> 2> A = <<"a">>. <<"a">> 3> ABC = <<"abc">>. <<"abc">> 4> <> = ABC. ** exception error: no match of right hand side value <<"abc">> 5> Size = size(A). 1 6> <> = ABC. <<"abc">> ...a minor inconvenience, but irritating. Perhaps there's a reason that I don't immediately see why 4> isn't valid? /s From rvirding@REDACTED Fri Jul 2 03:13:51 2010 From: rvirding@REDACTED (Robert Virding) Date: Fri, 2 Jul 2010 03:13:51 +0200 Subject: [erlang-questions] Re: binary expression with fixed and variablefields In-Reply-To: References: <201006291922003122229@its3.ch> <201007011849079531993@its3.ch> Message-ID: The main reason why 4> isn't valid is that the default type of a binary segment is an integer. So by not qualifying A you are trying to match an integer from ABC with the *binary* <<"a">>, which can never match. That 1> works is because a string literal in a binary is expanded into the sequence of bytes in the string. So in effect 1> is equivalent to <<$a,_/binary>> = <<$a,$b,$c>>. Robert On 2 July 2010 02:58, Steve Davis wrote: > On a related note, I find it curious that there's the following > limitation forcing you to manually calculate the size of an already > known binary: > > 1> <<"a", _/binary>> = <<"abc">>. > <<"abc">> > 2> A = <<"a">>. > <<"a">> > 3> ABC = <<"abc">>. > <<"abc">> > 4> <> = ABC. > ** exception error: no match of right hand side value <<"abc">> > 5> Size = size(A). > 1 > 6> <> = ABC. > <<"abc">> > > ...a minor inconvenience, but irritating. > > Perhaps there's a reason that I don't immediately see why 4> isn't > valid? > > /s > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From tanduy.vo@REDACTED Fri Jul 2 06:21:17 2010 From: tanduy.vo@REDACTED (tanduy) Date: Thu, 1 Jul 2010 21:21:17 -0700 (PDT) Subject: Installing Module and Adding Path : Ibrowse In-Reply-To: References: Message-ID: <40179f8f-7877-4e65-804a-4c39e3714a85@x24g2000pro.googlegroups.com> Hi Ted Karmel. If you copy & build ibrowse under this path: erl -noshell -eval 'io:format("~s/lib",[code:root_dir()])' -s init stop You start erl anywhere that can load module ibrowse Duy. On Jun 29, 10:32?pm, Ted Karmel wrote: > Sorry for the noob question. > > I am trying to install the ibrowse erlang module (http://wiki.github.com/cmullaparthi/ibrowse/ibrowse-api). > > I created a directory separate from the erlang lib one ( i.e. > usr/local/lib/erlang/lib ?). > > I downloaded ibrowse to this folder and compiled ( make ) it successfully. > > I added this directory to the code path with the built in code module > (http://www.erlang.org/doc/man/code.html). > > When I try using the ibrowse module from the erl command, it works > when I am in the ibrowse directory and the ebin folder. > > However, whenever I am in another folder, I cannot call the ibrowse > module. ?It is simply not recognized. > > Help. > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > Seehttp://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscr...@REDACTED From ulf.wiger@REDACTED Fri Jul 2 12:44:19 2010 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Fri, 02 Jul 2010 12:44:19 +0200 Subject: RFC: parse_trans for code generation Message-ID: <4C2DC303.7060408@erlang-solutions.com> I realize that quite the minority of list readers take an interest in parse transforms. Nevertheless, I thought I'd highlight a small addition to the parse_trans project to assist code generation. http://github.com/esl/parse_trans (Note too the new location. The old repos still exists, but I strongly recommend that you pull from the esl location.) The parse_trans library has primarily offered various ways to fold over code in various passes in order to collect information and then make small transformations to code. However, when generating significant amounts of code, you tend to end up with tons of abstract code that looks pretty horrible from a maintenance perspective (I've occasionally thought about making an Abstract Form <-> XML translator and calling it Executable XML - to be released on April 1, of course.) To help things somewhat, I made a code generation parse transform, called parse_trans_codegen. A small, highly contrived, example can be found at http://github.com/esl/parse_trans/blob/master/examples/ex_codegen.erl Since it is small, I can include it here: -module(ex_codegen). -compile({parse_transform, parse_trans_codegen}). -export([f/1, g/2, gen/2]). f(Name) -> codegen:gen_function( Name, fun(1,2,3) -> foo; (A,B,C) -> {A,B,C} end). g(Name, V) -> codegen:gen_function( Name, fun(L) -> member({'$var',V}, L) end). gen(Name, X) -> codegen:gen_function( Name, fun(L) -> lists:member({'$var',X}, L) end). The codegen:gen_function/2 function is just a pseudo function that triggers the transformation. It takes as first argument the name of the function being generated, and as second argument an anonymous function whose body defines the semantics of the generated function. A named function is generated with the same clauses as the provided fun. The {'$var',V} construct in g/2 is a trick to allow value expansion at code generation time. The arity of the generated function is derived from the provided fun. Using a utility function in parse_trans, we can inspect the result of the compile-time transformation: uwiger@REDACTED:~/ETC/git/parse_trans/examples$ erl -pa ../ebin Erlang R13B04 (erts-5.7.5) [source] [rq:1] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.7.5 (abort with ^G) 1> parse_trans:pp_beam("ex_codegen.beam"). -file("./ex_codegen.erl", 1). -module(ex_codegen). -export([f/1, g/2, gen/2]). f(Name) -> {function, 9, Name, 3, [{clause, 11, [{integer, 11, 1}, {integer, 11, 2}, {integer, 11, 3}], [], [{atom, 12, foo}]}, {clause, 13, [{var, 13, 'A'}, {var, 13, 'B'}, {var, 13, 'C'}], [], [{tuple, 14, [{var, 14, 'A'}, {var, 14, 'B'}, {var, 14, 'C'}]}]}]}. g(Name, V) -> {function, 20, Name, 1, [{clause, 22, [{var, 22, 'L'}], [], [{call, 23, {atom, 23, member}, [erl_parse:abstract(V, 23), {var, 23, 'L'}]}]}]}. gen(Name, X) -> {function, 28, Name, 1, [{clause, 28, [{var, 28, 'L'}], [], [{call, 28, {remote, 28, {atom, 28, lists}, {atom, 28, member}}, [erl_parse:abstract(X, 28), {var, 28, 'L'}]}]}]}. ok (The final 'ok' is the return value from the pretty-printing.) We can call one of the functions: 2> ex_codegen:g(foo, bar). {function,20,foo,1, [{clause,22, [{var,22,'L'}], [], [{call,23, {atom,23,member}, [{atom,23,bar},{var,23,'L'}]}]}]} It is easier to see what happened if we pretty-print the result: 2> ex_codegen:gen(contains_17, 17). {function,28,contains_17,1, [{clause,28, [{var,28,'L'}], [], [{call,28, {remote,28,{atom,28,lists},{atom,28,member}}, [{integer,28,17},{var,28,'L'}]}]}]} 3> io:fwrite("~s~n", [erl_pp:form(v(2))]). contains_17(L) -> lists:member(17, L). ok (Again, the trailing 'ok' is just the return value.) The {'$var', V} construct allows us to dynamically insert values into the code at generation time. I hope some of you find it useful. Comments are welcome. There is not much documentation - only a couple of paragraphs in the edoc for parse_trans_codegen:parse_transform/2. BR, Ulf W -- Ulf Wiger CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd http://www.erlang-solutions.com From serge@REDACTED Fri Jul 2 17:45:55 2010 From: serge@REDACTED (Serge Aleynikov) Date: Fri, 02 Jul 2010 11:45:55 -0400 Subject: type specification Message-ID: <4C2E09B3.2050505@aleynikov.org> Can user-defined type specification be imported from or referenced to another module? E.g. if I have a function that returns date/time value in the same format as calendar:now_to_local_time/1 whose type t_datetime1970() is defined in the calendar module, what would the -spec of my function be: -spec local_time() -> ??? local_time() -> calendar:now_to_local_time(now()). From kostis@REDACTED Fri Jul 2 18:41:31 2010 From: kostis@REDACTED (Kostis Sagonas) Date: Fri, 02 Jul 2010 19:41:31 +0300 Subject: [erlang-questions] type specification In-Reply-To: <4C2E09B3.2050505@aleynikov.org> References: <4C2E09B3.2050505@aleynikov.org> Message-ID: <4C2E16BB.8050506@cs.ntua.gr> Serge Aleynikov wrote: > Can user-defined type specification be imported from or referenced to > another module? > > E.g. if I have a function that returns date/time value in the same > format as calendar:now_to_local_time/1 whose type t_datetime1970() is > defined in the calendar module, what would the -spec of my function be: > > -spec local_time() -> ??? > local_time() -> > calendar:now_to_local_time(now()). If the type is exported (cf. the new -export_type attribute) then what you want to write is as simple as: -spec local_time() -> calendar:t_datetime1970(). In this particular case, the t_datetime1970() is not exported, so you either need to clone it in your module or send a request to the module's maintainer to export this type. Kostis PS. Btw, I've just checked the 'calendar' manual page and the only types that it mentions there are date() and time(), which are also not exported by the module (and actually have slightly different names t_date() and t_time()). IMO, they should be renamed and exported. It's not so clear to me whether datetime1970() should also be in the same category. From kiszl@REDACTED Fri Jul 2 19:30:21 2010 From: kiszl@REDACTED (Zoltan Lajos Kis) Date: Fri, 02 Jul 2010 19:30:21 +0200 Subject: [erlang-questions] type specification In-Reply-To: <4C2E16BB.8050506@cs.ntua.gr> References: <4C2E09B3.2050505@aleynikov.org> <4C2E16BB.8050506@cs.ntua.gr> Message-ID: <4C2E222D.7070000@tmit.bme.hu> On 7/2/2010 6:41 PM, Kostis Sagonas wrote: > Serge Aleynikov wrote: >> Can user-defined type specification be imported from or referenced to >> another module? >> >> E.g. if I have a function that returns date/time value in the same >> format as calendar:now_to_local_time/1 whose type t_datetime1970() is >> defined in the calendar module, what would the -spec of my function be: >> >> -spec local_time() -> ??? >> local_time() -> >> calendar:now_to_local_time(now()). > > If the type is exported (cf. the new -export_type attribute) then what > you want to write is as simple as: > > -spec local_time() -> calendar:t_datetime1970(). > > In this particular case, the t_datetime1970() is not exported, so you > either need to clone it in your module or send a request to the > module's maintainer to export this type. > > Kostis > Could you explain how the new export_type attribute relates to the opaque attribute? In R14A it seems that if I define an opaque type (without exporting it), and try to use it in another module, dialyzer emits an unknown type warning. If I export the type the warning is not emitted, but the type is not treated as opaque anymore... Thank you, Zoltan. From erlang@REDACTED Fri Jul 2 23:05:10 2010 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 2 Jul 2010 23:05:10 +0200 Subject: [erlang-questions] two simple escript questions In-Reply-To: References: Message-ID: #!/usr/local/bin/escript main(_) -> Name = io:get_line("What's your name?\n> "), io:format("Hello ~s!~n", [Name]). erl -man io is your friend /Joe On Tue, Jun 29, 2010 at 9:44 PM, Gonzalo wrote: > Hi all, > > I have two questions regarding the following simple erlang script: > > > #!/opt/local/bin/escript > main(_) -> {ok, Name} = io:read("What's your name?\n> "), > ? ? ? ? ? io:format("Hello ~s!~n", [Name]). > > Execution: > > Denver:Erlang gonzalo$ ./hello > What's your name? >> gonzalo. > Hello gonzalo! > > It works for a simple atom. > > 1. I would like to modify this script so I could type anything. > Examples: gonzalo, jean paul, Gonzalo, Jean Paul, etc. > > 2. It seems that io:read() expects an expression ending with a dot (.) > Is it possible to avoid this? Just pressing enter should work. > > Thanks for your tips. > Gonzalo. > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From info@REDACTED Fri Jul 2 23:32:16 2010 From: info@REDACTED (info) Date: Fri, 2 Jul 2010 23:32:16 +0200 Subject: bit syntax or tokens ? Message-ID: <201007022332132816745@its3.ch> Given a string S = <<"ABC,DE,FGH">>. I do <> = S. and Alpha. gives 4276803 How to find the string ABC from Alpha ? The bix syntax seems to be better in Erlang but is it a good approach to extract string fields from a string or is it better to use the tokens ? John From jesper.louis.andersen@REDACTED Fri Jul 2 23:38:03 2010 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Fri, 2 Jul 2010 23:38:03 +0200 Subject: [erlang-questions] bit syntax or tokens ? In-Reply-To: <201007022332132816745@its3.ch> References: <201007022332132816745@its3.ch> Message-ID: On Fri, Jul 2, 2010 at 11:32 PM, info wrote: > Given a string S = <<"ABC,DE,FGH">>. > I do > <> = S. > and > Alpha. gives 4276803 This is an excellent case for the new R14A/EEP-31 binary module, presumed I understand your question: 3> binary:split(<<"ABC,DE,FHG">>, <<",">>). [<<"ABC">>,<<"DE,FHG">>] -- J. From rvirding@REDACTED Sat Jul 3 00:06:10 2010 From: rvirding@REDACTED (Robert Virding) Date: Sat, 3 Jul 2010 00:06:10 +0200 Subject: [erlang-questions] bit syntax or tokens ? In-Reply-To: References: <201007022332132816745@its3.ch> Message-ID: Another alternative is to do: <> = S. which will give binaries A, B and G. It is, however, a very static way of doing it. Using the new binary module as Jesper suggests is much more dynamic and adaptable. While you can put what you want into a binary the bit syntax was never really designed for string fields, especially not dynamic ones, as you can't search with it. How much do you know about the substrings and what are you going to do with them once you have got them? This can also influence how you extract them. Robert On 2 July 2010 23:38, Jesper Louis Andersen wrote: > On Fri, Jul 2, 2010 at 11:32 PM, info wrote: >> Given a string S = <<"ABC,DE,FGH">>. >> I do >> <> = S. >> and >> Alpha. gives 4276803 > > This is an excellent case for the new R14A/EEP-31 binary module, > presumed I understand your question: > > 3> binary:split(<<"ABC,DE,FHG">>, <<",">>). > [<<"ABC">>,<<"DE,FHG">>] > > > -- > J. > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From vances@REDACTED Sat Jul 3 00:28:36 2010 From: vances@REDACTED (Vance Shipley) Date: Fri, 2 Jul 2010 18:28:36 -0400 Subject: Change node name in mnesia In-Reply-To: <20100214031924.GM13976@h216-235-12-174.host.egate.net> References: <20100214031924.GM13976@h216-235-12-174.host.egate.net> Message-ID: <20100702222835.GC267@h216-235-12-169.host.egate.net> Is it valid to have records in an mnesia table of this form: {log_header,dcl_log,"1.0","4.4.10",'foo@REDACTED',{1266,113437,587068}}, The tables seem to be working fine even though these entries are there which obviously do not have the correct OID for the table. What I'd like to understand is if I've broken the tables myself or if this type of thing is valid and I should just deal with them when traversing a table with mnesia:foldl/3. -Vance On Sat, Feb 13, 2010 at 10:19:24PM -0500, Vance Shipley wrote: } I used the example in the Mnesia User's Guide to backup } and transform a database from a long node name to a short } one. That all seemed to go smoothly enough but now I'm } noticing these strange records in my tables: } } {log_header,dcl_log,"1.0","4.4.10",'foo@REDACTED',{1266,113437,587068}}, } } I discovered this using mnesia:foldl/3. Is this normal } or have I messed things up? } } -- } -Vance } } ________________________________________________________________ } erlang-questions (at) erlang.org mailing list. } See http://www.erlang.org/faq.html } To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED -- -Vance From dgud@REDACTED Sat Jul 3 09:09:31 2010 From: dgud@REDACTED (Dan Gudmundsson) Date: Sat, 3 Jul 2010 09:09:31 +0200 Subject: [erlang-questions] Re: Change node name in mnesia In-Reply-To: <20100702222835.GC267@h216-235-12-169.host.egate.net> References: <20100214031924.GM13976@h216-235-12-174.host.egate.net> <20100702222835.GC267@h216-235-12-169.host.egate.net> Message-ID: Are you seeing those in the ets table? They should not be in the table, they are what they say the header of a TABLE.DCL file. Either you or I have some improvements to do :-) /Dan On Sat, Jul 3, 2010 at 12:28 AM, Vance Shipley wrote: > Is it valid to have records in an mnesia table of this form: > > ?{log_header,dcl_log,"1.0","4.4.10",'foo@REDACTED',{1266,113437,587068}}, > > The tables seem to be working fine even though these entries are > there which obviously do not have the correct OID for the table. > > What I'd like to understand is if I've broken the tables myself > or if this type of thing is valid and I should just deal with > them when traversing a table with mnesia:foldl/3. > > ? ? ? ?-Vance > > On Sat, Feb 13, 2010 at 10:19:24PM -0500, Vance Shipley wrote: > } ?I used the example in the Mnesia User's Guide to backup > } ?and transform a database from a long node name to a short > } ?one. ?That all seemed to go smoothly enough but now I'm > } ?noticing these strange records in my tables: > } > } ? ? {log_header,dcl_log,"1.0","4.4.10",'foo@REDACTED',{1266,113437,587068}}, > } > } ?I discovered this using mnesia:foldl/3. ?Is this normal > } ?or have I messed things up? > } > } ?-- > } ? ? ? -Vance > } > } ?________________________________________________________________ > } ?erlang-questions (at) erlang.org mailing list. > } ?See http://www.erlang.org/faq.html > } ?To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > -- > ? ? ? ?-Vance > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From kostis@REDACTED Sat Jul 3 09:21:31 2010 From: kostis@REDACTED (Kostis Sagonas) Date: Sat, 03 Jul 2010 10:21:31 +0300 Subject: [erlang-questions] type specification In-Reply-To: <4C2E222D.7070000@tmit.bme.hu> References: <4C2E09B3.2050505@aleynikov.org> <4C2E16BB.8050506@cs.ntua.gr> <4C2E222D.7070000@tmit.bme.hu> Message-ID: <4C2EE4FB.5070104@cs.ntua.gr> Zoltan Lajos Kis wrote: > > Could you explain how the new export_type attribute relates to the > opaque attribute? Declaring a type as opaque means that you want to keep the structure private to the defining module (which of course can manipulate the structure of such terms) and prevent other modules from doing operations to such a term that depends on its structure; dialyzer will warn you about such uses. Because the defining module can always manipulate the structure of such terms, it does not make sense to declare a type as opaque in some module and have it module-local (i.e., not exported). Thus, an opaque type should always be exported. > In R14A it seems that if I define an opaque type (without exporting it), > and try to use it in another module, dialyzer emits an unknown type > warning. Yes, this is expected. You can not use remote types (types defined in some other module) that are not exported by the defining module. > If I export the type the warning is not emitted, but the type is not > treated as opaque anymore... Either I do not understand what you mean here, or I doubt this. A small code example with the behavior you observe will help here (perhaps off list, if it is too big). Kostis From kiszl@REDACTED Sat Jul 3 09:55:25 2010 From: kiszl@REDACTED (Zoltan Lajos Kis) Date: Sat, 03 Jul 2010 09:55:25 +0200 Subject: [erlang-questions] type specification In-Reply-To: <4C2EE4FB.5070104@cs.ntua.gr> References: <4C2E09B3.2050505@aleynikov.org> <4C2E16BB.8050506@cs.ntua.gr> <4C2E222D.7070000@tmit.bme.hu> <4C2EE4FB.5070104@cs.ntua.gr> Message-ID: <4C2EECED.7070601@tmit.bme.hu> On 7/3/2010 9:21 AM, Kostis Sagonas wrote: > Zoltan Lajos Kis wrote: >> >> Could you explain how the new export_type attribute relates to the >> opaque attribute? > > Declaring a type as opaque means that you want to keep the structure > private to the defining module (which of course can manipulate the > structure of such terms) and prevent other modules from doing > operations to such a term that depends on its structure; dialyzer will > warn you about such uses. Because the defining module can always > manipulate the structure of such terms, it does not make sense to > declare a type as opaque in some module and have it module-local > (i.e., not exported). > > Thus, an opaque type should always be exported. > >> In R14A it seems that if I define an opaque type (without exporting >> it), and try to use it in another module, dialyzer emits an unknown >> type warning. > > Yes, this is expected. You can not use remote types (types defined in > some other module) that are not exported by the defining module. > >> If I export the type the warning is not emitted, but the type is not >> treated as opaque anymore... > > Either I do not understand what you mean here, or I doubt this. A > small code example with the behavior you observe will help here > (perhaps off list, if it is too big). > > Kostis Shouldn't I be warned that b:f breaks the opaqueness of a:my_type() with the modules below? Zoltan. -------------------------------------------- -module(a). -compile(export_all). -opaque( my_type() :: {atom(), atom()} ). -export_type([my_type/0]). -spec( f(my_type()) -> atom() ). f({A,_B}) -> A. --------------------------------------------- -module(b). -compile(export_all). -spec( f(a:my_type()) -> atom() ). f({A,_B}) -> A. --------------------------------------------- From bgustavsson@REDACTED Sat Jul 3 11:13:42 2010 From: bgustavsson@REDACTED (=?UTF-8?Q?Bj=C3=B6rn_Gustavsson?=) Date: Sat, 3 Jul 2010 11:13:42 +0200 Subject: [erlang-questions] Stack space used by "body-recursive calls". In-Reply-To: References: Message-ID: On Wed, Jun 30, 2010 at 10:02 AM, Kresten Krab Thorup wrote: > One of my challenges in Erjang is that list comprehensions end up chewing stack space. ?And today I got a glimpse of hope reading this: > > According to http://www.erlang.org/doc/efficiency_guide/myths.html > > In R12B and later releases, there is an optimization that will in many cases reduces the number of words used on the stack in body-recursive calls, so that a body-recursive list function and tail-recursive function that calls lists:reverse/1<../man/lists.html#reverse-1> at the end will use exactly the same amount of memory. lists:map/2, lists:filter/2, list comprehensions, and many other recursive functions now use the same amount of space as their tail-recursive equivalents. > > Can someone tell me, what exactly is the optimization that was done in R12B? It must be something in the runtime system that recognizes these conditions and does something smart; I'd love to be able to be equally smart. No, it's a compiler optimization - stack trimming. List comprehensions and other body recursive calls used to eat even more stack space before R12. (The only support that was added to the run-time system was the trim/2 instruction to do the actual stack trimming.) -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From info@REDACTED Sat Jul 3 11:56:45 2010 From: info@REDACTED (info) Date: Sat, 3 Jul 2010 11:56:45 +0200 Subject: [erlang-questions] bit syntax or tokens ? References: <201007022332132816745@its3.ch>, , Message-ID: <201007031156453128795@its3.ch> Thank you Robert, Once I have got them, I will mainly compare with string data or make calculation. if A == "ABC" -> ... Sometimes I want A as a string, sometimes A as integer !! I try to stay with the bit syntax "as long as possible" but I don't know if it's a good approach ! John Another alternative is to do: < > = S. which will give binaries A, B and G. It is, however, a very static way of doing it. Using the new binary module as Jesper suggests is much more dynamic and adaptable. While you can put what you want into a binary the bit syntax was never really designed for string fields, especially not dynamic ones, as you can't search with it. How much do you know about the substrings and what are you going to do with them once you have got them? This can also influence how you extract them. Robert On 2 July 2010 23:38, Jesper Louis Andersen wrote: > On Fri, Jul 2, 2010 at 11:32 PM, info wrote: > > Given a string S = < <"ABC,DE,FGH" > >. > > I do > > < > = S. > > and > > Alpha. gives 4276803 > > This is an excellent case for the new R14A/EEP-31 binary module, > presumed I understand your question: > > 3 > binary:split( < <"ABC,DE,FHG" > >, < <"," > >). > [ < <"ABC" > >, < <"DE,FHG" > >] > > > -- > J. > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From jesper.louis.andersen@REDACTED Sat Jul 3 16:55:18 2010 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sat, 3 Jul 2010 16:55:18 +0200 Subject: [erlang-questions] bit syntax or tokens ? In-Reply-To: <201007031156453128795@its3.ch> References: <201007022332132816745@its3.ch> <201007031156453128795@its3.ch> Message-ID: On Sat, Jul 3, 2010 at 11:56 AM, info wrote: > Thank you Robert, > Once I have got them, I will mainly compare with string data or make calculation. > if A == "ABC" -> ... > Sometimes I want A as a string, sometimes A as integer !! One way to achieve this is the decode the binary as both a string and an integer, and then lug both around at the same time. > I try to stay with the bit syntax "as long as possible" but I don't know if it's a good approach ! My guess is you wont win much by doing this. Of course, the string is taking up some space, but lugging it around is still just a pointer-pass. I wouldn't worry too much about it until it ends up being a bottleneck. -- J. From zeno490@REDACTED Sat Jul 3 17:58:26 2010 From: zeno490@REDACTED (Nicholas Frechette) Date: Sat, 3 Jul 2010 11:58:26 -0400 Subject: escript os:cmd behavior different from erl or command line Message-ID: Hi, I am attempting to run 'make' using os:cmd("make"). from an escript. The command works fine if I run it from the erl interpreter (or from the command like) but not from an escript. >From the escript, (i'm building mochiweb) for each beam, i'll get an error however the beam still gets created and in fact, using make -k seems to force it to work. Errors are like this: nicholas@REDACTED:~/projects/mochiweb-dev$ ./test (cd src;make all) make[1]: Entering directory `/home/nicholas/projects/mochiweb-dev/src' erlc -W -I ../include +debug_info -o ../ebin mochifmt_records.erl File has no extension: /home/nicholas/projects/mochiweb-dev/src/! make[1]: *** [../ebin/mochifmt_records.beam] Error 1 make[1]: Leaving directory `/home/nicholas/projects/mochiweb-dev/src' make: *** [all] Error 2 Where test is an escript like so: #!/usr/bin/env escript %% -*- erlang -*- %%! main(_Args) -> Result = os:cmd("make"), io:format("~s~n", [Result]), ok. I'm not a make fan/expert but as far as I can tell, the mochiweb make files are looking good. I'm using erlang R13B01 on ubuntu 9.10 and mochiweb is the head I grabbed earlier today via the download source button. Thanks From prikrutil@REDACTED Sat Jul 3 18:45:25 2010 From: prikrutil@REDACTED (Sergey Samokhin) Date: Sat, 3 Jul 2010 20:45:25 +0400 Subject: [erlang-questions] escript os:cmd behavior different from erl or command line In-Reply-To: References: Message-ID: Hello, Nicholas. This bug has been fixed in R13B02. Upgrade to R13B02 or delete %%! from your escript. Answer to my bug report: http://www.erlang.org/cgi-bin/ezmlm-cgi?2:msp:1460:ihedkfpokaibbannbafi -- Sergey Samokhin From zeno490@REDACTED Sat Jul 3 19:14:21 2010 From: zeno490@REDACTED (Nicholas Frechette) Date: Sat, 3 Jul 2010 13:14:21 -0400 Subject: [erlang-questions] escript os:cmd behavior different from erl or command line In-Reply-To: References: Message-ID: Indeed that fixed it, thanks! On Sat, Jul 3, 2010 at 12:45 PM, Sergey Samokhin wrote: > Hello, Nicholas. > > This bug has been fixed in R13B02. > > Upgrade to R13B02 or delete > > %%! > > from your escript. > > Answer to my bug report: > http://www.erlang.org/cgi-bin/ezmlm-cgi?2:msp:1460:ihedkfpokaibbannbafi > > -- > Sergey Samokhin > From gonzalo@REDACTED Sun Jul 4 01:06:36 2010 From: gonzalo@REDACTED (Gonzalo) Date: Sun, 4 Jul 2010 01:06:36 +0200 Subject: [erlang-questions] two simple escript questions In-Reply-To: References: Message-ID: Cool! Thanks for the tip Joe! By the way, it's a pleasure to read your book "Programming Erlang" (Pragmatic Programmers). It's very well written. Regards. Gonzalo. From joaohf@REDACTED Sun Jul 4 02:02:25 2010 From: joaohf@REDACTED (=?UTF-8?Q?Jo=C3=A3o_Henrique_Freitas?=) Date: Sat, 3 Jul 2010 21:02:25 -0300 Subject: Trying to change things Message-ID: Hello, I am working on a place wich uses the CHILL language programming to develop a huge telecom system. We use others languages too like C and C++. But CHILL is the largest code base. I staring to learning Erlang about six months ago and in the last three months I spent a lot of energies trying persuade developers to change from CHILL/C/C++ to Erlang. But is hard change things. Anybody have some experience with these situation? My boss question me about 'Who is using Erlang?' and I am trying to found some in my country (Brazil). Now I can't waiting more and start a internal project to interfacing with CHILL/C/C++ old base and Erlang. Thanks -- ----------------------------------------------------------- Jo?o Henrique Freitas - joaohf_at_gmail.com Campinas-SP-Brasil BSD051283 LPI 1 http://www.joaohfreitas.eti.br From bernie@REDACTED Sun Jul 4 02:50:04 2010 From: bernie@REDACTED (Bernard Duggan) Date: Sun, 04 Jul 2010 10:50:04 +1000 Subject: [erlang-questions] Trying to change things In-Reply-To: References: Message-ID: <4C2FDABC.2040407@m5net.com> Hi Jo?o, On 4/07/2010 10:02 AM, Jo?o Henrique Freitas wrote: > Hello, > > I am working on a place wich uses the CHILL language programming to > develop a huge telecom system. We use others languages too like C and > C++. But CHILL is the largest code base. We were in almost exactly the same situation as you a couple of years ago, minus the CHILL - we were just using C/C++. > I staring to learning Erlang about six months ago and in the last > three months I spent a lot of energies trying persuade developers to > change from CHILL/C/C++ to Erlang. We did that when we first discovered Erlang too - doing that without a lot of stuff to back you up (see below) is almost certainly doomed to failure. > But is hard change things. Anybody have some experience with these situation? Yes, indeed I do :) I'm not going to proffer what I'm saying as general advice, but it's what allowed us some progress in our particular situation. Here's what we did: * Start, in your "spare time", to write something in Erlang that's going to be useful but doesn't exist yet because "we'll get to it later,,,when we have time" :) (Make sure you treat this as a learning experience - you /will/ look back at this code in a couple of years and marvel at how terrible it is, I promise you :)). In our case, one of the biggest problems we had was that we had no good way to test how the system would behave when we plugged 3000 phones into it, because we had neither 3000 phones nor the 3000 QA guys to run them :) Erlang's concurrent nature made it a perfect fit for this kind of role - acting exactly like a whole pile of phones. After a few months we suddenly had a tool that both allowed us to do something really useful and showed off Erlang. * Make sure everyone knows how awesome this is, and that they know that it's awesome, at least partly, because it's in Erlang (and also, naturally, because /you/ wrote it :)). * Hopefully, people will start asking "why doesn't it do X?" (though they'll rarely marvel at how something useful sprung up without them having to do anything or even ask for it - it's all about what it /doesn't/ do). Once again, you can show how nice and easy Erlang is to modify by adding X. But make sure you /show/ them how easy it is to add. Maybe they might want to add the next feature themselves (because you're really busy right now...)? Hey look - you have another person writing Erlang :) * Make sure you read up on all the great stuff Erlang can give you - especially the reliability and "safe crashing" aspects. Telco people, especially, /love/ reliability for obvious reasons. We have a process where one single bad pointer can take down 5000 phones for 20 seconds - imagine how aweomse it sounds if a bug in your code will, in all but the worst possible cases, take down only one or two! * This step is where, I think, we got a bit lucky - we started actively agitating to write new bits of the core code in Erlang. Depeding on your system, that's probably going to have a high startup cost in terms of writing a layer to interact with the legacy code. Somehow we convinced them it was, in fact, the "way forward", but we didn't have time to convert anything that we currently had (fair enough - it was all "working" okay). But then we got another lucky break when we were asked to write a whole new module for the existing core system, and the job was given to the two biggest Erlang users :) * This time, we didn't try to sneak it "under the radar" - we said we wanted to do it in Erlang, said there would be a certain cost to getting the initial interface layer written, but also made it clear that we were totally convinced it would pay off, even for this single module. Based in no small part on our earlier success with the testing system, we got the go-ahead. * The only other suggestion I can give is, if you get to that stage, take as much time as you can to make sure you get the first serious bit of Erlang stuff "right". If you still have nay-sayers, they will be looking for any little thing that goes wrong as a way of saying "see? Told you Erlang was rubbish - we should be sticking with good-ole reliable C++". Never mind that the C++ stuff crashed twice a day when they first coded it :) Like I said, that's just our story - it may or may not be any use to you. > My boss question me about 'Who is using Erlang?' and I am trying to > found some in my country (Brazil). Can't help you with that one, sorry (not for Brazil, anyway). What I /would/ say is that it's entirely typical of "management" to take the "well if it's so great, why isn't everyone else using it?" attitude. I'm sure it's self-evident to everyone on this list why that very question itself is wrong, but it's the job of management not to screw up. If they have something that is seen to be working (for some definition of "working"), the choice they see is between a "zero risk" option of changing nothing or a risky option that some guy is telling them will make things better. It's always the easier choice to stick with a known quantity. I'm not meaning this as some kind of "anti-management-they're-all-morons" rant - they have a different perspective on things and I can totally understand their reluctance to move away from a known quantity. > Now I can't waiting more and start a internal project to interfacing > with CHILL/C/C++ old base and Erlang. Good luck! Let us know how you get on. B From kenji.rikitake@REDACTED Sun Jul 4 09:32:01 2010 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Sun, 4 Jul 2010 16:32:01 +0900 Subject: native Erlang version of SFMT PRNG Message-ID: <20100704073201.GA37621@k2r.org> A crude pure Erlang version of SFMT (SIMD-oriented Fast Mersenne Twister) PRNG: http://github.com/jj1bdx/sfmt-erlang Note: this code is still ~300 times slower than the C code of SFMT even when HiPE enabled on Erlang/OTP R14A at FreeBSD 7.3-RELEASE x86; a NIF set will boost the speed. I've already dissected the original SFMT code for a thread-safe implementation at: http://github.com/jj1bdx/sfmt-extstate Kenji Rikitake (well, if nobody does something for me, I have to do it anyway :)) In the message <20100530075320.GA29981@REDACTED> dated Sun, May 30, 2010 at 04:52:56PM +0900, Kenji Rikitake writes: > Anybody has implemented a NIF or port version of Mersenne Twister or SFMT? > http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html > > (Mersenne Twister has been incorporated as the default RNG for Python > and R, so far as I know.) From torben.lehoff@REDACTED Sun Jul 4 16:55:51 2010 From: torben.lehoff@REDACTED (Torben Hoffmann) Date: Sun, 4 Jul 2010 16:55:51 +0200 Subject: [erlang-questions] Trying to change things In-Reply-To: <4C2FDABC.2040407@m5net.com> References: <4C2FDABC.2040407@m5net.com> Message-ID: Jo?o, I second many of Bernard's observations - see http://erlang-factory.com/conference/2008LondonErlangeXchange/speakers/NicholasGunderfor our personal war story. See the slides and come back with additional questions - I have some hidden slides and notes I can dig out for you. Cheers, Torben 2010/7/4 Bernard Duggan > Hi Jo?o, > > On 4/07/2010 10:02 AM, Jo?o Henrique Freitas wrote: > > Hello, > > > > I am working on a place wich uses the CHILL language programming to > > develop a huge telecom system. We use others languages too like C and > > C++. But CHILL is the largest code base. > We were in almost exactly the same situation as you a couple of years > ago, minus the CHILL - we were just using C/C++. > > I staring to learning Erlang about six months ago and in the last > > three months I spent a lot of energies trying persuade developers to > > change from CHILL/C/C++ to Erlang. > We did that when we first discovered Erlang too - doing that without a > lot of stuff to back you up (see below) is almost certainly doomed to > failure. > > But is hard change things. Anybody have some experience with these > situation? > Yes, indeed I do :) I'm not going to proffer what I'm saying as general > advice, but it's what allowed us some progress in our particular > situation. Here's what we did: > > * Start, in your "spare time", to write something in Erlang that's going > to be useful but doesn't exist yet because "we'll get to it later,,,when > we have time" :) (Make sure you treat this as a learning experience - > you /will/ look back at this code in a couple of years and marvel at how > terrible it is, I promise you :)). In our case, one of the biggest > problems we had was that we had no good way to test how the system would > behave when we plugged 3000 phones into it, because we had neither 3000 > phones nor the 3000 QA guys to run them :) Erlang's concurrent nature > made it a perfect fit for this kind of role - acting exactly like a > whole pile of phones. After a few months we suddenly had a tool that > both allowed us to do something really useful and showed off Erlang. > > * Make sure everyone knows how awesome this is, and that they know that > it's awesome, at least partly, because it's in Erlang (and also, > naturally, because /you/ wrote it :)). > > * Hopefully, people will start asking "why doesn't it do X?" (though > they'll rarely marvel at how something useful sprung up without them > having to do anything or even ask for it - it's all about what it > /doesn't/ do). Once again, you can show how nice and easy Erlang is to > modify by adding X. But make sure you /show/ them how easy it is to > add. Maybe they might want to add the next feature themselves (because > you're really busy right now...)? Hey look - you have another person > writing Erlang :) > > * Make sure you read up on all the great stuff Erlang can give you - > especially the reliability and "safe crashing" aspects. Telco people, > especially, /love/ reliability for obvious reasons. We have a process > where one single bad pointer can take down 5000 phones for 20 seconds - > imagine how aweomse it sounds if a bug in your code will, in all but the > worst possible cases, take down only one or two! > > * This step is where, I think, we got a bit lucky - we started actively > agitating to write new bits of the core code in Erlang. Depeding on > your system, that's probably going to have a high startup cost in terms > of writing a layer to interact with the legacy code. Somehow we > convinced them it was, in fact, the "way forward", but we didn't have > time to convert anything that we currently had (fair enough - it was all > "working" okay). But then we got another lucky break when we were asked > to write a whole new module for the existing core system, and the job > was given to the two biggest Erlang users :) > > * This time, we didn't try to sneak it "under the radar" - we said we > wanted to do it in Erlang, said there would be a certain cost to getting > the initial interface layer written, but also made it clear that we were > totally convinced it would pay off, even for this single module. Based > in no small part on our earlier success with the testing system, we got > the go-ahead. > > * The only other suggestion I can give is, if you get to that stage, > take as much time as you can to make sure you get the first serious bit > of Erlang stuff "right". If you still have nay-sayers, they will be > looking for any little thing that goes wrong as a way of saying "see? > Told you Erlang was rubbish - we should be sticking with good-ole > reliable C++". Never mind that the C++ stuff crashed twice a day when > they first coded it :) > > Like I said, that's just our story - it may or may not be any use to you. > > My boss question me about 'Who is using Erlang?' and I am trying to > > found some in my country (Brazil). > Can't help you with that one, sorry (not for Brazil, anyway). What I > /would/ say is that it's entirely typical of "management" to take the > "well if it's so great, why isn't everyone else using it?" attitude. > I'm sure it's self-evident to everyone on this list why that very > question itself is wrong, but it's the job of management not to screw > up. If they have something that is seen to be working (for some > definition of "working"), the choice they see is between a "zero risk" > option of changing nothing or a risky option that some guy is telling > them will make things better. It's always the easier choice to stick > with a known quantity. I'm not meaning this as some kind of > "anti-management-they're-all-morons" rant - they have a different > perspective on things and I can totally understand their reluctance to > move away from a known quantity. > > Now I can't waiting more and start a internal project to interfacing > > with CHILL/C/C++ old base and Erlang. > Good luck! Let us know how you get on. > > B > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > -- http://www.linkedin.com/in/torbenhoffmann From g9414002.pccu.edu.tw@REDACTED Sun Jul 4 17:04:37 2010 From: g9414002.pccu.edu.tw@REDACTED (=?UTF-8?B?6buD6ICA6LOiIChZYXUtSHNpZW4gSHVhbmcp?=) Date: Sun, 4 Jul 2010 23:04:37 +0800 Subject: [erlang-questions] Trying to change things In-Reply-To: References: Message-ID: 2010/7/4 Jo?o Henrique Freitas > I am working on a place wich uses the CHILL language programming to > develop a huge telecom system. We use others languages too like C and > C++. But CHILL is the largest code base. > > I staring to learning Erlang about six months ago and in the last > three months I spent a lot of energies trying persuade developers to > change from CHILL/C/C++ to Erlang. > > But is hard change things. Anybody have some experience with these > situation? > > My boss question me about 'Who is using Erlang?' and I am trying to > found some in my country (Brazil). > > Now I can't waiting more and start a internal project to interfacing > with CHILL/C/C++ old base and Erlang. > > It a cultural and religious problems. And it's not easy to vanquish all users of other languages. They used CHILL, C, and C++. Do you know about how much they used them and enjoyed benefits of them? And how long have you been in the firm is another factor. If you have to replace original things with others, you have to give something with more benefits than the older one. You must give something that they can try and done. I'm in Taiwan, and there's no Erlang jobs and cases here. I'm seeking opportunities for showing and promoting Erlang. Writing a book may be a way. In my firm, unfortunately, they immersed in Microsoft solutions. It's not bad, but it seems no way left for Erlang. :$ And I'm figuring which kind of application may be a start for Erlang. Web development solutions? I'm not sure. From kenji.rikitake@REDACTED Mon Jul 5 07:17:54 2010 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Mon, 5 Jul 2010 14:17:54 +0900 Subject: revised R14A FreeBSD unofficial port Re: [erlang-questions] R14A FreeBSD unofficial port In-Reply-To: <20100620042450.GA28253@k2r.org> References: <20100620042450.GA28253@k2r.org> Message-ID: <20100705051754.GA74549@k2r.org> http://www.ne.jp/asahi/bdx/info/software/erlang-r14a,2-20100705.tar.gz This tar.gz archive includes an unofficial port of Erlang R14A for FreeBSD (lang/erlang, erlang-r14a,2_1) Note 1: R13A port hasn't been released officially, so I expect R14A port won't be released officially either. Note 2: Java functionality untested. Note 3: Compilation/installation ested on FreeBSD 7.3-RELEASE i386. Note 4: a patch added to fix inet_drv to detect passive mode UDP errors for SCTP builds http://www.erlang.org/cgi-bin/ezmlm-cgi?3:mss:1195:201006:ljbebjdglkaipibfaoaf http://github.com/RaimoNiskanen/otp/commit/5615d7ac85e94ec718a2acdc9e77381f9109a64c Regards, Kenji Rikitake From info@REDACTED Mon Jul 5 11:01:24 2010 From: info@REDACTED (info) Date: Mon, 5 Jul 2010 11:01:24 +0200 Subject: embedded timeouts Message-ID: <201007051101243128942@its3.ch> Hi all, Why the first timeout never happens ? How must be structured this code in order to have two timeouts ? init(Timeout)-> receive ... loop(), after Timeout -> ... end. loop()-> ... send(Message), receive after 1000 -> 0 end loop(). From ulf.wiger@REDACTED Mon Jul 5 11:22:40 2010 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Mon, 05 Jul 2010 11:22:40 +0200 Subject: [erlang-questions] embedded timeouts In-Reply-To: <201007051101243128942@its3.ch> References: <201007051101243128942@its3.ch> Message-ID: <4C31A460.8000308@erlang-solutions.com> info wrote: > Hi all, > Why the first timeout never happens ? Does the function in init/1 receive a message? If it does, and loop/1 is called, it is no longer inside the receive clause, and the 'after' clause will not execute (it simply means, do this if no message has arrived within Timeout milliseconds). If no message is sent to the receive clause in init/1, loop() will never be called. BR, Ulf W > How must be structured this code in order to have two timeouts ? > > init(Timeout)-> > receive > ... > loop(), > after Timeout -> > ... > end. > > loop()-> > ... > send(Message), > receive after 1000 -> 0 end > loop(). > -- Ulf Wiger CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd http://www.erlang-solutions.com From marc@REDACTED Mon Jul 5 11:55:41 2010 From: marc@REDACTED (Marc Worrell) Date: Mon, 5 Jul 2010 11:55:41 +0200 Subject: Looking for an Erlang developer Message-ID: <5BEFD130-1A15-4CE3-B2C5-2497A24492D1@worrell.nl> We are looking for an Erlang programmer and found that it is quite difficult to find someone. We also found that the available positions are spread out over many websites. Which makes it hard to find interesting positions for those that are looking for Erlang work. So we made a little site ( http://totally-erlang.com/ ) to quickly (and freely) publish any Erlang positions. The first thing we need now is other people joining in so if you know anybody that needs to post a job ? I would appreciate it if you pass it on! Kind Regards, Marc Worrell From rapsey@REDACTED Mon Jul 5 12:21:03 2010 From: rapsey@REDACTED (Rapsey) Date: Mon, 5 Jul 2010 12:21:03 +0200 Subject: [Erlyaws-list] Write rendered EHTML to file In-Reply-To: References: Message-ID: Call the ehtml functions in yaws_api directly to convert ehtml to iolist. yaws_api:ehtml_expand(EHTML) should be the right one I think. Sergej On Mon, Jul 5, 2010 at 11:58 AM, Branko Vukelic wrote: > Hi, > > Is there a way to write rendered EHTML to a file instead of returning it? > > What I'm trying to do is to make a appmod for generating static HTML > pages based on user input that will be placed in a directory that is > served as a regular static site. > > Thanks, > > -- > Branko Vukeli? > > bg.branko@REDACTED > studio@REDACTED > > Check out my blog: http://www.brankovukelic.com/ > Check out my portfolio: http://www.flickr.com/photos/foxbunny/ > Registered Linux user #438078 (http://counter.li.org/) > I hang out on identi.ca: http://identi.ca/foxbunny > > Gimp Brushmakers Guild > http://bit.ly/gbg-group > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Erlyaws-list mailing list > Erlyaws-list@REDACTED > https://lists.sourceforge.net/lists/listinfo/erlyaws-list > From e_d_k@REDACTED Mon Jul 5 14:21:11 2010 From: e_d_k@REDACTED (Ed Keith) Date: Mon, 5 Jul 2010 05:21:11 -0700 (PDT) Subject: [erlang-questions] Looking for an Erlang developer In-Reply-To: <5BEFD130-1A15-4CE3-B2C5-2497A24492D1@worrell.nl> Message-ID: <812947.17334.qm@web120510.mail.ne1.yahoo.com> It might be a good idea to also allow people looking for Erlang Jobs to post resumes. -EdK Ed Keith e_d_k@REDACTED Blog: edkeith.blogspot.com --- On Mon, 7/5/10, Marc Worrell wrote: > From: Marc Worrell > Subject: [erlang-questions] Looking for an Erlang developer > To: erlang-questions@REDACTED > Date: Monday, July 5, 2010, 5:55 AM > We are looking for an Erlang > programmer and found that it is quite difficult to find > someone.? We also found that the available positions > are spread out over many websites.? Which makes it hard > to find interesting positions for those that are looking for > Erlang work. > > So we made a little site ( http://totally-erlang.com/ ) to quickly (and freely) > publish any Erlang positions. > > The first thing we need now is other people joining in so > if you know anybody that needs to post a job ? I would > appreciate it if you pass it on! > > Kind Regards, > > Marc Worrell From info@REDACTED Mon Jul 5 15:33:48 2010 From: info@REDACTED (info) Date: Mon, 5 Jul 2010 15:33:48 +0200 Subject: [erlang-questions] embedded timeouts References: <201007051101243128942@its3.ch>, <4C31A460.8000308@erlang-solutions.com> Message-ID: <201007051533476090057@its3.ch> The problem is that the "after Timeout" closure is never called. The loop never stops ! John info wrote: > Hi all, > Why the first timeout never happens ? Does the function in init/1 receive a message? If it does, and loop/1 is called, it is no longer inside the receive clause, and the 'after' clause will not execute (it simply means, do this if no message has arrived within Timeout milliseconds). If no message is sent to the receive clause in init/1, loop() will never be called. BR, Ulf W > How must be structured this code in order to have two timeouts ? > > init(Timeout)- > > receive > ... > loop(), > after Timeout - > > ... > end. > > loop()- > > ... > send(Message), > receive after 1000 - > 0 end > loop(). > -- Ulf Wiger CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd http://www.erlang-solutions.com From bartlomiej@REDACTED Mon Jul 5 15:37:49 2010 From: bartlomiej@REDACTED (=?utf-8?Q?Bart=C5=82omiej_Puzo=C5=84?=) Date: Mon, 5 Jul 2010 13:37:49 +0000 (GMT) Subject: [erlang-questions] embedded timeouts In-Reply-To: <201007051533476090057@its3.ch> Message-ID: <871634171.568481278337069585.JavaMail.root@zimbra> Yes, it is an intended behaviour. The receive's "after" closure applies if and only if there is no message to match for the receive construct within a given amount of time. ----- "info" escribi?: > The problem is that the "after Timeout" closure is never called. The > loop never stops ! > John > > info wrote: > > Hi all, > > Why the first timeout never happens ? > > Does the function in init/1 receive a message? > If it does, and loop/1 is called, it is no longer inside > the receive clause, and the 'after' clause will not > execute (it simply means, do this if no message has arrived > within Timeout milliseconds). > > If no message is sent to the receive clause in init/1, > loop() will never be called. > > BR, > Ulf W > > > How must be structured this code in order to have two timeouts ? > > > > init(Timeout)- > > > receive > > ... > > loop(), > > after Timeout - > > > ... > > end. > > > > loop()- > > > ... > > send(Message), > > receive after 1000 - > 0 end > > loop(). > > > > > -- > Ulf Wiger > CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd > http://www.erlang-solutions.com -- Bart?omiej Puzo? Erlang Solutions bartlomiej.puzon@REDACTED From juanjo@REDACTED Mon Jul 5 17:57:47 2010 From: juanjo@REDACTED (Juan Jose Comellas) Date: Mon, 5 Jul 2010 12:57:47 -0300 Subject: [erlang-questions] Trying to change things In-Reply-To: References: Message-ID: Jo?o, we successfully migrated a client's distributed telecom system (about 50K users) from Java/C/C++ to Erlang/C a few years ago. The new system's been in production for a little less than a year and it took about 1.5 years to rewrite it and achieve feature parity (and more) with the original system. Nowadays, the new system can probably handle 10x the load of the original one per server. There were improvements in the architecture, of course, but switching to Erlang was one of the main reasons for the project's success and the performance improvements. About 3 years ago, we were reaching the limits of the old system, so we asked the client to let us dedicate 2 developers to creating some prototypes for a new version of the system. We created 3 prototypes: one in Java; one in a mixture of JavaScript and a C core; and the other one in Erlang. The Erlang prototype was the last one we did, and even before finishing it, it was clear that it was the way to go. The JavaScript version was discarded because it lacked certain key functionality that was really very difficult to add. For the Java prototype we'd spent weeks trying to transparently distribute calls among servers, to support hot code loading and to achieve a level of fault-tolerance that would allow us to avoid dropping calls in case of exceptions/errors in our own code. We made it work, but when compared to what Erlang gave us for free our own code was much less resilient and much more complex. It was clear at that point that continuing using Java for this was harming us more than helping us. We talked to the client, showed them the code and how simpler it was to solve our problem in Erlang and convinced them to switch. Erlang has its own set of problems, but they are mostly due to its weirdness when coming from an imperative background and to its lack of market penetration. We are in Buenos Aires, Argentina (not that far from you and sharing your pain in the World Cup), and finding Erlang developers at the time was a bit problematic. In our case, we didn't have any previous experience with Erlang, other than using ejabberd for other projects, so we had to learn it by ourselves and then had to retrain our Java developers. It took at least a month to get them to the point where they could start working on "real" code. I have no regrets regarding the decision, but you will need the people responsible for making the decision to trust you enough to commit to it. Nowadays the decision should be simpler because there are some great books and opensource libraries around. There are also several success stories from big companies that have helped gather more mindshare. So, good luck with this and don't hesitate to contact me if I can be of any help. 2010/7/3 Jo?o Henrique Freitas > Hello, > > I am working on a place wich uses the CHILL language programming to > develop a huge telecom system. We use others languages too like C and > C++. But CHILL is the largest code base. > > I staring to learning Erlang about six months ago and in the last > three months I spent a lot of energies trying persuade developers to > change from CHILL/C/C++ to Erlang. > > But is hard change things. Anybody have some experience with these > situation? > > My boss question me about 'Who is using Erlang?' and I am trying to > found some in my country (Brazil). > > Now I can't waiting more and start a internal project to interfacing > with CHILL/C/C++ old base and Erlang. > > Thanks > > -- > ----------------------------------------------------------- > Jo?o Henrique Freitas - joaohf_at_gmail.com > Campinas-SP-Brasil > BSD051283 > LPI 1 > http://www.joaohfreitas.eti.br > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From max.lapshin@REDACTED Mon Jul 5 22:36:11 2010 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 6 Jul 2010 00:36:11 +0400 Subject: Segmentation fault in crypto:dh_generate_key R13B4 Message-ID: Erlang R13B4, OS X 10.6, erlang build from homebrew otool -L /usr/local/lib/erlang/lib/crypto-1.6.4/priv/lib/crypto_drv.so /usr/local/lib/erlang/lib/crypto-1.6.4/priv/lib/crypto_drv.so: /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0) Starting attached file leads to Segmentation Fault: maxbp:erlyvideo max$ ./dh_check.erl Segmentation fault What should I do more to fix this problem? -------------- next part -------------- A non-text attachment was scrubbed... Name: dh_check.erl Type: application/octet-stream Size: 1255 bytes Desc: not available URL: From jesper.louis.andersen@REDACTED Tue Jul 6 00:01:55 2010 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 6 Jul 2010 00:01:55 +0200 Subject: ANN: etorrent v1.0.0 Message-ID: (Apologies if there is another list taking software release announcements) I am happy to announce etorrent v1.0.0 to the masses. Etorrent is a bittorrent client written in Erlang, relying on concurrency to get the job done. Etorrent is a fully functional bittorrent client for the base protocol, although it needs some work to support all extensions to the protocol. This is the first release in about 2 years on the project. Overall this version of the client is the first one which is not simply a tech-preview. It can actually be used as a client on a daily basis if one wants. Code and downloads are available from the Github page: http://github.com/jlouis/etorrent Building requires rebar, although it should be fairly easy to call emake by yourself if wanted. Highlights: (Tuncer Ayaz): Estimate the ETA of torrents. Guess at when they are done. When processes are stopping, correctly clean up ETS tables. The solution we use is to place monitors on key processes. Bookkeeping processes then act on 'DOWN' messages and remove ETS entries again. All module-exported functions now have edoc tags and -spec entries. We now use rebar for building the application. To come is a standalone-node provisioning. For now the 'run' makefile target is to be used. Also adapt the file layout mandated by rebar. Adaptive active/passive sockets. When a peer is slow, we manage the socket ourselves. This gives fine granularity of its speed. When the peer socket jumps above a high watermark, it is made active, pushing the overhead to the C-layer of the VM. Use an LRU-replacement scheme on open files. Limit the number of open files to 128 at once. This enables torrents with more than 1024 - OPEN_SOCKETS files to be downloaded. Add a WebUI. The inets server provides a simple RPC-service for a primarily Javascript-enabled web-frontend. It can only display the basic overview at the moment, but it should be easy to extend with new functionality. Numerous additional code cleanups here and there. It should be even easier to read and understand now. Make GitHub the official repository place: http://github.com/jlouis/etorrent Use http://github.com/jlouis/etorrent/issues for issues. Issues can be voted on, so if one prefers one thing over the other, don't hesitate to hint me :) -- J. From ci.johnpaul87@REDACTED Tue Jul 6 05:53:25 2010 From: ci.johnpaul87@REDACTED (johnpaul ci) Date: Mon, 5 Jul 2010 23:53:25 -0400 Subject: Fwd: error in crypo module Message-ID: ---------- Forwarded message ---------- From: johnpaul ci Date: Mon, 5 Jul 2010 00:53:41 -0400 Subject: Re: ex11 usage To: Joe Armstrong Hello This time I am sending you another errot encountered when using the crypto moduke in erlang. I have installed the package erlang-crypto and some its functions are working well. The following errors occured when tried to run the functions of DES encryption. 3>Key = <<16#01,16#23,16#45,16#67,16#89,16#ab,16#cd,16#ef>>. <<1,35,69,103,137,171,205,239>> 4> IVec = <<16#12,16#34,16#56,16#78,16#90,16#ab,16#cd,16#ef>>. <<18,52,86,120,144,171,205,239>> 5> P = "Now is the time for all ". "Now is the time for all " 6> C = crypto:des_cbc_encrypt(Key, IVec, P). ** exception error: bad argument in function port_control/3 called as port_control(crypto_drv02,13, [<<1,35,69,103,137,171,205,239>>, <<18,52,86,120,144,171,205,239>>, "Now is the time for all "]) in call from crypto:control/2 How can this be rectified. Thankyou From kenji.rikitake@REDACTED Tue Jul 6 06:42:51 2010 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Tue, 6 Jul 2010 13:42:51 +0900 Subject: [erlang-questions] Fwd: error in crypo module In-Reply-To: References: Message-ID: <20100706044251.GA9836@k2r.org> Which version of Erlang are you using? In R13B04 and before (inclusive), you need to do crypto:start() before using the crypto module functions. In R14A, you don't have to. Here it's like this: -- begin -- Erlang R14A (erts-5.8) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.8 (abort with ^G) 1> Key = <<16#01,16#23,16#45,16#67,16#89,16#ab,16#cd,16#ef>>. <<1,35,69,103,137,171,205,239>> 2> IVec = <<16#12,16#34,16#56,16#78,16#90,16#ab,16#cd,16#ef>>. <<18,52,86,120,144,171,205,239>> 3> P = "Now is the time for all ". "Now is the time for all " 4> length(P). 24 5> C = crypto:des_cbc_encrypt(Key, IVec, P). <<229,199,205,222,135,43,242,124,67,233,52,0,140,56,156, 15,104,55,136,73,154,124,5,246>> 6> P2 = crypto:des_cbc_decrypt(Key, IVec, C). <<"Now is the time for all ">> 10> P3 = erlang:binary_to_list(P2). "Now is the time for all " 11> P3 =:= P. true -- end -- Kenji Rikitake In the message dated Mon, Jul 05, 2010 at 11:53:01PM -0400, johnpaul ci writes: > 3>Key = <<16#01,16#23,16#45,16#67,16#89,16#ab,16#cd,16#ef>>. > <<1,35,69,103,137,171,205,239>> > 4> IVec = <<16#12,16#34,16#56,16#78,16#90,16#ab,16#cd,16#ef>>. > <<18,52,86,120,144,171,205,239>> > 5> P = "Now is the time for all ". > "Now is the time for all " > 6> C = crypto:des_cbc_encrypt(Key, IVec, P). > ** exception error: bad argument > in function port_control/3 > called as port_control(crypto_drv02,13, > [<<1,35,69,103,137,171,205,239>>, > <<18,52,86,120,144,171,205,239>>, > "Now is the time for all "]) > in call from crypto:control/2 From kenji.rikitake@REDACTED Tue Jul 6 06:51:28 2010 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Tue, 6 Jul 2010 13:51:28 +0900 Subject: Tokyo Erlang Workshop #5: Friday 27-AUG-2010 8pm-10pm(JST) at Oracle Aoyama Center Message-ID: <20100706045128.GB9836@k2r.org> Tokyo Erlang Workshop #5 will be held on Friday, August 27, 2010 8pm-10pm JST at Oracle Aoyama Center (near Tokyo Metro Gaien-Mae station) Location map in Japanese: http://www.oracle.co.jp/aoyamacenter/ Presentations are mostly given in Japanese but English-speaking participants are also welcome. Program details TBD. (Gemini Mobile Technology Japan will make a presentation about the Hibari KVS, in English. Details may be changed later.) Contact Masahito Ikuta for the further details. Regards, Kenji Rikitake From michael.eugene.turner@REDACTED Tue Jul 6 09:50:08 2010 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Tue, 6 Jul 2010 16:50:08 +0900 Subject: [erlang-questions] Trying to change things In-Reply-To: References: Message-ID: In private e-mail, I wrote, in part: 2010/7/5 Michael Turner > "CHILL is unusual in that it supports two forms of declaration syntax, one > based on Cobol and the other on PL/1." > (Wikipedia) > > My heart goes out to you. ;-) > > You're fighting the inertia of legacy code. However, the inertia of a > legacy can cut both ways. Erlang itself has benefited by the same social > and institutional inertia you describe. Erlang survived in part because > open-sourcing helped circumvent the *formal* objection that -- contrary to a > recent policy in the late 90s at Ericsson -- it was not independently > supported. Realistically, however, Erlang was foundational in a successful > product. It takes a long time to get rid of something like that, even if > you should. Erlang is an open-sourced legacy, luckily with real legs, > crossing seas. > It occurs to me now that, both in my joke and in the rest of my comments, there's an underlying message: politically, it seldom hurts to show due respect for why people have done things a certain way in the past. If your company uses CHILL, it probably made sense at one time, and might even make a lot of sense now. Take CHILL'S PL/1 and COBOL declaration syntax (please!). I can see why it might be important, even now. Telecom is concurrent-event-intensive, so Erlang is a good match. However, with these events, we're not talking about UDP packets, which you can toss on the floor without much worry. No, many, if not most, of certain major classes of events also represent *billing opportunities*, or they at least relate to billing opportunities in some way that has bottom-line impact for the telco. Billing is often done on legacy systems, in COBOL. Yes, still! The COBOL billing code is often hosted on IBM mainframes -- yes, still! The systems programming language for those mainframes might still be predominantly PL/1 -- yes, still! And ultimately, the telecom switches have to be integrated with the business systems, because nobody's going type all that stuff in from switch log printouts. There's not enough paper in the world anyway, to print it all out. If CHILL uses PL/1 and COBOL declaration syntax, that might be ugly, but from a global systems configuration perspective, and from a source code management perspective, using that syntax might also exceedingly practical. It means the CHILL code that runs the switch, the PL/1 code that talks directly to the switch, and the COBOL code that talks to the PL/1 code, can *all* share header files. Now, these facts might actually be irrelevant in your context, in the year 2010. Maybe your company's business apps are now all written in Java. But what if it isn't irrelevant? What if it's, in fact, mission-critical? Then writing something in Erlang that can understand PL/1 and COBOL declaration syntax (don't try Erlang parse transforms at home, at least not at this stage) would speak very clearly to management, in your favor. It shows you can nod toward the necessities of the past while looking toward the future. It would be especially cool if you could use Erlang bitstring features to adhere to any binary (and, where character-oriented, possibly EBCDIC-based) protocols. Here's another sales technique that can work. (If you aren't good at selling technical ideas to technical people, and then to managers above them, find somebody in your workplace who is, and convert them to Erlang ideas the best you can.) Give a presentation and get the nod of approval for Erlang from the *smartest* person in your shop, whether they have any real authority or not. Then teach some Erlang to the person in your shop who is generally regarded as the slowest. (Be careful here: the real problem with this person might be only that they aren't very motivated, because they've gotten bored with programming. And if you're lucky, Erlang exposure could change that.) You now have two very persuasive arguments in your favor: (1) The endorsement of the brightest. (2) A defense against the following (very common) management objection to adopting new technology, "Well, sure, our smartest programmer is probably right when he agrees with you that [technology X] very powerful and useful. For really smart people, maybe [technology X] makes sense. But we have to hire -- and make use of -- relatively average programmers as well. [Technology X] is probably over their heads." Running code in Erlang written by your resident "relatively average" programmer closes the deal. Just be careful how you say this. -michael turner From schramm.ingo@REDACTED Tue Jul 6 10:05:31 2010 From: schramm.ingo@REDACTED (ingo.schramm) Date: Tue, 6 Jul 2010 01:05:31 -0700 (PDT) Subject: Erlang: Who uses it for games? Message-ID: Does somebody ever used Erlang to program game servers? Is there any real live industrial game solution written in Erlang? I need to know this for some evangelization :) Cheers, Ingo From pguyot@REDACTED Tue Jul 6 10:12:36 2010 From: pguyot@REDACTED (Paul Guyot) Date: Tue, 6 Jul 2010 10:12:36 +0200 Subject: Segmentation fault in crypto:dh_generate_key R13B4 In-Reply-To: <1278402610.30818.ezmlm@erlang.org> References: <1278402610.30818.ezmlm@erlang.org> Message-ID: <74E5A8FE-C6D6-4697-8E8D-FBAFF80119B8@kallisys.net> Le 6 juil. 2010 ? 09:50, erlang-questions-digest-help@REDACTED a ?crit : > De : Max Lapshin > Date : 5 juillet 2010 22:36:11 HAEC > ? : Erlang-Questions Questions > Objet : Segmentation fault in crypto:dh_generate_key R13B4 > > > Erlang R13B4, OS X 10.6, erlang build from homebrew > > > otool -L /usr/local/lib/erlang/lib/crypto-1.6.4/priv/lib/crypto_drv.so > /usr/local/lib/erlang/lib/crypto-1.6.4/priv/lib/crypto_drv.so: > /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current > version 0.9.8) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current > version 125.0.0) > > > Starting attached file leads to Segmentation Fault: > > > maxbp:erlyvideo max$ ./dh_check.erl > Segmentation fault > > What should I do more to fix this problem? > As of R14A, crypto has been rewritten and is now based on NIF instead of relying on a linked-in driver. While this doesn't excuse the seg fault, I believe there is a bug in your code: DH_P = <<16#ff, 16#ff, 16#ff, 16#ff, 16#ff, 16#ff, 16#ff, 16#ff, 16#c9, 16#0f, 16#da, 16#a2, 16#21, 16#68, 16#c2, 16#34, 16#c4, 16#c6, 16#62, 16#8b, 16#80, 16#dc, 16#1c, 16#d1, 16#29, 16#02, 16#4e, 16#08, 16#8a, 16#67, 16#cc, 16#74, 16#02, 16#0b, 16#be, 16#a6, 16#3b, 16#13, 16#9b, 16#22, 16#51, 16#4a, 16#08, 16#79, 16#8e, 16#34, 16#04, 16#dd, 16#ef, 16#95, 16#19, 16#b3, 16#cd, 16#3a, 16#43, 16#1b, 16#30, 16#2b, 16#0a, 16#6d, 16#f2, 16#5f, 16#14, 16#37, 16#4f, 16#e1, 16#35, 16#6d, 16#6d, 16#51, 16#c2, 16#45, 16#e4, 16#85, 16#b5, 16#76, 16#62, 16#5e, 16#7e, 16#c6, 16#f4, 16#4c, 16#42, 16#e9, 16#a6, 16#37, 16#ed, 16#6b, 16#0b, 16#ff, 16#5c, 16#b6, 16#f4, 16#06, 16#b7, 16#ed, 16#ee, 16#38, 16#6b, 16#fb, 16#5a, 16#89, 16#9f, 16#a5, 16#ae, 16#9f, 16#24, 16#11, 16#7c, 16#4b, 16#1f, 16#e6, 16#49, 16#28, 16#66, 16#51, 16#ec, 16#e6, 16#53, 16#81, 16#ff, 16#ff, 16#ff, 16#ff, 16#ff, 16#ff, 16#ff, 16#ff>>, DH_G = 2, crypto:dh_generate_key([DH_P, DH_G]). You pass a binary which is not a mpint() and an integer to crypto:dh_generate_key/1. You should call crypto:mpint/1 instead, e.g.: DH_P = crypto:mpint(16#ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff), DH_G = crypto:mpint(2), crypto:dh_generate_key([DH_P, DH_G]). Paul -- Semiocast http://semiocast.com/ +33.175000290 - 62 bis rue Gay-Lussac, 75005 Paris From max.lapshin@REDACTED Tue Jul 6 10:16:26 2010 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 6 Jul 2010 12:16:26 +0400 Subject: [erlang-questions] Re: Segmentation fault in crypto:dh_generate_key R13B4 In-Reply-To: <74E5A8FE-C6D6-4697-8E8D-FBAFF80119B8@kallisys.net> References: <1278402610.30818.ezmlm@erlang.org> <74E5A8FE-C6D6-4697-8E8D-FBAFF80119B8@kallisys.net> Message-ID: You've seen my code in attached file. It produces segmentation fault, so it doesn't matter, whether it is bug in my code or not. Under no circumstances erlang linked-in driver should generate segfault. However, if it is rewritten, I will check under R14A and tell about my experience. From rapsey@REDACTED Tue Jul 6 10:32:18 2010 From: rapsey@REDACTED (Rapsey) Date: Tue, 6 Jul 2010 10:32:18 +0200 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: References: Message-ID: There are a number of hits on google if you search for erlang and mmo Sergej On Tue, Jul 6, 2010 at 10:05 AM, ingo.schramm wrote: > Does somebody ever used Erlang to program game servers? Is there any > real live industrial game solution written in Erlang? > > I need to know this for some evangelization :) > > Cheers, > Ingo > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From pguyot@REDACTED Tue Jul 6 10:33:51 2010 From: pguyot@REDACTED (Paul Guyot) Date: Tue, 6 Jul 2010 10:33:51 +0200 Subject: [erlang-questions] Re: Segmentation fault in crypto:dh_generate_key R13B4 In-Reply-To: References: <1278402610.30818.ezmlm@erlang.org> <74E5A8FE-C6D6-4697-8E8D-FBAFF80119B8@kallisys.net> Message-ID: <2B4B8C20-54D8-4089-ABBD-602B28D93172@kallisys.net> Le 6 juil. 2010 ? 10:16, Max Lapshin a ?crit : > You've seen my code in attached file. It produces segmentation fault, > so it doesn't matter, whether it is bug in my code or not. > Under no circumstances erlang linked-in driver should generate segfault. I agree. > However, if it is rewritten, I will check under R14A and tell about my > experience. For the record, the original code does not segfault with crypto 2.0 (R14A). Regards, Paul -- Semiocast http://semiocast.com/ +33.175000290 - 62 bis rue Gay-Lussac, 75005 Paris From gleber.p@REDACTED Tue Jul 6 12:43:39 2010 From: gleber.p@REDACTED (Gleb Peregud) Date: Tue, 6 Jul 2010 12:43:39 +0200 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: References: Message-ID: Vendetta Online (an Eve-like MMO game) is known to be at least partially written in Erlang On Tue, Jul 6, 2010 at 10:32, Rapsey wrote: > There are a number of hits on google if you search for erlang and mmo > > > Sergej > > > On Tue, Jul 6, 2010 at 10:05 AM, ingo.schramm > wrote: > >> Does somebody ever used Erlang to program game servers? Is there any >> real live industrial game solution written in Erlang? >> >> I need to know this for some evangelization :) >> >> Cheers, >> Ingo >> >> ________________________________________________________________ >> erlang-questions (at) erlang.org mailing list. >> See http://www.erlang.org/faq.html >> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED >> >> > From marc@REDACTED Tue Jul 6 13:19:34 2010 From: marc@REDACTED (Marc Worrell) Date: Tue, 6 Jul 2010 13:19:34 +0200 Subject: [erlang-questions] Looking for an Erlang developer In-Reply-To: <812947.17334.qm@web120510.mail.ne1.yahoo.com> References: <812947.17334.qm@web120510.mail.ne1.yahoo.com> Message-ID: Hi Ed, Thanks for the suggestion, I will look into it and see if we can add this. Best, Marc On Jul 5, 2010, at 14:21 , Ed Keith wrote: > It might be a good idea to also allow people looking for Erlang Jobs to post resumes. > > -EdK > > Ed Keith > e_d_k@REDACTED > > Blog: edkeith.blogspot.com > > > --- On Mon, 7/5/10, Marc Worrell wrote: > >> From: Marc Worrell >> Subject: [erlang-questions] Looking for an Erlang developer >> To: erlang-questions@REDACTED >> Date: Monday, July 5, 2010, 5:55 AM >> We are looking for an Erlang >> programmer and found that it is quite difficult to find >> someone. We also found that the available positions >> are spread out over many websites. Which makes it hard >> to find interesting positions for those that are looking for >> Erlang work. >> >> So we made a little site ( http://totally-erlang.com/ ) to quickly (and freely) >> publish any Erlang positions. >> >> The first thing we need now is other people joining in so >> if you know anybody that needs to post a job ? I would >> appreciate it if you pass it on! >> >> Kind Regards, >> >> Marc Worrell > > > From luismarianoguerra@REDACTED Tue Jul 6 14:09:15 2010 From: luismarianoguerra@REDACTED (Mariano Guerra) Date: Tue, 6 Jul 2010 09:09:15 -0300 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: References: Message-ID: On Tue, Jul 6, 2010 at 5:05 AM, ingo.schramm wrote: > Does somebody ever used Erlang to program game servers? Is there any > real live industrial game solution written in Erlang? > > I need to know this for some evangelization :) openpoker is written in erlang http://www.devmaster.net/articles/mmo-scalable-server/ http://github.com/wagerlabs/openpoker From bpaquet@REDACTED Tue Jul 6 17:53:05 2010 From: bpaquet@REDACTED (Bertrand Paquet) Date: Tue, 6 Jul 2010 17:53:05 +0200 Subject: Slave node and open file Message-ID: Hi, I have the following problem : 1) On master node, I start a remote erlang node with slave:start command, using ssh 2) I spawn a process in this node 3) In the spawned process, I run inet:gethostname() command, which give me the remote hostname -> OK 4) In the spawned process, I open /proc/sys/kernel/hostname : I get the local hostname -> It's not that I want Do you know : - if this comportement is normal : a remote node started with slave:start, which use file:open command access to master node filesystem ? - if there is a solution to access to the remote node file system ? Thank you for your help. Regards, Bertrand From max.lapshin@REDACTED Tue Jul 6 19:51:44 2010 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 6 Jul 2010 21:51:44 +0400 Subject: [erlang-questions] Slave node and open file In-Reply-To: References: Message-ID: rpc:call ? From zeno490@REDACTED Tue Jul 6 21:02:30 2010 From: zeno490@REDACTED (Nicholas Frechette) Date: Tue, 6 Jul 2010 15:02:30 -0400 Subject: [erlang-questions] Slave node and open file In-Reply-To: References: Message-ID: Unless I am mistaken, the erlang master/slave modules are designed such that all IO (perhaps only file system IO) on the slave is redirected to the master. This allows slaves to read/write to the master while doing the heavy lifting on the remote cpu. I'm not sure if you can access the slave's file system that way. On Tue, Jul 6, 2010 at 1:51 PM, Max Lapshin wrote: > rpc:call ? > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From bpaquet@REDACTED Wed Jul 7 08:37:09 2010 From: bpaquet@REDACTED (Bertrand Paquet) Date: Wed, 7 Jul 2010 08:37:09 +0200 Subject: [erlang-questions] Slave node and open file In-Reply-To: References: Message-ID: On Tue, Jul 6, 2010 at 21:02, Nicholas Frechette wrote: > Unless I am mistaken, the erlang master/slave modules are designed such that > all IO (perhaps only file system IO) on the slave is redirected to the > master. This allows slaves to read/write to the master while doing the heavy > lifting on the remote cpu. > I'm not sure if you can access the slave's file system that way. Network IOs are not redirected, but stdout and file IO seems to be :-) Do you know a solution to have the same function as slave:start, without redirection ? - start a remote node using rsh - stop remote nodes when killing master Actually, I do that with os:cmd("ssh remote erl ..."), but it's not very clean. And the remote erlang vm is not killed when I kill the master. Regards, Bertrand From kenji.rikitake@REDACTED Wed Jul 7 08:46:32 2010 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Wed, 7 Jul 2010 15:46:32 +0900 Subject: [erlang-questions] Tokyo Erlang Workshop #5: Friday 27-AUG-2010 8pm-10pm(JST) at Oracle Aoyama Center In-Reply-To: <20100706045128.GB9836@k2r.org> References: <20100706045128.GB9836@k2r.org> Message-ID: <20100707064632.GA34594@k2r.org> Reservation site for Tokyo Erlang Workshop #5 now available: http://atnd.org/events/6270 (in Japanese) FYI Kenji Rikitake In the message <20100706045128.GB9836@REDACTED> dated Tue, Jul 06, 2010 at 01:51:04PM +0900, Kenji Rikitake writes: > Date: Tue, 6 Jul 2010 13:51:28 +0900 > From: Kenji Rikitake > Subject: [erlang-questions] Tokyo Erlang Workshop #5: Friday 27-AUG-2010 8pm-10pm(JST) at > Oracle Aoyama Center > To: erlang-questions > > Tokyo Erlang Workshop #5 will be held on > Friday, August 27, 2010 8pm-10pm JST at > Oracle Aoyama Center (near Tokyo Metro Gaien-Mae station) > Location map in Japanese: > http://www.oracle.co.jp/aoyamacenter/ > > Presentations are mostly given in Japanese but English-speaking > participants are also welcome. > > Program details TBD. > (Gemini Mobile Technology Japan will make a presentation about the > Hibari KVS, in English. Details may be changed later.) > > Contact > Masahito Ikuta > for the further details. > > Regards, > Kenji Rikitake From therevoltingx@REDACTED Wed Jul 7 10:44:24 2010 From: therevoltingx@REDACTED (Miguel Morales) Date: Wed, 7 Jul 2010 01:44:24 -0700 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: References: Message-ID: I'm developing a mobile 2D multiplayer rpg, although it's not open source you can find my dev blog here: http://developingthedream.blogspot.com/ I use it alongside rabbitmq and a use the whole 'eveything is a process' method. Although I haven't released it and scaled it yet, I hope it'll scale will. That is if the game needs to. Some of the links posted are interesting, you'll also get a lot of hits if you google 'erlang mmo' It was interesting implementing things like game loops, pathfinding, chat, etc. Erlang so far has been a good choice. (err, sorry, I'm used to using the android-dev list, forgot to hit reply-all) On Tue, Jul 6, 2010 at 5:09 AM, Mariano Guerra wrote: > On Tue, Jul 6, 2010 at 5:05 AM, ingo.schramm > wrote: >> Does somebody ever used Erlang to program game servers? Is there any >> real live industrial game solution written in Erlang? >> >> I need to know this for some evangelization :) > > openpoker is written in erlang > > http://www.devmaster.net/articles/mmo-scalable-server/ > http://github.com/wagerlabs/openpoker > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > -- http://developingthedream.blogspot.com/, http://diastrofunk.com, http://www.youtube.com/user/revoltingx, ~Isaiah 55:8-9 From kostis@REDACTED Wed Jul 7 11:34:56 2010 From: kostis@REDACTED (Kostis Sagonas) Date: Wed, 07 Jul 2010 12:34:56 +0300 Subject: [erlang-questions] type specification In-Reply-To: <4C2EECED.7070601@tmit.bme.hu> References: <4C2E09B3.2050505@aleynikov.org> <4C2E16BB.8050506@cs.ntua.gr> <4C2E222D.7070000@tmit.bme.hu> <4C2EE4FB.5070104@cs.ntua.gr> <4C2EECED.7070601@tmit.bme.hu> Message-ID: <4C344A40.2030102@cs.ntua.gr> Zoltan Lajos Kis wrote: > Shouldn't I be warned that b:f breaks the opaqueness of a:my_type() with > the modules below? Well, first of all there is no such should as far as dialyzer is concerned. The only property that dialyzer guarantees is that it will never produce a warning that is not a discrepancy. Dialyzer has nowhere mentioned that it will identify all discrepancies in your program. There is a fundamental reason why this is so: so that it guarantees that it will never produce a warning that is not a discrepancy ;-) This property aside, the reason why currently you get no such warning is that there is no information flow between the module defining the opaque data type and the module where the data type is used. (In fact, in your example, the module defining the opaque data type does not really construct any such term.) Write in module 'a' a function that constructs an opaque term, i.e. -spec new() -> my_type() new() -> {foo, bar}. and use this in module 'b' as follows: use() -> T = a:new(), f(T). and you will get a warning. I hope it is clear what's happening. > -------------------------------------------- > -module(a). > -compile(export_all). > > -opaque( my_type() :: {atom(), atom()} ). > > -export_type([my_type/0]). > > -spec( f(my_type()) -> atom() ). > f({A,_B}) -> A. > --------------------------------------------- > -module(b). > -compile(export_all). > > -spec( f(a:my_type()) -> atom() ). > f({A,_B}) -> A. > --------------------------------------------- Now, having written all the above, in the current development version of dialyzer we have made, long before your mail, an important enhancement to the analysis that it will allow you to get the warning you desire. Indeed, I get: b.erl:5: Function f/1 has no local return b.erl:5: The attempt to match a term of type a:my_type() against the pattern {A, _B} breaks the opaqueness of the term Stay tuned for R14B! Kostis From zeno490@REDACTED Wed Jul 7 15:59:12 2010 From: zeno490@REDACTED (Nicholas Frechette) Date: Wed, 7 Jul 2010 09:59:12 -0400 Subject: [erlang-questions] Slave node and open file In-Reply-To: References: Message-ID: Couldn't you connect the slave to the master and link against say, the supervisor process of the master? If the node goes down or shuts down, won't that take down the slave as well? You could even do all that from the master node via rpc module (ie: fork slave node with name 'foo', use rpc to fork a process that links both the process on the master that simply kills the slave node when it receives the node down message). You can even send the code from the master such that it doesn't need to be where the slave is started. Unless there is a cleaner way to do it, that's probably how I would hack it up if I had to. On Wed, Jul 7, 2010 at 2:37 AM, Bertrand Paquet wrote: > On Tue, Jul 6, 2010 at 21:02, Nicholas Frechette > wrote: > > Unless I am mistaken, the erlang master/slave modules are designed such > that > > all IO (perhaps only file system IO) on the slave is redirected to the > > master. This allows slaves to read/write to the master while doing the > heavy > > lifting on the remote cpu. > > I'm not sure if you can access the slave's file system that way. > > Network IOs are not redirected, but stdout and file IO seems to be :-) > > Do you know a solution to have the same function as slave:start, > without redirection ? > - start a remote node using rsh > - stop remote nodes when killing master > > Actually, I do that with os:cmd("ssh remote erl ..."), but it's not > very clean. And the remote erlang vm is not killed when I kill the > master. > > Regards, > > Bertrand > From mjtruog@REDACTED Wed Jul 7 16:36:03 2010 From: mjtruog@REDACTED (Michael Truog) Date: Wed, 07 Jul 2010 07:36:03 -0700 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: References: Message-ID: <4C3490D3.1030108@gmail.com> The biggest seems to be Vendetta Online http://www.vendetta-online.com/ Their engine is being sold/licensed here http://www.guildsoftware.com/naos/ However, the Erlang piece seems to be mainly for NPC actors (ships (?)) and the AI associated with them... but that is just speculation after reading their development blog a year or two ago (I think that is when it went into production). They call it the "/Kourier"/ system. Here is a paper on the topic http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.73.5033 For a normal MMO you would probably need a few NIFs to make everything as efficient as possible but its scalability should surpass other language implementations (with less lines of code and less complexity). Miguel Morales wrote: > I'm developing a mobile 2D multiplayer rpg, although it's not open > source you can find my dev blog here: > http://developingthedream.blogspot.com/ > > I use it alongside rabbitmq and a use the whole 'eveything is a process' method. > Although I haven't released it and scaled it yet, I hope it'll scale > will. That is if the game needs to. > Some of the links posted are interesting, you'll also get a lot of > hits if you google 'erlang mmo' > > It was interesting implementing things like game loops, pathfinding, > chat, etc. Erlang so far has been a good choice. > > (err, sorry, I'm used to using the android-dev list, forgot to hit reply-all) > > > On Tue, Jul 6, 2010 at 5:09 AM, Mariano Guerra > wrote: > >> On Tue, Jul 6, 2010 at 5:05 AM, ingo.schramm >> wrote: >> >>> Does somebody ever used Erlang to program game servers? Is there any >>> real live industrial game solution written in Erlang? >>> >>> I need to know this for some evangelization :) >>> >> openpoker is written in erlang >> >> http://www.devmaster.net/articles/mmo-scalable-server/ >> http://github.com/wagerlabs/openpoker >> >> ________________________________________________________________ >> erlang-questions (at) erlang.org mailing list. >> See http://www.erlang.org/faq.html >> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED >> >> >> > > > > From zeno490@REDACTED Wed Jul 7 18:27:16 2010 From: zeno490@REDACTED (Nicholas Frechette) Date: Wed, 7 Jul 2010 12:27:16 -0400 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: <4C3490D3.1030108@gmail.com> References: <4C3490D3.1030108@gmail.com> Message-ID: For an MMO backend, erlang could be decent. Depending on how many external libraries you use or rather how many native libraries you need to interface with, it might not be too bad. No reason I can think of why you couldn't. For a regular game or for an MMO client however, I'm not so sure. For those, something like C# might be a better fit (easy to interface with C++, native or managed). As far as consoles go, I could see erlang running on a 360 fine, using all cores but not so much on a Wii (where you too often need to hand optimize code which will require C++/assembly) and not so much on the PS3 where you may get a hard time using the SPUs from erlang (as I'm guessing the VM won't run on them out of the box and you might have to spend considerable time to get erlang processes to run on SPUs (feasible I'm sure)). You'll definitely need a large number of NIFs for allocating memory aligned binaries for all that data you need to process with SIMD instructions and all kind of other stuff too. Games where performance isn't a huge bottleneck or where is it easy to parallelize would be a good fit for erlang, such as the poker game mentioned. I could see a small company willing to invest in building their core tech in erlang but I doubt we'll see any big ones change any time soon. For them, it would make more business sense to build support applications with it (such as online presence stuff, debugging tools, test tools, data/code build tools, etc.), things you mostly access through a network or are distributed in nature. The truth is that most game programmers out there are fundamentally imperative programmers. I work in the industry and frankly, I haven't met many programmers that have used functional p. languages beyond a few simple scripts or that have even played with them in the past. Most of them come from a C/C++ background and as such, if you are a company looking to hire talent and experience, you'll need to offer work in something they are familiar with. This is mainly why a language like C# has more chances of succeeding, if only because of the familiar syntax. I do believe the code quality would be higher if more of it was written in a functional language but I can't picture seeing it happening very fast. I do know of some studios using LISP variants and I also know they have a hard time hiring programmers (mostly hire seniors with functional p. experience and game experience, which is not so common). Also keep in mind a substantial portion of the companies out there making video games are essentially microsoft shops. They run windows, use visual studio, etc. That means they have support directly from microsoft for all their products (compilers, linkers, sdks, etc.). There is a huge incentive to use microsoft products for them in development so even when an opportunity arises where they could build an application, they will often opt for C++ or C# (or a mix of both) because of that fact and the one mentioned above where that is where most of their talent pool lies. As such, for anyone part of such a project, it'll be an uphill battle. The state of things is unlikely to change anytime soon seeing three of the four biggest markets are PC gaming, console gaming (360 SDK pretty much requires windows/vs) and web based games (flash dev tools are mostly for windows, so is silverlight (who uses java anymore on the web anyway?)) The fourth being mobile games. (Mac/linux gaming omitted, while it is slowly picking up recently (specially noticeable with Stream), it isn't very big yet) For erlang to make more headway into games, I believe they would need to make it easier to integrate into existing applications. It is fairly straightforward to integrate python, lisp, lua or even javascript into an existing application but I'm not sure I could say the same of erlang. Being easy to embed would be a great first step, allowing progressive transition from C++ into erlang (for PC at least). To use erlang on consoles, you'll need a beam to native compiler for sure as some consoles do not allow interpreted code to execute (ie: PS3, applies to mobile devices as well such as the iPhone/iPad). Even if it were for just a subset of erlang, an LLVM frontend could achieve that with backends for different target architectures. Thankfully the current generation of consoles is all powerpc based so that might not be that much work. I for one would love to see erlang used more in games as well as their supporting applications :) 2cents Nicholas On Wed, Jul 7, 2010 at 10:36 AM, Michael Truog wrote: > The biggest seems to be Vendetta Online > http://www.vendetta-online.com/ > > Their engine is being sold/licensed here > http://www.guildsoftware.com/naos/ > > However, the Erlang piece seems to be mainly for NPC actors (ships (?)) > and the AI associated with them... but that is just speculation after > reading their development blog a year or two ago (I think that is when > it went into production). They call it the "/Kourier"/ system. > > Here is a paper on the topic > http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.73.5033 > > For a normal MMO you would probably need a few NIFs to make everything > as efficient as possible but its scalability should surpass other > language implementations (with less lines of code and less complexity). > > > Miguel Morales wrote: > > I'm developing a mobile 2D multiplayer rpg, although it's not open > > source you can find my dev blog here: > > http://developingthedream.blogspot.com/ > > > > I use it alongside rabbitmq and a use the whole 'eveything is a process' > method. > > Although I haven't released it and scaled it yet, I hope it'll scale > > will. That is if the game needs to. > > Some of the links posted are interesting, you'll also get a lot of > > hits if you google 'erlang mmo' > > > > It was interesting implementing things like game loops, pathfinding, > > chat, etc. Erlang so far has been a good choice. > > > > (err, sorry, I'm used to using the android-dev list, forgot to hit > reply-all) > > > > > > On Tue, Jul 6, 2010 at 5:09 AM, Mariano Guerra > > wrote: > > > >> On Tue, Jul 6, 2010 at 5:05 AM, ingo.schramm > >> wrote: > >> > >>> Does somebody ever used Erlang to program game servers? Is there any > >>> real live industrial game solution written in Erlang? > >>> > >>> I need to know this for some evangelization :) > >>> > >> openpoker is written in erlang > >> > >> http://www.devmaster.net/articles/mmo-scalable-server/ > >> http://github.com/wagerlabs/openpoker > >> > >> ________________________________________________________________ > >> erlang-questions (at) erlang.org mailing list. > >> See http://www.erlang.org/faq.html > >> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > >> > >> > >> > > > > > > > > > > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From anton.krasovsky@REDACTED Wed Jul 7 23:59:50 2010 From: anton.krasovsky@REDACTED (Anton Krasovsky) Date: Wed, 7 Jul 2010 22:59:50 +0100 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: References: Message-ID: http://www.demonware.net/ who are owned by Activision/Blizzard are using Erlang. Anton On Tue, Jul 6, 2010 at 9:05 AM, ingo.schramm wrote: > Does somebody ever used Erlang to program game servers? Is there any > real live industrial game solution written in Erlang? > > I need to know this for some evangelization :) > > Cheers, > Ingo > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From ok@REDACTED Thu Jul 8 02:05:24 2010 From: ok@REDACTED (Richard O'Keefe) Date: Thu, 8 Jul 2010 12:05:24 +1200 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: References: <4C3490D3.1030108@gmail.com> Message-ID: <7DC4E578-DDDA-47BA-BE09-1733A209799E@cs.otago.ac.nz> On Jul 8, 2010, at 4:27 AM, Nicholas Frechette wrote: > hand optimize code which will require C++/assembly) and not so much > on the > PS3 where you may get a hard time using the SPUs from erlang (as I'm > guessing the VM won't run on them out of the box and you might have > to spend > considerable time to get erlang processes to run on SPUs (feasible I'm > sure)). It's not clear that it _is_ feasible in any interesting sense. The SPUs are essentially numeric vector engines. They have 128 registers, each 128 bits wide; loads are only 128 bits (16 bytes) and stores are only 128 bits (16 bytes). Memory is byte addressed and addresses are 32 bits, but the 2009 manual talks about 256 kB. One could imagine SPU _nodes_ doing vector crunching that Erlang processes running on the PPU communicated with as if Erlang. But Erlang would not be the language of choice for programming SPUs. (An APL dialect would be ideal, or Fortran 95.) From dangud@REDACTED Thu Jul 8 09:44:07 2010 From: dangud@REDACTED (Dan Gudmundsson) Date: Thu, 8 Jul 2010 09:44:07 +0200 Subject: [erlang-questions] Re: On Windows XP (SP2): wx broken In-Reply-To: References: <9C6B96B5-37FA-4CF6-A7D3-663736CEE916@gmail.com> <69869ad8-a27a-48e6-8835-8303a87ed40d@g11g2000yqe.googlegroups.com> <93df43b61003032220m5b4d396dn4aca92270134d795@mail.gmail.com> Message-ID: Have you with this problem tried R14A, is it working now? I found that we had upgraded Visual Studio without recompiling wxWidgets DLL's causing the wx-driver to be dependent on two different versions of the runtime DLL, where only the latest where installed with erlang. Thanks for locating it. /Dan On Fri, Mar 5, 2010 at 4:48 AM, MapAndFold wrote: > I have a Intel Core 2, SMP is enabled, and I am using werl. > > Erlang R13B04 (erts-5.7.5) [smp:2:2] [rq:2] [async-threads:0] > > Eshell V5.7.5 ?(abort with ^G) > 1> wx:demo(). > > Then, a memory access error occurred, and werl aborted. > > --------------------------- > werl.exe - Application Error > --------------------------- > The instruction at "0x7c911948" referenced memory at "0x00000000". The > memory could not be "read". > > On Thu, Mar 4, 2010 at 2:20 PM, Dan Gudmundsson wrote: >> Are you running it from werl? >> >> erl and wxwidgets seems to be fighting for stdio, so it needs to be run from >> werl or erl -detached -s wx demo >> >> /Dan >> >> On Thu, Mar 4, 2010 at 7:01 AM, Steve Davis >> wrote: >> > From schramm.ingo@REDACTED Thu Jul 8 09:54:16 2010 From: schramm.ingo@REDACTED (ingo.schramm) Date: Thu, 8 Jul 2010 00:54:16 -0700 (PDT) Subject: Erlang: Who uses it for games? In-Reply-To: <7DC4E578-DDDA-47BA-BE09-1733A209799E@cs.otago.ac.nz> References: <4C3490D3.1030108@gmail.com> <7DC4E578-DDDA-47BA-BE09-1733A209799E@cs.otago.ac.nz> Message-ID: <95f43ac3-f279-4990-b4eb-c90fef53192e@r27g2000yqb.googlegroups.com> Great! So many Erlang gamers out there! Somebody told me, a Battlestar Galactica browser game is backed up by an Erlang engine. On Jul 8, 2:05?am, "Richard O'Keefe" wrote: > On Jul 8, 2010, at 4:27 AM, Nicholas Frechette wrote: > > > hand optimize code which will require C++/assembly) and not so much ? > > on the > > PS3 where you may get a hard time using the SPUs from erlang (as I'm > > guessing the VM won't run on them out of the box and you might have ? > > to spend > > considerable time to get erlang processes to run on SPUs (feasible I'm > > sure)). > > It's not clear that it _is_ feasible in any interesting sense. > The SPUs are essentially numeric vector engines. ?They have 128 > registers, each 128 bits wide; loads are only 128 bits (16 bytes) > and stores are only 128 bits (16 bytes). ?Memory is byte addressed > and addresses are 32 bits, but the 2009 manual talks about 256 kB. > > One could imagine SPU _nodes_ doing vector crunching that Erlang > processes running on the PPU communicated with as if Erlang. ?But > Erlang would not be the language of choice for programming SPUs. > (An APL dialect would be ideal, or Fortran 95.) > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > Seehttp://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscr...@REDACTED From 8mayday@REDACTED Thu Jul 8 11:57:46 2010 From: 8mayday@REDACTED (Andrey Popp) Date: Thu, 8 Jul 2010 13:57:46 +0400 Subject: Possible leak in inets httpc. Message-ID: Hello, I have application that makes huge number of HTTP requests with httpc and I have spotted that `httpc_manager__handler_db` ETS table growing in size and doesn't clean up. That is the example records from this table (ets:i(httpc_manager__handler_db)): <1 > {handler_info,#Ref<0.0.0.18800>,undefined,<0.177.0>,undefined,operational} <2 > {handler_info,#Ref<0.0.0.35242>,undefined,<0.3075.0>,undefined,operational} <3 > {handler_info,#Ref<0.0.0.61713>,undefined,<0.5755.0>,undefined,operational} <4 > {handler_info,#Ref<0.0.0.68114>,undefined,<0.6943.0>,undefined,operational} <5 > {handler_info,#Ref<0.0.0.85303>,undefined,<0.8305.0>,undefined,operational} and processes with handler pids are no longer alive. Also, note that I have no timeout setting in my http:request HTTPOptions, but I think inets should not leak even in that case. Thanks. -- Andrey Popp phone: +7 911 740 24 91 e-mail: 8mayday@REDACTED From michael.eugene.turner@REDACTED Thu Jul 8 12:10:45 2010 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Thu, 8 Jul 2010 19:10:45 +0900 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: References: Message-ID: Though James Hague has mainly talked about client-side game programming, and mostly separately from Erlang topics, his writings are on both Erlang and games is fascinating, and even where there's no clear overlap, they perhaps be a source of insights on this topic. Besides which, reading him on these subjects leads you compulsively onto other programming topics he's covered, and before you know it, you've eaten the *whole bag* of potato chips ;-) *http://tinyurl.com/26dthru* * * -michael turner On Tue, Jul 6, 2010 at 5:05 PM, ingo.schramm wrote: > Does somebody ever used Erlang to program game servers? Is there any > real live industrial game solution written in Erlang? > > I need to know this for some evangelization :) > > Cheers, > Ingo > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From 8mayday@REDACTED Thu Jul 8 12:12:07 2010 From: 8mayday@REDACTED (Andrey Popp) Date: Thu, 8 Jul 2010 14:12:07 +0400 Subject: Possible leak in inets httpc. In-Reply-To: References: Message-ID: It seems it has been fixed with [1] in inets-5.3.2. Sorry. [1]: http://github.com/erlang/otp/commit/91c89d54d45989a85367f10d5902b9b508754a49 On Thu, Jul 8, 2010 at 1:57 PM, Andrey Popp <8mayday@REDACTED> wrote: > Hello, > > I have application that makes huge number of HTTP requests with httpc > and I have spotted that `httpc_manager__handler_db` ETS table growing > in size and doesn't clean up. That is the example records from this > table (ets:i(httpc_manager__handler_db)): > > <1 ? > {handler_info,#Ref<0.0.0.18800>,undefined,<0.177.0>,undefined,operational} > <2 ? > {handler_info,#Ref<0.0.0.35242>,undefined,<0.3075.0>,undefined,operational} > <3 ? > {handler_info,#Ref<0.0.0.61713>,undefined,<0.5755.0>,undefined,operational} > <4 ? > {handler_info,#Ref<0.0.0.68114>,undefined,<0.6943.0>,undefined,operational} > <5 ? > {handler_info,#Ref<0.0.0.85303>,undefined,<0.8305.0>,undefined,operational} > > and processes with handler pids are no longer alive. Also, note that I > have no timeout setting in my http:request HTTPOptions, but I think > inets should not leak even in that case. > > Thanks. > > -- > Andrey Popp > > phone: +7 911 740 24 91 > e-mail: 8mayday@REDACTED > -- Andrey Popp phone: +7 911 740 24 91 e-mail: 8mayday@REDACTED From michael.eugene.turner@REDACTED Thu Jul 8 12:47:05 2010 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Thu, 8 Jul 2010 19:47:05 +0900 Subject: Something like csh "source" command in Erlang shell? Message-ID: Is there some way to read in a bunch of Erlang shell commands as if they'd been typed in? I'm thinking of something like the "source" command in csh. OK: why? That's a reasonable question. The reason I want this: I started into a tutorial for wx that was very command-line intensive, showing how you call wx to put up a window, put a menu in that window, put an item in that menu, etc., just by issuing commands in the shell. I was quite delighted to see that Erlang is almost like Tcl/Tk's tclsh in this respect. Perhaps it's an under-appreciated feature of graphics programming for Erlang. If you don't mind stuffing a lot of callbacks into fun-valued variables, you can actually bring up a whole little GUI through which you can actually do stuff, just by typing commands into the Erlang shell. But then if you q() out, it all goes away. What I'd like to do here is to tell the tutorial reader to copy-paste the commands of interest to a file, one that can be read back in as a series of commands, not only to rebuild the GUI being assembled interactively, but also to reestablish --*in the Erlang shell session* -- the variable bindings made by the commands. Eventually, of course, you want the reader of the tutorial to either throw all that out or package it more cleanly in a module, before continuing. In the meantime, though, it would give them a way to "pick up where they left off" in an ongoing command line dialogue, by reading in all the commands they wanted to keep, in the order they issued them. Not to mention that having all the commands of interest, in order, batched in a text file, makes for easier review. I think for learning even the rudiments of something as sprawling as wx, this approach, "today's commands after re-reading, then re-using, yesterday's", would be helpful. Is there something like this in the Erlang shell, either undocumented or so under-documented that I keep missing it? -michael turner From attila.r.nohl@REDACTED Thu Jul 8 14:11:14 2010 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Thu, 8 Jul 2010 14:11:14 +0200 Subject: [erlang-questions] Something like csh "source" command in Erlang shell? In-Reply-To: References: Message-ID: 2010/7/8, Michael Turner : > Is there some way to read in a bunch of Erlang shell commands as if they'd > been typed in? I'm thinking of something like the "source" command in csh. file:eval/1 isn't what you want? From james.hague@REDACTED Thu Jul 8 15:24:26 2010 From: james.hague@REDACTED (James Hague) Date: Thu, 8 Jul 2010 08:24:26 -0500 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: References: <4C3490D3.1030108@gmail.com> Message-ID: >To use erlang on consoles, you'll >need a beam to native compiler for sure as some consoles do not allow >interpreted code to execute (ie: PS3, applies to mobile devices as well such >as the iPhone/iPad). Not true about the PS3. Using Lua as a scripting language is common. (It's also used in iPhone games.) A bigger problem is that BEAM relies on gcc extensions for speed, so you have to take the hit if you're using platform where a specific C compiler is mandated. From mixolyde@REDACTED Thu Jul 8 15:34:29 2010 From: mixolyde@REDACTED (Brian Williams) Date: Thu, 8 Jul 2010 09:34:29 -0400 Subject: Nested Record Pattern Matching in R14A Message-ID: I converted a small search algorithm project to use the new nested record syntax in R14A. My records are: -record(state, {yard_state}). -record(solution_state, {state = #state{}, moves, depth}). -record(astar_solution_state, {solution_state = #solution_state{}, fvalue}). I was able to use a line like this to access a field in the nested record: Astar_Solution_State#astar_solution_state.solution_state#solution_state.state Based on the example in the reference manual, I thought the pattern for matching the state field would be: function_call(#astar_solution_state.solution_state#solution_state{state = State}) However, that gave me "illegal pattern" errors, and after a bit of fiddling, I got this to work: #astar_solution_state{solution_state = #solution_state{state = State}} Is this intended? Or a bug? -- Brian E. Williams mixolyde@REDACTED http://www.techhouse.us/wordpress-mu/brianw "Never attribute to malice that which can be adequately explained by stupidity." - Hanlon's Razor From ulf.wiger@REDACTED Thu Jul 8 15:34:36 2010 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Thu, 08 Jul 2010 15:34:36 +0200 Subject: [erlang-questions] Something like csh "source" command in Erlang shell? In-Reply-To: References: Message-ID: <4C35D3EC.8050807@erlang-solutions.com> I don't think that can be done out of the box. Some assembly is certainly required. I wrote a small code snippet to allow saving the shell history to a file in a format that can be handled by file:eval/1 or file:script/1 (the difference between the two is that the latter returns the result of the last expression, while file:eval/1 only returns 'ok'). http://gist.github.com/468003 The code doesn't bother checking whether the commands were successful before saving, but this could be added. How to restore the bindings in the shell would be another challenge. I've not looked into whether it can be done without hacking the evaluator. BR, Ulf W -- Ulf Wiger CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd http://www.erlang-solutions.com From mononcqc@REDACTED Thu Jul 8 15:46:15 2010 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 8 Jul 2010 09:46:15 -0400 Subject: gen_event init and global names. Message-ID: I'm working on Chut (reading the app's design might be useful), trying to add type specs to my program when I found I were breaking contracts with the gen_event:start_link/1 and gen_fsm:start_link/3 functions. I prototyped my application using the global module directly to register my processes (I need name distribution), which accepts any term for a name (I use {atom(), term()}). However, I later on moved it all to a supervision tree and consequently moved the registration of the processes to the gen_event and gen_fsm mechanisms, using {global, Name}. This, as expected, creates a problem because: 1. the contract is broken - {global, {atom(), term()}} =/= {global, atom()}. 2. I can no longer pass conflict-resolving functions to the global module as the OTP behaviors take no argument for that. So to get the functionality back and respect types, I decided to move in the global registration to gen_fsm's init function. I'd just pass the supervisor the name info needed, which would then pass it to gen_fsm:start_link/3, which would in turn call Mod:init/1 with the right info for it to register itself. This would work well, without any big apparent problem. However, this won't hold with the gen_event because there isn't any way to have an init function running in there without having a handler. I also can't add a handler without naming the process because I have no direct access to the Pid. Things go a bit like this: --> top-level supervisor:add_child --> user_supervisor:start_link --> my_gen_event:start_link. I'm a bit lost with it all. The only solution I've found that would work and be easy to implement would be to use the user_supervisor to find the gen_event (with supervisor:which_children), then add an event handler whose role is to do the registration in its own init/1 function. Does anyone else have a better idea? Ideally I'd like not to change my app's architecture too much given it fits pretty much every requirements I had already, except for the type contracts. From lfredlund@REDACTED Thu Jul 8 16:14:38 2010 From: lfredlund@REDACTED (=?ISO-8859-1?Q?Lars-=C5ke_Fredlund?=) Date: Thu, 08 Jul 2010 16:14:38 +0200 Subject: [erlang-questions] Something like csh "source" command in Erlang shell? In-Reply-To: References: Message-ID: <4C35DD4E.6060809@fi.upm.es> On 07/08/2010 02:11 PM, Attila Rajmund Nohl wrote: > 2010/7/8, Michael Turner: > >> Is there some way to read in a bunch of Erlang shell commands as if they'd >> been typed in? I'm thinking of something like the "source" command in csh. >> > file:eval/1 isn't what you want? > Does file:eval really permit executing normal shell commands? That is, reading record definitions using rr("record.hrl") for instance? I too would be very happy to have a source command functionality for the shell. Preferably the "source command" would be a normal function rather than a shell command so that one could automatically read in a number of definitions when Erlang starts without typing anything. From mats.westin@REDACTED Thu Jul 8 16:30:13 2010 From: mats.westin@REDACTED (Mats) Date: Thu, 8 Jul 2010 16:30:13 +0200 Subject: [erlang-questions] Something like csh "source" command in Erlang shell? In-Reply-To: References: Message-ID: Screen can receive text as if you were typing it. Start erlang inside screen with: screen -S erl_screen erl Send a file: screen -S erl_screen -p 0 -X stuff "`cat hist_erl`" A cr with: screen -S erl_screen -p 0 -X stuff $'\n' Quit your session with: screen -S erl_screen -p 0 -X quit On Thu, Jul 8, 2010 at 12:47 PM, Michael Turner < michael.eugene.turner@REDACTED> wrote: > Is there some way to read in a bunch of Erlang shell commands as if they'd > been typed in? I'm thinking of something like the "source" command in csh. > > OK: why? That's a reasonable question. > > The reason I want this: I started into a tutorial for wx that was very > command-line intensive, showing how you call wx to put up a window, put a > menu in that window, put an item in that menu, etc., just by issuing > commands in the shell. I was quite delighted to see that Erlang is almost > like Tcl/Tk's tclsh in this respect. Perhaps it's an under-appreciated > feature of graphics programming for Erlang. > > If you don't mind stuffing a lot of callbacks into fun-valued variables, > you > can actually bring up a whole little GUI through which you can actually do > stuff, just by typing commands into the Erlang shell. > > But then if you q() out, it all goes away. > > What I'd like to do here is to tell the tutorial reader to copy-paste the > commands of interest to a file, one that can be read back in as a series of > commands, not only to rebuild the GUI being assembled interactively, but > also to reestablish --*in the Erlang shell session* -- the variable > bindings made by the commands. Eventually, of course, you want the reader > of the tutorial to either throw all that out or package it more cleanly in > a > module, before continuing. In the meantime, though, it would give them a > way to "pick up where they left off" in an ongoing command line dialogue, > by > reading in all the commands they wanted to keep, in the order they issued > them. Not to mention that having all the commands of interest, in order, > batched in a text file, makes for easier review. I think for learning even > the rudiments of something as sprawling as wx, this approach, "today's > commands after re-reading, then re-using, yesterday's", would be helpful. > > Is there something like this in the Erlang shell, either undocumented or so > under-documented that I keep missing it? > > -michael turner > From zeno490@REDACTED Thu Jul 8 16:47:29 2010 From: zeno490@REDACTED (Nicholas Frechette) Date: Thu, 8 Jul 2010 10:47:29 -0400 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: <7DC4E578-DDDA-47BA-BE09-1733A209799E@cs.otago.ac.nz> References: <4C3490D3.1030108@gmail.com> <7DC4E578-DDDA-47BA-BE09-1733A209799E@cs.otago.ac.nz> Message-ID: While yes the SPUs are mainly for vector processing, imo, they could be suited quite well in practice for erlang processes. 256kb is total space they have for code/data as such would be great for small processes. Erlang processes already have all their data immutable meaning this would imply little need to dma info in/out of spus. While not designed for it, the SPUs can still be used for general processing and in fact, it is better to use them with something they aren't so good at rather than not use them at all. You'll find that a large number of ps3 games, even today make use of less than 75% of the SPUs. Since most erlang applications are already message passing based, the processes need not share their memory with each other. Obviously, the size being the key factor here, one would still have to fit the code in <150kb to be able to do much with the processes. For long lists processing or large binaries, one might be able to do double buffering (or tripple) and still keep decent speeds. This could be done in erlang with minimal nif support, see below. I'd see it like this: you'd spawn a process, you'd mark it as being "spu friendly" so that the spus can find it when they look for the next process to execute. SPUs would then dma the code & process data and run it and then move on to the next process. For long running processes, one could artificially "yield" to allow the spu to run another task before returning to it, something like a yield() nif. Obviously, only a subset of erlang would run out of the box, as things like io/kernel stuff would require message passing with a process on the PPU to execute them. I could see number crunching processes having a partner process on the PPU who's job would be to partition/segment the data and feed it to the SPU process on demand. The spu process could then do something like: %% Process data in 50kb chunks, or perhaps less loop(SomeData, CurrPos) -> PPUPartner ! {send_next, CurrPos}, %% DMAed and sent to the PPU partner process executing on the PPU, might not be needed if the partner process just splits everything up front and queues all the processing messages or keeps track via the 'processed' message and keeps the queue full or at a decent size process current pos. stuff here, part 1... %% This doesn't have to be simd stuff, but very well could be (using NIFs) begin_receive_msgs(), %% NIF to start dma of messages, this would start streaming in the next data chunk, optional, only there to reduce latency from blocking receive statement which has to dma any new messages and wait for their data process current pos. stuff here, part 2... PPUPartner ! {processed, CurrPos, Result}, %% Sends the result calculated back to the ppu partner process to gather them back, come to think of it, this pattern is similar to map-reduce receive {data, Data, Pos} -> loop(Data, Pos), done -> ok end. When the process ends execution, run GC if needed, wait for all pending DMAs to finish and grab the next one. On the PPU side, the partner process mostly idles waiting for the SPU to be done with the data and request more or send back results. It would do simple operations like appending the result to the head of a list for max performance then at the end, simple run a lists:reverse (as done traditionally anyway) or for long lists, run that operation on the SPUs as well (lists:spu_reverse?). 1 PPU partner process could easily split work among several SPU processes, feeding them and gathering/sorting their results. Anyhow, sorry for the lengthy train of thoughts. It is a shame now that the PS3 is no longer supporting the "other OS" option otherwise I would love to experiment with something like this. Then again, it appears IBM will no longer develop new cell processors in the future so this effort might be moot. (I think they are stopping at something like 2 ppu hyper threaded cores (4 virtual cores) and 32 spu cores per chip? alas I forgot the details) I'm also not sure if the other os option allowed the OS to access to the spus in the first place as if I remember correctly, a number of things are "turned off" and inaccessible so mostly all of this talk is speculation :). 2cents :) Nicholas On Wed, Jul 7, 2010 at 8:05 PM, Richard O'Keefe wrote: > > On Jul 8, 2010, at 4:27 AM, Nicholas Frechette wrote: > >> hand optimize code which will require C++/assembly) and not so much on the >> PS3 where you may get a hard time using the SPUs from erlang (as I'm >> guessing the VM won't run on them out of the box and you might have to >> spend >> considerable time to get erlang processes to run on SPUs (feasible I'm >> sure)). >> > > It's not clear that it _is_ feasible in any interesting sense. > The SPUs are essentially numeric vector engines. They have 128 > registers, each 128 bits wide; loads are only 128 bits (16 bytes) > and stores are only 128 bits (16 bytes). Memory is byte addressed > and addresses are 32 bits, but the 2009 manual talks about 256 kB. > > One could imagine SPU _nodes_ doing vector crunching that Erlang > processes running on the PPU communicated with as if Erlang. But > Erlang would not be the language of choice for programming SPUs. > (An APL dialect would be ideal, or Fortran 95.) > > > From erlangy@REDACTED Thu Jul 8 17:00:31 2010 From: erlangy@REDACTED (Michael McDaniel) Date: Thu, 8 Jul 2010 08:00:31 -0700 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: References: Message-ID: <20100708150030.GT30357@delora.autosys.us> On Thu, Jul 08, 2010 at 07:10:45PM +0900, Michael Turner wrote: > Though James Hague has mainly talked about client-side game programming, and > mostly separately from Erlang topics, his writings are on both Erlang and > games is fascinating, and even where there's no clear overlap, they perhaps > be a source of insights on this topic. Besides which, reading him on these > subjects leads you compulsively onto other programming topics he's covered, > and before you know it, you've eaten the *whole bag* of potato chips ;-) > > *http://tinyurl.com/26dthru* > * > * > -michael turner > > On Tue, Jul 6, 2010 at 5:05 PM, ingo.schramm wrote: > > > Does somebody ever used Erlang to program game servers? Is there any > > real live industrial game solution written in Erlang? > > > > I need to know this for some evangelization :) > > > > Cheers, > > Ingo > > ________________________________________________________________ This is the article by James that introduced me to Erlang ... http://www.dadgum.com/james/performance.html (see also http://prog21.dadgum.com/11.html) I think I stumbled upon the original performance article in early 2005 and investigated Erlang at that time. I was fairly burnt out on computers and especially software (after about 30 years of computers, last 20 of which were software). I was on a multi-month (year?) hiatus from software/systems creation in any form. Then I stumbled upon James's article and actually got excited about software again! James introduced me to a tool, Erlang, that didn't get in my way, but actually, in a major way, facilitated my end results. And provided some income and lots of fun (still). James, I doubt I ever said so until now, so *"Thank you"* for the original performance article and introduction to Erlang. (I have told the OTP team *Thank you* for Erlang, and do so again here). ~M -- Michael McDaniel Portland, Oregon, USA http://trip.autosys.us http://edids.org From michael.eugene.turner@REDACTED Thu Jul 8 17:29:11 2010 From: michael.eugene.turner@REDACTED (Michael Turner) Date: Fri, 9 Jul 2010 00:29:11 +0900 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: <20100708150030.GT30357@delora.autosys.us> References: <20100708150030.GT30357@delora.autosys.us> Message-ID: Very O/T here, but ... I think the main reason I left three (or was it four) grammatical errors in my plug for Hague's blog is that I was trying to write as well as he does. I shouldn't try. Not that he needs *another* one for me, after what Michael McDaniel just wrote. Joe Armstrong says we need more books. I'm starting a "Draft James Hague" movement: write a book. I'll buy it even if he just ends up just *pretending* it's about Erlang. Better yet, team up with Nicholas Frechette to write Erlang for GPU Programming, or something similarly unlikely. -michael turner On Fri, Jul 9, 2010 at 12:00 AM, Michael McDaniel wrote: > On Thu, Jul 08, 2010 at 07:10:45PM +0900, Michael Turner wrote: > > Though James Hague has mainly talked about client-side game programming, > and > > mostly separately from Erlang topics, his writings are on both Erlang and > > games is fascinating, and even where there's no clear overlap, they > perhaps > > be a source of insights on this topic. Besides which, reading him on > these > > subjects leads you compulsively onto other programming topics he's > covered, > > and before you know it, you've eaten the *whole bag* of potato chips ;-) > > > > *http://tinyurl.com/26dthru* > > * > > * > > -michael turner > > > > On Tue, Jul 6, 2010 at 5:05 PM, ingo.schramm < > schramm.ingo@REDACTED>wrote: > > > > > Does somebody ever used Erlang to program game servers? Is there any > > > real live industrial game solution written in Erlang? > > > > > > I need to know this for some evangelization :) > > > > > > Cheers, > > > Ingo > > > > ________________________________________________________________ > > This is the article by James that introduced me to Erlang ... > > http://www.dadgum.com/james/performance.html > > (see also http://prog21.dadgum.com/11.html) > > I think I stumbled upon the original performance article > in early 2005 and investigated Erlang at that time. > > I was fairly burnt out on computers and especially software > (after about 30 years of computers, last 20 of which were > software). I was on a multi-month (year?) hiatus from > software/systems creation in any form. > > Then I stumbled upon James's article and actually got excited > about software again! James introduced me to a tool, Erlang, > that didn't get in my way, but actually, in a major way, > facilitated my end results. And provided some income and > lots of fun (still). > > James, I doubt I ever said so until now, so *"Thank you"* for > the original performance article and introduction to Erlang. > (I have told the OTP team *Thank you* for Erlang, and do so > again here). > > ~M > > -- > Michael McDaniel > Portland, Oregon, USA > http://trip.autosys.us > http://edids.org > > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From hd2010@REDACTED Thu Jul 8 18:22:10 2010 From: hd2010@REDACTED (Henning Diedrich) Date: Thu, 08 Jul 2010 18:22:10 +0200 Subject: [erlang-questions] Erlang: Who uses it for games? In-Reply-To: References: Message-ID: <4C35FB32.2080705@eonblast.com> Hi Ingo, we are currently developing an experimental browser game server in Erlang, with game logic embedded in Lua. Henning ingo.schramm wrote: > Does somebody ever used Erlang to program game servers? Is there any > real live industrial game solution written in Erlang? > > I need to know this for some evangelization :) > > Cheers, > Ingo > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > > From anthonym@REDACTED Thu Jul 8 22:13:41 2010 From: anthonym@REDACTED (Anthony Molinaro) Date: Thu, 8 Jul 2010 13:13:41 -0700 Subject: [erlang-questions] Re: Possible leak in inets httpc. In-Reply-To: References: Message-ID: <20100708201341.GB9969@alumni.caltech.edu> Hi, anyone know if its safe to backport this fix to R13B04? I'm in the process of deploying R13B04 as an upgrade from R12B05 and since I make heavy use of httpc this will bite me. Ideally, I can just grab the appropriate files from git and plop them into my R13B04 when I build an rpm (of course I need to remember enough git to do that :) ), so wondering if it's possible or if there are deps outside of the inets directory which matter? Thanks, -Anthony On Thu, Jul 08, 2010 at 02:12:07PM +0400, Andrey Popp wrote: > It seems it has been fixed with [1] in inets-5.3.2. Sorry. > > [1]: http://github.com/erlang/otp/commit/91c89d54d45989a85367f10d5902b9b508754a49 > > On Thu, Jul 8, 2010 at 1:57 PM, Andrey Popp <8mayday@REDACTED> wrote: > > Hello, > > > > I have application that makes huge number of HTTP requests with httpc > > and I have spotted that `httpc_manager__handler_db` ETS table growing > > in size and doesn't clean up. That is the example records from this > > table (ets:i(httpc_manager__handler_db)): > > > > <1 ? > {handler_info,#Ref<0.0.0.18800>,undefined,<0.177.0>,undefined,operational} > > <2 ? > {handler_info,#Ref<0.0.0.35242>,undefined,<0.3075.0>,undefined,operational} > > <3 ? > {handler_info,#Ref<0.0.0.61713>,undefined,<0.5755.0>,undefined,operational} > > <4 ? > {handler_info,#Ref<0.0.0.68114>,undefined,<0.6943.0>,undefined,operational} > > <5 ? > {handler_info,#Ref<0.0.0.85303>,undefined,<0.8305.0>,undefined,operational} > > > > and processes with handler pids are no longer alive. Also, note that I > > have no timeout setting in my http:request HTTPOptions, but I think > > inets should not leak even in that case. > > > > Thanks. > > > > -- > > Andrey Popp > > > > phone: +7 911 740 24 91 > > e-mail: 8mayday@REDACTED > > > > > > -- > Andrey Popp > > phone: +7 911 740 24 91 > e-mail: 8mayday@REDACTED > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > -- ------------------------------------------------------------------------ Anthony Molinaro From anthonym@REDACTED Thu Jul 8 23:34:10 2010 From: anthonym@REDACTED (Anthony Molinaro) Date: Thu, 8 Jul 2010 14:34:10 -0700 Subject: [erlang-questions] Re: Possible leak in inets httpc. In-Reply-To: <20100708201341.GB9969@alumni.caltech.edu> References: <20100708201341.GB9969@alumni.caltech.edu> Message-ID: <20100708213410.GC9969@alumni.caltech.edu> Well, looks like the answer is yes and no. I was able to get a patch which applied cleanly, however, the problem does not appear to be fixed. The ets table still fills up with every request that times out (I unfortunately don't have a standalone test, but I've tested repeatedly and it always seem to get an extra entry for every request that times out). This is sort of a show stopper for me upgrading, so I'll be trying to figure out a fix, but if anyone more familiar with the code wants to help me out, it would be appreciated. Thanks, -Anthony On Thu, Jul 08, 2010 at 01:13:41PM -0700, Anthony Molinaro wrote: > Hi, anyone know if its safe to backport this fix to R13B04? I'm in the process > of deploying R13B04 as an upgrade from R12B05 and since I make heavy use of > httpc this will bite me. Ideally, I can just grab the appropriate files from > git and plop them into my R13B04 when I build an rpm (of course I need to > remember enough git to do that :) ), so wondering if it's possible or if > there are deps outside of the inets directory which matter? > > Thanks, > > -Anthony > > On Thu, Jul 08, 2010 at 02:12:07PM +0400, Andrey Popp wrote: > > It seems it has been fixed with [1] in inets-5.3.2. Sorry. > > > > [1]: http://github.com/erlang/otp/commit/91c89d54d45989a85367f10d5902b9b508754a49 > > > > On Thu, Jul 8, 2010 at 1:57 PM, Andrey Popp <8mayday@REDACTED> wrote: > > > Hello, > > > > > > I have application that makes huge number of HTTP requests with httpc > > > and I have spotted that `httpc_manager__handler_db` ETS table growing > > > in size and doesn't clean up. That is the example records from this > > > table (ets:i(httpc_manager__handler_db)): > > > > > > <1 ? > {handler_info,#Ref<0.0.0.18800>,undefined,<0.177.0>,undefined,operational} > > > <2 ? > {handler_info,#Ref<0.0.0.35242>,undefined,<0.3075.0>,undefined,operational} > > > <3 ? > {handler_info,#Ref<0.0.0.61713>,undefined,<0.5755.0>,undefined,operational} > > > <4 ? > {handler_info,#Ref<0.0.0.68114>,undefined,<0.6943.0>,undefined,operational} > > > <5 ? > {handler_info,#Ref<0.0.0.85303>,undefined,<0.8305.0>,undefined,operational} > > > > > > and processes with handler pids are no longer alive. Also, note that I > > > have no timeout setting in my http:request HTTPOptions, but I think > > > inets should not leak even in that case. > > > > > > Thanks. > > > > > > -- > > > Andrey Popp > > > > > > phone: +7 911 740 24 91 > > > e-mail: 8mayday@REDACTED > > > > > > > > > > > -- > > Andrey Popp > > > > phone: +7 911 740 24 91 > > e-mail: 8mayday@REDACTED > > > > ________________________________________________________________ > > erlang-questions (at) erlang.org mailing list. > > See http://www.erlang.org/faq.html > > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > > > -- > ------------------------------------------------------------------------ > Anthony Molinaro -- ------------------------------------------------------------------------ Anthony Molinaro From mapandfold@REDACTED Fri Jul 9 03:54:56 2010 From: mapandfold@REDACTED (MapAndFold) Date: Fri, 9 Jul 2010 09:54:56 +0800 Subject: [erlang-questions] Re: On Windows XP (SP2): wx broken In-Reply-To: References: <9C6B96B5-37FA-4CF6-A7D3-663736CEE916@gmail.com> <69869ad8-a27a-48e6-8835-8303a87ed40d@g11g2000yqe.googlegroups.com> <93df43b61003032220m5b4d396dn4aca92270134d795@mail.gmail.com> Message-ID: Yeah, I have tried again on R14A, and it is *almost* OK now. But, another problem occurs: Opening the sudoku demo, drag to resize the window, then things crash with this message. --------------------------------------------------------------------------------- --------------------------- Sudoku: werl.exe - Application Error --------------------------- The instruction at "0x02292376" referenced memory at "0x00000010". The memory could not be "read". --------------------------------------------------------------------------------- My guest is that it seems to be related to the painting procedure of the window. My little app which draws some graphics is also easy to crash when resizing the window, while in wx:demo(), most of the examples are OK (graphicsContext is easy to crash). On Thu, Jul 8, 2010 at 3:44 PM, Dan Gudmundsson wrote: > Have you with this problem tried R14A, is it working now? > > I found that we had upgraded Visual Studio without recompiling > wxWidgets DLL's causing the > wx-driver to be dependent on two different versions of the runtime DLL, > where only the latest where installed with erlang. > > Thanks for locating it. > > /Dan > From rvg@REDACTED Fri Jul 9 07:32:38 2010 From: rvg@REDACTED (Rudolph van Graan) Date: Fri, 9 Jul 2010 07:32:38 +0200 Subject: ORBER and support for valuetype Message-ID: <4B63B58C-7D06-42EE-84F6-72EBA2480481@patternmatched.com> Hi, Does anyone know if there is an upcoming version of ORBER that will an implementation of the CORBA valuetype semantics that will allow one to do this: valuetype Base { long some_data; }; valuetype Derived : Base { long more_data; }; Thanks, Rudolph van Graan -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4369 bytes Desc: not available URL: From 8mayday@REDACTED Fri Jul 9 08:12:37 2010 From: 8mayday@REDACTED (Andrey Popp) Date: Fri, 9 Jul 2010 10:12:37 +0400 Subject: [erlang-questions] Re: Possible leak in inets httpc. In-Reply-To: <20100708213410.GC9969@alumni.caltech.edu> References: <20100708201341.GB9969@alumni.caltech.edu> <20100708213410.GC9969@alumni.caltech.edu> Message-ID: We have updated to R14 (thanks to deb packages in debian squeeze repository) and all seems to be ok for now. On Fri, Jul 9, 2010 at 1:34 AM, Anthony Molinaro wrote: > Well, looks like the answer is yes and no. ?I was able to get a patch > which applied cleanly, however, the problem does not appear to be fixed. > The ets table still fills up with every request that times out > (I unfortunately don't have a standalone test, but I've tested > repeatedly and it always seem to get an extra entry for every request > that times out). > > This is sort of a show stopper for me upgrading, so I'll be trying to > figure out a fix, but if anyone more familiar with the code wants to > help me out, it would be appreciated. > > Thanks, > > -Anthony > > On Thu, Jul 08, 2010 at 01:13:41PM -0700, Anthony Molinaro wrote: >> Hi, anyone know if its safe to backport this fix to R13B04? ?I'm in the process >> of deploying R13B04 as an upgrade from R12B05 and since I make heavy use of >> httpc this will bite me. ?Ideally, I can just grab the appropriate files from >> git and plop them into my R13B04 when I build an rpm (of course I need to >> remember enough git to do that :) ), so wondering if it's possible or if >> there are deps outside of the inets directory which matter? >> >> Thanks, >> >> -Anthony >> >> On Thu, Jul 08, 2010 at 02:12:07PM +0400, Andrey Popp wrote: >> > It seems it has been fixed with [1] in inets-5.3.2. Sorry. >> > >> > [1]: http://github.com/erlang/otp/commit/91c89d54d45989a85367f10d5902b9b508754a49 >> > >> > On Thu, Jul 8, 2010 at 1:57 PM, Andrey Popp <8mayday@REDACTED> wrote: >> > > Hello, >> > > >> > > I have application that makes huge number of HTTP requests with httpc >> > > and I have spotted that `httpc_manager__handler_db` ETS table growing >> > > in size and doesn't clean up. That is the example records from this >> > > table (ets:i(httpc_manager__handler_db)): >> > > >> > > <1 ? > {handler_info,#Ref<0.0.0.18800>,undefined,<0.177.0>,undefined,operational} >> > > <2 ? > {handler_info,#Ref<0.0.0.35242>,undefined,<0.3075.0>,undefined,operational} >> > > <3 ? > {handler_info,#Ref<0.0.0.61713>,undefined,<0.5755.0>,undefined,operational} >> > > <4 ? > {handler_info,#Ref<0.0.0.68114>,undefined,<0.6943.0>,undefined,operational} >> > > <5 ? > {handler_info,#Ref<0.0.0.85303>,undefined,<0.8305.0>,undefined,operational} >> > > >> > > and processes with handler pids are no longer alive. Also, note that I >> > > have no timeout setting in my http:request HTTPOptions, but I think >> > > inets should not leak even in that case. >> > > >> > > Thanks. >> > > >> > > -- >> > > Andrey Popp >> > > >> > > phone: +7 911 740 24 91 >> > > e-mail: 8mayday@REDACTED >> > > >> > >> > >> > >> > -- >> > Andrey Popp >> > >> > phone: +7 911 740 24 91 >> > e-mail: 8mayday@REDACTED >> > >> > ________________________________________________________________ >> > erlang-questions (at) erlang.org mailing list. >> > See http://www.erlang.org/faq.html >> > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED >> > >> >> -- >> ------------------------------------------------------------------------ >> Anthony Molinaro ? ? ? ? ? ? ? ? ? ? ? ? ? > > -- > ------------------------------------------------------------------------ > Anthony Molinaro ? ? ? ? ? ? ? ? ? ? ? ? ? > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > -- Andrey Popp phone: +7 911 740 24 91 e-mail: 8mayday@REDACTED From schramm.ingo@REDACTED Fri Jul 9 09:43:30 2010 From: schramm.ingo@REDACTED (ingo.schramm) Date: Fri, 9 Jul 2010 00:43:30 -0700 (PDT) Subject: Erlang: Who uses it for games? In-Reply-To: <20100708150030.GT30357@delora.autosys.us> References: <20100708150030.GT30357@delora.autosys.us> Message-ID: <2861ca59-2583-43d0-914b-4c6bcff91436@k39g2000yqd.googlegroups.com> Hey Michael, I just have 20 years of computers and software but some 10-15 of the Internet with all those crappy quickies of time to market stuff and only Erlang saved me to still believe in the possibility of well crafted software :) On Jul 8, 5:00?pm, Michael McDaniel wrote: > > ?This is the article by James that introduced me to Erlang ... > > ? ?http://www.dadgum.com/james/performance.html > > ? ?(see also ?http://prog21.dadgum.com/11.html) > > ?I think I stumbled upon the original performance article > ?in early 2005 and investigated Erlang at that time. > > ?I was fairly burnt out on computers and especially software > ?(after about 30 years of computers, last 20 of which were > ?software). ?I was on a multi-month (year?) hiatus from > ?software/systems creation in any form. > > ?Then I stumbled upon James's article and actually got excited > ?about software again! ?James introduced me to a tool, Erlang, > ?that didn't get in my way, but actually, in a major way, > ?facilitated my end results. ?And provided some income and > ?lots of fun (still). > > ?James, I doubt I ever said so until now, so *"Thank you"* for > ?the original performance article and introduction to Erlang. > ?(I have told the OTP team *Thank you* for Erlang, and do so > ? again here). > > ~M > > -- > Michael McDaniel > Portland, Oregon, USAhttp://trip.autosys.ushttp://edids.org > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > Seehttp://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscr...@REDACTED From antoine.koener@REDACTED Fri Jul 9 12:07:28 2010 From: antoine.koener@REDACTED (Antoine Koener) Date: Fri, 9 Jul 2010 12:07:28 +0200 Subject: [erlang-questions] Re: On Windows XP (SP2): wx broken In-Reply-To: References: <9C6B96B5-37FA-4CF6-A7D3-663736CEE916@gmail.com> <69869ad8-a27a-48e6-8835-8303a87ed40d@g11g2000yqe.googlegroups.com> <93df43b61003032220m5b4d396dn4aca92270134d795@mail.gmail.com> Message-ID: On Fri, Jul 9, 2010 at 3:54 AM, MapAndFold wrote: > Yeah, I have tried again on R14A, and it is *almost* OK now. > > But, another problem occurs: > > Opening the sudoku demo, drag to resize the window, then things crash > with this message. > > While your talking about the sudoku application, it's worth saying that it takes 100% CPU. Don't know if it's wx related but for my point of view it's a complete failure. UI must not take too much cpu (I'm not talking about games...) Note that I know that this sudoku thing is only a proof of concept, and it is not designed as a top quality game, but this don't encourage myself to rely heavily on wx/erlang :/ > > --------------------------------------------------------------------------------- > --------------------------- > Sudoku: werl.exe - Application Error > --------------------------- > The instruction at "0x02292376" referenced memory at "0x00000010". The > memory could not be "read". > > --------------------------------------------------------------------------------- > > My guest is that it seems to be related to the painting procedure of > the window. My little app which draws some graphics is also easy to > crash when resizing the window, while in wx:demo(), most of the > examples are OK (graphicsContext is easy to crash). > > On Thu, Jul 8, 2010 at 3:44 PM, Dan Gudmundsson wrote: > > Have you with this problem tried R14A, is it working now? > > > > I found that we had upgraded Visual Studio without recompiling > > wxWidgets DLL's causing the > > wx-driver to be dependent on two different versions of the runtime DLL, > > where only the latest where installed with erlang. > > > > Thanks for locating it. > > > > /Dan > > > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From bomicael@REDACTED Fri Jul 9 12:12:13 2010 From: bomicael@REDACTED (Micael Karlberg) Date: Fri, 9 Jul 2010 12:12:13 +0200 Subject: [erlang-questions] Re: Possible leak in inets httpc. In-Reply-To: References: <20100708201341.GB9969@alumni.caltech.edu> <20100708213410.GC9969@alumni.caltech.edu> Message-ID: This problem was fixed in inets-5.3.2. The fix was reported by Lev Walkin: http://www.erlang.org/cgi-bin/ezmlm-cgi/2/1766 Unfortunately, github was not updated in one commit, but in several, here are some of them: http://github.com/erlang/otp/commit/4b87b22ce97abf2759eb551222a862e17c5f4dcb http://github.com/erlang/otp/commit/91c89d54d45989a85367f10d5902b9b508754a49 So you have to do a bit of cut-and-paste. The last version of inets in R13B was 5.3.3, but I don't know if that made it into github. Regards, /BMK On Fri, Jul 9, 2010 at 8:12 AM, Andrey Popp <8mayday@REDACTED> wrote: > We have updated to R14 (thanks to deb packages in debian squeeze > repository) and all seems to be ok for now. > > On Fri, Jul 9, 2010 at 1:34 AM, Anthony Molinaro > wrote: >> Well, looks like the answer is yes and no. ?I was able to get a patch >> which applied cleanly, however, the problem does not appear to be fixed. >> The ets table still fills up with every request that times out >> (I unfortunately don't have a standalone test, but I've tested >> repeatedly and it always seem to get an extra entry for every request >> that times out). >> >> This is sort of a show stopper for me upgrading, so I'll be trying to >> figure out a fix, but if anyone more familiar with the code wants to >> help me out, it would be appreciated. >> >> Thanks, >> >> -Anthony >> >> On Thu, Jul 08, 2010 at 01:13:41PM -0700, Anthony Molinaro wrote: >>> Hi, anyone know if its safe to backport this fix to R13B04? ?I'm in the process >>> of deploying R13B04 as an upgrade from R12B05 and since I make heavy use of >>> httpc this will bite me. ?Ideally, I can just grab the appropriate files from >>> git and plop them into my R13B04 when I build an rpm (of course I need to >>> remember enough git to do that :) ), so wondering if it's possible or if >>> there are deps outside of the inets directory which matter? >>> >>> Thanks, >>> >>> -Anthony >>> >>> On Thu, Jul 08, 2010 at 02:12:07PM +0400, Andrey Popp wrote: >>> > It seems it has been fixed with [1] in inets-5.3.2. Sorry. >>> > >>> > [1]: http://github.com/erlang/otp/commit/91c89d54d45989a85367f10d5902b9b508754a49 >>> > >>> > On Thu, Jul 8, 2010 at 1:57 PM, Andrey Popp <8mayday@REDACTED> wrote: >>> > > Hello, >>> > > >>> > > I have application that makes huge number of HTTP requests with httpc >>> > > and I have spotted that `httpc_manager__handler_db` ETS table growing >>> > > in size and doesn't clean up. That is the example records from this >>> > > table (ets:i(httpc_manager__handler_db)): >>> > > >>> > > <1 ? > {handler_info,#Ref<0.0.0.18800>,undefined,<0.177.0>,undefined,operational} >>> > > <2 ? > {handler_info,#Ref<0.0.0.35242>,undefined,<0.3075.0>,undefined,operational} >>> > > <3 ? > {handler_info,#Ref<0.0.0.61713>,undefined,<0.5755.0>,undefined,operational} >>> > > <4 ? > {handler_info,#Ref<0.0.0.68114>,undefined,<0.6943.0>,undefined,operational} >>> > > <5 ? > {handler_info,#Ref<0.0.0.85303>,undefined,<0.8305.0>,undefined,operational} >>> > > >>> > > and processes with handler pids are no longer alive. Also, note that I >>> > > have no timeout setting in my http:request HTTPOptions, but I think >>> > > inets should not leak even in that case. >>> > > >>> > > Thanks. >>> > > >>> > > -- >>> > > Andrey Popp >>> > > >>> > > phone: +7 911 740 24 91 >>> > > e-mail: 8mayday@REDACTED >>> > > >>> > >>> > >>> > >>> > -- >>> > Andrey Popp >>> > >>> > phone: +7 911 740 24 91 >>> > e-mail: 8mayday@REDACTED >>> > >>> > ________________________________________________________________ >>> > erlang-questions (at) erlang.org mailing list. >>> > See http://www.erlang.org/faq.html >>> > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED >>> > >>> >>> -- >>> ------------------------------------------------------------------------ >>> Anthony Molinaro ? ? ? ? ? ? ? ? ? ? ? ? ? >> >> -- >> ------------------------------------------------------------------------ >> Anthony Molinaro ? ? ? ? ? ? ? ? ? ? ? ? ? >> >> ________________________________________________________________ >> erlang-questions (at) erlang.org mailing list. >> See http://www.erlang.org/faq.html >> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED >> >> > > > > -- > Andrey Popp > > phone: +7 911 740 24 91 > e-mail: 8mayday@REDACTED > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From dangud@REDACTED Fri Jul 9 12:25:48 2010 From: dangud@REDACTED (Dan Gudmundsson) Date: Fri, 9 Jul 2010 12:25:48 +0200 Subject: [erlang-questions] Re: On Windows XP (SP2): wx broken In-Reply-To: References: <9C6B96B5-37FA-4CF6-A7D3-663736CEE916@gmail.com> <69869ad8-a27a-48e6-8835-8303a87ed40d@g11g2000yqe.googlegroups.com> <93df43b61003032220m5b4d396dn4aca92270134d795@mail.gmail.com> Message-ID: On Fri, Jul 9, 2010 at 12:07 PM, Antoine Koener wrote: > On Fri, Jul 9, 2010 at 3:54 AM, MapAndFold wrote: >> >> Yeah, I have tried again on R14A, and it is *almost* OK now. >> >> But, another problem occurs: >> >> Opening the sudoku demo, drag to resize the window, then things crash >> with this message. >> > Thanks for the input, I need to see if I can repeat that. > While your talking about the sudoku application, it's worth saying that it > takes 100% CPU. > Don't know if it's wx related but for my point of view it's a complete > failure. > UI must not take too much cpu (I'm not talking about games...) > Note that I know that this sudoku thing is only a proof of concept, and it > is not designed as > a top quality game, but this don't encourage myself to rely heavily on > wx/erlang :/ :-) It's not the gui that takes 100% cpu, the game generates new boards in the background for a while. Generating boards (at least in my implementation) takes some cpu. You know in erlang you can spawn processes to do work while waiting for user input. :-) But if you wait some time it will have generated 5 boards and it will slow down. /Dan From nick@REDACTED Fri Jul 9 12:35:26 2010 From: nick@REDACTED (Niclas Eklund) Date: Fri, 9 Jul 2010 12:35:26 +0200 (CEST) Subject: [erlang-questions] ORBER and support for valuetype In-Reply-To: <4B63B58C-7D06-42EE-84F6-72EBA2480481@patternmatched.com> References: <4B63B58C-7D06-42EE-84F6-72EBA2480481@patternmatched.com> Message-ID: Hello! Currently there are no plans for adding IDL-support for valuetype in IC and Orber. Best Regards, Niclas @ Erlang/OTP On Fri, 9 Jul 2010, Rudolph van Graan wrote: > Hi, > > Does anyone know if there is an upcoming version of ORBER that will an > implementation of the CORBA valuetype semantics that will allow one to > do this: > > valuetype Base { > long some_data; > }; > > valuetype Derived : Base { > long more_data; > }; > > Thanks, > > Rudolph van Graan > > From anthonym@REDACTED Fri Jul 9 18:26:48 2010 From: anthonym@REDACTED (Anthony Molinaro) Date: Fri, 9 Jul 2010 09:26:48 -0700 Subject: [erlang-questions] Re: Possible leak in inets httpc. In-Reply-To: References: <20100708201341.GB9969@alumni.caltech.edu> <20100708213410.GC9969@alumni.caltech.edu> Message-ID: <20100709162648.GB18058@alumni.caltech.edu> Yeah, I managed to get the entire set of patches, basically used git diff 201ccdd08bd2a591fe1e348a9a1df3d94a3606e4 141ff3c087ca856d21d0 lib/inets Which seemed to get them all. However, I still see memory leaked Erlang R13B04 (erts-5.7.5) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false] Eshell V5.7.5 (abort with ^G) 1> inets:start(). ok 2> ets:i(). ... 16402 httpc_manager__session_cookie_db bag 0 316 httpc_manager httpc_manager__handler_db httpc_manager__handler_db set 0 316 httpc_manager httpc_manager__session_db httpc_manager__session_db set 0 316 httpc_manager ... 3> http:request (post, { "http://www.example.com", [], "application/octet-stream", <<"hello">>}, [{connect_timeout, 100},{timeout, 10}], [{body_format, binary} ]). {error,timeout} 4> ets:i(). ... 16402 httpc_manager__session_cookie_db bag 0 316 httpc_manager httpc_manager__handler_db httpc_manager__handler_db set 1 333 httpc_manager httpc_manager__session_db httpc_manager__session_db set 0 316 httpc_manager ... 5> ets:i(httpc_manager__handler_db). <1 > {handler_info,#Ref<0.0.0.142>,undefined,<0.60.0>,<0.33.0>,operational} 6> m(inets). Module inets compiled: Date: July 8 2010, Time: 06.45 Compiler options: [{d,'SERVER_SOFTWARE',"inets/5.3.3"}, {cwd,"/home/molinaro/projects/work/vendor/erlang/R13B04/rpmbuild/BUILD/otp_src_R13B04/lib/inets/src/inets_app"}, {outdir,"/home/molinaro/projects/work/vendor/erlang/R13B04/rpmbuild/BUILD/otp_src_R13B04/lib/inets/src/inets_app/../../ebin"}, {attribute,insert,app_vsn,"inets-5.3.3"}, {parse_transform,sys_pre_attributes}, debug_info] Object file: /usr/lib64/erlang/lib/inets-5.3.3/ebin/inets.beam ... So it seems if you connect but then timeout you leak some memory even with 5.3.3. I've not tried 5.4 which is in dev but the only changes there seem to be related to ssl... Can anyone else confirm this is still broken? -Anthony On Fri, Jul 09, 2010 at 12:12:13PM +0200, Micael Karlberg wrote: > This problem was fixed in inets-5.3.2. The fix was reported by Lev Walkin: > > http://www.erlang.org/cgi-bin/ezmlm-cgi/2/1766 > > Unfortunately, github was not updated in one commit, but in several, here > are some of them: > > http://github.com/erlang/otp/commit/4b87b22ce97abf2759eb551222a862e17c5f4dcb > http://github.com/erlang/otp/commit/91c89d54d45989a85367f10d5902b9b508754a49 > > So you have to do a bit of cut-and-paste. The last version of inets in > R13B was 5.3.3, > but I don't know if that made it into github. > > Regards, > /BMK > > On Fri, Jul 9, 2010 at 8:12 AM, Andrey Popp <8mayday@REDACTED> wrote: > > We have updated to R14 (thanks to deb packages in debian squeeze > > repository) and all seems to be ok for now. > > > > On Fri, Jul 9, 2010 at 1:34 AM, Anthony Molinaro > > wrote: > >> Well, looks like the answer is yes and no. ?I was able to get a patch > >> which applied cleanly, however, the problem does not appear to be fixed. > >> The ets table still fills up with every request that times out > >> (I unfortunately don't have a standalone test, but I've tested > >> repeatedly and it always seem to get an extra entry for every request > >> that times out). > >> > >> This is sort of a show stopper for me upgrading, so I'll be trying to > >> figure out a fix, but if anyone more familiar with the code wants to > >> help me out, it would be appreciated. > >> > >> Thanks, > >> > >> -Anthony > >> > >> On Thu, Jul 08, 2010 at 01:13:41PM -0700, Anthony Molinaro wrote: > >>> Hi, anyone know if its safe to backport this fix to R13B04? ?I'm in the process > >>> of deploying R13B04 as an upgrade from R12B05 and since I make heavy use of > >>> httpc this will bite me. ?Ideally, I can just grab the appropriate files from > >>> git and plop them into my R13B04 when I build an rpm (of course I need to > >>> remember enough git to do that :) ), so wondering if it's possible or if > >>> there are deps outside of the inets directory which matter? > >>> > >>> Thanks, > >>> > >>> -Anthony > >>> > >>> On Thu, Jul 08, 2010 at 02:12:07PM +0400, Andrey Popp wrote: > >>> > It seems it has been fixed with [1] in inets-5.3.2. Sorry. > >>> > > >>> > [1]: http://github.com/erlang/otp/commit/91c89d54d45989a85367f10d5902b9b508754a49 > >>> > > >>> > On Thu, Jul 8, 2010 at 1:57 PM, Andrey Popp <8mayday@REDACTED> wrote: > >>> > > Hello, > >>> > > > >>> > > I have application that makes huge number of HTTP requests with httpc > >>> > > and I have spotted that `httpc_manager__handler_db` ETS table growing > >>> > > in size and doesn't clean up. That is the example records from this > >>> > > table (ets:i(httpc_manager__handler_db)): > >>> > > > >>> > > <1 ? > {handler_info,#Ref<0.0.0.18800>,undefined,<0.177.0>,undefined,operational} > >>> > > <2 ? > {handler_info,#Ref<0.0.0.35242>,undefined,<0.3075.0>,undefined,operational} > >>> > > <3 ? > {handler_info,#Ref<0.0.0.61713>,undefined,<0.5755.0>,undefined,operational} > >>> > > <4 ? > {handler_info,#Ref<0.0.0.68114>,undefined,<0.6943.0>,undefined,operational} > >>> > > <5 ? > {handler_info,#Ref<0.0.0.85303>,undefined,<0.8305.0>,undefined,operational} > >>> > > > >>> > > and processes with handler pids are no longer alive. Also, note that I > >>> > > have no timeout setting in my http:request HTTPOptions, but I think > >>> > > inets should not leak even in that case. > >>> > > > >>> > > Thanks. > >>> > > > >>> > > -- > >>> > > Andrey Popp > >>> > > > >>> > > phone: +7 911 740 24 91 > >>> > > e-mail: 8mayday@REDACTED > >>> > > > >>> > > >>> > > >>> > > >>> > -- > >>> > Andrey Popp > >>> > > >>> > phone: +7 911 740 24 91 > >>> > e-mail: 8mayday@REDACTED > >>> > > >>> > ________________________________________________________________ > >>> > erlang-questions (at) erlang.org mailing list. > >>> > See http://www.erlang.org/faq.html > >>> > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > >>> > > >>> > >>> -- > >>> ------------------------------------------------------------------------ > >>> Anthony Molinaro ? ? ? ? ? ? ? ? ? ? ? ? ? > >> > >> -- > >> ------------------------------------------------------------------------ > >> Anthony Molinaro ? ? ? ? ? ? ? ? ? ? ? ? ? > >> > >> ________________________________________________________________ > >> erlang-questions (at) erlang.org mailing list. > >> See http://www.erlang.org/faq.html > >> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > >> > >> > > > > > > > > -- > > Andrey Popp > > > > phone: +7 911 740 24 91 > > e-mail: 8mayday@REDACTED > > > > ________________________________________________________________ > > erlang-questions (at) erlang.org mailing list. > > See http://www.erlang.org/faq.html > > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > > > > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > -- ------------------------------------------------------------------------ Anthony Molinaro From boris.muehmer@REDACTED Fri Jul 9 19:55:46 2010 From: boris.muehmer@REDACTED (=?UTF-8?Q?Boris_M=C3=BChmer?=) Date: Fri, 9 Jul 2010 19:55:46 +0200 Subject: Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") Message-ID: It looks like some people are interested in Erlang game programming. On the other hand getting started in Erlang and OTP isn't too easy. Especially for people with a strong C/C++/C#/Java/etc background. Inspired by the "Erlang: Who uses it for games?" thread I thought about starting a community project to implement a MMO game in Erlang/OTP. The goal would be to collect some "best-practices" for different tasks. Actually I am more interested in the server side than how to implement a top-notch-state-of-the-art client. Also I think Erlang is more suited for the server side. But I am also interested in how to interface the "server-side erlang" using a (C/C++, Java, Python) cross-plattform client (using wxWidget or Qt as a base and OpenGL for graphics). What I would like to see are reponses from other people who may also be interested in such a project. Not only beginners with Erlang/OTP, but also (or especially) experienced people to guide and support the others. And most of all, to have some fun practising Erlang. Well, what do You think about it? Best regards, Boris From dale@REDACTED Fri Jul 9 20:10:04 2010 From: dale@REDACTED (Dale Harvey) Date: Fri, 9 Jul 2010 19:10:04 +0100 Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: References: Message-ID: On 9 July 2010 18:55, Boris M?hmer wrote: > It looks like some people are interested in Erlang game programming. > On the other hand getting started in Erlang and OTP isn't too easy. > Especially for people with a strong C/C++/C#/Java/etc background. > > Inspired by the "Erlang: Who uses it for games?" thread I thought about > starting a community project to implement a MMO game in Erlang/OTP. > The goal would be to collect some "best-practices" for different tasks. > > Actually I am more interested in the server side than how to implement > a top-notch-state-of-the-art client. Also I think Erlang is more suited > for the server side. But I am also interested in how to interface the > "server-side erlang" using a (C/C++, Java, Python) cross-plattform > client (using wxWidget or Qt as a base and OpenGL for graphics). > > I would completely recommend using a web front end, depending on the type of graphics involved dom / canvas / svg or webgl can be used for rendering, and comet or websockets for communication. erlang has long missed the boat on becoming a strong platform for building cross platform desktop clients, and considering how well suited it is for writing the server components of a web application I would suggest sticking to its strengths. (I would love to keep updates, and while I would love to contribute, the chances are I will be too busy, no harm in bugging me if you are looking for a web frontend though) > What I would like to see are reponses from other people who may also > be interested in such a project. Not only beginners with Erlang/OTP, > but also (or especially) experienced people to guide and support the > others. And most of all, to have some fun practising Erlang. > > Well, what do You think about it? > > Best regards, > Boris > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From therevoltingx@REDACTED Fri Jul 9 21:33:46 2010 From: therevoltingx@REDACTED (Miguel Morales) Date: Fri, 9 Jul 2010 12:33:46 -0700 Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: References: Message-ID: It would be feasible to do the client side using wxWidgets and/or esdl. However, I think having a web frontend is the way to go. I'm too busy on my own project to help, how about perhaps contributing to existing mmorpg engines such as: http://www.next-gen.cc/ There goes a lot into making a game, not just programming. A lot of art is needed, plus people to design characters and story lines. One would have to think carefully as to what type of mmorpg to make before even getting started. On Fri, Jul 9, 2010 at 11:10 AM, Dale Harvey wrote: > On 9 July 2010 18:55, Boris M?hmer wrote: > >> It looks like some people are interested in Erlang game programming. >> On the other hand getting started in Erlang and OTP isn't too easy. >> Especially for people with a strong C/C++/C#/Java/etc background. >> >> Inspired by the "Erlang: Who uses it for games?" thread I thought about >> starting a community project to implement a MMO game in Erlang/OTP. >> The goal would be to collect some "best-practices" for different tasks. >> >> Actually I am more interested in the server side than how to implement >> a top-notch-state-of-the-art client. Also I think Erlang is more suited >> for the server side. But I am also interested in how to interface the >> "server-side erlang" using a (C/C++, Java, Python) cross-plattform >> client (using wxWidget or Qt as a base and OpenGL for graphics). >> >> > I would completely recommend using a web front end, depending on the type of > graphics involved dom / canvas / svg or webgl can be used for rendering, and > comet or websockets for communication. > > erlang has long missed the boat on becoming a strong platform for building > cross platform desktop clients, and considering how well suited it is for > writing the server components of a web application I would suggest sticking > to its strengths. > > (I would love to keep updates, and while I would love to contribute, the > chances are I will be too busy, no harm in bugging me if you are looking for > a web frontend though) > > >> What I would like to see are reponses from other people who may also >> be interested in such a project. Not only beginners with Erlang/OTP, >> but also (or especially) experienced people to guide and support the >> others. And most of all, to have some fun practising Erlang. >> >> Well, what do You think about it? >> >> Best regards, >> Boris >> >> ________________________________________________________________ >> erlang-questions (at) erlang.org mailing list. >> See http://www.erlang.org/faq.html >> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED >> >> > -- http://developingthedream.blogspot.com/, http://diastrofunk.com, http://www.youtube.com/user/revoltingx, ~Isaiah 55:8-9 From mjtruog@REDACTED Sat Jul 10 02:14:48 2010 From: mjtruog@REDACTED (Michael Truog) Date: Fri, 09 Jul 2010 17:14:48 -0700 Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: References: Message-ID: <4C37BB78.4060205@gmail.com> I am interested in contributing to server-side MMOG work, open-source and otherwise. I think and MMOG server could be done in a way where the front-end could be web based, or a graphics intensive application (probably .NET C++ or C#... or cross-platform if truly innovative). It would be nice to somehow abstract away the difference between AJAX communication and Websockets, to have a very compatible web front-end working. However, all the core logic should not require hard-coding the server communication and client front-end. We need an Erlang-based MMOG server that is open-source, and the easiest way to get one, is to create one. It would not be easy or productive to convince other projects to suddenly change what they are doing, to use a better server programming paradigm (and with open-source, the best project generally wins, by surviving the longest). I think many common components could be developed that MMOGs generally need: object/PC/NPC persistence and database caching, efficient physics/AI code access, DSL for game scripting, etc.. I do not think the Erlang-based server would be too inefficient. Such an attitude seems to come from much of the focus on only testing within the Erlang community and the focus on only premature optimization within the gaming community. Many Erlang servers have scalability characteristics that easily exceed the rushed coding of production game servers (that contain much more complexity and more SLOC than is easily maintainable). C and C++ integration is required for using efficient libraries that are required for complex tasks (a best case scenario might be only a physics engine). One major problem is not having memory leaks, since that is normally the cause of any MMOG's daily server reboot (which is very typical). That would mean that linked-in driver (NIF) usage would require much scrutiny, and an Erlang port might offer redundancy if the delay was acceptable (i.e., managing the computational latency). It would probably be best to have a game scripting language (DSL) layered on the Erlang VM, and to keep as much logic within Erlang as possible... until the logic delves into data structures that must be immutable. So, I am interested and have been thinking about it awhile. I have worked on previous MMOGs and would enjoy working on an Erlang-based solution. On 07/09/2010 12:33 PM, Miguel Morales wrote: > It would be feasible to do the client side using wxWidgets and/or esdl. > However, I think having a web frontend is the way to go. > I'm too busy on my own project to help, how about perhaps contributing > to existing mmorpg engines such as: http://www.next-gen.cc/ > There goes a lot into making a game, not just programming. A lot of > art is needed, plus people to design characters and story lines. One > would have to think carefully as to what type of mmorpg to make before > even getting started. > > On Fri, Jul 9, 2010 at 11:10 AM, Dale Harvey wrote: > >> On 9 July 2010 18:55, Boris M?hmer wrote: >> >> >>> It looks like some people are interested in Erlang game programming. >>> On the other hand getting started in Erlang and OTP isn't too easy. >>> Especially for people with a strong C/C++/C#/Java/etc background. >>> >>> Inspired by the "Erlang: Who uses it for games?" thread I thought about >>> starting a community project to implement a MMO game in Erlang/OTP. >>> The goal would be to collect some "best-practices" for different tasks. >>> >>> Actually I am more interested in the server side than how to implement >>> a top-notch-state-of-the-art client. Also I think Erlang is more suited >>> for the server side. But I am also interested in how to interface the >>> "server-side erlang" using a (C/C++, Java, Python) cross-plattform >>> client (using wxWidget or Qt as a base and OpenGL for graphics). >>> >>> >>> >> I would completely recommend using a web front end, depending on the type of >> graphics involved dom / canvas / svg or webgl can be used for rendering, and >> comet or websockets for communication. >> >> erlang has long missed the boat on becoming a strong platform for building >> cross platform desktop clients, and considering how well suited it is for >> writing the server components of a web application I would suggest sticking >> to its strengths. >> >> (I would love to keep updates, and while I would love to contribute, the >> chances are I will be too busy, no harm in bugging me if you are looking for >> a web frontend though) >> >> >> >>> What I would like to see are reponses from other people who may also >>> be interested in such a project. Not only beginners with Erlang/OTP, >>> but also (or especially) experienced people to guide and support the >>> others. And most of all, to have some fun practising Erlang. >>> >>> Well, what do You think about it? >>> >>> Best regards, >>> Boris >>> >>> ________________________________________________________________ >>> erlang-questions (at) erlang.org mailing list. >>> See http://www.erlang.org/faq.html >>> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED >>> >>> >>> >> > > > From raould@REDACTED Sat Jul 10 02:21:31 2010 From: raould@REDACTED (Raoul Duke) Date: Fri, 9 Jul 2010 17:21:31 -0700 Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: <4C37BB78.4060205@gmail.com> References: <4C37BB78.4060205@gmail.com> Message-ID: On Fri, Jul 9, 2010 at 5:14 PM, Michael Truog wrote: > DSL for game scripting, etc.. http://github.com/rvirding/lfe :-) From corticalcomputer@REDACTED Sat Jul 10 02:37:09 2010 From: corticalcomputer@REDACTED (G.S.) Date: Fri, 9 Jul 2010 17:37:09 -0700 Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: References: <4C37BB78.4060205@gmail.com> Message-ID: I'll join. I can do Physics/AI, or some other part. Regards, -Gene On Fri, Jul 9, 2010 at 5:21 PM, Raoul Duke wrote: > On Fri, Jul 9, 2010 at 5:14 PM, Michael Truog wrote: >> ?DSL for game scripting, etc.. > > http://github.com/rvirding/lfe > > :-) > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > From boris.muehmer@REDACTED Sat Jul 10 07:40:18 2010 From: boris.muehmer@REDACTED (=?UTF-8?Q?Boris_M=C3=BChmer?=) Date: Sat, 10 Jul 2010 07:40:18 +0200 Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: References: <4C37BB78.4060205@gmail.com> Message-ID: Thank You for the first responses in such a short time. Where should we set up a project? Would "Google Code" be a good place to start at? Maybe use "Google Groups"/"Google Wave" for communication? What other alternatives are there? I currently only know of C#/.Net places... An "no", I don't work for Google, still I like the tools they provide... :-) I had a brief look at some sites. Many need a "license" for a project. Which one should be used? What kind of repository system should be used? Would "Git" be ok? - boris From mjtruog@REDACTED Sat Jul 10 08:09:27 2010 From: mjtruog@REDACTED (Michael Truog) Date: Fri, 09 Jul 2010 23:09:27 -0700 Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: References: <4C37BB78.4060205@gmail.com> Message-ID: <4C380E97.6090505@gmail.com> I vote for "Google Groups"/"Google Wave"/GitHub/BSD_License I am neutral on "Google Code" This is not legal advice! The BSD license does make it easier for companies to profit directly from all work, but it also helps the code get more external development which impacts the core open-source code. The direction the GPL license has gone (even trying to discourage commercial usage of GPL code as a service without submitting the code changes) seems to discourage much serious usage of open-source software in competitive industries (i.e., industries that depend on lots of proprietary secrets that must integrate directly with open-source software). I don't think there is a problem with the old style of the BSD license, but die-hard GPL believers would probably disagree (and favor the new style BSD license). I have not seen a good reason why the LGPL is better than a BSD/MIT license (BSD seems clearer and more concise to me). The difference seems like it is the difference between SYSV and BSD (i.e., different people with different ideas doing the same stuff in different ways). So, the BSD license can help companies take an active role in development, if they choose to. It would be counter-productive for a company to not help out the project they depend on, if that is the case. This is not legal advice! On 07/09/2010 10:40 PM, Boris M?hmer wrote: > Thank You for the first responses in such a short time. > > Where should we set up a project? Would "Google Code" be a good place > to start at? Maybe use "Google Groups"/"Google Wave" for > communication? What other alternatives are there? I currently only > know of C#/.Net places... An "no", I don't work for Google, still I > like the tools they provide... :-) > > I had a brief look at some sites. Many need a "license" for a project. > Which one should be used? > > What kind of repository system should be used? Would "Git" be ok? > > - boris > > ________________________________________________________________ > erlang-questions (at) erlang.org mailing list. > See http://www.erlang.org/faq.html > To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED > > > From ttmrichter@REDACTED Sat Jul 10 08:32:04 2010 From: ttmrichter@REDACTED (Michael Richter) Date: Sat, 10 Jul 2010 14:32:04 +0800 Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: <4C380E97.6090505@gmail.com> References: <4C37BB78.4060205@gmail.com> <4C380E97.6090505@gmail.com> Message-ID: On 10 July 2010 14:09, Michael Truog wrote: > I vote for "Google Groups"/"Google Wave"/GitHub/BSD_License > I am neutral on "Google Code" > I vote AGAINST Google Wave and Google Code. I've never had a good experience on Google Code and Google Wave is painfully slow and incoherent for anything serious IME. -- "Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot." --Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra. From dawid.figiel@REDACTED Sat Jul 10 11:15:47 2010 From: dawid.figiel@REDACTED (Dawid Figiel) Date: Sat, 10 Jul 2010 10:15:47 +0100 Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: References: <4C37BB78.4060205@gmail.com> <4C380E97.6090505@gmail.com> Message-ID: bitbucket ? On Sat, Jul 10, 2010 at 7:32 AM, Michael Richter wrote: > On 10 July 2010 14:09, Michael Truog wrote: > > > I vote for "Google Groups"/"Google Wave"/GitHub/BSD_License > > I am neutral on "Google Code" > > > > I vote AGAINST Google Wave and Google Code. I've never had a good > experience on Google Code and Google Wave is painfully slow and incoherent > for anything serious IME. > > -- > "Perhaps people don't believe this, but throughout all of the discussions > of > entering China our focus has really been what's best for the Chinese > people. > It's not been about our revenue or profit or whatnot." > --Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra. > -- Dawid From ttmrichter@REDACTED Sat Jul 10 11:50:53 2010 From: ttmrichter@REDACTED (Michael Richter) Date: Sat, 10 Jul 2010 17:50:53 +0800 Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: References: <4C37BB78.4060205@gmail.com> <4C380E97.6090505@gmail.com> Message-ID: BitBucket, GitHub both sure, although I favour the former. On 10 July 2010 17:15, Dawid Figiel wrote: > bitbucket ? > > > On Sat, Jul 10, 2010 at 7:32 AM, Michael Richter >wrote: > > > On 10 July 2010 14:09, Michael Truog wrote: > > > > > I vote for "Google Groups"/"Google Wave"/GitHub/BSD_License > > > I am neutral on "Google Code" > > > > > > > I vote AGAINST Google Wave and Google Code. I've never had a good > > experience on Google Code and Google Wave is painfully slow and > incoherent > > for anything serious IME. > > > > -- > > "Perhaps people don't believe this, but throughout all of the discussions > > of > > entering China our focus has really been what's best for the Chinese > > people. > > It's not been about our revenue or profit or whatnot." > > --Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra. > > > > > > -- > Dawid > -- "Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot." --Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra. From boris.muehmer@REDACTED Sat Jul 10 13:21:43 2010 From: boris.muehmer@REDACTED (=?UTF-8?Q?Boris_M=C3=BChmer?=) Date: Sat, 10 Jul 2010 13:21:43 +0200 Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: References: <4C37BB78.4060205@gmail.com> <4C380E97.6090505@gmail.com> Message-ID: I will have a look at bitbucket and github. Does bitbucket have a "free plan" for many users? I didn't see it at my first glance... I know Linux doesn't have any problems with git, mercurial, or whatever. How about Windows and Mac OS X? Sometimes I use subversion on windows, but I don't have too much experience about git or mercurial. I also have an old G4 Mac, even with Mac OS X, but I never did any programming on that machine. Also how should we name the project? Somehow I don't want to have the term "Game" in the name, because I think a general approach wouldn't only be interesting for games (like Fantasy-/SF-MMO[RP]Gs), but also "Virtual Worlds" (like Second Life), maybe it could also be of interest for "Virtual-Classrooms". Maybe we need more than one project. Like one for the major "backbone" components (cluster management, monitoring, load balancing, accounting, reporting, tools) and other for "instances" like "Erlang Vast Exploration Online", "Universe of Erlang", "My Erlang Farm", "Erlang Mafia Disputes", "Erlang Aquarium", "Erlang Life", "Cafe Erlang"... Should we discuss those things using "erlang-questions" or move to Google Groups or another mailing list? I don't want to annoy to many people with crazy thoughts... - boris From e_d_k@REDACTED Sat Jul 10 15:18:22 2010 From: e_d_k@REDACTED (Ed Keith) Date: Sat, 10 Jul 2010 06:18:22 -0700 (PDT) Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: Message-ID: <2179.1971.qm@web120506.mail.ne1.yahoo.com> --- On Sat, 7/10/10, Boris M?hmer wrote: > From: Boris M?hmer > Subject: Re: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") > To: "erlang-questions" > Date: Saturday, July 10, 2010, 7:21 AM > I will have a look at bitbucket and > github. Does bitbucket have a > "free plan" for many users? I didn't see it at my first > glance... You can have several user on a project at Bitbucket. > > I know Linux doesn't have any problems with git, mercurial, > or > whatever. How about Windows and Mac OS X? Sometimes I use > subversion > on windows, but I don't have too much experience about git > or > mercurial. I also have an old G4 Mac, even with Mac OS X, > but I never > did any programming on that machine. I have used both subversion and mercurial on Windows, using both the command line and the excelant Tortoise frount ends (TortoiseHg (http://tortoisehg.bitbucket.org/about.html) & TortoiseSVN (http://tortoisesvn.tigris.org/). I have never used GIT. > > Also how should we name the project? > > Somehow I don't want to have the term "Game" in the name, > because I > think a general approach wouldn't only be interesting for > games (like > Fantasy-/SF-MMO[RP]Gs), but also "Virtual Worlds" (like > Second Life), > maybe it could also be of interest for > "Virtual-Classrooms". I am more intrestd in the "Virtual-Classrooms" posabilities than just a game. > > Maybe we need more than one project. Like one for the major > "backbone" > components (cluster management, monitoring, load > balancing, > accounting, reporting, tools) and other for "instances" > like "Erlang > Vast Exploration Online", "Universe of Erlang", "My Erlang > Farm", > "Erlang Mafia Disputes", "Erlang Aquarium", "Erlang Life", > "Cafe > Erlang"... sound like a good idea, but it could be too big and endup callapsing under its own waight. Ed Keith e_d_k@REDACTED Blog: edkeith.blogspot.com From zeno490@REDACTED Sat Jul 10 17:56:01 2010 From: zeno490@REDACTED (Nicholas Frechette) Date: Sat, 10 Jul 2010 11:56:01 -0400 Subject: [erlang-questions] Let's start a project for a (MMO-)Game in Erlang... (inspired by "Erlang: Who uses it for games?") In-Reply-To: <2179.1971.qm@web120506.mail.ne1.yahoo.com> References: <2179.1971.qm@web120506.mail.ne1.yahoo.com> Message-ID: I would love to contribute however I legally cannot due to my current contract. While I cannot code, I can still give advice. IMO that sounds like a great idea. Since you'll likely create a custom protocol over TCP, you'll be able to make a frontend in just about any language. I would advise against a web solution if you ever want to achieve any kind of meaningful performance. For heavy scenes, you'll almost always have to end up shifting a lot of work off the server and onto the client (stuff that doesn't need the server, like vfx particles bouncing off physics objects (ie: destructible)) and you'll have a hard time doing efficient work in javascript (I use it in my project for rendering tasks and it is terribly slow still..). Good luck trying to have your browser call c++ code locally (as in external library) without creating a custom plugin. If however you don't aim to support hardcore gaming and more for casual, slow paced games like second life or farmville, then yes, a web frontend would be ideal. While I haven't tried webgl yet, I've found that svg was faster overall than canvas for heavy scenes. An other problem you'll hit if you go the web frontend route is that you'll find javascript poorly suited for binary parsing and you'll most likely want to have your underlying protocol use json or some delimiter based strings (to save on bandwidth and parsing time). That might not be such a bad idea in fact, just have all the protocol messages be in json (later on you can always add a message to request binary messages for efficiency in games that require it). Most languages have libraries to parse json and it'll integrate well with javascript if need be. You could even, have javascript be the game's scripting language both on the server side and client side. Do spent a good amount of time designing the authoring tool(s) and how they will tie in with the rest of the engine. Those are usually critical for acceptance. (ie: Unreal3 has a horrible engine, code wise and performance wise, but because it has good tools for artists, a lot of games go for unreal) That could very well turn out be the most critical part of the project. While you may be able to build most supporting tools and pipelines (in fact I would vote for you to use erlang for the data building pipelines), you may have to use something else for the authoring tools. You'll need to be able to render large scenes in low res and have it be very responsive. You'll definitely need opengl/directx support for it. Perhaps python or c# could be good fits here, I'm not sure. Likewise, spent a good deal amount of time designing the data building pipelines. This is where designers/artists spend a good deal of their time (waiting for things to build). You'll most definitely want to have assets build separately and be cached to avoid needless rebuilding. You may wish to bundle them together but only referencing a hash or key. You'll then be able to stream them to the clients on demand when they load a level. (There might be an opportunity to abuse javascript caching in browsers if you go the web frontend route (ie: when loading assets, dynamicaly add