frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Reverse Engineering Medium.com's Editor: How Copy, Paste, and Images Work

https://app.writtte.com/read/gP0H6W5
1•birdculture•11s ago•0 comments

Go 1.22, SQLite, and Next.js: The "Boring" Back End

https://mohammedeabdelaziz.github.io/articles/go-next-pt-2
1•mohammede•6m ago•0 comments

Laibach the Whistleblowers [video]

https://www.youtube.com/watch?v=c6Mx2mxpaCY
1•KnuthIsGod•7m ago•1 comments

I replaced the front page with AI slop and honestly it's an improvement

https://slop-news.pages.dev/slop-news
1•keepamovin•11m ago•1 comments

Economists vs. Technologists on AI

https://ideasindevelopment.substack.com/p/economists-vs-technologists-on-ai
1•econlmics•14m ago•0 comments

Life at the Edge

https://asadk.com/p/edge
1•tosh•19m ago•0 comments

RISC-V Vector Primer

https://github.com/simplex-micro/riscv-vector-primer/blob/main/index.md
2•oxxoxoxooo•23m ago•1 comments

Show HN: Invoxo – Invoicing with automatic EU VAT for cross-border services

2•InvoxoEU•23m ago•0 comments

A Tale of Two Standards, POSIX and Win32 (2005)

https://www.samba.org/samba/news/articles/low_point/tale_two_stds_os2.html
2•goranmoomin•27m ago•0 comments

Ask HN: Is the Downfall of SaaS Started?

3•throwaw12•28m ago•0 comments

Flirt: The Native Backend

https://blog.buenzli.dev/flirt-native-backend/
2•senekor•30m ago•0 comments

OpenAI's Latest Platform Targets Enterprise Customers

https://aibusiness.com/agentic-ai/openai-s-latest-platform-targets-enterprise-customers
1•myk-e•33m ago•0 comments

Goldman Sachs taps Anthropic's Claude to automate accounting, compliance roles

https://www.cnbc.com/2026/02/06/anthropic-goldman-sachs-ai-model-accounting.html
2•myk-e•35m ago•5 comments

Ai.com bought by Crypto.com founder for $70M in biggest-ever website name deal

https://www.ft.com/content/83488628-8dfd-4060-a7b0-71b1bb012785
1•1vuio0pswjnm7•36m ago•1 comments

Big Tech's AI Push Is Costing More Than the Moon Landing

https://www.wsj.com/tech/ai/ai-spending-tech-companies-compared-02b90046
4•1vuio0pswjnm7•38m ago•0 comments

The AI boom is causing shortages everywhere else

https://www.washingtonpost.com/technology/2026/02/07/ai-spending-economy-shortages/
2•1vuio0pswjnm7•40m ago•0 comments

Suno, AI Music, and the Bad Future [video]

https://www.youtube.com/watch?v=U8dcFhF0Dlk
1•askl•42m ago•2 comments

Ask HN: How are researchers using AlphaFold in 2026?

1•jocho12•44m ago•0 comments

Running the "Reflections on Trusting Trust" Compiler

https://spawn-queue.acm.org/doi/10.1145/3786614
1•devooops•49m ago•0 comments

Watermark API – $0.01/image, 10x cheaper than Cloudinary

https://api-production-caa8.up.railway.app/docs
1•lembergs•51m ago•1 comments

Now send your marketing campaigns directly from ChatGPT

https://www.mail-o-mail.com/
1•avallark•54m ago•1 comments

Queueing Theory v2: DORA metrics, queue-of-queues, chi-alpha-beta-sigma notation

https://github.com/joelparkerhenderson/queueing-theory
1•jph•1h ago•0 comments

Show HN: Hibana – choreography-first protocol safety for Rust

https://hibanaworks.dev/
5•o8vm•1h ago•1 comments

Haniri: A live autonomous world where AI agents survive or collapse

https://www.haniri.com
1•donangrey•1h ago•1 comments

GPT-5.3-Codex System Card [pdf]

https://cdn.openai.com/pdf/23eca107-a9b1-4d2c-b156-7deb4fbc697c/GPT-5-3-Codex-System-Card-02.pdf
1•tosh•1h ago•0 comments

Atlas: Manage your database schema as code

https://github.com/ariga/atlas
1•quectophoton•1h ago•0 comments

Geist Pixel

https://vercel.com/blog/introducing-geist-pixel
2•helloplanets•1h ago•0 comments

Show HN: MCP to get latest dependency package and tool versions

https://github.com/MShekow/package-version-check-mcp
1•mshekow•1h ago•0 comments

The better you get at something, the harder it becomes to do

https://seekingtrust.substack.com/p/improving-at-writing-made-me-almost
2•FinnLobsien•1h ago•0 comments

Show HN: WP Float – Archive WordPress blogs to free static hosting

https://wpfloat.netlify.app/
1•zizoulegrande•1h ago•0 comments
Open in hackernews

System.LongBool

https://docwiki.embarcadero.com/Libraries/Sydney/en/System.LongBool
41•surprisetalk•3mo ago

Comments

azhenley•3mo ago
I need some context… why?
dale_glass•3mo ago
It says it right there:

"Note: The ByteBool, WordBool, and LongBool types exist to provide compatibility with other languages and operating system libraries."

beyondCritics•3mo ago
Turns out that old versions of Visual C++ used their own typedef of bool as int: https://stackoverflow.com/questions/4897844/is-sizeofbool-de...
bobmcnamara•3mo ago
There were risc platforms with int sized bool, usually where one byte math wasn't in the instruction set.
bobmcnamara•3mo ago
In C, sizeof(bool) is implementation specific. Typical values are sizeof(char) and sizeof(int).
keketi•3mo ago
In case you need a lot more than two boolean values some day.
knodi123•3mo ago
I chuckled, but presumably it's useful for applications where you want data types to take up the same amount of space, like for matrices or database columns? Or maybe where you coerce different data types into boolean? The language offers WordBool and ByteBool too, so they're pretty consistent. And AFAIK, there aren't any languages where you can specifically allocate only a single bit for a single boolean.
nneonneo•3mo ago
You kind of can in C with bit size specifications on struct members, but you’ll still face the problem that C’s minimum alignment is one byte - so a struct containing a single 1-bit field will still occupy a byte in memory. However, it does let you “allocate” different bits within a byte for different member fields.

C++ has vector<bool>, which is supposed to be an efficient bit-packed vector of Booleans, but due to C++ constraints it doesn’t quite behave like a container (unlike other vector<T>s). Of course, if you make a vector<bool> of a single bit, that’s still going to occupy much more than one bit in memory.

There are plenty of hardware specification languages where it’s trivial to “allocate” one bit, but those aren’t allocating from the heap in a traditional sense. (Simulators for these languages will often efficiently pack the bits in memory, but that’s more of an implementation detail than a language guarantee).

kevincox•3mo ago
> Note: The ByteBool, WordBool, and LongBool types exist to provide compatibility with other languages and operating system libraries.

Which makes sense. So these are really only intended to be used for FFI, not internal Delphi code. If you are bridging from C where bools are a byte you want to determine how you handle the other values.

I think the one thing missing is specifying what the True and False constants map to. It is implied that False maps to 0 by "A WordBool value is considered False when its ordinality is 0" but it doesn't suggest that True has a predictable value which would be important for FFI use cases.

stefs•3mo ago
I'm not sure I get you - "not 0" is a more predicable value than a certain number, isn't it?
kevincox•3mo ago
I'm talking about output. For sure, if I am reading this bool from FFI I want to have "not 0" be truthy. However if I am writing a bool to a FFI interface I want the value to be predictable (for example 1) rather than "some non-zero value".

Although this does open interesting cases where if you read a bool from one FFI interface and write to another it may have an unexpected value (ex 2). But I still think it is useful for the in-language conversions for example Boolean to LongBool and the True constant to have predictable values.

saurik•3mo ago
I presume this FFI goes in both directions; some APIs really want the value of a boolean to be 1 while others really want it to be "all 1s"/0xfff.../-1 because, internally, someone decided to do something silly and compare == or switch on TRUE.
masfuerte•3mo ago
The .Net runtime generates code that relies on bools being either 0 or 1. It's quite easy using interop to inadvertently set a bool to something else and this leads to very odd bugs where simple boolean expressions appear to be giving the wrong result.

(Tangentially, VB traditionally used -1 for true. VB.NET uses the same 0 or 1 internal representation for a bool as C# but if you convert a bool to a number in VB.NET it comes out as -1.)

da_chicken•3mo ago
-1 isn't even a bad choice, since that's basically using 0xFF for true and 0x00 for false. The weirdness is the fact that you're converting a binary value to a signed integer.
int_19h•3mo ago
This goes all the way to early BASIC, and it's signed because the language didn't have any unsigned numbers to begin with.

The main reason for this particular arrangement is that, so long as you can rely on truth being represented as -1 - i.e. all bits set - bitwise operators double as logical ones. Thus BASIC would have NOT, AND, OR, XOR, IMP, EQV all operating bitwise but mostly used for Booleans in practice (it misses short-circuiting, but languages of that era rarely defaulted to it).

saurik•3mo ago
If you can rely on truth being represented as 1 (or 3, fwiw) the same bitwise operations work fine.
int_19h•3mo ago
NOT doesn't
hyghjiyhu•3mo ago
A lot of the time variables will be in registers. And registers are basically ints. That would be my guess for why many things are ints that could fit in less space.
Sharlin•3mo ago
And bools are definitely a byte only on "new" C standard versions (as in since C99), before that there was no boolean type and ints were often used. Thus, LongBool.
jjmarr•3mo ago
I think bool is implementation-defined, no?

And a std::vector<bool> uses 1 bit per bool.

maxlybbert•3mo ago
Looking at the C 2011 standard, it looks like "_Bool" is implementation defined ( https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf , pg. 57 of the PDF; the page labeled 39 section 6.2.5 paragraph 2): " An object declared as type _Bool is large enough to store the values 0 and 1."

I believe everybody uses a single byte for that -- a single byte can store the values 0 and 1 -- but it looks like they aren't required to.

I believe C++ specifies "bool" is one byte; it's definitely never larger than a "char".

As far as std::vector<bool>, the fact that each value is defined at taking up a single bit inside the std::vector<bool> doesn't really say anything about how large each bool would be outside of the std::vector<bool>. std::vector<bool> was arguably a case of the Committee being too clever ( https://isocpp.org/blog/2012/11/on-vectorbool ).

spc476•3mo ago
And you can take the address of a _Bool, so it must be addressable, so the least it could be is sizeof(bool) == 1.
kevincox•3mo ago
I don't think "addressable" implies byte addressable or addressable by a single machine word. IIUC a bool* could be implemented as a byte pointer and a bit offset. Of course this then causes a cascade of things that you probably don't want like intptr_t getting at least 3 bits longer and size_t and related types may need to grow as well. So baking it a byte is the most practical choice.
tonyarkles•3mo ago
I was burned so so hard by vector<bool> and have sworn to never touch it again. I wasn’t aware of the specialization and wrote a ton of code around it. Eventually needed to take a pointer to an element or range of elements and only then discovered that it was special.
ronsor•3mo ago
Isn't the usual definition of true "not 0" (or rather "not false")?
kg•3mo ago
In VB, True was 0xFFFFFFFF - bitwise not 0 - instead of logical not 0 (1).
1313ed01•3mo ago
Also in Free Pascal?

https://wiki.freepascal.org/Data_type#Boolean_types

nine_k•3mo ago
This reply was wrong, removed.

Please downvote it to oblivion.

p_l•3mo ago
Every major CPU ISA still in use can, in fact, address individual bytes (C and C++ standards even demand atomic access).

It's just inefficient, but sometimes needed (MMIO, inter-cpu visible byte changes, etc)

int_19h•3mo ago
C and C++ standards demand atomic access to individual chars.

It is not a given that a C/C++ char is a "byte" in the conventional modern understanding of that word, though. sizeof(char)==sizeof(bool)===sizeof(int)==1 is a perfectly valid arrangement for an architecture that is only capable of addressing machine words, and there have been such architectures historically although I'm not sure any are still around today.

piperswe•3mo ago
Don't modern C and C++ standards mandate an 8-bit char now though?

EDIT: never mind, guess I misremembered! it's just mandated to be at least 8 bits

jonathrg•3mo ago
You can just make stuff up on this website
noir_lord•3mo ago
Amazes me that Embarcadero/Delphi is still going - it's been 25ish years since I wrote a line of Object Pascal, it was a very nice language in its day with an even nicer IDE.
MarkSweep•3mo ago
I assume this type is for compatibility with the 32-bit BOOL type on Windows. This is a common bugaboo when doing interoperability, as I think languages tend to define bool as a 8-bit value.

https://learn.microsoft.com/en-us/windows/win32/winprog/wind...

This must be a pretty slow news day for this to make the front page of Hacker News.

mastax•3mo ago
Don’t they use int-size bools in Solaris? I think I remember seeing those in ZFS.
spyrja•3mo ago
Next up: 64-bit booleans for the win!
ray_v•3mo ago
I'd like to allocate memory for one mega-bool please.
tux3•3mo ago
There was a proposal for a unit type for C++, it would be a zero-sized type just like void except that you could actually use it to declare a variable and pass around as a value, like other regular types.

The less serious proposal: have it be `long void`

magicalhippo•3mo ago
In Delphi, and possibly other Pascal variants, you can do this with a type that's just an empty record (struct). It'll have zero size, but you can declare variables of that type, pass it as parameters and such.

IIRC things get a bit funky using this in certain situations, so I'm not sure the compiler devs actually considered this or if it's just a happy accident of sorts.

int_19h•3mo ago
The problem is that it's still a nominal type system, so each empty struct is still a different type. A proper unit type has a single value of that type, and it's the same throughout the entire program.
magicalhippo•3mo ago
> The problem is that it's still a nominal type system, so each empty struct is still a different type.

Fair point, though for me that was a feature when I used it in Delphi. Allowed me to differentiate them when using them as type parameters (generics).

kragen•3mo ago
Empty structs are supported in clang; I think it's a GCC extension to C. This program:

  #include <stdio.h>
  
  typedef struct {} unit;
  
  static unit f(unit *p)
  {
      return (unit){};
  }
  
  static void g(unit u)
  {
  }
  
  int main()
  {
      unit a = {}, b = {};
      a = b;
      f(&a);
      g(b);
      printf("a is at %lx, b is at %lx, "
              "sizeof unit is %d\n",
              (unsigned long)&a, (unsigned long)&b,
              (int)sizeof(unit));
      return 0;
  }
compiles without complaints on my cellphone and produces the output:

a is at 7ffb39805b, b is at 7ffb39805a, sizeof unit is 0

So you can declare empty structs as variables, return them, assign them, pass them as parameters, take their addresses, create them in struct literals, and dereference pointers to them. clang is assigning different addresses to different empty-struct local variables, but presumably in an array all of them would have the same address, unlike in C++.

I wouldn't be confident that you could malloc them, and I wouldn't be surprised if passing them by value uncovered compiler divergences in the interpretation of the ABI. (I spent most of last night tracking down a bug due to LuaJIT/GCC ABI differences in the implementation of parameter passing.)

int_19h•3mo ago
Why couldn't you malloc them? Malloc doesn't care about types, it just wants the number of bytes, and 0 is a perfectly valid value to pass to malloc. Now, it's unspecified whether malloc will give you back a pointer distinct from all other non-freed allocated blocks or NULL, but if you don't rely on address as identity that is irrelevant.
kragen•3mo ago
You're right, in the standard it's implementation-defined. I mistakenly thought malloc(0) was undefined. That said, it's probably not the best-tested code path in the system library.
tonyarkles•3mo ago
And correspondingly calling free() on the returned value is also unlikely to be particularly well tested.
kragen•3mo ago
Well, unless it's NULL. I'm pretty sure that people call free(0) a lot.
int_19h•3mo ago
I mean, these are literally all special values that are explicitly called out in all the relevant standards (both ISO C and POSIX). Anyone who is competent and is writing tests for libc would surely cover that.
kragen•3mo ago
Probably malloc(0) is not completely untested, yes. But it's unlikely to be regularly executed by applications.
Someone•3mo ago
> Empty structs are supported in clang; I think it's a GCC extension to C.

Indeed. See https://gcc.gnu.org/onlinedocs/gcc-15.2.0/gcc/Empty-Structur....

That page also says “In C++, empty structures are part of the language”, and “G++ treats empty structures as if they had a single member of type char”. I think that means the size of empty structs differs between GCC C and GCC C++.

kragen•3mo ago
Thanks! Yes, C++ requires all objects to have a nonzero size.

In GCC these two variables get the same address; also true in clang with -O.

cryptonector•3mo ago
This would be useful for decoding ASN.1 CHOICEs and open types that contain a NULL option. These should compile to a sum type where the components have values, except that the NULL cases should not.
isolay•3mo ago
This looks so strange from a mathematical perspective. A Boolean type has exactly `true` and `false` as valid instances, but this one allows every 32-bit value. Par for the course of PLs that were arbitrarily invented instead of derived from maths.