r/Compilers • • Jun 12 '26

Code Readability Comparison

/r/programmer/comments/1u3x0z8/code_readability_comparison/
0 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/Mean-Decision-3502 Jun 12 '26

Sorry, but I would rather program in assembly than in this language.

1

u/ChiveSalad Jun 12 '26 edited Jun 12 '26

no offense taken: I am on the fence still on whether this is a prank language or a serious attempt. The compiler still uses random.rand() to type check (las vegas algorithm! its deterministic with probability 1!)

on the rather program in assembly front I have wonderful, terrible news

(backend asm Instr popcnt)
(header (popcnt I64 I64) I64)
(print (popcnt 0 (sub 10 1)))

shortly thereafter

main:
pushq   %rbp
movq    %rsp, %rbp
movq $10, %rax
subq $1, %rax
subq $8, %rsp
movq %rax, -8(%rbp)
movq $0, %rax
popcntq -8(%rbp), %rax
subq $8, %rsp
movq %rax, -16(%rbp)
movq    -16(%rbp), %rdi
call    printII9
subq $8, %rsp
movq %rax, -24(%rbp)
movq    %rbp, %rsp
popq    %rbp
ret

and finally

podman run -i --rm --platform linux/amd64 -v "$PWD":/work -w /work docker.i o/library/gcc:latest sh -c "gcc build/examples/helloworld.lisp.s -o build/e xamples/helloworld.lisp; ./build/examples/helloworld.lisp" 2 %