comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: The state of functional programming
Date: Fri, 30 Jul 2010 11:29:31 +0200
Date: 2010-07-30T11:29:31+02:00	[thread overview]
Message-ID: <nc2l5qwigc3k.jfz7etce87m2$.dlg@40tude.net> (raw)
In-Reply-To: 8bfjlaFemlU1@mid.individual.net

On Fri, 30 Jul 2010 12:17:29 +0300, Niklas Holsti wrote:

> Dmitry A. Kazakov wrote:
>> On Thu, 29 Jul 2010 21:01:35 +0000 (UTC), Warren wrote:
>> 
>>> Dmitry A. Kazakov expounded in
>>> news:17hhchqy1a2si.1akul43vk1sd9.dlg@40tude.net: 
>>>
>>>> On Thu, 29 Jul 2010 19:19:49 +0000 (UTC), Warren wrote:
>> 
>>>>> But FP cannot always solve that "problem".
>>>> Same in Ada. Not every legal Ada program is compilable. 
>>> If an Ada program doesn't compile, then the programmer
>>> hasn't spelled out the "how" correctly has he?  
>> 
>>    X : constant := 2**(2**(2**(2**9999_9999))) + 1:
>> 
>> is pretty much clear "how", legal, but not compilable.
> 
> ... because the binary representation of the value of X needs too many 
> bits, you mean? But I don't think that a compiler is required to 
> represent the value in binary form *at compile time*; it could use a 
> formulaic representation, which needs only a small amount of memory, as 
> shown by your source line. Depending on how X is used in the rest of the 
> program, this could make it possible to compile the program.

Yes, but you cannot find a representation which would work for any legal
expression. I.e. whatever representation the compiler uses, it is always
possible to write a legal program that would break it. E.g:

    X : constant := 2**(3**(2**(3**9999_9999))) + 1:
    Y : constant := 3**(2**(5**(2**8999_9979))) - 1:
    C : constant Boolean := X > Y;

> Of course I agree that a normal Ada compiler will not be able to compile 
> such things.

The above expression is supposed to break representations used by "normal
compilers".

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2010-07-30  9:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2adc4d8d-210e-429c-8188-9b1e99c2718e@d17g2000yqb.googlegroups.com>
2010-07-28 16:16 ` The state of functional programming Georg Bauhaus
2010-07-28 19:37   ` Kulin Remailer
2010-07-28 23:34     ` deadlyhead
2010-07-28 16:31 ` Jeffrey R. Carter
2010-07-28 23:35   ` J.s
2010-07-28 16:40 ` Dmitry A. Kazakov
2010-07-28 17:47   ` (see below)
2010-07-28 18:40     ` Dmitry A. Kazakov
2010-08-03  3:15     ` Randy Brukardt
2010-08-03 13:57       ` (see below)
2010-07-28 19:09   ` Warren
2010-07-28 19:35     ` Dmitry A. Kazakov
2010-07-29 15:20       ` Warren
2010-07-29 17:00         ` Dmitry A. Kazakov
2010-07-29 19:19           ` Warren
2010-07-29 20:40             ` Dmitry A. Kazakov
2010-07-29 21:01               ` Warren
2010-07-29 23:09                 ` Georg Bauhaus
2010-07-30  8:50                 ` Dmitry A. Kazakov
2010-07-30  9:17                   ` Niklas Holsti
2010-07-30  9:29                     ` Dmitry A. Kazakov [this message]
2010-07-29 20:46             ` Niklas Holsti
2010-07-30 13:52               ` Warren
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox