Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Astra for Law(openai.com ↗)
    380comments
  2. Bonsai 2 27B: Near-Lossless Compression in a 9x Smaller Footprint(prismml.com ↗)
    82comments
  3. Goose:experimental lang 1.16x faster than C++ and 1.12x than safe Rust, mem safe(github.com/aardappel ↗)
    36comments
  4. Bend – A language that blocks AI mistakes via proof, on CPU and GPU(bend-lang.com ↗)
    167comments
  5. Hister: A private search engine for the pages you visit and the files you keep(github.com/asciimoo ↗)
    139comments
  6. Wax motor(wikipedia.org ↗)
    50comments
  7. Fujitsu launches made-in-Japan next-generation CPU FUJITSU-MONAKA(global.fujitsu ↗)
    198comments
  8. Alibaba releases Qwen 3.8 Omni Flash(qwen.ai ↗)
    7comments
  9. Telstra outage: The night a network decided the year was 2006(netnod.se ↗)
    3comments
  10. Flet 1.0 – Build cross-platform apps in Python(flet.dev ↗)
    36comments
  11. Diplodocus, Long Thought Exclusively American, Turns Up in Spain(sci.news ↗)
    22comments
  12. Better Icon and Label Alignment(ishadeed.com ↗)
    1comments
  13. I Put Nam A2-Lite Inside an iRig HD X(playtaurus.com ↗)
    2comments
  14. CrowdSec Source Code Leak(crowdsec.net ↗)
    41comments
  15. More than 100k people in Japan are now aged 100 or older(bbc.com ↗)
    129comments
  16. The most important product decision is what you don't build(liamnugent.me ↗)
    19comments
  17. How Uber Protects Against Retry Storms(uber.com ↗)
    25comments
  18. Infinite-Parameter LLMs: Generating and Adapting Weights from Live Data(arxiv.org ↗)
    35comments
  19. Why I didn’t sign the Fields medallists’ letter(gowers.wordpress.com ↗)
    316comments
  20. Rate limits on GitLab.com are changing(about.gitlab.com ↗)
    107comments
  21. How do we prevent mathemathics from devolving into the Medieval Era of secrecy?(mathoverflow.net ↗)
    60comments
  22. CCC invites all model citizens to 40C3(ccc.de ↗)
    181comments
  23. The American Religion of Self-Storage Facilities(newyorker.com ↗)
    347comments
  24. TSMC revealing details about next gen A14 node(mapyourshow.com ↗)
    36comments
  25. Landing the Space Shuttle – A Flying Machine and the Thrill of a Lifetime(eaa.org ↗)
    5comments
  26. Zettascale (YC S24) Is Hiring ASIC/FPGA Engineers to Build Chips for ASI(zscc.ai ↗)
    discuss
  27. Show HN: Snapdrop: Instantly share files between devices. No setup, no signup(snapdrop.me ↗)
    20comments
  28. Computer Reset, Dallas(dfarq.homeip.net ↗)
    4comments
  29. Launch HN: Skillsync (YC W26) – AI chat sessions made portable across agents
    51comments
  30. Show HN: Share your AI Setup, Learn from others(mysetup.ai ↗)
    104comments

Goose:experimental lang 1.16x faster than C++ and 1.12x than safe Rust, mem safe

39 pointsby 1h agogithub.com
35 comments
1h agoHN ↗

What does Goose change about memory management ?

1h agoHN ↗

A lot - title could probably use editing. The language has no heap, only stack memory, so the only deallocation is returning from a call stack frame.

46m agoHN ↗

How big is the stack? Too often large data will blow the top and destroy adjacent stacks in multi-thread environments. Are memory barrier fences used to check against overflow?

35m agoHN ↗

I think it is supposed to be stacks in the general sense of the data structure, not the literal `sp` register. I imagine they could be arbitrarily sized up to physical limits if you do some mmap magic. I'm still a bit fuzzy about how you could make useful programs with that, but it seems interesting.

46m agoHN ↗

If I am reading it correctly, the compiler creates N bump allocators per function (or possibly globally) - where N is (I'm guessing at this point) determined by liveness or similar.

1h agoHN ↗

Goose looks familiar like C or Rust, and is built on one idea: there is no heap

So it looks like it restricts the memory management to 100% scope based. I expect that makes a lot of designs for programs not translate to it as well as they fit in Rust or Java (for example). There are a bunch more constraining design choices they list further down:

- Nothing ever moves

- ... A string, an array of strings, a record with variable-size fields and an array of those records are each one contiguous block with no pointer in it

I'll have to look a bit deeper to decide if it's feasible to write many things in this language.

1h agoHN ↗

What kinds of things do you think might not translate well?

58m agoHN ↗

Not the OP, but I'm thinking about like closures?

Say you wanted to make a Node.js framework with callbacks that react to an event. The callback might be a closure that captured some of its surrounding variables. At that point, any of the captured variables are not trivially stack-allocated.

You might be able to do something similar to what Rust does with moving though.

56m agoHN ↗

You could predefine your event handlers within your context, then call 'enter framework' and pass your event handlers as arguments. this is continuation passing style

28m agoHN ↗

it is, but more specifically it’s an eliminator for a coinductive step.

57m agoHN ↗

You could write everything if you refactor to continuation passing style

35m agoHN ↗

Might as well go back to ye olden days and put 100% of your memory in a giant preallocated block and instead of stack locals you just use the block. No allocation cost at runtime, cheese benchmarks by making the super arena.

29m agoHN ↗

CPS is an intermediate representation, humans shouldn’t have to tolerate it.

7m agoHN ↗

Embedded people are well used to this.

Dynamic memory management is a performance enhancement. It lets you more efficiently utilize memory vs static allocation at the cost of, well, lots of types of bugs.

You can always preallocate MAX_NUM_ELEMENTS * SIZE_OF_OBJECT for all your arrays. If someone tries to send you more objects then you have buffer space for you just reject the request.

Latency sensitive programs already do this, since memory allocation is rarely deterministic (although it can be in .NET and other similar languages). Likewise a bunch of destructors going off when an object is freed in C++ also takes a, practically, non-deterministic amount of time. (Really well profiles and controlled programs can make this deterministic if allocation patterns are always identical, but that is rarely the case.)

Of course having fixed sized buffers means you have to have protocols that are aware of size limitations. Most protocols now days assume infinite memory. Everything just fails, badly, when memory does run out.

After having worked in embedded for awhile I grew to deeply appreciate planning around memory limits. Really everyone should be doing it but almost nobody is.

1h agoHN ↗

I am researching a similar idea but which allowed moves if the compiler was able to fix the resulting structure, but mine will probably stay a small side project for a long time.

54m agoHN ↗

Faster than C++ is always a head-turner. Curious what "magic" enables that with memory safety.

5m agoHN ↗

If it's just strict aliasing then you can't be as fast as C++ in all cases. So you have to either provide an escape hatch like Rust (making the memory safety claim only mostly true), or accept worse performance in some cases (making the performance claim only mostly true).

50m agoHN ↗

So much Claude text. I'm sure this is great (I did a bunch of stuff with/to aardappel's lobster, years ago, and it was pretty tidy, and quite easy to work with), but: Claude's writing makes my brain melt.

It's a no from me. I'm sorry.

39m agoHN ↗

Yeah it's very clear at the bottom that it's created by AI. I think this is an interesting case where someone with some great ideas they never got to can actually implement them. I personally hate the Claude style, but just looking at the samples was enough to get a feel for the language.

30m agoHN ↗

Lest it seem like I'm patting myself on the back for my ability to detect Claude's writing style, as if this instance would be evidence of any particular skill in that department: I did skim the README enough to note that bit.

50m agoHN ↗

I'm always fuzzy on this, so 116% faster or 16% faster? The benchmarks suggest 16%.

46m agoHN ↗

116% would be 2x which will break the laws of physics. 16% is possible if you're not allocating heap memory, which I believe is the main selling point here.

42m agoHN ↗

All-stack-no-heap

Isn't this kind of the point of Java's Project Valhalla or am I just confused???

39m agoHN ↗

Great launch!

I was thinking about making a language with same thoughts: Safer than C++ and faster than rust (and a 3rd thing: optimized for AI)

and you actually did it for me. Hooray!

Just the AI language optimization thing is missing..

25m agoHN ↗

The AI optimization is to put it in distribution. So... make it look like python or js?

33m agoHN ↗

a flagged-dead comment in this thread:

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

I genuinely wonder how this style minimized the loss function or got the most upvotes in RLHF and yet is so universally hated that it gets flagged to death almost every time, and similar to Reddit. If I were to describe it, it's "snappy" and information-dense, without fillers. I dislike it too of course.

33m agoHN ↗

Cluould be viewed like a fancy evoultion of CHICKEN (Cheney on the MTA) that used stack for everything.

25m agoHN ↗

Nim defaults to this kind of stack management and value semantics, except the `ref` and `ptr` trapdoors are there whenever you need them. So like this, Nim requires no memory annotations or semantics for good, safe default behavior.

Goose is a straightjacket by comparison. I've never enjoyed languages that plant a flag on one mechanism and force users to adapt.

20m agoHN ↗

This is neat.

But the benchmarks are tiny, and it’s likely that Goose was tuned on them.

So, I think I would read this as: Goose has competitive performance to C and Rust and I’ll take them at their word that it’s as memory safe as Rust

19m agoHN ↗

So if nothing moves, you can't make an array that grows?