Thread overview
Why do i need to import a freaking module to use int128?
Nov 27
ryuukk_
Nov 27
Kagamin
Nov 27
Sergey
Nov 27
IGotD-
Nov 27
Daniel N
November 27

Literally the worst idea ever, is this javascript?

Don't make people want to choose something else https://ziglang.org/documentation/master/#toc-Primitive-Types

A module for a database driver? yes

A module for abstracting networking? yes

A module for formatting text? yes

A module for primitive types? NO, stop everything you do and think about the purpose of your language

November 27

That's tame, I have a module that defines

/// Signed integer of pointer size
alias ptrdiff_t intp;
/// Unsigned integer of pointer size
alias size_t uintp;
/// Signed integer of byte size
alias byte tiny;
/// Unsigned integer of byte size
alias ubyte utiny;
November 27

On Monday, 27 November 2023 at 12:20:23 UTC, ryuukk_ wrote:

>

Literally the worst idea ever, is this javascript?

This is a new module. Some (quite short) time ago there was even no any support for i128.
And support of this type is quite new for all languages (not only for D): https://forums.swift.org/t/status-check-int128-uint128/67694

And I'm not sure this module should be imported for everyone by default. If it adds size into binary and some complexity into internals, while usage of i128 not so common..
So first of all - keep calm, add more technical knowledge, instead of impulsive ranting.

There is also BigInt which is usually going into a separate module in many languages.

But I agree that numeric types could be revisited and improved - probably into one module: Numerics with separate sub-modules (i128, f16, f8, BigInt, etc).

As I already mentioned in Discord half-float (bad name btw) which is usually called float16 was ready for merge - but then some strange comments for PR about process and other bs.. and the code just became abandoned and forgotten.

November 27

On Monday, 27 November 2023 at 12:20:23 UTC, ryuukk_ wrote:

>

Literally the worst idea ever, is this javascript?

Don't make people want to choose something else https://ziglang.org/documentation/master/#toc-Primitive-Types

A module for a database driver? yes

A module for abstracting networking? yes

A module for formatting text? yes

A module for primitive types? NO, stop everything you do and think about the purpose of your language

Question, because int128 is a library type, does it mean that the code is less optimized compared to if the int128 would be a built in type?

November 28
On 28/11/2023 1:54 AM, Sergey wrote:
> There is also BigInt which is usually going into a separate module in many languages.

Big integers require memory allocations. They are a completely unrelated in terms of implementation to 128bit integer types which can be implemented using pretty simple instructions comparatively.
November 27

On Monday, 27 November 2023 at 13:01:12 UTC, IGotD- wrote:

>

On Monday, 27 November 2023 at 12:20:23 UTC, ryuukk_ wrote:

>

Literally the worst idea ever, is this javascript?

Question, because int128 is a library type, does it mean that the code is less optimized compared to if the int128 would be a built in type?

In dmd maybe, but ldc/gdc can use native backend type, iirc.

November 27

On Monday, 27 November 2023 at 12:20:23 UTC, ryuukk_ wrote:

>

Literally the worst idea ever, is this javascript?

If you'd get IDE integration to auto import the module, I don't think it would be a problem, unless it is a forever one line module.

November 28
On 11/27/2023 4:54 AM, Sergey wrote:
> As I already mentioned in Discord half-float (bad name btw) which is usually called float16 was ready for merge - but then some strange comments for PR about process and other bs.. and the code just became abandoned and forgotten.

You can find halffloat here:

https://github.com/DigitalMars/sargon/blob/master/src/sargon/halffloat.d