Little C personal utilities

This is a discussion on Little C personal utilities within the General Discussions forums, part of the Community Boards category; I can read and interpret and use regular expressions as long as it is with the syntax defined by formal ...

  1. #16
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    I can read and interpret and use regular expressions as long as it is with the syntax defined by formal language theory.

    Once I see a regular expression using some other syntax, such as that of Perl, my brain shuts off and dies.

    My professor taught us regular expressions under the context of formal language theory, and we implemented them with C++ using a syntax similar to what was used in class, but we never got into the popular Perl syntax for regular expressions.
    My Website

    "Circular logic is good because it is."

  2. #17
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    The perl regex is where the real fun is.

    I tend to write a lot of one off or small utilities. Hardly any of them are in C or C++. I prefer using scripting languages that get up and running faster. For those the development + execution times need to be better than just doing it manually.

  3. #18
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,412
    Must say that Boost.Xpressive and other little nothings like Boost.Program_options pretty much displaced any chance I will gain an interest on Perl. Maybe if I get more into Systems Administration, I will find a good use for it.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  4. #19
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    I really like Perl for writing small little useful applications, but I use Python for that too (and occasionally C and C++). Recently I've written a few bash scripts, but it just seems like a constrained version of Perl to me. I have dozens of these programs in my ~/bin directory. chwinmod.sh, wrappy.py, memcheck, gmount, duhl, ls-dirs.sh ... the list goes on.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #20
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by DavidP View Post
    I can read and interpret and use regular expressions as long as it is with the syntax defined by formal language theory.

    Once I see a regular expression using some other syntax, such as that of Perl, my brain shuts off and dies.
    After looking at the article, I would say that perl does use that syntax. Like, irrefutably. Everything listed there is valid in perl except for the POSIX section.

    However, perl also expands upon this greatly, which may explain your confusion.
    Last edited by MK27; 09-23-2009 at 06:26 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  6. #21
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Quote Originally Posted by brewbuck View Post
    Anything to do with text processing that does not have the "blazingly fast" requirement, I do in Perl or Python. Text processing in C is just masochism.
    Not with Lex it isn't

  7. #22
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,235
    Quote Originally Posted by zacs7 View Post
    Not with Lex it isn't
    Perl's regular expressions are about as fast as lex/flex. In many common text processing tasks most of the work can be done by regexes, and these tasks are reasonably fast in Perl. But if the data processing dominates the complexity, a C solution will probably outperform. But I question if the effort is worth it for a one-off utility that might run for one or two minutes then never be used again.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  8. #23
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    All this reinventing of the wheel.

    Sigh, if only there was some way to collect all these utilities (in a uniform language) and present a standard way of interacting with them...

  9. #24
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,412
    Quote Originally Posted by zacs7 View Post
    Sigh, if only there was some way to collect all these utilities (in a uniform language) and present a standard way of interacting with them...
    Hehe. That's Perl.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  10. #25
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Interestingly, one little personal tool I wrote eventually grew to be the largest application I've ever written. It was related to reverse engineering and documenting and analyzing structures/classes in memory.
    "The Internet treats censorship as damage and routes around it." - John Gilmore

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New personal record
    By VirtualAce in forum Windows Programming
    Replies: 2
    Last Post: 04-10-2005, 08:21 PM
  2. Replies: 6
    Last Post: 02-01-2005, 08:41 AM
  3. Personal messages disabled temporarily
    By webmaster in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-11-2001, 06:25 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21