Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 28 Aug 2015, 10:46
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
mawk, the fastest computer language around...
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [10 Posts]  
Author Message
musher0


Joined: 04 Jan 2009
Posts: 5766
Location: Gatineau (Qc), Canada

PostPosted: Sat 07 Feb 2015, 20:57    Post subject:  mawk, the fastest computer language around...
Subject description: Now available to Puppyists
 

Hello, Puppyists.

According to http://awk.info/?doc/news/mawkIsFast.html, mawk is faster than C,
C++, Java, Perl, Ruby,.. They say it's the fastest computer language around. Now
that's pretty enormous to say, but the people at awk.info seem to be able to back
it up: they have test benches showing that mawk can handle large bundles of data
fast and splendidly.

I for one feel that mawk is faster than both nawk and gawk, but it's an impression
rather than a fact. I'm too busy writing Puppy scripts these days to pause and
validate that statement. Very Happy However those of my bash scripts that contain awk
lines or statements do feel speedier running with mawk.

So here : mawk-1.3.4_6Dec14.pet, fresh from my workbench, just compiled on/for
Puppy Slacko-6.0b : http://tinyurl.com/l977qfp.

I realize that gawk is present on all Puppies. However it is not known for its speed,
and some believe that it is not a real awk in the sense that it has "proprietary"
commands not found on run-of-the-mill awks. gawk is also mammoth-sized (over
400k) compared to mawk's 160k.

This package includes a pdf on mawk to get you started. There are of course
numerous resources on-line for awk generally. This search
http://www.ask.com/web?qsrc=1&o=0&l=dir&q=awk+computer+language&qo=serpSearchTopBox
should provide a good jumping board for anyone interested in the awk language.

As for me, I like awk because
    * its logic is not foreign to my regular thinking as a language worker (which
    __ I am by trade);
    * anyone with a minimum of logic can understand its basic concept of line and
    __ column or record and field processing;
    * it's not cryptic or "savant"; and
    * it interfaces wonderfully with the bash script language we have on Puppy.

Enjoy!

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Sun 19 Apr 2015, 15:04; edited 4 times in total
Back to top
View user's profile Send private message Visit poster's website 
slavvo67

Joined: 12 Oct 2012
Posts: 721
Location: The other Mr. 305

PostPosted: Sat 07 Feb 2015, 21:32    Post subject:  

Musher0:

I'm jumping in to play. Do you have any sample scripts to get me started?

Best,

Slavvo67
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5766
Location: Gatineau (Qc), Canada

PostPosted: Sun 08 Feb 2015, 00:15    Post subject:  

Hello, slavvo67

Here is my series of opera bookmarks for awk.
You'll find in there four references to awk one-liners.
Try some? Smile

BFN.

musher0
awk.html.zip
Description 
zip

 Download 
Filename  awk.html.zip 
Filesize  2.98 KB 
Downloaded  93 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
slavvo67

Joined: 12 Oct 2012
Posts: 721
Location: The other Mr. 305

PostPosted: Sat 14 Feb 2015, 14:18    Post subject:  

I guess the real issue here is how to use mawk as more than just an awk substitute. If it's speed is really that fast, it would be great if there was a way to use it beyond the typical awk type uses.
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5766
Location: Gatineau (Qc), Canada

PostPosted: Sat 14 Feb 2015, 16:35    Post subject:  

Hi, slavvo67.

The answer is yes and no. Certainly we should try to write and run complete awk
program with mawk, but I won't snub the use of the occasional (m)awk sub-routine
within an ash or bash script.

I mention ash because it executes scripts +/- 150 % faster than bash. ash+mawk
seem to be a winning combination if we're considering speed. However, ash has a
more limited set of commands than bash.

One can search the difference between ash and bash to his/her heart's content Smile
via
http://www.info.com/searchw?qkw=diference+between+ash+and+bash&qcat=web&q=&qhqn=&KW=

Come to think of it, if you are bringing up the question, maybe it's because you
already have some awk programs you'd like to share ? Smile

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
slavvo67

Joined: 12 Oct 2012
Posts: 721
Location: The other Mr. 305

PostPosted: Sat 14 Feb 2015, 22:33    Post subject:  

I respect that Ash comment. Were you the one that first noticed that speed difference? It's quite substantial depending on the script. Now you did it... you have me digging through my old scripts seeking some of my better uses of awk. Funny on how many use sed and grep and how few actually use awk. That said, I think awk's a great tool for the right purpose. Here's one but it's not mine. INSTADONE.txt is the name of my original text file so that would be replaced with whatever text file you have. INSTADONE1.txt is just a temporary so it could be named anything, really.

The below removes dupe lines from a text file, and if I recall correctly; they don't need to be next to each other for it to work.

awk '!x[$0]++' INSTADONE.txt >INSTADONE1.txt
mv INSTADONE1.txt INSTADONE.txt
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5766
Location: Gatineau (Qc), Canada

PostPosted: Sun 15 Feb 2015, 08:38    Post subject:  

slavvo67 wrote:
(...) Now you did it... you have me digging through my old scripts seeking some of my better uses of awk. (...)


Haha ! Smile The cat's out of the bag! Smile I knew it! Smile

Ok, folks: we have a awk programmer amongst us! Wink
He just has to brush some dust off his stuff! Smile

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
8-bit


Joined: 03 Apr 2007
Posts: 3427
Location: Oregon

PostPosted: Mon 16 Feb 2015, 19:16    Post subject:  

Somewhere along the line of downloading mawk, I got connected to a site called marriage chat with the picture of a young lady and a chat window with the line "Why don't you join now?"
Not what I was expecting.
I will have to check out the mawk programming language though.
Back to top
View user's profile Send private message 
slavvo67

Joined: 12 Oct 2012
Posts: 721
Location: The other Mr. 305

PostPosted: Mon 16 Feb 2015, 22:36    Post subject:  

So you tested Mawk and got married! What a day! LOL
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5766
Location: Gatineau (Qc), Canada

PostPosted: Mon 16 Feb 2015, 23:44    Post subject:  

slavvo67 wrote:
So you tested Mawk and got married! What a day! LOL


Yeah, 8-bit, you must be exhausted! Smile

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [10 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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 can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1758s ][ Queries: 12 (0.0125s) ][ GZIP on ]