Erlang/OTP Forums

Author Message

<  Erlang  ~  Some basic questions (files, packages)

drakon
Posted: Fri Sep 18, 2009 9:48 pm Reply with quote
Joined: 18 Sep 2009 Posts: 5
Hi

I'm wondering how I can place my source files in an other folder. For example in a sub folder.

And an other problem ist, thaht when i start erlang directly in the folder i can compile the .erl files but if I start erlang with a link i can't. I do not really understand why erlang does that.

And one final question. Or it's more a confusion. I realised that the actual reference here:
file:///C:/Programme/erl5.7.2/doc/index.html

does not contain anything about packages:
http://www.erlang.se/publications/packages.html

which I found while trying to solve the first problem. Why isn't it includede anymore?

I use erts-5.7.2 on Windows XP.
Thanks for help
View user's profile Send private message
uwiger
Posted: Sat Sep 19, 2009 1:23 pm Reply with quote
User Joined: 03 Jul 2006 Posts: 604 Location: Sweden
drakon wrote:
I'm wondering how I can place my source files in an other folder. For example in a sub folder.


You can. Erlang doesn't care where the source is, but some build tools may. In these cases, you need to provide them with the information needed to find the source files as well as the build target directory. If you describe what problems you encounter, it will be easier to help.

drakon wrote:
And an other problem ist, thaht when i start erlang directly in the folder i can compile the .erl files but if I start erlang with a link i can't. I do not really understand why erlang does that.


It isn't Erlang, but Windows that sets the current working directory. You can change it by right-clicking on the link and selecting 'Properties'. In Vista, it's the 'Start in:' option. I don't recall what it is in XP, but it was fairly intuitive.

drakon wrote:
And one final question. Or it's more a confusion. I realised that the actual reference here:
file:///C:/Programme/erl5.7.2/doc/index.html

does not contain anything about packages:
http://www.erlang.se/publications/packages.html

which I found while trying to solve the first problem. Why isn't it includede anymore?


It never has been part of the official documentation. It is an experimental and unsupported feature.

BR,
Ulf W
View user's profile Send private message Visit poster's website
drakon
Posted: Sat Sep 19, 2009 2:00 pm Reply with quote
Joined: 18 Sep 2009 Posts: 5
Yeah. I wasn't precise yesterday. Sorry. Wink

I'am using the Erlang Shell to compile and there I don't know how to specify the search paths.
I expected that it's possible to specify the path like that:
Code:
c(mysubfolder/foo).

to compile in an other folder. It would be also nice to specify it non-realtive.
But am I right that's that impossible and I have to specify a some kind of path?

Is there a common IDE for erlang projects? Something like Visual Studio or Eclipse?

EDIT:
OK, i found e plug in for Eclipse. However, which tools do you/others use for developing erlang?

EDIT2:
Hmm. It seems to me very confusing that its not easy to build a "user-friendly" application.. I come from C++, where you naturally generate an .exe and which is basically independent of other things (well it's linking dependent, but that's not really a problem). I searched a way to build up a .exe in erlang and found this:
http://www.sics.se/~joe/sae.html
But the Windows way seems not to work. So my additional question is: How can i build up an hello-world application (.exe) which I can copy on an other computer where no erlang is installed and just use the application?
View user's profile Send private message
Mazen
Posted: Sun Sep 27, 2009 8:31 am Reply with quote
User Joined: 20 Jul 2006 Posts: 164 Location: London
drakon wrote:
So my additional question is: How can i build up an hello-world application (.exe) which I can copy on an other computer where no erlang is installed and just use the application?


You can't [currently, or perhaps never will be able to... probably].
View user's profile Send private message
drakon
Posted: Sun Sep 27, 2009 1:56 pm Reply with quote
Joined: 18 Sep 2009 Posts: 5
hmm. That sounds bad to me. But actually i've seen a webpage, where it was explained how to create e executable but IIRC it was just for linux and the windows version was not working..

anyway. so is it intendet to use an erlang program from this console and call the functions? - is this the normal way to use an erlang program? - i'm a little bit confuesed about that because i'm used to "normal" executables where you can create programs which are friendly for "not-programmers" which seems erlang not to be..
View user's profile Send private message
Mazen
Posted: Mon Sep 28, 2009 6:22 am Reply with quote
User Joined: 20 Jul 2006 Posts: 164 Location: London
Could you please be more specific on how you expect your application to be used? Will it be used from the command prompt? Will you click on a shortcut on the desktop? How would you see it working?

Also, what kind of application is it? Is it a GUI application or console application?

/Mazen
View user's profile Send private message
drakon
Posted: Mon Sep 28, 2009 8:13 am Reply with quote
Joined: 18 Sep 2009 Posts: 5
Well at start nothing really special just for exame a simple chat program. a user should just have an .exe start it (just an console app) and maybe have to connect with an other client or so. the program should than read the input and send it to the spicified other client. it shouldnt be possible to call functions like that way you do with the erlang console.

so it shouldnt be interactive where you can do other things as the things intented from the programmer.

hope this is specific enough. Smile
View user's profile Send private message
Mazen
Posted: Mon Sep 28, 2009 8:57 am Reply with quote
User Joined: 20 Jul 2006 Posts: 164 Location: London
I don't know if you are familiar with how Java does it but you should think of it the same way with Erlang.

You have the virtual machine which you start with erl. erl takes a bunch of parameters and runs in the console. You can remove the shell from erl so that it doesn't allow arbitrary input (only input when you ask for it).

E.g:
Code:

C:\Users\mazen>erl -noinput -noshell -run io format "Hello World" -eval halt()
Hello World
C:\Users\mazen>

I suggest you first look at:
http://www.erlang.org/doc/man/erl.html
and
http://www.erlang.org/doc/man/init.html

then you look at the following flags on those pages (which might interest you):
-detached
-noshell
-noinput
-boot (or -s and -run, if you don't want to use a boot script)

Good luck.
View user's profile Send private message
drakon
Posted: Mon Sep 28, 2009 11:06 am Reply with quote
Joined: 18 Sep 2009 Posts: 5
yeah. that sounds right. Smile
it seems to be the thing im searching for.
ill check it this evening. know im gonna learn eiffel :p
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum