Jordan Wilberding | 1 Apr 01:48 2007
Picon

Re: How to identify symlinks with Erlang

I ended up finding a solution. I wrote my own function, but instead of 
using file:read_file_info, I used file:read_link_info which correctly 
identifies symlink types along with files and directories.

Thanks!
Jordan Wilberding

Jordan Wilberding wrote:
> Hello,
>
> I was wondering if there is a way to identify if a directory is a 
> symlink to another directory in Erlang?
>
> The problem I am having is that when you install the wine, it creates 
> symlinks like
>
> ~/.wine/dosdevices/z: -> /
>
> This means when you try to use filelib:fold_files("~/.",..) it goes 
> endlessly, since it keeps recursing back into the symlink.
>
> Anyone have any ideas?
>
> Thanks!
> Jordan Wilberding
> _______________________________________________
> erlang-questions mailing list
> erlang-questions <at> erlang.org
> http://www.erlang.org/mailman/listinfo/erlang-questions
>   
(Continue reading)

Fredrik Hoback | 1 Apr 11:20 2007
Picon

Start module

Hi, I have a project that I'm working on which consists of several modules. These has to be loaded ( l(my_module). ) and started in a special order. Since I have 5 modules it is cumbersome to do this every time. Is it possible to construct a new module that does this? It should first load some modules then start them? 
------------------------------------
Fredrik Hoback



<div>Hi, I have a project that I'm working on which consists of several modules. These has to be loaded ( l(my_module). ) and started in a special order. Since I have 5 modules it is cumbersome to do this every time. Is it possible to construct a new module that does this? It should first load some modules then start them?&nbsp;<div>
<div> <span class="Apple-style-span"><div>------------------------------------</div>
<div>Fredrik Hoback</div>
<div><a href="mailto:fredrik.hoback <at> gmail.com">fredrik.hoback <at> gmail.com</a></div>
<div><br class="khtml-block-placeholder"></div>
<br class="Apple-interchange-newline"></span> </div>
<br>
</div>
</div>
Ramon Diaz-Uriarte | 1 Apr 18:43 2007
Picon

Re: Erlang and Ada

On 3/30/07, ok <ok <at> cs.otago.ac.nz> wrote:
> On 29 Mar 2007, at 10:00 pm, Ramon Diaz-Uriarte wrote:
>
> > I was looking for a comparison of Erlang with Ada and could find very
> > little (I searched comp.lang.ada, the erlang list, and lambda the
> > ultimate, and did a variety of goodle searches). I understand that the
> > two languages have different origins and have been mainly applied in
> > different areas (telecom --Erlang-- vs. aviation and military --Ada).
> > But it seems both are unique among "major languages" in the support
> > they provide for concurrent and distributed programming using message
> > passing. Why, then, so few comparisons among the two?
>
> I have copies of the Ada 81, Ada 83, Ada 95, and Ada 2005 standards.
> I haven't finished reading the last of these, as I only got it recently.
> However, I can certainly assure you that there is nothing in any of the
> previous Ada standards concerning distribution.  Ada was designed to be

Aha, I see. You obviously know this stuff, so I won't argue, but I
thought in Appendix E (for Ada 95) there was some stuff related
to/relevant for distribution. Anyway, you make this clear enough, and
now that I reread some of my Ada material, I can find "concurrent" and
parallel, but nothing that would indicate distributed. So I guess I
managed to confuse myself.

> a clean general-purpose programming language with a special emphasis on
> embedded systems, which is one reason why the Ada standards do not
> require
> garbage collection.  The SPARK Ada subset, that is, the subset supported
> by the SPARK verifier, doesn't even include dynamic allocation, although
> that is certainly part of the full language.
>
> Nor does Ada use message passing.  It uses the *rendezvous*, which is
> a bit like message passing except that it is synchronous and unbuffered.
> If one Ada task wants another task to do something, it has to wait until
> the other task is ready to receive the request.  The 'select' statement
> of Ada is very similar indeed to Erlang's 'receive', but the one is
> unbuffered synchronous and the other buffered asynchronous.
>

Thanks for the clarification!

> The different backgrounds lead to another important difference.
> Erlang is designed for systems where you expect to upgrade the software
> while it is running without taking the system down; this is the famous
> "hot loading", and amongst other things it presupposes a network over
> which the changes can be distributed.  Ada was designed for conventional
> applications and for embedded systems, where you are expected to follow
> a development process that gets the program "right the first time".
> There
> is no notion in the Ada language of any kind of dynamic loading.
> (Which is
> not to say that Ada can't use dynamic linking on those operating systems
> that have it, only that it's not part of the standard language or
> libraries
> in the same way that it's not part of the standard C language or
> libraries.)
>

OK, I see. I never paid too much attention to these issues since
neither make a whole lot of difference for my current projects (or,
I've never programmed in a language that allows "hot loading", so
maybe I have no idea what I've been missing).

> Interestingly, both Ada 95 and Erlang/OTP allow a kind of dotted
> module name,
> and from my point of view they both got the dotted names inside out,
> but Ada
> 95 "child packages" really have some point to them.  (For example an Ada
> package can have *private* children that other packages cannot see.
> Neither
> Java nor Erlang can manage that.  Also, Ada children can be allowed
> to see
> inside their parents, which again neither Java nor its slavish
> imitator in
> this respect, Erlang, allows.)
>
> Arguably the single most important difference between Ada and Erlang is
> that Ada is an imperative language relying on destructive updates to
> variables and arrays, while Erlang is mostly functional.  One of the

Yes, this part I was aware of. I understand it is a  big difference
but I guess that this ought not to stop anyone from using Erlang or
Ada if either one meets their needs.

> things
> that makes Ada a nice language for concurrency is that it doesn't SHARE
> mutable data between tasks.

But you cannot run into trouble in this issue with Erlang, either.

The nearest it comes is something called a
> 'protected record', which is essentially a 'monitor' (or a Java
> object all
> of whose methods are synchronised and with no exported fields).
> Nevertheless
> it is only really at home on shared *memory* machines.
>

Aha, that is something I wasn't aware of. And that seems a crucial point.

> Ada doesn't have any form of pattern matching other than a 'case'
> statement

Yep. Erlang's pattern matching is a very neat feature.

> which is similar to (but MUCH cleaner and far easier to get right) the
> C/C++/Java 'switch' statement.  It _could_ have something fancier;
> Mesa did.
>
>

Thanks again for your detailed answers.

Best,

R.

> _______________________________________________
> erlang-questions mailing list
> erlang-questions <at> erlang.org
> http://www.erlang.org/mailman/listinfo/erlang-questions
>

--

-- 
Ramon Diaz-Uriarte
Statistical Computing Team
Structural Biology and Biocomputing Programme
Spanish National Cancer Centre (CNIO)
http://ligarto.org/rdiaz
Bob Ippolito | 1 Apr 19:28 2007

Re: Start module

On 4/1/07, Fredrik Hoback <fredrik.hoback <at> gmail.com> wrote:
> Hi, I have a project that I'm working on which consists of several modules.
> These has to be loaded ( l(my_module). ) and started in a special order.
> Since I have 5 modules it is cumbersome to do this every time. Is it
> possible to construct a new module that does this? It should first load some
> modules then start them?
>

Modules are loaded automatically when a function is called in them.
You shouldn't need to explicitly load the module unless you're trying
to replace the current version with a new beam file.

It sounds like what you want to do is write a supervisor...

-bob
Lennart Ohman | 1 Apr 19:33 2007
Picon

Re: Start module

Hi Fredrik,
I am not sure if I now answer something in the middle of a
thread, but unless you have done something to your Erlang
system, modules are automatically loaded on demand. The l/1
shell function you are referring to is only necessary if you
want to reload the module (like after you have a bew better
version available).

If reloading modules in runtime *is* what you want to do and
you want it to be done in som "automagic" way, you need to
look at the API of 'code'. What you will be doing in that case
is actually building a kind of release handler, and requires
understanding of the new/old code concepts.

Best Regards

Lennart

-------------------------------------------------------------
Lennart Ohman                   office  : +46-8-587 623 27
Sjoland & Thyselius Telecom AB  cellular: +46-70-552 67 35
Hälsingegatan 43, 10tr          fax     : +46-8-667 82 30
SE-113 31, STOCKHOLM, SWEDEN    email   : lennart.ohman <at> st.se
> -----Original Message-----
> From: erlang-questions-bounces <at> erlang.org [mailto:erlang-questions-
> bounces <at> erlang.org] On Behalf Of Fredrik Hoback
> Sent: Sunday, April 01, 2007 11:21 AM
> To: erlang-questions <at> erlang.org
> Subject: [erlang-questions] Start module
> 
> Hi, I have a project that I'm working on which consists of several
> modules. These has to be loaded ( l(my_module). ) and started in a special
> order. Since I have 5 modules it is cumbersome to do this every time. Is
> it possible to construct a new module that does this? It should first load
> some modules then start them?
> ------------------------------------
> Fredrik Hoback
> fredrik.hoback <at> gmail.com
> 
> 

adfafd adfadfafddafa | 1 Apr 21:24 2007
Picon

Freelancers

Hi all

Im after an Erlang programmer who is willing to work on a job for me . Whether they charge per hour or per job is fine.

I already have a program in Erlang and require the program to be improved and also a windows client made for it .

Having searched in sites like Elance,SL , Rentacoder etc I thought I would post a request here.

Alternatively if anyone knows of sites where I may find Erlang freelancers then please let me know

Thanks

--

<div>
<p>Hi all<br><br>Im after an Erlang programmer who is willing to work on a job for me . Whether they charge per hour or per job is fine.<br><br>I already have a program in Erlang and require the program to be improved and also a windows client made for it .<br><br>Having searched in sites like Elance,SL , Rentacoder etc I thought I would post a request here.<br><br>Alternatively if anyone knows of sites where I may find Erlang freelancers then please let me know<br><br>Thanks<br><br>

--

-- 
</p>
<p>
<a href="http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=en-mail_a_01" target="_blank">
</a>
</p>
</div>
jm | 2 Apr 00:54 2007

Re: Erlang and Ada (and now Hume)


Following this thread made me wonder if there was a functional
programming language suitable for hard real-time applications, the sort
of thing that Ada is normally used for, and, if not, why not. Searching
for "hard realtime functional programming language" I came across this paper

http://homepages.inf.ed.ac.uk/stg/workshops/TFP/book/Hammond/TFP03-Hammond/tfp03.pdf

In which it lists the "Essential properties of real-time languages" as
determinacy, bounded time/space, asynchronicity, concurrency,
correctness, and adds periodic scheduling, and interrupts and polling.

They go on to discuss the different approaches taken in designing
real-time languages, either by adapting an existing general language or
by creating a domain specific language. Ada, SPARK Ada, Java, Erlang,
and a few less well known languages get mentioned. Before turning their
attention to why function language haven't seen much application in this
space before (mostly due to bounding space/time). Finally, they turn to
there own language Hume (http://www.hume-lang.org/).

Having only heard of this language in passing before I was wondering
what anyone out there knew and thought about it. There seems to be a few
examples on the website to do with hard real-time application, but as
yet I haven't had the time to look at the language in any detail. Anyone
 had some experience with Hume?

Jeff.
Bob Ippolito | 2 Apr 03:44 2007

R11B-3 shell crashes when printing float infinity

I haven't installed R11B-4 on my workstation yet, so I'm not sure if
this is still applicable... but I just noticed that the R11B-3 shell
crashes if you try and get it to print out float infinity.

Erlang (BEAM) emulator version 5.5.3 [source] [async-threads:0]
[kernel-poll:false]

Eshell V5.5.3  (abort with ^G)
1> float_to_list(1.0e666666).
"inf"
2> 1.0e666666.
*** ERROR: Shell process terminated! (^G to start new job) ***

=ERROR REPORT==== 1-Apr-2007::18:41:54 ===
Error in process <0.23.0> with exit value:
{function_clause,[{io_lib_format,float_data,[[],[]]},{io_lib_format,fwrite_e,5},{shell,shell_rep,4},{shell,server_loop,7}]}

-bob
ok | 2 Apr 05:19 2007
Picon

Re: Erlang and Ada

I wrote:
>> However, I can certainly assure you that there is nothing in any  
>> of the
>> previous Ada standards concerning distribution.  Ada was designed  
>> to be

This was far too strong, and I was hoping to fix this up before anyone
noticed.  However,
On 2 Apr 2007, at 4:43 am, Ramon Diaz-Uriarte wrote:
>

> Aha, I see. You obviously know this stuff, so I won't argue, but I
> thought in Appendix E (for Ada 95) there was some stuff related
> to/relevant for distribution.

It's "Annex" E, and its title is "Distributed Systems".
I had made a serious mistake.  Annexes K to P "are for information  
only";
my mistake was thinking that Annex E was one of the "informative"  
annexes.
In fact Annex is is "Normative", and "Annexes A to J form an integral  
part
of this international standard", so distribution *IS* "an integral  
part of"
Ada 95.  (It made sense for distribution to be optional, given that many
of the systems on which one would want to use Ada couldn't make use of
distribution facilities.  But that's not the way the real world is.)

One is left wondering why "integral parts" are split off as "annexes"
rather than "chapters".  However, annexes C to H are the "Specialized
Needs" annexes, which again strongly suggests to the feeble-minded  
reader
(ME) that they are not required of all systems.  Chapter 10, which says
	An implementation may provide inter-partition communication
	mechanism(s) via special packages and pragmas. ... If no such
	mechanisms are provided, then each partition is isolated from
	all others, and behaves as a program in and of itself.
does not encourage the reader to believe that distribution facilities  
can
be relied on to be present.

What is quite clear is that Annex E itself says that
	The implementation shall provide means for explicitly assigning
	library units to a partition and for the configuring and
	execution of a program consisting of multiple partitions on a
	distributed system; THE MEANS ARE IMPLEMENTATION-DEFINED.

That is, there is no *standard* way to say what the distribution of an
Ada program actually *is* nor to cause a distributed Ada program to run.

	... the scheduling policies, treatment of priorities, and
	management of shared resources between [...] partitions [that
	are mapped onto the same node] are IMPLEMENTATION-DEFINED.

Ada 95 distribution does not handle update, but does provide 'Version  
and
'Body_Version attributes that you can use to detect when update would  
hhave
been necessary.  These things change whenever there is a semantically
significant change, EXCEPT that

	This International Standard does not define ... "semantically
	significant".

Let me characterise Ada 95 distribution this way:

    Ada 95 provides language means for specifying a program that *MAY*
    be distributed, but not means for specifying that it *MUST* be
    distributed, nor any way for saying *HOW* it is distributed.

The summary of the summary is

    There is a reliable way for an Erlang program to say "I want to run
    <this> over <there>."  There is no portable way for an Ada program
    to do that.

And from my point of view, that amounts to saying that there is  
nothing in
Ada 95 that I can recognise as useful distribution.  (Not to mention the
fact that an Ada 95 implementation is only required to make distribution
work between identical machines.)
>

> OK, I see. I never paid too much attention to these issues since
> neither make a whole lot of difference for my current projects (or,
> I've never programmed in a language that allows "hot loading", so
> maybe I have no idea what I've been missing).

Lisp, Smalltalk, Prolog, TCL, Python (I think).  We are even seeing
C systems with "fix and continue" in the debugger (not that I trust  
them...)

Bengt Kleberg | 2 Apr 08:49 2007
Picon

OT Re: Erlang and Ada

On 2007-04-02 05:19, ok wrote:
...deleted
> Lisp, Smalltalk, Prolog, TCL, Python (I think).  We are even seeing
> C systems with "fix and continue" in the debugger (not that I trust  
> them...)

about 20 years ago i was building a real time expert system for the oil 
industry in noreway. we had a UniWorks system (vxWorks+Unix) where the c 
debugger contained the command ffb. according to the documentation it 
was for ''find and fix bug''. not that i ever needed to use it :-)

bengt
--

-- 
Those were the days...
    EPO guidelines 1978: "If the contribution to the known art resides
    solely in a computer program then the subject matter is not
    patentable in whatever manner it may be presented in the claims."

Gmane