7 comments

  • Aardappel 39 minutes ago
    Btw I made the language, AMA. repo: https://github.com/aardappel/goose
    • koolba 9 minutes ago
      What does this mean (from your link):

      > Nested data stays inline. 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. A record that is 160 bytes and an allocation in C++ is 29 bytes and none in Goose.

      I’m having trouble parsing that last sentence.

      • Aardappel 4 minutes ago
        It means that to do variable sized things like vectors and strings, C++ often ends up having to allocate their contents dynamically. Which results in data structures with lots of 64-bit pointers over multiple allocations.

        Even Rust's "enum" feature, which can store different sized things all in the same space, does that at the cost of the smallest variant being just as big as the biggest.

        Goose can do all of that not only inline (no pointers), but with variable size, meaning small items take less space. It's like a serialized data representation, but iterable. It makes for big space savings vs these languages.

        • koolba 1 minute ago
          These AI generated docs would make more sense if you instruct it to not include numbers unless they form a complete example.
      • lynndotpy 5 minutes ago
        [delayed]
    • amelius 15 minutes ago
      Is this like forcing the escape analysis of the compiler to be perfect, by making it explicit in the programming language?

      I'm wondering what kind of architectural corners this forces the programmer into ... have you found any so far?

      • Aardappel 12 minutes ago
        Yes, the compiler guarantees references to data structures can't escape. I believe it does that "perfectly" :)

        It certainly requires the programmer to rethink how they structure their data, as you have to think of where it is going to be stored, and how to store it in a way such that it will have similar lifetimes to what it is stored with, to get the most out of the language.

    • AnEro 19 minutes ago
      You noted AI creating a large amount of this code base with yourself directing it. Do you have a process that keeps you sane while doing this over such a large codebase?(especially for a brand new concept and implementation) [Obviously congrats and can't wait to read through to have deeper questions!]
      • Aardappel 8 minutes ago
        A big part of this making it base the code of this new compiler on my previous compiler for the Lobster Programming Language. I had it go thru that codebase, distill an elaborate code style guide from it, and used that to make it write the new code pass by pass in that style. That made me feel "at home" as if it is my code, easier to review etc, and easier to know we're going in the right direction by seeing similar structure to my past compiler work.

        Once the initial compiler was there it became easier, as Fable is rather good of working within the context of what is already there.

    • fancyfredbot 22 minutes ago
      What happens if the memory is freed in a different order to allocation? Does the language disallow that? Or does it get allowed but mean the stack can't shrink?

      How are you deciding how many stacks to use?

      • Aardappel 17 minutes ago
        The compiler automatically optimally allocates all arrays currently in scope that are able to grow to "stacks" (address spaced reserved areas).

        The programmer choose what to store where, so you typically store things in arrays by lifetime. Goose gives you many more tools to do that, it can store entire variable sized trees of an enum type in a single array.

        You try to avoid having to deallocate in mixed/random order, but if you absolutely must, you can turn arrays into pools, basically.

    • ksec 19 minutes ago
      First, Congrats on the release!

      Do you know if Goose is the first time something like this has been done?

      • Aardappel 14 minutes ago
        In this particular combination, most certainly.

        There is lots of prior art on the individual parts of the design, e.g. "regions" and various stack languages etc, see: https://github.com/aardappel/goose/blob/master/docs/design/p...

        Part of this is that 64-bit address spaces make this design practical, and almost all languages in use today were designed with the limitations of 32-bit in mind. Once you can assign arrays huge amounts of address space, you don't have to realloc, which gets you stable pointers, and a lot of the other Goose features.

    • vanderZwan 31 minutes ago
      If you had no other obligations and todos getting in the way, what's the first thing you'd rewrite in Goose yourself?

      (And why isn't it Amiga E?)

  • bobbydigitales 1 hour ago
    "That looks really neat! The automatic analysis and use of multiple data stacks and resizable fields takes it from "lots of work can be done this way" to "basically everything can be".

    The relative references and built in binary structure validation also enable direct memory mapping of data structures and immediate use of network data. "Parsing" file and network data is often 100x slower than it needs to be." - John Carmack

  • ebiederm 5 minutes ago
    I seem to remember the ML guys went down this route. I believe they called it regions.

    From what little I read in the literature I seem to recall that there were enough programs with quite a bit more memory usage that they decided this approach was a dead end.

    Does anyone know anymore details?

    • Aardappel 1 minute ago
      Yes, ML Kit region inference is probably the closest prior art to Goose.

      Back then though, they couldn't lean on large 64-bit address spaces like Goose can. They implemented all of this with a chain of blocks of memory instead, and tracked most of it at runtime that Goose now does at compile time.

      https://github.com/aardappel/goose/blob/master/docs/design/p...

  • AnEro 44 minutes ago
    Such a cool idea! I've been toying around making a few libraries to force languages to do that direct io zero-read mapping to data structures. Ofcourse this looks way better and infinity less hacky, but it is a fun and trippy experience to find someone working in the same direction as you independently.
  • geoffbp 38 minutes ago
    No relation to https://goose-docs.ai/ I guess?
  • mi_lk 54 minutes ago
    Obviously the guy is replying to something that you can't see without logging in twitter. And without context this means little