Top
Best
New

Posted by bobbydigitales 17 hours ago

The Goose Programming Language(aardappel.github.io)
https://twitter.com/ID_AA_Carmack/status/2113704269274636568
424 points | 259 commentspage 5
baalimago 15 hours ago|
Do android dream of goose?
nnevatie 5 hours ago||
> and scope exit is the free

And doc is the slop.

rvz 15 hours ago||
If you can't be bothered to read and structure your own README after getting an AI agent to write more than 10,000+ lines on a single page, it becomes a DONTREADME.md.

Yet, the author expects YOU to read all of what they didn't write. So I ain't reading all of that.

rfgplk 15 hours ago||
Keep going, and I hope more people start rolling their own languages.

If anyone is interested, I'm fairly close to finalizing Slang and I'm considering open-sourcing it in the near future. What originally started as a simple register based lang for an embeddable VM turned into an insanely expressive meta?programming language. Full system Fω, expansive whole program reflection (you can reflect on absolutely anything), string memory & logic safety..

You can do stuff like this:

   (fn answer () -> i64 0)
   (defpass build-answer
     (phase source)
     (transform (lambda (f)
       (fn-with f 'body '(let ((a (arr (42)))) (at a 0)))))
     (safety (lambda (goal) (syntax (refl)))))
   (run-pass build-answer answer)
   (fnmut answer
     (transform (lambda (f)
       (if (memory-safe? (check-memory (current-program)))
         f (syntax-error 'unproved-memory)))))
   (defpass inspect-ssa
     (phase ssa)
     (transform (lambda (f)
       (if (memory-safe? (check-memory (ssa-current-program)))
         f (syntax-error 'unproved-ssa-memory))))
     (proof (lambda (goal) (syntax (refl)))))
   (run-pass inspect-ssa answer)
   (answer)
or this:

   (fn next ((i i64)) -> i64 (+ i 1))
   (fncontract next
     (ensures result (successor (Eq i64 result (+ (old i) 1)) auto)))
   (fn read-second ((i i64)) -> i64
     (let ((a (arr (0 42)))) (at a i)))
   (fncontract read-second (requires (one (Eq i64 i 1))))
   (let ((i (next 0)))
     (with-proof ((one (Eq i64 i 1) (result-proof i successor)))
       (print (read-second i))))
it also supports full inline asm or llvm ir:

   (var answer 0)
   (asm (input rdi 20)
        (input rsi 22)
        (output rax answer)
        (mov rdi rax)
        (add rsi rax))
   (print answer)

   (macroop \ (a) (asm (mov a rax)))
   (\ 42)

   (print (llvm add 20 22))
   (print (->i64 (llvm fused-multiply-add (f64) 6.0 7.0 0.0)))
   (llvm fn sum32 ((x i32) (y i32)) -> i32
     (block entry
       (value answer (llvm add x y (declare (flags nsw))))
       (llvm return answer)))
   (print (->i64 (sum32 (the i32 20) (the i32 22))))

Even though you can write this by hand, the core idea is to get a very dense and terse language that LLMs can emit while guaranteeing safety and performance.
ModernMech 9 hours ago||
You should submit your own ShowHN to talk about it rather than hijack some other language’s announcement thread.
gspr 13 hours ago|||
> Even though you can write this by hand, the core idea is to get a very dense and terse language that LLMs can emit while guaranteeing safety and performance.

So now your safety and performance issues are in the LLM and whatever prose you feed it for it to generate slang. Have you gained anything?

(Not meant to detract from the language. It's just that this particular goal seems... strange).

anthk 12 hours ago||
Try Common Lisp and Coalton. Also, Common Lisp and that one math proof solver.
IshKebab 15 hours ago||
PLEASE rewrite this without AI-isms. AI can write perfectly good code now, but its prose - even the latest models - is just awful to read. It hurts my brain to read this.
ivanjermakov 15 hours ago|
I like it this way, it gives correct expectations regarding effort put into the rest of the project.
iacuobos 16 hours ago||
I can't see a reason to use this and not C++ It reads like slop text
andsoitis 15 hours ago|
> to use this and not C++

Why Goose - https://aardappel.github.io/goose/#why-goose

FrustratedMonky 16 hours ago||
Looks cool, and well developed. But really, cover pages need some better TL;DR, about the purpose. What is it for? There are a ton of languages out there. What gap is this filling? What is the purpose, the use case. Why do I need to keep reading further?

Edit Man, two posting about Goose back to back. Carmack alone might be enough to read further.

https://news.ycombinator.com/item?id=50224100

tobiolo 15 hours ago|
I think it is a general systems programming language that fits for a variety of use cases but especially well with trees, records and where you want to have direct data (de-)serialization, like flatten out a tree and pick it up then (last one reminds me of FlatBuffers, another invention of the programming language author). I think if you look into the Discord channel there's some nice examples.
anonymous908213 15 hours ago|
[flagged]
More comments...