f



TCL/TCL combined with Java/C/C++, Any Recommendations?

Hi,

I have an application that I wrote in TCL/TK. It has to work with big files +5GB.

The parsing performace is not where I would like and some of the data manipulations are taking considerable amount of time due to the data size.

Therefore I am considering switching these parts of the code to Java, C or C++. While keepting the GUI and GUI supporting code in TCL/TK at this time.

I am trying to figure out which language will be easier to merge with TCL in an application.

For C I know that I can compile and generate a .so or .dll and create a TCL package and load it. I believe this is done with SWIG but I have not done it.

In Java I saw some info on Jacl and TclBlend.

The application will be "compiled" into a TCL "executable". I know I can compile my TCL code into Byte code to protect the IP. I am not sure about Java.

Any recommendations or pointers will be greatly appreciated.

Thanks in advance,
Frank
0
kranfg (61)
5/15/2013 4:15:43 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

19 Replies
969 Views

Similar Articles

[PageSpeed] 11

Frank <kranfg@gmail.com> writes:

> Hi,
>
> I have an application that I wrote in TCL/TK. It has to work with big files +5GB.
>
> The parsing performace is not where I would like and some of the data manipulations are taking considerable amount of time due to the data size.
>
> Therefore I am considering switching these parts of the code to Java, C or C++. While keepting the GUI and GUI supporting code in TCL/TK at this time.
>
> I am trying to figure out which language will be easier to merge with TCL in an application.
>
> For C I know that I can compile and generate a .so or .dll and create a TCL package and load it. I believe this is done with SWIG but I have not done it.
>
> In Java I saw some info on Jacl and TclBlend.
>
> The application will be "compiled" into a TCL "executable". I know I can compile my TCL code into Byte code to protect the IP. I am not sure about Java.
>
> Any recommendations or pointers will be greatly appreciated.

Easy integration of C extensions is one of Tcl's strong points.
Depending on how extensive your task is, Critcl might hit a sweet spot:

Start e.g. here: http://wiki.tcl.tk/2523

Regards
-- tomás
0
tomas2949 (126)
5/15/2013 5:28:41 PM
At Wed, 15 May 2013 09:15:43 -0700 (PDT) Frank <kranfg@gmail.com> wrote:

> 
> Hi,
> 
> I have an application that I wrote in TCL/TK. It has to work with big files +5GB.
> 
> The parsing performace is not where I would like and some of the data manipulations are taking considerable amount of time due to the data size.
> 
> Therefore I am considering switching these parts of the code to Java, C or C++. While keepting the GUI and GUI supporting code in TCL/TK at this time.
> 
> I am trying to figure out which language will be easier to merge with TCL in an application.
> 
> For C I know that I can compile and generate a .so or .dll and create a TCL package and load it. I believe this is done with SWIG but I have not done it.
> 
> In Java I saw some info on Jacl and TclBlend.
> 
> The application will be "compiled" into a TCL "executable". I know I can compile my TCL code into Byte code to protect the IP. I am not sure about Java.
> 
> Any recommendations or pointers will be greatly appreciated.

Visit: these pages:

http://code.google.com/p/tclkit/
http://wiki.tcl.tk/10558

> 
> Thanks in advance,
> Frank
>                                                                                                                               

-- 
Robert Heller             -- 978-544-6933 / heller@deepsoft.com
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments


                                                                                              
0
heller (3031)
5/15/2013 6:44:35 PM
Hi Tomas,

Yes I saw the post from Andreas about Critcl but in my case I think it may be better to decouple it.

I was inclined in C. The problem with C is that you need to generate a library for each platform that your application will run.

I thought that Java could make it easier as it should be platform independent. But in Java the JAR files can be unwrapped the same way the TCL starkits can be unwrapped. Therefore I was not sure if they can be encoded like TCL can be byte_encoded.


Thanks again,
Frank
0
kranfg (61)
5/16/2013 3:33:17 AM
Hi Robert,

Yes I am familiar with the TCL starkits but they can be unwrapped.

Currently I have my code encoded (bytecode) to protect it.

C libraries are binary so they are protected.

I am not sure about JAR files.

Thanks again,
Frank
0
kranfg (61)
5/16/2013 3:36:32 AM
* Frank <kranfg@gmail.com>
| I have an application that I wrote in TCL/TK. It has to work with big
| files +5GB.
>
| The parsing performace is not where I would like and some of the data
| manipulations are taking considerable amount of time due to the data size.

Can you show some code?  Maybe there are ways to optimize the TCL so the
performance would be better?

R'
0
ralfixx (1283)
5/16/2013 8:51:10 AM
At Wed, 15 May 2013 20:36:32 -0700 (PDT) Frank <kranfg@gmail.com> wrote:

> 
> Hi Robert,
> 
> Yes I am familiar with the TCL starkits but they can be unwrapped.
> 
> Currently I have my code encoded (bytecode) to protect it.
> 
> C libraries are binary so they are protected.
> 
> I am not sure about JAR files.


Java Class files are in fact compiled to Java's byte code.  There is no need 
to ship Java *source* (.java) files.

> 
> Thanks again,
> Frank
>                                   

-- 
Robert Heller             -- 978-544-6933 / heller@deepsoft.com
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments


                                                                                               
0
heller (3031)
5/16/2013 11:30:30 AM
On Thursday, May 16, 2013 3:51:10 AM UTC-5, Ralf Fassel wrote:
'Can you show some code? Maybe there are ways to optimize the TCL so the pe=
rformance would be better? R'


Sorry I can not provide the parsing code.

I made a very simple test to read a 3.9GB file in TCL and in C. Just readin=
g and no parsing or printing the lines. In C it ran in 80 seconds while TCL=
 was 201 secs. The 5GB is an average. I had to work with 40GB files. Just c=
omparing the two results I can get a 2.5X improvement (in the reading part)=
 by switching to C. I am hoping the parsing part of the code can be made ef=
ficient in C.

I believe I did some research some time ago and found a study someone did o=
n tweaking TCL to read the files in different ways. I think one of the meth=
ods was reading in binary and in big chunks and then processing those chunk=
s but I thought that was going to complicate my parser.

The two codes I ran are below. Both ran in the same Linux machine.

I also think that I may convert some of the data manipulation/math computat=
ion areas of the code to C which I should get better runtime.

I am more inclined to work on Java as it would be a nice opportunity to pla=
y with Java and write code that I can easily levarage in multiple platforms=
..

The TCL code:
#! /bin/sh
# The next line restarts using wish \
exec tclsh "$0" "$@"

set file my_big.file
set fIn [open ${file} r]
puts "Started at: [exec date]"
 while {[gets $fIn line] >=3D 0} {
}
puts "Ended at [exec date]"
close $fIn

The C code is below:
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <time.h>
#define SIZE 256

main()
{
struct timeval tv1, tv2, diff;
  FILE * kp;
  char file[80];
  char classmain[100];
  int i=3D0, j=3D0,x=3D0;
       char buffer[SIZE];
       time_t curtime;
       struct tm *loctime;
  printf("Open File: ", &file);
  gets(file);

  kp=3Dfopen(file,"r");
  if(kp=3D=3DNULL)
    {
      printf("unable to open the file");
      exit(1);
    }

       /* Get the current time. */
       curtime =3D time (NULL);

       /* Convert it to local time representation. */
       loctime =3D localtime (&curtime);

       /* Print out the date and time in the standard format. */
       printf("Start Time:");
       fputs (asctime (loctime), stdout);

    printf("Reading file\n");
  while(!feof(kp))
    {

      while(fgets(classmain,100,kp)!=3D NULL)
        {

/*        printf("%s",classmain); */
        }

    } //end of 1st while

  fclose(kp);

       /* Get the current time. */
       curtime =3D time (NULL);

       /* Convert it to local time representation. */
       loctime =3D localtime (&curtime);
 printf("End Time:");
 fputs (asctime (loctime), stdout);

}//end of main
0
kranfg (61)
5/16/2013 3:11:41 PM
On Thursday, May 16, 2013 6:30:30 AM UTC-5, Robert Heller wrote: "Java Class files are in fact compiled to Java's byte code. There is no need to ship Java *source* (.java) files."

That is great news. I may try the Java way then. I think I'll write a simple read file like the TCL and C and run it to see what I get. :)

Thanks,
Frank
0
kranfg (61)
5/16/2013 4:46:49 PM
* Frank <kranfg@gmail.com>
| I made a very simple test to read a 3.9GB file in TCL and in C. Just
| reading and no parsing or printing the lines. In C it ran in 80
| seconds while TCL was 201 secs. The 5GB is an average. I had to work
| with 40GB files. Just comparing the two results I can get a 2.5X
| improvement (in the reading part) by switching to C. 

You will always be quicker in C, though improvements to the TCL code to
make it comparable to the C program exist (binary encoding, putting the
code in a proc so it gets compiled etc).  But since TCL under the hood
can't do anything better than read(2), it can't be quicker than
read(2)...

| I am hoping the parsing part of the code can be made efficient in C.

This is where it gets interesting.  Text processing or anything like it
is so much easier in TCL, so the question is whether TCL could be "quick
enough"...

YMMV.

R'
0
ralfixx (1283)
5/17/2013 10:23:27 AM
On Friday, May 17, 2013 5:23:27 AM UTC-5, Ralf Fassel wrote:
"Text processing or anything like it is so much easier in TCL"

I know. It is so nice and simple. :)

I believe C has a regexp library and I was planning to give it a shot. That may help ease the parsing of the data.

I am trying to get some java stats with the same file but I need to setup my Linux environment for it.

Thanks again,
Frank

0
kranfg (61)
5/17/2013 2:44:22 PM
Am 15.05.13 18:15, schrieb Frank:
> Therefore I am considering switching these parts of the code to Java, C or C++. While keepting the GUI and GUI supporting code in TCL/TK at this time.
>
> I am trying to figure out which language will be easier to merge with TCL in an application.

I'd go for C/C++ rather than Java. Its really easy to extend Tcl with C, 
much easier than you might think. And if you write your C code platform 
independent from the beginning, it won't be a problem to compile it for 
different platforms.

> For C I know that I can compile and generate a .so or .dll and create a TCL package and load it. I believe this is done with SWIG but I have not done it.

You don't need that, unless you have a huge library of C code that is 
already there as it is and needs to be integrated in Tcl.

> In Java I saw some info on Jacl and TclBlend.

Tclblend is probably what you need if you want to go with Java. Jacl is 
for integrating Tcl into Java, but since you mentioned that your GUI is 
in Tk, this wouldn't be helpful. But Tclblend introduces a dependency on 
the JNI interface and on a suitable JRE on the client platform... things 
to consider.

> The application will be "compiled" into a TCL "executable". I know I can compile my TCL code into Byte code to protect the IP. I am not sure about Java.

When you link your C extension against the Tclstubs library, they will 
be ready for tclkits

Best Regards

-- 
Eckhard

0
elehmann77 (52)
5/23/2013 8:52:41 PM
At Thu, 23 May 2013 22:52:41 +0200 Eckhard Lehmann <elehmann77@gmail.com> wrote:

> 
> Am 15.05.13 18:15, schrieb Frank:
> > Therefore I am considering switching these parts of the code to Java, C or C++. While keepting the GUI and GUI supporting code in TCL/TK at this time.
> >
> > I am trying to figure out which language will be easier to merge with TCL in an application.
> 
> I'd go for C/C++ rather than Java. Its really easy to extend Tcl with C, 
> much easier than you might think. And if you write your C code platform 
> independent from the beginning, it won't be a problem to compile it for 
> different platforms.
> 
> > For C I know that I can compile and generate a .so or .dll and create a TCL package and load it. I believe this is done with SWIG but I have not done it.
> 
> You don't need that, unless you have a huge library of C code that is 
> already there as it is and needs to be integrated in Tcl.

The OP may not *need* to use SWIG, but SWIG automates the process. For many
straight forward C or C++ code, SWIG will do *everything* needed with little
or even no need to delve into the Tcl C API at all.  A 5-10 line .i file and a 
pass though SWIG, and then compilation with C or C++, a link step and presto, 
a ready to do .so or .dll file. Done.  As they say in the Staples commercials, 
"that was easy".

> 
> > In Java I saw some info on Jacl and TclBlend.
> 
> Tclblend is probably what you need if you want to go with Java. Jacl is 
> for integrating Tcl into Java, but since you mentioned that your GUI is 
> in Tk, this wouldn't be helpful. But Tclblend introduces a dependency on 
> the JNI interface and on a suitable JRE on the client platform... things 
> to consider.
> 
> > The application will be "compiled" into a TCL "executable". I know I can compile my TCL code into Byte code to protect the IP. I am not sure about Java.
> 
> When you link your C extension against the Tclstubs library, they will 
> be ready for tclkits
> 
> Best Regards
> 

-- 
Robert Heller             -- 978-544-6933 / heller@deepsoft.com
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments


                                                                              
0
heller (3031)
5/24/2013 1:40:51 AM
Am Freitag, 24. Mai 2013 03:40:51 UTC+2 schrieb Robert Heller:

> The OP may not *need* to use SWIG, but SWIG automates the process. For many
> 
> straight forward C or C++ code, SWIG will do *everything* needed with little
> 
> or even no need to delve into the Tcl C API at all.  A 5-10 line .i file and a 
> 
> pass though SWIG, and then compilation with C or C++, a link step and presto, 
> 
> a ready to do .so or .dll file. Done.

Sure, if he has C/C++ code already. Or if he decides to write the C code in a way to be independent from Tcl and later on connect this independent C library to Tcl.
But if he writes the C extension from scratch and decides to couple it to Tcl anyway (the Tcl C library might offer him some handy tools), then there is no need for SWIG.

Nevertheless SWIG is a great tool. I will use it very soon I think.

-- 
Eckhard
0
elehmann77 (52)
5/24/2013 9:28:53 AM
In article <knlviq$gmm$1@news-ailanthus.fernuni-hagen.de>,
Eckhard Lehmann  <elehmann77@gmail.com> wrote:
>Am 15.05.13 18:15, schrieb Frank:
>> Therefore I am considering switching these parts of the code to Java, C or C++. While keepting the GUI and GUI supporting code in TCL/TK at this time.
>>
>> I am trying to figure out which language will be easier to merge with TCL in an application.
>

>> In Java I saw some info on Jacl and TclBlend.
>
>Tclblend is probably what you need if you want to go with Java. Jacl is 
>for integrating Tcl into Java, but since you mentioned that your GUI is 
>in Tk, this wouldn't be helpful. But Tclblend introduces a dependency on 
>the JNI interface and on a suitable JRE on the client platform... things 
>to consider.
>
>> The application will be "compiled" into a TCL "executable". I know I can compile my TCL code into Byte code to protect the IP. I am not sure about Java.



Just to clear up any confusion, JTcl (a modern fork of Jacl) is a complete Tcl 
interpreter written in Java.  JTcl implements Tcl 8.4, plus many Tcl 8.5 
commands as well.  Swank is an extension for JTcl that provides a Tk interface,
so many Tcl/Tk programs run with no modification under JTcl/Swank.  (Due to 
some differences in the windowing model Swank uses [Swing], sometimes small 
tweaks may be required.)  JTcl ships with Tcllib, IncrTcl and a number of
JTcl specific libraries.

JTcl has a few more interesting items that make interfacing with Java easy.

  -TJC (Tcl to Java Compiler) will compile Tcl procedures into Java code, and 
   thus into Java byte-code for execution.  This is used both as a speed up 
   and way to protect Tcl source code.  

  -Hyde is a JTcl extension that provides easy Java interfacing, allowing 
   you to write Java code inside Tcl proc's, very much like Critcl does for 
   C/Tcl.  Java code is compiled on-the-fly or ahead of time.

  -a small utility shipped with JTcl allows you to bundle the JTcl interpreter, 
   your source code, extra Java libraries into a single .jar file, very similar 
   to Starkits.

All about JTcl and Swank can be found at:
    http://jtcl.kenai.com/
    http://swank.kenai.com/

--
Tom Poindexter
tpoindex@nyx.net
0
tpoindex1 (87)
5/27/2013 6:38:38 PM
Am 27.05.13 20:38, schrieb Tom Poindexter:

> Just to clear up any confusion, JTcl (a modern fork of Jacl) is a complete Tcl
> interpreter written in Java.  JTcl implements Tcl 8.4, plus many Tcl 8.5
> commands as well.  Swank is an extension for JTcl that provides a Tk interface,
> so many Tcl/Tk programs run with no modification under JTcl/Swank.

Thats interresting to note, thanks!
Is there support for tests in Jtcl? Could be a good substitute for Junit...
And are there plans to implement XOTcl or TclOO?

-- 
Eckhard

0
elehmann77 (52)
5/28/2013 6:44:04 PM
On 5/23/13 9:40 PM, Robert Heller wrote:
> The OP may not*need*  to use SWIG, but SWIG automates the process. For many
> straight forward C or C++ code, SWIG will do*everything*  needed with little
> or even no need to delve into the Tcl C API at all.  A 5-10 line .i file and a
> pass though SWIG, and then compilation with C or C++, a link step and presto,
> a ready to do .so or .dll file. Done.  As they say in the Staples commercials,
> "that was easy".

+1 for SWIG. I found it very easy to write a Tcl interface to a C lib 
using just a simple interface file. Much easier than using critcl or 
writing the glue code by hand.

-- 
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
0
kw564 (720)
5/29/2013 12:47:47 AM
In article <ko2ttk$1l4$1@news-ailanthus.fernuni-hagen.de>,
Eckhard Lehmann  <elehmann77@gmail.com> wrote:
>Am 27.05.13 20:38, schrieb Tom Poindexter:
>
>> Just to clear up any confusion, JTcl (a modern fork of Jacl) is a complete Tcl
>> interpreter written in Java.  JTcl implements Tcl 8.4, plus many Tcl 8.5
>> commands as well.  Swank is an extension for JTcl that provides a Tk interface,
>> so many Tcl/Tk programs run with no modification under JTcl/Swank.
>
>Thats interresting to note, thanks!
>Is there support for tests in Jtcl? Could be a good substitute for Junit...
>And are there plans to implement XOTcl or TclOO?


Yes, the 'tcltest' package is supported.  JTcl uses the Tcl test suite from 
Tcl 8.4 to ensure command compliance.  JTcl invokes the test suite from 
Junit, to allow "Java friendly" development.  Of course you can use
tcltest stand alone, just the same as you would with C/Tcl.

We don't have any immediate plans for supporting XOTcl or TclOO, mostly due
to the small team working on JTcl and limited amount of time we have.  We are
happy to provide commit access to anyone who would like to work on these or
other extensions.

-Tom

--
Tom Poindexter
tpoindex@nyx.net
0
tpoindex1 (87)
5/29/2013 2:10:42 PM
get rid of java c++ part

0
5/29/2013 7:06:28 PM
johannes falcone wrote:
> get rid of java c++ part
> 
Don't hit the booze so hard ?

uwe
0
uwe6118 (423)
5/29/2013 8:46:21 PM
Reply:

Similar Artilces:

Tcl to C or C++
Hi all, does anyone know some tool (free or not) capable to translate Tcl source code to C or C++? Of course I believe to translate only a subset of Tcl language (1), while statements like this: #...some code that algorithmically generate the string a, where a is # almost-arbitrary code eval $a cannot be translated at all, except with somewhat complex solutions! Thank you (1) I'm thinking to traslate Tcl source code written using a subset of Tcl keywords and by following some coding rules; for example I'd avoid this: #...some code that calculates a and b set $a$b 0 Stefano Chia...

Extending TCL in C with tcl.h - Disabliing [<tcl-cmd>] feature
Hi, TCL has a command execution syntax like this: [<tcl cmd>] Anything inside the 3rd bracket will be executed as a Tcl command by the Tcl interprater. Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]? In other words, my Tcl interprator should print "[32]" for tcl command puts "[32]" It should not try to treat [] as a special character. Is this any way possible while extending Tcl in C with tcl.h? Thank you, Arijit * arijit79@gmail.com | puts "[32]" | | It should not try to treat [] as a special character. Check out the TCL quoting rules. http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M10 http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M15 Any of puts {[32]} puts "\[32\]" will do the trick. R' On May 8, 3:14 am, ariji...@gmail.com wrote: > Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]? By doing this, you would disable the primary functionality of Tcl. I'm certain you could go into the tcl source and stop it - but why not talk about what you are really trying to do. Perhaps someone can give you a better way of doing what you are wanting to do. ...

tcl as library of c/c++/java program
Hi, All tcl books I know talking how tcl can dynamically load c library. Is any source out there talking about WHO A C/C++/JAVA PROGRAM TO USE TCL AS LIBRARY? Thank, alex "tak" <tak416@yahoo.com> wrote > All tcl books I know talking how tcl can dynamically load c library. > Is any source out there talking about WHO A C/C++/JAVA > PROGRAM TO USE TCL AS LIBRARY? Start with http://phaseit.net/claird/comp.lang.tcl/HowToC.html but some people think that you can choose a better overall architecture. http://mini.net/tcl/9303 If you choose to use Tcl libraries "the o...

Tcl Book that explains tcl C API?
Hi! I am looking for material that explains the tcl C API in order to: - Embed Tcl into a C application. - Extend Tcl to add new commands in C. Does Tcl and Tk Toolkit (2nd Edition) by Ken Jones and John Ousterhout do a good job explain these topics in depth? Thanks! Asif wrote: > Hi! > > I am looking for material that explains the tcl C API in order to: > > - Embed Tcl into a C application. > - Extend Tcl to add new commands in C. > > Does Tcl and Tk Toolkit (2nd Edition) by Ken Jones and John Ousterhout do > a good job explain these topics in depth? > ...

C++/Tcl/C++ Interface
Hi, I'm a newbie in Tcl and Tcl/C++ interfacing. I need to develop a prototype for one of our upcoming project. I've a shared library which provides Tcl procedures to traverse through some graph which is being created upon reading a file of specific format. If I load this shared library in Tcl shell and call those proc to read the specific file and traverse the graph. Graph traversal proc are like: * getting neighbor nodes of a given node * getting the node name and edge names to/from a node Let's name this Tcl library GL (graph lib). Now, in my C++ program I need cre...

how to debug tcl running under tcl interep in C++ exe
Hi: I have a C++ exe, which has a tcl interep and loads some tcl files. The exe throws a tcl shell to user where user enters tcl scripts. I want to debug the tcl files while these exe runs. Is there any way/debugger to do this? Regards --Sourav Sourav Sircar schrieb: > Hi: > I have a C++ exe, which has a tcl interep and loads some tcl files. > The exe throws a tcl shell to user where user enters tcl scripts. > I want to debug the tcl files while these exe runs. Is there any > way/debugger to do this? > Regards > --Sourav You could probably load the comm packa...

In Tcl and C++ code, how to use Tcl Command, such as exit?
In my code, i used Tcl_SetStdChannel(0, STDIN) and a thread to control all input and output from Tcl, but i want to use some of Tcl' Commands, such as, exit. I used Tcl_Eval() then, but the Tcl command seem invisible in my code, I typed a string in command prompt, such as "AAAAA", and Enter, got nothing feedback. How can i do to get these Tcl Commands work? Thanx! vian1381@china.com.cn wrote: > In my code, i used Tcl_SetStdChannel(0, STDIN) and a thread to control > all input and output from Tcl, but i want to use some of Tcl' Commands, > such as, exit. > &g...

Remembering Tcl: Problems with C and Tcl communicated via pipelines
I am now remembering TCL and I have came across with a problem when doing something I used to do. My purpose is to implement a console-like GUI to present in a listbox outputs from another program written in c and allow to command orders via an entry. All the communication between both programs will be via pipeline As a first approximation, I tried several easy examples and I get stucked with these two programs (see below). When executing tclprogram2.tcl I get Done1 and Done2 and nothing more: i must end it with Ctrl-C. However, if I change Hello3 lines before for loop, the program run smoo...

adding events to tcl queue, or using variables and traces (C and TCL)
I'm writing simple testing framework for embedded application. The application is written on C language and runs on microchip PIC microcontroller normally. To test application I made the following: * hardware depended code was picked out from main source and written to separate source files (module_hal.c for example); * two build mode for program: for microchip PIC, using *_hal.c files dealing with real hardware, or for PC, where *_hal.c files contain hardware simulation code and bindings to TCL-commands. Then program was build for PC, I can using TCL commands change input signal st...

How does the Tcl interpret handle results returned from C-created Tcl commands ?
I've ventured on creating a Tcl command trough a C routine. I've followed the manual guidelines. My C routine checks the validity of a selected option for the currently displayed histogram. Therefore it returns a Boolean value that, according to the C <-> Tcl communucation protocol, I have encoded as TCL_ERROR (= FALSE) and TCL_OK (TRUE). WHenthis command is called in a Tcl proc, the interpreter is supposed to perform two different actions according to the returned Boolean value. How can I fetch this returned Boolean result (TCL_ERROR/ TCL_OK) from the Tcl proc that executes the C-created command ? What if I wrote 1 (FALSE) or 0 (TRUE) in a string and have the C routine return this 1-character string ? Would it be easier to get the result of the teest from the caling TCL proc ? Please, find in the following the code that implements (according to my best resolution) the C-created command and the callind Tcl proc. Thank you, Maura ************************************************************************************************************* * C routine * ************************************************************************************************************* static int check_hist_aint_option_cb( ClientData clientData, Tcl_Interp *interp, int argc, char *argv[] ) { int i; if ( hg.active_ &...

TCL C API: receiving command from a script or from tcl command line ?
Hello, TCL allows to run commands from commandl line or from within a script file thanks to the command "source filename". I used TCL C API to embed my own commands. My question is : from my own commands, how can I know whether it was called from the script or directly from the shell ? Thanks, Fabrice Hi Fabrice, "fabrice" writes: > I used TCL C API to embed my own commands. My question is : from my > own commands, how can I know whether it was called from the script > or directly from the shell ? You can look at the variable tcl_interactive to distinguish...

tcl-to-c?
are there any program to translate tcl code to c or c++ that works? SaToNiO schrieb: > are there any program to translate tcl code to c or c++ that works? > Tcl_Eval() is one thing (although probably not what you are thinking about), there are others... But what do you really want to achieve by translation to c? Michael In article <1161209932.178803.193640@f16g2000cwb.googlegroups.com>, SaToNiO <SaToNiO@gmail.com> wrote: >are there any program to translate tcl code to c or c++ that works? Good news. Depending on what you want, it's already been done! (Depending ...

TCL +C
Hi guys i want to emped some c code to use it in tcl , i have found this article which takes about that http://wiki.tcl.tk/11153. i tried to compile this simple example but i failed to do that. how swig are used to compile this code. or how this code can be compiled . Another thing i want to ask about is how can i run tcl proccess as external procces. i am compiling this code using the following gcc -shared -DUSE_TCL_STUBS hello.c -o ibhello.so -ltclstub8.4 the compiler give me an error cannot find ltclstub8.4 What is this libray and how can i locate it > the compiler give me an error...

TCL C++
Okay I am kinda inbetween groups here. I am curious on if/how I could use TCL/TK commands in C++ so I can create a gui. "Richard Seguin" <seguinr@sympatico.ca> wrote in news:Y5Spd.75126$Le1.1561474@news20.bellglobal.com: > Okay I am kinda inbetween groups here. > > I am curious on if/how I could use TCL/TK commands in C++ so I can > create a gui. > > jim wrote: hi richard- here are some options for you: 1) use python + tkinter for a gui (still object oriented) 2) use python + wxwidgets/python 3) tcl/tk for gui and call c/c++ functions or objects if...

running other tcl from a tcl
Is that possible? 1 - sequentially to call two tcl files, like: c:\> tclkit-8.4.7.exe first.tcl second.tcl 2 - from a tcl to call other one # first.tcl content below exec hello.tcl # end regards, mauro ps.: I'm not experience in Tcl. Mauro Silva wrote: > Is that possible? > > 1 - sequentially to call two tcl files, like: > > c:\> tclkit-8.4.7.exe first.tcl second.tcl > > 2 - from a tcl to call other one > > # first.tcl content below > > exec hello.tcl > > # end > > regards, > m...

Tcl and C#?
Is it possible to let Tcl and C# (.NET Framework) work together? Thanks. Guy Guy Dillen wrote: > Is it possible to let Tcl and C# (.NET Framework) work together? What sort of "work together" do you hope to accomplish? Tcl has a number of ways of serving as "glue" with other software. Are you really asking whether there is a way to translate Tcl programs into CLR bytecodes? -- | Don Porter Mathematical and Computational Sciences Division | | donald.porter@nist.gov Information Technology Laboratory | | http://math.nist.gov/~DPorter/ ...

tcl-gaul: Genetic Algorithms for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-gaul Tcl-gaul is a Tcl extension for genetic/evolutionary algorithm processing.It relies on the GAUL library: http://gaul.sourceforge.net/ * A genetic algorithm (GA) is a search technique used in computing to find exact or approximate solutions to optimization and search problems. Genetic algorithms are categorized as global search heuristics. They are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover. For ...

Tcl with C#
Hello, I am very new to Tcl and C#/.net. I have a gui written in Tcl its a stand alone program. I want to write a C# application wich would be calling this Tcl GUI. I tried using the code http://wiki.tcl.tk/9563, and it seems to not work. I am looking for ideas, as to how I can accomplish this, I would appreciate any suggestions. Thanks, ...

Tcl and C++
Hi, have somebody experience writing C++ source code for Tcl? I used over the years to write my application in C and would like to have at least new source code written in C++. It makes for me the life easier, but would like to know, if somebody has experienced doing this and if is it a benifet or not? regards khamis -- Try Code-Navigator on http://www.codenav.com a source code navigating, analysis and developing tool. It supports almost all languages on the scope. In article <ci4psn$nbe$02$1@news.t-online.com>, Khamis Abuelkomboz wrote: > Hi, Hi too, > have somebody ex...

C,, C++, Java, C#
I come from C,C++,Java and C#. What can SmallTalk do for me and for what cost? Regarding the Squeak thing, it's interesting though confusing. Is it an IDE? Why are the menus so wacky? "DM McGowan II" <nospam@nospam.net> wrote in message news:PLednX2vnLd11IncRVn-rA@comcast.com... > I come from C,C++,Java and C#. What can SmallTalk do for me ...? Ask not what Smalltalk can do for, but what can you do with Smalltalk. :-) In very few words, it significantly reduces time to market, while enhancig the development experience. This is because: 1. It manages the memory for you, so you don't have to allocate/deallocate all the time (the source of some of the most nasty bugs in C). Java and C# learnt that feature from ST. 2. It has single inheritance. 3. All the development is in a single file, called the image, so you don't have to fish for where did you put that missing class. Yet, you don't have to go through thousands of lines of code to find the method you wrote three months ago. 4. It's the language for which it's easier to work within the Agile methodologies. 5. It's strongly typed without being unnecessarily redundant. 6. It's "wacky" interface releases you from the need to use curlys. 7. It comes with a huge library, so you don't need to reinvent the wheel as much. 8. It's debugger is highly integrated and friendly, so the experience of findin...

l'C program executing from a tcl script with pipe opened using open command in Tcl
Hi all, I wanted to communicate with a C program from a Tcl script.. The test code i have written is below Both the 'C' program and Tcl script are located in the same directory. The 'C' program is below. I have named it CTCL.C #include<stdio.h> #include<string.h> int main() { int i; char c[30]; printf("Reading..."); scanf("%s",c); printf("String read is :%s\n",c); fflush(stdout); return 0; } I have compiled the program with the command cc CTCL.C -o ctcl So the executable was generated with the name 'ctcl' The Tcl script...

Writing new tcl command using c or c++?
Can anyone help me to write new command that can be used in tcl shell using c or c++ code. Himanshu Gupta <himanshulkce@gmail.com> wrote: > Can anyone help me to write new command that can be used in tcl shell > using c or c++ code. Start here: http://wiki.tcl.tk/9849 and here: http://wiki.tcl.tk/21007, read these and then follow and read the links to the other pages from the above two. On Monday, 5 January 2015 14:12:44 UTC+5:30, Himanshu Gupta wrote: > Can anyone help me to write new command that can be used in tcl shell using c or c++ code. Thankyou... On M...

Accessing C/C++ variables both local and global from TCL
I would like to have real-time access to any and all variables in C/C++ programs. Is there anything that can help me out other than modifying the C/C++ code themselves ? thanks for help Mel wrote: > I would like to have real-time access to any and all variables in C/C++ > programs. Is there anything that can help me out other than modifying the > C/C++ code themselves ? > > thanks for help > What do you want to do? Eckhard "Eckhard Lehmann" <ecky-l@web.de> wrote in message news:434befd9$0$28967$9b622d9e@news.freenet.de... > Mel wrote: >> I...

Why are the advantages of TCL for testing instead of standard C or C++?
I am developing software for a microcontroller. It has a LAN connection. I want to test the microcontroller via a standard PC. I have planed to write my test in "C" but what are the advantages of writing the test in TCL compared with "C" or "C++" ? Gerald Maher wrote: > I am developing software for a microcontroller. It has a LAN > connection. I want to test the microcontroller via a standard PC. I > have planed to write my test in "C" but what are the advantages of > writing the test in TCL compared with "C" or "C++" ? ...

Web resources about - TCL/TCL combined with Java/C/C++, Any Recommendations? - comp.lang.tcl

Implementing Recommendations of the 9/11 Commission Act of 2007 - Wikipedia, the free encyclopedia
Passed the House on January 9, 2007 (299-128 Roll call vote 015 , via Clerk.House.gov) Reported by the joint conference committee on July 25, ...

OK.com Helps Facebook Users Tap Friends, Family For Age-Appropriate Movie Recommendations
Facebook users are more likely to trust their friends when it comes to movie recommendations , and Deseret Digital Media saw an opportunity in ...

Under the Hood: Building the App Center recommendation engine - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Under the Hood: Building the App Center recommendation engine geschrieben. Du kannst den vollständigen ...

Recommendations Box - Facebook-Entwickler
The Recommendations Box shows personalized recommendations to your users. Since the content is hoste...

Recommendations
TripAdvisor today expanded the personalization of its travel site to highlight reviews from friends of users’ Facebook friends. When people ...

Zacks Investment Research - Proven Stock Ratings Research Recommendations
Zacks is the leading investment research firm focusing on equities earnings estimates and stock analysis for the individual investor, including ...

foursquare : With foursquare deemphasizing the checkin in v5.0, are the explore recommendations going ...
Answer (1 of 4): I guess there's another way of looking at it. They're trying to make you feel less pressured to check-in and spend more time ...

App Store - BuddyTV Guide: TV guide, recommendations & remote control
Read reviews, get customer ratings, see screenshots, and learn more about BuddyTV Guide: TV guide, recommendations & remote control on the App ...

The Grizzly Labs Launches Pyfl Business Recommendation App
The Grizzly Labs has announced the release of Pyfl (Places Your Friends Like), its venue recommendation app on iOS and Android. Pyfl allows users ...

The clever way Netflix’s recommendation algorithm keeps viewers addicted
While Netflix was once synonymous for shipping boatloads of DVDs by mail, Netflix today is primarily a streaming-based company with two primary ...

Resources last updated: 3/10/2016 1:21:25 PM