5 ms·
Goose Programming Language
- bobbydigitales 17d ago[dead]
- MiroslavPokorny 17d agoWhat does Goose change about memory management ?
- bobbydigitales 17d ago[dead]
- kenferry 17d agoA 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.
- yndoendo 17d agoHow 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?
- gcoakes 17d agoI 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.
- MiroslavPokorny 17d agoStack allocations will be lost when the enclosing call exits. How does this help for long term values ?
- bobbydigitales 17d ago[dead]
- zamalek 17d agoIf 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.
- deleted 17d ago[deleted]
- backlands 17d ago> 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.
- bobbydigitales 17d agoWhat kinds of things do you think might not translate well?
- tombert 17d agoNot 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.
- skew-aberration 17d agoYou could predefine your event handlers within your context, then call 'enter framework' and pass your event handlers as arguments. this is continuation passing style
- cmrx64 17d agoit is, but more specifically it’s an eliminator for a coinductive step.
- com2kid 17d agoNah we did something similar on Microsoft Band. I wrote about how - https://meanderingthoughts.hashnode.dev/cooperative-multitasking-on-microsoft-band https://meanderingthoughts.hashnode.dev/cooperative-multitas... The tldr is you had to preallocate a struct with anything you wanted captured ahead of time.
- dadoum 17d agoI 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.
- finn888 17d agoFaster than C++ is always a head-turner. Curious what "magic" enables that with memory safety.
- wmf 17d agoUsually strict aliasing.
- Ohentis 17d agoIf 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).
- tom_ 17d agoSo 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.
- blahblaher 17d agoright? man, I'm starting to really hate this kind of writing. Sure, use the llm to do the first draft, but at least, do a second pass and remove the stupid llm-isms
- bobbydigitales 17d agoYeah 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.
- tom_ 17d agoLest 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.
- webprofusion 17d agoI'm always fuzzy on this, so 116% faster or 16% faster? The benchmarks suggest 16%.
- levkk 17d ago116% 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.
- tom_ 17d agoEvergreen: https://randomascii.wordpress.com/2018/02/04/what-we-talk-about-when-we-talk-about-performance/ https://randomascii.wordpress.com/2018/02/04/what-we-talk-ab... (Feels like it should probably say "1.16x as fast" or "1.16x the throughput" - or something like that.)
- jlkuester7 17d agoAll-stack-no-heap Isn't this kind of the point of Java's Project Valhalla or am I just confused???
- thayne 17d agoProject valhalla allows more things to be on the stack but doesn't get rid of the heap.
- respectattentio 17d agoGreat 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..
- elromulous 17d agoThe AI optimization is to put it in distribution. So... make it look like python or js?
- respectattentio 17d agoSyntax could be improved for AI I believe. With testing, you could reduce tokens while being more accurate. This is a new language, it's worth experimenting in this and see reasoning, input, and output tokens across different tasks.
- xdavidliu 17d agoa flagged-dead comment in this thread: https://news.ycombinator.com/item?id=49749113 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.
- t3r 17d agoMy read: it's not the style per se, it's the association. People are just sick of AI slop and react badly to anything that smells like it. The dead summary itself was reasonably informative, I'd say.
- applfanboysbgon 17d agoThis style is deliberately trained by the frontier providers, not something that occurs accidentally. It is a manipulative style that is extremely effective against the general population. It utilises countless dopamine-inducing techniques used in clickbait headlines and Youtube thumbnails, and barrages the user with a wall of text that obfuscates everything it attempts to say, which is extremely useful for giving the appearance of intelligence; when you use a lot of sophisticated language and technical jargon, people won't understand you, but rather than assuming that you're stupid for writing something incomprehensible, they will instead give you credit and assume they can't comprehend it because it's too advanced for them, even if actually is incoherent. It is only flagged on HN because it's been made against the rules, giving the minority who hate it the power to retaliate. It was only some months ago I was routinely getting downvoted every time I pointed out obvious bot accounts spamming a post per minute in blatant LLM-speak. Even now, LLM articles are still allowed and people upvote them to the top all the time. > information-dense Err, no. It absolutely is not. You could say that it's dense in technical language, but the style has mastered the art of saying a lot without saying anything at all.
- ipython 17d agoYour comment sparked an idea - it’s like the bike shedding of written text. If you write clean, concise English, it’s easy to parse and then inject your thoughts. If you instead (like an llm) throw a human a large wall of jargon heavy text, they’ll just give up and agree with you.
- karmakaze 17d agoCluould be viewed like a fancy evoultion of CHICKEN (Cheney on the MTA) that used stack for everything.
- afgrant 17d agoUnfortunate language/protocol name reusal. Watch out for these. https://www.se.com/ww/en/download/document/998-2095-18-12-19AR0-EN/ https://www.se.com/ww/en/download/document/998-2095-18-12-19...
- netbioserror 17d agoNim 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.
- timschmidt 17d ago> I've never enjoyed languages that plant a flag on one mechanism and force users to adapt. Well, the hardware designers have chosen one (or at most a small number of) mechanism[s] and implemented in silicon. The farther you diverge from their implementations, in terms of abstractions, language features, and the like, the more you will pay in performance. Your choice.
- bobbydigitales 17d agoI suppose to be distinctive and have a "new idea", you sort of have to do that. Otherwise there's really no point in making a new language.
- devenquan 17d ago[dead]
- pizlonator 17d agoThis 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
- RantyDave 17d agoSo if nothing moves, you can't make an array that grows?
- bobbydigitales 17d agohttps://github.com/aardappel/goose/blob/master/samples/02_memory.goose https://github.com/aardappel/goose/blob/master/samples/02_me...
- codys 17d agoIt appears they got around that by making expanding and contracting data arrays builtin types the compiler impls. And it does this by creating what they call a "data stack" for each thing that needs to grow. To me it reads like "we have a builtin type that hides the heap allocation and does the free at the scope exit ", which is fine I guess as it keeps the nature of the language in tying lifetimes strictly to function scopes.
- sodacanner 17d agoI just can't understand why you'd let an LLM write your README. The code, the implementation? Sure! That's the purpose of a coding agent. The README, though? That's the first thing I read about your project. Anybody familiar with LLMs is going to pick up that one wrote it in an instant. Surely you understand your own project well enough to write it in your own words, right? If not, what's even the purpose of the project in the first place?
- bobbydigitales 17d agoYeah I hate the Claude writing style. It would be better with a cut down README. I suppose the point is that this was a latent idea that they got out there using these new tools, and that this would probably have not been done otherwise.
- BobbyJo 17d agoAm I the only one with a deep aversion to the keyword "let"?
- Pxtl 17d agoWhy? It's idiomatic to math. There's a lot to hate about math notation (use more than one letter in your variable names!) but "let" for declaring variables seems harmless. If I'm going to pick a bone about modern programming language conventions it's the prevalence of = for assignment and == for equality that grinds my gears.
- fwlr 17d agoThis is an interesting idea. It’s a pity it was implemented by LLM instead of explored by someone with curiosity.
- bobbydigitales 17d agoWell it's their original idea and it's based on the Lobster compiler they wrote, so it isn't just a random person doing it. I'd say it's more like an expert language designer using a tool to explore an idea they otherwise wouldn't have time for.
- overtone1000 17d agoSome of us may never adjust to a world without sweat equity.
- insanitybit 17d agoAs someone building a language with an LLM, it is exactly an exploration of curiosity. I have a lot of ideas, I don't always know how to implement them, and I certainly lack the time. The LLM can write the code, I can guide it, and I can learn what does or does not work.
- thayne 17d ago> All elements remain valid at all times. free does not release any memory and does not end any lifetime — it adds an index to a freelist. The slot is still a live, well-typed Item afterwards, and it still belongs to the pool, which still belongs to its owning scope. > > So there is nothing here to be unsafe. A reference to a freed-and-reused slot reads a different Item — a perfectly good one, just not the one you were thinking of. This avoids the dreaded undefined behavior, but it can still be pretty bad. For example, accessing a record that has been freed and re-used could leak sensitive information from one user to another. Granted that kind of bug is possible with any memory safe language, but this pattern is probably more like to be used in goose than languages with automated memory management.
- dang 17d agoThe submitter asked us to take this down because the language is missing some important elements they should have added before posting. I don't think we can do that because the thread is so active, but we'll bury this one so they can repost it when ready.
- Pxtl 17d agoThat's surprising because WVO just updated the readme to actually be a decent pitch for the language (although it's LLM-text heavy) just before it was posted to here.
- Mawr 17d ago> 1.16x faster than C++ and 1.12x than safe Rust This alone is enough to tell you have no idea what you're talking about, and it's not even about the ambiguous usage of the word "faster". There is no way for performance claims that are a) this accurate, b) this small, to possibly be real. You certainly just cherry-picked favorable benchmarks. Ah, here it is: "Over sixteen benchmarks Goose runs at about...". First, let's make this statement actually correct: "Over sixteen microbenchmarks Goose runs at about...". That's not the same statement as "1.16x faster than C++ and 1.12x than safe Rust". Not by a mile. You need a test suite comprised of a wide variety of real world programs, not 16 microbenchmarks, possibly specifically chosen to play to the strengths of your language.
- bobbydigitales 16d agoYou can't fit all that in the title of a post. The readme is very clear about the claim. There's no way to get a wide variety of real world program benchmarks for a brand new language. You can look at the benchmarks and determine if you think they're fair.
- skavi 17d agohttps://github.com/aardappel/goose/blob/master/docs/tutorial.md#11-when-lifetimes-really-are-not-nested https://github.com/aardappel/goose/blob/master/docs/tutorial... this bit seems a bit messy.
- Pxtl 17d agoI'm a big fan of Aardappel, I used to co-run the Cube/Sauerbraten mapping website. I've never played with his language projects since they generally seemed too C-fixated to me... but despite that being the case here, I can at least see the value proposition clearly-enough that it seems really cool. I think the README has been updated to be much more informative since it was first posted. tl;dr: Stack-obsessed compiles-to-C programming language that promises to be faster than idiomatic C++ or Rust by using creative ideas about allocating dynamically-sized objects to the stack.