‹ BackHN Continuity

Thread

Goose Programming Language

54 points · 69 comments · bobbydigitales

  1. backlands · · focus · HN ↗
    > 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.

    1. skew-aberration · · focus · HN ↗
      You could write everything if you refactor to continuation passing style
      1. eyegor · · focus · HN ↗
        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.
        1. omoikane · · focus · HN ↗
          > Might as well go back to ye olden days and put 100% of your memory in a giant preallocated block

          I do that for the Playdate: statically allocate most of the large structures and tables in global variables, and don't call malloc or free after initialization is done.

          I also put some things on the stack, not so much because I need to dynamically allocate or free something, often it's because I get lower access latency to the stack compared to main memory (because stack lives inside ARM's tightly coupled memory).

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.