- Notifications
You must be signed in to change notification settings - Fork4
fredyouhanaie/etclface
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is aTcl extension that will allow software writtenin Tcl andErlang to communicate using theErlang/OTP interface,erl_interface
.
Erlang provides two native interfaces that enable communication betweenErlang processes and external programs using Erlang's message passingmechanism.
One of these interfaces iserl_interface
, which allows the externalprogram to register as a node in a Distributed Erlang network and exchangemessages with Erlang processes.
Some of the aims of the Tcl extension are:
- Let a Tcl application use Erlang for processing.
- Let an Erlang application use a Tcl/Tk based GUI, or other Tclextensions such as Expect.
The initial version will only expose enougherl_interface
functions toallow a Tcl application to communicate with Erlang nodes. Currently,there are many functions inerl_interface
, however, only the followingsubset will be provided:
- register with epmd as a node
- send/receive messages
- decode/encode between internal and Tcl types
You will need the following software/packages:
- Tcl/Tk 8.5 or higher
- Erlang/OTP, R15B03 or higher
- TeX, if producing the documentation
- Cweb, which can be obtained fromhere, orautomatically installed with the TeX Live package.
- cmake
- ccmake, not mandatory, but a useful tool for editing cmake parameters
- make
- C compiler, GCC was used during development
- tcllib, provides doctools and dtplite, which is needed for the manpage
Once you have the source files on a local disk, change to theetclface
directory, then
mkdir -pv _build# for out-of-source buildscd _buildcmake ..make# to create the librarymake man# to create the man pagemake doc# optional, for the PDF docs
if the build is successful, then you should have the following filesin the_build
directory:
- libetclface.so
- etclface.3tcl.gz
- etclface.pdf (if
make doc
was run)
You can then install the library, by default under/usr/local/
, with
make install# ensure you have permissions
The PDF file is not installed anywhere, it is up to you to move/copyit somewhere convenient.
You can also change the installation directory when configuring cmake,e.g.
mkdir -pv _buildcd _buildcmake -DCMAKE_INSTALL_PREFIX=$HOME/.local ..
The$HOME/.local
directory in the above example is standard on theLinux systems, and it allows users to have their own privateequivalent of/usr/local
directory.
Every timemake install
is run, the file_build/install_manifest.txt
will contain the list of the installedfiles.
The software has been tested on Debian GNU/Linux only. The testscripts can be found in theTests
directory.
To run the testsuite:
cd _buildmake tests
The testsuite will start a local erlang node in the background, usingrun_erl
, that will be used to test the communication betwen the Tcland Erlang processes. The erlang node will only be active during thetest. While active, the erlang node will write to log files in/tmp/erlnode/
.
If, for some reason, the erlang node is left running, it can bestopped as follows, note that the trailing/
is required:
echo 'q().' | to_erl /tmp/erlnode/
There are two pieces of documentation, a man page and a single PDFfile generated from theCWEB
source code.
The man page is generated from theetclace.man
file and, onceinstalled, can be accessed usingman etclface
. It describes all theTcl commands implemented byetclface
.
The PDF file contains the implementation details, including thecomplete source code.
Comments and feedback are welcome, please use the issue tracker forthis.
Please use pull requests for patch contributions.
Enjoy!
Fred Youhanaie