logoalt Hacker News

gonzalohm • yesterday at 6:55 PM • 4 replies • view on HN

Can we please stop comparing AI with a compiler?

A compiler takes a programming language as input

float x = 3.1;

Has only one translation into assembly. The programming language is well defined (or it should be). If you try to do

float x = '3.1'; you will get an error

However, the human language is not a programming language. It's open to interpretation "create a variable x and assign it 3.1" is not a well defined programming instruction. Is x a number or a string? If it's a number, what's the precision. Etc.


Replies

timerol • yesterday at 7:35 PM

Loading a float value of 3.1 does not have only one translation into assembly. On Godbolt, flipping through various ARM 32-bit compilers, I define a function that returns 3.1 as a float:

    float constant(void) {
      return 3.1f;
    }
And can get a handful of different results. I trimmed the function setup and teardown to simplify things.

Option 1 (loading high 16 bits and low 16 bits, then moving to fp register):

    movw     r3, #26214
    movt     r3, 16454
    vmov     s15, r3
    vmov.f32 s0, s15
Option 2 (hardcoding the hex value into program text and loading it into r0 via r3, no specific fp conversion):

    ldr     r3, .L3
    mov     r0, r3
    .L3:
        .word   1078355558
Option 3 (similar to 2, but using the load for SIMD and FP registers):

    vldr.32 s0, .L3
    .L3:
        .word   1078355558
xkcd-sucks • yesterday at 7:03 PM

    In [1]: def f(x: int) -> float:
       ...:     return f"the input was {x}"
    In [2]: f(b'deadbeef')
    Out[2]: "the input was b'deadbeef'"
➕ show 1 reply
pjmlp • yesterday at 7:18 PM

"Please send an email with subject XYZ to recipient ABC@somehere with this body AAA"

You can enter this as is on an Workato or Boomi agentic workflow.

For plenty of people this is how programming looks like in 2026.

Also your example has multiple translations into Assembly, depending on the optimizations levels, and where the statement happens to be located, it might even be part of auto vectorisation, or completely thrown away.

voxic11 • yesterday at 6:59 PM

might a compiler turn "float x = 3.1;" into no instructions at all in some situations? So it has at least 2 possible translations into assembly depending on the context.

➕ show 1 reply