From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,DATE_IN_PAST_24_48, FORGED_GMAIL_RCVD,FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d5b211b0c1ffcf3e X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.149.210 with SMTP id u18mr398533bkv.1.1339692891670; Thu, 14 Jun 2012 09:54:51 -0700 (PDT) Path: e27ni47945bkw.0!nntp.google.com!news1.google.com!postnews.google.com!eh4g2000vbb.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Practicalities of Ada for app development Date: Wed, 13 Jun 2012 05:57:18 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <79c5c9f7-4b72-4990-8961-b3e2db4db79b@qz1g2000pbc.googlegroups.com> <98ef69fe-f5af-485b-89b2-9358059f4582@googlegroups.com> <92d44fa9-03ac-4f3a-84ba-4c73bf59392b@re7g2000pbc.googlegroups.com> NNTP-Posting-Host: 195.182.34.254 Mime-Version: 1.0 X-Trace: posting.google.com 1339592343 28862 127.0.0.1 (13 Jun 2012 12:59:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 13 Jun 2012 12:59:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: eh4g2000vbb.googlegroups.com; posting-host=195.182.34.254; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-06-13T05:57:18-07:00 List-Id: On 13 Cze, 12:31, quiet_lad wrote: > How handle the strings without regex? I see you insist very much on having support for regexps, but there is something that bothers me about the way they are typically implemented. Programs that use regexps *usually* have them coded statically. The run-time loading of regexp patterns is very rare. The problem with static patterns is that they are anyway processed at run-time (they are somehow analyzed at runtime and some internal representation is *dynamically* created in memory that later helps in processing the subject strings), meaning that every time the program is run, the same "statically" coded pattern has to be analyzed and the structure has to be constructed from scratch. That is, there is some conceptual mismatch and potentially lost optimization opportunity, due to the fact that we go from something that is known statically to something that has a run-time nature. This is just counterproductive. I would rather ask about an external tool that can take my regexp pattern and generate the *static* code structure that processes input strings accordingly. Such a generated code can be then included in the final application just like IDL-generated serializers are used. The advanta of such approach is that there is no tradeoff between regexp analysis speed vs. string processing speed and there is no time wasted on analyzing the same pattern many times. In short: in a typical application (whether this is web service or something else) you don't need regexp support in the language; you need regexp processor code generator. -- Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com