From wingsone@REDACTED Sat Feb 2 15:32:21 2002 From: wingsone@REDACTED (Chris Osgood) Date: Sat, 02 Feb 2002 09:32:21 -0500 Subject: Erlang to external app interfaces Message-ID: <3C5BF875.1010305@mac.com> I know there are a few different ways to hook Erlang to non-Erlang applications. I'm curious about the performance of each. The regular ports stuff seems kinda slow since it uses a regular network connection. This method is "clean" though. Then you have linked-in drivers. This seems faster than regular ports, but how fast is it? As fast as a BIF, or is there some "port" overhead? This method is mostly clean. And finally, you have BIF's. It was very easy to add my own BIF's to Erlang, and I assume these are pretty fast. In fact, for an Erlang newbie like me, it was easier than doing a linked-in driver. This method is not as clean as using ports because you are changing the Erlang core. Am I missing another technique? Is there another way besides the BIF's to link right into the Erlang core for maximum performance? Are linked-in drivers just as fast? Which is _the_ fastest method? I need not only fast function calls, but lots of bandwidth for passing data too. Thanks! -- // Chris From admin@REDACTED Sun Feb 3 09:28:54 2002 From: admin@REDACTED (admin) Date: Sun, 3 Feb 2002 11:28:54 +0300 Subject: salamon.netfirms.com - The cheapest shop of Personal digital Assistents (PDA) and Pocket PC ($alamon PDA $ale) Message-ID: <200202030834.g138Y5H13059@hades.cslab.ericsson.net> An HTML attachment was scrubbed... URL: From admin@REDACTED Sun Feb 3 14:57:29 2002 From: admin@REDACTED (admin) Date: Sun, 3 Feb 2002 16:57:29 +0300 Subject: salamon.netfirms.com - The cheapest shop of Personal digital Assistents (PDA) and Pocket PC Message-ID: <200202031358.g13DwYH13644@hades.cslab.ericsson.net> An HTML attachment was scrubbed... URL: From baos@REDACTED Mon Feb 4 06:59:54 2002 From: baos@REDACTED (Bancroft Scott) Date: Mon, 4 Feb 2002 00:59:54 -0500 (EST) Subject: verifying encoding_comparison.html results (resend) Message-ID: ---------- Forwarded message ---------- Date: Thu, 31 Jan 2002 16:41:01 -0500 (EST) From: Bancroft Scott To: erlang-questions@REDACTED Subject: Re: verifying encoding_comparison.html results Hi, I downloaded the Megaco measurement software from your website and ran it locally on my machine which is an Intel Celeron 900MHz box running RedHat Linux. The Erlang/OTP environment was compiled with "--enable-hipe" option. While checking the results, the following questions arose: 1) Your charts at http://www.erlang.org/project/megaco/encode_time.jpg refer to binary encoders as just "PER" and "BER". Exactly which variant of your encoders are being referenced here - "original" or "native"? As you can see in the attachment to this email, the tool that you provided reports results for both your "original" and "native" implementations. 2) According to my measurements, on average the erl_dist encoder is 11.7 times faster than the BER native encoder and 17.3 times faster than the ordinary (non-native) BER encoder. However, your charts at http://www.erlang.org/project/megaco/encoding_comparison/encode_time.jpg show that the erl_dist encoder is "only" 8.8 times faster then BER. How do you explain this difference where my results shows erl_dist is 17.3 times faster than BER, while yours show only 8.8? Is it that the version of your libraries that you provided has a more highly optimized version of the erl_dist encoder/decoder than the one that you used in your own reports? If that is not the case, do you have any idea why it performs significantly better than is reported on the website? You can find the full set of output from my test run in the attached file. Bancroft Scott -------------- next part -------------- A non-text attachment was scrubbed... Name: megaco.zip Type: application/zip Size: 2808 bytes Desc: URL: From raimo@REDACTED Mon Feb 4 10:04:27 2002 From: raimo@REDACTED (Raimo Niskanen) Date: Mon, 04 Feb 2002 10:04:27 +0100 Subject: Iterate n times References: <402DD461F109D411977E0008C791C312039F676E@imp02mbx.one2one.co.uk> Message-ID: <3C5E4E9B.F5E9711B@erix.ericsson.se> You can make up numerous variants of this idea. Here is another one: %% A simple loop construct. %% %% Calls 'Fun' with argument 'Start' first and then repeatedly with %% its returned value (state) until 'Fun' returns 'Stop'. Then %% the last state value that was not 'Stop' is returned. iterate(Start, Done, Fun) when function(Fun) -> iterate(Start, Done, Fun, Start). iterate(Done, Done, Fun, I) -> I; iterate(I, Done, Fun, _) -> iterate(Fun(I), Done, Fun, I). Example: 1>iterate([1], done, fun ([5|_])->done; (L)->[hd(L)+1|L] end). [5,4,3,2,1] Another thought is to make lists:seq/3 accept a fun as incrementor. The problem might be that everytime a user comes up with this kind of construct, it looks slightly different, so there is no obvious one-size-fits-all solution. Furthermore, if you give the user another loop construct it is just another way for the user to shoot her/himself in the foot. / Raimo Niskanen, Ericsson UAB, Erlang/OTP Sean Hinde wrote: > > Does anyone know if this function has a proper name or already exists > anywhere? > > iter(F, St, 0) -> > St; > iter(F, St, N) when integer(N), N > 1 -> > iter(F, F(St, N), N-1). > > Simple examples of usage might be: > > 1> iter(fun(St, N) -> N + St end, 0, 5). > 15 > 2> iter(fun(St, N) -> [N|St] end, [], 5). > [1,2,3,4,5] > > Sean > > NOTICE AND DISCLAIMER: > This email (including attachments) is confidential. If you have received > this email in error please notify the sender immediately and delete this > email from your system without copying or disseminating it or placing any > reliance upon its contents. We cannot accept liability for any breaches of > confidence arising through use of email. Any opinions expressed in this > email (including attachments) are those of the author and do not necessarily > reflect our opinions. We will not accept responsibility for any commitments > made by our employees outside the scope of our business. We do not warrant > the accuracy or completeness of such information. From raimo@REDACTED Mon Feb 4 14:31:37 2002 From: raimo@REDACTED (Raimo Niskanen) Date: Mon, 04 Feb 2002 14:31:37 +0100 Subject: Erlang to external app interfaces References: <3C5BF875.1010305@mac.com> Message-ID: <3C5E8D39.34FC4676@erix.ericsson.se> You seem to have got the grip of the subject already, so I have just some comments. Regular ports use pipes for inter process communication, so there is not really any network communication since the processes involved must be on the same host. The overhead for linked-in drivers occurs in at least 3 different contexts: 1. Linking in the driver. 2. Opening the port. 2. Sending to the port / receiving from the port. Linking in the driver is probably done once, so it is often not critical. Opening the port consists of allocating the port structure, initializing all fields, and calling the driver->open() function, which takes the time it needs. Overhead in sending to the port consists of calling the erlang:'!'/2 BIF, looking up the port, analysing the mode and validity of the port, and, depending on the mode perhaps flattening and copying the send data. So if you want to minimize this overhead you should send the data as one or a few binaries - then the data will not be copied, just the pointers to the data. Finally, the driver->outputv() function is called. Overhead when calling a BIF is roughly looking up the BIF in the modules export table (array lookup), pushing live data on the stack (emulator stack, not processor stack). When writing a BIF there are _lots_ of rules to follow regarding memory allocation, result data construction, and so on to follow, and the rules might change in the next Erlang release. This is _really_ deep water. The only way to get less overhead than calling a BIF is to add a new instruction to the Emulator loop, and now we get into deep sea diving. Not recommended at all. The probability for mistakes is approaching one. Do some measurements, and/or explain more about your application. / Raimo Niskanen, Erlang/OTP, Ericsson UAB Chris Osgood wrote: > > I know there are a few different ways to hook Erlang to non-Erlang > applications. I'm curious about the performance of each. > > The regular ports stuff seems kinda slow since it uses a regular network > connection. This method is "clean" though. > > Then you have linked-in drivers. This seems faster than regular ports, > but how fast is it? As fast as a BIF, or is there some "port" overhead? > This method is mostly clean. > > And finally, you have BIF's. It was very easy to add my own BIF's to > Erlang, and I assume these are pretty fast. In fact, for an Erlang > newbie like me, it was easier than doing a linked-in driver. This > method is not as clean as using ports because you are changing the > Erlang core. > > Am I missing another technique? Is there another way besides the BIF's > to link right into the Erlang core for maximum performance? Are > linked-in drivers just as fast? > > Which is _the_ fastest method? I need not only fast function calls, but > lots of bandwidth for passing data too. > > Thanks! > > -- > // Chris From thomas.lindgren@REDACTED Mon Feb 4 15:05:46 2002 From: thomas.lindgren@REDACTED (Thomas Lindgren) Date: Mon, 4 Feb 2002 15:05:46 +0100 Subject: Erlang to external app interfaces In-Reply-To: <3C5E8D39.34FC4676@erix.ericsson.se> Message-ID: > The only way to get less overhead than calling a BIF is to add a new > instruction to the Emulator loop, and now we get into deep sea diving. > Not recommended at all. The probability for mistakes is approaching one. You can also hack the HIPE subsystem to generate inline native code for your primitive. In principle it's simple: pattern match on the primitive you want to compile, emit the proper rtl instructions instead of the call and you're set. In practice, things may be more difficult. And please don't mention the maintenance issues. I suppose this goes under the heading of fairly deep sea diving as well. With sharks :-) -- Thomas From joe@REDACTED Tue Feb 5 10:56:05 2002 From: joe@REDACTED (Joe Armstrong) Date: Tue, 5 Feb 2002 10:56:05 +0100 Subject: is their a program for plotting supervision trees??? Message-ID: <200202050956.g159u5p00625@enfield.sics.se> has anybody written a program for plotting the static structure of a supervision tree from its specification?? /Joe From hal@REDACTED Tue Feb 5 17:47:51 2002 From: hal@REDACTED (Hal Snyder) Date: 05 Feb 2002 10:47:51 -0600 Subject: is their a program for plotting supervision trees??? In-Reply-To: <200202050956.g159u5p00625@enfield.sics.se> References: <200202050956.g159u5p00625@enfield.sics.se> Message-ID: <87bsf3nadk.fsf@ghidra.vail> Joe Armstrong writes: > has anybody written a program for plotting the static structure of a > supervision tree from its specification?? Not really (sorry), but graphviz looks like a nice way to go, e.g.: http://www.foobar.tm/beta/index.cgi?domain=erlang.org From luke@REDACTED Tue Feb 5 17:57:55 2002 From: luke@REDACTED (Luke Gorrie) Date: 05 Feb 2002 17:57:55 +0100 Subject: is their a program for plotting supervision trees??? In-Reply-To: <200202050956.g159u5p00625@enfield.sics.se> References: <200202050956.g159u5p00625@enfield.sics.se> Message-ID: Joe Armstrong writes: > has anybody written a program for > plotting the static structure of a supervision tree from > its specification?? Sounds like what Jan Nystr?m presented at the Erlang Workshop? Perhaps his was more blood and guts than just going from a specification.. his paper is at http://citeseer.nj.nec.com/453431.html, not sure if the code is posted anywhere. Cheers, Luke From thomas@REDACTED Wed Feb 6 09:18:50 2002 From: thomas@REDACTED (Thomas Arts) Date: Wed, 06 Feb 2002 09:18:50 +0100 Subject: is their a program for plotting supervision trees??? References: <200202050956.g159u5p00625@enfield.sics.se> Message-ID: <3C60E6EA.74049EF2@cslab.ericsson.se> The project on which Jan Nystr?m is working deals with visualization of applications (in particular the AXD 301 applications). Visualizing the supervision tree is part of that. I wrote a prototype for the work Jan Nystr?m started of with. Three modules are attached for those of you that are interested. Regards Thomas Attached are: visualize.erl app.erl eval.erl you need a small modification in the graph drawing package of Hans Nilsson from the open source user contributions: http://www.erlang.org/contrib/graph_draw-0.0.tgz The function supertree/2 is added: diff 4c4 < -export([start/1, start/4, supertree/2, --- > -export([start/1, start/4, 25,33d24 < < % added by Thomas (June 2001) < supertree(CallBack,UsersData) -> < spawn(?MODULE, init, < [CallBack, UsersData, < #gdtop_options{title = "Supervision Tree"}, < #gd_options{cyclic = false, < horizontal = false, < graph_font={screen,16}, algorithm=tree}]). After installing and modifying the graph drawing package you can run the software on a supervision tree. Given a call mymodule:start(Arg1,...,Argn) to start your topnode supervision process, you can visualize the tree with: visualize:supervisor(mymodule,start,[Arg1,...,Argn]). Good luck Luke Gorrie wrote: > > Joe Armstrong writes: > > > has anybody written a program for > > plotting the static structure of a supervision tree from > > its specification?? > > Sounds like what Jan Nystr?m presented at the Erlang Workshop? Perhaps > his was more blood and guts than just going from a specification.. his > paper is at http://citeseer.nj.nec.com/453431.html, not sure if the > code is posted anywhere. > > Cheers, > Luke -------------- next part -------------- % static analysis of application % % Thomas Arts % November 2000 -module(app). -define(WARNING(F,A),io:format("Warning: "++F,A)). %-define(DEBUG(F,A),io:format("Debug: "++F,A)). -define(DEBUG(F,A),ok). -define(ERROR(Reasons),begin io:format("~p~n",[Reasons]), {error,Reasons} end). -export([start/1, start/2, nonapp/3, parse/2]). -import(lists,[map/2]). % app:start(App) should be called instead % of application:start(App) % be sure the .app file is readable and the sources are either in % ../src/ from the directory in which .app is situated or % in the same directory as .app file. % app:supervision(Mod,StartArgs) should be called instead % of supervision:start_link(Mod,StartArgs) % be sure the Mod file and all calling sources are in present dir start(Application) -> start([],Application). start(IncludePath,Application) -> Directory = find_app(Application), AppSpec = parse(Directory,Application), analyse_app(IncludePath,Directory,AppSpec). nonapp(Module,Func,Args) -> analyse_to_sup([],".",{application,unknown,[]},top,Module,Func,Args). analyse_app(IncludePath,Dir,AppSpec) -> {application,Name,Spec} = AppSpec, case lists:keysearch(mod,1,Spec) of {value,{mod,{Mod,Arg}}} -> {application,Name, [analyse_to_sup(IncludePath,Dir,AppSpec,app_master, Mod,start,[normal,Arg])]}; _ -> ?ERROR(["cannot determine start module"]) end. analyse_to_sup(IncludePath,Dir,AppSpec,SupName,Mod,Func,Args) -> % the Mod:Func(Args) function should now evaluate % to a process that is the top of the supervisor tree ?DEBUG("~p:~p/~p should lead to supervisor:start_link~n", [Mod,Func,length(Args)]), case readprog(IncludePath,Dir,Mod) of {ok,AbsForms} -> case evaluate(IncludePath,Dir,AppSpec,AbsForms,Func,Args) of {value,{supervisor,start_link,[M,A]},_} -> {supervisor,SupName,analyse_sup(IncludePath,Dir,AppSpec,M,A)}; {value,{supervisor,start_link,[SN,M,A]},_} -> {supervisor,SN,analyse_sup(IncludePath,Dir,AppSpec,M,A)}; {value,ignore,_} -> {supervisor,ignored,[]}; Other -> ?ERROR(["no supervisor started",Other]) end; {error,Reason} -> ?ERROR(["parse_error module "++atom_to_list(Mod)++".erl", Reason]) end. analyse_sup(IncludePath,Dir,AppSpec,Mod,Arg) -> ?DEBUG("computing supervisor structure ~p:init(~p)~n",[Mod,Arg]), case readprog(IncludePath,Dir,Mod) of {ok,AbsForms} -> % the Mod:init(Arg) function should evaluate to a % data structure describing the supervisor specification case catch evaluate(IncludePath,Dir,AppSpec,AbsForms,init,[Arg]) of {value,{ok,{{SupType,_,_},ChildSups}},_} -> map(fun(X)-> analyse_worker(IncludePath,Dir,AppSpec,SupType,X) end,ChildSups); Other -> ?ERROR(["supervisor wrong return value for init/1", Other]) end; {error,Reason} -> ?ERROR(["parse_error module "++atom_to_list(Mod)++".erl", Reason]) end. analyse_worker(IncludePath,Dir,AppSpec,SupType, {Name,{Mod,Start,Args},Restart,_,supervisor,_}) -> % a supervisor again, that should be analysed differently analyse_to_sup(IncludePath,Dir,AppSpec,Name,Mod,Start,Args); analyse_worker(IncludePath,Dir,AppSpec,SupType, {Name,{Mod,Start,Args},Restart,_,worker,_}) -> ?DEBUG("computing worker ~p:~p/~p~n",[Mod,Start,length(Args)]), case readprog(IncludePath,Dir,Mod) of {ok,AbsForms} -> % case grepbehaviour(AbsForms) of % none -> % {SupType,Name,{{Mod,Start,Args},Restart,worker}}; % Behaviour -> % end % THIS IS DANGEROUS, the function could loop infinitely case catch evaluate(IncludePath,Dir,AppSpec,AbsForms,Start,Args) of {value,{gen_server,start,[M,As,_]},_} -> {SupType,Name,nolink(Mod,Start,length(Args),Name)}; {value,{gen_server,start,[SName,M,As,_]},_} -> {SupType,checkname(Mod,Start,length(Args),Name,SName), nolink(Mod,Start,length(Args),Name)}; {value,{gen_server,start_link,[M,As,_]},_} -> {SupType,Name,{{M,init,[As]},Restart,gen_server, [{started,[{Start,length(Args)}]} ]}}; {value,{gen_server,start_link,[SName,M,As,_]},_} -> CheckedName = checkname(Mod,Start,length(Args),Name,SName), {SupType,CheckedName, {{M,init,[As]},Restart,gen_server, [{registered,CheckedName}, {started,[{Start,length(Args)}]} ]}}; {value,{gen_fsm,start,[M,As,_]},_} -> {SupType,Name,nolink(Mod,Start,length(Args),Name)}; {value,{gen_fsm,start,[SName,M,As,_]},_} -> {SupType,checkname(Mod,Start,length(Args),Name,SName), nolink(Mod,Start,length(Args),Name)}; {value,{gen_fsm,start_link,[M,As,_]},_} -> {SupType,Name,{{M,init,[As]},Restart,gen_fsm, [{started,[{Start,length(Args)}]} ]}}; {value,{gen_fsm,start_link,[SName,M,As,_]},_} -> CheckedName = checkname(Mod,Start,length(Args),Name,SName), {SupType,CheckedName, {{M,init,[As]},Restart,gen_fsm, [{registered,CheckedName}, {started,[{Start,length(Args)}]} ]}}; {value,{gen_event,start,[]},_} -> {SupType,Name,nolink(Mod,Start,length(Args),Name)}; {value,{gen_event,start,[SName]},_} -> {SupType,checkname(Mod,Start,length(Args),Name,SName), nolink(Mod,Start,length(Args),Name)}; {value,{gen_event,start_link,[]},_} -> {SupType,Name,{{gen_event,start_link,[]},Restart,gen_event}}; {value,{gen_event,start_link,[SName]},_} -> CheckedName = checkname(Mod,Start,length(Args),Name,SName), {SupType,CheckedName, {{gen_event,start_link,[SName]},Restart,gen_event, [{registered,CheckedName}]}}; {value,{spawn,As},_} -> {SupType,Name,returntype_error(Mod,Start,length(Args),Name)}; {value,{spawn_link,As},_} -> {SupType,Name,returntype_error(Mod,Start,length(Args),Name)}; {value,{ok,{spawn,[M,F,As]}},_} -> {SupType,Name,nolink(Mod,Start,length(Args),Name)}; {value,{ok,{spawn,[Node,M,F,As]}},_} -> {SupType,Name,nolink(Mod,Start,length(Args),Name)}; {value,{ok,{spawn_link,[M,F,As]}},_} -> {SupType,Name,{{M,F,As},Restart,worker, [{started,[{Start,length(Args)}]} ]}}; {value,{ok,{spawn_link,[Node,M,F,As]}},_} -> {SupType,Name,{{M,F,As},Restart,worker, [{started,[{Start,length(Args)}]} ]}}; Other -> io:format("Unrecognized spawning: ~p~n",[Other]), {SupType,Name,{{Mod,Start,Args},Restart,worker}} end; {error,enoent} -> % worker defined in other application {SupType,Name,{{Mod,Start,Args},Restart,{worker,Mod}}}; {error,Reason} -> ?ERROR(["parse_error module "++atom_to_list(Mod)++".erl", Reason]) end. readprog(IncludePath,Dir,Module) -> % assume Module to be in Dir++"../src", otherwise Dir File = atom_to_list(Module)++".erl", case file:read_file_info(filename:join([Dir,"../src",File])) of {ok,_} -> ?DEBUG("reading file ~p~n",[filename:join([Dir,"../src",File])]), NewDir=filename:join([Dir,"../src"]), epp:parse_file(filename:join([NewDir,File]), [Dir,NewDir|IncludePath],[]); _ -> case file:read_file_info(filename:join([Dir,File])) of {ok,_} -> ?DEBUG("reading file ~p~n",[filename:join([Dir,File])]), epp:parse_file(filename:join([Dir,File]),[Dir|IncludePath],[]); Error -> ?DEBUG("eval mod "++File++" (~p)~n",[Error]), Error end end. checkname(Mod,Start,Arity,Name,SName) -> case SName of Name -> Name; {local,Name} -> Name; {global,Name} -> Name; _ -> io:format("Warning: named worker ~p registered as ~p in "++ atom_to_list(Mod)++":"++ atom_to_list(Start)++"/"++ integer_to_list(Arity)++"~n", [Name,SName]), SName end. grepbehaviour([]) -> none; grepbehaviour([{attribute,_,behaviour,Behaviour}|AbsForms]) -> Behaviour; grepbehaviour([_|AbsForms]) -> grepbehaviour(AbsForms). nolink(Mod,Start,Arity,Name) -> Reason = io_lib:format("Error: ~p not linked to parent in "++ atom_to_list(Mod)++":"++ atom_to_list(Start)++"/"++ integer_to_list(Arity), [Name]), io:format("~s~n",[Reason]), {error,lists:flatten(Reason)}. returntype_error(Mod,Start,Arity,Name) -> Reason = io_lib:format( "Error: ~p started wrongly, returntype should be {ok,Pid} in "++ atom_to_list(Mod)++":"++ atom_to_list(Start)++"/"++ integer_to_list(Arity), [Name]), io:format("~s~n",[Reason]), {error,lists:flatten(Reason)}. evaluate(IncludePath,Dir,AppSpec,AbsForms,Name,Arguments) -> LocalFunctionHandler = fun({io,format},Args,Bindings) -> {value,ok,Bindings}; ({M,F},Args,Bindings) -> case readprog(IncludePath,Dir,M) of {ok,NewAbsForms} -> {value,V,Bs} = evaluate(IncludePath,Dir,AppSpec, NewAbsForms,F,Args), {value,V,Bindings}; _ -> case {M,F,Args} of {application,get_env,[Key]} -> {value,extract(AppSpec,Key),Bindings}; {application,get_env,[App,Key]} -> case AppSpec of {application,App,Spec} -> {value,extract(AppSpec,Key),Bindings}; _ -> % different application {value,apply(M,F,Args),Bindings} end; _ -> {value,apply(M,F,Args),Bindings} end end; (F,Args,Bindings) when atom(F) -> {value,V,Bs} = evaluate(IncludePath,Dir,AppSpec,AbsForms,F,Args), {value,V,Bindings} end, case [ Body || {function,_,Fun,Arity,Body}<-AbsForms, Name==Fun, length(Arguments)==Arity ] of [ Clauses ] -> eval:case_clauses(list_to_tuple(Arguments), map(fun({clause,L,Ps,Gs,B}) -> {clause,L,[{tuple,L,Ps}],Gs,B} end,Clauses), [],{value,LocalFunctionHandler}); Other -> exit({AbsForms,Other,"undefined function "++ atom_to_list(Name)++ "/"++integer_to_list(length(Arguments))}) end. %%%----------------------------------------------------------- find_app(AppName) -> find_app(atom_to_list(AppName)++".app",code:get_path()). find_app(File,[]) -> exit("cannot find "++File); find_app(File,[Dir|Dirs]) -> case file:read_file_info(filename:join(Dir,File)) of {ok,Info} -> Dir; _ -> find_app(File,Dirs) end. parse(Dir,Application) -> File = filename:join(Dir,atom_to_list(Application)++".app"), ?DEBUG("reading file ~p~n",[File]), case file:read_file(File) of {ok,Bin} -> case erl_scan:string(binary_to_list(Bin)) of {ok,Tokens,Line} -> case erl_parse:parse_term(Tokens) of {ok,Term} -> check_app(Term,Application,File); {error,ParseError} -> exit({"error parsing file "++File,ParseError}) end; Error -> exit({"error reading file "++File,Error}) end; {error,Reason} -> exit({"error opening file "++File,Reason}) end. check_app({application,AppName,Spec},Application,File) -> {application, case AppName of Application -> AppName; _ -> ?WARNING("name conflict ~p called ~p in ~p~n", [Application,AppName,File]), Application end, Spec}; check_app(Other,Application,File) -> exit({"error in format "++File,Other}). extract({application,_,Spec},Key) -> case lists:keysearch(env,1,Spec) of {value,{env,Vars}} -> case lists:keysearch(Key,1,Vars) of {value,{_,Value}} -> {ok,Value}; _ -> ?WARNING("application variable ~p undefined in .app file~n", [Key]), undefined end; _ -> ?WARNING("application variable ~p undefined in .app file~n",[Key]), undefined end. -------------- next part -------------- %% ``The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved via the world wide web at http://www.erlang.org/. %% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. %% %% The Initial Developer of the Original Code is Ericsson Utvecklings AB. %% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings %% AB. All Rights Reserved.'' %% %% $Id$ %% %% Modified version by Thomas Arts %% November 2000 -module(eval). %% An evaluator for Erlang abstract syntax. -export([case_clauses/4]). -export([exprs/2,exprs/3,expr/2,expr/3,expr_list/2,expr_list/3]). -export([new_bindings/0,bindings/1,binding/2,add_binding/3,del_binding/2]). -export([is_constant_expr/1, partial_eval/1]). %% The following exports are here for backwards compatibility. -export([seq/2,seq/3,arg_list/2,arg_list/3]). -import(lists, [reverse/1,flatmap/2,foldl/3]). %% seq(ExpressionSeq, Bindings) %% seq(ExpressionSeq, Bindings, LocalFuncHandler) %% arg_list(ExpressionList, Bindings) %% arg_list(ExpressionList, Bindings, LocalFuncHandler) %% These calls are here for backwards compatibility (BC sucks!). seq(Exprs, Bs) -> exprs(Exprs, Bs). seq(Exprs, Bs, Lf) -> exprs(Exprs, Bs, Lf). arg_list(Es, Bs) -> expr_list(Es, Bs). arg_list(Es, Bs, Lf) -> expr_list(Es, Bs, Lf). %% exprs(ExpressionSeq, Bindings) %% exprs(ExpressionSeq, Bindings, LocalFuncHandler) %% Returns: %% {value,Value,NewBindings} exprs(Exprs, Bs) -> exprs(Exprs, Bs, none). exprs(Exprs, Bs, Lf) -> exprs(Exprs, Bs, true, Lf). exprs([E|Es], Bs0, _, Lf) -> {value,V,Bs} = expr(E, Bs0, Lf), exprs(Es, Bs, V, Lf); exprs([], Bs, V, Lf) -> {value,V,Bs}. %% expr(Expression, Bindings) %% expr(Expression, Bindings, LocalFuncHandler) %% Returns: %% {value,Value,NewBindings} expr(E, Bs) -> expr(E, Bs, none). expr({var,L,V}, Bs, Lf) -> case binding(V, Bs) of {value,Val} -> {value,Val,Bs}; unbound -> exit({{unbound,V},[{?MODULE,expr,3}]}) end; expr({char,_,C}, Bs, Lf) -> {value,C,Bs}; expr({integer,_,I}, Bs, Lf) -> {value,I,Bs}; expr({float,_,F}, Bs, Lf) -> {value,F,Bs}; expr({atom,_,A}, Bs, Lf) -> {value,A,Bs}; expr({string,_,S}, Bs, Lf) -> {value,S,Bs}; expr({nil, _}, Bs, Lf) -> {value,[],Bs}; expr({cons,_,H0,T0}, Bs0, Lf) -> {value,H,Bs1} = expr(H0, Bs0, Lf), {value,T,Bs2} = expr(T0, Bs0, Lf), {value,[H|T],merge_bindings(Bs1, Bs2)}; expr({lc,_,E,Qs}, Bs, Lf) -> eval_lc(E, Qs, Bs, Lf); expr({tuple,_,Es}, Bs0, Lf) -> {Vs,Bs} = expr_list(Es, Bs0, Lf), {value,list_to_tuple(Vs),Bs}; expr({record_index,_,Name,F}, Bs, Lf) -> exit({undef_record,Name}); expr({record,_,Name,Fs}, Bs, Lf) -> exit({undef_record,Name}); expr({record_field,_,Rec,Name,F}, Bs, Lf) -> exit({undef_record,Name}); expr({record,_,Rec,Name,Fs}, Bs, Lf) -> exit({undef_record,Name}); expr({record_field,_,Rec,F}, Bs, Lf) -> exit(undef_record); expr({block,_,Es}, Bs, Lf) -> exprs(Es, Bs, Lf); expr({'if',_,Cs}, Bs, Lf) -> if_clauses(Cs, Bs, Lf); expr({'case',_,E,Cs}, Bs0, Lf) -> {value,Val,Bs} = expr(E, Bs0, Lf), case_clauses(Val, Cs, Bs, Lf); expr({'receive',_,Cs}, Bs, Lf) -> receive_clauses(Cs, Bs, Lf, []); expr({'receive',_, Cs, E, TB}, Bs0, Lf) -> {value,T,Bs} = expr(E, Bs0, Lf), receive_clauses(T, Cs, {TB,Bs}, Bs0, Lf, []); expr({'fun',Line,{clauses,Cs}}, Bs, Lf) -> %% This is a really ugly hack! case length(element(3,hd(Cs))) of 0 -> {value,fun () -> eval_fun(Cs, [], Bs, Lf) end,Bs}; 1 -> {value,fun (A) -> eval_fun(Cs, [A], Bs, Lf) end,Bs}; 2 -> {value,fun (A,B) -> eval_fun(Cs, [A,B], Bs, Lf) end,Bs}; 3 -> {value,fun (A,B,C) -> eval_fun(Cs, [A,B,C], Bs, Lf) end,Bs}; 4 -> {value,fun (A,B,C,D) -> eval_fun(Cs, [A,B,C,D], Bs, Lf) end,Bs}; 5 -> {value, fun (A,B,C,D,E) -> eval_fun(Cs, [A,B,C,D,E], Bs, Lf) end, Bs}; 6 -> {value, fun (A,B,C,D,E,F) -> eval_fun(Cs, [A,B,C,D,E,F], Bs, Lf) end, Bs}; 7 -> {value, fun (A,B,C,D,E,F,G) -> eval_fun(Cs, [A,B,C,D,E,F,G], Bs, Lf) end, Bs}; 8 -> {value, fun (A,B,C,D,E,F,G,H) -> eval_fun(Cs, [A,B,C,D,E,F,G,H], Bs, Lf) end, Bs}; 9 -> {value, fun (A,B,C,D,E,F,G,H,I) -> eval_fun(Cs, [A,B,C,D,E,F,G,H,I], Bs, Lf) end, Bs}; 10 -> {value, fun (A,B,C,D,E,F,G,H,I,J) -> eval_fun(Cs, [A,B,C,D,E,F,G,H,I,J], Bs, Lf) end, Bs}; 11 -> {value, fun (A,B,C,D,E,F,G,H,I,J,K) -> eval_fun(Cs, [A,B,C,D,E,F,G,H,I,J,K], Bs, Lf) end, Bs}; 12 -> {value, fun (A,B,C,D,E,F,G,H,I,J,K,L) -> eval_fun(Cs, [A,B,C,D,E,F,G,H,I,J,K], Bs, Lf) end, Bs}; 13 -> {value, fun (A,B,C,D,E,F,G,H,I,J,K,L,M) -> eval_fun(Cs, [A,B,C,D,E,F,G,H,I,J,K,L,M], Bs, Lf) end, Bs}; 14 -> {value, fun (A,B,C,D,E,F,G,H,I,J,K,L,M,N) -> eval_fun(Cs, [A,B,C,D,E,F,G,H,I,J,K,L,M,N], Bs, Lf) end, Bs}; 15 -> {value, fun (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) -> eval_fun(Cs, [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O], Bs, Lf) end, Bs}; 16 -> {value, fun (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) -> eval_fun(Cs, [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P], Bs, Lf) end, Bs}; 17 -> {value, fun (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q) -> eval_fun(Cs, [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q], Bs, Lf) end, Bs}; 18 -> {value, fun (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R) -> eval_fun(Cs, [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R], Bs, Lf) end, Bs}; 19 -> {value, fun (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S) -> eval_fun(Cs, [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S], Bs, Lf) end, Bs}; 20 -> {value, fun (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T) -> eval_fun(Cs, [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T], Bs, Lf) end, Bs}; Other -> exit({'argument_limit',{'fun',Line,Cs}}) end; expr({call,_,{remote,_,Mod,Func},As0}, Bs0, Lf) -> {value,M,Bs1} = expr(Mod, Bs0, Lf), {value,F,Bs2} = expr(Func, Bs0, Lf), {As,Bs3} = expr_list(As0, merge_bindings(Bs1, Bs2), Lf), case {M,F,length(As)} of {supervisor,start_link,Arity} when Arity==2; Arity==3 -> {value,{supervisor,start_link,As},Bs3}; {gen_server,start,Arity} when Arity==3; Arity==4 -> {value,{gen_server,start,As},Bs3}; {gen_server,start_link,Arity} when Arity==3; Arity==4 -> {value,{gen_server,start_link,As},Bs3}; {gen_event,start,Arity} when Arity==0; Arity==1 -> {value,{gen_event,start,As},Bs3}; {gen_event,start_link,Arity} when Arity==0; Arity==1 -> io:format("creating an event manager~n"), {value,{gen_event,start_link,As},Bs3}; {gen_event,add_handler,Arity} when Arity==3 -> io:format("adding a handler ~p~n",[As]), {value,{gen_event,add_handler,As},Bs3}; {gen_fsm,start,Arity} when Arity==3; Arity==4 -> {value,{gen_fsm,start,As},Bs3}; {gen_fsm,start_link,Arity} when Arity==3; Arity==4 -> {value,{gen_fsm,start_link,As},Bs3}; % do not send {gen_server,call,Arity} when Arity==2 -> io:format("Warning: disabled gen_server:call~n"), {value,{gen_server,call,As},Bs3}; _ -> case Lf of {value,LocalHandler} -> LocalHandler({M,F},As,Bs3); _ -> {value,apply(M, F, As),Bs3} end end; expr({call,_,Func0,As0}, Bs0, Lf) -> %Local functions handler {value,Func,Bs1} = expr(Func0, Bs0, Lf), if Func == spawn_link -> {As,Bs2} = expr_list(As0, Bs1, Lf), {value,{spawn_link,As},Bs2}; Func == spawn -> {As,Bs2} = expr_list(As0, Bs1, Lf), {value,{spawn,As},Bs2}; function(Func) -> {As,Bs2} = expr_list(As0, Bs1, Lf), {value,apply(Func, As),Bs2}; true -> case erl_internal:bif(Func, length(As0)) of true -> {As,Bs2} = expr_list(As0, Bs1, Lf), {value,bif(Func, As),Bs2}; false -> local_func(Func, As0, Bs1, Lf) end end; expr({'catch',_,Expr}, Bs0, Lf) -> Ref = make_ref(), case catch {Ref,expr(Expr, Bs0, Lf)} of {Ref,{value,Val,Bs}=Ret} -> %Nothing was thrown (guaranteed). Ret; Other -> {value,Other,Bs0} end; expr({match,_,Lhs,Rhs0}, Bs0, Lf) -> {value,Rhs,Bs1} = expr(Rhs0, Bs0, Lf), case match(Lhs, Rhs, Bs1) of {match,Bs} -> {value,Rhs,Bs}; nomatch -> exit({{badmatch,Rhs},[{?MODULE,expr,3}]}) end; expr({op,_,Op,A0}, Bs0, Lf) -> {value,A,Bs} = expr(A0, Bs0, Lf), {value,eval_op(Op, A),Bs}; expr({op,_,Op,L0,R0}, Bs0, Lf) -> {value,L,Bs1} = expr(L0, Bs0, Lf), {value,R,Bs2} = expr(R0, Bs0, Lf), {value,eval_op(Op, L, R),merge_bindings(Bs1, Bs2)}; expr({bin,_,Fs}, Bs0, Lf) -> eval_bits:expr_grp(Fs,Bs0, fun(E, B) -> expr(E, B, Lf) end, [], true); expr({remote,_,M,F}, Bs, Lf) -> exit({{badexpr,':'},[{?MODULE,expr,3}]}); expr({field,_,Rec,F}, Bs, Lf) -> exit({{badexpr, '.'},[{?MODULE,expr,3}]}); expr({value,_,Val}, Bs, Lf) -> %Special case straight values. {value,Val,Bs}. %% local_func(Function, Arguments, Bindings, LocalFuncHandler) -> %% {value,Value,Bindings} when %% LocalFuncHandler = {value,F}|{value,F,Eas}|{eval,F}|{eval,F,Eas}|none. local_func(Func, As0, Bs0, {value,F}) -> {As1,Bs1} = expr_list(As0, Bs0, {value,F}), % changed this % {value,apply(F, [Func,As1]),Bs1}; % to F(Func,As1,Bs1); local_func(Func, As0, Bs0, {value,F,Eas}) -> {As1,Bs1} = expr_list(As0, Bs0, {value,F,Eas}), {value,apply(F, [Func,As1|Eas]),Bs1}; local_func(Func, As, Bs, {eval,F}) -> apply(F, [Func,As,Bs]); local_func(Func, As, Bs, {eval,F,Eas}) -> apply(F, [Func,As,Bs|Eas]); %% These two clauses are for backwards compatibility. local_func(Func, As0, Bs0, {M,F}) -> {As1,Bs1} = expr_list(As0, Bs0, {M,F}), {value,apply(M, F, [Func,As1]),Bs1}; local_func(Func, As, Bs, {M,F,Eas}) -> apply(M, F, [Func,As|Eas]); %% Default unknown function handler to undefined function. local_func(Func, As0, Bs0, none) -> exit({undef,[{?MODULE,Func,length(As0)}]}). %% eval_lc(Expr, [Qualifier], Bindings, LocalFunctionHandler) -> %% {value,Value,Bindings}. %% This is evaluating list comprehensions "straight out of the book". eval_lc(E, Qs, Bs, Lf) -> {value,eval_lc1(E, Qs, Bs, Lf),Bs}. eval_lc1(E, [{generate,_,P,L0}|Qs], Bs0, Lf) -> {value,L1,Bs1} = expr(L0, Bs0, Lf), flatmap(fun (V) -> case match(P, V, new_bindings()) of {match,Bsn} -> Bs2 = add_bindings(Bsn, Bs1), eval_lc1(E, Qs, Bs2, Lf); nomatch -> [] end end, L1); eval_lc1(E, [F|Qs], Bs0, Lf) -> case erl_lint:is_guard_test(F) of true -> case guard_test(F, Bs0, Lf) of {value,true,Bs1} -> eval_lc1(E, Qs, Bs1, Lf); {value,false,Bs1} -> [] end; false -> case expr(F, Bs0, Lf) of {value,true,Bs1} -> eval_lc1(E, Qs, Bs1, Lf); {value,false,Bs1} -> []; Other -> exit({bad_filter,[{?MODULE,expr,3}]}) end end; eval_lc1(E, [], Bs, Lf) -> {value,V,_} = expr(E, Bs, Lf), [V]. %% eval_fun(Clauses, Arguments, Bindings, LocalFunctionHandler) -> %% Value eval_fun([{clause,L,H,G,B}|Cs], As, Bs0, Lf) -> case match_list(H, As, new_bindings()) of {match,Bsn} -> %The new bindings for the head Bs1 = add_bindings(Bsn, Bs0), % which then shadow! case guard(G, Bs1, Lf) of true -> {value,V,Bs2} = exprs(B, Bs1, Lf), V; false -> eval_fun(Cs, As, Bs0, Lf) end; nomatch -> eval_fun(Cs, As, Bs0, Lf) end; eval_fun([], As, Bs, Lf) -> exit({function_clause,[{?MODULE,'-inside-a-shell-fun-',As}, {?MODULE,expr,3}]}). %% expr_list(ExpressionList, Bindings) %% expr_list(ExpressionList, Bindings, LocalFuncHandler) %% Evaluate a list of expressions "in parallel" at the same level. expr_list(Es, Bs) -> expr_list(Es, [], Bs, Bs, none). expr_list(Es, Bs, Lf) -> expr_list(Es, [], Bs, Bs, Lf). expr_list([E|Es], Vs, BsOrig, Bs0, Lf) -> {value,V,Bs1} = expr(E, BsOrig, Lf), expr_list(Es, [V|Vs], BsOrig, merge_bindings(Bs1, Bs0), Lf); expr_list([], Vs, _, Bs, Lf) -> {reverse(Vs),Bs}. eval_op('*', A1, A2) -> A1 * A2; eval_op('/', A1, A2) -> A1 / A2; eval_op('+', A1, A2) -> A1 + A2; eval_op('-', A1, A2) -> A1 - A2; eval_op('div', A1, A2) -> A1 div A2; eval_op('rem', A1, A2) -> A1 rem A2; eval_op('band', A1, A2) -> A1 band A2; eval_op('bor', A1, A2) -> A1 bor A2; eval_op('bxor', A1, A2) -> A1 bxor A2; eval_op('bsl', A1, A2) -> A1 bsl A2; eval_op('bsr', A1, A2) -> A1 bsr A2; eval_op('<', E1, E2) -> E1 < E2; eval_op('=<', E1, E2) -> E1 =< E2; eval_op('>', E1, E2) -> E1 > E2; eval_op('>=', E1, E2) -> E1 >= E2; eval_op('==', E1, E2) -> E1 == E2; eval_op('/=', E1, E2) -> E1 /= E2; eval_op('=:=', E1, E2) -> E1 =:= E2; eval_op('=/=', E1, E2) -> E1 =/= E2; eval_op('and', E1, E2) -> E1 and E2; eval_op('or', E1, E2) -> E1 or E2; eval_op('xor', E1, E2) -> E1 xor E2; eval_op('++', A1, A2) -> A1 ++ A2; eval_op('--', A1, A2) -> A1 -- A2; eval_op('!', E1, E2) -> E1 ! E2. eval_op('+', A) -> A; eval_op('-', A) -> -A; eval_op('bnot', A) -> bnot A; eval_op('not', A) -> not A. %% bif(Name, Arguments) %% Evaluate the Erlang builtin function Name. N.B. Special case apply %% here, apply/2 needs to be explicit. bif(apply, [M,F,As]) -> apply(M, F, As); bif(apply, [F,As]) -> apply(F, As); bif(Name, As) -> apply(erlang, Name, As). %% if_clauses(Clauses, Bindings, LocalFuncHandler) if_clauses([{clause,_,[],G,B}|Cs], Bs, Lf) -> case guard(G, Bs, Lf) of true -> exprs(B, Bs, Lf); false -> if_clauses(Cs, Bs, Lf) end; if_clauses([], Bs, Lf) -> exit({if_clause,[{?MODULE,expr,3}]}). %% case_clauses(Value, Clauses, Bindings, LocalFuncHandler) case_clauses(Val, Cs, Bs, Lf) -> case match_clause(Cs, Val, Bs, Lf) of {B, Bs1} -> exprs(B, Bs1, Lf); nomatch -> exit({{case_clause,Val},[{?MODULE,expr,3}]}) end. %% %% receive(Clauses, Bindings, LocalFuncHandler, Messages) %% receive_clauses(Cs, Bs, Lf, Ms) -> receive Val -> case match_clause(Cs, Val, Bs, Lf) of {B, Bs1} -> merge_queue(Ms), exprs(B, Bs1, Lf); nomatch -> receive_clauses(Cs, Bs, Lf, [Val|Ms]) end end. %% %% receive_clauses(TimeOut, Clauses, TimeoutBody, Bindings, LocalFuncHandler) %% receive_clauses(T, Cs, TB, Bs, Lf, Ms) -> {_,_} = statistics(runtime), receive Val -> case match_clause(Cs, Val, Bs, Lf) of {B, Bs1} -> merge_queue(Ms), exprs(B, Bs1, Lf); nomatch -> {_,T1} = statistics(runtime), if T == infinity -> receive_clauses(T, Cs, TB, Bs, Lf, [Val|Ms]); T-T1 =< 0 -> receive_clauses(0, Cs, TB, Bs, Lf, [Val|Ms]); true -> receive_clauses(T-T1, Cs, TB, Bs, Lf, [Val|Ms]) end end after T -> merge_queue(Ms), {B, Bs1} = TB, exprs(B, Bs1, Lf) end. merge_queue(Ms) -> send_all(recv_all(Ms), self()). recv_all(Xs) -> receive X -> recv_all([X|Xs]) after 0 -> reverse(Xs) end. send_all([X|Xs], Self) -> Self ! X, send_all(Xs, Self); send_all([], _) -> true. %% match_clause -> {Body, Bindings} or nomatch match_clause([{clause,_,[P],G,B}|Cs], Val, Bs, Lf) -> case match(P, Val, Bs) of {match, Bs1} -> case guard(G, Bs1, Lf) of true -> {B, Bs1}; false -> match_clause(Cs, Val, Bs, Lf) end; nomatch -> match_clause(Cs, Val, Bs, Lf) end; match_clause([], _, _, _) -> nomatch. %% guard(GuardTests, Bindings, LocalFuncHandler) -> true | false. %% Evaluate a guard. We test if the guard is a true guard. guard(L=[G|_], Bs0, Lf) when list(G) -> guard1(L, Bs0, Lf); guard(L, Bs0, Lf) -> guard0(L, Bs0, Lf). %% disjunction of guard conjunctions guard1([G|Gs], Bs0, Lf) when list(G) -> case guard0(G, Bs0, Lf) of true -> true; false -> guard1(Gs, Bs0, Lf) end; guard1([], Bs, Lf) -> false. %% guard conjunction guard0([G|Gs], Bs0, Lf) -> case erl_lint:is_guard_test(G) of true -> case guard_test(G, Bs0, Lf) of {value,true,Bs} -> guard0(Gs, Bs, Lf); {value,false,Bs} -> false end; false -> exit({guard_expr,[{?MODULE,expr,3}]}) end; guard0([], Bs, Lf) -> true. %% guard_test(GuardTest, Bindings, LocalFuncHandler) -> %% {value,bool(),NewBindings}. %% Evaluate one guard test. This should never fail, just return true %% or false. We DEMAND that this is valid guard test. guard_test({call,_,{atom,_,Name},As0}, Bs0, Lf) -> case catch expr_list(As0, Bs0, Lf) of {As1,Bs1} -> {value,type_test(Name, As1),Bs1}; Other -> {value,false,Bs0} end; guard_test({op,_,Op,Lhs0,Rhs0}, Bs0, Lf) -> case catch begin {[Lhs,Rhs],Bs1} = expr_list([Lhs0,Rhs0], Bs0, Lf), {value,eval_op(Op, Lhs, Rhs),Bs1} end of {value,Bool,Bs2} -> {value,Bool,Bs2}; Other -> {value,false,Bs0} end; guard_test({atom,_,true}, Bs, Lf) -> {value,true,Bs}. type_test(integer, [A]) when integer(A) -> true; type_test(float, [A]) when float(A) -> true; type_test(number, [A]) when number(A) -> true; type_test(atom, [A]) when atom(A) -> true; type_test(constant, [A]) when constant(A) -> true; type_test(list, [A]) when list(A) -> true; type_test(tuple, [A]) when tuple(A) -> true; type_test(pid, [A]) when pid(A) -> true; type_test(reference, [A]) when reference(A) -> true; type_test(port, [A]) when port(A) -> true; type_test(record, [R,A]) when atom(R), element(1, A) == R -> true; type_test(function, [A]) when function(A) -> true; type_test(binary, [A]) when binary(A) -> true; type_test(_, _) -> false. %% match(Pattern, Term, Bindings) -> %% {match,NewBindings} | nomatch %% Try to match Pattern against Term with the current bindings. match(Pat, Term, Bs) -> %io:format("match ~p ~p (~p)~n",[Pat,Term,Bs]), catch match1(Pat, Term, Bs). string_to_conses([], Line, Tail) -> Tail; string_to_conses([E|Rest], Line, Tail) -> {cons, Line, {integer, Line, E}, string_to_conses(Rest, Line, Tail)}. match1({atom,_,A}, A, Bs) -> {match,Bs}; match1({integer,_,I}, I, Bs) -> {match,Bs}; match1({float,_,F}, F, Bs) -> {match,Bs}; match1({char,_,C}, C, Bs) -> {match,Bs}; match1({var,_,'_'}, _, Bs) -> %Anonymous variable matches {match,Bs}; % everything, no new bindings match1({var,_,Name}, Term, Bs) -> case binding(Name, Bs) of {value,Term} -> {match,Bs}; {value,V} -> throw(nomatch); unbound -> {match,add_binding(Name, Term, Bs)} end; match1({match,Line,Pat1,Pat2}, Term, Bs0) -> {match, Bs1} = match1(Pat1, Term, Bs0), match1(Pat2, Term, Bs1); match1({string,_,S}, S, Bs) -> {match,Bs}; match1({nil,_}, [], Bs) -> {match,Bs}; match1({cons,_,H,T}, [H1|T1], Bs0) -> {match,Bs} = match1(H, H1, Bs0), match1(T, T1, Bs); match1({tuple,_,Elts}, Tuple, Bs) when length(Elts) == size(Tuple) -> match_tuple(Elts, Tuple, 1, Bs); match1({bin, _, Fs}, B, Bs0) when binary(B) -> eval_bits:match_bits(Fs, B, Bs0, fun(L, R, Bs) -> match1(L, R, Bs) end, fun(E, Bs) -> expr(E, Bs, none) end, true); match1({op,Line,'++',{nil,_},R}, Term, Bs) -> match1(R, Term, Bs); match1({op,_,'++',{cons,Li,{integer,L2,I},T},R}, Term, Bs) -> match1({cons,Li,{integer,L2,I},{op,Li,'++',T,R}}, Term, Bs); match1({op,_,'++',{string,Li,L},R}, Term, Bs) -> match1(string_to_conses(L, Li, R), Term, Bs); match1({op,Line,Op,A}, Term, Bs) -> case partial_eval({op,Line,Op,A}) of {op,Line,Op,A} -> throw(nomatch); X -> match1(X, Term, Bs) end; match1({op,Line,Op,L,R}, Term, Bs) -> case partial_eval({op,Line,Op,L,R}) of {op,Line,Op,L,R} -> throw(nomatch); X -> match1(X, Term, Bs) end; match1(_, _, _) -> throw(nomatch). match_tuple([E|Es], Tuple, I, Bs0) -> {match,Bs} = match1(E, element(I, Tuple), Bs0), match_tuple(Es, Tuple, I+1, Bs); match_tuple([], _, _, Bs) -> {match,Bs}. %% match_list(PatternList, TermList, Bindings) -> %% {match,NewBindings} | nomatch %% Try to match a list of patterns against a list of terms with the %% current bindings. match_list(Ps, Ts, Bs) -> catch match_list1(Ps, Ts, Bs). match_list1([P|Ps], [T|Ts], Bs0) -> case match(P, T, Bs0) of {match,Bs1} -> match_list1(Ps, Ts, Bs1); nomatch -> throw(nomatch) end; match_list1([], [], Bs) -> {match,Bs}. %% new_bindings() %% bindings(Bindings) %% binding(Name, Bindings) %% add_binding(Name, Value, Bindings) %% del_binding(Name, Bindings) new_bindings() -> orddict:new(). bindings(Bs) -> orddict:dict_to_list(Bs). binding(Name, Bs) -> case orddict:find(Name, Bs) of {ok,Val} -> {value,Val}; error -> unbound end. add_binding(Name, Val, Bs) -> orddict:store(Name, Val, Bs). del_binding(Name, Bs) -> orddict:erase(Name, Bs). add_bindings(Bs1, Bs2) -> foldl(fun ({Name,Val}, Bs) -> orddict:store(Name, Val, Bs) end, Bs2, orddict:dict_to_list(Bs1)). merge_bindings(Bs1, Bs2) -> foldl(fun ({Name,Val}, Bs) -> case orddict:find(Name, Bs) of {ok,Val} -> Bs; %Already with SAME value {ok,V1} -> exit({{badmatch,V1},[{?MODULE,expr,3}]}); error -> orddict:store(Name, Val, Bs) end end, Bs2, orddict:dict_to_list(Bs1)). %%---------------------------------------------------------------------------- %% %% Evaluate expressions: %% constants and %% op A %% L op R %% Things that evaluate to constants are accepted %% and guard_bifs are allowed in constant expressions %%---------------------------------------------------------------------------- is_constant_expr(Expr) -> case eval_expr(Expr) of {ok, X} when number(X) -> true; _ -> false end. eval_expr(Expr) -> case catch ev_expr(Expr) of X when integer(X) -> {ok, X}; X when float(X) -> {ok, X}; X when atom(X) -> {ok,X}; {'EXIT',Reason} -> {error, Reason}; _ -> {error, badarg} end. partial_eval(Expr) -> Line = line(Expr), case catch ev_expr(Expr) of X when integer(X) -> ret_expr(Expr,{integer,Line,X}); X when float(X) -> ret_expr(Expr,{float,Line,X}); X when atom(X) -> ret_expr(Expr,{atom,Line,X}); _ -> Expr end. ev_expr({op,Ln,Op,L,R}) -> eval(Op, ev_expr(L), ev_expr(R)); ev_expr({op,Ln,Op,A}) -> eval(Op, ev_expr(A)); ev_expr({integer,_,X}) -> X; ev_expr({float,_,X}) -> X; ev_expr({atom,_,X}) -> X; ev_expr({tuple,_,Es}) -> list_to_tuple(lists:map(fun(X) -> ev_expr(X) end, Es)); ev_expr({nil,_}) -> []; ev_expr({cons,_,H,T}) -> [ev_expr(H) | ev_expr(T)]. %ev_expr({call,Line,{atom,_,F},As}) -> % true = erl_internal:guard_bif(F, length(As)), % apply(erlang, F, lists:map(fun(X) -> ev_expr(X) end, As)); %ev_expr({call,Line,{remote,_,{atom,_,erlang},{atom,_,F}},As}) -> % true = erl_internal:guard_bif(F, length(As)), % apply(erlang, F, lists:map(fun(X) -> ev_expr(X) end, As)). %% (we can use 'apply' here now, instead of enumerating the operators) eval('+', X, Y) -> X + Y; eval('-', X, Y) -> X - Y; eval('*', X, Y) -> X * Y; eval('/', X, Y) -> X / Y; eval('div', X, Y) -> X div Y; eval('rem', X, Y) -> X rem Y; eval('band', X, Y) -> X band Y; eval('bor', X, Y) -> X bor Y; eval('bxor', X, Y) -> X bxor Y; eval('bsl', X, Y) -> X bsl Y; eval('bsr', X, Y) -> X bsr Y; eval('and', X, Y) -> X and Y; eval('or', X, Y) -> X or Y; eval('xor', X, Y) -> X xor Y; eval('==', X, Y) -> X == Y; eval('/=', X, Y) -> X /= Y; eval('=<', X, Y) -> X =< Y; eval('<', X, Y) -> X < Y; eval('>=', X, Y) -> X >= Y; eval('>', X, Y) -> X > Y; eval('=:=', X, Y) -> X =:= Y; eval('=/=', X, Y) -> X =/= Y; eval('++', X, Y) -> X ++ Y; eval('--', X, Y) -> X -- Y. eval('+', X) -> 0 + X; eval('-', X) -> 0 - X; eval('bnot', X) -> bnot X; eval('not', X) -> not X. ret_expr(Old, New) -> %% io:format("~w: reduced ~s => ~s~n", %% [line(Old), erl_pp:expr(Old), erl_pp:expr(New)]), New. line(Expr) -> element(2, Expr). -------------- next part -------------- % Visualisation of the supervision tree % % Thomas Arts % November 2000 % Modified June 2001 -module(visualize). -export([supervisor/3, callback/1, callback/2]). -include("gd.hrl"). -import(lists,[foldr/3]). supervisor(Mod,Func,Args) -> SupervisorStruct = app:nonapp(Mod,Func,Args), gdtop:supertree({?MODULE,callback}, SupervisorStruct). vertices({supervisor,Name,{error,Reason}},Path) -> [{Name,error,Path}]; vertices({supervisor,Name,Children},Path) -> {Vertices,_} = foldr(fun(Child,{Vs,N}) -> {vertices(Child,Path++[N])++Vs,N+1} end,{[],1},Children), [{Name,supervisor,Path}|Vertices]; vertices({_,Name,{error,Reason}},Path) -> [{Name,error,Path}]; vertices({_,Name,{_,_,Behaviour,_}},Path) -> [{Name,Behaviour,Path}]. edges([]) -> []; edges([{N1,T1,P1}|Vs]) -> [{{N1,T1,P1},{N2,T2,P2}} || {N2,T2,P2}<-Vs, prefix(P1,P2)]++ edges(Vs). prefix([],[N]) -> true; prefix([N|Ns],[N|Ms]) -> prefix(Ns,Ms); prefix(_,_) -> false. %get_name([],SuperTree) -> % atom_to_list(element(2,SuperTree)); %get_name([N|Ns],{supervisor,_,Children}) -> % % here the node must be a supervisor node % get_name(Ns,lists:nth(N,Children)). %%------------------------------------------------------------- callback(graph,SuperTree) -> Vertices = (catch vertices(SuperTree,[])), {#gd_graph{directed=false, cyclic=false, vertices=Vertices, start_vertices=[hd(Vertices)], edges=edges(Vertices) }, SuperTree}; callback({name_string,{Name,Type,Path}},SuperTree) -> {io_lib:format(" ~p ~n~n ~p ",[Name,Type]),SuperTree}; callback({shape,{Name,Type,Path}},SuperTree) -> case Type of supervisor -> {rectangle,SuperTree}; _ -> {oval,SuperTree} end. callback({click,node,Node}) -> io:format("clicked ~p~n",[Node]); callback({select_node_attributes,Node}) -> [{fg,red}]; callback({old_node_attributes,{_,supervisor,_}}) -> [{fill,lightblue}]; callback({old_node_attributes,{_,error,_}}) -> [{fill,red}]; callback({old_node_attributes,{_,gen_server,_}}) -> [{fill,yellow}]; callback({old_node_attributes,{_,gen_fsm,_}}) -> [{fill,yellow}]; callback({old_node_attributes,{_,gen_event,_}}) -> [{fill,lightyellow}]; callback({old_node_attributes,{_,Worker,_}}) -> [{fill,white}]; callback({new_node_attributes,_}) -> [{fill,white}]. From jrespino@REDACTED Thu Feb 7 07:44:20 2002 From: jrespino@REDACTED (Jose Espino) Date: Thu, 07 Feb 2002 00:44:20 -0600 Subject: Erlang and US Department of Defense (DoD) High Level Architecture (HLA) Message-ID: Hello All: Does any have any information on the in regards to Erlang interoperating with the US Departmement of Defense (DoD) High Level Architecture (HLA)? Best Regards, Jose _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx From lennart.ohman@REDACTED Thu Feb 7 10:26:03 2002 From: lennart.ohman@REDACTED (Lennart =?iso-8859-1?Q?=D6hman?=) Date: Thu, 07 Feb 2002 10:26:03 +0100 Subject: Erlang and US Department of Defense (DoD) High Level Architecture (HLA) References: Message-ID: <3C62482B.B3610080@st.se> Hi, we work with both Erlang and HLA (not necessarily in conjuction, but). Any particular aspect of your question? /Lennart Jose Espino wrote: > > Hello All: > > Does any have any information on the in regards to Erlang interoperating > with the US Departmement of Defense (DoD) High Level Architecture (HLA)? > > Best Regards, > > Jose > > _________________________________________________________________ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx ------------------------------------------------------------- Lennart Ohman phone : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 6735 Sehlstedtsgatan 6 fax : +46-8-667 8230 SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED From cvrincea@REDACTED Thu Feb 7 18:28:27 2002 From: cvrincea@REDACTED (Costel Vrinceanu) Date: Thu, 7 Feb 2002 09:28:27 -0800 (PST) Subject: Threaded-code Message-ID: <200202071728.g17HSR221774@saga.vc.intel.com> Can someone explain what does 'threaded' in 'threaded-code emulation' mean? I understand that the generated byte-code is modified when loaded in the emulator, but what/why 'threaded'? Also, the BEAM spec says: "The BEAM system allows mixing threaded code emulation with compiling into C" Does this mean there is a mechanism other than BIFs for alternating execution of BEAM instruction with execution of C functions/code segments? Thanks From happi@REDACTED Thu Feb 7 20:00:03 2002 From: happi@REDACTED (Happi) Date: Thu, 7 Feb 2002 20:00:03 +0100 Subject: Threaded-code References: <200202071728.g17HSR221774@saga.vc.intel.com> Message-ID: <017a01c1b009$a6eba5a0$c90b0a0a@LISA> ----- Original Message ----- From: "Costel Vrinceanu" > Can someone explain what does 'threaded' in 'threaded-code emulation' mean? Kent Boortz once wrote an explanation of threaded code: http://www-lp.doc.ic.ac.uk/UserPages/staff/ft/alp/net/impl/emulate.html Basically, with directly threaded code each beam instruction is a pointer to the C code in the emulator implementing that instruction. The emulator reads the instruction and jumps to that address. > I understand that the generated byte-code is modified when loaded in the > emulator, but what/why 'threaded'? The beam loader replaces each "external beam instruction" (instruction in the beam file) with a pointer to code that implements the instruction. (In fact the loader is much more complicated than that, the mapping from external instructions to code in the emulator is not one-to-one, some instructions are merged and other split.) The reason is speed, you minimize the overhead of instruction dispatch by having direct code pointers. > Also, the BEAM spec says: > "The BEAM system allows mixing threaded code emulation with compiling into C" This is probably from a very old BEAM spec. When BEAM was introduced you could compile Erlang code to native code via C and link this to the BEAM emulator. This feature is long gone by now. Fortunately the HiPE compiler is integrated into the Open Source (BEAM) Erlang system. With HiPE you can compile Erlang to native code on SPARC and X86 and execute this together with native code. > Does this mean there is a mechanism other than BIFs for alternating execution > of BEAM instruction with execution of C functions/code segments? Yes, (well I'm not sure that sentence meant that, but you can do it anyway) see the discussion in this thread: http://www.erlang.org/ml-archive/erlang-questions/200202/msg00000.html You can for example use ports, linked in drivers, or BIFs. /Erik From eedfang@REDACTED Fri Feb 8 09:54:48 2002 From: eedfang@REDACTED (Faustin Ngokse) Date: Fri, 8 Feb 2002 09:54:48 +0100 (MET) Subject: How to 'bypass' the receive timer Message-ID: <200202080854.JAA09799@meto71.eed.ericsson.se> Hello erlang friends, This is my first contribution on this mailing list, I guess I am at the right place. I have an erlang process working as server and receiving a lot of messages. Some messages trigger further "receive" with a timer to prevent the process from waiting undefinetely. It often happens that the messages destinated to the 'external' receive can't be delivered because the timer for the 'internal' receiver is not yet over. This make my server process very very slow. Is there a possibility to influence the message so that messages for the 'external' receive can be delivered while the 'internal' receive is still waiting? Do anybody have another idea how to solve this problem? Thanx in advance Faustin From thomas.lindgren@REDACTED Fri Feb 8 09:59:55 2002 From: thomas.lindgren@REDACTED (Thomas Lindgren) Date: Fri, 8 Feb 2002 09:59:55 +0100 Subject: Threaded-code In-Reply-To: <200202071728.g17HSR221774@saga.vc.intel.com> Message-ID: > Can someone explain what does 'threaded' in 'threaded-code emulation' mean? Threaded code roughly means each emulator instruction jumps directly to the next, rather than going via an interpreter loop. Cf. J. R. Bell, Threaded code, CACM, 16, 370-372 (1973). -- Thomas From vlad_dumitrescu@REDACTED Fri Feb 8 13:12:17 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 08 Feb 2002 13:12:17 +0100 Subject: any news about EOL? Message-ID: Hi! I guess this should have gone to Joe Armstrong directly. Are there any news from the Erlang OnLine project? The (old) bluetail page hasn't been updated in ages... While I am still here, are the wiki and pico modules still at versions 14.0 and respectively 11.0? best regards, Vlad _________________________________________________________________ H?mta MSN Explorer kostnadsfritt p? http://explorer.msn.se/intl.asp. From etxuwig@REDACTED Fri Feb 8 15:26:56 2002 From: etxuwig@REDACTED (Ulf Wiger) Date: Fri, 8 Feb 2002 15:26:56 +0100 (MET) Subject: How to 'bypass' the receive timer In-Reply-To: <200202080854.JAA09799@meto71.eed.ericsson.se> Message-ID: On Fri, 8 Feb 2002, Faustin Ngokse wrote: >Hello erlang friends, > >This is my first contribution on this mailing list, I guess I >am at the right place. >I have an erlang process working as server and receiving a lot >of messages. Some messages trigger further "receive" with a >timer to prevent the process from waiting undefinetely. >It often happens that the messages destinated to the 'external' >receive can't be delivered because the timer for the 'internal' >receiver is not yet over. This make my server process very very >slow. >Is there a possibility to influence the message so that >messages for the 'external' receive can be delivered while the >'internal' receive is still waiting? >Do anybody have another idea how to solve this problem? I am not altogether sure that I understand your problem correctly. Basically, your server tends to get stuck in blocking receive while servicing client requests, right? If so, there are a couple of ways to address the problem: - Have the server spawn a request thread for each incoming request, or at least those requests that might take a long time. The OTP rpc.erl module is implemented this way. You may want to think about partitioning your server state if the request threads need to share state. I have a fairly clean example of how to do this that I may post shortly. ;) - Keep a 'pending' list where you can save the request, and convert the blocking operations on the server side to non- blocking. This can get a bit envolved. Below is a simplified example, which makes some assumptions, and doesn't handle error conditions. handle_call({...} = Req, Ref, State) -> Sofar = ..., NewState = non_blocking_call(OtherServer, MyReq, Ref, Req, Sofar, State), {noreply, NewState}. handle_cast({nb_reply, Ref, Reply}, #state{pending = Pending} = State0) -> {value, {Ref, Sofar, ClientReq}} = lists:keysearch(Ref, 1, Pending), State1 = State#state{pending = lists:keydelete( Ref, 1, Pending), {Reply, State2} = finish_request(ClientReq, Sofar, State1), {reply, Reply, State2}. non_blocking_call(Server, Req, Ref, ClientReq, Sofar, #state{pending = Pending} = State) -> gen_server:cast(Server, {nb_req, self(), From, Req}), State#state{pending = [{Ref, Sofar, ClientReq}|Pending]}. /Uffe From lennart.ohman@REDACTED Fri Feb 8 15:35:09 2002 From: lennart.ohman@REDACTED (Lennart =?iso-8859-1?Q?=D6hman?=) Date: Fri, 08 Feb 2002 15:35:09 +0100 Subject: How to 'bypass' the receive timer References: <200202080854.JAA09799@meto71.eed.ericsson.se> Message-ID: <3C63E21D.F7E00A91@st.se> Hi Faustin, it sounds to me that what you want to do is to start a set a timer in the timer process for each handled message which will be followed by a second message. Look in stdlib for timer. timer:send_after(Time,MessageIWillGetBack) for instance. If you get the expected message you either cancel the time-out or program in a way that you can ignore it when it eventually arrives. I guess the reason for going to a special receive statment (having the time-out) is that you need to handled the second message in a context dictated by the previous. You will achieve this by letting the tail-recursive function having the main receive statment have an argument where such relevant parameters for that context can be kept. /Lennart Faustin Ngokse wrote: > > Hello erlang friends, > > This is my first contribution on this mailing list, I guess I am at the right > place. > I have an erlang process working as server and receiving a lot of messages. > Some messages trigger further "receive" with a timer to prevent the process from > waiting undefinetely. > It often happens that the messages destinated to the 'external' receive can't be > delivered because the timer for the 'internal' receiver is not yet over. > This make my server process very very slow. > Is there a possibility to influence the message so that messages for the > 'external' receive can be delivered while the 'internal' receive is still > waiting? > Do anybody have another idea how to solve this problem? > > Thanx in advance > > Faustin -- ------------------------------------------------------------- Lennart Ohman phone : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 6735 Sehlstedtsgatan 6 fax : +46-8-667 8230 SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED From garry@REDACTED Fri Feb 8 16:10:55 2002 From: garry@REDACTED (Garry Hodgson) Date: Fri, 08 Feb 2002 10:10:55 -0500 Subject: xmlrpc in erlang? Message-ID: <3C63EA7F.3AAB3F1F@sage.att.com> has anyone done anything like an xmlrpc server in erlang? it looks like i could use xmerl to parse requests, and formatting responses should be straightforward. i just wondered if it's already been done. -- Garry Hodgson Let my inspiration flow Senior Hacker in token rhyme suggesting rhythm Software Innovation Services that will not forsake me AT&T Labs 'til my tale is told and done. garry@REDACTED From taavi@REDACTED Fri Feb 8 16:12:51 2002 From: taavi@REDACTED (Taavi Talvik) Date: Fri, 8 Feb 2002 17:12:51 +0200 (EET) Subject: How to 'bypass' the receive timer In-Reply-To: <3C63E21D.F7E00A91@st.se> Message-ID: <20020208165453.X53751-100000@valu.uninet.ee> On Fri, 8 Feb 2002, Lennart ?hman wrote: Probably easiest is to use gen_server model and remember running timers somewhere (ets tabel) a'la: handle_call({do_something_useful, Params}, From, State )-> do_something_useful, {ok, Tref} = timer:send_after(?TIMEOUT_VALUE,self(),{timeout,State#state.seq_no}, ets:insert(State#state.timers, {State#state.seq_no, Tref}), Seq = State#state.seq + 1, {reply, Reply, State#state{seq_no=Seq}); handle_info({normal_answer, Seq_no}, State) -> [{_,Tref}] = ets:lookup(State#state.timers, Seq_no), ets:delete(State#state.timers,Seq_no), {ok, cancel} = timer:cancel(Tref), do_something_useful, {noreply, State}; handle_info({timeout,Seq_no}, State) -> [{_,Tref}] = ets:lookup(State#state.timers, Seq_no), ets:delete(State#state.timers,Seq_no), do_something_useful, {noreply,State}; best regards, taavi > it sounds to me that what you want to do is to start a set a timer > in the timer process for each handled message which will be followed by > a second message. Look in stdlib for timer. > timer:send_after(Time,MessageIWillGetBack) for instance. If you get the > expected message you either cancel the time-out or program in a way that > you can ignore it when it eventually arrives. > > I guess the reason for going to a special receive statment (having the > time-out) is that you need to handled the second message in a context > dictated by the previous. > > You will achieve this by letting the tail-recursive function having the > main receive statment have an argument where such relevant parameters > for that context can be kept. > > Faustin Ngokse wrote: > > > > Hello erlang friends, > > > > This is my first contribution on this mailing list, I guess I am at the right > > place. > > I have an erlang process working as server and receiving a lot of messages. > > Some messages trigger further "receive" with a timer to prevent the process from > > waiting undefinetely. > > It often happens that the messages destinated to the 'external' receive can't be > > delivered because the timer for the 'internal' receiver is not yet over. > > This make my server process very very slow. > > Is there a possibility to influence the message so that messages for the > > 'external' receive can be delivered while the 'internal' receive is still > > waiting? > > Do anybody have another idea how to solve this problem? > > > > Thanx in advance > > > > Faustin > > -- > ------------------------------------------------------------- > Lennart Ohman phone : +46-8-587 623 27 > Sjoland & Thyselius Telecom AB cellular: +46-70-552 6735 > Sehlstedtsgatan 6 fax : +46-8-667 8230 > SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > ----------------------------------------------------------- Taavi Talvik | Internet: taavi@REDACTED AS Uninet | phone: +372 6800013 Parnu mnt. 105 | fax: +372 6800001 Tallinn 11312, Estonia | gsm: +372 56569996 From eedfang@REDACTED Fri Feb 8 16:27:57 2002 From: eedfang@REDACTED (Faustin Ngokse) Date: Fri, 8 Feb 2002 16:27:57 +0100 (MET) Subject: How to 'bypass' the receive timer Message-ID: <200202081527.QAA10595@meto71.eed.ericsson.se> Hi Lennart, Thanx for your hint; that sounds promising. I'll go for that and I think all will work fine. thanks again; CU ///Faustin > Date: Fri, 08 Feb 2002 15:35:09 +0100 > From: Lennart ?hman > X-Accept-Language: en > MIME-Version: 1.0 > To: Faustin Ngokse > CC: erlang-questions@REDACTED > Subject: Re: How to 'bypass' the receive timer > Content-Transfer-Encoding: 7bit > > Hi Faustin, > > it sounds to me that what you want to do is to start a set a timer > in the timer process for each handled message which will be followed by > a second message. Look in stdlib for timer. > timer:send_after(Time,MessageIWillGetBack) for instance. If you get the > expected message you either cancel the time-out or program in a way that > you can ignore it when it eventually arrives. > > I guess the reason for going to a special receive statment (having the > time-out) is that you need to handled the second message in a context > dictated by the previous. > > You will achieve this by letting the tail-recursive function having the > main receive statment have an argument where such relevant parameters > for that context can be kept. > > /Lennart > > > Faustin Ngokse wrote: > > > > Hello erlang friends, > > > > This is my first contribution on this mailing list, I guess I am at the right > > place. > > I have an erlang process working as server and receiving a lot of messages. > > Some messages trigger further "receive" with a timer to prevent the process from > > waiting undefinetely. > > It often happens that the messages destinated to the 'external' receive can't be > > delivered because the timer for the 'internal' receiver is not yet over. > > This make my server process very very slow. > > Is there a possibility to influence the message so that messages for the > > 'external' receive can be delivered while the 'internal' receive is still > > waiting? > > Do anybody have another idea how to solve this problem? > > > > Thanx in advance > > > > Faustin > > -- > ------------------------------------------------------------- > Lennart Ohman phone : +46-8-587 623 27 > Sjoland & Thyselius Telecom AB cellular: +46-70-552 6735 > Sehlstedtsgatan 6 fax : +46-8-667 8230 > SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED From etxuwig@REDACTED Fri Feb 8 16:33:54 2002 From: etxuwig@REDACTED (Ulf Wiger) Date: Fri, 8 Feb 2002 16:33:54 +0100 (MET) Subject: How to 'bypass' the receive timer In-Reply-To: <200202081527.QAA10595@meto71.eed.ericsson.se> Message-ID: Oh, but please use erlang:start_timer(Time, self(), Msg) instead. The timer module is not especially efficient. /Uffe On Fri, 8 Feb 2002, Faustin Ngokse wrote: >Hi Lennart, > >Thanx for your hint; that sounds promising. >I'll go for that and I think all will work fine. >thanks again; > >CU > >///Faustin > > >> Date: Fri, 08 Feb 2002 15:35:09 +0100 >> From: Lennart ?hman >> X-Accept-Language: en >> MIME-Version: 1.0 >> To: Faustin Ngokse >> CC: erlang-questions@REDACTED >> Subject: Re: How to 'bypass' the receive timer >> Content-Transfer-Encoding: 7bit >> >> Hi Faustin, >> >> it sounds to me that what you want to do is to start a set a timer >> in the timer process for each handled message which will be followed by >> a second message. Look in stdlib for timer. >> timer:send_after(Time,MessageIWillGetBack) for instance. If you get the >> expected message you either cancel the time-out or program in a way that >> you can ignore it when it eventually arrives. >> >> I guess the reason for going to a special receive statment (having the >> time-out) is that you need to handled the second message in a context >> dictated by the previous. >> >> You will achieve this by letting the tail-recursive function having the >> main receive statment have an argument where such relevant parameters >> for that context can be kept. >> >> /Lennart >> >> >> Faustin Ngokse wrote: >> > >> > Hello erlang friends, >> > >> > This is my first contribution on this mailing list, I guess I am at the >right >> > place. >> > I have an erlang process working as server and receiving a lot of messages. >> > Some messages trigger further "receive" with a timer to prevent the process >from >> > waiting undefinetely. >> > It often happens that the messages destinated to the 'external' receive >can't be >> > delivered because the timer for the 'internal' receiver is not yet over. >> > This make my server process very very slow. >> > Is there a possibility to influence the message so that messages for the >> > 'external' receive can be delivered while the 'internal' receive is still >> > waiting? >> > Do anybody have another idea how to solve this problem? >> > >> > Thanx in advance >> > >> > Faustin >> >> -- >> ------------------------------------------------------------- >> Lennart Ohman phone : +46-8-587 623 27 >> Sjoland & Thyselius Telecom AB cellular: +46-70-552 6735 >> Sehlstedtsgatan 6 fax : +46-8-667 8230 >> SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED > > From per@REDACTED Sun Feb 10 08:43:37 2002 From: per@REDACTED (Per Bergqvist) Date: Sun, 10 Feb 2002 08:43:37 +0100 Subject: How to 'bypass' the receive timer In-Reply-To: <3C63E21D.F7E00A91@st.se> Message-ID: <200202100743.g1A7hb627659@vargen.levonline.com> Lennart Ohman wrote: > it sounds to me that what you want to do is to start a set a timer > in the timer process for each handled message which will be followed by > a second message. Look in stdlib for timer. > timer:send_after(Time,MessageIWillGetBack) for instance. If you get the Note that timer:send_after does not scale well. It will give you problems if you have many concurrent sessions. Use erlang:start_timer instead. In my opinion the only meaningful function in the timer module is exit_after. At least I view the other functions as backward compatibility code, and try to avoid use the timer module. /Per From vlad_dumitrescu@REDACTED Sun Feb 10 12:51:47 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Sun, 10 Feb 2002 12:51:47 +0100 Subject: TCP traffic Message-ID: Hello again, I am not very knowledgeable with TCP/IP, so please forgive me if this is a FAQ. I have an application where I'd like to be able to throttle the traffic, by limiting the bandwidth for each connection. I know there are programs doing that, what I wonder is: is is a socket or low-level TCP/IP thing, or is it the application that does it? In case of the latter, how would I do that with Erlang? Thanks in advance. Regards, Vlad From enano@REDACTED Sun Feb 10 22:31:21 2002 From: enano@REDACTED (Miguel Barreiro Paz) Date: Sun, 10 Feb 2002 22:31:21 +0100 (CET) Subject: TCP traffic In-Reply-To: Message-ID: Hi, > I have an application where I'd like to be able to throttle the traffic, by > limiting the bandwidth for each connection. I know there are programs doing > that, what I wonder is: is is a socket or low-level TCP/IP thing, or is it > the application that does it? In case of the latter, how would I do that > with Erlang? TCP has flow control mechanisms built-in. As long as you don't explicitly receive data (ie., until you eval a gen_tcp:recv(), assuming it was opened as passive), the remote end won't be able to send any more data. Being a little more precise, the remote end will only be able to send _a little_ more data - the amount that fits in the OS kernel buffer for that socket. If the OS is Linux, it's what /proc/sys/net/core/rmem_default says, 64KB by default (settable). For Solaris, 'ndd /dev/tcp tcp_recv_hiwat', if memory serves. You can change it for your open socket with a setsockopt call. Regards, Miguel From pjs@REDACTED Mon Feb 11 01:32:42 2002 From: pjs@REDACTED (Peter Stuckey) Date: Mon, 11 Feb 2002 11:32:42 +1100 Subject: ICLP02 FINAL CALL FOR PAPERS Message-ID: <26117.1013387562.1@muldi.cs.mu.oz.au> ------- Blind-Carbon-Copy X-Mailer: exmh version 2.5 10/15/1999 with version: MH 6.8.4 #1[UCI] To: pjs Subject: ICLP02 FINAL CALL FOR PAPERS Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 11 Feb 2002 11:32:42 +1100 Message-ID: <26117.1013387562@REDACTED> From: Peter Stuckey Apologies for Receiving Multiple Copies of this Message - ---------------------------------------------------------- FINAL CALL FOR PAPERS ICLP'02 Eighteenth International Conference on Logic Programming Copenhagen, Denmark July 29th - August 1, 2002 http://floc02.diku.dk/ICLP/ ICLP'02, the Eighteenth International Conference on Logic Programming will be be held this year as part of the 2002 Federated Logic Conference (http://floc02.diku.dk/) in conjunction with CADE, CAV, FME, LICS, RTA and TABLEAUX. ICLP'02 is sponsored by IF/Prolog (http://www.ifcomputer.de). Invited Speakers include: Pierre Wolper (Universite de Liege) Stefan Decker (Stanford) TOPICS Since the first ICLP, held in Marseilles in 1982, ICLP has been the premier international conference for presenting research into logic programming. Original papers are sought in all areas of logic programming including (but not restricted to): Theory Implementation Semantic Foundations Compilation Formalisms Memory Management Non-monotonic Reasoning Virtual Machines Knowledge Representation Parallelism Language Issues Environments Constraints Program Analysis Concurrency Program Transformation Objects Validation and Verification Coordination Debugging Mobilility Higher Order Applications Types Modes Deductive Databases Programming Techniques Software Engineering Natural Language Web tools Internet Agents Artificial Intelligence Papers describing innovative applications of logic programming (in the broadest sense, e.g. including constraint programming, non-monotonic systems, etc.) are particularly sought. We welcome submission in, but not limited to, the following topics: surveys of an application area, problems to which logic programming may be applied, experience in applying logic programming, software engineering aspects of logic programming and areas where further research is required to meet industrial needs. There will be an award for the best application paper sponsored by IF/Prolog. SUBMISSION Papers must describe original, previously unpublished work, be written and presented in English, not exceed 15 pages (A4 or letter format, up to 5,000 words), and not be simultaneously submitted for publication elsewhere. The proceedings will be published by Springer Verlag in the Lecture Notes in Computer Science series. Authors are strongly encouraged to use LaTeX2e and the Springer llncs class file, available at http://www.springer.de/comp/lncs/authors.html Submission is Web-based. In order to submit a paper, authors should upload it via the web at http://www.cs.mu.oz.au/~pjs/ICLP2002/ where more detailed instructions are given. If submission through the Web is not possible, five hard copies may be sent to the program chair. Submission Agenda: Submission of papers: February 17, 2002 Notification of acceptance: April 14, 2002 Camera-ready papers due: May 14, 2002 Workshops: The following workshops will be held in conjunction with ICLP'02. August 1: CLIMA - Computational Logic In Multi-Agent Systems July 28: CLPSE - (Constraint) Logic Programming and Software Engineering July 31: LPE - Workshop on Logic Programming Environments July 27-28: NLULP - Natural Language Understanding and Logic Programming July 27: PCL - Paraconsistent Computational Logic July 27: SAVE - Specification, Analysis and Validation for Emerging Technologies in Computational Logic July 28: UNKB - Updating Non-Monotonic Knowledge Bases Conference Location: The conference will be held at the University of Copenhagen. Program Chair: Conference Chair: Peter J. Stuckey Henning Christiansen Department of Computer Science Department of Computer Science and Software Engineering Roskilde University University of Melbourne PO Box 260 3010, AUSTRALIA DK-4000 Roskilde, DENMARK Email: pjs@REDACTED Email: henning@REDACTED Tel: +613-8344-9155 Tel: +45 46 74 38 32 Fax: +613-9348-1184 Programme Committee: Jose Alferes, Universidade Nova de Lisboa Francisco Bueno, Universidad Polytecnica de Madrid Henning Christiansen, Roskilde University Sandro Etalle, University of Twente Francois Fages, INRIA Maurizio Gabbrielli, University of Bologna Maria Garcia de la Banda, Monash University Michael Gelfond, Texas Tech University Gopal Gupta, UT Dallas Katsumi Inoue, Kobe University Joxan Jaffar, National University of Singapore Gerda Janssens, K.U.Leuven Bharat Jayaraman, State University of New York at Buffalo Michael Leuschel, University of Southampton Michael Maher, Loyola University Chicago Dale Miller, The Pennsylvania State University Ulf Nilsson, Linkoping University Francesca Rossi, Universita' di Padova Konstantinos Sagonas, Uppsala University Christian Schulte, Universitat des Saarlandes Harald Sondergaard, University of Melbourne Francesca Toni, Imperial College London Miroslaw Truszczynski, University of Kentucky Pascal Van Hentenryck, Brown University David S. Warren, State University of New York at Stony Brook ------- End of Blind-Carbon-Copy From vlad_dumitrescu@REDACTED Mon Feb 11 14:02:42 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Mon, 11 Feb 2002 14:02:42 +0100 Subject: layered networking Message-ID: Hello, I am looking at an application where we want to implement a networked platform at various levels (core, services, applications). My first idea was to let those layers be implemented by it's own Erlang process, and the communication be message based. This will provide a clean separation and it should be easy to understand. The alternative would be using behaviour-likes, funs and applys - which might get messy, I think. I wonder if there might be something talking against my solution (like for example the performance penalty). Any ideas, suggestions, pointers? thanks. best regards, Vlad _________________________________________________________________ Kom med i v?rldens st?rsta e-posttj?nst; MSN Hotmail. http://www.hotmail.com/sv From Erik.Reitsma@REDACTED Mon Feb 11 14:21:50 2002 From: Erik.Reitsma@REDACTED (Erik Reitsma (ELN)) Date: Mon, 11 Feb 2002 14:21:50 +0100 Subject: xmlrpc in erlang? Message-ID: Hi Garry (and others)! > has anyone done anything like an xmlrpc server in erlang? > it looks like i could use xmerl to parse requests, and formatting > responses should be straightforward. i just wondered if it's > already been done. Mickael Remond c.s. have made a package to do SOAP. I guess that that is what you mean with xmlrpc? I have just finished upgrading his code to a newer SOAP version. It is still quite rudimentary and "hacky" in my opinion. But I have only been using it for demo purposes so far, so as long as my calls worked, I was satisfied :-) And I was quite satisfied, because I could talk to both ASP.NET and the Tomcat that is included in JBuilder 6.0, having Erlang both as server and as client. I think that there is a lot of potential for Erlang in this area, especially since it is easy to have a small server in your application, compared to ASP.NET, where your server has to run in IIS. I have just sent my adaptation to the source to Mickael. I think that the license would allow me to send you the same source, but Mickael promised to integrate my code, so the next version should include my improvements. If you want to use my adaptations just to try out what it looks like, let me know, and I can mail you what I've got. Some more eyes on the code would not hurt at all. So far application concepts etc. have not been used, but it works for me! But there are a lot of opportunities for improvement here. And yes, it uses xmerl. *Erik. From thomas@REDACTED Mon Feb 11 16:36:24 2002 From: thomas@REDACTED (Thomas Arts) Date: Mon, 11 Feb 2002 16:36:24 +0100 Subject: Trace abstraction as behaviour Message-ID: <3C67E4F8.67C8FD4E@cslab.ericsson.se> Hi all If you want to visualize several traces of the same generic servers interacting which each other, you might like the attached new behaviour "gen_trace.erl". You can define one abstraction over a trace and use it for several traces. This might give you a better view on what the program is actually doing. The best part of it, as far as I see it, is that you can map states in the trace that are equivalent under the abstraction to the same node in a graph. As such, you get a very compact picture of complex behaviour. I attached some documentation with an example in the attached postscript file. Have fun Thomas --- Thomas Arts Ericsson Computer Science Laboratory -------------- next part -------------- %%%---------------------------------------------------------------------- %%% File : gen_trace.erl %%% Author : Thomas Arts %%% Purpose : behaviour for trace analyses of a gen_server and gen_fsm %%% Created : 29 Nov 2001 by Thomas Arts %%% Modified: 01 Feb 2002 by Thomas Arts %%% Last Mod: 08 Feb 2002 by Thomas Arts %%%---------------------------------------------------------------------- -module(gen_trace). -author('thomas@REDACTED'). -version("1.0"). -export([dump/3, abstract/3, abstract0/3, proc_info/1, proc_select/2, show/1, behaviour_info/1, init/0, % default callbacks for gen_trace abstract_state/2, abstract_event/2, terminate/1 ]). -export([davinci/2, dot/2, svg/2, postscript/2, dictionaries/2, print_states/2, cadp/2]). -import(lists,[foldl/3,foldr/3,member/2,foreach/2,map/2,keysearch/3]). %-define(DEBUG(S,A),io:format(S,A)). -define(DEBUG(S,A),ok). -define(ERROR(To,S,A),To!{error,S,A}). -define(LEN,500). % defaultlength of trace -define(MAXLEN,5000000). % maximum length of trace -define(MAXWAIT,20). % default attempts to get initialized -define(STATE_COLOUR,"yellow"). -define(EVENT_COLOUR,none). -record(trace, {vertex_dict = % vk -> {abstract state,CB,real state} dict:store(0,{init,?MODULE,init},dict:new()), edge_dict = dict:new(), % ek -> {abstract event,CB,real event} state_dict = % dict(sk,orddict(pid(),vk)) dict:store(0,orddict:new(),dict:new()), states = 0, % sk :: integer() graph = digraph:new(), % digraph({integer(),colour()}) actions = dict:new(), % dict(pid(),[ek :: integer()]) localstates = dict:new(), % dict(pid(),term()) sendpoints = dict:new(), % dict(pid(),{term(),pid(),vk,ek}) trace_procdict = false, % trace process dictionary procdict = dict:new() , % dict(pid(),dict(Key,Value)) connect = trace, collect = false, % group equal states together mapping = [], % {pid(),name(),colour()} callback = ?MODULE, % default callback callbacks = dict:new() % specified callbacks }). behaviour_info(callbacks) -> [{init,0},{abstract_state,2},{abstract_event,2}]. %%%%%%%%%%%%%%% Default CallBack part %%%%%%%%%%%%%%%%%%%%%%%%%%% init() -> init. abstract_state(Term,LS) -> {Term,LS}. abstract_event(Event,LS) -> {Event,LS}. terminate(LS) -> ok. %%%%%%%%%%%%%%% End CallBack part %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %+type dump([pid()],filename(),[option()]) -> trace_process :: pid(). % where option() is % {len,int()} | {timeout, seconds::int() | infinity} % % the processes in the given list are located and their actions are traced dump(Processes,File,Options) -> {Local,Remote} = foldl(fun({N,P},{Ls,Rs}) -> case N==node() of true -> {[P|Ls],Rs}; false -> {Ls,appendnode({N,P},Rs)} end; (P,{Ls,Rs}) -> {[P|Ls],Rs} end,{[],[]},Processes), spawn(fun() -> tracestart([{node(),Local}|Remote],File,Options) end). tracestart(NodeProcesses,File,Options) -> process_flag(trap_exit,true), Collector = self(), ProcDict = options(process_dictionary,false,Options), foreach(fun({Node,[]}) -> ok; ({Node,Procs}) -> spawn_link(Node,fun() -> tracer(Collector,Procs,ProcDict) end) end,NodeProcesses), {Length,Timer} = case keysearch(timeout,1,Options) of {value,{timeout,Seconds}} when integer(Seconds) -> {options(len,?MAXLEN,Options), spawn_link(fun() -> receive after Seconds*1000 -> exit(timeout) end end)}; _ -> {options(len,?LEN,Options),self()} % wait until length reached end, {ok,_} = disk_log:open([{name,tracelog},{file,filename:absname(File)}]), disk_log:log(tracelog,{trace,self(),processes, foldl(fun({N,Ps},Total) -> length(Ps)+Total end,0,NodeProcesses)}), disk_log:log(tracelog,{trace,self(),trace_process_dictionary,ProcDict}), traceloop(Timer,Length). traceloop(Timer,0) -> disk_log:close(tracelog), io:format("~nTracing has finished~n"), exit(tracer_finished); % kills all remote tracing processes traceloop(Timer,Length) -> receive stoptracing -> traceloop(Timer,0); {'EXIT',Timer,_} -> traceloop(Timer,0); X -> ok = disk_log:log(tracelog,X), io:format("."), traceloop(Timer,Length-1) end. % switch all local function tracing off. Thus, only exported functions % are traced % tracer(Collector,Procs,ProcDict) -> ?DEBUG("tracer started node ~p pid ~p~n",[node(),self()]), erlang:trace_pattern({'_','_','_'},false,[local]), % recover pman bug erlang:trace_pattern({gen_server,loop,'_'},true,[local]), erlang:trace_pattern({gen_fsm,loop,'_'},true,[local]), erlang:trace_pattern({erlang,put,'_'},ProcDict,[local]), tracemodules(Collector,Procs,[],[],sets:new()). tracemodules(Collector,SearchPids,PidsToTrace,Mapping,Events) -> {NewSearch,Pids,NewMap} = foldl(fun(P,{NSs,NPs,M}) when pid(P) -> Collector!{trace,P,process_dict,process_info(P,dictionary)}, erlang:monitor(process,P), erlang:trace(P,true,[call,send,{tracer,self()}]), {NSs,[P|NPs],M}; (P,{NSs,NPs,M}) -> ?DEBUG("Searching process activity for ~p~n",[P]), case whereis(P) of Pid when pid(Pid) -> Collector!{trace,Pid,mapped,{node(),P}}, Collector!{trace,Pid,process_dict, process_info(Pid,dictionary)}, erlang:monitor(process,Pid), erlang:trace(Pid,true,[call,send,{tracer,self()}]), {NSs,[Pid|NPs],[{Pid,P}|M]}; _ -> {[P|NSs],NPs,M} end end, {[],PidsToTrace,Mapping}, SearchPids), receive Message -> case Message of {trace,Pid,call,{M,F,As}} -> case member(Pid,Pids) of true -> case {M,F,As} of {gen_server,loop,[_,_,State,Mod,_,_]} -> NewEvents = sets:union(Events, tracepattern(gen_server,Mod)), tracemodules(Collector,NewSearch,Pids--[Pid], NewMap,NewEvents); {gen_fsm,loop,[_,_,State,Data,Mod,_,_]} -> Collector!{trace,Pid,gen_fsm_state,State}, NewEvents = sets:add_element({Mod,State,2}, sets:add_element({Mod,State,3}, sets:union(Events, tracepattern(gen_fsm,Mod)))), tracemodules(Collector,NewSearch,Pids--[Pid], NewMap,NewEvents); {erlang,put,Args} -> Collector!Message, tracemodules(Collector,NewSearch,Pids, NewMap,Events); Other -> ?DEBUG("tracer ignored: ~p~n",[Other]), tracemodules(Collector,NewSearch,Pids, NewMap,Events) end; false -> NewEvents = tracehandle(Collector,Events,Message), tracemodules(Collector,NewSearch,Pids, NewMap,NewEvents) end; {'DOWN', _, process, Pid, Info} -> Collector!{trace,Pid,'DOWN',Info}, case keysearch(Pid,1,NewMap) of {value,{_,Proc}} -> tracemodules(Collector,[Proc|NewSearch],Pids--[Pid], NewMap--[{Pid,Proc}],Events); _ -> tracemodules(Collector,NewSearch,Pids--[Pid], NewMap,Events) end; {trace,Pid,send,Msg,To} -> Collector!{trace,Pid,send,Msg,To}, tracemodules(Collector,NewSearch,Pids,NewMap,Events); Other -> ?DEBUG("tracer ignored message: ~p~n",[Other]), tracemodules(Collector,NewSearch,Pids,NewMap,Events) end after 20 -> tracemodules(Collector,NewSearch,Pids,NewMap,Events) end. tracehandle(Collector,Events,Message) -> case Message of {trace,Pid,call,{erlang,put,Args}} -> Collector!Message, Events; {trace,Pid,call,{gen_server,loop,_}} -> Events; {trace,Pid,call,{gen_fsm,loop,[_,_,State,Data,Mod,_,_]}} -> case sets:is_element({Mod,State,2},Events) of true -> Events; false -> Collector!{trace,Pid,gen_fsm_state,State}, sets:add_element({Mod,State,2}, sets:add_element({Mod,State,3},Events)) end; {trace,Pid,call,{Mod,Func,Args}} -> ShouldTrace = sets:fold(fun({M,F,A},B) -> B or ((M==Mod) and (F==Func)) end,false,Events), case ShouldTrace of true -> case sets:is_element({Mod,Func,length(Args)},Events) of true -> Collector!{trace,Pid,call,{Mod,Func,Args}}; false -> ?DEBUG("tracer ignored message: ~p~n", [{trace,Pid,call,{Mod,Func,Args}}]) end; false -> ?DEBUG("drop tracing ~p~n",[{Mod,Func,Args}]), erlang:trace_pattern({Mod,Func,'_'},false,[global]) end, Events; Other -> ?DEBUG("tracer ignored call: ~p~n",[Other]), Events end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %+type proc_info(filename()) -> {[pid() | {node(),pid()}],length::integer()}. % proc_info(InFile) -> {Procs,Mapping,Nr} = proc_info2(InFile), {map(fun(P) -> case dict:find(P,Mapping) of error -> P; {_,Name} -> Name end end,sets:to_list(Procs)),Nr}. proc_info2(InFile) -> {ok,_} = disk_log:open([{name,tracelog},{file,InFile}]), {Procs,Mapping,Nr} = scan_proc_info(start,dict:new(),sets:new(),0), disk_log:close(tracelog), {Procs,Mapping,Nr}. scan_proc_info(Continuation,Mapping,Procs,Nr) -> case disk_log:chunk(tracelog,Continuation,1) of eof -> {Procs,Mapping,Nr}; {NewContinuation,[Term]} -> case Term of {trace,Pid,processes,OriginalNr} -> %io:format("original attempt to trace ~p processes~n", % [OriginalNr]), scan_proc_info(NewContinuation,Mapping,Procs,Nr); {trace,Pid,mapped,{nonode@REDACTED,Name}} -> scan_proc_info(NewContinuation, dict:store(Pid,Name,Mapping),Procs,Nr); {trace,Pid,mapped,{Node,Name}} -> scan_proc_info(NewContinuation, dict:store(Pid,{Node,Name},Mapping),Procs,Nr); Other when tuple(Other) -> Pid = element(2,Other), scan_proc_info(NewContinuation,Mapping, sets:add_element(Pid,Procs),Nr+1) end end. %+type proc_select(filename(), [pid() | {node(),pid()}]) -> ok. % proc_select(InFile,Procs) -> {ok,_} = disk_log:open([{name,tracelog},{file,InFile}]), {ok,_} = disk_log:open([{name,selectlog}, {file,filename:rootname(InFile)++"-sel"++ filename:extension(InFile)}]), disk_log:log(selectlog,{trace,self(),processes,length(Procs)}), scan_proc_select(start,Procs), disk_log:close(selectlog), disk_log:close(tracelog). scan_proc_select(Continuation,Procs) -> case disk_log:chunk(tracelog,Continuation,1) of eof -> ok; {NewContinuation,[Term]} -> case Term of {trace,Pid,mapped,{nonode@REDACTED,Proc}} -> case member(Proc,Procs) of true -> disk_log:log(selectlog,Term), scan_proc_select(NewContinuation,[Pid|Procs]); false -> scan_proc_select(NewContinuation,Procs) end; {trace,Pid,mapped,Proc} -> case member(Proc,Procs) of true -> disk_log:log(selectlog,Term), scan_proc_select(NewContinuation,[Pid|Procs]); false -> scan_proc_select(NewContinuation,Procs) end; Other when tuple(Other) -> case member(element(2,Other),Procs) of true -> disk_log:log(selectlog,Term), scan_proc_select(NewContinuation,Procs); false -> scan_proc_select(NewContinuation,Procs) end end end. %+type show(filename()) -> ok. % show(InFile) -> {ok,_} = disk_log:open([{name,tracelog},{file,InFile}]), scan_show(start), disk_log:close(tracelog). scan_show(Continuation) -> case disk_log:chunk(tracelog,Continuation,1) of eof -> ok; {NewContinuation,[Term]} -> io:format("~p~n",[Term]), scan_show(NewContinuation) end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %+type abstract(callback :: module(), in::filename(), [option()]) -> ok % where option() = % {tool, toolname(), file::atom()} | % {connect, graph | changegraph | % trace | changetrace | singletrace | msc} %+type abstract([{pid()|{node(),pid()},callback :: module()}], in::filename(), % [option()]) -> ok % where option() = % {tool, toolname(), file::atom()} | % {connect, graph | changegraph | % trace | changetrace | singletrace | msc} abstract(C,F,O) -> Abstractor = spawn_link(?MODULE,abstract0,[C,F,O]). abstract0(CallBack,InFile,Options) when atom(CallBack) -> Trace = #trace{callback=CallBack}, abstract1(Trace,InFile,Options); abstract0(CallBacks,InFile,Options) -> Trace = #trace{callbacks=dict:from_list(CallBacks)}, abstract1(Trace,InFile,Options). abstract1(Trace,InFile,Options) -> {ok,_} = disk_log:open([{name,tracelog},{file,InFile}]), Connect = options(connect,trace,Options), Collect = member(Connect,[graph,changegraph]), digraph:add_vertex(Trace#trace.graph,0,none), ResultTrace = readlog(Trace#trace{connect=Connect, collect=Collect},start), disk_log:close(tracelog), %%% % Here the digraph is assembled further %%% %io:format("sendpoints ~p~n",[dict:to_list(ResultTrace#trace.sendpoints)]), DefaultCB = ResultTrace#trace.callback, case keysearch(tool,1,Options) of {value,{tool,Tool,OutFile}} -> case catch ?MODULE:Tool(filename:absname(OutFile),ResultTrace) of {'EXIT',Reason} -> io:format("failed using tool ~p: ~w~n",[Tool,Reason]); Info -> map(fun({FN,Cont}) -> file:write_file(FN,Cont) end,Info) end; _ -> io:format("no tool specified~n") end, terminate(DefaultCB,ResultTrace#trace.localstates), digraph:delete(Trace#trace.graph), io:format("finished trace abstraction~n"). readlog(Trace,Continuation) -> case disk_log:chunk(tracelog,Continuation,1) of eof -> Procs = orddict:fetch_keys( dict:fetch(Trace#trace.states,Trace#trace.state_dict)), remainsend(Trace,Procs); {NewContinuation,[Term]} -> readlog(abs_event(Trace,Term),NewContinuation) end. %+type abs_event(trace(),term()) -> trace(). % abs_event(Trace,Term) -> case Term of {trace,Pid,process_dict,{dictionary,Dict}} -> Trace#trace{procdict = dict:store(Pid,dict:from_list(Dict), Trace#trace.procdict)}; {trace,Pid,call,{erlang,put,[Field,Value]}} -> ProcDict = case dict:find(Pid,Trace#trace.procdict) of error -> dict:store(Field,Value,dict:new()); {_,Dict} -> dict:store(Field,Value,Dict) end, Trace#trace{procdict = dict:store(Pid,ProcDict,Trace#trace.procdict)}; {trace,Pid,call,{Mod,handle_call,[Msg,From,State]}} -> statechange(Pid,Trace,handle_call,State,{Msg,From}); {trace,Pid,call,{Mod,handle_cast,[Msg,State]}} -> statechange(Pid,Trace,handle_cast,State,Msg); {trace,Pid,call,{Mod,handle_info,[Msg,State]}} -> statechange(Pid, Trace,handle_info,State,Msg); {trace,Pid,send,Msg,To} -> CallBack = callback(Trace#trace.callbacks,Trace#trace.callback,Pid), LocalState = localstate(Pid,CallBack,Trace#trace.localstates), {AbsEvent,LState} = CallBack:abstract_event({send,To,Msg},LocalState), {Trace3,EventKey} = findabsevent(Pid,Trace,AbsEvent,{send,To,Msg}), Trace3#trace{actions = dict:append(Pid,EventKey,Trace3#trace.actions), localstates= dict:store(Pid,LState,Trace3#trace.localstates)}; {trace,Pid,'DOWN',Reason} -> AbsEvent = {node_down,Pid,Reason}, {Trace2,EventKey} = findabsevent(Pid,Trace,node_down,{node_down,Pid,Reason}), Trace2#trace{actions = dict:append(Pid,EventKey,Trace2#trace.actions)}; {trace,Pid,mapped,{nonode@REDACTED,Name}} -> CallBack = callback(Trace#trace.callbacks,Trace#trace.callback,Name), io:format("CallBack ~p used for Pid ~w~n",[CallBack,Pid]), Colour = 100*(length(Trace#trace.mapping)+1), Trace#trace{mapping = [{Pid,Name,Colour}|Trace#trace.mapping], callbacks = dict:store(Pid,CallBack,Trace#trace.callbacks)}; {trace,Pid,mapped,Proc} -> CallBack = callback(Trace#trace.callbacks,Trace#trace.callback,Proc), ?DEBUG("CallBack ~p used for Pid ~w~n",[CallBack,Pid]), Colour = 100*(length(Trace#trace.mapping)+1), Trace#trace{mapping = [{Pid,Proc,Colour}|Trace#trace.mapping], callbacks = dict:store(Pid,CallBack,Trace#trace.callbacks)}; {trace,_,processes,Nr} -> Trace; X -> ?DEBUG("uninterpreted ~p~n",[X]), Trace end. statechange(Pid,Trace,Action,State,Event) -> CallBack = callback(Trace#trace.callbacks,Trace#trace.callback,Pid), LocalState = localstate(Pid,CallBack,Trace#trace.localstates), {AbsState,LState1} = CallBack:abstract_state(State,LocalState), {AbsEvent,LState2} = CallBack:abstract_event({Action,Event},LState1), {Trace1,EventKey} = findabsevent(Pid,Trace,AbsEvent,{Action,Event}), {AbsActions,Actions} = case dict:find(Pid,Trace1#trace.actions) of error -> {[],[]}; {_,Values} -> foldr(fun(V,{AAs,As}) -> {AA,_,A} = dict:fetch(V,Trace#trace.edge_dict), {[AA|AAs],[A|As]} end,{[],[]},Values) end, {AbsEvents,LState3} = case catch CallBack:abstract_eventseq(AbsActions,LState2) of {'EXIT',Reason} -> case Reason of {undef,[{CallBack,abstract_eventseq,_}|_]} -> {AbsActions, LState2}; _ -> io:format("~p~n",[Reason]), {AbsActions, LState2} end; Result -> Result end, OldStateKey = Trace1#trace.states, Trace2 = Trace1#trace{actions = dict:store(Pid,[EventKey],Trace1#trace.actions), localstates = dict:store(Pid,LState3,Trace1#trace.localstates)}, Trace3 = addstate(Pid,Trace2,AbsState,State), {Trace4,ActionsNr} = findabsevent(Pid,Trace3,AbsEvents, Actions), digraph:add_edge(Trace4#trace.graph, {OldStateKey,Trace4#trace.states,ActionsNr}, OldStateKey,Trace4#trace.states,ActionsNr), ?DEBUG("edge: ~p -> ~p nr ~p~n",[OldStateKey,Trace4#trace.states,ActionsNr]), Trace4. callback(CallBacks,DefaultCallBack,Pid) -> case dict:find(Pid,CallBacks) of error -> DefaultCallBack; {_,Value} -> Value end. localstate(Pid,CallBack,StateDict) -> case dict:find(Pid,StateDict) of error -> CallBack:init(); {_,LState} -> LState end. % event is encountered and now it should be added in the way % 'collect' prescribes % % update vertex_dict with {AbsState,CallBack,State} % if new state encountered % update states % update state_dict % update graph with extra node % % thus, guaranteeing that for every key in state_dict there is a % node in the graph and vice versa % addstate(Pid,Trace,AbsState,State) -> StateVector = dict:fetch(Trace#trace.states,Trace#trace.state_dict), {States,VertexKey,NewStateVector,NewStateKey} = case Trace#trace.collect of true -> {Value,VK} = case find_2_3(AbsState,Trace#trace.vertex_dict) of error -> {[State],dict:size(Trace#trace.vertex_dict)}; {_,Key} -> {_,_,Ss} = dict:fetch(Key,Trace#trace.vertex_dict), {[State|Ss],Key} end, NewSV = orddict:store(Pid,VK,StateVector), case find_2(NewSV,Trace#trace.state_dict) of error -> {Value,VK,NewSV,dict:size(Trace#trace.state_dict)}; {_,SKey} -> {Value,VK,NewSV,SKey} end; false -> VK = dict:size(Trace#trace.vertex_dict), NewSV = orddict:store(Pid,VK,StateVector), {State,VK,NewSV,dict:size(Trace#trace.state_dict)} end, % could add colour here (of Pid that is in action) digraph:add_vertex(Trace#trace.graph,NewStateKey,none), ?DEBUG("added state vector ~w = ~p~n",[NewStateKey,NewStateVector]), CB = callback(Trace#trace.callbacks,Trace#trace.callback,Pid), Trace#trace{vertex_dict = dict:store(VertexKey,{AbsState,CB,States}, Trace#trace.vertex_dict), states = NewStateKey, state_dict = dict:store(NewStateKey,NewStateVector, Trace#trace.state_dict) }. % event is encountered and now it should be added to edge_dict % in the way 'collect' prescribes % findabsevent(Pid,Trace,AbsEvent,Event) -> {Value,EdgeKey} = case Trace#trace.collect of true -> case find_2_3(AbsEvent,Trace#trace.edge_dict) of error -> {[Event],dict:size(Trace#trace.edge_dict)}; {_,Key} -> {_,_,Events} = dict:fetch(Key,Trace#trace.edge_dict), {[Event|Events],Key} end; false -> {Event,dict:size(Trace#trace.edge_dict)} end, CB = callback(Trace#trace.callbacks,Trace#trace.callback,Pid), {Trace#trace{edge_dict = dict:store(EdgeKey,{AbsEvent,CB,Value},Trace#trace.edge_dict)}, EdgeKey}. % % is this abstract state/event already stored? % note that we do not check the pid() here, thus in graph mode % pids can be messed up % find_2_3(SndKey,Dict) -> dict:fold(fun(Key1,{Key2,_,_},Result) -> case (Key2==SndKey) of true -> {ok,Key1}; false -> Result end end,error,Dict). find_2(Value,Dict) -> dict:fold(fun(Key,V,Result) -> case V==Value of true -> {ok,Key}; false -> Result end end,error,Dict). % some messages are sent, but not yet received % (those are in sendpoints, edge_dict, but not in graph) % add them to destination pid() where % 'extern' is used for pids that are not traced % % depends on value 'collect' how this is done in particular % remainsend(Trace,DrawnProcs) -> NewSendPoints = dict:fold(fun(Key,Value,NewDict) -> case member(Key,DrawnProcs) of true -> dict:store(Key, map(fun({M,N,P,A}) -> case member(P,DrawnProcs) of true -> {M,N,P,A}; false -> {M,N,extern,A} end end,Value),NewDict); false -> foldl(fun(V,D) -> dict:append(extern,V,D) end,NewDict,Value) end end,dict:new(),Trace#trace.sendpoints), Trace#trace{sendpoints = NewSendPoints}. %%%%%%%%%%%%%%%% format functions %%%%%%%%%%%%%%%%%%%% %+type graph_to_dicts(trace()) -> % {[{node(),{string(),term(),colour()}}], % [{{node(),node()},{string(),term(),colour()}}]}. % graph_to_dicts(Trace) -> VDict = expand_state_dict(Trace), EDict = expand_event_dict(Trace), {VDict,EDict}. %+type noedgelabel([{node(),{string(),term(),colour()}}], % [{{node(),node()},{string(),term(),colour()}}]) -> % {dict(node(),{string(),term(),colour()}), % dict(node(),[{node(),none|arrow}])}. % noedgelabel({VDict,EDict}) -> {NVDict,NEDict,_} = foldl(fun({{N1,N2},Label},{VD,ED,Max}) -> {dict:store(Max,Label,VD), dict:append(Max,{N2,arrow},dict:append(N1,{Max,none},ED)), Max+1} end,{dict:from_list(VDict),dict:new(),length(VDict)},EDict), {NVDict,NEDict}. expand_state_dict(Trace) -> Colour = case Trace#trace.connect of _ -> ?STATE_COLOUR end, case member(Trace#trace.connect,[changetrace,changegraph]) of true -> StateKeys = lists:seq(0,dict:size(Trace#trace.state_dict)-1), {Dict,_} = foldl(fun(StateKey,{D,OldVector}) -> StateVector = dict:fetch(StateKey,Trace#trace.state_dict), ExpandVector = foldl(fun({Pid,VK},EV) -> case member({Pid,VK},OldVector) of true -> % no change EV; false -> {AbsState,CB,State} = dict:fetch(VK, Trace#trace.vertex_dict), case Trace#trace.connect of singletrace -> [{typeset_state(CB,AbsState), State}|EV]; _ -> [{pid_to_list(Pid)++"\n"++ typeset_state(CB,AbsState), State}|EV] end end end,[],StateVector), {[{StateKey,zvector(ExpandVector,Colour)}|D],StateVector} end,{[],orddict:new()},StateKeys), Dict; false -> dict:fold(fun(StateKey,StateVector,D) -> ExpandVector = map(fun({Pid,VK}) -> {AbsState,CB,State} = dict:fetch(VK,Trace#trace.vertex_dict), case Trace#trace.connect of singletrace -> {typeset_state(CB,AbsState),State}; _ -> {pid_to_list(Pid)++"\n"++ typeset_state(CB,AbsState),State} end end,StateVector), [{StateKey,zvector(ExpandVector,Colour)}|D] end,[],Trace#trace.state_dict) end. zvector(PairList,Colour) -> {AbsStates,StateLists} = unzip(PairList), {concat(AbsStates,"\n"),StateLists,Colour}. expand_event_dict(Trace) -> Colour = ?EVENT_COLOUR, foldl(fun(E,Es) -> {_,N1,N2,Label} = digraph:edge(Trace#trace.graph,E), {AbsEvents,CB,Events} = dict:fetch(Label,Trace#trace.edge_dict), [{{N1,N2},{typeset_events(CB,AbsEvents),Events,Colour}}|Es] end,[],digraph:edges(Trace#trace.graph)). %%%%%%%%%%%%%%%% DOT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dot(FileName,Trace) -> {VDict,EDict} = graph_to_dicts(Trace), Dot = ["digraph G {\n",dot_build(VDict,EDict),"}\n"], [{FileName++".dot",Dot}]. %+type dot_build(dict(node(),{string(),term(),colour()}), % dict({node(),node()},{string(),term(),colour()})) -> % deeplist(). % dot_build(VDict,EDict) -> Vertices = map(fun({Nr,{ShortForm,LongForm,Colour}}) -> integer_to_list(Nr)++ " [" ++ case Colour of none -> ""; _ -> "style=filled, color=\""++Colour++"\",\n" end ++ " shape=box,\n label=\""++ dot_quote(ShortForm)++ "\"];\n" end,VDict), Edges = map(fun({{From,To},{ShortForm,LongForm,Colour}}) -> integer_to_list(From)++ " -> "++ integer_to_list(To)++ " [label=\""++dot_quote(ShortForm)++"\"];\n" end,EDict), Vertices++Edges. dot_quote(String) -> foldr(fun(C,S) -> case C of 10 -> "\\n"++S; 13 -> "\\n"++S; $< -> "< "++S; $> -> "> "++S; $& -> "& "++S; _ -> [C|S] end end, "", String). %%%%%%%%%%%%%%%% POSTSCRIPT via dot tool %%%%%%%%%%%%%%%%%%%%%%%%%%% postscript(FileName,Trace) -> [{DotFileName,DotData}] = dot(FileName,Trace), % should use a port here, but have to learn how to do that %Dot = open_port({spawn, "dot -Tps "}, []), %Dot ! {self(), {command, DotData}}, %receive % {Dot, {data, Data}} -> % [{FileName++".ps",Data}] %end. file:write_file(DotFileName,DotData), PSData = os:cmd("dot -Tps "++DotFileName), [{FileName++".ps",PSData}]. %%%%%%%%%%%%%%%% SVG output via dot tool %%%%%%%%%%%%%%%%%%%%%%%%%%% svg(FileName,Trace) -> [{DotFileName,DotData}] = dot(FileName,Trace), % should use a port here, but have to learn how to do that % Dot = open_port({spawn, "dot -Tsvg "}, []), % call dot here with -svg % Dot ! {self(), {command, DotData}}, % receive % {Dot, {data, Data}} -> % [{FileName++".svg",add_scrollbars(Data)}] % end. file:write_file(DotFileName,DotData), SVGData = os:cmd("dot -Tsvg "++DotFileName), [{FileName++".svg",add_scrollbars(SVGData)}]. add_scrollbars(SVGData) -> ReplaceString = case os:getenv("SVGScript") of false -> scrollbars(); FileName -> "\n"]. %%%%%%%%%%%%%%%% DAVINCI %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% davinci(FileName,Trace) -> {VDict,EDict} = noedgelabel(graph_to_dicts(Trace)), DaVinci = ["[",davinci_build(VDict,EDict),"]"], [{FileName++".daVinci",DaVinci}]. %+type davinci_build(dict(node(),{string(),term(),colour()}), % dict(node(),[{node(),none|arrow}])) -> % deeplist(). % davinci_build(VDict,EDict) -> sep(fun(Nr) -> {ShortForm,LongForm,Colour} = dict:fetch(Nr,VDict), ["l(\"", integer_to_list(Nr), "\",n(\"\",[a(\"OBJECT\",\"", davinci_quote(ShortForm), "\")", case Colour of none -> ""; _ -> [",a(\"COLOR\",\"",Colour,"\")"] end, "],[", sep(fun(To) -> davinci_edge(Nr,To) end,case dict:find(Nr,EDict) of {ok,Tos} -> Tos; _ -> [] end), "]))"] end,lists:seq(0,dict:size(VDict)-1)). davinci_quote(String) -> concat(string:tokens(String,[10,13]),"\\n"). davinci_edge(From,{To,none}) -> ["e(\"\",[a(\"_DIR\",\"none\")],r(\"", integer_to_list(To), "\"))"]; davinci_edge(From,{To,arrow}) -> ["e(\"\",[],r(\"", integer_to_list(To), "\"))"]. concat([],Sep) -> ""; concat([Token],Sep) -> Token; concat([Token|Tokens],Sep) -> Token++Sep++concat(Tokens,Sep). sep(F,[]) -> []; sep(F,[E]) -> [F(E)]; sep(F,[E|Es]) -> [F(E),",\n"|sep(F,Es)]. %%%%%%%%%%%%%%%% NILSSON %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dictionaries(FileName,Trace) -> {VDict,EDict} = graph_to_dicts(Trace), [{FileName++".dicts",term_to_binary({trace,VDict,EDict})}]. %%%%%%%%%%%%%%%%% CADP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cadp(FileName,Trace) -> {VDict,EDict} = graph_to_dicts(Trace), Length = length(EDict), Max = length(VDict), Labels = [io_lib:format("des (0,~w,~w)~n",[Length,Max])| map(fun({{N1,N2},{ShortForm,LongForm,Colour}}) -> ["(",integer_to_list(N1), ",\""++ShortForm++"\",",integer_to_list(N2),")\n"] end,lists:sort(EDict))], [{FileName++".aut",Labels},{FileName++".map",term_to_binary(VDict)}]. %%%%%%%%%%%%%%%% Print States %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% print_states(FileName,Trace) -> Dict = expand_state_dict(Trace), [{FileName++".ascii",map(fun({N,{ShortForm,LongForm,Colour}}) -> io_lib:format("~p~n",[ShortForm]) end, Dict)}]. %%%%%%%%%%%%%%%% local functions %%%%%%%%%%%%%%%%%%%%% terminate(CallBack,States) -> dict:fold(fun(Key,Value,Acc) -> case catch CallBack:terminate(Value) of {'EXIT',{undef,[{CallBack,terminate,_}|_]}} -> Acc; {'EXIT',Reason} -> io:format("error ~p:terminate/1 ~p~n",[CallBack,Reason]), error; _ -> Acc end end,ok,States). %+type appendnode({Key,Value},[{Key,[Value]}]) -> [{Key,[Value]}]. % appendnode({N,P},[]) -> [{N,[P]}]; appendnode({N,P},[{N,Ps}|Rest]) -> [{N,[P|Ps]}|Rest]; appendnode({N,P},[{M,Ps}|Rest]) -> [{M,Ps}|appendnode({N,P},Rest)]. % % % in R8 and later, we can use behaviour_info in this function, i.e. % trace all functions in behaviour_info(callbacks) % tracepattern(gen_server,Module) -> erlang:trace_pattern({Module,handle_call,'_'},true,[global]), erlang:trace_pattern({Module,handle_cast,'_'},true,[global]), erlang:trace_pattern({Module,handle_info,'_'},true,[global]), erlang:trace_pattern({Module,terminate,'_'},true,[global]), erlang:trace_pattern({Module,code_change,'_'},true,[global]), behaviour(gen_server,Module); tracepattern(gen_fsm,Module) -> erlang:trace_pattern({Module,'_','_'},true,[global]), behaviour(gen_fsm,Module). %+type behaviour(behaviour :: atom()) -> set({fun::atom(),arity::integer()}). % behaviour(gen_server,Module) -> sets:from_list([{Module,handle_call,3}, {Module,handle_cast,2}, {Module,handle_info,2}, {Module,terminate,2}, {Module,code_change,3}]); behaviour(gen_fsm,Module) -> sets:from_list([{Module,handle_event,3}, {Module,handle_sync_event,4}, {Module,handle_info,3}, {Module,terminate,3}, {Module,code_change,4}]). options(KeyWord,Default,List) -> case keysearch(KeyWord,1,List) of {value,{_,V}} -> V; _ -> Default end. typeset_state(CallBack,AbsState) -> case catch CallBack:typeset_state(AbsState) of {'EXIT',Reason} -> case Reason of {undef,[{CallBack,typeset_state,_}|_]} -> lists:flatten(io_lib:format("~w",[AbsState])); _ -> io:format("~p~n",[Reason]), lists:flatten(io_lib:format("~w",[AbsState])) end; Result -> lists:flatten(Result) end. typeset_events(CallBack,AbsEvents) -> TypesetEvents = map(fun(A) -> case catch CallBack:typeset_event(A) of {'EXIT',Reason} -> case Reason of {undef,[{CallBack,typeset_event,_}|_]} -> ok; _ -> io:format("typset error: ~p~n",[Reason]) end, lists:flatten(io_lib:format("~w",[A])); Result -> lists:flatten(Result) end end,AbsEvents), case catch CallBack:typeset_eventseq(TypesetEvents) of {'EXIT',Reason} -> case Reason of {undef,[{CallBack,typeset_eventseq,_}|_]} -> ok; _ -> io:format("typset error: ~p~n",[Reason]) end, lists:flatten(["[",concat(TypesetEvents,",\n"),"]"]); Result -> lists:flatten(Result) end. unzip([]) -> {[],[]}; unzip([{X,Y}|Rest]) -> {Xs,Ys} = unzip(Rest), {[X|Xs],[Y|Ys]}. -------------- next part -------------- % % Thomas Arts % February 2002 % % abstraction for % code_server process % -module(abs_code_server). -behaviour(gen_trace). -export([init/0, abstract_state/2, abstract_event/2, abstract_eventseq/2]). % store is a reflection of the state, i.e., the code path % %+type init() -> store(). % init() -> []. %+type abstract_state(term(),store()) -> {term(),store()}. % abstract_state(Term,Store) -> CodePath = element(2,Term), case Store of [] -> {initial_code_path,CodePath}; _ -> case CodePath -- Store of [] -> {code_path,CodePath}; Added -> {extended_code_path,CodePath} end end. %+type abstract_event(term(),store()) -> {term(),store()}. % abstract_event({handle_call,{{load_file,F},Client}},Store) -> {try_to_load_file,Store}; abstract_event({handle_call,{{load_abs,F},Client}},Store) -> {try_to_load_file_without_search,Store}; abstract_event({handle_call,{{purge,F},Client}},Store) -> {try_to_purge_file,Store}; abstract_event({send,Pid,{'$gen_call',_,Cmd}},Store) -> {{gen_server_call,Cmd},Store}; abstract_event({send,Pid,{_,{get_file,FileName}}},Store) -> case filename:basename(FileName) of FileName -> {get_file_from_currect_dir,Store}; _ -> {get_file_from_path_dir,Store} end; abstract_event({send,Pid,{_,{error,_,_}}},Store) -> {{send,error},Store}; abstract_event({send,Pid,{Ref,Msg}},Store) -> {{send,Msg},Store}; abstract_event(Event,Store) -> {Event,Store}. %+type abstract_eventseq([term()],store()) -> {[term()],store()}. % abstract_eventseq(Events,Store) -> {Events,Store}. -------------- next part -------------- % % Thomas Arts % November 2001 % % no abstraction % for reading the raw trace % -module(abs0). -behaviour(gen_trace). -export([init/0, abstract_state/2, abstract_event/2, abstract_eventseq/2, terminate/1]). %+type init() -> store(). % init() -> 0. %+type abstract_state(term(),store()) -> {term(),store()}. % abstract_state(Term,Store) -> {Term,Store+1}. %+type abstract_event(term(),store()) -> {term(),store()}. % abstract_event(Event,Store) -> {Event,Store}. %+type abstract_eventseq([term()],store()) -> {[term()],store()}. % abstract_eventseq(Events,Store) -> {Events,Store}. %+type terminate(store()) -> ok. % terminate(Store) -> io:format("trace of ~p states~n",[Store]). -------------- next part -------------- A non-text attachment was scrubbed... Name: release.ps Type: application/postscript Size: 97037 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe.armstrong@REDACTED Mon Feb 11 19:49:48 2002 From: joe.armstrong@REDACTED (joe armstrong) Date: Mon, 11 Feb 2002 19:49:48 +0100 Subject: layered networking References: Message-ID: <3C68124C.4090105@telia.com> Vlad Dumitrescu wrote: > Hello, > > I am looking at an application where we want to implement a networked > platform at various levels (core, services, applications). My first > idea was to let those layers be implemented by it's own Erlang > process, and the communication be message based. This will provide a > clean separation and it should be easy to understand. The alternative > would be using behaviour-likes, funs and applys - which might get > messy, I think. > > I wonder if there might be something talking against my solution (like > for example the performance penalty). Any ideas, suggestions, pointers? No - if your code struture is isomorphic to the problem then the thing should "write itself" and will have a much higher chance of being correct. Given the choice you should always choose beauty over efficiency - It will probably turn out the that the beautiful solution will be fast enough anyway. It is, after all, easy to make an incorrect program run arbitrarly fast If, and it can happen, the final beautiful program is too slow then you will be in a good position to optimise the algorithm since it should at least be clear what the thing is supposed to do and you will have a good set of test cases to test you efficient version on. /Joe > > thanks. best regards, > Vlad > > _________________________________________________________________ > Kom med i v?rldens st?rsta e-posttj?nst; MSN Hotmail. > http://www.hotmail.com/sv > > From martin@REDACTED Mon Feb 11 23:51:56 2002 From: martin@REDACTED (Martin J. Logan) Date: Mon, 11 Feb 2002 16:51:56 -0600 Subject: Debugger Message-ID: <3C684B0C.EC23D5A9@vailsys.com> Hello, I am having problems with the debugger in R8. =ERROR REPORT==== 11-Feb-2002::16:38:38 === Module db_init must be purged before loading =ERROR REPORT==== 11-Feb-2002::16:38:38 === Loading of /home/martin/work/applications/least_cost_routing/server/src/db_init.beam failed: not_purged =ERROR REPORT==== 11-Feb-2002::16:38:38 === Error in process <0.50.0> on node 'm@REDACTED' with exit value: {badarg,[{erlang,binary_to_term,[<<0 bytes>>]},{dbg_iload,abstr,1},{dbg_iload,store_module,3},{dbg_iload,load_mod1,3}]} This is on a newly created node trying to interpret a file compiled with erlc +debug_info . Can anyone provide me with a description of the proper to use the debugger? Thanks, Martin From klacke@REDACTED Tue Feb 12 02:18:02 2002 From: klacke@REDACTED (Claes Wikstrom) Date: Tue, 12 Feb 2002 02:18:02 +0100 Subject: yaws Message-ID: <20020212021802.A18456@hyber.org> Howdy folks, I've just started a little late-night-hack webserver project. I've come quite some distance in just a little while and it looks good. The reason I started was that I found myself in a position where I had to write a little dynamic content website and I discovered that php sucks bigtime. So hence, we have http://yaws.hyber.org Lot's of work left to be done, and you are all welcome to take a look at http://yaws.hyber.org/todo.yaws Tarball is at http://yaws.hyber.org/download Cheers /klacke -- Claes Wikstrom -- Caps lock is nowhere and http://www.hyber.org -- everything is under control From james@REDACTED Tue Feb 12 04:00:21 2002 From: james@REDACTED (James Hague) Date: Mon, 11 Feb 2002 21:00:21 -0600 Subject: Erlang for Mac OS X Message-ID: <3C6830E5.7534.3799CC@localhost> What's the state of Erlang for Mac OS X? Is it buildable with the current distribution? Do dynamically loaded drivers work okay? Any performance numbers, as compared to other systems? Thanks, James From vlad_dumitrescu@REDACTED Tue Feb 12 08:21:49 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Tue, 12 Feb 2002 08:21:49 +0100 Subject: yaws Message-ID: Hi, That was an interesting project. I have a first observation to make: the HTML code generated for the yaws site looks very weird. Basically, the table that contains the menu is never "closed", and the result is that it looks truncated in IE, while Netscape refuses to show anything.
... menu here ...

Yaws

should be: + +
... menu here ...

+

Yaws

Good luck! regards, Vlad _________________________________________________________________ H?mta MSN Explorer kostnadsfritt p? http://explorer.msn.se/intl.asp From joe@REDACTED Tue Feb 12 10:14:42 2002 From: joe@REDACTED (Joe Armstrong) Date: Tue, 12 Feb 2002 10:14:42 +0100 Subject: yaws In-Reply-To: <20020212021802.A18456@hyber.org> References: <20020212021802.A18456@hyber.org> Message-ID: <200202120914.g1C9Egk02422@enfield.sics.se> Well done klacke, brilliant. I had a few ideas for extensions :-) a) make the server into a mutil-protocol server i.e now it's HTML request -> HTML reply Suppose it could handle SOAP request -> SOAP reply synchronously with the HTML requests (and say SNMP) or even Erl rpc :-) Then you could use the server as a regular HTTP/HTML machine but manage it out of band (so to speak) with SOAP or XMLRPC requests. b) Add the notion of small peer groups - when we do things like IRC instant messaging etc. we have to connect to a central server - but most of the time the peer group could "detach" itself from the cenral server - suppose I (joe) wants to "chat" to you (Klacke) why do I need ICQ/MSN/AOL to introduce us - I have a permanent IP - that's all that's needed :-) it would be nice if clients that connected to the sever could become part of the server itself .... (though a soap channel, or an erl channel) ... and then detach themselves ... I'll have to take a look at the code :-) /Joe From daniel.neri@REDACTED Tue Feb 12 10:19:34 2002 From: daniel.neri@REDACTED (Daniel =?iso-8859-1?q?N=E9ri?=) Date: 12 Feb 2002 09:19:34 +0000 Subject: xmlrpc in erlang? In-Reply-To: References: Message-ID: "Erik Reitsma (ELN)" writes: > Mickael Remond c.s. have made a package to do SOAP. I guess that > that is what you mean with xmlrpc? Quoted from the XML-RPC HowTo[*]: "SOAP was originally created as a collaboration between UserLand, DevelopMentor and Microsoft. The initial public release was basically XML-RPC with namespaces and longer element names. Since then, however, SOAP has been turned over a W3C working group. [...] Basically, if you like XML-RPC, but wish the protocol had more features, check out SOAP. :-)" Regards, --Daniel [*] http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto-soap.html -- Daniel Neri Sigicom AB, Sweden From etxuwig@REDACTED Tue Feb 12 10:36:05 2002 From: etxuwig@REDACTED (Ulf Wiger) Date: Tue, 12 Feb 2002 10:36:05 +0100 (MET) Subject: yaws In-Reply-To: <200202120914.g1C9Egk02422@enfield.sics.se> Message-ID: On Tue, 12 Feb 2002, Joe Armstrong wrote: > >Well done klacke, brilliant. > >I had a few ideas for extensions :-) > > a) make the server into a mutil-protocol server > i.e now it's HTML request -> HTML reply > > Suppose it could handle SOAP request -> SOAP reply > synchronously with the HTML requests (and say SNMP) > or even Erl rpc :-) For what it's worth, that's exactly why I started working on XMErl and its export feature. I'd been building dynamic content web servers, and the idea was to be able to work with simple tagged tuples internally, and let the session handler keep track of what the external representation should look like. (http://www.erlang.se/euc/00/xmerl.ppt) Erl rpc would of course be trivial, since the handlers could define their own data structures (sticking to the {Tag,Args,Data} format). Then, context-sensitive export/mapping functions could map to real XML, HTML, or something else. I haven't yet verified that the model works well in practice, but other nice people (e.g. Richard C and Johan B) seem to be busy fixing things so that it actually becomes useable. (: I like the ... stuff. Neat. /Uffe From vlad_dumitrescu@REDACTED Tue Feb 12 11:32:15 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Tue, 12 Feb 2002 11:32:15 +0100 Subject: yaws Message-ID: Hi all, If I may add something to the extensions... It isn't really an extension, but it would be a different application, but it fits well into the discussion, I think. I was about to start implementing a Gnutella client in Erlang, just for fun, but then I found out that the network is almost clogged up... and so I stumbled onto JXTA (www.jxta.org) which is a protocol specification and a platform for peer-to-peer networking. The current implementation is in Java (Sun has started the project), but I think it would be a nice thing to try to implement. There are ongoing projects to create bindings for C, python, perl and some other languages. I begun looking at that, and I thought that it might be interesting enough for you to know. regards, Vlad _________________________________________________________________ H?mta MSN Explorer kostnadsfritt p? http://explorer.msn.se/intl.asp. From joe@REDACTED Tue Feb 12 12:04:49 2002 From: joe@REDACTED (Joe Armstrong) Date: Tue, 12 Feb 2002 12:04:49 +0100 Subject: yaws In-Reply-To: References: Message-ID: <200202121104.g1CB4np02869@enfield.sics.se> On Tuesday 12 February 2002 11:32 am, Vlad Dumitrescu wrote: > Hi all, > > If I may add something to the extensions... It isn't really an extension, > but it would be a different application, but it fits well into the > discussion, I think. > > I was about to start implementing a Gnutella client in Erlang, just for > fun, but then I found out that the network is almost clogged up... Yes - I did this as well Gnutella sucketh *greatly* - you get a flood of totaally meaningless messages which are bascially junk. There is also no way of killing of a down-stream query - terrible protocol - brain dead. If you want a neato protocol check out Chord. > and so I > stumbled onto JXTA (www.jxta.org) which is a protocol specification and a > platform for peer-to-peer networking. > > The current implementation is in Java (Sun has started the project), but I > think it would be a nice thing to try to implement. No JXTA also sucks (though less so than gnutella) - JXTA is a framework for P2P but is IMHO not the way to go. I'm more attracted to the idea of very small peer-2-peer groups (everybody want's massive p2p groups) but what about the small one's. Why do I have to use ICQ to get a connection to a friend? - why not use a small p2p group for this. We could use yaws to keep track of the small p2p groups. yaws could deligate a query to a p2p group, for example. /Joe There are ongoing > projects to create bindings for C, python, perl and some other languages. > > I begun looking at that, and I thought that it might be interesting enough > for you to know. > > regards, > Vlad > > _________________________________________________________________ > H?mta MSN Explorer kostnadsfritt p? http://explorer.msn.se/intl.asp. From willem@REDACTED Tue Feb 12 12:50:08 2002 From: willem@REDACTED (Willem Broekema) Date: Tue, 12 Feb 2002 12:50:08 +0100 Subject: Gnutella (was: Re: yaws) References: <200202121104.g1CB4np02869@enfield.sics.se> Message-ID: <3C690170.9030505@pastelhorn.com> Joe Armstrong wrote: > Yes - I did this as well Gnutella sucketh *greatly* - you get a flood of > totaally meaningless messages which are bascially junk. There is also > no way of killing of a down-stream query - terrible protocol - brain dead. Me too, I'm also (not very actively) working on a client. Gnutella is indeed not very advanced, but there are interesting developments going on like "Ultrapeer" nodes that each handle most of the traffic for tens of regular leaf nodes. Not sure what "meaningless messages" you're talking about? By the way, if you or Vlad have some code for an Erlang client lying around, I'd surely like to see it. I have my client basically working, but I'm sure I learn something by looking at your code! :-) - Willem From willem@REDACTED Tue Feb 12 12:53:41 2002 From: willem@REDACTED (Willem Broekema) Date: Tue, 12 Feb 2002 12:53:41 +0100 Subject: yaws References: <20020212021802.A18456@hyber.org> Message-ID: <3C690245.1040003@pastelhorn.com> Claes Wikstrom wrote: > Howdy folks, > > I've just started a little late-night-hack webserver project. > I've come quite some distance in just a little while and it looks > good. > > The reason I started was that > I found myself in a position where I had to write a little dynamic > content website and I discovered that php sucks bigtime. Right now you seem to create a template-based file-based web server. If you want to aim for something bigger, consider making it similar to Zope, an open-source web application server written in Python, , by adding a persistent storage for Erlang terms, maybe using Mnesia? Can Mnesia store hierarchical data? In that case you can set the server up to let server.com/folder1/folder2/term refer to the Erlang term located in f1/f2. The storage can support transactions, undo etc (I'm sure I have read Mnesia supports that). Right now the templates do not work well together with WYSIWYG HTML editors. Zope has solved this by using the attributes of standard HTML tags instead of new tags. In a separate XML namespace, template commands are included. See Zope's Template Attribute Language , which is part of the functionality of Zope Page Templates, . I think their solution is quite neat and elegant, better than the current syntax. - Willem, satisfied amateur Zope user :-) From nick@REDACTED Tue Feb 12 12:58:46 2002 From: nick@REDACTED (Niclas Eklund) Date: Tue, 12 Feb 2002 12:58:46 +0100 (MET) Subject: xmlrpc in erlang? or CORBA vs. SOAP In-Reply-To: Message-ID: Hello! This subject, CORBA vs. SOAP, have been discussed several times in the comp.object.corba newsgroup (both for and against). See (complete): http://groups.google.com/groups?hl=en&q=SOAP&meta=group%3Dcomp.object.corba or: http://groups.google.com/groups?hl=en&threadm=a1f28d%24q7mmf%241%40ID-74226.news.dfncis.de&rnum=7&prev=/groups%3Fq%3DSOAP%2Bgroup:comp.object.corba%2Bgroup:comp.object.corba%26hl%3Den%26selm%3Da1f28d%2524q7mmf%25241%2540ID-74226.news.dfncis.de%26rnum%3D7 Best Regards /Nick > "Erik Reitsma (ELN)" writes: > > > Mickael Remond c.s. have made a package to do SOAP. I guess that > > that is what you mean with xmlrpc? > > Quoted from the XML-RPC HowTo[*]: > > "SOAP was originally created as a collaboration between UserLand, > DevelopMentor and Microsoft. The initial public release was > basically XML-RPC with namespaces and longer element names. Since > then, however, SOAP has been turned over a W3C working group. > > [...] > > Basically, if you like XML-RPC, but wish the protocol had more > features, check out SOAP. :-)" > > > Regards, > --Daniel > > [*] http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto-soap.html > > -- > Daniel Neri > Sigicom AB, Sweden From joe@REDACTED Tue Feb 12 13:23:42 2002 From: joe@REDACTED (Joe Armstrong) Date: Tue, 12 Feb 2002 13:23:42 +0100 Subject: Gnutella (was: Re: yaws) In-Reply-To: <3C690170.9030505@pastelhorn.com> References: <200202121104.g1CB4np02869@enfield.sics.se> <3C690170.9030505@pastelhorn.com> Message-ID: <200202121223.g1CCNgn03248@enfield.sics.se> On Tuesday 12 February 2002 12:50 pm, Willem Broekema wrote: > Joe Armstrong wrote: > > Yes - I did this as well Gnutella sucketh *greatly* - you get a flood of > > totaally meaningless messages which are bascially junk. There is also > > no way of killing of a down-stream query - terrible protocol - brain > > dead. > > Me too, I'm also (not very actively) working on a client. Gnutella is > indeed not very advanced, but there are interesting developments going on > like "Ultrapeer" nodes that each handle most of the traffic for tens of > regular leaf nodes. > > Not sure what "meaningless messages" you're talking about? Meaningless in the sence that the messages carried no useful data (for example, IPs of dead machines etc.) sure they were correctly formatted but they contained no useful data. The other thing I noticed was an alarming tendency for nodes to just break-off communication for no apparent reason. A lot of nodes don't hang around for long-enough to do something useful. The other thing that sucks is that once you have finished a session other machines in the net can port-scan you for a long time to see if you're still alive. > > By the way, if you or Vlad have some code for an Erlang client lying > around, I'd surely like to see it. I have my client basically working, but > I'm sure I learn something by looking at your code! :-) > > - Willem From klacke@REDACTED Tue Feb 12 13:38:27 2002 From: klacke@REDACTED (Klacke) Date: Tue, 12 Feb 2002 13:38:27 +0100 Subject: yaws In-Reply-To: <3C690245.1040003@pastelhorn.com>; from willem@pastelhorn.com on Tue, Feb 12, 2002 at 12:53:41PM +0100 References: <20020212021802.A18456@hyber.org> <3C690245.1040003@pastelhorn.com> Message-ID: <20020212133827.A21580@bluetail.com> On Tue, Feb 12, 2002 at 12:53:41PM +0100, Willem Broekema wrote: > Claes Wikstrom wrote: > > Howdy folks, > > > > I've just started a little late-night-hack webserver project. > > I've come quite some distance in just a little while and it looks > > good. > > > > The reason I started was that > > I found myself in a position where I had to write a little dynamic > > content website and I discovered that php sucks bigtime. > > Right now you seem to create a template-based file-based web server. > > If you want to aim for something bigger, consider making it similar to > Zope, an open-source web application server written in Python, Actually it is allready an application server, it's just that the pages that show up on yaws.hyber.org don't do anything more fancy that including other files. Nothin there that plain ssi can't do. However, the erlang code that gets evaluated can do anything it wants. > , by adding a persistent storage for Erlang terms, maybe > using Mnesia? Can Mnesia store hierarchical data? In that case you can set > the server up to let server.com/folder1/folder2/term refer to the Erlang > term located in f1/f2. The storage can support transactions, undo etc (I'm > sure I have read Mnesia supports that). This already doable. I'll add some more fancy examples to make this more clear. > > Right now the templates do not work well together with WYSIWYG HTML > editors. This is indeed correct, and maybe I should be using one of those since Vlad pointed out that my HTML was bad, I may need it .... :-) > Zope has solved this by using the attributes of standard HTML tags > instead of new tags. In a separate XML namespace, template commands > are included. > > See Zope's Template Attribute Language > , > which is part of the functionality of Zope Page Templates, > . I think their > solution is quite neat and elegant, better than the current syntax. > > Ok, thanks, I'll take a look at those. -- Claes Wikstrom -- Caps lock is nowhere and Alteon WebSystems -- everything is under control http://www.bluetail.com/~klacke cellphone: +46 70 2097763 From vlad_dumitrescu@REDACTED Tue Feb 12 13:46:10 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Tue, 12 Feb 2002 13:46:10 +0100 Subject: yaws Message-ID: >If you want a neato protocol check out Chord. Yes, that seems like fun! >No JXTA also sucks (though less so than gnutella) - JXTA is a framework for >P2P but is IMHO not the way to go. I haven't had time to look at it that much, but I think it might work... >I'm more attracted to the idea of very small peer-2-peer groups (everybody >want's massive p2p groups) but what about the small one's. >Why do I have to use ICQ to get a connection to a friend? - why not use a >small p2p group for this. We could use yaws to keep track of the small p2p >groups. But JXTA is just a protocol - it shouldn't matter if it's a small or large group, does it? It just defines how the communication takes place. If ICQ was open-sourced, you could set up a private central server and let only your friends connect to it. Then you'd have your small group, but also the option to communicate with the rest of the world too. The protocol is orthogonal to the implementation (in theory), so any fixed point (yaws or wikie or a cgi/php/asp script) can be used to put the peers in contact with each other. Am I wrong? regards, Vlad _________________________________________________________________ Chatta med v?nner online, prova MSN Messenger: http://messenger.msn.se From thomas.lindgren@REDACTED Tue Feb 12 13:53:00 2002 From: thomas.lindgren@REDACTED (Thomas Lindgren) Date: Tue, 12 Feb 2002 13:53:00 +0100 Subject: yaws In-Reply-To: <20020212133827.A21580@bluetail.com> Message-ID: For interesting extensions, or some inspiration, have a look at http://www.aolserver.com Seems like a natural application for Erlang, except it's written in ... threaded TCL :-) (Somebody has already done a plug-in http://www.smlserver.com, by the way.) -- Thomas -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED]On Behalf Of Klacke Sent: den 12 februari 2002 13:38 To: Willem Broekema Cc: erlang-questions@REDACTED Subject: Re: yaws On Tue, Feb 12, 2002 at 12:53:41PM +0100, Willem Broekema wrote: > Claes Wikstrom wrote: > > Howdy folks, > > > > I've just started a little late-night-hack webserver project. > > I've come quite some distance in just a little while and it looks > > good. > > > > The reason I started was that > > I found myself in a position where I had to write a little dynamic > > content website and I discovered that php sucks bigtime. > > Right now you seem to create a template-based file-based web server. > > If you want to aim for something bigger, consider making it similar to > Zope, an open-source web application server written in Python, Actually it is allready an application server, it's just that the pages that show up on yaws.hyber.org don't do anything more fancy that including other files. Nothin there that plain ssi can't do. However, the erlang code that gets evaluated can do anything it wants. > , by adding a persistent storage for Erlang terms, maybe > using Mnesia? Can Mnesia store hierarchical data? In that case you can set > the server up to let server.com/folder1/folder2/term refer to the Erlang > term located in f1/f2. The storage can support transactions, undo etc (I'm > sure I have read Mnesia supports that). This already doable. I'll add some more fancy examples to make this more clear. > > Right now the templates do not work well together with WYSIWYG HTML > editors. This is indeed correct, and maybe I should be using one of those since Vlad pointed out that my HTML was bad, I may need it .... :-) > Zope has solved this by using the attributes of standard HTML tags > instead of new tags. In a separate XML namespace, template commands > are included. > > See Zope's Template Attribute Language > , > which is part of the functionality of Zope Page Templates, > . I think their > solution is quite neat and elegant, better than the current syntax. > > Ok, thanks, I'll take a look at those. -- Claes Wikstrom -- Caps lock is nowhere and Alteon WebSystems -- everything is under control http://www.bluetail.com/~klacke cellphone: +46 70 2097763 From taha@REDACTED Tue Feb 12 14:31:10 2002 From: taha@REDACTED (Walid Taha) Date: Tue, 12 Feb 2002 08:31:10 -0500 (EST) Subject: CFP Generators and Components (GCSE/SAIG'02) Message-ID: CALL FOR PAPERS The First ACM SIGPLAN/SIGSOFT Conference on Generators and Components (GCSE/SAIG'02) Supported by the National Science Foundation (NSF) Pittsburgh, PA, October 6-8, 2002. http://www.cs.yale.edu/~taha/gcse-saig/cfp02.html Invited Speakers: * Neil Jones, University of Denmark * Catuscia Palamidessi, Penn State University * Janos Sztipanovits, Vanderbilt University Program generation has the prospect of being an integral part of a wide range of software development processes. Many recent studies investigate different aspects of program generation, including their semantics, their application, and their implementation. Existing theories and systems address both high-level (source) language and low-level (machine) language generation. A number of programming languages now support program generation and manipulation, with different goals, implementation techniques, and targeted at different applications. The goal of this conference is to provide a meeting place for researchers and practitioners interested in this topic. A particular area of interest is component-based software development, which bears the promise of considerable productivity increases to software development comparable to the introduction of the assembly line in manufacturing. But due to the very same sophistication that makes components useful, their maintenance can be hard. Generative programming presents a promising approach to alleviating the above problems, as changes affecting components can now be more effectively managed during the generation process rather than at the component level. The goal of this joint event is to foster further cross-fertilization between the software engineering research community on the one hand, and the programming languages community on the other, in addition to supporting the original research goals of both GCSE and SAIG communities. We seek papers both in software engineering and programming languages, and especially those that bridge the gap. Being accessible to both communities at the same time is also valued. The conference solicits submissions related (but not limited) to: * Generative Programming: Reuse, meta-programming, partial evaluation, multi-stage and multi-level languages, * Semantics, type systems, symbolic computation, linking and explicit substitution, in-lining and macros, templates, program transformation, * Runtime code generation, compilation, active libraries, synthesis from specifications, development methods, generation of non-code artifacts, formal methods. Reflection. * Component-Based Software Engineering: Reuse, distributed platforms, distributed systems, evolution, analysis and design patterns, development methods, formal methods * Integration of Generative and Component-Based Approaches * Domain Engineering, analysis, and languages * Separation of Concerns: Aspect-Oriented Programming, Intentional * Programming, and Multi-Dimensional Separation of Concerns * Product Lines and generic architectures for that purpose. * Industrial Applications of Components and Generative Programming Reports on applications of these techniques to real-world problems are especially encouraged, as are submissions that relate ideas and concepts from several of these topics, or bridge the gap between theory and practice. The program committee is happy to advise on the appropriateness of a particular subject. General Chair: Walid Taha, Yale University, USA. Program Chair (GCSE focus): Don Batory, University of Texas at Austin, USA. Program Chair (SAIG focus): Charles Consel, INRIA, LaBRI, France. Program Committee (GCSE focus): Jan Bosch , University of Groningen Greg Butler, Concordia University Prem Devanbu, University of California at Davis Cristina Gacek, University of Newcastle upon Tyne Stan Jarzabek, National University of Singapore Kyo Kang, Pohang University of Science and Technology Peter Knauber, Fraunhofer Institute for Experimental Software Engineering Hausi Muller, University of Victoria Nenad Medvidovic, University of Southern California Wolfgang Pree, University of Constance Yannis Smaragdakis, Georgia Institute of Technology Douglas R. Smith , Kestrel Institute Program Committee (SAIG focus): Craig Chambers, University of Washington Shigeru Chiba, Tokyo Institute of Technology Pierre Cointe, Ecole des Mines de Nantes Dawson Engler, Stanford University Siau cheng Khoo, National University of Singapore Gregor Kiczales, University of British Columbia Martin Odersky, Ecole Polytechnique F?d?rale de Lausanne Calton Pu, Georgia Institute of Technology Peter Thiemann, Universit?t Freiburg Andrew Tolmach, Portland State University Submission Details: Authors are invited to submit papers of at most 5000 words (excluding figures), in postscript format (letter or A4), using the electronic submission form by March 21st, 2002. This deadline is firm. Both position and technical papers are welcome (Please indicate at time of submission.) Authors will be notified of acceptance by May 14th, 2002. Final version of the papers must be submitted by July 14, 2002. Format: The three day conference will contain slots for technical papers (45 minutes) and position papers (30 minutes). Both times include discussion. Position papers are expected to describe important future directions, ongoing work, and survey previous results. This category is best thought of as one for "competitive invited papers". Technical papers are expected to contain novel results. All papers will be reviewed by the program committee for the above-mentioned criteria, in addition to correctness and clarity. Simultaneous submission to other venues is not allowed, as is submission of previously published material. In addition, there will be time allocated for open discussions at the end of the conference. Proceedings will be published as an LNCS volume. Special Note on Combined Event: While the Program Committee is divided into two focus areas corresponding the parent events (GCSE and SAIG), there will be one unified program committee meeting. At the time of submission, authors must indicate whether they intend the paper for the GCSE audience, SAIG audience, or BOTH. The last category is the default, and is strongly encouraged. Papers submitted explicitly to only one focus will be accepted or rejected by the respective Program Chair. For papers submitted to BOTH, it is enough that one of the two Program Chairs accepts the paper. All members of the PC will allowed to bid for and review all papers, and cross-bidding is encouraged. The conference itself will not be divided along focus lines. Rather, an attempt will be made to ensure that each session is of interest to both parent communities. ------------------------------------------------------------------------- A printable version of this CFP is available at: http://www.cs.yale.edu/~taha/gcse-saig/cfp02.pdf From joe@REDACTED Tue Feb 12 15:04:40 2002 From: joe@REDACTED (Joe Armstrong) Date: Tue, 12 Feb 2002 15:04:40 +0100 Subject: yaws In-Reply-To: References: Message-ID: <200202121404.g1CE4fo03755@enfield.sics.se> On Tuesday 12 February 2002 1:46 pm, Vlad Dumitrescu wrote: > >If you want a neato protocol check out Chord. > > Yes, that seems like fun! > > >No JXTA also sucks (though less so than gnutella) - JXTA is a framework > > for P2P but is IMHO not the way to go. > > I haven't had time to look at it that much, but I think it might work... Yes it would work but there are problems - like - its overkill (using a battelship to kill a wallnut :-) - it doesn't map naturally onto Erlang. You have to set up a whole lot of stuff to do *anything* in JXTA. The JXTA spec is mostly a terminology for talking about the components of a P2P system - it gives the protocols that have to be obeyed by the different layers, BUT it gives no indication as to HOW they should be implemented - Full of "there should be a name service" that maps GUIDs to communication ports - bit it doen't say how to do this. Easier to roll your own. > > >I'm more attracted to the idea of very small peer-2-peer groups (everybody > >want's massive p2p groups) but what about the small one's. > >Why do I have to use ICQ to get a connection to a friend? - why not use a > >small p2p group for this. We could use yaws to keep track of the small p2p > >groups. > > But JXTA is just a protocol - it shouldn't matter if it's a small or large > group, does it? It just defines how the communication takes place. > > If ICQ was open-sourced, you could set up a private central server and let > only your friends connect to it. Then you'd have your small group, but also > the option to communicate with the rest of the world too. > > The protocol is orthogonal to the implementation (in theory), so any fixed > point (yaws or wikie or a cgi/php/asp script) can be used to put the peers > in contact with each other. > > Am I wrong? No quite right - I wrote an ICQ like thing'y for fun - only with *strong* encryption (ho ho) - I'll dig it out and put it up on a server for you to play with - this is the sort of component you're taking about. > > regards, > Vlad > > _________________________________________________________________ > Chatta med v?nner online, prova MSN Messenger: http://messenger.msn.se From jleite@REDACTED Tue Feb 12 14:55:04 2002 From: jleite@REDACTED (=?Windows-1252?Q?Jo=E3o_Alexandre_Leite?=) Date: Tue, 12 Feb 2002 13:55:04 -0000 Subject: CFP: CLIMA'02 - Computational Logic in Multi-Agent Systems Message-ID: <012201c1b3cc$e0b2d080$572216d5@netcabo.pt> [We apologize if you receive multiple copies of this message.] ****************************************************************** Preliminary Call for Papers Computational Logic in Multi-Agent Systems (CLIMA'02) Copenhagen, Denmark August 1, 2002 http://centria.di.fct.unl.pt/~jleite/clima02/ Affiliated with FLOC'2002 and ICLP'2002 Submission Deadline: April 30th, 2002 ****************************************************************** Multi-agent systems (MAS) have become an increasingly important area of research, not least because of the advances in the Internet and Robotics. However multi-agent systems can become very complicated, and, consequently, reasoning about the behaviour of such systems can become extremely difficult. Therefore, it is important to be able to formalise multi-agent systems and, to do so in such a way that allows automated reasoning about agents' behaviour. The purpose of this workshop is to present techniques, based on computational logic (CL), for multi-agent systems in a formal way. In 1999, the ICLP'99 Workshop on Multi-Agent Systems in Logic Programming was held and constituted the first in this series. It was followed by CLIMA'00 at CL2000 and CLIMA'01 at ICLP'01. In 2000, we announced a special issue of the Annals of Math and AI and we especially invited all accepted papers of CLIMA'00 for submission to this issue. We got over 20 submissions and the issue will appear early in 2002. We are planning to continue this series of workshops in the following years in order to foster interaction between the multi-agent and the computational logic communities. We solicit unpublished papers that address formal approaches to multi-agent systems. The approaches as well as being formal must make a significant contribution to the practice of multi-agent systems. Relevant techniques include the following: * Non-monotonic reasoning in multi-agent systems * Planning under incomplete information in multi-agent systems * Usage of abduction in multi-agent systems * Representation of knowledge and belief in multi-agent systems * Temporal reasoning for multi-agent systems * Theory of argumentation for multi-agent negotiation and co-operation * Communication languages for multi-agent systems * Distributed constraint satisfaction in multi-agent systems * Decision theory for multi-agents * Distributed theorem proving for multi-agent systems ------------------------------ SUBMISSION INSTRUCTIONS ------------------------------ Papers should be written in English, unpublished, and not simultaneously submitted for publication elsewhere. Papers should be formatted according to the Springer LNCS style and not exceed 12 pages including figures, references, etc. Please send your paper in PostScript (PS) or Portable Document Format (PDF) file format to jleite@REDACTED ------------------------------ IMPORTANT DATES ------------------------------ * Submission: April 30th, 2002 * Notification of Acceptance: May 31st, 2002 * Final version due: June 20th, 2002 * CLIMA'02: August 1st, 2002 ------------------------------ PROCEEDINGS ------------------------------ Informal workshop proceedings will be available. As in 2000, we are planning to have a special issue of the Annals of Math and AI on "Computational Logic and Multi-Agency". Authors of the best CLIMA'02 papers will be invited to submit extended drafts for the special issue as a part of the volume. Further details will be announced shortly. ------------------------------ PROGRAM COMMITTEE ------------------------------ * Thomas Eiter, Vienna University of Technology, Austria * Klaus Fischer, DFKI, Germany * Michael Fisher, University of Liverpool, UK * James Harland, Royal Melbourne Institute of Technology, Australia * Wiebe van der Hoek, Utrecht University, The Netherlands * Katsumi Inoue, Kobe University, Japan * Lu?s Moniz Pereira, New University of Lisbon, Portugal * V.S. Subrahmanian, University of Maryland, USA * Francesca Toni, Imperial College, UK * Paolo Torroni, University of Bologna, Italy ------------------------------ WORKSHOP ORGANIZERS: ------------------------------ * J?rgen Dix The University of Manchester UK dix@REDACTED * Jo?o Alexandre Leite New University of Lisbon Portugal jleite@REDACTED * Ken Satoh National Institute of Informatics, Japan ksatoh@REDACTED ------------------------------ INQUIRIES: ------------------------------ Please send program suggestions and inquires to either of the organizers. From Sean.Hinde@REDACTED Tue Feb 12 17:30:48 2002 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Tue, 12 Feb 2002 16:30:48 -0000 Subject: Erlang for Mac OS X Message-ID: <402DD461F109D411977E0008C791C312039F681B@imp02mbx.one2one.co.uk> > What's the state of Erlang for Mac OS X? > Is it buildable with the current distribution? It's mostly buildable with a bit of tweaking. I sent out a patch which made some more of it buildable some time ago, which I also attach here. Some of the libraries still don't build - you just need to touch lib/mnesia_session-.../SKIP or whatever when one breaks and start again. > Do dynamically loaded drivers work okay? Yes, very well. They need to be named x_drv.so not x_drv.dyld but apart from that they work fine. > Any performance numbers, as compared to other systems? Well, it seems pretty snappy running wings3d. I've never run any benchmarks. Good luck Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. -------------- next part -------------- A non-text attachment was scrubbed... Name: osx.patch Type: application/octet-stream Size: 2344 bytes Desc: not available URL: From joe@REDACTED Tue Feb 12 18:21:59 2002 From: joe@REDACTED (Joe Armstrong) Date: Tue, 12 Feb 2002 18:21:59 +0100 Subject: yaws In-Reply-To: References: Message-ID: <200202121721.g1CHLxg09149@enfield.sics.se> Another interesting thing to do might be Babblenet (which I just found) to quote IBM's site What is BabbleNet? BabbleNet is a completely decentralized, peer-to-peer (P2P), real-time chat program that allows users to create an ad hoc chat network without connecting to or installing a central server. Basically, it is a cross between Gnutella and IRC. BabbleNet was developed in a modular way so that the chat functionality sits upon a generic P2P framework. How does it work?The main components of BabbleNet are Chat user interface P2P framework for node-to-node communications Simple, XML-based P2P communication protocol Multicast peer location protocol. Cool - but what is the protocol? I havn't been able to find this yet /Joe From vlad_dumitrescu@REDACTED Wed Feb 13 06:46:04 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 13 Feb 2002 06:46:04 +0100 Subject: Peer to peer (was: yaws) References: <200202121721.g1CHLxg09149@enfield.sics.se> Message-ID: There seems to be a degree of interest in peer-to-peer technology and applications in Erlang (at least Joe and me, Vlad), so a place to discuss is neeeded without imposing on this lists' patience ;-). So I created http://www.bluetail.com:5999/wiki/allRefsToMe?node=PeerToPeer, where I took the liberty to insert some of the latest mail exchanges. best regards, Vlad From mbj@REDACTED Wed Feb 13 13:12:30 2002 From: mbj@REDACTED (Martin Bjorklund) Date: Wed, 13 Feb 2002 13:12:30 +0100 (CET) Subject: SNMP vulnerability Message-ID: <20020213.131230.104045377.mbj@bluetail.com> Hi, You might have seen that CERT has found vulnerabilities in many implementations of SNMP (http://www.cert.org/advisories/CA-2002-03.html) I've had an oppurtunity to run the tool they're using to find these falws towards OTP's SNMP agent (some 30.000 cases with mostly malformed ASN.1 PDUs). No security issues were found, and the agent did not waste resources during the test. However, I did found a couple of bugs; in some of the corner cases the packets were silently dropped but the snmpInASNParseErrs counter was not incremented. A patch for this bug is attached. (Also, looking at the code in snmp_pdus.erl, I realize that there is lots of room for improvments!) /martin -------------- next part -------------- *** /usr/local/lib/erlang/lib/snmp-3.3.3/src/snmp_pdus.erl Wed Dec 12 11:23:05 2001 --- snmp_pdus.erl Wed Feb 6 14:49:59 2002 *************** *** 256,274 **** {{'IpAddress', Value}, Rest}; dec_value([65 | Bytes]) -> {Value, Rest} = dec_integer_notag(Bytes), ! {{'Counter32', Value}, Rest}; dec_value([66 | Bytes]) -> {Value, Rest} = dec_integer_notag(Bytes), ! {{'Unsigned32', Value}, Rest}; dec_value([67 | Bytes]) -> {Value, Rest} = dec_integer_notag(Bytes), ! {{'TimeTicks', Value}, Rest}; dec_value([68 | Bytes]) -> {Value, Rest} = dec_oct_str_notag(Bytes), {{'Opaque', Value}, Rest}; dec_value([70 | Bytes]) -> {Value, Rest} = dec_integer_notag(Bytes), ! {{'Counter64', Value}, Rest}; dec_value([128,0|T]) -> {{'NULL', noSuchObject}, T}; dec_value([129,0|T]) -> --- 253,287 ---- {{'IpAddress', Value}, Rest}; dec_value([65 | Bytes]) -> {Value, Rest} = dec_integer_notag(Bytes), ! if Value >= 0, Value =< 4294967295 -> ! {{'Counter32', Value}, Rest}; ! true -> ! exit({error, {bad_counter32, Value}}) ! end; dec_value([66 | Bytes]) -> {Value, Rest} = dec_integer_notag(Bytes), ! if Value >= 0, Value =< 4294967295 -> ! {{'Unsigned32', Value}, Rest}; ! true -> ! exit({error, {bad_unsigned32, Value}}) ! end; dec_value([67 | Bytes]) -> {Value, Rest} = dec_integer_notag(Bytes), ! if Value >= 0, Value =< 4294967295 -> ! {{'TimeTicks', Value}, Rest}; ! true -> ! exit({error, {bad_timeticks, Value}}) ! end; dec_value([68 | Bytes]) -> {Value, Rest} = dec_oct_str_notag(Bytes), {{'Opaque', Value}, Rest}; dec_value([70 | Bytes]) -> {Value, Rest} = dec_integer_notag(Bytes), ! if Value >= 0, Value =< 18446744073709551615 -> ! {{'Counter64', Value}, Rest}; ! true -> ! exit({error, {bad_counter64, Value}}) ! end; dec_value([128,0|T]) -> {{'NULL', noSuchObject}, T}; dec_value([129,0|T]) -> *************** *** 288,294 **** length(Tail) == Size -> Tail; true -> ! exit({error, {'wrong length', Bytes}}) end. split_at(L, 0, Acc) -> {lists:reverse(Acc), L}; --- 301,307 ---- length(Tail) == Size -> Tail; true -> ! exit({error, {wrong_length, Bytes}}) end. split_at(L, 0, Acc) -> {lists:reverse(Acc), L}; *************** *** 676,686 **** enc_integer_tag(Val) when Val >= 0 -> %% stdcase positive ints Bytes = eint(Val,[]), ! [2, length(Bytes) | Bytes]; enc_integer_tag(Val) -> %% It's a negative number Bytes = enint(Val,[]), ! [2, length(Bytes) | Bytes]. enc_integer_notag(Val) when Val >= 0 -> %% stdcase positive ints eint(Val,[]); --- 689,699 ---- enc_integer_tag(Val) when Val >= 0 -> %% stdcase positive ints Bytes = eint(Val,[]), ! [2 | elength(length(Bytes))] ++ Bytes; enc_integer_tag(Val) -> %% It's a negative number Bytes = enint(Val,[]), ! [2 | elength(length(Bytes))] ++ Bytes. enc_integer_notag(Val) when Val >= 0 -> %% stdcase positive ints eint(Val,[]); From vlad_dumitrescu@REDACTED Wed Feb 13 14:11:10 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 13 Feb 2002 14:11:10 +0100 Subject: Wiki bug (or feature?) Message-ID: Hi folks, Contrary to what I thought I knew about Wikie, it is possible to take a page that is not password protected and change it into a password protected one. The drawback is that the history is lost. One only has to go to "/wiki/createNewPage?node=" and paste the content of the old page in the text field. best regards, Vlad _________________________________________________________________ Chatta med v?nner online, prova MSN Messenger: http://messenger.msn.se From vlad_dumitrescu@REDACTED Wed Feb 13 14:39:52 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 13 Feb 2002 14:39:52 +0100 Subject: Node connections Message-ID: Hi again, Looks like I have some time to think about things! ;-) I don't remember reading anything about this, but the question should have had come up before... If an Erlang node is configured to keep connections with all nodes it comes in contact with, does it permanently occupy sockets for those connections? If yes, how can one disconnect from just some nodes, without restarting? (I am referring to connections for the Erlang distribution mechanism, not gen_tcp) thanks. regards, Vlad _________________________________________________________________ MSN Photos ?r det enklaste s?ttet att dela ut och skriva ut foton: http://photos.msn.se/Support/WorldWide.aspx From vlad_dumitrescu@REDACTED Wed Feb 13 15:07:12 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 13 Feb 2002 15:07:12 +0100 Subject: Node connections Message-ID: Ouch, I forgot about erlang:disconnect_node... Sorry for the disturbance. Now I'm going home and let you have some peace and quiet. regards, Vlad >From: "Vlad Dumitrescu" >To: erlang-questions@REDACTED >Subject: Node connections >Date: Wed, 13 Feb 2002 14:39:52 +0100 > >Hi again, > >Looks like I have some time to think about things! ;-) > >I don't remember reading anything about this, but the question should have >had come up before... If an Erlang node is configured to keep connections >with all nodes it comes in contact with, does it permanently occupy sockets >for those connections? If yes, how can one disconnect from just some nodes, >without restarting? (I am referring to connections for the Erlang >distribution mechanism, not gen_tcp) > >thanks. regards, >Vlad > >_________________________________________________________________ >MSN Photos ?r det enklaste s?ttet att dela ut och skriva ut foton: >http://photos.msn.se/Support/WorldWide.aspx > _________________________________________________________________ Chatta med v?nner online, prova MSN Messenger: http://messenger.msn.se From vances@REDACTED Wed Feb 13 15:44:26 2002 From: vances@REDACTED (Vance Shipley) Date: Wed, 13 Feb 2002 09:44:26 -0500 Subject: Event Modeling Language Message-ID: I've been trying out the Event Modeling Language: http://www.erlang.se/euc/99/Event.ps Is anyone actively using this? Has it proved useful? Is anyone currently using the "EML" plugin(*) for Dia? Are there any other tools available for generating these diagrams? Are there other graphical notations I should consider? Thanks, -Vance Vance Shipley Motivity Telecom Inc. +1 519 579 5816 * Written by Vladimir Sekissov and found in the current distribution of Dia. http://www.lysator.liu.se/~alla/dia It does seem a bit broken at the moment but that may be due to it not having been maintained. They've changed things in Dia since it's contribution. From etxuwig@REDACTED Wed Feb 13 17:44:13 2002 From: etxuwig@REDACTED (Ulf Wiger) Date: Wed, 13 Feb 2002 17:44:13 +0100 (MET) Subject: SNMP vulnerability In-Reply-To: <20020213.131230.104045377.mbj@bluetail.com> Message-ID: Well, I'm not sure about the "did not waste resources" part. ;) It seems as if the snmp agent pretty prints an error message upon a decoding error. For some of the PDUs, this message can become quite sizeable, e.g. after a badarg on list_to_binary(LongBadList). I think the appropriate thing to do for a protocol handler is to _optionally_ log invalid messages in the cheapest way possible (using e.g. disk_log). This is simple enough to fix. Try the following for grins (not entirely accurate, but close enough): 1> L = lists:seq(1,256). [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29|...] 2> Reason = (catch list_to_binary(L)). {'EXIT',{badarg,[{erlang,list_to_binary, [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19|...]]}, {erl_eval,expr,3}, {erl_eval,exprs,4}, {shell,eval_loop,2}]}} 5> snmp_error:user_err("failed encoding message only(pdu: ~p, community: ~p): ~p~n", [L,"public",]). ok 6> =ERROR REPORT==== 13-Feb-2002::17:15:32 === ** User error: failed encoding message only(pdu: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, (In general, someone should come up with a nice way to protect against io:format()s or crash reports with huge information payload.) Running this on an embedded system with start_erl and to_erl (and to_erl activated which means I/O gets directed to both screen and disk) on a Solaris system (seemingly slower I/O system than Linux, and no graphics accelerators), might cause some disturbance. /Uffe On Wed, 13 Feb 2002, Martin Bjorklund wrote: >Hi, > >You might have seen that CERT has found vulnerabilities in many >implementations of SNMP >(http://www.cert.org/advisories/CA-2002-03.html) > >I've had an oppurtunity to run the tool they're using to find >these falws towards OTP's SNMP agent (some 30.000 cases with >mostly malformed ASN.1 PDUs). No security issues were found, >and the agent did not waste resources during the test. > >However, I did found a couple of bugs; in some of the corner >cases the packets were silently dropped but the >snmpInASNParseErrs counter was not incremented. A patch for >this bug is attached. (Also, looking at the code in >snmp_pdus.erl, I realize that there is lots of room for >improvments!) > > >/martin > > From mbj@REDACTED Wed Feb 13 20:33:10 2002 From: mbj@REDACTED (Martin Bjorklund) Date: Wed, 13 Feb 2002 20:33:10 +0100 (CET) Subject: SNMP vulnerability In-Reply-To: References: <20020213.131230.104045377.mbj@bluetail.com> Message-ID: <20020213.203310.74746790.mbj@bluetail.com> Ulf Wiger wrote: > > Well, I'm not sure about the "did not waste resources" part. ;) > > It seems as if the snmp agent pretty prints an error message > upon a decoding error. For some of the PDUs, this message can > become quite sizeable, e.g. after a badarg on > list_to_binary(LongBadList). Well, it's just because you're using the default error logging mechanism - the idea is that you should write your own logging module! However, this good idea is badly implemented - it was implemented before OTP and does not fit into the OTP framework (you need to write your own snmp_error module, i.e. it's name must be snmp_error). It should be redone. /martin From klacke@REDACTED Wed Feb 13 21:58:27 2002 From: klacke@REDACTED (Klacke) Date: Wed, 13 Feb 2002 21:58:27 +0100 Subject: yaws In-Reply-To: <20020212021802.A18456@hyber.org>; from klacke@hyber.org on Tue, Feb 12, 2002 at 02:18:02AM +0100 References: <20020212021802.A18456@hyber.org> Message-ID: <20020213215827.B30036@bluetail.com> Ok, minor update. 0.21 now. Should fix the broken HTML as well as some other minor stuff. http://yaws.hyber.org -- Claes Wikstrom -- Caps lock is nowhere and Alteon WebSystems -- everything is under control http://www.bluetail.com/~klacke cellphone: +46 70 2097763 From vlad_dumitrescu@REDACTED Thu Feb 14 10:09:38 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Thu, 14 Feb 2002 10:09:38 +0100 Subject: p2p summary (kind of) Message-ID: Hello everyone! After turning inside out the peer2peer concept for the last days, I reached some conclusions that might (some of them at least) be of interest for you. The ones that are just random greek ;-) just ignore them. The text is also available on the Wiki. - there are many protocols on the making, but none was really an "aha!" experience, except maybe Chord, recommended by Joe. - I don't have the time to build/implement a low-level protocol, even if that would give immediate reward by being able to connect to an already existing network - Erlang offers "for free" much of the basic functionality that is needed to create a p2p network, through the distribution mechanism. However, Erlang's actual design probably doesn't scale up and if trying that it might end up just as Gnutella did... - What I am mostly interested is a general framework that will permit p2p applications to be built upon. This means that the basic services are to be at least: connectivity, routing and gatewaying, security, search (of any kind: for other peers, for data, for services/applications). The applications should be just plugins that use the connection provided, using their own protocol. - The protocols in use tend to begin using XML. This is just because they must write instead of {searchresult, [{id, 3}], [ {item, [{id, 4},{name, "file1"}, {node, "12.12.12.12:3333"], []}, {item, [{id, 7},{name, "file3"}, {node, "12.132.12.13:2424"], []} ] } This is really a matter of taste. Converting between the two is straightforward. - Let us see how Erlang works for the 4 areas outlined above (I only guess some of this stuff, please fill in the right situation if you know I'm wrong): -- connectivity: it is automatic using the underlying distribution mechanism; but will it scale? I doubt it strongly. A fully connected net is not manageable (not with thousands of nodes), so the connections should be kept limited. This creates the need of relaying messages between nodes that aren't directly connected, because it would be very elegant if the present location transparency would be kept. I.E. are Pids enough for identifying processes on nodes that aren't connected? -- routing and gatewaying: nothing exists now that will help in this case, as far as I know. This is functionality that must be built in. One of the most important things is how to be able to bridge through firewalls, or over different kind of networks. -- security: here we have a big can of worms... as Erlang works now it is fully open for anyone knowing the cookie. Some studies have been made, but since we are only talking about exchanging messages, not code, we probably don't need SafeErlang yet. Probably it would be enough with a node that has a modified net_kernel AND it doesn't allow for more than message passing (no remote spawns). I'm not sure if the latter can be achieved only via net_kernel. There is also another problem: how to get all nodes have the same cookie? That might be possible to get around with a new net_kernel (if this control isn't buried deeper), and allow nodes with different cookies to connect, and possibly have different security policies for different cookies. This way a node can be a full node on the intranet, while being connected to the outside world too. -- search: this is mostly a p2p issue, so it isn't addressed in today's Erlang. A protocol needs to be defined and implemented, that will also rule the routing and gatewaying behaviour. - The big problem here is that there might be security issues that won't be noticed until it's too late. Because of that it is wiser to have a separate connection management, where we can more easily decide what's okay and what's not. This might ease up the task of bridgeing with different networks (instead of an IP socket we use another transport, or we go over HTTP). It won't be as elegant as Pid ! Msg, but I for one can live with send(Pid, Msg) :-) - Of course, one can write p2p applications without any such platform underneath. But it's kind of a waste to address the same issues for every application, and the one that each one of them will necessary meet is how to access nodes behind firewalls. What do you people think? Am I babbleing, or is there a trace of rational thinking? best regards, Vlad _________________________________________________________________ Kom med i v?rldens st?rsta e-posttj?nst; MSN Hotmail. http://www.hotmail.com/sv From matthias@REDACTED Thu Feb 14 10:26:17 2002 From: matthias@REDACTED (matthias@REDACTED) Date: Thu, 14 Feb 2002 10:26:17 +0100 Subject: erlang comment spotted on slashdot Message-ID: <15467.33465.646632.311266@corelatus.se> Spotted on slashdot today: Erlang Virus Propagation System (Score:3, Interesting) by Anonymous Coward on 14/02/02 1:35 (#3004254) "A fully coordinated worm, where the worms explicitly coordinate their attack on the network, is a theoretical possibility but has not been seen in practice due to the difficulty in coding and coordinating the worms." Obviously the author has not heard of the interpreted, functional programming language Erlang. It can be best described as "The Borg" and has language level support for things like automatic resource discovery, live updates of software modules and distributed databases. There are binaries available for many architectures. An attack platform written in this language has the potential to be utterly devastating. Imagine, all of the infected nodes know about all of the other nodes. You have a distributed database containing information on exploits and probes for various computer systems that can be updated on the fly as new exploits are discovered. Even the code for the platform itself can be updated while the system is running. Matthias (and now I understand why certain policies were written ;-) From joe@REDACTED Thu Feb 14 11:00:29 2002 From: joe@REDACTED (Joe Armstrong) Date: Thu, 14 Feb 2002 11:00:29 +0100 Subject: p2p summary (kind of) In-Reply-To: References: Message-ID: <200202141000.g1EA0Tt09297@enfield.sics.se> > Hello everyone! > > After turning inside out the peer2peer concept for the last days, I reached > some conclusions that might (some of them at least) be of interest for you. > The ones that are just random greek ;-) just ignore them. The text is also > available on the Wiki. > > - there are many protocols on the making, but none was really an "aha!" > experience, except maybe Chord, recommended by Joe. > > - I don't have the time to build/implement a low-level protocol, even if > that would give immediate reward by being able to connect to an already > existing network No the existing ones are crap :-) - Gutella is like wandering into a random room in a random town in a random country and shouting at a random group of passers by "has anybody got a fish" I've been thinking about the "discovery protocol" for some time - and the answer is ..... "Dewey" Assume we have producers and consumers of information we need to discover who knows what. If I have a car for sale the best way to sell it is to place an ad in the local paper in the "Pets section" - the ad might read Banana for sale one careful owner 10,000$ This is how the internet works - crap - then we invent Google (a miscropic improvement) If we have a ?Key -> Value namespace (which is what the producer/consumer paradigm is) then we must agree on the Keys and what they mean. "car" Means that tin thing that costs a lot spews out poisinous gases despoilse the environment and slows down personal transportation between A and B. "banana" means yellow thing whose skin you slip on. So how do we agree on Keys (use the dewey decimal system, or library of congress catelogging system - librariens have thought about this for yonks). How do you find info in the p2p system - by *carefully* probing the peer group and asking the right questions - by building catalogues and maintaining trust neworks (do I believe this information) JXTR says "Info is keyed by ten zillion bit (random) globally unique identifiers." Now I can't even say "banana for sale" when I want to sell my car Now I must say 328fgfjghsfio37465o8ybamfo82347b3245325kjf741hkht for sale apply to 3985728356hfjahecuyrileuayct97kfkurfyselihfilaerh for more details And to make it technically respectable I'd do it XML and program it in Java But that *basicaly* is what JXTR is (at the most primitive level) - with not even a hint as to HOW you go about finding the meading of the GUIDs. (I might even specify it in UML and hire fifty consultants for good measure :-) No my infrastruce will use the dewey decimal system - and I will keep data bases of who knows what and how reliable the information is That feels better :-) > > - Erlang offers "for free" much of the basic functionality that is needed > to create a p2p network, through the distribution mechanism. However, > Erlang's actual design probably doesn't scale up and if trying that it > might end up just as Gnutella did... Erlang is a programing language - PLs don't scale up! > > - What I am mostly interested is a general framework that will permit p2p > applications to be built upon. This means that the basic services are to be > at least: connectivity, routing and gatewaying, security, search (of any > kind: for other peers, for data, for services/applications). The > applications should be just plugins that use the connection provided, using > their own protocol. I've covered search (or resource discovery) I am building such an infrastructure NOW - hope to post by end of next week > > - The protocols in use tend to begin using XML. This is just because they > must write > > > > > > > instead of > > {searchresult, [{id, 3}], > [ > {item, [{id, 4},{name, "file1"}, > {node, "12.12.12.12:3333"], []}, > {item, [{id, 7},{name, "file3"}, > {node, "12.132.12.13:2424"], []} > ] > } > > This is really a matter of taste. Converting between the two is > straightforward. > > - Let us see how Erlang works for the 4 areas outlined above (I only guess > some of this stuff, please fill in the right situation if you know I'm > wrong): > > -- connectivity: it is automatic using the underlying distribution > mechanism; but will it scale? I doubt it strongly. A fully connected net is > not manageable (not with thousands of nodes), so the connections should be > kept limited. This creates the need of relaying messages between nodes that > aren't directly connected, because it would be very elegant if the present > location transparency would be kept. I.E. are Pids enough for identifying > processes on nodes that aren't connected? No - need IP's ports etc and STATE > > -- routing and gatewaying: nothing exists now that will help in this case, > as far as I know. This is functionality that must be built in. One of the > most important things is how to be able to bridge through firewalls, or > over different kind of networks. > Smile :-) - we gould you segiography and communicate with gifs of yellow bananas on port 80 :-) > -- security: here we have a big can of worms... as Erlang works now it is > fully open for anyone knowing the cookie. Some studies have been made, but > since we are only talking about exchanging messages, not code, we probably > don't need SafeErlang yet. Probably it would be enough with a node that has > a modified net_kernel AND it doesn't allow for more than message passing > (no remote spawns). I'm not sure if the latter can be achieved only via > net_kernel. There is also another problem: how to get all nodes have the > same cookie? That might be possible to get around with a new net_kernel (if > this control isn't buried deeper), and allow nodes with different cookies > to connect, and possibly have different security policies for different > cookies. This way a node can be a full node on the intranet, while being > connected to the outside world too. RSA with 2K bytes keys + Hiffie Hellman. My RSA is on the Erlang web site. Diffie Hellamn is trivial (almost :-) > -- search: this is mostly a p2p issue, so it isn't addressed in today's > Erlang. A protocol needs to be defined and implemented, that will also rule > the routing and gatewaying behaviour. > > - The big problem here is that there might be security issues that won't be > noticed until it's too late. Because of that it is wiser to have a separate > connection management, where we can more easily decide what's okay and > what's not. This might ease up the task of bridgeing with different > networks (instead of an IP socket we use another transport, or we go over > HTTP). It won't be as elegant as Pid ! Msg, but I for one can live with > send(Pid, Msg) > > :-) > > - Of course, one can write p2p applications without any such platform > underneath. But it's kind of a waste to address the same issues for every > application, and the one that each one of them will necessary meet is how > to access nodes behind firewalls. > > What do you people think? Am I babbleing, or is there a trace of rational > thinking? No not at all - I babble with you - I plan to register a new domain name and host a myp2p.org (or whatever) at SICS with an Erlang P2p infracstructre real soon - Then you can all help write the apps. The first real app (on top of IRC/chat/file sharing - which is easy) is backup. > > best regards, > Vlad > Have a nice one (as Ann-Louise used to say) /Joe <> From vlad_dumitrescu@REDACTED Thu Feb 14 11:36:58 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Thu, 14 Feb 2002 11:36:58 +0100 Subject: p2p summary (kind of) Message-ID: > :-) nice to see someone really feeling for an issue! >No the existing ones are crap :-) - Gutella is like wandering into a random >room in a random town in a random country and shouting at a random group of >passers by "has anybody got a fish" TRUE! but for only 20 peers, it works fine! >I've been thinking about the "discovery protocol" for some time - and >the answer is ..... "Dewey" Doesn't that cost money? I'm not even sure if they have a licensing programme yet (but I suppose the interest exists). >How do you find info in the p2p system - by *carefully* probing the peer >group and asking the right questions - by building catalogues and >maintaining trust neworks (do I believe this information) Absolutely!!! >JXTR says "Info is keyed by ten zillion bit (random) globally unique >identifiers." And Dewey says "Info is keyed by ten milion decimal digit hierarchical identifiers". Is it such a big difference? >But that *basicaly* is what JXTR is (at the most primitive level) - with >not even a hint as to HOW you go about finding the meading of the GUIDs. The advantage of UUIDs is that you can have one for exactly YOUR red Volvo S40 car's driving wheel, or something. Using Dewey, you can at most get a reference to any driving wheel, and link it to a reference to Volvos and to yourself as the owner... >No my infrastruce will use the dewey decimal system - and I will keep data >bases of who knows what and how reliable the information is Personally I think it is an internal matter. Applications should not have to see those identifiers at all. A naming service should take care of that, in either case. A DNS for the universe, maybe? :-) >That feels better :-) Good! >Erlang is a programing language - PLs don't scale up! I meant the Erlang distribution mechanism. Is it correct now? >I am building such an infrastructure NOW - hope to post by end of next week Looking forward to it! I will start with more concrete stuff myself too. > > -- routing and gatewaying: ... >Smile :-) - we gould you segiography and communicate with gifs of yellow >bananas on port 80 :-) :-) No, but send the erlang messages over http as binary/octet-stream, if the receiver is behind a firewall. >No not at all - I babble with you - I plan to register a new domain name >and host a myp2p.org (or whatever) at SICS with an Erlang P2p >infracstructre real soon - Wonderful! regards, Vlad _________________________________________________________________ Chatta med v?nner online, prova MSN Messenger: http://messenger.msn.se From joe@REDACTED Thu Feb 14 12:19:36 2002 From: joe@REDACTED (Joe Armstrong) Date: Thu, 14 Feb 2002 12:19:36 +0100 Subject: p2p summary (kind of) In-Reply-To: References: Message-ID: <200202141119.g1EBJaJ09664@enfield.sics.se> On Thursday 14 February 2002 11:36 am, Vlad Dumitrescu wrote: > > > > > :-) nice to see someone really feeling for an issue! > : > >No the existing ones are crap :-) - Gutella is like wandering into a > > random room in a random town in a random country and shouting at a random > > group of passers by "has anybody got a fish" > > TRUE! but for only 20 peers, it works fine! > > >I've been thinking about the "discovery protocol" for some time - and > >the answer is ..... "Dewey" > > Doesn't that cost money? I'm not even sure if they have a licensing > programme yet (but I suppose the interest exists). > I don't know I hope not :-( > >How do you find info in the p2p system - by *carefully* probing the peer > >group and asking the right questions - by building catalogues and > >maintaining trust neworks (do I believe this information) > > Absolutely!!! > > >JXTR says "Info is keyed by ten zillion bit (random) globally unique > >identifiers." > > And Dewey says "Info is keyed by ten milion decimal digit hierarchical > identifiers". Is it such a big difference? > Yes - an incredable difference. Dewey category code has a *meaning* 470 is "Italic Languages. Latin" - librarians spend their entire life figureing out what code to give a particular thing. The GUID is a random string. > >But that *basicaly* is what JXTR is (at the most primitive level) - with > >not even a hint as to HOW you go about finding the meading of the GUIDs. > > The advantage of UUIDs is that you can have one for exactly YOUR red Volvo > S40 car's driving wheel, or something. Using Dewey, you can at most get a > reference to any driving wheel, and link it to a reference to Volvos and to > yourself as the owner... > > >No my infrastruce will use the dewey decimal system - and I will keep data > >bases of who knows what and how reliable the information is > > Personally I think it is an internal matter. Applications should not have > to see those identifiers at all. A naming service should take care of that, > in either case. A DNS for the universe, maybe? :-) IMHO the naming service is cenral and integral to the p2p system not outside it. > > >That feels better :-) > > Good! > > >Erlang is a programing language - PLs don't scale up! > > I meant the Erlang distribution mechanism. Is it correct now? > > >I am building such an infrastructure NOW - hope to post by end of next > > week > > Looking forward to it! I will start with more concrete stuff myself too. > > > > -- routing and gatewaying: ... > > > >Smile :-) - we gould you segiography and communicate with gifs of yellow > >bananas on port 80 :-) > > > :-) No, but send the erlang messages over http as binary/octet-stream, if > > the receiver is behind a firewall. > > >No not at all - I babble with you - I plan to register a new domain name > >and host a myp2p.org (or whatever) at SICS with an Erlang P2p > >infracstructre real soon - > > Wonderful! > > regards, > Vlad > > _________________________________________________________________ > Chatta med v?nner online, prova MSN Messenger: http://messenger.msn.se From vlad_dumitrescu@REDACTED Thu Feb 14 13:00:41 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Thu, 14 Feb 2002 13:00:41 +0100 Subject: p2p summary (kind of) Message-ID: Hi, I'd like to check if my understanding of terms is in accordance with yours or not. In my world, an UUID is a reference to something, like a C pointer. A Dewey category is a description of a group of entities, meta-data; like a type declaration for a C entity. Therefore, they are two completely different beasts, each with its usefulness. I think they are both needed (not necessarily in the form of UUIDs and Dewey numbers, but as a reference to something and a type description of that something). It's hard to imagine how things would work without any of them. In the p2p world, UUIDs (or other kind of unique references) can identify specific users, or specific services, or specific global data. Dewey numbers (or other kind of meta-data) can be used in searches, as a complement to regexps :-), and in describing the thingie that an UUID refers to. best regards, Vlad _________________________________________________________________ MSN Photos ?r det enklaste s?ttet att dela ut?och skriva ut foton: http://photos.msn.se/Support/WorldWide.aspx From joe@REDACTED Thu Feb 14 13:55:55 2002 From: joe@REDACTED (Joe Armstrong) Date: Thu, 14 Feb 2002 13:55:55 +0100 Subject: p2p summary (kind of) In-Reply-To: References: Message-ID: <200202141255.g1ECttW10202@enfield.sics.se> On Thursday 14 February 2002 1:00 pm, Vlad Dumitrescu wrote: > Hi, > > I'd like to check if my understanding of terms is in accordance with yours > or not. > > In my world, an UUID is a reference to something, like a C pointer. > I was thinking of the meaning that the JXTR spec. uses. Quote: JXTR uses UUID, a 128 bit-datum to refer to a peer ... omitted .. It become significant only after it is bound to other information ... We assume and expect that sophisticated naming and binding services will be developed for the JXTR platform EndQuote. Which I take to mean it's a 128 bit thing that points to something but *finding the thing it points to is not defined* - but this to me is the knux of the problem. > A Dewey category is a description of a group of entities, meta-data; like a > type declaration for a C entity. > It's a standard for names. > Therefore, they are two completely different beasts, each with its > usefulness. I think they are both needed (not necessarily in the form of > UUIDs and Dewey numbers, but as a reference to something and a type > description of that something). It's hard to imagine how things would work > without any of them. > Yes you need both. > In the p2p world, UUIDs (or other kind of unique references) can identify > specific users, or specific services, or specific global data. Dewey > numbers (or other kind of meta-data) can be used in searches, as a > complement to regexps :-), and in describing the thingie that an UUID > refers to. My problem (with JXTR) is that if you read the standard for ideas whenever things start getting interesting (like how to find the peer where a UUID came from) the text get vague and says (this is out of scope, or, an implementation issue, or, they "expect that something will be developed which will ...") It's a kind of empty framwork with a terminology - admittedly it clarifies various design issues (like breaking things up into different prototcols, the discovery protocol, the peer resolver protocol etc.) but as you dig into the detail you find there is no *helpful* detail in the sence that the detail provides insights into how to do things. I guess this is getting very off-topic (sorry) - we'll move to the wiki > best regards, > Vlad > > _________________________________________________________________ > MSN Photos ?r det enklaste s?ttet att dela ut?och skriva ut foton: > http://photos.msn.se/Support/WorldWide.aspx From sn@REDACTED Thu Feb 14 14:26:53 2002 From: sn@REDACTED (Stefan Nickl) Date: Thu, 14 Feb 2002 14:26:53 +0100 (CET) Subject: p2p summary (kind of) In-Reply-To: <200202141000.g1EA0Tt09297@enfield.sics.se> Message-ID: This talking about namespaces, Key -> Value mappings reminded me of a document from Hans Reiser that was also on Slashdot recently: http://www.namesys.com/whitepaper.html http://slashdot.org/article.pl?sid=02/01/29/1735234&mode=thread http://www.theregister.co.uk/content/4/23852.html The reason for bringing this up again were the signs that the next major Windoze shall unify the filesystem with a database server. But I remember Mr. Reiser writing (mostly incomprehensible stuff to me :) about namespaces when reiserfs turned up first. CU, SN ------ The UNIX equivalent of the "Blue Screen of Death" would be called "kernel panic". It obviously exists, since I have heard and read about it, but I've never been witness to it in my professional career. John Kirch, Networking Consultant and Microsoft Certified Professional (Windows NT) From rpettit@REDACTED Thu Feb 14 16:55:08 2002 From: rpettit@REDACTED (Rick Pettit) Date: Thu, 14 Feb 2002 09:55:08 -0600 (CST) Subject: erlang comment spotted on slashdot In-Reply-To: <15467.33465.646632.311266@corelatus.se> Message-ID: > Erlang Virus Propagation System (Score:3, Interesting) > by Anonymous Coward on 14/02/02 1:35 (#3004254) Fortunately this guy has not yet even begun playing with the language (I know, I went to school with and now share an apartment with him). The thought of someone using Erlang for evil purposes is a little frightening none the less... -Rick From enano@REDACTED Thu Feb 14 17:12:09 2002 From: enano@REDACTED (Miguel Barreiro Paz) Date: Thu, 14 Feb 2002 17:12:09 +0100 (CET) Subject: p2p summary (kind of) In-Reply-To: Message-ID: > The reason for bringing this up again were the signs that the > next major Windoze shall unify the filesystem with a database server. Oh, looks like they're almost catching up with OS/400 }:) From hal@REDACTED Thu Feb 14 18:00:34 2002 From: hal@REDACTED (Hal Snyder) Date: 14 Feb 2002 11:00:34 -0600 Subject: erlang comment spotted on slashdot In-Reply-To: (Rick Pettit's message of "Thu, 14 Feb 2002 09:55:08 -0600 (CST)") References: Message-ID: <87sn84t2vh.fsf@gamera.vail> Rick Pettit writes: >> Erlang Virus Propagation System (Score:3, Interesting) >> by Anonymous Coward on 14/02/02 1:35 (#3004254) Hoping this is an example of there being no such thing as bad publicity. > Fortunately this guy has not yet even begun playing with the > language (I know, I went to school with and now share an apartment > with him). Please keep him away from sharp objects (and OTP) as he would probably hurt himself. Ad OTP. It seems there are three or more separate initiatives to upgrade inets to HTTP-1.1 plus various other fixes/features. Any hints yet as to what is going to happen to the official OTP release? I confess I've refrained from downloading the daily builds - busy writing to last October's R8 and hoping for a changelog to surface at the download site... From garry@REDACTED Fri Feb 15 15:28:56 2002 From: garry@REDACTED (Garry Hodgson) Date: Fri, 15 Feb 2002 09:28:56 -0500 Subject: how do i specify include path? Message-ID: <3C6D1B28.5702B45C@sage.att.com> i know i use the -pa flag on the erl command line to specify module path, but i can't seem to find the corresponding flag to set include path, so it can find the necessary .hrl files when compiling. i see a -I on erlc, but it doesn't appear to work within erl, when using c(modulename). any clues? thanks -- Garry Hodgson Let my inspiration flow Senior Hacker in token rhyme suggesting rhythm Software Innovation Services that will not forsake me AT&T Labs 'til my tale is told and done. garry@REDACTED From yrashk@REDACTED Fri Feb 15 14:48:07 2002 From: yrashk@REDACTED (Yurii A. Rashkovskii) Date: Fri, 15 Feb 2002 15:48:07 +0200 Subject: distributed messaging Message-ID: <002601c1b627$66dec5e0$5864a8c0@softerra.int> Guys and gals, I got an error while trying to setup distributed messaging. My server module says 'Connection attempt from disallowed node.'. I always have used messaging only one host, but now need to communicate between different hosts; on one host server works properly. What can you advise? How can I make certain node allowed? -- Best regards, Yurii (http://yar.com.ua/) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Ingela.Anderton@REDACTED Fri Feb 15 16:48:10 2002 From: Ingela.Anderton@REDACTED (UAB/L/K Ingela Anderton konsult OTP) Date: Fri, 15 Feb 2002 16:48:10 +0100 (MET) Subject: distributed messaging References: <002601c1b627$66dec5e0$5864a8c0@softerra.int> Message-ID: <15469.11481.340062.11860@gildor> The answer to your question you can find at: http://erlang.ericsson.se/doc/doc-5.1/doc/getting_started/part_frame.html section 1.6.4 Yurii A. Rashkovskii wrote: > Guys and gals, > > I got an error while trying to setup distributed messaging. My server > module says 'Connection attempt from disallowed node.'. I always have > used messaging only one host, but now need to communicate between > different hosts; on one host server works properly. What can you advise? > How can I make certain node allowed? > > -- > Best regards, > Yurii (http://yar.com.ua/) > > > > > > > > > distributed messaging > > > > >

Guys and gals,

> >

I got an error while trying to setup distributed messaging. My server module says Connection attempt from disallowed node…’. I always have used messaging only one host, but now need to communicate between different hosts; on one host server works properly. What can you advise? How can I make certain node allowed?

> >

--

> >

Best regards,             

> >

Yurii (http://yar.com.ua/)

>
> >

> > > -- /m.v.h Ingela From Ingela.Anderton@REDACTED Fri Feb 15 16:51:20 2002 From: Ingela.Anderton@REDACTED (UAB/L/K Ingela Anderton konsult OTP) Date: Fri, 15 Feb 2002 16:51:20 +0100 (MET) Subject: how do i specify include path? References: <3C6D1B28.5702B45C@sage.att.com> Message-ID: <15469.11806.338491.230684@gildor> http://erlang.ericsson.se/doc/doc-5.1/doc/getting_started/part_frame.html section 1.7 Garry Hodgson wrote: > > i know i use the -pa flag on the erl command line to specify module > path, > but i can't seem to find the corresponding flag to set include path, so > it can find the necessary .hrl files when compiling. > i see a -I on erlc, but it doesn't appear to work within erl, when using > > c(modulename). > > any clues? > thanks > > -- > Garry Hodgson Let my inspiration flow > Senior Hacker in token rhyme suggesting rhythm > Software Innovation Services that will not forsake me > AT&T Labs 'til my tale is told and done. > garry@REDACTED -- /m.v.h Ingela //The highway of life is always under construction. // |\ _,,,--,,_ ,) /,`.-'`' -, ;-;;' |,4- ) )-,_ ) /\ '---''(_/--' (_/-' Ericsson Utvecklings AB Cellular/Mobile: +46 70 636 78 68 From chris.williams@REDACTED Fri Feb 15 16:57:15 2002 From: chris.williams@REDACTED (Chris Williams) Date: Fri, 15 Feb 2002 16:57:15 +0100 Subject: how do i specify include path? References: <3C6D1B28.5702B45C@sage.att.com> Message-ID: <3C6D2FDB.E2F0A68D@ericsson.com> Hi, If you want to compile the file in a erlang shell you can always use the command: compile:file(Filename,[{i,PathToIncludeFile}]). There you can include a paths to .hrl files. //Chris Garry Hodgson wrote: > > i know i use the -pa flag on the erl command line to specify module > path, > but i can't seem to find the corresponding flag to set include path, so > it can find the necessary .hrl files when compiling. > i see a -I on erlc, but it doesn't appear to work within erl, when using > > c(modulename). > > any clues? > thanks > > -- > Garry Hodgson Let my inspiration flow > Senior Hacker in token rhyme suggesting rhythm > Software Innovation Services that will not forsake me > AT&T Labs 'til my tale is told and done. > garry@REDACTED From Chandrashekhar.Mullaparthi@REDACTED Fri Feb 15 16:52:41 2002 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Fri, 15 Feb 2002 15:52:41 -0000 Subject: how do i specify include path? Message-ID: <402DD461F109D411977E0008C791C31205E064B8@imp02mbx.one2one.co.uk> erl -man compile cheers, Chandru -----Original Message----- From: Garry Hodgson [mailto:garry@REDACTED] Sent: 15 February 2002 14:29 To: Erlang Subject: how do i specify include path? i know i use the -pa flag on the erl command line to specify module path, but i can't seem to find the corresponding flag to set include path, so it can find the necessary .hrl files when compiling. i see a -I on erlc, but it doesn't appear to work within erl, when using c(modulename). any clues? thanks NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From martin@REDACTED Fri Feb 15 18:14:42 2002 From: martin@REDACTED (Martin J. Logan) Date: Fri, 15 Feb 2002 11:14:42 -0600 Subject: distributed messaging References: <002601c1b627$66dec5e0$5864a8c0@softerra.int> Message-ID: <3C6D4202.E6E8D0F4@vailsys.com> My guess is that your cookie are not set properly. Place an .erlang.cookie file in your home directory on both machines. Place the same text string in both then start your distributed nodes erl -name or erl -sname you can also use a command line option to set your cookie what ever you use make sure that they are the same on all boxes. Cheers, Martin "Yurii A. Rashkovskii" wrote: > Guys and gals, > > I got an error while trying to setup distributed messaging. My server > module says `Connection attempt from disallowed node...'. I always > have used messaging only one host, but now need to communicate between > different hosts; on one host server works properly. What can you > advise? How can I make certain node allowed? > > -- > > Best regards, > > Yurii (http://yar.com.ua/) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Sean.Hinde@REDACTED Fri Feb 15 18:13:42 2002 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Fri, 15 Feb 2002 17:13:42 -0000 Subject: distributed messaging Message-ID: <402DD461F109D411977E0008C791C312039F6845@imp02mbx.one2one.co.uk> Bear in mind also that your .erlang.cookie should have permissions -r-------- i.e. readonly to owner, none for anyone else Sean -----Original Message----- From: Martin J. Logan [mailto:martin@REDACTED] Sent: 15 February 2002 17:15 To: Yurii A. Rashkovskii; erlang-questions@REDACTED Subject: Re: distributed messaging My guess is that your cookie are not set properly. Place an .erlang.cookie file in your home directory on both machines. Place the same text string in both then start your distributed nodes erl -name or erl -sname you can also use a command line option to set your cookie what ever you use make sure that they are the same on all boxes. Cheers, Martin "Yurii A. Rashkovskii" wrote: Guys and gals, I got an error while trying to setup distributed messaging. My server module says `Connection attempt from disallowed node...'. I always have used messaging only one host, but now need to communicate between different hosts; on one host server works properly. What can you advise? How can I make certain node allowed? -- Best regards, Yurii ( http://yar.com.ua/ ) NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From metrics2002@REDACTED Sat Feb 16 17:15:06 2002 From: metrics2002@REDACTED (metrics2002@REDACTED) Date: Sat, 16 Feb 2002 17:15:06 +0100 (CET) Subject: METRICS 2002 - June 4-7, Ottawa, Canada Message-ID: <200202161615.g1GGF6G02172@unisannio.it> ----------------------------------------------------------------------------- METRICS 2002: 8th International Symposium on Software Metrics ** Hotel and conference on-line registration now available** Focus: Software quality and productivity Objective: The METRICS conference aims at providing participants with a thorough and complete insight into the state practice and research with respect to software measurement, process improvement, and quality engineering. Academic papers as well as industry presentations and tutorials will provide relevant information to participants of diverse background and interest. We emphasize both industry and academic participation, thus offering a forum for interaction between research and practice. Industry participants: IBM, Nortel Networks, Alcatel, TCS-Tata Consultancy Services, InfoSys, Lockheed Martin, Philips, Ericsson, Motorola, Xerox, ... Dates: June 4-7, 2002. (Tutorials on June 4) Location: Ottawa, Canada Information and on-line registration: http://www.software-metrics.org/ Our apologies if you received multiple copy of this. If you would like to be removed from our list please send an email to metrics2002@REDACTED with REMOVE in the subject. ----------------------------------------------------------------------------- From yrashk@REDACTED Mon Feb 18 15:09:07 2002 From: yrashk@REDACTED (Yurii A. Rashkovskii) Date: Mon, 18 Feb 2002 16:09:07 +0200 Subject: jinterface question Message-ID: <000201c1b885$d4976fa0$5864a8c0@softerra.int> I have an application built using application-supervisor-gen_server model. How can I send messages to server using jinterface? How can I emulate gen_server:call behaviour? -- Best regards, Yurii (http://yar.com.ua/) -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik.linder@REDACTED Mon Feb 18 15:55:35 2002 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Mon, 18 Feb 2002 15:55:35 +0100 Subject: trace and match_spec Message-ID: <000c01c1b88c$53d0a740$dab7f2d5@frelin> Hi I am having problems understanding the erlang:trace and erlang:trace_pattern. What I am after is getting a call-tree trace with return values. In the documentation of erlang:trace[_pattern] is {return_trace} mentioned to give me my return values, which I assume comes from match_spec in ERTS. According to the description of match_spec will a badarg EXIT occurr if ther is something wrong with the match condition, but I cannot find the fault. Could someone please help me understand what I am doing wrong? ---[Working, but no return tracing]--- erlang:trace(Pid1, true, [call, 'receive', return_to]), erlang:trace_pattern({'_', '_', '_'}, true, [local]), ---[Working, but too much tracing]--- erlang:trace(Pid1, true, all), erlang:trace_pattern({'_', '_', '_'}, true, [local]), ---[Not Working]--- erlang:trace(Pid1, true, [call, 'receive', return_to]), MatchHead = '_', % Any arguments MatchCond = [], % Always MatchBody = [{return, trace}], % Trace return values (disables tail recursion) erlang:trace_pattern({Mod, '_', '_'}, [{MatchHead, MatchCond, MatchBody}], [local]), =ERROR REPORT==== 18-Feb-2002::15:42:17 === Error in process <0.292.0> with exit value: {badarg,[{erlang,trace_pattern,[{'_','_','_'},[{'_',[],[{return,trace}]}]]}, {t,tracer_init,1}]} /Fredrik From siri@REDACTED Mon Feb 18 16:30:29 2002 From: siri@REDACTED (Siri Hansen) Date: Mon, 18 Feb 2002 16:30:29 +0100 (MET) Subject: trace and match_spec In-Reply-To: <000c01c1b88c$53d0a740$dab7f2d5@frelin> References: <000c01c1b88c$53d0a740$dab7f2d5@frelin> Message-ID: <15473.6421.539451.924121@durin> Fredrik Linder wrote: > .... > > ---[Working, but no return tracing]--- > erlang:trace(Pid1, true, [call, 'receive', return_to]), > erlang:trace_pattern({'_', '_', '_'}, true, [local]), The return_to flag will only tell you when you return to(!) a function, but you will not get any return values. The message you get is {trace,Pid,return_to,MFA} > ---[Working, but too much tracing]--- > erlang:trace(Pid1, true, all), > erlang:trace_pattern({'_', '_', '_'}, true, [local]), This should be the same as above when it comes to return tracing > ---[Not Working]--- > erlang:trace(Pid1, true, [call, 'receive', return_to]), > MatchHead = '_', % Any arguments > MatchCond = [], % Always > MatchBody = [{return, trace}], % Trace return values (disables tail > recursion) > erlang:trace_pattern({Mod, '_', '_'}, [{MatchHead, MatchCond, MatchBody}], > [local]), > > =ERROR REPORT==== 18-Feb-2002::15:42:17 === > Error in process <0.292.0> with exit value: > {badarg,[{erlang,trace_pattern,[{'_','_','_'},[{'_',[],[{return,trace}]}]]}, > {t,tracer_init,1}]} If you change {return,trace} to {return_trace} this should work, and it will give the return values. The message you get is {trace,Pid,return_from,MFA,ReturnValue} /siri From Claude.Kirchner@REDACTED Mon Feb 18 17:04:11 2002 From: Claude.Kirchner@REDACTED (Claude Kirchner) Date: Mon, 18 Feb 2002 17:04:11 +0100 Subject: PPDP 2002 - Call for papers --> March 21 Message-ID: <200202181604.RAA25059@apach.loria.fr> PPDP 2002 - Call for papers March 21, 2002 submission deadline http://ppdp2002.cs.brown.edu Fourth International Conference on Principles and Practice of Declarative Programming 6-8 October, Pittsburgh, USA as part of PLI 2002 (http://pli2002.cs.brown.edu) Invited speakers: Neil Jones (University of Copenhagen) Catuscia Palamidessi (The Pennsylvania State University) Janos Sztipanovits (Vanderbilt University ) Important dates March 21, 2002 submission FIRM deadline May 30, 2002 acceptance decisions June 30, 2002 Camera-ready copies October 6-8, 2002 Conference Submission web site: http://ppdp-2002.loria.fr Conference Chair: Frank Pfenning, CMU, USA Program Chair: Claude Kirchner, LORIA and INRIA 615, rue du Jardin Botanique, BP 101 54602 Villers-l?s-Nancy, France Claude.Kirchner@REDACTED Program Committee: Hassan Ait Kaci: ILOG, France Olivier Danvy: BRICS, University of Aarhus, Denmark Mariangiola Dezani: Universita di Torino, Italy Francois Fages: INRIA, France Fergus Henderson: The University of Melbourne, Australia Manuel Hermenegildo: University of Madrid, Spain Andrew Gordon: Microsoft Research, UK Amy Felty: University of Ottawa, Canada Claude Kirchner: LORIA & INRIA, France Paul Klint: CWI, The Netherlands Michael Maher: Griffith University, Australia and Loyola University Chicago, USA Dale Miller: The Pennsylvania State University, USA Roberto Nieuwenhuis: University of Barcelona, Spain Frank Pfenning: CMU, USA Francesca Rossi: University of Padova, Italy Scope of the Conference PPDP aims to stimulate research on the use of declarative methods in programming and on the design, implementation and application of programming languages that support such methods. Topics of interest include any aspect related to understanding, integrating and extending programming paradigms such as those for logic, functional, constraint, probabilistic, rule and object-oriented programming; concurrent extensions and mobile computing; type theory; support for modularity; use of logical methods in the design of program development tools; program analysis and verification; abstract interpretation; development of implementation methods; application of the relevant paradigms and associated methods in industry and education. This list is not exhaustive: submissions related to new and interesting ideas relating broadly to declarative programming are encouraged. The technical program of the conference will combine presentations of the accepted papers and system descriptions with invited talks and advanced tutorials. Previous PPDP meetings were held in Paris (1999), Montreal (2000), Firenze (2001). Topics of Interest Logic and Constraint Programming; Rule Programming; Object-Oriented Programming; Concurrent Programming; Mobile Computing; Specification Languages and Methods; Type and Module Systems; Program Logics and Verification; Program Analysis and Transformation; Abstract Machines and Compilation Methods; Parallel and Distributed Implementations; Programming Environments; Applications of Declarative Programming; Implementation Techniques; Logical and Semantical Aspects of Declarative Programming; Declarative and probabilistic programming. Paper Submissions Submissions must be received on or before March 21, 2002 (this is a HARD deadline) and must describe original, previously unpublished work that has not been simultaneously submitted for publication elsewhere. They must be written in English and, in case the work is accepted for presentation and publication, one of the author must attend the conference to present it. Submissions must contain a clearly delineated part intended for the proceedings not exceeding 12 pages and 9 pt (for a full description see the ACM conference format at http://www.acm.org/sigplan/conferences/author-info) and must have a cover page with an abstract of up to 200 words, keywords, postal and electronic mailing addresses, and phone and fax numbers of the corresponding author. Additional material for possible consideration by reviewers may be included in the form of appendices. Submitted papers can be either: Regular papers that will be judged in particular on originality, correctness and significance, or System descriptions that will be judged in particular on usefulness and design, originality of system design, implementation or application. They must contain a link to a working system. All submissions are to be electronic unless specifically approved by the Program Chair. Submissions in PostScript or PDF formats should be submitted via the conference management system as described on the web site. Authors will be notified of acceptance decisions by May 30, 2002 Camera-ready copies of the accepted papers must be received by June 30, 2002. Proceedings will be published by ACM Press. Authors of accepted papers will be required to sign the ACM copyright form, which will be made accessible from this site. Conference Venue and Related Events PPDP 2002 is part of a federation of colloquia known as Principles, Logics and Implementations of high-level programming languages (PLI 2002) which includes the ACM SIGPLAN International Conference on Functional Programming (ICFP 2002) and the first ACM SIGPLAN Conference on Generators and Components (GCSE/SAIG'02) . The colloquia and affiliated workshops will run from October 4 to October 8, 2002 and will be held in Pittsburgh, USA. Details about the affiliated conferences and workshops will appear at the URL http://pli2002.cs.brown.edu/. Sponsorship PPDP 2002 is sponsored by ACM SIGPLAN. ---------------------------------------------------------------- From hal@REDACTED Tue Feb 19 07:27:36 2002 From: hal@REDACTED (Hal Snyder) Date: 19 Feb 2002 00:27:36 -0600 Subject: io_lib:format and ++ Message-ID: <87lmdqm1ev.fsf@gamera.vail> I don't think io_lib:format is returning a flat character string. We have: 1> "hello " ++ "there". "hello there" but: 2> io_lib:format("hello ~s", ["there"]). [104,101,108,108,111,32,"there"] So, cooking long strings with io_lib:format() gave me a surprise when the next thing to happen was a regexp:split, which does care about depth. Bug, or confused programmer? This is with otp_src_R8B-20011015-SNAPSHOT. From kent@REDACTED Tue Feb 19 07:54:17 2002 From: kent@REDACTED (Kent Boortz) Date: 19 Feb 2002 07:54:17 +0100 Subject: io_lib:format and ++ In-Reply-To: Hal Snyder's message of "19 Feb 2002 00:27:36 -0600" References: <87lmdqm1ev.fsf@gamera.vail> Message-ID: Hal Snyder writes: > I don't think io_lib:format is returning a flat character string. > > We have: > > 1> "hello " ++ "there". > "hello there" > > but: > > 2> io_lib:format("hello ~s", ["there"]). > [104,101,108,108,111,32,"there"] > > > So, cooking long strings with io_lib:format() gave me a surprise when > the next thing to happen was a regexp:split, which does care about > depth. > > Bug, or confused programmer? This is a feature. From the reference manual MODULE io_lib - IO Library Functions DESCRIPTION This module contains functions for converting to and from strings (lists of characters). They are used for implement- ing the functions in the io module. There is no guarantee that the character lists returned from some of the functions are flat, they can be deep lists. lists:flatten/1 is used for generating flat lists. But the reference manual fr io_lib lack type information for the functions so it is easy to missinterpret. kent From hal@REDACTED Tue Feb 19 08:17:11 2002 From: hal@REDACTED (Hal Snyder) Date: 19 Feb 2002 01:17:11 -0600 Subject: io_lib:format and ++ In-Reply-To: (Kent Boortz's message of "19 Feb 2002 07:54:17 +0100") References: <87lmdqm1ev.fsf@gamera.vail> Message-ID: <87g03ylz48.fsf@gamera.vail> Kent Boortz writes: > This is a feature. From the reference manual > > MODULE > io_lib - IO Library Functions > > DESCRIPTION > This module contains functions for converting to and from > strings (lists of characters). They are used for implement- > ing the functions in the io module. There is no guarantee > that the character lists returned from some of the functions > are flat, they can be deep lists. lists:flatten/1 is used > for generating flat lists. Aargh. Thank you for the quick reply. I looked in the io_lib manual, really, but was skipping straight to the section on format, not reading the DESCRIPTION at the top. From nico.weling@REDACTED Tue Feb 19 14:01:33 2002 From: nico.weling@REDACTED (Nico Weling) Date: Tue, 19 Feb 2002 14:01:33 +0100 Subject: Option to set row/cell height Message-ID: <3C724CAD.19E0FA68@eed.ericsson.se> Hi all, does somebody know if there is an option to set the height of the rows in a table? Table = gs:create(grid, Win,[{x,115},{y,53}, {height,Height-53}, {width,Width-130},{bg,white}, {columnwidths,Columnwidths_list}, {rows,{1, NumOfRows}}, {hscroll, true}]), maybe something like : {rowheight,6} Head1 = gs:create(gridline, Table, [{font,{screen,12}}, {row,1},{click, true},{bg,grey90}, {fg,white}]), or something like : {height,6} Regards, Nico. -- Nico Weling Software Designer Ericsson Eurolab Deutschland GmbH Verification Tool Design Tel: +49 2407 575 5217 Fax: +49 2407 575 651 Dect:+49 2407 575 89339 mailto:Nico.Weling@REDACTED From pramod@REDACTED Tue Feb 19 14:18:07 2002 From: pramod@REDACTED (Pramod R. Bhagwat) Date: Tue, 19 Feb 2002 18:48:07 +0530 Subject: how to start megaco Message-ID: <3C72508F.F162A699@ncoretech.com> Hi, i am new to erlang. i have installed linux version of erlang R8B-0 on redhat 6.2. i wanted to run erlang media gateway controller. ( i need udp text encoding configuartion ). If i execute megaco_simple_mgc:start(). in the erlang shell it gives following output {error,{start_user,megaco_not_started}} Please inform me how to start. Regards, pramod From lmp@REDACTED Tue Feb 19 14:13:29 2002 From: lmp@REDACTED (Luis Moniz Pereira) Date: Tue, 19 Feb 2002 13:13:29 +0000 Subject: UNKB 2002 - ICLP'02 Workshop on "Updating Non-Monotonic Knowledge Bases" Message-ID: <3C724F79.2B9AE54A@di.fct.unl.pt> We apologize for multiple postings _____________________________________________________________________________ UNKB 2002 http://floc02.diku.dk/UNKB/ Workshop on "Updating Non-Monotonic Knowledge Bases" Copenhagen, Denmark, July 28, 2002 Affiliated with ICLP 2002 http://floc02.diku.dk/ICLP/ Significant advances have been made recently in the area of updates of logic programs, and, more generally, updates of non-monotonic knowledge bases and their applications. Numerous papers were published on this subject and the journal Theory and Practice of Logic Programming (TPLP) has decided to publish its Special Issue on Change in Knowledge Bases, tentatively scheduled to appear at the beginning of 2003, to which extended versions of the workshop papers might be submitted. Given the strong activity and extensive work in this area, the present workshop, scheduled for July 28 during the 2002 Federated Logic Conference, will help provide a further boost to and enhance visibility of the recent active research on non-monotonic KB updates and its applications. The workshop seeks high-quality contributions containing original research results or offering an insightful synthesis of past work on various aspects of updating non-monotonic knowledge bases. Topics will include, but are not limited to: Updates of knowledge bases, in single and multi-agent contexts Revision, contradiction removal, preferring, approximating, and other dynamic changes to knowledge bases Relationship and/or applications to software development, theory of actions, multi-source knowledge combination, abductive update planning, model-based diagnosis, agent architectures, and others Implementation issues and systems. Organizers Lu?s Moniz Pereira Universidade Nova de Lisboa, Monte da Caparica, Portugal Teodor C. Przymusinski University of California, Riverside, CA, USA Program Committee Jos? Alferes , New University of Lisbon, Monte da Caparica, Portugal Chitta Baral, Arizona State University, Tempe, AZ, USA Thomas Eiter Technical University of Vienna, Vienna, Austria Katsumi Inoue Kobe University, Kobe, Japan Nicola Leone Technical University of Vienna, Vienna, Austria Lu?s Moniz Pereira , New University of Lisbon, Monte da Caparica, Portugal Teodor C. Przymusinski , University of California, Riverside, CA, USA Chiaki Sakama, Wakayama University, Wakayama, Japan Mirek Truszczynski University of Kentucky, Lexington, KY, USA Important Dates Paper submission: Sun March 31, 2002 Author notification: Fri May 10, 2002 Final papers due: Fri May 31, 2002 Send PS or PDF files to both organizers. Local proceedings are foreseen. ______________________________________________________________________ Lu?s Moniz Pereira, Professor http://centria.di.fct.unl.pt/~lmp/ ______________________________________________________________________ Director AI Centre CENTRIA http://centria.fct.unl.pt/ Departamento de Inform?tica Ph (+351) 21 294 8533 Fax 21 294 8541 Universidade Nova de Lisboa Secretary: (+351) 21 294 8536 2829-516 Caparica, Portugal Email: lmp@REDACTED ____________________________________________________________________ Teodor C. Przymusinski, Professor http://www.cs.ucr.edu/~teodor/ ____________________________________________________________________ Office Phone: (909)787-5015 College of Engineering Department: (909)787-5639 Computer Science Fax: (909)787-4643 University of California E-mail: teodor@REDACTED Riverside, CA 92521, USA WWW: ____________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From gunilla@REDACTED Tue Feb 19 14:31:38 2002 From: gunilla@REDACTED (Gunilla Arendt) Date: Tue, 19 Feb 2002 14:31:38 +0100 Subject: Option to set row/cell height References: <3C724CAD.19E0FA68@eed.ericsson.se> Message-ID: <3C7253B9.967E0229@erix.ericsson.se> Hi, Yes, grid has an option 'cellheight', specifying the height in pixels. Don't know why it isn't documented. / Gunilla Nico Weling wrote: > > Hi all, > > does somebody know if there is an option to set the height of the rows in a table? > > Table = gs:create(grid, Win,[{x,115},{y,53}, > {height,Height-53}, > {width,Width-130},{bg,white}, > {columnwidths,Columnwidths_list}, > {rows,{1, NumOfRows}}, > {hscroll, true}]), > > maybe something like : {rowheight,6} > > Head1 = gs:create(gridline, Table, [{font,{screen,12}}, > {row,1},{click, true},{bg,grey90}, > {fg,white}]), > > or something like : {height,6} > > Regards, > > Nico. > -- > Nico Weling > Software Designer > Ericsson Eurolab Deutschland GmbH > Verification Tool Design > > Tel: +49 2407 575 5217 > Fax: +49 2407 575 651 > Dect:+49 2407 575 89339 > mailto:Nico.Weling@REDACTED From Chandrashekhar.Mullaparthi@REDACTED Tue Feb 19 14:34:11 2002 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Tue, 19 Feb 2002 13:34:11 -0000 Subject: Big numbers Message-ID: <402DD461F109D411977E0008C791C31205E064CF@imp02mbx.one2one.co.uk> I have a record in which one of the elements is a bitmap which can be about a 100 bits long. Is it more efficient to store the bitmap as a binary or as a number in Mnesia. I will be storing millions of these records. The only operation I will be doing on these bitmaps is checking whether certain bits are set. If using numbers I can use the "band" operator. Is there any computation overhead when dealing with big numbers compared to dealing with binaries in this aspect. tia, Chandru NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From hakan@REDACTED Tue Feb 19 16:28:29 2002 From: hakan@REDACTED (Hakan Mattsson) Date: Tue, 19 Feb 2002 16:28:29 +0100 (MET) Subject: how to start megaco In-Reply-To: <3C72508F.F162A699@ncoretech.com> Message-ID: On Tue, 19 Feb 2002, Pramod R. Bhagwat wrote: Pramod> i am new to erlang. i have installed linux version of erlang Pramod> R8B-0 on redhat 6.2. Pramod> i wanted to run erlang media gateway controller. ( i need Pramod> udp text encoding configuartion ). Pramod> Pramod> If i execute Pramod> megaco_simple_mgc:start(). Pramod> in the erlang shell it gives following output Pramod> {error,{start_user,megaco_not_started}} Pramod> Pramod> Please inform me how to start. You need to start the megaco application, that is the protocol stack, before you start the MGC. It may either be started manually by invoking megaco:start(). in the Erlang shell or started together with the Erlang node with the -s megaco option as described in the example: http://www.erlang.org/doc/r8b/lib/megaco-1.0/doc/html/megaco_examples.html#6.1 /H?kan --- H?kan Mattsson Ericsson Computer Science Laboratory http://www.ericsson.com/cslab/~hakan/ From per@REDACTED Tue Feb 19 16:57:23 2002 From: per@REDACTED (Per Bergqvist) Date: Tue, 19 Feb 2002 16:57:23 +0100 Subject: R8B-0 get interface list bug Message-ID: <200202191557.g1JFvPb08698@hyena.levonline.com> Hi, prim_inet:getiflist/1 may miss some interfaces on nodes with many (alias) interfaces. The bug is caused by a buffer underr un in inet_drv and the the function does not retry the call with a larger buffer as it should. Attached is a patch for R8B-0. To apply it cd to the erlang root and "patch -p0 < inet_drv_patch" /Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED -------------- next part -------------- A non-text attachment was scrubbed... Name: inet_drv_patch Type: application/octet-stream Size: 2994 bytes Desc: not available URL: From per@REDACTED Tue Feb 19 16:59:50 2002 From: per@REDACTED (Per Bergqvist) Date: Tue, 19 Feb 2002 16:59:50 +0100 Subject: R8B-0 get interface list bug In-Reply-To: <200202191557.g1JFvPb08698@hyena.levonline.com> Message-ID: <200202191559.g1JFxob09770@hyena.levonline.com> And I am not drunk. I just hate my ISP's webmail. /Per > Hi, > > prim_inet:getiflist/1 may miss some interfaces > on nodes with many (alias) interfaces. > The bug is caused by a buffer underr > un in inet_drv and the > the function does not retry the call with a larger buffer as it > should. > > Attached is a patch for R8B-0. > To apply it cd to the erlang root and "patch -p0 < inet_drv_patch" > > /Per > > ========================================================= > Per Bergqvist > Synapse Systems AB > Phone: +46 709 686 685 > Email: per@REDACTED ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From hal@REDACTED Tue Feb 19 17:21:57 2002 From: hal@REDACTED (Hal Snyder) Date: 19 Feb 2002 10:21:57 -0600 Subject: catch not an rvalue Message-ID: <87eljhl9wa.fsf@gamera.vail> Hope this isn't another RTFM, but I can't resist asking. Am going through the puzzle box while home with the flu. During prototyping, it would be nice to replace X = with X = catch but the shell (and compiler) don't like that. Just wondering why the syntax error is happening. Didn't see the answer in, e.g., Chap 6 of http://www.erlang.org/download/erl_spec47.ps.gz 1>catch 22. 22 2> X=catch 22. ** 1: syntax error before: 'catch' ** but: 3> F=fun()->catch 22 end. #Fun 4> X=F(). 22 From kostis@REDACTED Tue Feb 19 17:27:52 2002 From: kostis@REDACTED (Kostis Sagonas) Date: Tue, 19 Feb 2002 17:27:52 +0100 (MET) Subject: catch not an rvalue In-Reply-To: Mail from 'Hal Snyder ' dated: 19 Feb 2002 10:21:57 -0600 Message-ID: <200202191627.RAA15136@harpo.it.uu.se> Try: 2> X = (catch 22). Kostis. From hongwei.chen@REDACTED Tue Feb 19 17:27:02 2002 From: hongwei.chen@REDACTED (Daniel Chen Hongwei) Date: Wed, 20 Feb 2002 00:27:02 +0800 Subject: SNMP MIB compiler for Windows version In-Reply-To: <87lmdqm1ev.fsf@gamera.vail> Message-ID: Hello, I am a new user to OTP. After I install the OTP R8B in my PC(Windows 98), I follows the SNMP User Guide to try compiling MIBs.It failed even for standard MIBs included in directory of .\lib\snmp-3.3.3\mibs. Is there any environment variable should be set before we run snmp:c("RFC-1212") in Erlang shell? Or how can we run the compiler under Windows? I got the following error info: 10> snmp:c("RFC-1212"). RFC-1212.mib: 9: Error: syntax error before: 'OBJECT-TYPE' {error,compilation_failed} The same error info is got if I run "erlc RFC-1212.mib" under DOS: RFC-1212.mib: 9: Error: syntax error before: 'OBJECT-TYPE' From peter@REDACTED Tue Feb 19 17:29:58 2002 From: peter@REDACTED (Peter H|gfeldt) Date: Tue, 19 Feb 2002 17:29:58 +0100 (MET) Subject: catch not an rvalue In-Reply-To: <87eljhl9wa.fsf@gamera.vail> Message-ID: 1> X = (catch 22). 22 /Peter On 19 Feb 2002, Hal Snyder wrote: > Hope this isn't another RTFM, but I can't resist asking. > Am going through the puzzle box while home with the flu. > > During prototyping, it would be nice to replace > X = > with > X = catch > but the shell (and compiler) don't like that. > > Just wondering why the syntax error is happening. > Didn't see the answer in, e.g., Chap 6 of > http://www.erlang.org/download/erl_spec47.ps.gz > > 1>catch 22. > 22 > 2> X=catch 22. > ** 1: syntax error before: 'catch' ** > > but: > > 3> F=fun()->catch 22 end. > #Fun > 4> X=F(). > 22 > From Chandrashekhar.Mullaparthi@REDACTED Tue Feb 19 17:28:25 2002 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Tue, 19 Feb 2002 16:28:25 -0000 Subject: catch not an rvalue Message-ID: <402DD461F109D411977E0008C791C31205E064D2@imp02mbx.one2one.co.uk> X = (catch ) will work. cheers, Chandru -----Original Message----- From: Hal Snyder [mailto:hal@REDACTED] Sent: 19 February 2002 16:22 To: erlang-questions@REDACTED Subject: catch not an rvalue Hope this isn't another RTFM, but I can't resist asking. Am going through the puzzle box while home with the flu. During prototyping, it would be nice to replace X = with X = catch but the shell (and compiler) don't like that. NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From lennart.ohman@REDACTED Tue Feb 19 17:32:36 2002 From: lennart.ohman@REDACTED (Lennart =?iso-8859-1?Q?=D6hman?=) Date: Tue, 19 Feb 2002 17:32:36 +0100 Subject: catch not an rvalue References: <87eljhl9wa.fsf@gamera.vail> Message-ID: <3C727E24.B323E0DB@st.se> Try: 5>X=(catch 22). 22 6> /Lennart Hal Snyder wrote: > > Hope this isn't another RTFM, but I can't resist asking. > Am going through the puzzle box while home with the flu. > > During prototyping, it would be nice to replace > X = > with > X = catch > but the shell (and compiler) don't like that. > > Just wondering why the syntax error is happening. > Didn't see the answer in, e.g., Chap 6 of > http://www.erlang.org/download/erl_spec47.ps.gz > > 1>catch 22. > 22 > 2> X=catch 22. > ** 1: syntax error before: 'catch' ** > > but: > > 3> F=fun()->catch 22 end. > #Fun > 4> X=F(). > 22 -- ------------------------------------------------------------- Lennart Ohman phone : +46-8-587 623 27 Sjoland & Thyselius Telecom AB cellular: +46-70-552 6735 Sehlstedtsgatan 6 fax : +46-8-667 8230 SE-115 28 STOCKHOLM, SWEDEN email : lennart.ohman@REDACTED From peter@REDACTED Tue Feb 19 17:38:06 2002 From: peter@REDACTED (Peter H|gfeldt) Date: Tue, 19 Feb 2002 17:38:06 +0100 (MET) Subject: SNMP MIB compiler for Windows version In-Reply-To: Message-ID: According to SNMP User's Guide, Section 4.2: "The following MIBs are built-ins of the Erlang SNMP compiler: SNMPv2-SMI, RFC-1215, RFC-1212, SNMPv2-TC, SNMPv2-CONF, and RFC1155-SMI. They cannot therefore be compiled separately." /Peter On Wed, 20 Feb 2002, Daniel Chen Hongwei wrote: > Hello, > > I am a new user to OTP. After I install the OTP R8B in my PC(Windows 98), I follows the SNMP User Guide to try compiling MIBs.It failed even for standard MIBs included in directory of .\lib\snmp-3.3.3\mibs. Is there any environment variable should be set before we run snmp:c("RFC-1212") in Erlang shell? Or how can we run the compiler under Windows? > > I got the following error info: > 10> snmp:c("RFC-1212"). > RFC-1212.mib: 9: Error: syntax error before: 'OBJECT-TYPE' > {error,compilation_failed} > > The same error info is got if I run "erlc RFC-1212.mib" under DOS: > RFC-1212.mib: 9: Error: syntax error before: 'OBJECT-TYPE' > From luke@REDACTED Tue Feb 19 18:08:01 2002 From: luke@REDACTED (Luke Gorrie) Date: 19 Feb 2002 18:08:01 +0100 Subject: catch not an rvalue In-Reply-To: <87eljhl9wa.fsf@gamera.vail> References: <87eljhl9wa.fsf@gamera.vail> Message-ID: Hal Snyder writes: > Hope this isn't another RTFM, but I can't resist asking. > Am going through the puzzle box while home with the flu. > > During prototyping, it would be nice to replace > X = > with > X = catch > but the shell (and compiler) don't like that. > > Just wondering why the syntax error is happening. > Didn't see the answer in, e.g., Chap 6 of > http://www.erlang.org/download/erl_spec47.ps.gz This keeps coming up all the time :-) I had a squiz at the grammar in the spec and in stdlib/src/erl_parse.yrl, and it seems to be caused by the implementation of operator precedence. "Catch" binds the weakest (`expr'), a match (`expr_100') needs at least another `expr_100' on its right hand side. I don't know enough about parsing to know if that's the way it has to be. But, with ignorance established as my defense, I hacked erl_parse.yrl so that any expression can appear on the right hand side of a match (patch below). It seems to do what you'd expect - "X = catch 1 + 2." binds X to 3 - and it at least managed to compile > 100K lines of code without complaining. So.. maybe someone can explain what it's all about? NB, the new parser comes out about the same size at 4 lines longer than the normal 4925 line erl_parse.erl. Cheers, Luke -------------- next part -------------- A non-text attachment was scrubbed... Name: erl_parse.patch Type: text/x-patch Size: 453 bytes Desc: not available URL: From garry@REDACTED Tue Feb 19 18:17:01 2002 From: garry@REDACTED (Garry Hodgson) Date: Tue, 19 Feb 2002 12:17:01 -0500 Subject: how do i specify include path? References: <3C6D1B28.5702B45C@sage.att.com> <3C6D2FDB.E2F0A68D@ericsson.com> Message-ID: <3C72888D.89AF896A@sage.att.com> Chris Williams wrote: > If you want to compile the file in a erlang shell you can > always use the command: > compile:file(Filename,[{i,PathToIncludeFile}]). > > There you can include a paths to .hrl files. thanks to chris and all the others who pointed this out. most helpful, as usual. -- Garry Hodgson Let my inspiration flow Senior Hacker in token rhyme suggesting rhythm Software Innovation Services that will not forsake me AT&T Labs 'til my tale is told and done. garry@REDACTED From nico.weling@REDACTED Wed Feb 20 08:29:27 2002 From: nico.weling@REDACTED (Nico Weling) Date: Wed, 20 Feb 2002 08:29:27 +0100 Subject: Unknown GS error Message-ID: <3C735057.671C9D2C@eed.ericsson.se> Hi All, I've seen the following error and I've no idea who is causing this error. gs error: gstk: error in input : invalid command name "-te" Could somebody give me a hint were I can look for, and what it does mean? Thanks in advance, regards Nico. From vlad_dumitrescu@REDACTED Wed Feb 20 14:13:57 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Wed, 20 Feb 2002 14:13:57 +0100 Subject: General protocol stack management Message-ID: Hi all, I am trying to devise a general way to handle a protocol stack in a way that is protocol independent. The closest thing I found to look at was Megaco, which is very cool. However, assumptions about the specific protocols are spread a little here and there, and also the protocol layers are fixed (since it is only designed to handle one protocol). I wonder if anyone had felt the need for such an application, where once could dynamically add, remove or change some of the handlers for the different layers in the stack. My reason for doing this is to be able to change the encoding and routing algorithms and/or the transport medium, but then I thought "why not make it more general?" -- I'd like to find out if such generality can be really needed, or maybe it's better to choose the custom solution? Maybe such a general aplication already exists, and then I'd have a lot to learn from. Any thoughts or remarks? Best regards, Vlad _________________________________________________________________ Chatta med v?nner online, prova MSN Messenger: http://messenger.msn.se From Erik.Johansson@REDACTED Wed Feb 20 14:30:42 2002 From: Erik.Johansson@REDACTED (Erik.Johansson) Date: Wed, 20 Feb 2002 14:30:42 +0100 Subject: General protocol stack management References: Message-ID: <034f01c1ba12$cc2ccbb0$980cee82@it.uu.se> Some work has been done in this area, there was a Ms C. thesis about this in 2000, A general protocol stack interface in Erlang, the thesis can be found at: ftp://ftp.csd.uu.se/pub/papers/masters-theses/0143-andersson-kvisth.ps.gz or http://www.erlang.se/publications/xjobb/peter_anderson.pdf I don't know if the application was productified, but if not the thesis should be good starting point. I think that at least Peter Andersson is working with Erlang for some Ericsson company. /Erik ----- Original Message ----- From: "Vlad Dumitrescu" To: Sent: Wednesday, February 20, 2002 2:13 PM Subject: General protocol stack management Hi all, I am trying to devise a general way to handle a protocol stack in a way that is protocol independent. The closest thing I found to look at was Megaco, which is very cool. However, assumptions about the specific protocols are spread a little here and there, and also the protocol layers are fixed (since it is only designed to handle one protocol). I wonder if anyone had felt the need for such an application, where once could dynamically add, remove or change some of the handlers for the different layers in the stack. My reason for doing this is to be able to change the encoding and routing algorithms and/or the transport medium, but then I thought "why not make it more general?" -- I'd like to find out if such generality can be really needed, or maybe it's better to choose the custom solution? Maybe such a general aplication already exists, and then I'd have a lot to learn from. Any thoughts or remarks? Best regards, Vlad _________________________________________________________________ Chatta med v?nner online, prova MSN Messenger: http://messenger.msn.se From Sean.Hinde@REDACTED Wed Feb 20 14:31:03 2002 From: Sean.Hinde@REDACTED (Sean Hinde) Date: Wed, 20 Feb 2002 13:31:03 -0000 Subject: General protocol stack management Message-ID: <402DD461F109D411977E0008C791C312039F685F@imp02mbx.one2one.co.uk> > I am trying to devise a general way to handle a protocol > stack in a way that > is protocol independent. Take a look at the tcp implemnation by Tobbe http://www.bluetail.com/~tobbe/etcp/ There is also a paper on the erlang web site http://www.erlang.se/publications/xjobb/peter_anderson.pdf Rgds, Sean NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From francesco@REDACTED Wed Feb 20 14:49:38 2002 From: francesco@REDACTED (Francesco Cesarini) Date: Wed, 20 Feb 2002 13:49:38 GMT Subject: General Protocol Stack Management Message-ID: <1014212978.520francesco@home.se> Hi! Peter Andersson and Markus Kvisth wrote a Thesis on the subject. You can find it in the Erlang Thesis section at the open directory. I am unsure on where the code they wrote it, or if it is in a usable state. http://dmoz.org/Computers/Programming/Languages/Erlang/Artic les/Thesis/ Regards, Francesco -- http://www.erlang-consulting.com Hi all, I am trying to devise a general way to handle a protocol stack in a way that is protocol independent. The closest thing I found to look at was Megaco, which is very cool. However, assumptions about the specific protocols are spread a little here and there, and also the protocol layers are fixed (since it is only designed to handle one protocol). I wonder if anyone had felt the need for such an application, where once could dynamically add, remove or change some of the handlers for the different layers in the stack. My reason for doing this is to be able to change the encoding and routing algorithms and/or the transport medium, but then I thought "why not make it more general?" - - I'd like to find out if such generality can be really needed, or maybe it's better to choose the custom solution? Maybe such a general aplication already exists, and then I'd have a lot to learn from. Any thoughts or remarks? Best regards, Vlad From nico.weling@REDACTED Wed Feb 20 15:46:58 2002 From: nico.weling@REDACTED (Nico Weling) Date: Wed, 20 Feb 2002 15:46:58 +0100 Subject: Unknown GS error References: <200202201308.g1KD8U508833@hyena.levonline.com> Message-ID: <3C73B6E2.24467C20@eed.ericsson.se> Hi, > Which release, OS etc ? Linux RedHat 7.0 Kernel 2.4.1 Erlang R8B > > Hi All, > > > > I've seen the following error and I've no idea who is causing this > error. > > > > gs error: gstk: error in input : invalid command name "-te" > > > > > > Could somebody give me a hint were I can look for, and what it does > mean? > > > > Thanks in advance, > > > > regards Nico. > > > ========================================================= > Per Bergqvist > Synapse Systems AB > Phone: +46 709 686 685 > Email: per@REDACTED -- Nico Weling Software Designer Ericsson Eurolab Deutschland GmbH Verification Tool Design Tel: +49 2407 575 5217 Fax: +49 2407 575 651 Dect:+49 2407 575 89339 mailto:Nico.Weling@REDACTED From yrashk@REDACTED Wed Feb 20 17:13:52 2002 From: yrashk@REDACTED (Yurii A. Rashkovskii) Date: Wed, 20 Feb 2002 18:13:52 +0200 Subject: another jinterface question Message-ID: <003601c1ba29$97652be0$5864a8c0@softerra.int> Guys and gals, How can I send message using OtpErlang Java library, assuming I know only remote node name and registered server name. It seems that something like mbox.send(this.registeredName, this.remoteNode, msgTuple); doesn't work. What can you advise? Thank you in advance, Yurii (http://yar.com.ua/) From kent@REDACTED Wed Feb 20 17:18:42 2002 From: kent@REDACTED (Kent Boortz) Date: 20 Feb 2002 17:18:42 +0100 Subject: Unknown GS error In-Reply-To: Nico Weling's message of "Wed, 20 Feb 2002 08:29:27 +0100" References: <3C735057.671C9D2C@eed.ericsson.se> Message-ID: Nico Weling writes: > I've seen the following error and I've no idea who is causing this error. > > gs error: gstk: error in input : invalid command name "-te" > > Could somebody give me a hint were I can look for, and what it does mean? It is probably a bug in GS. The back-end of the back-end is a Tcl interpreter and GS send it commands using a pipe or a socket. This backend report that it got an invalid Tcl command. There is no information sent that tell Tcl when it has got a comlete command from GS. A built in function is called in the Tcl code that return true for a valid Tcl command line. My guess is that GS sent a partial command line or failed to escape some characters, probably a newline or a ';', that made this function think it got a complete command. The next input it gets is the rest of the command line starting with "-te". If you can reproduce the error you can help finding the bug by enabling debugging in the file "gstk_port_handler.erl". Uncomment the format call in the output/2 function and set DEBUGLEVEL > 0. If the debug printout at the failing point isn't readable (it should be text mostly, maybe a few control characters) you can use the altered "gstk_port_handler.erl" attached below, kent -------------- next part -------------- A non-text attachment was scrubbed... Name: gstk_port_handler.erl Type: application/octet-stream Size: 10896 bytes Desc: gstk_port_handler.erl URL: From peppe@REDACTED Wed Feb 20 17:49:13 2002 From: peppe@REDACTED (Peter Andersson) Date: Wed, 20 Feb 2002 17:49:13 +0100 Subject: General protocol stack management References: Message-ID: <3C73D389.31BBF5F@erix.ericsson.se> Hi Vlad, As you've already been told, Markus Kvisth and I did our master thesis on the subject of general protocol stack interfacing from Erlang a while back. We put quite a big effort into theory and did not focus as much on implementation. We prototyped a subset of the ideas that we presented in the report, mainly to verify that our proposals were feasible for implementation. I think that if you find functionality described in our paper that you would want to use practically, then honestly, you're better off writing the code from scratch than to go digging into our old prototype (implementation should be quite straightfwd after reading chapter 3, anyway). This holds especially true if you want to base your stack interface implementation on OTP (which we didn't back in '97). Anyway, I still have the code and can dust it off for you if you insist... eh, I mean like. ;-) I hope you find the paper interesting. (I do. I must have read it through a hundred times! ;-). It has a lot of nice little pictures in it, so you shouldn't have to be disappointed! Seriously, from what you said in your mail, I think you'll find some interesting things in there. Do let me know! (unless you hate it). Best regards /Peter (at OTP, which does indeed belong to some Ericsson company, like Erik said) Vlad Dumitrescu wrote: > Hi all, > > I am trying to devise a general way to handle a protocol stack in a way that > is protocol independent. The closest thing I found to look at was Megaco, > which is very cool. However, assumptions about the specific protocols are > spread a little here and there, and also the protocol layers are fixed > (since it is only designed to handle one protocol). > > I wonder if anyone had felt the need for such an application, where once > could dynamically add, remove or change some of the handlers for the > different layers in the stack. My reason for doing this is to be able to > change the encoding and routing algorithms and/or the transport medium, but > then I thought "why not make it more general?" -- I'd like to find out if > such generality can be really needed, or maybe it's better to choose the > custom solution? Maybe such a general aplication already exists, and then > I'd have a lot to learn from. > > Any thoughts or remarks? > Best regards, > Vlad > > _________________________________________________________________ > Chatta med v?nner online, prova MSN Messenger: http://messenger.msn.se From jamesh@REDACTED Wed Feb 20 18:32:34 2002 From: jamesh@REDACTED (James Hague) Date: Wed, 20 Feb 2002 11:32:34 -0600 Subject: vec module status? Message-ID: What is the status of the undocumented vec module, which implements functional arrays? I'm mostly curious about the advantages of vec over other methods of array handling. From yrashk@REDACTED Wed Feb 20 18:02:28 2002 From: yrashk@REDACTED (Yurii A. Rashkovskii) Date: Wed, 20 Feb 2002 19:02:28 +0200 Subject: FW: another jinterface question Message-ID: <003a01c1ba30$60e8a360$5864a8c0@softerra.int> Oh, it seems that I found. Is OtpConnection a right way? -----Original Message----- From: owner-erlang-questions@REDACTED [mailto:owner-erlang-questions@REDACTED] On Behalf Of Yurii A. Rashkovskii Sent: Wednesday, February 20, 2002 6:14 PM To: erlang-questions@REDACTED Subject: another jinterface question Guys and gals, How can I send message using OtpErlang Java library, assuming I know only remote node name and registered server name. It seems that something like mbox.send(this.registeredName, this.remoteNode, msgTuple); doesn't work. What can you advise? Thank you in advance, Yurii (http://yar.com.ua/) From simonpj@REDACTED Wed Feb 20 22:15:38 2002 From: simonpj@REDACTED (Simon Peyton-Jones) Date: Wed, 20 Feb 2002 13:15:38 -0800 Subject: ICFP 2002: write now! Message-ID: <1113DDB24D4A2841951BFDF86665EE19374992@RED-MSG-10.redmond.corp.microsoft.com> Don't miss your chance to submit a paper to ICFP02. It'll be fun! Simon PJ ICFP 2002 International Conference on Functional Programming October 4-6, 2002, Pittsburgh, USA Final call for papers -------------------------------------------- Submission deadline: 21 March 2002 18:00 UTC -------------------------------------------- Program Chair: Simon Peyton Jones (Microsoft Research) Full call for papers including submission details: http://icfp2002.cs.brown.edu/CfP/ ICFP 2002 seeks original papers on the full spectrum of the art, science, and practice of functional programming. The conference invites submissions on all topics ranging from principles to practice, from foundations to features, and from abstraction to application. The scope covers all languages that encourage programming with functions, including both purely applicative and imperative languages, as well as languages that support objects and concurrency. Topics of interest include, but are not limited to, the following: Foundations: formal semantics, lambda calculus, type theory, monads, continuations, control, state, effects. Design: modules and type systems, concurrency and distribution, components and composition, relations to object-oriented and logic programming, multiparadigm programming. Implementation: abstract machines, compile-time and run-time optimization, just-in-time compilers, memory management, foreign-function and component interfaces. Transformation and analysis: abstract interpretation, partial evaluation, program transformation, theorem proving, specification and verification. Software development techniques for functional programming: design patterns, specification, verification and validation, debugging, test generation, etc. Human productivity of functional programming: visual, graphical (etc) approaches, evaluating language usability, empirical studies of human effectiveness, etc. Applications and domain-specific languages: scientific and numerical computing, symbolic computing and artificial intelligence, systems programming, databases, graphic user interfaces, multimedia programming, Web programming. Practice and experience: functional programming in education and industry, ramifications on other paradigms and computing disciplines. Functional pearls elegant, instructive examples of functional programming. General Chair: Mitchell Wand (Northeastern University) Program Committee Matthias Blume (Lucent) Margaret Burnett (Oregon State University) Manuel Chakravarty (University of New South Wales) Matthew Flatt (University of Utah) Haruo Hosoya (Kyoto University) Uwe Nestmann (EPFL, Lausanne) Chris Okasaki (United States Military Academy) Norman Ramsey (Harvard University) David Sands (Chalmers University) Olin Shivers (Georgia Tech) Stephanie Weirich (Cornell) Joe Wells (Heriot Watt University) From kurt@REDACTED Thu Feb 21 07:58:04 2002 From: kurt@REDACTED (Kurt Luoto) Date: Wed, 20 Feb 2002 22:58:04 -0800 Subject: Debugger problems Message-ID: <58BE468BAC66D511AFE6000347251A2D011ED5CA@morpheus.lanterncom.com> I am also having problems with the debugger in the R8 distribution running on Windows2000 and on Windows98. It doesn't seem to matter what module (file) I try to interpret, I get the following error report on the Erlang emulator screen: ---------------------------------------------------------------------------- -------------------------------- Erlang (BEAM) emulator version 5.1 [threads:0] Eshell V5.1 (abort with ^G) 1> gs error: gstk: unexpected reply: Monitor =ERROR REPORT==== 20-Feb-2002::22:41:21 === Error in process <0.49.0> with exit value: {badarg,[{erlang,binary_to_term,[<<0 bytes>>]},{dbg_iload,abstr,1},{dbg_iload,store_module,3},{dbg_iload,load_mod 1,3 ]} ---------------------------------------------------------------------------- -------------------------------- After that, the debugger is pretty much dead. This happens even on trivial files that compile and test correctly. -- Kurt Luoto From vlad_dumitrescu@REDACTED Thu Feb 21 08:42:08 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Thu, 21 Feb 2002 08:42:08 +0100 Subject: General protocol stack management Message-ID: Thanks for all the pointers. I have read Peter's and Markus' thesis and it was very enlightening. Just to mention the realization of how many things I didn't have had thought of! :-) My starting point was not as general, though - I was really thinking about higher-level protocols that build on TCP or UDP. Thus many of the issues in the paper aren't as relevant. The "model template" was Joe Armstrong's pico and wiki applications, I really love the elegance of building the wiki upon the pico_http_server upon the pico_socket_server. That is the kind of architecture I am envisioning. I realize that it won't be a carrier-class implementation, but I think it will be enough for me at least. I will let you know when progress will be made. best regards, Vlad _________________________________________________________________ MSN Photos ?r det enklaste s?ttet att dela ut och skriva ut foton: http://photos.msn.se/Support/WorldWide.aspx From Chandrashekhar.Mullaparthi@REDACTED Thu Feb 21 10:37:45 2002 From: Chandrashekhar.Mullaparthi@REDACTED (Chandrashekhar Mullaparthi) Date: Thu, 21 Feb 2002 09:37:45 -0000 Subject: Big numbers Message-ID: <402DD461F109D411977E0008C791C31205E064EC@imp02mbx.one2one.co.uk> I'll answer my own question :) A big number represented as a binary has a fixed overhead of a 1 word compared to the big number itself. And there is no easy way to do a binary-and of two binaries. The only way I can think of is: do_bin_and(A,B) -> ASize = size(A)*8, BSize = size(B)*8, <> = A, <> = B, AI band BI. which is obviously less efficient than A band B. Chandru -----Original Message----- From: Chandrashekhar Mullaparthi [mailto:Chandrashekhar.Mullaparthi@REDACTED] Sent: 19 February 2002 13:34 To: 'erlang-questions@REDACTED' Subject: Big numbers I have a record in which one of the elements is a bitmap which can be about a 100 bits long. Is it more efficient to store the bitmap as a binary or as a number in Mnesia. I will be storing millions of these records. The only operation I will be doing on these bitmaps is checking whether certain bits are set. If using numbers I can use the "band" operator. Is there any computation overhead when dealing with big numbers compared to dealing with binaries in this aspect. tia, Chandru NOTICE AND DISCLAIMER: This email (including attachments) is confidential. If you have received this email in error please notify the sender immediately and delete this email from your system without copying or disseminating it or placing any reliance upon its contents. We cannot accept liability for any breaches of confidence arising through use of email. Any opinions expressed in this email (including attachments) are those of the author and do not necessarily reflect our opinions. We will not accept responsibility for any commitments made by our employees outside the scope of our business. We do not warrant the accuracy or completeness of such information. From gunilla@REDACTED Thu Feb 21 14:01:24 2002 From: gunilla@REDACTED (Gunilla Arendt) Date: Thu, 21 Feb 2002 14:01:24 +0100 Subject: Debugger problems References: <58BE468BAC66D511AFE6000347251A2D011ED5CA@morpheus.lanterncom.com> Message-ID: <3C74EFA4.EE9BE0F2@erix.ericsson.se> Hi, >From R8, the Debugger needs the abstract code for a module. I.e. any module to be debugged must be compiled with the option 'debug_info' set. Example: unix> erlc +debug_info m.erl or 1> c(m, debug_info). This greatly improves code handling in the Debugger but unfortunately the documentation has not been updated accordingly, sorry about that. An improved Debugger (with updated documentation) is under development and will be released soon. / Gunilla Kurt Luoto wrote: > > I am also having problems with the debugger in the R8 distribution running > on Windows2000 and on Windows98. It doesn't seem to matter what module > (file) I try to interpret, I get the following error report on the Erlang > emulator screen: > ---------------------------------------------------------------------------- > -------------------------------- > Erlang (BEAM) emulator version 5.1 [threads:0] > > Eshell V5.1 (abort with ^G) > 1> gs error: gstk: unexpected reply: Monitor > > =ERROR REPORT==== 20-Feb-2002::22:41:21 === > Error in process <0.49.0> with exit value: > {badarg,[{erlang,binary_to_term,[<<0 > bytes>>]},{dbg_iload,abstr,1},{dbg_iload,store_module,3},{dbg_iload,load_mod > 1,3 > ]} > > ---------------------------------------------------------------------------- > -------------------------------- > After that, the debugger is pretty much dead. > This happens even on trivial files that compile and test correctly. > > -- Kurt Luoto From kurt@REDACTED Fri Feb 22 02:28:33 2002 From: kurt@REDACTED (Kurt Luoto) Date: Thu, 21 Feb 2002 17:28:33 -0800 Subject: Mnesia and the Erlang message distribution model Message-ID: <58BE468BAC66D511AFE6000347251A2D011ED5D4@morpheus.lanterncom.com> I'm a newcomer to Erlang/OTP, and I have a some Mnesia questions. I'll post each in a separate email so we can maintain separate threads for each. >From reading the Mnesia user's guide I have the impression that all nodes that participate in the same database, even if they are only "readers" of the DB, must be "connected" to each other through the Erlang message distribution layer. So, for example, if I have 10 Erlang nodes sharing a Mnesia database (schema), then each node needs to maintain 9 sessions, one with each of the other nodes. Is this correct understanding? I would like to hear that it is possible to set up a sparse connection topology, a hierarchy of nodes where each node only needs to maintain connections with a few other nodes, for example, it's immediate "parent" or "master", it's immediate "children" or "slaves", and perhaps a few of it's "siblings" or "peers". The application I have to consider is one where the total number of Erlang nodes in the system may be on the order of hundreds, but there is a natural hierarchy to them. We make communications equipment. One chassis (rack-mounted shelf) has a control processor for the chassis overall and several line cards each with its own processor, let's say about ten processors (Erlang nodes) per chassis. A complete system has two or more chasses; a large one may have 20 or 30 chasses. We want to treat all these as a single system for management & control purposes, so they all need access to the (distributed Mnesia) database. Obviously there are scaling problems if all 200 to 300 Erlang nodes must be connected to each other. However, in practice the line cards in one node really don't have anything to say to processors outside their own chassis. They only need to exchange data with the control processor in their local chassis. And the control processors among the chassis need to talk to each other, but each control processor only needs to talk to line cards in its own chassis. So I would like to know if it is possible to set up a sparse communications topology to match the hardware configuration. If necessary, I could live with having Mnesia replicate tables such that each control processor has local copies of all the data it needs for its chassis, with the hope that within each chassis the line card's copy of Mnesia only needs to deal with control processor's copy of Mnesia. Is this possible today? -- Kurt Luoto From kurt@REDACTED Fri Feb 22 02:46:38 2002 From: kurt@REDACTED (Kurt Luoto) Date: Thu, 21 Feb 2002 17:46:38 -0800 Subject: Mnesia -- multiple schemas? Message-ID: <58BE468BAC66D511AFE6000347251A2D011ED5D5@morpheus.lanterncom.com> When Mnesia is running in an Erlang node, is there only one "schema", one database at any given time? Or can a Mnesia instance support multiple schemas at the same time? The question arises when in a system I have one set of nodes (A) that need to share one set of tables (a schema if you will), and another set of nodes (B) that need to share a different set of tables, (perhaps several other sets of nodes sharing their own sets of tables, etc), where the sets A and B may overlap (non-empty intersection), but in general are not identical. For purposes of scalability, I would not want to burden every node (Mnesia instance) with the overhead of having to know all the details of every other schema in the entire system, much less have to be in communication with nodes with which it is not sharing data. -- Kurt Luoto From kurt@REDACTED Fri Feb 22 03:09:28 2002 From: kurt@REDACTED (Kurt Luoto) Date: Thu, 21 Feb 2002 18:09:28 -0800 Subject: Redundant nodes Message-ID: <58BE468BAC66D511AFE6000347251A2D011ED5D6@morpheus.lanterncom.com> Our shelf hardware was designed to support a pair of redundant control cards, only one of which is "active" at any given time, the other intended to be a "hot standby". However the specifics of the hardware design are such that only the currently active card can talk to the outside world or to any of the line cards in the shelf. The currently standby processor can only talk directly to the active card through a dedicated channel between them, across which they exchange data that needs to be mirrored. The intention was that from the point of view of an external entity (such as a management system), and from the point of view of the line cards, there is apparently only one control card (entity, control point). The idea is that since only one of the control cards can talk to the world at any given time, both cards can offer the same IP address (even the same MAC address) to the world. When a switchover occurs between the redundant control cards in the shelf, it will appear to the world that there has been a temporary disruption since TCP sessions (and perhaps their associated processes) will have to be re-established or restarted, and if transactions were in process they may be aborted, but otherwise the shelf responds to the same addresses and they pick up where they left off. The same story from the line card's point of view. Assuming that all the processors within the shelf are running Erlang, as are some processors outside the shelf, is the above scheme feasible with the current design of the Erlang message distribution mechanism? Or would a switchover in the above scheme necessarily wreak havoc? -- Kurt Luoto From dgud@REDACTED Fri Feb 22 08:27:37 2002 From: dgud@REDACTED (Dan Gudmundsson) Date: Fri, 22 Feb 2002 08:27:37 +0100 Subject: Mnesia and the Erlang message distribution model In-Reply-To: <58BE468BAC66D511AFE6000347251A2D011ED5D4@morpheus.lanterncom.com> References: <58BE468BAC66D511AFE6000347251A2D011ED5D4@morpheus.lanterncom.com> Message-ID: <15477.62185.948817.202006@gargle.gargle.HOWL> Hi Kurt Luoto writes: > I'm a newcomer to Erlang/OTP, and I have a some Mnesia questions. I'll post > each in a separate email so we can maintain separate threads for each. > And I'll answer all of them in the same thread :-) Since the short answer to all your questions is .. no. > So I would like to know if it is possible to set up a sparse communications > topology to match the hardware configuration. If necessary, I could live > with having Mnesia replicate tables such that each control processor has > local copies of all the data it needs for its chassis, with the hope that > within each chassis the line card's copy of Mnesia only needs to deal with > control processor's copy of Mnesia. > > Is this possible today? > > -- Kurt Luoto No you can't create topologies inside mnesia, mnesia requires to be fully connected to all the nodes in the schema. You would have to create separate mnesia schemas/clusters (set of nodes), but since mnesia doesn't handle several schemas, the set of nodes for each cluster may not overlap with each other. If you want tables to be globally available to all nodes, you would have to keep them updated manually, i.e. in each cluster have one process that subscribes to all changes in the table and updates the other clusters, you will loose the ACID properties though. Comments about the redundant nodes mail from the database view, this also breaks mnesia functionality since the mnesia nodes needs to be fully connected, i.e. you can't have mnesia running on the hot standby. Sorry for ruin your day :-( /Dan -- Dan Gudmundsson Project: Mnesia, Erlang/OTP Ericsson Utvecklings AB Phone: +46 8 727 5762 UAB/F/P Mobile: +46 70 519 9469 S-125 25 Stockholm Visit addr: Armborstv 1 From cpressey@REDACTED Fri Feb 22 08:37:32 2002 From: cpressey@REDACTED (Chris Pressey) Date: Fri, 22 Feb 2002 01:37:32 -0600 Subject: Mnesia -- multiple schemas? In-Reply-To: <58BE468BAC66D511AFE6000347251A2D011ED5D5@morpheus.lanterncom.com> References: <58BE468BAC66D511AFE6000347251A2D011ED5D5@morpheus.lanterncom.com> Message-ID: <20020222013732.66fcd11a.cpressey@catseye.mb.ca> On Thu, 21 Feb 2002 17:46:38 -0800 Kurt Luoto wrote: > When Mnesia is running in an Erlang node, is there only one "schema", one > database at any given time? Or can a Mnesia instance support multiple > schemas at the same time? In my experience, Mnesia only supports a single schema per node. Maybe what would be useful for a sparse distribution topology would be some sort of mostly-but-not-entirely transparent 'bridge' to connect two different groups of nodes. Not sure how that would work though. What I would really like would be if Mnesia could add or remove nodes from its schema after the schema has been created (perhaps I am living in a fantasy world though.) All nodes must be up and have mnesia stopped while creating or destroying a schema (but they must have mnesia started when creating tables.) This is a bit tiresome to manually set up on a large number of nodes, and pretty much rules out ad hoc deployment. If anyone knows a nifty trick to make this more painless, I'm all ears :) Chris From dgud@REDACTED Fri Feb 22 09:20:14 2002 From: dgud@REDACTED (Dan Gudmundsson) Date: Fri, 22 Feb 2002 09:20:14 +0100 Subject: Mnesia -- multiple schemas? In-Reply-To: <20020222013732.66fcd11a.cpressey@catseye.mb.ca> References: <58BE468BAC66D511AFE6000347251A2D011ED5D5@morpheus.lanterncom.com> <20020222013732.66fcd11a.cpressey@catseye.mb.ca> Message-ID: <15477.65342.326051.539508@gargle.gargle.HOWL> Chris Pressey writes: > What I would really like would be if Mnesia could add or remove nodes from > its schema after the schema has been created (perhaps I am living in a > fantasy world though.) All nodes must be up and have mnesia stopped while > creating or destroying a schema (but they must have mnesia started when > creating tables.) This is a bit tiresome to manually set up on a large > number of nodes, and pretty much rules out ad hoc deployment. If anyone > knows a nifty trick to make this more painless, I'm all ears :) > To add a node On one of existing nodes mnesia:add_table_copy(schema, Node, ram_copies), mnesia:change_table_copy(schema, Node, disc_copies). Or on the new node or mnesia:change_config(extra_db_nodes, [Nodes]), mnesia:change_table_copy(schema, node(), disc_copies). Delete the replica of every table on that node and then delete the schema. mnesia:del_table_copy(schema, Node) /Dan -- Dan Gudmundsson Project: Mnesia, Erlang/OTP Ericsson Utvecklings AB Phone: +46 8 727 5762 UAB/F/P Mobile: +46 70 519 9469 S-125 25 Stockholm Visit addr: Armborstv 1 From etxuwig@REDACTED Fri Feb 22 10:26:10 2002 From: etxuwig@REDACTED (Ulf Wiger) Date: Fri, 22 Feb 2002 10:26:10 +0100 (MET) Subject: Mnesia and the Erlang message distribution model In-Reply-To: <58BE468BAC66D511AFE6000347251A2D011ED5D4@morpheus.lanterncom.com> Message-ID: I would like to modify Dan's answer to say: yes, it is possible, but you cannot rely entirely on the default behaviour of the OTP components (wouldn't that have been sweet?) On Thu, 21 Feb 2002, Kurt Luoto wrote: >I would like to hear that it is possible to set up a sparse >connection topology, a hierarchy of nodes where each node only >needs to maintain connections with a few other nodes, for >example, it's immediate "parent" or "master", it's immediate >"children" or "slaves", and perhaps a few of it's "siblings" or >"peers". One thing you can do is to make the Erlang nodes on the line cards (assuming you really want to run Erlang there) "hidden nodes". This means that they will run distributed Erlang, but do not appear in the nodes() list of the other nodes. What to think about when using hidden nodes in particular, but basically for distributed processing in general, is that you should craft your APIs such that they hide the specifics of inter-process(or) communication. Having done that, you could replace distributed Erlang with a connection-less lightweight protocol, with only minor changes to your code. (If you want to get really sophisticated, you'll replace the TCP/IP-based Distributed Erlang with your own model. This is not for the faint of heart, but there's a user's guide that explains how to do it.) The scaling problems when running 200 to 300 Erlang nodes lie not so much in Distributed Erlang, but in things like the global name server. Using global_groups, one can partition the global name space in order to make sure that global name registration doesn't lead to voting among 300 peers. Regarding mnesia, I don't think that it's terribly much overhead to maintain the schema on 300 nodes, since the schema is static. The trick is to allocate table copies in an efficient manner. You could, for example, maintain table copies on two control processors, for fault tolerance, and _maybe_ one local copy on a line card, where the local processing occurs. If you really need full replication of data, well, Mnesia is probably as good as anything else (unless you come up with a true multicast replication scheme of sorts.) /Uffe From vlad_dumitrescu@REDACTED Fri Feb 22 11:45:56 2002 From: vlad_dumitrescu@REDACTED (Vlad Dumitrescu) Date: Fri, 22 Feb 2002 11:45:56 +0100 Subject: Mnesia and the Erlang message distribution model Message-ID: Hi, I have kind of a side-question Ulf said: >The scaling problems when running 200 to 300 Erlang nodes lie not >so much in Distributed Erlang, but in things like ... while the "Efficiency guide" v5.1 states: >The maximum number of distributed nodes that one Erlang node can connect to >during its life time is 255. It can be less than 255 for several mostly >platform dependent reasons, for example the maximum >number of open file >descriptors allowed for a process on the operating system. which makes a number of 300 fully conected peers unreachable anyways... Isn't it? And also note that the documentation doesn't say "maximum number of distributed nodes to connect SIMULTANEOUSLY to", but "during it's life time"... Does that mean that even if nodes get disconnected, the connection is remembered somehow and can't be reused? Seems very weird to me if it was like that... What is the right interpretation? best regards, Vlad _________________________________________________________________ MSN Photos ?r det enklaste s?ttet att dela ut?och skriva ut foton: http://photos.msn.se/Support/WorldWide.aspx From fredrik.linder@REDACTED Fri Feb 22 14:37:13 2002 From: fredrik.linder@REDACTED (Fredrik Linder) Date: Fri, 22 Feb 2002 14:37:13 +0100 Subject: kill_after Message-ID: Hi Are there any plans on adding erlang:exit_after(Time, Pid, Reason), in the same fashion as erlang:send_after/3 and erlang:start_timer/3? I would prefer using them instead of the timer module. /Fredrik From hakan@REDACTED Fri Feb 22 15:09:36 2002 From: hakan@REDACTED (Hakan Mattsson) Date: Fri, 22 Feb 2002 15:09:36 +0100 (MET) Subject: kill_after In-Reply-To: Message-ID: On Fri, 22 Feb 2002, Fredrik Linder wrote: Fredrik> Are there any plans on adding erlang:exit_after(Time, Pid, Reason), in the Fredrik> same fashion as erlang:send_after/3 and erlang:start_timer/3? Fredrik> Fredrik> I would prefer using them instead of the timer module. This reminds me on a couple of useful functions in megaco_monitor, that would be nice to have as blinding fast BIF's: apply_after(M, F, A, Time) -> Ref cancel_apply_after(Ref) -> ok | {error, Reason} apply_at_exit(M, F, A, Pid) -> Ref cancel_apply_at_exit(Ref) -> ok | {error, Reason} /H?kan From camarao@REDACTED Fri Feb 22 21:06:44 2002 From: camarao@REDACTED (Carlos Camarao de Figueiredo) Date: Fri, 22 Feb 2002 17:06:44 -0300 (EST) Subject: SBLP'2002 Call for Papers -> Feb.28,2002 Message-ID: <200202222006.g1MK6iU29292@berilo.dcc.ufmg.br> =============================================== SBLP'2002 VI Brazilian Symposium on Programming Languages http://www.inf.puc-rio.br/sblp Departamento de Inform?tica PUC-Rio Rio de Janeiro, RJ, Brazil June 05-07, 2002 =============================================== The VI Brazilian Symposium on Programming Languages (SBLP'2002) will be held at Pontif?cia Universidade Cat?lica do Rio de Janeiro (PUC-Rio) in Rio de Janeiro, Brazil, on June 05-07, 2002. The symposium is sponsored by the Brazilian Computer Society (SBC) and aims to provide a forum where researchers, educators, and practitioners present and discuss the latest theoretical and practical work on programming languages. We invite authors to contribute to SBLP'2002 with the following kinds of submission: * Technical research papers introducing original research results on topics such as (but not limited to): - Programming language design and implementation - Formal semantics of programming languages - Domain-specific programming languages - Visual programming languages - Programming languages for mobile, WWW, and network computing - Script languages - Design and implementation of programming tools and environments - New programming models - Theoretical foundations of programming languages - Teaching programming languages * Experience reports on the use of programming languages, tools, and environments. The reports should clearly state the problems and difficulties identified on using those programming languages or technologies on projects, possibly giving solutions to those problems or hints to avoid them. * Tutorial proposals on subjects related to programming languages, APIs, tools, environments or theories. There will be also invited lectures, tutorials, panels, and working meetings to closely group together professionals interested on specific research topics. Important dates --------------- Deadline for submissions: February 28, 2002 Notification of acceptance: March 28, 2002 Camera-ready version: May 15, 2002 Conference chair ---------------- Edward Hermann Haeusler Departamento de Inform?tica Pontif?cia Universidade Cat?lica do Rio de Janeiro Tel.: +55 (21) 3114-1500 R: 4345 email: hermann@REDACTED Program Chair ------------- Carlos Camar?o Departamento de Ci?ncia da Computa??o Universidade Federal de Minas Gerais Tel: +55 (31) 3499 5889 email: camarao@REDACTED Invited Speakers ----------------- Simon Thompson (U. Kent) Doug Lea (State Univ. of New York at Oswego) Submission details ------------------- Contributions can be written in Portuguese, English or Spanish. Those written in English can be selected for publication elsewhere (probably Elsevier Electronic Notes in Theoretical Computer Science). All papers and experience reports will be published in the conference proceedings. Papers should have at most 14 pages and experience reports at most 8 pages. ---- Tutorials will be published in a separate proceedings. They should cover material of postgraduate level. The tutorial submission may be only a proposal, containing: - title - author names - motivation, describing the relevance of the subject in the area of programming languages - abstract - description of the presentation (optional) Tutorial proposals will be selected according to i) its technical quality and ii) expected relevance and interest from the community. The final tutorial should contain at most 30 pages. ---- Contributions should use the standard format of SBC (Brazilian Computer Society). They are available in: - LaTeX: http://www.sbc.org.br/templates/sbc-template-latex.zip - PDF/Adobe Acrobat: http://www.sbc.org.br/templates/sbc-template-pdf.zip - Word: http://www.sbc.org.br/templates/sbc-template-dot.zip Use of LaTeX is preferred. Examples of the use of the SBC format can be found in these zip files. (You can also obtain them by visiting the site http://www.sbc.org.br and following the links *eventos* and, afterwards, *Informa??es ?teis*.) For submission of contributions, fill out the required information at http://www.dcc.ufmg.br/~camarao/sblp/forms/authpaper_reg.html Program Committee ----------------- Alan Mitchell Durham (USP) Alex Garcia (IME/RJ) Alfio Martini (UFRGS) Andr? Santos (UFPE) Br?ulio Avila (PUC/PR) Carlos Camar?o (UFMG) Catuscia Palamidessi (Pennsylvania State) Cec?lia Rubira (Unicamp) Christiano de Oliveira Braga (PUC-Rio) Dale Miller (Pennsylvania State) Dilma da Silva (IBM TJ Watson) Edward Hermann Haeusler (PUC-Rio) Hermano Moura (UFPE) Isabel Cafezeiro (UFF) Jos? Fiadeiro (ATX Software, Univ. of Lisbon) Jos? Oliveira Guimar?es (UFSCar) Luc?lia Figueiredo (UFOP) Maria L?cia Lisboa (UFRGS) Mariza Bigonha (UFMG) Martin Musicante (UFPR) Noemi Rodriguez (PUC-Rio) Paulo Blauth (UFRGS) Paulo Borba (UFPE) Rafael Lins (UFPE) Roberto Bigonha (UFMG) Roberto Ierusalimschy (PUC-Rio) Uday Reddy (Birmingham) ====================================================================== From Martin.Fraenzle@REDACTED Mon Feb 25 13:54:03 2002 From: Martin.Fraenzle@REDACTED (Martin Fraenzle) Date: Mon, 25 Feb 2002 13:54:03 +0100 (MET) Subject: FTRTFT02 - New Deadline March 11 Message-ID: ----------------------------------------------------- Due to several requests we announce the following extended deadline for paper submissions: *** Monday, March 11, 2002 *** For more information visit the Web page http://www.informatik.uni-oldenburg.de/ftrtft02 There will be no further extension. W. Damm and E.-R. Olderog (Conference co-chairs) ---------------------------------------------------------------------- CALL FOR PAPERS FTRTFT 2002 7th International Symposium on Formal Techniques in Real-Time and Fault Tolerant Systems co-sponsored by IFIP Working Group 2.2 on Formal Description of Programming Concepts ........................................................................... New in 2002 --- special focus on UML --- additional topic: secure global and mobile computing ........................................................................... 9 -- 12 September 2002 University of Oldenburg Germany http://www.informatik.uni-oldenburg.de/ftrtft02 ftrtft02@REDACTED ====================================================================== IMPORTANT DATES: DEADLINE EXTENDED March 11, 2002 (Monday): Submissions (about 18 LNCS pages) due May 1, 2002: Notification of acceptance June 1, 2002: Final versions due September 9-12, 2002: FTRTFT 2002 ====================================================================== From per@REDACTED Tue Feb 26 02:21:44 2002 From: per@REDACTED (Per Bergqvist) Date: Tue, 26 Feb 2002 02:21:44 +0100 Subject: R8B-0 devpoll patch Message-ID: <200202260121.g1Q1LiK21720@hunden.levonline.com> Hi, Even if you don't like to patch your Erlang releases this is one you really want if you run Linux (2.4.x) or Solaris 8. This patch implements support for /dev/poll in Solaris and /dev/epoll for Linux. The idea about /dev/[e]poll is to declare interest in a file descriptor once to the kernel rather than building large poll descriptors and shuffle them around. /dev/epoll (eventpoll) takes it a bit further and mmaps the result set allocated by the driver to the process. In tests I have run 8192 concurrent persistent TCP sessions pumping 1MB/s over and 10 Mb ethernet with 70% idle cpu on a Celeron 650MHz. The Solaris variant is less efficient but still gives much better performance compare to traditional poll when you have many, many file descriptors in use. Files modified by this patch: erts/acconfig.h erts/configure.in erts/emulator/sys/unix/sys.c To apply the patch: # cd $ERL_TOP # patch -p1 < devpoll_patch # cd erts # autoheader # autoconf # cd .. # ./configure # make If you don't have autoheader and autoconf I have attached new versions of config.h.in and configure as well. Please note that they should be copied to the erts directory and nowhere else. A final note on Linux: To make eventpoll (/dev/epoll) useable for Erlang I modified the driver to be pollable itself and to use ms timeouts. Davide Libenzi have incorporated the fixes in release 0.28. Get this (or later) from http://www.xmailserver.org/linux-patches/nio-improve.html Have fun and please let me know of your experiences. Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED -------------- next part -------------- A non-text attachment was scrubbed... Name: devpoll_patch Type: application/octet-stream Size: 12171 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: config.h.in Type: application/octet-stream Size: 8912 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: configure Type: application/octet-stream Size: 163690 bytes Desc: not available URL: From ingela@REDACTED Tue Feb 26 13:24:14 2002 From: ingela@REDACTED (Ingela Anderton) Date: Tue, 26 Feb 2002 13:24:14 +0100 (MET) Subject: Online documentation Message-ID: <15483.31175.902328.63173@gildor> Hi! In some of my previous answers to questions (thread, "distributed messaging" and "how do I specify include path?" ) I referred to the online documentation. Unfortunately, despite my efforts not to do so, I refer to the ericsson internal page instead of the external one. But as you are all so intelligent ;) maybe you have already drawn the conclusion that if you swap http://erlang.ericsson.se/doc/ with http://www.erlang.se/doc/ you will get the external page. -- /Ingela From garry@REDACTED Tue Feb 26 22:22:17 2002 From: garry@REDACTED (Garry Hodgson) Date: Tue, 26 Feb 2002 16:22:17 -0500 Subject: pico question Message-ID: <3C7BFC89.15E58BCB@sage.att.com> i'm using joe armstrong's pico (11.0) server to build an xmlrpc server. i've got it working now, but only after a bit of kludgery with the data that i get passed. in particular, the message body seems to get split into a tuple, losing the "=" in the xml header. that is, when the client sends: \n\n ...rest deleted... my event handler: event_handler( { post, _, Whatever, Message }, State ) -> gets a Message value of: [ { "\n\n ...rest deleted... } ] note that the "=" got lost from between the two elements of the tuple. it's easy enough to work around, but i was curious why this happens? -- Garry Hodgson Let my inspiration flow Senior Hacker in token rhyme suggesting rhythm Software Innovation Services that will not forsake me AT&T Labs 'til my tale is told and done. garry@REDACTED From willem@REDACTED Tue Feb 26 23:11:57 2002 From: willem@REDACTED (Willem Broekema) Date: Tue, 26 Feb 2002 23:11:57 +0100 Subject: ets:info/1 Message-ID: <3C7C082D.2020800@pastelhorn.com> Seems like a bug: ets:info/1 returns a tuple of the form { {K,V},{K2,V2},.. } instead of doing what the doc says: returning a list of the k-v pairs. 98> T = ets:new(bogus, [set, private]). 63 99> ets:info(T). {{memory,276}, {owner,<0.343.0>}, {name,bogus}, {size,0}, {node,nonode@REDACTED}, {named_table,false}, {type,set}, {keypos,1}, {protection,private}} - Willem From kent@REDACTED Tue Feb 26 19:27:11 2002 From: kent@REDACTED (Kent Boortz) Date: 26 Feb 2002 19:27:11 +0100 Subject: R8B-0 devpoll patch In-Reply-To: Per Bergqvist's message of "Tue, 26 Feb 2002 02:21:44 +0100" References: <200202260121.g1Q1LiK21720@hunden.levonline.com> Message-ID: > This patch implements support for /dev/poll in Solaris > and /dev/epoll for Linux. This sounds very promising. For FreeBSD there is kqueue() that according to some tests is even more efficient. Do you know how stable these extensions are? kent Ref: http://www.kegel.com/dkftpbench/Poller_bench.html http://www.xmailserver.org/linux-patches/nio-improve.html http://www.citi.umich.edu/techreports/reports/citi-tr-00-4.pdf http://www.acme.com/software/thttpd/ (source has select/poll/kqueue wrapper) From per@REDACTED Wed Feb 27 09:32:09 2002 From: per@REDACTED (Per Bergqvist) Date: Wed, 27 Feb 2002 09:32:09 +0100 Subject: Fwd: Re: R8B-0 devpoll patch Message-ID: <200202270832.g1R8W9v21475@sork.levonline.com> Missed to reply to list as well, sorry. /Per From: Per Bergqvist To: Kent Boortz Date: Wed, 27 Feb 2002 06:39:54 +0100 > > This sounds very promising. For FreeBSD there is kqueue() that > according to some tests is even more efficient. > > Do you know how stable these extensions are? If you mean my patch it is of course rock solid(tm) ... Well at least it works for me. :-) I has not been through any kind of formal testing but a have run a large number of stress tests and tested a very large distributed application with it ... For the other poll extensions: 1) Solaris /dev/poll was introduces as a patch for Solaris 7 and is official since Solarais 8. 2) /dev/epoll is still being developed by Davide. I will most likely change somewhat with more ioctl. It is unlikely that the semantics of EP_POLL will change. 3) I don't have FreeBSD running anywhere and deliberately skipped this. /Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From art@REDACTED Wed Feb 27 15:21:54 2002 From: art@REDACTED (Artur Grabowski) Date: 27 Feb 2002 15:21:54 +0100 Subject: R8B-0 devpoll patch In-Reply-To: Kent Boortz's message of "26 Feb 2002 19:27:11 +0100" References: <200202260121.g1Q1LiK21720@hunden.levonline.com> Message-ID: <878z9f80ot.fsf@kaka.blahonga.org> Kent Boortz writes: > > This patch implements support for /dev/poll in Solaris > > and /dev/epoll for Linux. > > This sounds very promising. For FreeBSD there is kqueue() that > according to some tests is even more efficient. > > Do you know how stable these extensions are? kqueue in FreeBSD and OpenBSD (soon to be adapted by NetBSD too) is very stable (well, actually I introduced a bug in OpenBSD-current a few weeks ago that I'm fixing at this moment) and very useful and perform well. Unfortunately not all files support kqueues. Pipes, fifos, regular files sockets and ttys, as well as processes and signals, are supported, but more weird devices like usb stuff, audio, radio, etc. are not supported. I know that NetBSD is aiming for full support (everything that supports select will also support kqueue) and as soon as I have some more time I will go for full support in OpenBSD (possibly even going as far as making select(2) and poll(2) into wrappers around kqueues). But that's worth thinking about. Also, the full advantage of kqueues is seen if you try to move all event handling including processes and signals into the same processing loop. The first time I fully appreciated kqueues was when I convereted all external event handling in inetd(8) into kqueues and realized that I just removed thousands lines of code (including three signal handling race conditions) and replaced them by four 10-line functions for {,de}registering events and 5 lines in the main loop. //art From camarao@REDACTED Wed Feb 27 19:05:27 2002 From: camarao@REDACTED (Carlos Camarao de Figueiredo) Date: Wed, 27 Feb 2002 15:05:27 -0300 (EST) Subject: SBLP'2002 deadline extension --> March 7 Message-ID: <200202271805.g1RI5RN15228@berilo.dcc.ufmg.br> Due to a number of requests, we have decided to extend the deadline for submissions to SBLP'2002 to March 7, 2002. ************* The full updated call for papers is included below. =============================================== SBLP'2002 VI Brazilian Symposium on Programming Languages http://www.inf.puc-rio.br/sblp Departamento de Inform?tica PUC-Rio Rio de Janeiro, RJ, Brazil June 05-07, 2002 =============================================== First Call for Papers --------------------- The VI Brazilian Symposium on Programming Languages (SBLP'2002) will be held at Pontif?cia Universidade Cat?lica do Rio de Janeiro (PUC-Rio) in Rio de Janeiro, Brazil, on June 05-07, 2002. The symposium is sponsored by the Brazilian Computer Society (SBC) andg aims to provide a forum where researchers, educators, and practitioners present and discuss the latest theoretical and practical work on programming languages. We invite authors to contribute to SBLP'2002 with the following kinds of submission: * Technical research papers introducing original research results on topics such as (but not limited to): - Programming language design and implementation - Formal semantics of programming languages - Domain-specific programming languages - Visual programming languages - Programming languages for mobile, WWW, and network computing - Script languages - Design and implementation of programming tools and environments - New programming models - Theoretical foundations of programming languages - Teaching programming languages * Experience reports on the use of programming languages, tools, and environments. The reports should clearly state the problems and difficulties identified on using those programming languages or technologies on projects, possibly giving solutions to those problems or hints to avoid them. * Tutorial proposals on subjects related to programming languages, APIs, tools, environments or theories. There will be also invited lectures, tutorials, panels, and working meetings to closely group together professionals interested on specific research topics. Important dates --------------- Deadline for submissions: March 7, 2002 Notification of acceptance: April 8, 2002 Camera-ready version: May 15, 2002 Conference chair ---------------- Edward Hermann Haeusler Departamento de Inform?tica Pontif?cia Universidade Cat?lica do Rio de Janeiro Tel.: +55 (21) 3114-1500 R: 4345 email: hermann@REDACTED Program Chair ------------- Carlos Camar?o Departamento de Ci?ncia da Computa??o Universidade Federal de Minas Gerais Tel: +55 (31) 3499 5889 email: camarao@REDACTED Submission details ------------------- Contributions can be written in Portuguese, English or Spanish. Those written in English can be selected for publication elsewhere (probably Elsevier Electronic Notes in Theoretical Computer Science). All papers and experience reports will be published in the conference proceedings. Papers should have at most 14 pages and experience reports at most 8 pages. ---- Tutorials will be published in a separate proceedings. They should cover material of postgraduate level. The tutorial submission may be only a proposal, containing: - title - author names - motivation, describing the relevance of the subject in the area of programming languages - abstract - description of the presentation (optional) Tutorial proposals will be selected according to i) its technical quality and ii) expected relevance and interest from the community. The final tutorial should contain at most 30 pages. ---- Contributions should use the standard format of SBC (Brazilian Computer Society). They are available in: - LaTeX: http://www.sbc.org.br/templates/sbc-template-latex.zip - PDF/Adobe Acrobat: http://www.sbc.org.br/templates/sbc-template-pdf.zip - Word: http://www.sbc.org.br/templates/sbc-template-dot.zip Use of LaTeX is preferred. Examples of the use of the SBC format can be found in these zip files. (You can also obtain them by visiting the site http://www.sbc.org.br and following the links *eventos* and, afterwards, *Informa??es ?teis*.) For submission of contributions, fill out the required information at http://www.dcc.ufmg.br/~camarao/sblp/forms/authpaper_reg.html ====================================================================== From per@REDACTED Thu Feb 28 05:50:15 2002 From: per@REDACTED (Per Bergqvist) Date: Thu, 28 Feb 2002 05:50:15 +0100 Subject: R8B-0 devpoll patch In-Reply-To: <03c601c1bf6b$dcfeb350$4021970a@norris> Message-ID: <200202280450.g1S4oGR05145@raven.levonline.com> > Hi Per, > > Did you find on Solaris that there was a mistake in > included by : the extern "C" { chunk (line 63) must be moved > to before the #if defined(_KERNEL) (line 58) to match the #endif and } at > the bottom of the file! > > Possibly its been fixed in a patch, although we haven't seen it. > I have another version of with the #if defined(_KERNEL) on line 62. (from Solaris 8 MU6) This file is still wrong. However, the bug will only affect c++ users and will not affect building Erlang. Thanks for letting me know. /Per From per@REDACTED Thu Feb 28 06:10:30 2002 From: per@REDACTED (Per Bergqvist) Date: Thu, 28 Feb 2002 06:10:30 +0100 Subject: R8B-0 devpoll patch In-Reply-To: <878z9f80ot.fsf@kaka.blahonga.org> Message-ID: <200202280510.g1S5AV618160@hyena.levonline.com> [snip] > Unfortunately not all files support kqueues. Pipes, fifos, regular files > sockets and ttys, as well as processes and signals, are supported, but more > weird devices like usb stuff, audio, radio, etc. are not supported. Eventpoll in Linux has exactly the same problem. For this reason I added poll support to the /dev/epoll device itself. By doing that I can have a smaller result with "weird" files on which I actually call poll(). If readiness is indicated on the eventpoll file descriptor I do a EP_POLL to get the actual events. Would it be possible to multiplex with kqueue in a similiar way ? > I know > that NetBSD is aiming for full support (everything that supports select will > also support kqueue) and as soon as I have some more time I will go for > full support in OpenBSD (possibly even going as far as making select(2) and > poll(2) into wrappers around kqueues). But that's worth thinking about. > Even better. /Per ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED From art@REDACTED Thu Feb 28 15:38:31 2002 From: art@REDACTED (Artur Grabowski) Date: 28 Feb 2002 15:38:31 +0100 Subject: R8B-0 devpoll patch In-Reply-To: Per Bergqvist's message of "Thu, 28 Feb 2002 06:10:30 +0100" References: <200202280510.g1S5AV618160@hyena.levonline.com> Message-ID: <87adtt7jtk.fsf@kaka.blahonga.org> Per Bergqvist writes: > [snip] > > > Unfortunately not all files support kqueues. Pipes, fifos, regular files > > sockets and ttys, as well as processes and signals, are supported, but > > more weird devices like usb stuff, audio, radio, etc. are not supported. > > Eventpoll in Linux has exactly the same problem. For this reason > I added poll support to the /dev/epoll device itself. > By doing that I can have a smaller result with "weird" files on > which I actually call poll(). If readiness is indicated on the > eventpoll file descriptor I do a EP_POLL to get the actual > events. > > Would it be possible to multiplex with kqueue in a similiar way ? Yes, you can select(2)/poll(2) on kqueue descriptors. You can also register kqueue descriptors on another kqueue just to add to the orthogonality. //art From yrashk@REDACTED Thu Feb 28 16:41:01 2002 From: yrashk@REDACTED (Yurii A. Rashkovskii) Date: Thu, 28 Feb 2002 17:41:01 +0200 Subject: jinterface, applet Message-ID: <001601c1c06e$53214770$5864a8c0@softerra.int> Ladies and Gentlemen, Is there any "light" jinterface implementation (or something like this) that we'll be usable in java applets? -- Best regards, Yurii (http://yar.com.ua/) -------------- next part -------------- An HTML attachment was scrubbed... URL: From per@REDACTED Thu Feb 28 22:03:22 2002 From: per@REDACTED (Per Bergqvist) Date: Thu, 28 Feb 2002 22:03:22 +0100 Subject: R8B-0 devpoll patch In-Reply-To: <87adtt7jtk.fsf@kaka.blahonga.org> Message-ID: <200202282103.g1SL3P306075@raven.levonline.com> > Per Bergqvist writes: > > > [snip] > > > > > Unfortunately not all files support kqueues. Pipes, fifos, regular files > > > sockets and ttys, as well as processes and signals, are supported, but > > > more weird devices like usb stuff, audio, radio, etc. are not supported. > > > > Eventpoll in Linux has exactly the same problem. For this reason > > I added poll support to the /dev/epoll device itself. > > By doing that I can have a smaller result with "weird" files on > > which I actually call poll(). If readiness is indicated on the > > eventpoll file descriptor I do a EP_POLL to get the actual > > events. > > > > Would it be possible to multiplex with kqueue in a similiar way ? > > Yes, you can select(2)/poll(2) on kqueue descriptors. You can also > register kqueue descriptors on another kqueue just to add to the > orthogonality. > Great. A few other questions: 1) What is the best way to check if the fd should use poll or kqueue ? (in the Linux I do a fstat and test the mode) 2) Do you have to register EVFILT_READ and WRITE as separate event filters or can you simply OR them in one event ? (Check a few examples on the web and they all register separate events) Will get access to a FreeBSD machine next week to test it ... /Per > //art > ========================================================= Per Bergqvist Synapse Systems AB Phone: +46 709 686 685 Email: per@REDACTED