Printing floating points

Steven Schveighoffer schveiguy at gmail.com
Sat Jan 30 01:19:58 UTC 2021


On 1/28/21 1:21 AM, H. S. Teoh wrote:
> On Wed, Jan 27, 2021 at 10:18:58PM -0500, Steven Schveighoffer via Digitalmars-d wrote:
>> On 1/26/21 9:17 PM, H. S. Teoh wrote:
>>>
>>> If there was a way to make these tables pay-as-you-go, I'd vote for
>>> it.  Adding 104KB or 52KB even if the code never once formats a
>>> float, is not ideal, though granted, in this day and age of cheap,
>>> high-capacity RAM not really a big issue.
>>
>> There is a way -- dynamic libraries. It's how C does it.
> 
> That's total overkill for 100KB of data.

The idea is it would go into the phobos shared library, not a specific 
shared library just for floats.

> 
> 
>> But seriously, I can't imagine why we are concerned about 100KB of
>> code space. My vibe.d server is 80MB compiled (which I admit is a lot
>> more than I would like, but still). My phone has as much code space as
>> 100 computers from 10 years ago. Are you still using floppies to share
>> D code?
> [...]
> 
> It's not so much this specific 100KB that I'm concerned about; it's the
> general principle of pay-as-you-go.  You can have 100KB here and 50KB
> there and 70KB for something else, and pretty soon it adds up to
> something not so small. Individually they're not worth bothering with;
> together they can add quite a bit of bloat, which may be desirable to
> get rid of, for embedded applications say.

I get that there is a need for it in niche cases. But those are very 
niche, and I'd expect a custom runtime for them anyway.

But the solution to having code that is small is to use a shared library 
for the common code. This seems like a perfect fit for that.

-Steve


More information about the Digitalmars-d mailing list