From "mickael_remond"@REDACTED Thu Apr 1 15:42:13 1999 From: "mickael_remond"@REDACTED ("mickael_remond"@REDACTED) Date: Thu, 1 Apr 1999 15:42:13 +0200 Subject: OTP 5.0 Message-ID: I have heard their will be some improvement on database management in OTP 5.0. For exemple, ODBC will be available for the Windows and the Solaris version. Did you also improve the database management tools on Linux ? Is there a list of new feature of the version 5.0 ? In fact, I am likely to code some tools for database management and I do not want to rewrite something that is already in the next Erlang version. By the way, did someone try to compile SQLErlang with AdabasD oracle mode ? Thank you Micka?l R?mond From mike@REDACTED Wed Apr 7 19:19:29 1999 From: mike@REDACTED (Michael L. Welles) Date: Wed, 7 Apr 1999 12:19:29 -0500 (CDT) Subject: eddieware.org down? Message-ID: <14091.37793.445850.389182@queso> My apologies in advance for inappropriate questions, but this list is about as close as I know how to get... I've been trying to get trhough to eddieware.org for a few days to find out mailing list information for eddie. Unfortunatly the site has been down since at least monday. Does anyone on this list know the proper forum for questions about eddie ... e.g a mailing list? If not, is there anyone on this list who knows something about eddie and wouldn't mind being pestered with a few questions? Does anyone know what the status of eddieware.org is? Does it need a new home? ------------------------------------------------ M. L. Welles mike@REDACTED ------------------------------------------------ From tobbe@REDACTED Thu Apr 8 01:31:41 1999 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Thu, 08 Apr 1999 09:31:41 +1000 Subject: eddieware.org down? In-Reply-To: <14091.37793.445850.389182@queso> References: <14091.37793.445850.389182@queso> Message-ID: <199904072331.JAA03463@universe.serc.rmit.edu.au> ( My apologies if you get two copies of this answer. ) ( I cross-posting this answer to talk@REDACTED ) > My apologies in advance for inappropriate questions, but this list is > about as close as I know how to get... > > I've been trying to get trhough to eddieware.org for a few days to > find out mailing list information for eddie. Unfortunatly the site > has been down since at least monday. > > Does anyone on this list know the proper forum for questions about > eddie ... e.g a mailing list? If not, is there anyone on this list > who knows something about eddie and wouldn't mind being pestered with > a few questions? > > Does anyone know what the status of eddieware.org is? Does it need a > new home? > > > > ------------------------------------------------ > M. L. Welles mike@REDACTED > ------------------------------------------------ I'm afraid we have had 2 power outages in the last few days, the last one this very night. Perhaps we should get hold of some sort of power backup system... Anyway, www.eddieware.org is up and running again. The mailing list to use for eddie questions is: talk@REDACTED Cheers /Tobbe From tobbe@REDACTED Fri Apr 9 04:43:57 1999 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Fri, 09 Apr 1999 12:43:57 +1000 Subject: Beginner problem with Mnemosyne In-Reply-To: <678jwbra.fsf@javagroup.org> References: <678jwbra.fsf@javagroup.org> Message-ID: <199904090243.MAA20879@universe.serc.rmit.edu.au> > I've just started playing with Mnesia, but I'm having a small problem > with some code based on the provided examples. On the function: You must insert the following include directive (put it where your other '-include'-directives are) in your company.erl program. -include_lib("mnemosyne/include/mnemosyne.hrl"). Then it works: ----------------------------------------------------- unix> erl -mnesia_dir `pwd` Erlang (BEAM) emulator version 47.4.1 Eshell V47.4.1 (abort with ^G) 1> mnesia:create_schema([node()]). ok 2> mnesia:start(). ok 3> c(company). {ok,company} 4> company:init(). {atomic,ok} 5> company:insert_me(). {atomic,ok} 6> company:get_me(). {atomic,[luke]} 7> ----------------------------------------------------- Cheers /Tobbe From per@REDACTED Tue Apr 13 00:53:56 1999 From: per@REDACTED (Per Hedeland) Date: Tue, 13 Apr 1999 00:53:56 +0200 (MET DST) Subject: Archive? In-Reply-To: References: Message-ID: <199904122253.AAA13978@super.du.etx.ericsson.se> Luke Gorrie wrote: >I'm just wondering if this list is archived on the web somewhere? Not as far as the list maintainers know...:-) However archives are kept, and are retrievable with the standard Majordomo commands - send a message with just the word "help" (no quotes of course) in the body to majordomo@REDACTED to find out the details. >If not, perhaps we could subscribe www.mail-archive.org to this list. I'll have to reveal my ignorance by asking what that is (I can guess the general idea of course) - also the URL http://www.mail-archive.org/ doesn't exist ("host not found")... --Per Hedeland per@REDACTED From kruegger@REDACTED Tue Apr 13 07:22:58 1999 From: kruegger@REDACTED (Freddie Kruegger) Date: Tue, 13 Apr 1999 01:22:58 -0400 Subject: erlang crashes Message-ID: <199904130523.HAA17680@hades.cslab.ericsson.net> I managed to compile erlang successfully on Unixware 2.1.3 but when i type 'erl' to boot erlang, my erlang just crashed with following message : {'init terminating in do_boot',{'can not load',erlang.get_file}} init terminating in do_boot() does anybody know about this error? i must port erlang on unixware 2.1.3 because it is our development platform! i attached erlang crash dump file together -------------- next part -------------- A non-text attachment was scrubbed... Name: erl_crash.dump Type: application/octet-stream Size: 2087 bytes Desc: not available URL: From ulf.wiger@REDACTED Tue Apr 13 09:43:08 1999 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Tue, 13 Apr 1999 09:43:08 +0200 Subject: erlang crashes References: <199904130523.HAA17680@hades.cslab.ericsson.net> Message-ID: <3712F58C.8E903CFF@etxb.ericsson.se> Yes, this means that erlang cannot load one of the .jam files it needs to get things going. You can tell from the crash dump that the modules 'init' and 'erl_prim_loader' have been loaded, so I guess 'erlang' is next. You can see how erlang loads the modules in the start script. From the crash dump, I can't tell which one you're using, but this early in the start phase there shouldn't be much difference. The start scripts can be found under $ERL_ROOT/releases//. You're probably using start_clean or start. You'll find two files of each - e.g. start.script and start.boot. The .script file is in parsable ASCII format, and starts something like this: [{preLoaded,[init,erl_prim_loader]}, {progress,preloaded}, {path,["$ROOT/lib/kernel-2.1.4/ebin","$ROOT/lib/stdlib-1.5.2/ebin"]}, {primLoad,[erlang,error_handler]}, {kernel_load_completed}, {progress,kernel_load_completed}, As an aside, the .script and .boot files are basically generated like: Script = make_script(...), {ok,Fd} = file:open("start.script", [write]), io:format(Fd, "%% script generated at ~p ~p~n~p.~n", [Script]), file:close(Fd), file:write_file("start.boot", term_to_binary(Script)). If you want to see in more detail what's happening during the boot phase, you can start erlang with the -init_debug flag. /Uffe Freddie Kruegger wrote: > > I managed to compile erlang successfully on Unixware 2.1.3 but when i type > 'erl' to boot erlang, my erlang just crashed with following message : > > {'init terminating in do_boot',{'can not load',erlang.get_file}} > init terminating in do_boot() > > does anybody know about this error? > i must port erlang on unixware 2.1.3 because it is our development platform! > > i attached erlang crash dump file together > > ------------------------------------------------------------------------ > > Name: erl_crash.dump > erl_crash.dump Type: unspecified type (application/octet-stream) > Encoding: 7bit -- Ulf Wiger, Chief Designer AXD 301 Ericsson Telecom AB tfn: +46 8 719 81 95 Varuv?gen 9, ?lvsj? mob: +46 70 519 81 95 S-126 25 Stockholm, Sweden fax: +46 8 719 43 44 From kruegger@REDACTED Tue Apr 13 13:16:10 1999 From: kruegger@REDACTED (Freddie Kruegger) Date: Tue, 13 Apr 1999 07:16:10 -0400 Subject: erlang crashes Message-ID: <199904131116.NAA18027@hades.cslab.ericsson.net> hmm. now erlang is running on Data General AViiON 2600 Unixware 2.1.3. there was something wrong with installation. *.jam files were not installed properly. it's strange... Anyway, with slight modification on Makefile and sys.c, it seems working all right. While compiling, Makefile does not recognize /usr/ucblib and /usr/ucbinclude directory... so i added to it. In Unixware 2.1.3, we have to use fp.h instead of floatingpoint.h, which was included by sys.c file. By the way, when asn.1 compiler will support REAL type? Now i am compiling rest of libraries... i want to say thanks who helped me.... >Yes, this means that erlang cannot load one of the .jam files it needs >to get things going. > >You can tell from the crash dump that the modules 'init' and >'erl_prim_loader' have been loaded, so I guess 'erlang' is next. You can >see how erlang loads the modules in the start script. From the crash >dump, I can't tell which one you're using, but this early in the start >phase there shouldn't be much difference. > >The start scripts can be found under $ERL_ROOT/releases//. > >You're probably using start_clean or start. You'll find two files of >each - e.g. start.script and start.boot. The .script file is in parsable >ASCII format, and starts something like this: > > [{preLoaded,[init,erl_prim_loader]}, > {progress,preloaded}, > >{path,["$ROOT/lib/kernel-2.1.4/ebin","$ROOT/lib/stdlib-1.5.2/ebin"]}, > {primLoad,[erlang,error_handler]}, > {kernel_load_completed}, > {progress,kernel_load_completed}, > > >As an aside, the .script and .boot files are basically generated like: > > Script = make_script(...), > {ok,Fd} = file:open("start.script", [write]), > io:format(Fd, "%% script generated at ~p ~p~n~p.~n", [Script]), > file:close(Fd), > file:write_file("start.boot", term_to_binary(Script)). > > >If you want to see in more detail what's happening during the boot >phase, you can start erlang with the -init_debug flag. > >/Uffe From johnm@REDACTED Tue Apr 13 20:35:03 1999 From: johnm@REDACTED (John Gerard Malecki) Date: Tue, 13 Apr 1999 11:35:03 -0700 (PDT) Subject: Architectural Suggestions for Job Queuing Message-ID: <14099.36439.747507.84870@odin.artisan.com> Hi, I hope this is the right form for a beginner's question. Concurrent Programming and Erlang are new to me. I have read through the book and implemented some trivial programs. Now I would like to implement something useful. I am not sure of how to best architect these applications using Erlang and am looking for suggestions. Also, I am not yet familiar with all of the available libraries and so I may be missing some big picture. I am looking for are some productive hints. I want to code the applications myself. The first application I could use would limit the number of simultaneous jobs to run. In particular, we have limited number of software licenses. I'd like to start up a server and give it a list of jobs queues and their simultaneous limits. Throughout the network whenever someone wants to run job which uses one of those licenses they communicate with the server. If a license is not available then the job blocks until the license is available. I already have a program that does this written in ocaml but it uses threads. Although the threads solution is simple I would prefer to not use them as threads do not allow "introspection". I would prefer to maintain an explicit queue. This way the state of the queue could be printed and all of the running and pending jobs could be printed. As an off-shoot of the first application I would then like to write a batch queue system. Pretty much the only difference is that a general batch queuing system would have a smarter server. Furthermore that server would invoke the job to run and not just count jobs. I think if i do a good job of writing the job limiter the batch queue would not be much more complex but just more complicated. Sorry for bothering but if anyone has any architectural ideas I'd be very interested in reading them and experimenting with them. PS - for more information of ocaml and threads see http://pauillac.inria.fr/ocaml/htmlman/node22.html From klacke@REDACTED Wed Apr 14 00:33:17 1999 From: klacke@REDACTED (Claes Wikstrom) Date: Wed, 14 Apr 1999 00:33:17 +0200 (MET DST) Subject: Architectural Suggestions for Job Queuing In-Reply-To: <14099.36439.747507.84870@odin.artisan.com> References: <14099.36439.747507.84870@odin.artisan.com> Message-ID: <14099.50733.188878.285829@gin> Hello, > be missing some big picture. I am looking for are some productive > hints. I want to code the applications myself. > Ok, I'll just indicate the direction where you should look. > The first application I could use would limit the number of > simultaneous jobs to run. In particular, we have limited number of > software licenses. I'd like to start up a server and give it a list > of jobs queues and their simultaneous limits. This means creating sockets, this is done with gen_tcp.erl > Throughout the network > whenever someone wants to run job which uses one of those licenses > they communicate with the server. If a license is not available then > the job blocks until the license is available. Typically you would want a concurrent/threaded server here, i.e one erlang process per opened socket. There are examples of concurrent tcp/ip servers in the Examples section at http://www.erlang.org/examples/klacke_examples/index.html The toplevel process, the one that creates the socket processes could typically also be responsible for your queues > > I already have a program that does this written in ocaml but it uses > threads. Although the threads solution is simple I would prefer to > not use them as threads do not allow "introspection". Erlang process can't be introspected either, you need to send a message to the process and get a reply, but that is all natural to the erlang programmer. > I would prefer > to maintain an explicit queue. This way the state of the queue could > be printed and all of the running and pending jobs could be printed. This would be done by sending a message to the toplevel process and have it report the situation. The queue is best implemented by the queue.erl module > > As an off-shoot of the first application I would then like to write a > batch queue system. Pretty much the only difference is that a general > batch queuing system would have a smarter server. Furthermore that > server would invoke the job to run and not just count jobs. I think > if i do a good job of writing the job limiter the batch queue would > not be much more complex but just more complicated. No, Last but not least, try % erl -man queue or % erl -man gen_tcp Which at least on a unix system is a convenient way to view the man pages. Cheers /klacke From klacke@REDACTED Wed Apr 14 00:36:18 1999 From: klacke@REDACTED (Claes Wikstrom) Date: Wed, 14 Apr 1999 00:36:18 +0200 (MET DST) Subject: man pages Message-ID: <14099.50914.600588.816173@gin> Several people have asked if it would be possible to view the erlang man pages in a nice way in an *uninstalled* erlang system, that is the compiled source distribution. I do that by #!/bin/sh #file: eman #pupose: maybe useful man viewer for erlang developers if [ "xx$ERL_TOP" = "xx" ]; then echo "Need to set environment variable ERL_TOP" exit 1 fi mp="" for dir in $ERL_TOP/lib/* do if [ -d $dir/doc/man ]; then mp=$mp:$dir/doc/man fi done MANPATH="" export MANPATH man -M$mp $1 Cheers /klacke From joe@REDACTED Wed Apr 14 08:49:18 1999 From: joe@REDACTED (Joe Armstrong) Date: Wed, 14 Apr 1999 08:49:18 +0200 (MET DST) Subject: Architectural Suggestions for Job Queuing In-Reply-To: <14099.50733.188878.285829@gin> Message-ID: On Wed, 14 Apr 1999, Claes Wikstrom wrote: > > Hello, > > > be missing some big picture. I am looking for are some productive > > hints. I want to code the applications myself. > > > > Ok, I'll just indicate the direction where you should look. > > > The first application I could use would limit the number of > > simultaneous jobs to run. In particular, we have limited number of > > software licenses. I'd like to start up a server and give it a list > > of jobs queues and their simultaneous limits. > > This means creating sockets, this is done with gen_tcp.erl Hang on, this implies a design decision that is not yet made. You have to decide: 1) Server in Erlang + clients in Erlang + Distributed Erlang for communication, or, 2) Server in Erlang + clients in Erlang + socket communication, or, 3) Server in Erlang + clients in (C, C++, ...) + socket communication + API for (C, C++, ..) client side applications These are in order of complexity (simplest first). 1) would be OK for a quick prototype to get the protocols ok 3) would be for a commercial product that you could sell 2) is a half way house to implementing 3) > > > Throughout the network > > whenever someone wants to run job which uses one of those licenses > > they communicate with the server. If a license is not available then > > the job blocks until the license is available. I think the key architectural/design problem is one of deciding what you want to do in the event of failure. If the server crashes, then all the clients are blocked. If there is a communication failure then you may loose licenses etc. Here you can virtually design whatever you want. In a small (closed) system - then maybe there should be no server - the clients could alternatively take on the roles of client or server and use a broadcast/lock strategy to negotiate licenses. In a commercial system all nodes might not be equal. One server (placed on a reliable node) might service hundreds of clients, etc. - you still might want to have some hot-standby/fail-over behaviour for the server,... This kind of stuff soon gets complicated (but that's OK - our telecomms stuff is like this :-) Firstly I'd, like to see a simple "ball park" analysis of the problem, in terms of; a) How many clients b) How many servers c) Holding times (how long does a client use a license) d) Reliability requirements. - Is it acceptable that clients block if the server crashes? - Do you want hot standby for server crashes? e) is this a LAN/WAN application? f) required response times for obtaining/freeing a license g) security levels (none, ... full) How much effort do you want to put into making sure that you cannot forge a license (you can have anything up to a full public/private key system) h) Maintaince levels (do you want a remote management system) If so what ... Once you have some idea of the answers to questions like these you can *begin* to think about an architecture. It may be that you have a very specific set of answers - fine then we can talk architectures. Or, you might want to "grow" a solution for a very simple idealized system. /Joe -- Joe Armstrong Computer Science Laboratory +46 8 719 9452 AT2/ETX/DN/SU Ericsson Telecom SE-126 25 Stockholm Sweden joe@REDACTED http://www.ericsson.se/cslab/~joe From johnm@REDACTED Wed Apr 14 17:21:35 1999 From: johnm@REDACTED (John Gerard Malecki) Date: Wed, 14 Apr 1999 08:21:35 -0700 (PDT) Subject: Architectural Suggestions for Job Queuing In-Reply-To: References: <14099.50733.188878.285829@gin> Message-ID: <14100.45695.719441.635844@odin.artisan.com> Hi Joe, Thanks for the response. It looks like there does not exist a gen_batch_queue or gen_software_license module which would immediately solve my problem. :) Getting on to more specifications of the applications let me first state the following. I have no intention of selling the programs or running them outside of the company where i work. If they turn out to be generically useful I'd gratefully make them available to the public community. I'm not sure how much work is involved in developing a robust (crash resistant) and reasonably efficient application. I am curious about your remarks > You have to decide: > > 1) Server in Erlang + clients in Erlang + Distributed Erlang for > communication, or, > > 2) Server in Erlang + clients in Erlang + socket communication, > or, > > 3) Server in Erlang + clients in (C, C++, ...) + socket communication > + API for (C, C++, ..) client side applications > > These are in order of complexity (simplest first). > > 1) would be OK for a quick prototype to get the protocols ok > 3) would be for a commercial product that you could sell > 2) is a half way house to implementing 3) I figured that implementation #1 would minimize the amount of my work. Why is option #2 "better" than #1? I presume you are saying that #3 is good for a commercial product as the end-user could interface to it using C and not Erlang. When you mention option #2 are you suggesting that there is some good reason for using socket communication in preference to Distributed Erlang communication? > I think the key architectural/design problem is one of deciding > what you want to do in the event of failure. If the server crashes, > then all the clients are blocked. If there is a communication failure > then you may loose licenses etc. I agree. This may sound selfish but I would like to implement a robust distributed application because it sounds like fun and i have never written one before. > Here you can virtually design whatever you want. Darn, this is where i was hoping for a gen_software_license module :) > In a small (closed) system - then maybe there should be no server - > the clients could alternatively take on the roles of client or server and > use a broadcast/lock strategy to negotiate licenses. Interesting. > In a commercial system all nodes might not be equal. One server > (placed on a reliable node) might service hundreds of clients, etc. - > you still might want to have some hot-standby/fail-over behaviour for > the server,... > > This kind of stuff soon gets complicated (but that's OK - our > telecomms stuff is like this :-) Since this is not a commercial system i have a lot of flexibility here. I am not familiar with the trade-offs. I presume that the more robust the system the more work it will take to get it written. > Firstly I'd, like to see a simple "ball park" analysis of the > problem, in terms of; > > a) How many clients We have around 100 workstations at our company. This sounds like a nice number. > b) How many servers Other than for reliability or performance i see no reason why the answer could not be 1. Furthermore, I see no reason why the server could not run on all of the machines -- all 100 of them. > c) Holding times (how long does a client use a license) Rarely less than 10 seconds. Normally a minute or two. There may also be interactive use where the license could be held for hours at a time. There may also be large batch jobs where the license is held for some hours. > d) Reliability requirements. > - Is it acceptable that clients block if the server crashes? > - Do you want hot standby for server crashes? Yes and yes. I'm not familiar with the coding and performance impact of having a hot standby. I have never implemented anything like this before. > e) is this a LAN/WAN application? LAN only. > f) required response times for obtaining/freeing a license Less than 1 second. > g) security levels (none, ... full) How much effort do you > want to put into making sure that you cannot forge a license > (you can have anything up to a full public/private key system) None. Environment is completely secure. (Ha!) > h) Maintaince levels (do you want a remote management system) > If so what ... I'm not sure what remote means but yes i do want the ability to dynamically increase or decrease license counts, add new queues, shut down queues, etc. This is one of the reasons Erlang intrigued me as it seems that you guys have familiarity with these kinds of applications. > Once you have some idea of the answers to questions like these you > can *begin* to think about an architecture. > > It may be that you have a very specific set of answers - fine then > we can talk architectures. Or, you might want to "grow" a solution for > a very simple idealized system. I'm in no rush. I like the idea of having an architecture in mind, coding a pilot version, getting feel for how well it will work, making changes and then when happy adding all the bells and whistles. By the way, here is a more detailed description of how my license client and server work. This works well enough in the environment which i have described above. My present implementation of the license client in ocaml is quite small. When the user wants to execute a command on a named license queue, the user enters license_client name command The license_client program communicates with the server by sending it the license name. The license_client program then does a read and blocks. When the server decides that the named license is available to run it writes to the client. The pending license_client read now succeeds and then the license_client executes the desired user command. Once the user command finishes the license_client closes the connection with the server. The server now knows that the license is available. This approach works well as licenses are rarely lost even if the client is killed or crashes. If the server goes down i force the clients to wait. If the server goes down in the middle of a transaction then there is a problem. This is an area for improvement. Since the present implementation of the server uses threads it is convenient to only remember the currently running processes. It messes up the code quite a bit to create a queue of pending processes. This is however a desirable feature and so i would like to add this in the next implementation. From lars@REDACTED Fri Apr 16 13:50:12 1999 From: lars@REDACTED (Lars Thorsen) Date: Fri, 16 Apr 1999 13:50:12 +0200 Subject: Problem getting started with Orber Message-ID: <371723F4.6605040E@erix.ericsson.se> Hi Luke, i think the problem is that the Orber application isn't running. You must first install Orber, the most simple installation is to run Orber just in one Erlang node. That installation is done as follows. First create a mnesia database schema: mnesia:create_schema([]). Then install orber (creates some tables in the database): orber:install([]). Then every time you start your erlang node, you have to start Orber prior to the applications that use it: orber:start(). This badarg message you get comes from the gen_server module when the called process doesn't respond (it could be better i agree). The process in this case is the request number server which just gives a unique number for the outgoing IIOP requests. This explains that all your outgoing IIOP calls failed. Regards Lars Thorsen =============================================================== Ericsson Utvecklings AB Open Telecom Platform --------------------------------------------------------------- E-mail: lars@REDACTED Phone: +46 8 719 93 01 Fax: +46 8 719 91 01 Office address: G?talandsv?gen 218, S-126 25 Stockholm =============================================================== From luke@REDACTED Fri Apr 16 15:34:15 1999 From: luke@REDACTED (Luke Gorrie) Date: 16 Apr 1999 23:34:15 +1000 Subject: Problem getting started with Orber In-Reply-To: Lars Thorsen's message of "Fri, 16 Apr 1999 13:50:12 +0200" References: <371723F4.6605040E@erix.ericsson.se> Message-ID: <4smgk7u0.fsf@javagroup.org> Lars Thorsen writes: > i think the problem is that the Orber application isn't running. Thanks very much, you're quite right -- I cottoned on to this after taking a better look at the examples. I think I was trying to run before I'd learned to walk. :) I've been playing with Orber a bit today, and I have some new questions for you. Firstly, I've noticed that calls to objects which take floats as parameters strictly require a float to be passed in the erlang code, and won't coerce an integer. Thus if you have an operation "foo(in float value)", then calling foo(10) will fail to bind to a marshalling function because the guard requires a float() -- foo(10.0) must be used instead. I loosened the guards on the marshalling code from float() to number() which seems more intuitive to me, does this seem like a good modification? It doesn't introduce ambiguity because the fact that it will become a float has already been ascertained from the typecode, and from my limited testing it seems to work properly. Also related to the point above, I notice that Orber seems to bypass marshalling for calls made to objects belonging to the same Orber application. While this is a good thing, it bypasses the float() check and thus accepts integers in the place of floats, so there is a semantic difference between calling local and remote objects. By making the change above things are made consistent, though. It's getting late here in Australia, so I'm having to turn in for the evening without investigating another possible bug -- it seems that doubles are not being marshalled correctly. When I send a double to a JavaIDL server, it is received with the wrong value, and then Orber fails while trying to unmarshal the reply (which is the same value sent back). I couldn't guarantee that I didn't introduce this problem while hacking at Orber, I'll take a better look at it tomorrow or on Sunday, but I thought I'd best check incase it was a known problem or it was obvious to someone -- I'm just starting out with Erlang and I can't read the code too fluently (yet!). On a side note, I was wondering how one can convert an integer to a float (perhaps to satasfy an overly strict guard)? I didn't see a BIF for it. That's all, thanks for your attention. BTW, I had a chance to learn to use the debugger today, it's very convenient. Erlang seems to manage to astound me several times a day - though maybe too much Java has lowered my expectations ;-). Cheers, Luke From tobbe@REDACTED Sat Apr 17 02:20:09 1999 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Sat, 17 Apr 1999 10:20:09 +1000 Subject: Problem getting started with Orber In-Reply-To: Your message of "16 Apr 1999 23:34:15 +1000." <4smgk7u0.fsf@javagroup.org> Message-ID: <199904170020.KAA00924@campari.serc.rmit.edu.au> > On a side note, I was wondering how one can convert an integer to a > float (perhaps to satasfy an overly strict guard)? I didn't see a BIF > for it. Hm...I should probably also go to bed, but here is a quick and dirty way to do it: * 1.0 For example: 4 * 1.0 => 4.0 /Tobbe From luther@REDACTED Fri Apr 16 16:40:27 1999 From: luther@REDACTED (Luther Huffman) Date: Fri, 16 Apr 1999 10:40:27 -0400 Subject: No subject Message-ID: <001701be8817$13056aa0$3c321cd8@steelhive> Hello, Has anyone implemented XML-RPC client/server yet for Erlang? For the curious, XML-RPC is a very simple, XML-based Remote Procedure Call protocol put forward by Dave Winer of Frontier fame, and which has been rapidly latched onto by many other companies. Most notably, Office 2000 will include a XML-RPC interface for its apps. More info at: http://www.xml-rpc.com Regards, Luther Huffman From gandalf@REDACTED Fri Apr 16 21:07:08 1999 From: gandalf@REDACTED (Vladimir Ulogov) Date: Fri, 16 Apr 1999 15:07:08 -0400 Subject: newbie questions about dict. Message-ID: <199904161907.PAA09136@rohan.control.att.com> Hello people. Digging in Erlang, I'd catch strange (for newbie) things: 7> dict:new(). [] 8> a=dict:new(). ** exited: {{badmatch,[]},{erl_eval,expr,3}} ** 9> Can you tell to me, what I'd miss. -- ======================================================= Vladimir I. Ulogov (gandalf@REDACTED) tel: 973-236-6464 or 6463 fax: 973-236-2090 "Where lands meets water. Where earth meets air. Where body meets mind. Where space meets time. We like to be on one side, and look at the other." D.Adams "Mostly harmless" From mike@REDACTED Fri Apr 16 21:29:09 1999 From: mike@REDACTED (Michael C Williams) Date: Fri, 16 Apr 1999 21:29:09 +0200 (MET DST) Subject: newbie questions about dict. In-Reply-To: <199904161907.PAA09136@rohan.control.att.com> Message-ID: Try: A = dict:new(). words starting with small letters are atoms. Variable start with capital letters. /Mike On Fri, 16 Apr 1999, Vladimir Ulogov wrote: > Hello people. > > Digging in Erlang, I'd catch strange (for newbie) things: > 7> dict:new(). > [] > 8> a=dict:new(). > ** exited: {{badmatch,[]},{erl_eval,expr,3}} ** > 9> > > Can you tell to me, what I'd miss. > > -- > ======================================================= > Vladimir I. Ulogov (gandalf@REDACTED) > tel: 973-236-6464 or 6463 > fax: 973-236-2090 > "Where lands meets water. Where earth meets air. Where body meets > mind. Where space meets time. We like to be on one side, and look > at the other." D.Adams "Mostly harmless" > > From gandalf@REDACTED Fri Apr 16 22:11:13 1999 From: gandalf@REDACTED (Vladimir Ulogov) Date: Fri, 16 Apr 1999 16:11:13 -0400 Subject: How fast is Mnesia ? Message-ID: <199904162011.QAA09454@rohan.control.att.com> Hello folks. Newbie question #2. Did somebody measure Mnesia efficiency ? What will happens if I will need to store 10.000.000 records like this: NNN.NNN.NNN.NNN NNNNNNNNNN N N N N, where N is some number. and about 2.000.000 like this XXXXXXXXXX X X X And I don't know how much like this: XXX.XXX.XXX.XXX AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA where A are some ASCII . Are the Mnesia supports "soft realtime" for the data retrival ? How the tables on disk organized ? May be you will suggest to use external database ? Thanks. Vladimir -- ======================================================= Vladimir I. Ulogov (gandalf@REDACTED) tel: 973-236-6464 or 6463 fax: 973-236-2090 "Where lands meets water. Where earth meets air. Where body meets mind. Where space meets time. We like to be on one side, and look at the other." D.Adams "Mostly harmless" From luke@REDACTED Sun Apr 18 15:44:03 1999 From: luke@REDACTED (Luke Gorrie) Date: 18 Apr 1999 23:44:03 +1000 Subject: Orber doubles problem unmasked Message-ID: Hi, I've had a further look into my problem with Orber not marshalling doubles. It turns out that Orber is aligning relative to the end of the GIOP header, while it should be relative to the beginning of the octet stream (corba 2.2 spec 13.3.1). Because the GIOP header is 12 bytes long, this doesn't affect alignments of 2 or 4 octets, which accounts for the obscurity. I've included diffs of my changes: * Fix for alignment in cdr_encode and cdr_decode modules * Relaxed guards in cdrlib to accept number()s rather than just float()s for float and double types (for reasons outlined in my previous mail). Sorry to not send a proper patch file, but I'm a bit pressed for time, just my RCS diffs included. P.S. Could someone please confirm that there is no subtle problem I'm missing with the guard change? Cheers, Luke *** cdrlib.erl 1999/04/16 09:53:29 1.1 --- cdrlib.erl 1999/04/18 13:17:34 *************** *** 265,271 **** %%----------------------------------------------------------------- %% Func: enc_float/2 %%----------------------------------------------------------------- ! enc_float(X, Message) when float(X) -> {S, E, F} = enc_ieee(X, ?FLOAT_BASE, ?FLOAT_BIAS), [ (S bsl 7) bor ((E bsr 1) band 16#7f), ((F bsr 16) band 16#7f) bor ((E band 1) bsl 7), --- 265,271 ---- %%----------------------------------------------------------------- %% Func: enc_float/2 %%----------------------------------------------------------------- ! enc_float(X, Message) when number(X) -> {S, E, F} = enc_ieee(X, ?FLOAT_BASE, ?FLOAT_BIAS), [ (S bsl 7) bor ((E bsr 1) band 16#7f), ((F bsr 16) band 16#7f) bor ((E band 1) bsl 7), *************** *** 275,281 **** %%----------------------------------------------------------------- %% Func: enc_r_float/2 %%----------------------------------------------------------------- ! enc_r_float(X, Message) when float(X) -> {S, E, F} = enc_ieee(X, ?FLOAT_BASE, ?FLOAT_BIAS), [ (F band 16#ff), (F bsr 8) band 16#ff, --- 275,281 ---- %%----------------------------------------------------------------- %% Func: enc_r_float/2 %%----------------------------------------------------------------- ! enc_r_float(X, Message) when number(X) -> {S, E, F} = enc_ieee(X, ?FLOAT_BASE, ?FLOAT_BIAS), [ (F band 16#ff), (F bsr 8) band 16#ff, *************** *** 319,325 **** %%----------------------------------------------------------------- %% Func: enc_double/2 %%----------------------------------------------------------------- ! enc_double(X, Message) when float(X) -> {S, E, F} = enc_ieee(X, ?DOUBLE_BASE, ?DOUBLE_BIAS), [ (S bsl 7) bor ((E bsr 4) band 16#7f), ((F bsr 48) band 16#0f) bor ((E band 16#f) bsl 4), --- 319,325 ---- %%----------------------------------------------------------------- %% Func: enc_double/2 %%----------------------------------------------------------------- ! enc_double(X, Message) when number(X) -> {S, E, F} = enc_ieee(X, ?DOUBLE_BASE, ?DOUBLE_BIAS), [ (S bsl 7) bor ((E bsr 4) band 16#7f), ((F bsr 48) band 16#0f) bor ((E band 16#f) bsl 4), *************** *** 333,339 **** %%----------------------------------------------------------------- %% Func: enc_r_double/2 %%----------------------------------------------------------------- ! enc_r_double(X, Message) when float(X) -> {S, E, F} = enc_ieee(X, ?DOUBLE_BASE, ?DOUBLE_BIAS), [(F band 16#ff), (F bsr 8) band 16#ff, --- 333,339 ---- %%----------------------------------------------------------------- %% Func: enc_r_double/2 %%----------------------------------------------------------------- ! enc_r_double(X, Message) when number(X) -> {S, E, F} = enc_ieee(X, ?DOUBLE_BASE, ?DOUBLE_BIAS), [(F band 16#ff), (F bsr 8) band 16#ff, *** cdr_encode.erl 1999/04/16 10:12:17 1.1 --- cdr_encode.erl 1999/04/18 13:16:47 1.3 *************** *** 584,590 **** %% Func: enc_align/1 %%----------------------------------------------------------------- enc_align(R, Len, Alignment) -> ! Rem = Len rem Alignment, if Rem == 0 -> {R, Len}; true -> --- 584,592 ---- %% Func: enc_align/1 %%----------------------------------------------------------------- enc_align(R, Len, Alignment) -> ! Rem = (Len + ?GIOP_HEADER_SIZE) rem Alignment, if Rem == 0 -> {R, Len}; true -> *** cdr_decode.erl 1999/04/18 13:07:17 1.1 --- cdr_decode.erl 1999/04/18 13:17:08 1.3 *************** *** 885,891 **** %% An aligned byte sequence. %%----------------------------------------------------------------- dec_align(R, Len, Alignment) -> ! Rem = Len rem Alignment, if Rem == 0 -> {R, Len}; true -> --- 885,893 ---- %% An aligned byte sequence. %%----------------------------------------------------------------- dec_align(R, Len, Alignment) -> ! Rem = (Len + ?GIOP_HEADER_SIZE) rem Alignment, if Rem == 0 -> {R, Len}; true -> *** orber_iiop.hrl 1999/04/18 13:38:52 1.1 --- orber_iiop.hrl 1999/04/18 13:38:58 *************** *** 56,61 **** --- 56,65 ---- %% PROFILE_ID's -define(TAG_INTERNET_IOP, 0). -define(TAG_MULTIPPLE_COMPONENTS, 1). + + %% GIOP header size + -define(GIOP_HEADER_SIZE, 12). + %%---------------------------------------------------------------------- %% GIOP Message Header %% From hakan@REDACTED Mon Apr 19 10:31:44 1999 From: hakan@REDACTED (Hakan Mattsson) Date: Mon, 19 Apr 1999 10:31:44 +0200 (MET DST) Subject: How fast is Mnesia ? In-Reply-To: <199904162011.QAA09454@rohan.control.att.com> Message-ID: On Fri, 16 Apr 1999, Vladimir Ulogov wrote: Vladimir> Newbie question #2. Did somebody measure Mnesia efficiency ? What will happens Vladimir> if I will need to store 10.000.000 records like this: Vladimir> NNN.NNN.NNN.NNN NNNNNNNNNN N N N N, where N is some number. Vladimir> and about 2.000.000 like this Vladimir> XXXXXXXXXX X X X Vladimir> Vladimir> And I don't know how much like this: Vladimir> XXX.XXX.XXX.XXX AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA Vladimir> where A are some ASCII . Vladimir> Vladimir> Are the Mnesia supports "soft realtime" for the data retrival ? How the tables Vladimir> on disk organized ? May be you will suggest to use external database ? Both disk and ram resident tables in Mnesia are hash tables, utilizing the linear hashing algorithm. The lookup time should be almost constant and not dependent of the number of records in the table. Matching operations in Mnesia normally requires a linear search of the entire table and for large tables it may lead to unacceptable response times, if there are no secondandary indecies associated with the table. If the performance of Mnesia is enough for your application is hard to say. The best thing is if you can come up with some benchmark that tries to simulate important database aspects of your application. Try to figure out things like data volumes, record sizes, storage types, access patterns, need for replication etc. etc. and try to implement a prototype which you can measure. Since your tables seems to be rather large it is probably worth to take a look at Mnesia's new support for fragmented tables. The concept of table fragmentation has been introduced in Mnesia 3.7 in order to cope with very large tables. The idea is to split a table into several more manageable fragments. Each fragment is implemented as a first class Mnesia table and may be replicated, have indecies etc. as any other table. The dets module which implements the disk resident tables in Mnesia is currently a bottleneck. But this will improve in some future release, when the Erlang machine supports segmented binaries and the new bitsyntax. Best Regards H?kan --------------------------------------+------------------------------------ H?kan Mattsson, | Phone: +46 8 719 9452 Computer Science Laboratory | E-mail: hakan@REDACTED Ericsson Network Core Products | http://www.ericsson.se/cslab/~hakan Box 1505, SE-126 25 Stockholm, Sweden | From crd@REDACTED Mon Apr 19 15:41:58 1999 From: crd@REDACTED (Craig Dickson) Date: Mon, 19 Apr 1999 06:41:58 -0700 Subject: BEAM on Win32? Message-ID: <028c01be8a6a$6d8ee3c0$6e02a8c0@int2.inversenet.com> I've just installed the pre-built 47.4.1 Win32 binaries and I find that it seems to be a JAM-only build. This is a little disappointing to me as I was hoping to try out the faster BEAM emulator. I guess I will have to build my own from sources. There are some comments on how to do this in the README, but they seem to be Unix-centric -- no comments on how to do the same with the Win32 makefiles. I'm hoping that if I simply compile BEAM.EXE with MS VC++ 5.0, drop it into my current 47.4.1 JAM installation, and compile all the libraries for BEAM (while running under JAM, presumably, since I don't expect the BEAM emulator to be very useful until libraries have been built for it), and alter the "Emulator" key in the registry to say "beam" instead of "jam", that everything will work. Is it that simple? Why is it that BEAM.EXE was not included in the Win32 build? Is it still considered experimental? If it is still not as stable as JAM then I may stick with JAM for the time being (though it would still be interesting to compare performance between the two). Thanks, Craig From ulf.wiger@REDACTED Mon Apr 19 15:58:03 1999 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Mon, 19 Apr 1999 15:58:03 +0200 Subject: BEAM on Win32? References: <028c01be8a6a$6d8ee3c0$6e02a8c0@int2.inversenet.com> Message-ID: <371B366B.4F0A4554@etxb.ericsson.se> Craig Dickson wrote: > > I've just installed the pre-built 47.4.1 Win32 binaries and I find that it > seems to be a JAM-only build. This is a little disappointing to me as I was > hoping to try out the faster BEAM emulator. I can't tell you how to make BEAM on Win32, or even if it can be done, but I can tell you a little about BEAM, since the AXD 301 project uses it. I wouldn't call BEAM experimental anymore. We've been using it for quite some time now (what is it? since '96?), and it's very stable. However, we use Solaris. I think it's more of a porting issue, and in the olden days, BEAM was very difficult to port (partly because it generated native code.) As far as speed is concerned. BEAM does seem mostly faster than JAM - for most applications, I would think that it's decidedly faster. But the performance differences vary depending on the characteristics of the application (sometimes, JAM may even be faster than BEAM!) JAM and BEAM are essentially two different execution models (stack machine vs register machine) on top of the same runtime system. Scheduling, GC, message passing, ets, etc. are all the same. I know that BEAM is about twice as fast on higher-order functions and list comprehensions, so if you use them extensively, you should get quite a performance boost. Another nice thing about BEAM is that it can address 1 GB of memory, compared to 256 MB for JAM. /Uffe -- Ulf Wiger, Chief Designer AXD 301 Ericsson Telecom AB tfn: +46 8 719 81 95 Varuv?gen 9, ?lvsj? mob: +46 70 519 81 95 S-126 25 Stockholm, Sweden fax: +46 8 719 43 44 From patrickdlogan@REDACTED Tue Apr 20 01:38:58 1999 From: patrickdlogan@REDACTED (patrickdlogan@REDACTED) Date: Mon, 19 Apr 1999 16:38:58 -0700 (PDT) Subject: Erlang on BeOS? Message-ID: <199904192338.QAA00784@c837917-a.potlnd1.or.home.com> Has anyone considered the issues in a prt of Erlang to the BeOS? It is a POSIX OS, which may help the port. But moreover it is supposedly designed to be highly multi-threaded. Perhaps its design would be a good target for the prototype described in Pekka Hedqvist's Master's Thesis? -- Patrick D. Logan mailto:patrickdlogan@REDACTED From Pekka.Hedqvist@REDACTED Tue Apr 20 02:11:53 1999 From: Pekka.Hedqvist@REDACTED (Pekka.Hedqvist@REDACTED) Date: Tue, 20 Apr 1999 10:11:53 +1000 (EST) Subject: Erlang on BeOS? In-Reply-To: <199904192338.QAA00784@c837917-a.potlnd1.or.home.com> References: <199904192338.QAA00784@c837917-a.potlnd1.or.home.com> Message-ID: <14107.50761.534930.859016@universe.serc.rmit.edu.au> BeOS is nice but that Erlang prototype is not in any state to be ported. It was a prototype and needs a lot of work on it and most probably a redesign too. A port would definitely start with the current open source Erlang. It would not run Erlang processes on BeOS threads but thats a minor thing since no other available Erlang implementation does that today anyway. An Erlang on system-threads port would probably start with the current runtime since it has evolved since then, one would pick good ideas from my report and maybe some code snippets from the old prototype (if it were available) and start over again. patrickdlogan@REDACTED writes: > Has anyone considered the issues in a prt of Erlang to the BeOS? It is > a POSIX OS, which may help the port. But moreover it is supposedly > designed to be highly multi-threaded. Perhaps its design would be a > good target for the prototype described in Pekka Hedqvist's Master's > Thesis? > > -- > Patrick D. Logan mailto:patrickdlogan@REDACTED > From mattias@REDACTED Tue Apr 20 13:39:55 1999 From: mattias@REDACTED (Mattias Nilsson) Date: Tue, 20 Apr 1999 13:39:55 +0200 Subject: BEAM on Win32? Message-ID: <371C678B.A81D4CE2@erix.ericsson.se> Craig Dickson wrote: > > I've just installed the pre-built 47.4.1 Win32 binaries and I find that it > seems to be a JAM-only build. This is a little disappointing to me as I was > hoping to try out the faster BEAM emulator. I guess I will have to build my > own from sources. There are some comments on how to do this in the README, > but they seem to be Unix-centric -- no comments on how to do the same with > the Win32 makefiles. I'm hoping that if I simply compile BEAM.EXE with MS > VC++ 5.0, drop it into my current 47.4.1 JAM installation, and compile all > the libraries for BEAM (while running under JAM, presumably, since I don't > expect the BEAM emulator to be very useful until libraries have been built > for it), and alter the "Emulator" key in the registry to say "beam" instead > of "jam", that everything will work. Is it that simple? > > Why is it that BEAM.EXE was not included in the Win32 build? Is it still > considered experimental? If it is still not as stable as JAM then I may > stick with JAM for the time being (though it would still be interesting to > compare performance between the two). BEAM on Win32 is almost a reality today, but has not been thouroughly tested yet. We are in the process of distributing a win32 BEAM very soon. If you want to compile BEAM on Win32, you will most definetly need to compile it with a mixture of VC and GCC, due to a few 'missing' features in VC that GCC has (jump-tables etc). I cannot give you more info right now, as I don't have all the details myself. Anyway, it's most definetly possible to compile BEAM on Windows if you're prepared to dig a bit.. -- Best Regards, Mattias Nilsson Open Telecom Platform, Open Systems, Ericsson From knotwell@REDACTED Wed Apr 21 01:16:51 1999 From: knotwell@REDACTED (knotwell@REDACTED) Date: Tue, 20 Apr 1999 16:16:51 -0700 (PDT) Subject: erl; Linux; and tty reset Message-ID: <14109.2787.415640.35461@knotwell.f5.com> Hello all-- I wrote a small program (many thanks to the author of the urlget module). I run it from the command line with the following command: erl -s htmlhammer start # # URL -s erlang halt This seems to work okay except for one minor annoyance--every time erl "halts", the pseudo-terminal get "hosed up" and I need to do a reset or stty sane to fix it. It's not critical, but I was wondering if there was anyway around this problem. The only other thing I've ever seen do this (_very_ periodically) is a botched xemacs startup when using the -nw option. Another minor question: is there a module performing the common (I presume) idiom of: list_to_integer(atom_to_list('numeric_atom_here')) %%IOW, is there an --Brad From dne@REDACTED Wed Apr 21 02:36:47 1999 From: dne@REDACTED (Daniel Neri) Date: Wed, 21 Apr 1999 02:36:47 +0200 Subject: erl; Linux; and tty reset In-Reply-To: knotwell@f5.com's message of "Tue, 20 Apr 1999 16:16:51 -0700 (PDT)" References: <14109.2787.415640.35461@knotwell.f5.com> Message-ID: <87vheqizc0.fsf@nowhere.mayonnaise.net> knotwell@REDACTED writes: > This seems to work okay except for one minor annoyance--every time erl > "halts", the pseudo-terminal get "hosed up" and I need to do a reset or > stty sane to fix it. Yes, I'm experiencing this problem too. If you terminate the shell by doing "Ctrl-G q" or by executing "halt().", the tty stays "insane" and has to be manually restored. Quitting by "Ctrl-C a", restores the tty correctly. Regards, /Daniel -- Daniel Neri dne@REDACTED From e.blood@REDACTED Wed Apr 21 06:11:55 1999 From: e.blood@REDACTED (Eric Blood) Date: 21 Apr 1999 14:11:55 +1000 Subject: etk example Message-ID: <3lvheqwr1w.fsf@guava.citr.com.au> I followed the instructions for etk to compile the wtour example, but when I do a start, nothing shows up. Here are the steps I followed: $ erl Erlang (JAM) emulator version 47.4.1 Eshell V47.4.1 (abort with ^G) 1> make:all() 1> . Recompile: wtour_netscape Recompile: wtour Recompile: gdemo Recompile: etk_menu_test Recompile: etk_menu Recompile: etk_demo_label Recompile: etk_demo Recompile: erltk_demo up_to_date 2> wtour:start() 2> . <0.56.0> 3> wtour:start(). <0.58.0> 4> Any ideas? Eric From tobbe@REDACTED Wed Apr 21 06:31:28 1999 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Wed, 21 Apr 1999 14:31:28 +1000 Subject: etk example Message-ID: <199904210431.OAA22130@universe.serc.rmit.edu.au> Strange ! I did: cp ..../erlang-47.4.1/lib/etk/examples/wtour/* . erl -make all erl -s wtour and it worked. This on a Solaris system. What system are you using ? /Tobbe From e.blood@REDACTED Wed Apr 21 07:17:03 1999 From: e.blood@REDACTED (Eric Blood) Date: 21 Apr 1999 15:17:03 +1000 Subject: etk example In-Reply-To: Torbjorn Tornkvist's message of "Wed, 21 Apr 1999 14:31:28 +1000" References: <199904210431.OAA22130@universe.serc.rmit.edu.au> Message-ID: <3lu2uawo1c.fsf@guava.citr.com.au> >>>>> "TT" == Torbjorn Tornkvist writes: TT> What system are you using ? I'm on Solaris too; here's "uname -a": SunOS guava 5.5.1 Generic_103640-21 sun4u sparc SUNW,Ultra-2 -- Eric Blood e.blood@REDACTED From e.blood@REDACTED Wed Apr 21 08:00:09 1999 From: e.blood@REDACTED (Eric Blood) Date: Wed, 21 Apr 1999 16:00:09 +1000 (EST) Subject: etk update Message-ID: <14109.26737.628886.809533@guava.citr.com.au> Ok, I've flamed up the debugger, set a break point, and did one step down into the wtour stuff, and the return of etk:start() is <0.55.0>. In the "monitor" window of the debugger window, it shows: {undef, {etk, start, []}} So, it looks like a build problem. However, why does <0.55.0> show up on the terminal instead of the atoms shown in the monitor window? Meanwhile I'll look to see why etk didn't get in there. Eric From tobbe@REDACTED Wed Apr 21 08:21:57 1999 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Wed, 21 Apr 1999 16:21:57 +1000 Subject: etk update Message-ID: <199904210621.QAA25670@universe.serc.rmit.edu.au> > {undef, {etk, start, []}} > > So, it looks like a build problem. However, why does <0.55.0> show up > on the terminal instead of the atoms shown in the monitor window? Yes, looks like your build didn't work out properly. The pid is shown because the spawn/3 BIF creates a process returning a Pid to it. The returned Pid only indicates that a process was created, the process may very well crash right away, as in your case. You can check all living processes with the i() command from the shell prompt. Try this from the shell prompt: spawn(silly,example,[]) and: spawn_link(silly,example,[]) in both case you'll get a pid returned. In the second case however, the shell will also die (and be restarted again). This is caused by the link and the exit signal being sent. /Tobbe From ulf.wiger@REDACTED Wed Apr 21 09:29:47 1999 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Wed, 21 Apr 1999 09:29:47 +0200 Subject: erl; Linux; and tty reset References: <14109.2787.415640.35461@knotwell.f5.com> Message-ID: <371D7E6B.F793F8EF@etxb.ericsson.se> knotwell@REDACTED wrote: > > Hello all-- > > I wrote a small program (many thanks to the author of the urlget > module). I run it from the command line with the following command: > > erl -s htmlhammer start # # URL -s erlang halt > > This seems to work okay except for one minor annoyance--every time erl > "halts", the pseudo-terminal get "hosed up" and I need to do a reset or > stty sane to fix it. You could try init:stop() instead of erlang:halt(). It's less brutal. Another problem you might run into is that the halt() command comes too soon. Your function might be written such that it doesn't release the thread before it's done. Then you avoid the problem. One thing you could try is to write a synchronous function, one which doesn't return until the operation is finished. Then you pipe it into an erlang shell: $ > echo 'io:format("hello.~n",[]).' | erl -boot start_clean Eshell V4.7.1 (abort with ^G) 1> hello. ok ** Terminating erlang ** $ > When the shell reaches ^D, it terminates the shell automatically. Another option is erl_call (I don't know if it works on all platforms.) $ > setenv FOO `erl_call -s -name foo -a 'erlang localtime []'` $ > echo $FOO 1999 4 21 9 28 11 $ > erl_call -q -name foo > It's not critical, but I was wondering if there was anyway around this > problem. The only other thing I've ever seen do this (_very_ > periodically) is a botched xemacs startup when using the -nw option. > > Another minor question: is there a module performing the common (I > presume) idiom of: > > list_to_integer(atom_to_list('numeric_atom_here')) > %%IOW, is there an No, no such module. /Uffe -- Ulf Wiger, Chief Designer AXD 301 Ericsson Telecom AB tfn: +46 8 719 81 95 Varuv?gen 9, ?lvsj? mob: +46 70 519 81 95 S-126 25 Stockholm, Sweden fax: +46 8 719 43 44 From ulf.wiger@REDACTED Wed Apr 21 09:53:17 1999 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Wed, 21 Apr 1999 09:53:17 +0200 Subject: etk update References: <14109.26737.628886.809533@guava.citr.com.au> Message-ID: <371D83ED.639E76A2@etxb.ericsson.se> Eric Blood wrote: > > Ok, I've flamed up the debugger, set a break point, and did one step > down into the wtour stuff, and the return of etk:start() is <0.55.0>. > In the "monitor" window of the debugger window, it shows: > > {undef, {etk, start, []}} > > So, it looks like a build problem. However, why does <0.55.0> show up > on the terminal instead of the atoms shown in the monitor window? > > Meanwhile I'll look to see why etk didn't get in there. > > Eric The reason why the error indication is so poor is that spawn/3 was used instead of e.g. spawn_link/3 or - better yet - proc_lib:spawn_link/3. spawn/3 doesn't care what happens to the process it created. It will always just return the pid and move on. With spawn_link/3: ------------------ etxuwig@REDACTED > erl -boot start_clean Erlang (BEAM) emulator version 4.8.2 Eshell V4.8.2 (abort with ^G) 1> wtour:start(). <0.30.0> ** exited: {undef,{etk,start,[]}} ** With proc_lib:spawn_link/3 and the SASL application started: ------------------------------------------------------------ etxuwig@REDACTED > erl -boot start_sasl Erlang (BEAM) emulator version 4.8.2 Eshell V4.8.2 (abort with ^G) 1> ... =PROGRESS REPORT==== 21-Apr-1999::09:50:55 === application: sasl started_at: nonode@REDACTED 1> wtour:start(). <0.39.0> ** exited: {undef,{etk,start,[]}} ** 2> =CRASH REPORT==== 21-Apr-1999::09:50:59 === crasher: pid: <0.39.0> registered_name: [] error_info: {undef,{etk,start,[]}} initial_call: {wtour,start1,[]} ancestors: [<0.25.0>] messages: [] links: [<0.25.0>] dictionary: [] trap_exit: false status: running heap_size: 233 stack_size: 0 reductions: 76 neighbours: neighbour: [{pid,<0.25.0>}, {registered_name,[]}, {initial_call,{shell,evaluator,3}}, {current_function,{shell,eval_loop,2}}, {ancestors,[]}, {messages,[]}, {links,[<0.22.0>,<0.39.0>]}, {dictionary,[]}, {trap_exit,false}, {status,waiting}, {heap_size,233}, {stack_size,0}, {reductions,40}] -- Ulf Wiger, Chief Designer AXD 301 Ericsson Telecom AB tfn: +46 8 719 81 95 Varuv?gen 9, ?lvsj? mob: +46 70 519 81 95 S-126 25 Stockholm, Sweden fax: +46 8 719 43 44 From seb@REDACTED Wed Apr 21 15:56:56 1999 From: seb@REDACTED (Sebastian Strollo) Date: 21 Apr 1999 15:56:56 +0200 Subject: erl; Linux; and tty reset In-Reply-To: knotwell@f5.com's message of "Tue, 20 Apr 1999 16:16:51 -0700 (PDT)" References: <14109.2787.415640.35461@knotwell.f5.com> Message-ID: knotwell@REDACTED writes: ... > This seems to work okay except for one minor annoyance--every time erl > "halts", the pseudo-terminal get "hosed up" and I need to do a reset or > stty sane to fix it. ... Yes This my fault and I should be shot for messing it up. In my work to make the system portable I cleaned up all calls to atexit() in the emulator (well there was only one, and it was the one which cleans up the terminal settings). I thought that I had replaced it with a call to another "atexit type" function, but it turns out that it is never called before exit. I will fix it, add it to the FAQ and it will be in the next release... -- Sebastian PS. If you use tcsh, which I do, you don't notice this since tcsh is forgiving (smart?) enough to reset your terminal to a nice state... (Which is my excuse for letting this whole thing slip through our testing.) From mikl@REDACTED Sun Apr 25 14:46:24 1999 From: mikl@REDACTED (Mickael Remond) Date: Sun, 25 Apr 1999 14:46:24 +0200 Subject: Mnesia question Message-ID: <37230EA0.49A15F59@club-internet.fr> Hi, I have got a question about an error in my mnesia queries. When I try to make a joint query on two tables I get this error message : =ERROR REPORT==== 25-Apr-1999::14:38:23 === !!! Error in process <0.188.0> on node 'master@REDACTED' with exit value: nocatch ** exited: nocatch ** The code I am using for this query is : task(User) -> Q = query [ T || T <- table(tasks), U <- table(users), U.id = User, T.user_id = U.id ] end, F = fun() -> mnemosyne:eval(Q) end, mnesia:transaction(F). The data is the database seems correct. When I make a simple query, the function is working, but I did not manage to make this two tables query to work. Do you have any clue on what I am doing wrong ? Thank you in advance. Mickael Remond From tobbe@REDACTED Mon Apr 26 00:27:36 1999 From: tobbe@REDACTED (Torbjorn Tornkvist) Date: Mon, 26 Apr 1999 08:27:36 +1000 Subject: Mnesia question In-Reply-To: <37230EA0.49A15F59@club-internet.fr> References: <37230EA0.49A15F59@club-internet.fr> Message-ID: <199904252227.IAA22029@universe.serc.rmit.edu.au> Shouldn't you use the Boolean test operator for equality ? That is: task(User) -> Q = query [ T || T <- table(tasks), U <- table(users), U.id == User, T.user_id == U.id ] end, F = fun() -> mnemosyne:eval(Q) end, mnesia:transaction(F). /Tobbe From icimjs@REDACTED Mon Apr 26 01:27:55 1999 From: icimjs@REDACTED (Elan) Date: Sun, 25 Apr 1999 16:27:55 -0700 Subject: Erlang For FreeBSD 3.x Message-ID: <3.0.5.32.19990425162755.012ad650@pop.loop.com> Hi, I have been monitoring the erlang.org Website for a while, hoping to find the release of the latest Erlang libraries for FreeBSD 3.x. However, as of right now, these libraries are outstanding. Any idea when the libraries will be released? TIA, Elan ==================================== Get your copy of FaxForward http://www.commercebox.com/FaxForward/ From mikl@REDACTED Mon Apr 26 08:12:37 1999 From: mikl@REDACTED (Mickael Remond) Date: Mon, 26 Apr 1999 08:12:37 +0200 Subject: Mnesia question References: <37230EA0.49A15F59@club-internet.fr> <199904252227.IAA22029@universe.serc.rmit.edu.au> Message-ID: <372403D5.1A07D4C5@club-internet.fr> Torbjorn Tornkvist a ?crit : > > Shouldn't you use the Boolean test operator for equality ? > That is: > > task(User) -> > Q = query > [ T || > T <- table(tasks), > U <- table(users), > U.id == User, > T.user_id == U.id ] > end, > F = fun() -> mnemosyne:eval(Q) end, > mnesia:transaction(F). > > /Tobbe No, the syntaxe of mnemosyne seems to be different. When I use the '==' operator I get a compile error : ./task_mgr.erl:48: illegal operation (==) in database list comprehension In fact, I get the same no catch error with the 'company.erl' example : Erlang (JAM) emulator version 47.4.1 Eshell V47.4.1 (abort with ^G) (master@REDACTED)1> mnesia:start(). ok (master@REDACTED)2> cd('../src/examples'). C:/PROJET-0.1/src/examples ok (master@REDACTED)3> company:init(). {atomic,ok} (master@REDACTED)4> mnesia:load_textfile('Data'). ** Table employee already exists, just entering data ** Table dept already exists, just entering data ** Table project already exists, just entering data ** Table manager already exists, just entering data ** Table at_dep already exists, just entering data ** Table in_proj already exists, just entering data {atomic,ok} (master@REDACTED)5> company:females(). {atomic,["Hansson Catrin","Carlsson Tuula","Fedoriw Anna"]} (master@REDACTED)6> company:females2(). {atomic,["Hansson Catrin","Carlsson Tuula","Fedoriw Anna"]} (master@REDACTED)7> company:female_bosses(). ** exited: nocatch ** =ERROR REPORT==== 26-Apr-1999::08:09:25 === !!! Error in process <0.32.0> on node 'master@REDACTED' with exit value: nocatch I suspect a misconfiguration, but I did not see what I a missing. Thanks in advance for your help. Mickael Remond From mikl@REDACTED Mon Apr 26 08:21:53 1999 From: mikl@REDACTED (Mickael Remond) Date: Mon, 26 Apr 1999 08:21:53 +0200 Subject: RDBMS questions... Message-ID: <37240601.D603D189@club-internet.fr> Hi, I am trying to figure out how to make work the RDBMS contrib. I remplaced the mnesia_schema file with the one in the mnesia 3.6 distribution. I made the change marked as 'UW modif' in the RDBMS-mnesia_schema. Everything seems to be ok, then. This change makes me able to create schema, to create table, etc. But I did not really understand how to use this module. What about the sysMnesiaDict database ? Do I have to create it manually ? The add_properties functions return 'ok', but the operation did not seem to occur. Where are the properties stored ? Do you have a comprehensive example on how to use it ? Thanks in advance for your help. Mickael Remond From hakan@REDACTED Mon Apr 26 09:00:05 1999 From: hakan@REDACTED (Hakan Mattsson) Date: Mon, 26 Apr 1999 09:00:05 +0200 (MET DST) Subject: Mnesia question In-Reply-To: <372403D5.1A07D4C5@club-internet.fr> Message-ID: mikl>I suspect a misconfiguration, but I did not see what I a missing. I think that you forgot to start the mnemosyne application. The attached example worked for me, when Mnemosyne was started. ~> erl Erlang (BEAM) emulator version 4.8.1 Eshell V4.8.1 (abort with ^G) 1> c(memo(). ** 1: syntax error before: '.' ** 1> c(memo). ./memo.erl:27: Warning: non-recommended option 'export_all' used {ok,memo} 2> memo:init(). ok 3> memo:task(hakan). {atomic,[{tasks,drink_coffee,hakan}]} 4> application:stop(mnemosyne). =INFO REPORT==== 26-Apr-1999::08:54:17 === application: mnemosyne exited: stopped type: temporary ok 5> memo:task(hakan). =ERROR REPORT==== 26-Apr-1999::08:54:19 === <0.25.0> error: nocatch in mnemosyne_lc:the_query/1 ** exited: nocatch ** Regards H?kan -------------------------------------+------------------------------------ H?kan Mattsson, | +46 8 719 9452 Computer Science Laboratory | hakan@REDACTED Ericsson Network Core Products | http://www.ericsson.se/cslab/~hakan Box 1505, SE-126 25 Stockholm Sweden | -------------- next part -------------- -module(memo). -author('hakan@REDACTED'). -compile([export_all, {parse_transform, mnemosyne}]). -record(tasks, {id, user_id}). -record(users, {id, phone}). init() -> ok = application:start(mnesia), ok = application:start(mnemosyne), {atomic, ok} = mnesia:create_table(tasks, [{attributes, [id, user_id]}]), {atomic, ok} = mnesia:create_table(users, [{attributes, [id, phone]}]), ok = mnesia:dirty_write(users, #users{id = hakan, phone = 99251}), ok = mnesia:dirty_write(tasks, #tasks{id = drink_coffee, user_id = hakan}). task(User) -> Q = query [ T || T <- table(tasks), U <- table(users), U.id = User, T.user_id = U.id ] end, F = fun() -> mnemosyne:eval(Q) end, mnesia:transaction(F). From mattias@REDACTED Mon Apr 26 09:42:03 1999 From: mattias@REDACTED (Mattias Nilsson) Date: Mon, 26 Apr 1999 09:42:03 +0200 Subject: Are you aware ? References: <3724184B.3EA929A6@erix.ericsson.se> Message-ID: <372418CB.9968A9E8@erix.ericsson.se> Mattias Nilsson wrote: > > I just want to make sure everyone is aware of the Open Directory Project > category on Erlang at > http://dmoz.org/Computers/Programming/Languages/Erlang/ > > If you have any other sites related to Erlang, please submit them there. Oh, and by the way: The category needs an editor. I'm already an editor of ODP categories, so if someone feels like editing the Erlang category and have questions about being/becoming an editor, ask me. -- Best Regards, Mattias Nilsson Open Telecom Platform, Open Systems, Ericsson From mattias@REDACTED Mon Apr 26 09:39:55 1999 From: mattias@REDACTED (Mattias Nilsson) Date: Mon, 26 Apr 1999 09:39:55 +0200 Subject: Are you aware ? Message-ID: <3724184B.3EA929A6@erix.ericsson.se> I just want to make sure everyone is aware of the Open Directory Project category on Erlang at http://dmoz.org/Computers/Programming/Languages/Erlang/ If you have any other sites related to Erlang, please submit them there. -- Best Regards, Mattias Nilsson Open Telecom Platform, Open Systems, Ericsson From jocke@REDACTED Mon Apr 26 11:46:57 1999 From: jocke@REDACTED (Joakim Grebenö) Date: Mon, 26 Apr 1999 11:46:57 +0200 Subject: Mnesia broken? Message-ID: <37243611.96EAC47E@bluetail.com> Hi all, I can't add a new Mnesia node to an already runnning set of Mnesia nodes, i.e. inherit the db schema on the new node. It used to work (doesn't it always ;-), or is it just me having a bad day? Is this feature broken in Mnesia in 47.4.1? /Jocke The bug(?) in a simple example: -- Start x@REDACTED [jocke@REDACTED]$ erl -sname x Erlang (JAM) emulator version 47.4.1 Eshell V47.4.1 (abort with ^G) (x@REDACTED)1> mnesia:create_schema([node()]). ok (x@REDACTED)2> mnesia:start(). ok -- Start y@REDACTED [jocke@REDACTED]$ erl -sname y -mnesia extra_db_nodes \[x@REDACTED\] Erlang (JAM) emulator version 47.4.1 Eshell V47.4.1 (abort with ^G) (y@REDACTED)1> mnesia:start(). ok -- Add y@REDACTED to x@REDACTED's mnesia context, i.e. inherit schema. (x@REDACTED)4> mnesia:change_table_copy_type(schema,y@REDACTED,disc_copies). Ohps! x@REDACTED hangs forever... -- Ohps! Oh no y@REDACTED crashes... (y@REDACTED)2> =ERROR REPORT==== 26-Apr-1999::10:59:44 === Mnesia(y@REDACTED): ** ERROR ** (ignoring core) ** FATAL ** mnesia_monitor crashed: {badarg, {ets, lookup, [disk_log_names, latest_log]}} state: {state, <0.59.0>, [], []} =ERROR REPORT==== 26-Apr-1999::10:59:54 === Mnesia(y@REDACTED): ** ERROR ** mnesia_event got unexpected event: {'EXIT', <0.61.0>, killed} =INFO REPORT==== 26-Apr-1999::10:59:54 === application: mnesia exited: killed type: temporary From ulf.wiger@REDACTED Mon Apr 26 12:31:21 1999 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Mon, 26 Apr 1999 12:31:21 +0200 Subject: RDBMS questions... References: <37240601.D603D189@club-internet.fr> Message-ID: <37244079.81CD8BBE@etxb.ericsson.se> Mickael Remond wrote: > > Hi, > > I am trying to figure out how to make work the RDBMS contrib. > > I remplaced the mnesia_schema file with the one in the mnesia 3.6 > distribution. I made the change marked as 'UW modif' in the > RDBMS-mnesia_schema. > > Everything seems to be ok, then. This change makes me able to create > schema, to create table, etc. > > But I did not really understand how to use this module. What about the > sysMnesiaDict database ? Do I have to create it manually ? > The add_properties functions return 'ok', but the operation did not seem > to occur. Where are the properties stored ? > Oops! I guess you're referring to the following comment in rdbms.erl? %% %% Functions for accessing metadata. %% -- metadata values are stored in the table 'sysMnesiaDict' %% which has the structure -record(sysMnesiaDict, {key, value}). %% where key ::= {Obj_type, Obj, Type}, e.g. {attr, {Table, Attr}, Type}, %% {attr, Attr, Type}, {table, Table, Type}, or {record, Rec, Type}. %% Never mind that. It's an old relic. In the olden days, it wasn't possible to store user-defined properties in the mnesia schema, so I had my own table. Nowadays, the properties go into the mnesia schema as 'user_properties'. You can inspect them by calling mnesia:table_info(Tab, user_properties). > Do you have a comprehensive example on how to use it ? Let me get back to you on that. I don't have one quite ready, but perhaps later this week... /Uffe -- Ulf Wiger, Chief Designer AXD 301 Ericsson Telecom AB tfn: +46 8 719 81 95 Varuv?gen 9, ?lvsj? mob: +46 70 519 81 95 S-126 25 Stockholm, Sweden fax: +46 8 719 43 44 From mikl@REDACTED Mon Apr 26 22:09:05 1999 From: mikl@REDACTED (Mickael Remond) Date: Mon, 26 Apr 1999 22:09:05 +0200 Subject: Just another Mnesia question. Message-ID: <3724C7E1.2CF3B11@club-internet.fr> Sorry to bother you again, but I think I need some explaination about a particular concept in Mnesia. In the Mnesia doc, you can read : "What makes the Mnesia data model an extended relational model is the ability to store arbitrary Erlang terms in the attribute fields. One attribute value could for example be a whole tree of oids leading to other terms in other tables. This type of record is hard to model in traditional relational DBMSs." This sentence is particularly abstract to me. Could someone explain this concept or give me some concret examples. thanks in advance. Mickael Remond From mikl@REDACTED Mon Apr 26 22:09:05 1999 From: mikl@REDACTED (Mickael Remond) Date: Mon, 26 Apr 1999 22:09:05 +0200 Subject: Just another Mnesia question. Message-ID: <3724C7E1.2CF3B11@club-internet.fr> Sorry to bother you again, but I think I need some explaination about a particular concept in Mnesia. In the Mnesia doc, you can read : "What makes the Mnesia data model an extended relational model is the ability to store arbitrary Erlang terms in the attribute fields. One attribute value could for example be a whole tree of oids leading to other terms in other tables. This type of record is hard to model in traditional relational DBMSs." This sentence is particularly abstract to me. Could someone explain this concept or give me some concret examples. thanks in advance. Mickael Remond From crd@REDACTED Mon Apr 26 22:37:06 1999 From: crd@REDACTED (Craig Dickson) Date: Mon, 26 Apr 1999 13:37:06 -0700 Subject: Just another Mnesia question. References: <3724C7E1.2CF3B11@club-internet.fr> Message-ID: <026101be9024$8f923a20$6e02a8c0@int2.inversenet.com> Mickael Remond wrote: > Sorry to bother you again, but I think I need some explaination about a > particular concept in Mnesia. > > In the Mnesia doc, you can read : > "What makes the Mnesia data model an extended relational model is the > ability to store arbitrary Erlang terms in the attribute fields. One > attribute value could for example be a whole tree of oids leading to > other terms in other tables. This type of record is hard to model in > traditional relational DBMSs." > > This sentence is particularly abstract to me. Could someone explain this > concept or give me some concret examples. Another question for the experts: does the idea of storing "arbitrary Erlang terms" in the database imply that not only data (numbers, text, lists) but also executable code (i.e. funs) can be stored in the database? Craig From ulf.wiger@REDACTED Mon Apr 26 22:39:09 1999 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Mon, 26 Apr 1999 22:39:09 +0200 Subject: Just another Mnesia question. References: <3724C7E1.2CF3B11@club-internet.fr> Message-ID: <3724CEED.4872DFF9@etxb.ericsson.se> This is also known as "non-first normal form". The normal forms are a set of design standards for relational databases. They are formulated in a way as to ensure the integrity of the database. Taken from the "SQL Practical Handbook, Second Edition": "At each row-and-column intersection, there must be one and only one value" This is one of the things that make RDBMSes a bit clumsy for applications like CAD, where you want to be able to store the vertices of a polygon in one data object, and not as a relation between two tables. Another example could be storing phone numbers as a list in one person object, instead of having a phone_numbers table with objects like {{person_name, number_type}, number}. #person{name = "Uffe", tfn = [{wk, "+4687198195"},{mob, "+4685198195"}]} /Uffe Mickael Remond wrote: > > Sorry to bother you again, but I think I need some explaination about a > particular concept in Mnesia. > > In the Mnesia doc, you can read : > "What makes the Mnesia data model an extended relational model is the > ability to store arbitrary Erlang terms in the attribute fields. One > attribute value could for example be a whole tree of oids leading to > other terms in other tables. This type of record is hard to model in > traditional relational DBMSs." > > This sentence is particularly abstract to me. Could someone explain this > concept or give me some concret examples. > > thanks in advance. > > Mickael Remond -- Ulf Wiger, Chief Designer AXD 301 Ericsson Telecom AB tfn: +46 8 719 81 95 Varuv?gen 9, ?lvsj? mob: +46 70 519 81 95 S-126 25 Stockholm, Sweden fax: +46 8 719 43 44 From ulf.wiger@REDACTED Mon Apr 26 23:03:50 1999 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Mon, 26 Apr 1999 23:03:50 +0200 Subject: Just another Mnesia question. References: <3724C7E1.2CF3B11@club-internet.fr> <026101be9024$8f923a20$6e02a8c0@int2.inversenet.com> Message-ID: <3724D4B6.72ACA698@etxb.ericsson.se> Craig Dickson wrote: > > > Another question for the experts: does the idea of storing "arbitrary Erlang > terms" in the database imply that not only data (numbers, text, lists) but > also executable code (i.e. funs) can be stored in the database? Actually, with the new BEAM, you should be able to do this reasonably safely. JAM is not very good at handling funs when a module is recompiled. Usually, recompiling a module meant that funs could no longer be called. With BEAM, this is no longer true. You still have to do this with care, though. As far as I know, the only thing stored in the database is a reference to a certain function object in a given module (note: *not* the actual code). While I haven't been able to break the BEAM implementation of funs, I would like to hear someone explain exactly what its limitations are. With the old JAM 4.7, the answer is: don't do it. %%%%%%%%%%%%%%%% example program -module(test). -export([store/1, run/1]). store(a) -> mnesia:dirty_write({test, a, fun() -> fun_a end}); store(b) -> mnesia:dirty_write({test, b, fun() -> fun_b end}). run(a) -> [{_, a, F}] = mnesia:dirty_read({test,a}), F(); run(b) -> [{_, b, F}] = mnesia:dirty_read({test,b}), F(). %%%%%%%%%%%%%%%% end example program (bbs@REDACTED)5> test:store(a). ok (bbs@REDACTED)6> test:store(b). ok (Recompile test, restart mnesia) (bbs@REDACTED)3> test:run(a). fun_a (bbs@REDACTED)4> test:run(b). fun_b It seemed to work even though I moved the fun definitions around. Further inspection: (bbs@REDACTED)2> Res = mnesia:dirty_read({test,a}). [{test,a,#Fun}] (bbs@REDACTED)3> erlang:display(Res). [{test,a,{fun,test,0,12375923,{}}}] When I look at the output of c(test, ['E']): ----------------------------------------- store(b) -> mnesia:dirty_write({test,b,make_fun('fun%0'/0, 0, 125669168, [])}); store(a) -> mnesia:dirty_write({test,a,make_fun('fun%1'/0, 1, 67946889, [])}). run(a) -> [{_,a,F}] = mnesia:dirty_read({test,a}), F(); run(b) -> [{_,b,F}] = mnesia:dirty_read({test,b}), F(). 'fun%0'() -> fun_b. 'fun%1'() -> fun_a. ----------------------------------------- I don't know how the numbers 125669168 and 67946889 are derived. Checksums? /Uffe -- Ulf Wiger, Chief Designer AXD 301 Ericsson Telecom AB tfn: +46 8 719 81 95 Varuv?gen 9, ?lvsj? mob: +46 70 519 81 95 S-126 25 Stockholm, Sweden fax: +46 8 719 43 44 From ulf.wiger@REDACTED Tue Apr 27 12:57:50 1999 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Tue, 27 Apr 1999 12:57:50 +0200 Subject: fun with funs Message-ID: <3725982E.3B9057BB@etxb.ericsson.se> I have a question/discovery that I would like to present: Every once in a while, the dreaded error message: {{lambda_clause,mcncServer},{lists,120702597,3}} appears (mcncServer is just our most recent example.) This tends to baffle most programmers, and after a few of those, many try to stay as far away from funs as possible. Recently, I started looking at the expanded code of a module with funs. In this particular case, I compiled the mcncServer with erlc ... -E mcncServer.erl I started searching for the fun identified by {lists,120702597,3}. I first tried searching for 120702597, but with no luck. Then I searched for the string 'fun%3', and found the following: {ok,PvcKeys,SpvcKeys} -> Job1 = lists:map(make_fun('fun%2'/1, 2, 92415502, []),PvcKeys), Job2 = lists:map(make_fun('fun%3'/2, 3, 46622337, []),SpvcKeys), The funs (1 through 18) are all collected at the end of the file, and since you can see already from the above that there is something wrong with 'fun%3' (lists:map/2 expects a fun of arity 1, not 2), I zoomed down to these two funs: 'fun%2'({Key,ConnType}) -> sysTimer:apply_after(1000,mcncServer,poll_timeout, [pvc,Key,ConnType,erlang:self()]), {pvc,{Key,ConnType}}. 'fun%3'(Key,ConnType) -> sysTimer:apply_after(1000,mcncServer,poll_timeout, [spvc,Key,ConnType,erlang:self()]), {spvc,Key,ConnType}. I think that this method of identifying funs is unique to BEAM, but I haven't quite figured out how to read it yet. - Is the 'lists' reference a way of saying that the fun was called from the module lists? - What exactly does 120702597 stand for? - How is 3 derived in this case? Does it correspond to 'fun%3', or was I just lucky this time? Did I just miss the documentation of this, or isn't there any? /Uffe -- Ulf Wiger, Chief Designer AXD 301 Ericsson Telecom AB tfn: +46 8 719 81 95 Varuv?gen 9, ?lvsj? mob: +46 70 519 81 95 S-126 25 Stockholm, Sweden fax: +46 8 719 43 44 From ulf.wiger@REDACTED Tue Apr 27 12:45:27 1999 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Tue, 27 Apr 1999 12:45:27 +0200 Subject: RDBMS questions... References: <37240601.D603D189@club-internet.fr> <37244079.81CD8BBE@etxb.ericsson.se> <3724DCC0.EE4225D@club-internet.fr> Message-ID: <37259547.35F3CD7A@etxb.ericsson.se> Mickael Remond wrote: > > I have just begin to play with RDBMS and I think this is a great piece > of code. Thank you very much. That was nice to hear. > > I hope it will be integrated into mnesia distribution, because this tool > is really adding a lot of new functionnality. It surely is an interesting test of the mnesia API to try to tack a full-featured RDBMS on top of it. ;) /Uffe -- Ulf Wiger, Chief Designer AXD 301 Ericsson Telecom AB tfn: +46 8 719 81 95 Varuv?gen 9, ?lvsj? mob: +46 70 519 81 95 S-126 25 Stockholm, Sweden fax: +46 8 719 43 44 From hakan@REDACTED Wed Apr 28 09:24:49 1999 From: hakan@REDACTED (Hakan Mattsson) Date: Wed, 28 Apr 1999 09:24:49 +0200 (MET DST) Subject: Mnesia broken? In-Reply-To: <37243611.96EAC47E@bluetail.com> Message-ID: On Mon, 26 Apr 1999, Joakim Greben? wrote: jocke>Mnesia(y@REDACTED): ** ERROR ** (ignoring core) ** FATAL ** mnesia_monitor crashed: {badarg, jocke> {ets, jocke> lookup, jocke> [disk_log_names, jocke> latest_log]}} state: {state, jocke> <0.59.0>, jocke> [], This is caused by a bug in disk_log. But Mnesia 3.7.1 circumvents the bug, so it works in OTP R5. When Mnesia 3.7.1 is released as Open Source it will work there too, /H?kan From rv@REDACTED Wed Apr 28 12:58:34 1999 From: rv@REDACTED (Robert Virding) Date: Wed, 28 Apr 1999 12:58:34 +0200 Subject: fun with funs In-Reply-To: Your message of "Tue, 27 Apr 1999 12:57:50 +0200." <3725982E.3B9057BB@etxb.ericsson.se> Message-ID: <199904281058.MAA20908@renat.du.etx.ericsson.se> Ulf Wiger writes: >I have a question/discovery that I would like to present: > >Every once in a while, the dreaded error message: > >{{lambda_clause,mcncServer},{lists,120702597,3}} > >appears (mcncServer is just our most recent example.) ... > >I think that this method of identifying funs is unique to BEAM, but I >haven't quite figured out how to read it yet. > >- Is the 'lists' reference a way of saying that the fun was called from >the module lists? > >- What exactly does 120702597 stand for? > >- How is 3 derived in this case? Does it correspond to 'fun%3', or was I >just lucky this time? > >Did I just miss the documentation of this, or isn't there any? It is not defined and there is no documentation for this. It is different for the JAM and the BEAM. In the new version of the BEAM, R6, this will change, as will how fun errors are signaled. The _current_ suggestion is: 1. Error 'badfun' when something which is not a fun is applied, or the fun module no longer exists. 2. Error 'badarity' if the fun is applied with the wrong number of arguments. 3. Error 'function_clause' (!!!) if no clause in the fun matches. 4. The name of the fun "function" will be something like '-foo/3-5-' meaning that it is the 5th fun in the function foo/3. N.B. This had not yet been finally decided upon, but it will be something along these lines. No guarantees. Two caveats: 1. If this reaches the JAM? I have no idea. 2. When this reaches Open Source? I have no idea, ASAP, but I don't make the descisions, or do the work. :-) Robert -- Robert Virding Tel: +46 (0)8 719 95 28 Computer Science Laboratory Email: rv@REDACTED Ericsson Telecom AB WWW: http://www.ericsson.se/cslab/~rv S-126 25 ?LVSJ?, SWEDEN "Folk s?ger att jag inte bryr mig om n?gonting, men det skiter jag i". From ulf.wiger@REDACTED Wed Apr 28 15:17:00 1999 From: ulf.wiger@REDACTED (Ulf Wiger) Date: Wed, 28 Apr 1999 15:17:00 +0200 Subject: fun with funs References: <199904281058.MAA20908@renat.du.etx.ericsson.se> Message-ID: <37270A4C.5DED8DE2@etxb.ericsson.se> Robert Virding wrote: > > It is not defined and there is no documentation for this. It is > different for the JAM and the BEAM. > > In the new version of the BEAM, R6, this will change, as will how fun > errors are signaled. The _current_ suggestion is: [...] Ok, that's fine, but I was thinking that it might be useful still for programmers to know what to do *today* (even if it may change in some future release.) Was my analysis of funs in BEAM (today) correct? Is there a corresponding method that would work for JAM (today)? /Uffe -- Ulf Wiger, Chief Designer AXD 301 Ericsson Telecom AB tfn: +46 8 719 81 95 Varuv?gen 9, ?lvsj? mob: +46 70 519 81 95 S-126 25 Stockholm, Sweden fax: +46 8 719 43 44 From lyn@REDACTED Thu Apr 29 03:34:34 1999 From: lyn@REDACTED (lyn) Date: Wed, 28 Apr 1999 20:34:34 -0500 Subject: public key cryptography Message-ID: <199904290134.UAA00311@karma.uchicago.edu> hi, I'm researching an idea for a secure voting system which I'd like to develop in erlang and give away for free. I plan to use public key cryptography (pkc) to guarantee the security of the system. Has anyone developed any systems in erlang which use pkc? Does anyone know where to find a freely available implementation of a pkc library (C is fine), suitable for such an application? Could I distribute that library along with my application (I am a US citizen in the US)? If not, is the best approach to simply distribute my application separate from the crypto library, then have users download the library and do a "make crypt-bindings" which compiles the necessary erlang-C glue? This would make it legal to distribute my (secure) application, right? answers or pointers much appreciated, -Lyn Headley From jocke@REDACTED Thu Apr 29 23:07:15 1999 From: jocke@REDACTED (Joakim G.) Date: Thu, 29 Apr 1999 23:07:15 +0200 Subject: Mnesia broken? References: Message-ID: <3728CA03.A4CF1F94@bluetail.com> Hakan Mattsson wrote: > > On Mon, 26 Apr 1999, Joakim Greben? wrote: > > jocke>Mnesia(y@REDACTED): ** ERROR ** (ignoring core) ** FATAL ** mnesia_monitor crashed: {badarg, > jocke> {ets, > jocke> lookup, > jocke> [disk_log_names, > jocke> latest_log]}} state: {state, > jocke> <0.59.0>, > jocke> [], > > This is caused by a bug in disk_log. > But Mnesia 3.7.1 circumvents the bug, so it works in OTP R5. > > When Mnesia 3.7.1 is released as Open Source it will work there too, Great! When is "when" in this case? Do you know if the disk_log bug (by itself) is fixed in R5 as well? Thanks /Jocke From knotwell@REDACTED Thu Apr 29 23:36:10 1999 From: knotwell@REDACTED (knotwell@REDACTED) Date: Thu, 29 Apr 1999 14:36:10 -0700 (PDT) Subject: BSDI compilation Message-ID: <14120.53450.440899.23830@knotwell.f5.com> Hello all-- I was able to compile Erlang 47.4.1 under BSDI3.0 (jam only). Beam wouldn't compile because erlc was complaining about running out of memory. I'm guessing that having more than 64MB of memory available would've helped. First some observations: 1) It appears that an install program compatible with GNU's install is required. The default install on BSDI blew up on the -d option. Resolution: use fileutils package found at ftp.gnu.org 2) the configure script checks for pthreads as a separate library. Under BSDI3.0/3.1, the pthreads functions are found in libc instead of libpthread. Resolution: not really a problem I suppose. I suppose it would degrade performance some. Question: does anyone have a SWAG about how much performance is lost when multiplexing in a single-thread/process??? 3) lastly (and most interesting), my source code didn't work the same between a redhat linux system and a BSDI system. The BSDI system complained about a nxdomain error. I'm kind of surprised at this as it appears to have something to do with a the system being unable to do a host name lookup. The BSDI and Linux box both queried the same name on the same name server. . .pretty curious. Question: anyone have any quick ideas on this one? I could certainly fire up the debugger, but I thought I'd ask for any quick suggestions (since I'm not certain how easy it will be to compile up the graphics stuff under BSDI :-( ). Thanks. --Brad From art@REDACTED Fri Apr 30 01:44:43 1999 From: art@REDACTED (Artur Grabowski) Date: 30 Apr 1999 01:44:43 +0200 Subject: public key cryptography In-Reply-To: lyn's message of "Wed, 28 Apr 1999 20:34:34 -0500" References: <199904290134.UAA00311@karma.uchicago.edu> Message-ID: lyn writes: > Does anyone know where to find a freely available implementation of > a pkc library (C is fine), suitable for such an application? ftp.funet.fi:/pub/crypt is always a good place to look. > Could I distribute that library along with my application (I am a US > citizen in the US)? You can distribute it as much as you want in the US and Canada. But nowhere else. > If not, is the best approach to simply distribute my application > separate from the crypto library, then have users download the library > and do a "make crypt-bindings" which compiles the necessary erlang-C > glue? This would make it legal to distribute my (secure) application, > right? No. The law stops you not only from distributing crypto. But also code that uses crypto or has hooks for crypto. //art From seb@REDACTED Fri Apr 30 14:10:54 1999 From: seb@REDACTED (Sebastian Strollo) Date: 30 Apr 1999 14:10:54 +0200 Subject: Future of open source Erlang & When is next release? Message-ID: Hello Since a lot of people are wondering, I thought I would summarize some of the current plans for open source Erlang. As it stands right now, the open source version is lagging behind the production version of Erlang. This is not very good for anyone in the long run, so our plan is to merge them into one common base. Hopefully this will happen with the next official production release (in November 1999). Until then there will not be that much effort put into developing / maintaining the current open source release, mostly due to lack of people having time to work on it. I will try to include all fixes sent to us and, when necessary, make new releases. I am planning to put together a new release in about two weeks (sorry about this, Eddie gang, I realize you would like it sooner.) Since there won't be many people here that have time to work on this, I don't think there will be any binary versions of the new release (also don't hold your breath waiting for a windows version). Included in that release will be: the latest version of mnesia/mnemosyne and a new version of etk. Some bug fixes (out of the top of my head, fixed terminal weirdness, interface list in inet:get_if, and a couple of other things...) All of you that have sent us reports on compiling on other OS's, please mail me the modifications you made (if any) if you want them to be included in the next release. Thanks to all of you Erlang users! -- Sebastian From knotwell@REDACTED Fri Apr 30 23:33:06 1999 From: knotwell@REDACTED (knotwell@REDACTED) Date: Fri, 30 Apr 1999 14:33:06 -0700 (PDT) Subject: BSDI compilation In-Reply-To: <14120.53450.440899.23830@knotwell.f5.com> References: <14120.53450.440899.23830@knotwell.f5.com> Message-ID: <14122.8594.763850.644463@knotwell.f5.com> knotwell@REDACTED writes: > 3) lastly (and most interesting), my source code didn't work the > same between a redhat linux system and a BSDI system. The BSDI system > complained about a nxdomain error. I'm kind of surprised at this as > it appears to have something to do with a the system being unable to > do a host name lookup. The BSDI and Linux box both queried the same > name on the same name server. . .pretty curious. Resolver notes: The program seems to work if I use dot addresses. I guess this points even more highly towards a problem with the resolver. Beam compilation: I previously received a "couldn't reallocate" error, with a suggestion from Mr. Tornkvist, I increased some of the system limits for BSDI. First, I recompiled the kernel with the DFLDSIZE and MAXDSIZ increased to 128M and DFLSSIZ set to 8M. I then set the datasize, stacksize, memoryuse, and memorylocked system limits as large as possible. Jam was then able to compile everything correctly. Performance improvement: Using the beam compiler, my application's (a braindead traffic generator), connection rates went from 120-130 connections/s to 160-180 connections/s. All in all, beam gave me nifty 50% performance gain. Thanks. Brad