|
|
Subscribe / Log in / New account

An interview with Larry Wall (LinuxVoice)

An interview with Larry Wall (LinuxVoice)

Posted Jul 19, 2015 9:11 UTC (Sun) by Wol (subscriber, #4433)
In reply to: An interview with Larry Wall (LinuxVoice) by raiph
Parent article: An interview with Larry Wall (LinuxVoice)

I can only talk really about Pr1me INFORMATION (and modern Picks seem to use floating to point to emulate fixed point :-( but ...

The Pr1me CPU was capable of doing BCD arithmetic, and had a load of microcode specifically to optimise all this sort of stuff. The Pick database was designed to store integers, and to store the mantissa in the data definition, not the data itself. As an example, let's store some price information in pounds in Pick - you'd put "199" in the data field, and "MD2" in the definition ("masked decimal 2"). That converts data at display time to 2dp, ie 1.99

So when you as the programmer are doing the maths, you have to be wary of multiplying MD-type fields, because MD2 * MD2 is, of course, MD4 and if you don't "correct" it to whatever datatype you're storing the result as, you can get some right funnies ...

Cheers,
Wol


to post comments

An interview with Larry Wall (LinuxVoice)

Posted Jul 19, 2015 22:43 UTC (Sun) by raiph (guest, #89283) [Link] (1 responses)

> store the mantissa in the data definition, not the data itself.
> you have to be wary of multiplying [such] fields

Gotchya.

Iirc pick doesn't have (much of) a type system and you're describing the kind of problem that type systems address.

I don't see a parallel with anything Perl 6 specific atm.

Thanks for following up. :)

An interview with Larry Wall (LinuxVoice)

Posted Jul 20, 2015 14:34 UTC (Mon) by Wol (subscriber, #4433) [Link]

Pick have a type system? You must be joking!!!

imho that is both a great strength, and a massive weakness. Everything is a string. Works great (it really does). But the fact that all of your definitions are DEscriptive, rather than PREscriptive, *can* (not *is*) be a nightmare when you really really want to be certain something is, say, a number.

But on the other hand, it does make it easy to store things like "dead" or "unknown" in an age field :-)

Cheers,
Wol


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds