AdeptLanguage / Adept

The Adept Programming Language
GNU General Public License v3.0
119 stars 9 forks source link

Please translate `inttypes.h` #276

Closed ghost closed 8 months ago

ghost commented 8 months ago

It will help translating C headers easier.

IsaacShelton commented 8 months ago

It would be nice to have, but only really the int types have an equivalent. For the PRI and SCN macros there is no equivalent way since they use raw text substitution and side-by-side string concatenation, although maybe they could be translated as c-string literals or something

ghost commented 8 months ago

@IsaacShelton Rust have macros, as powerful as the C/C++ ones! Text substitution is not something that bad. It helps generating of code at compile time and thus we can do automated code generation in some extent. Why are you so against it?

ghost commented 8 months ago

This is how they do it in Vala:

stdout.printf ("%" + uint64.FORMAT + "\n", my_uint64_var);

https://valadoc.org/glib-2.0/uint64.html

IsaacShelton commented 8 months ago

Correct me if I'm wrong, but Rust only has lexical macros.

Ideally we wouldn't have to rely on macros for format strings though. Also it changes based on what you link against, which Adept does not control if you link manually.