I have been using TAWK frequently, it is an absolutely great compiler
which allowed me to create powerful and efficient programs within a
limited amount of time. I am working with version 4.1a (in DOS), but I
never had the opportunity to work with version 5, as Thompson stopped
selling it. I created a program which in itself works fine in 4.1a, but
it needs a lot of memory and processing power. I applied compressing
techniques to minimize the amount of memory needed. I wondered whether
there is a big difference in memory management and speed between
version 4 and 5. If so, I would like to know how I could get my hands
on version 5. As an alternative, I could port the program to Java,
which may make the program faster than TAWK, but that would need a lot
of time and I would like to continue easily updating my program, which
is one of those great features of TAWK.
Any suggestions ?
Kind regards,
Tom Vanallemeersch
Yes. The DOS version of TAWK 4 was built with a 16-bit DOS extender, 5 with
a 32-bit DOS extender.
A program like this (which does nothing useful but test for limits):
BEGIN {
local i
local test
for ( i = 1; i < 1000000; i++ ) {
test[ "NDX1" ] = ".T."
test[ "NDX2" ] = ".F."
if ( !(i/1000) )
print i
}
}
fails with an internal TAWK error in V4 somewhere between i=32000 and
i=33000 (perhaps 32768? - I didn't check in more detail). I don't know how
high V5 is willing to go with this test program, as I got bored waiting for
a failure.
Which doesn't mean the limit of a V4 array is 32000+. Using a different
allocation scheme a test program similar to the one above ran until a
"memory full" error. Not sure why it said that, as I expected paging to
occur (and maybe it did, to the small RAM drive the test was running out
of).
I can't tell you how to acquire a copy of V5, though.
Anton Treuenfels
Can you buy a copy somewhere?
Allan
"Anton Treuenfels" <atreu...@earthlink.net> wrote in message
news:_1nsf.1230$M%4....@newsread3.news.atl.earthlink.net...
Can you buy a copy somewhere?
Allan
"Anton Treuenfels" <atreu...@earthlink.net> wrote in message
news:_1nsf.1230$M%4....@newsread3.news.atl.earthlink.net...
>
Can you buy a copy somewhere?
Allan
"Anton Treuenfels" <atreu...@earthlink.net> wrote in message
news:_1nsf.1230$M%4....@newsread3.news.atl.earthlink.net...
>
Regards
Rex
BEGIN {
local i
local test
starting_time = time()
for ( i = 1; i < 100000000; i++ ) {
test[ i ] = "time in seconds " time()-starting_time
if ( !(i%100000) ) {print "test["i"]="test[i] }
}
}
c:\u\awk>awkw -f test.awk
test[100000]=time in seconds 1
test[200000]=time in seconds 2
test[300000]=time in seconds 3
test[400000]=time in seconds 4
test[500000]=time in seconds 5
test[600000]=time in seconds 6
...
test[5100000]=time in seconds 421
test[5200000]=time in seconds 436
test[5300000]=time in seconds 449
test[5400000]=time in seconds 463
test[5500000]=time in seconds 479
test[5600000]=time in seconds 488
test[5700000]=time in seconds 541
test[5800000]=time in seconds 597
awk: program aborted by SIGINT signal
c:\u\awk>
As most ppl on this ng know, I use TAWK daily (under both Windows and
Unix) and I am always glad to discuss it here.
You are right that the status of the software is in limbo at the
moment. Selling an existing copy is probably legal and you might even
find a copy at a flea market or similar, but, of course, making copies
is not. The first step to rectifying this situation would be to find
Mr. Thompson and get him to discuss it. He has posted to this ng in the
(distant) past, but as far as anyone can tell at the moment, he is lost
somewhere in the wilds of Thailand.
hmm, ya know, looking at this again makes me think I should have put it like
this:
BEGIN {
local i
local test
for ( i = 1; i < 1000000; i++ ) {
test[ i ][ "NDX1" ] = ".T."
test[ i ][ "NDX2" ] = ".F."
if ( !(i/1000) )
print i
}
}
Forces creation of a somewhat larger array, methinks!
The original point still holds. What I was testing for specifically here was
making all the array elements point to the same constant literal strings,
and this fails relatively quickly in TAWK V4.
But because elements of TAWK arrays can be other arrays, it is possible to
allocate like this:
local function makeone() {
local temp
temp[ "NDX1" ] = ".T."
temp[ "NDX2" ] = ".F."
return( temp )
}
BEGIN {
local i
local test
for ( i = 1; i <= 10^7; i++ ) {
test[ i ] = makeone()
if ( !(i/10000) )
print i
}
}
This runs until "memory full" in TAWK V4. And I suspect either version runs
as long as anyone cares to watch in V5.
Yes :)
> I would love to have other Tawk users to chat
Fine with me. It'd be nice to ask questions about things that aren't in the
manuals.
F'rinstance:
local function ret_array(this) {
this[ "ANY_OLD_INDEX" ] = ".T."
}
local function ret_string(this) {
this = ".T."
}
BEGIN {
local temp1, temp2
ret_array( temp1 )
ret_str( temp2 )
}
Now, "ret_array()" works but "ret_str()" doesn't. Since there is no
initialization of "temp1" or "temp2", I assume they have type
"unintialized". So why am I allowed to implicitly change the type of "temp1"
to "array" within a called function but not that of "temp2" to "string"?
In practice I use functions similar to "ret_array()" quite a bit, returning
actual results in the passed variable and a success or failure boolean value
as the function return value, which I can directly test in a conditional
expression.
Sometimes I'd like to do something similar with a scalar variable, but
because I can't I have to use special values assigned to the returned scalar
to indicate failure (or use a global error variable, I suppose).
Just asking :)
Anton Treuenfels
Are you familiar with "ref" parameters?
I sent an email to Pat Thompson a while ago through his website
address, and he actually answered me a week ago. He even provided me
with a copy of version 5. He seems to be back from Thailand (by the
way, if you have the opportunity to visit this country, go ahead, it's
a fascinating mix of great culture, food and nature !) I am very happy
to use version 5 now instead of 4, as it doubles the speed at which my
program runs !
Regards,
Tom
Kenny McCormack schreef:
Great news!!! We may get a Linux verison yet.