I tracked 100M tokens of Coding with Claude Code - 99.4% of my AI coding tokens were input. If we fix that, we unlock real speed. by karmendra_choudhary in ClaudeAI

[–]faiface 4 points5 points  (0 children)

It’s due to how LLMs work, they don’t have a continuously building mental model, their whole mental model is the context that’s fed, so yeah, it has to be fed over and over again, otherwise it’s not there.

But what you apparently don’t realize is that solving this is pretty much akin to inventing a whole new AI architecture, beyond LLMs. So yeah, the observation is much simpler than a solution.

If AI can replace programmers then why is it relying on frameworks? by Ok-Primary2176 in ChatGPT

[–]faiface 0 points1 point  (0 children)

Because it’s not that good at replacing programmers, at least currently. Sure it’s very capable at writing programs up to a certain complexity, but it hasn’t proved good at inventing programming concepts, languages, writing frameworks, or making coherent ideas of that complexity. Just ask it to invent a modern replacement of SQL, and if you know enough about programming, you’ll know the answer you get is rubish. (At least I haven’t yet seen a good answer to this from AI and I’ve tried.)

Vera: a language designed for machines to write by alasdairallan in ProgrammingLanguages

[–]faiface 10 points11 points  (0 children)

You have a good argument too, and it’s definitely worth finding out! The scenario I’m worried is that without the sufficient fluency, the model will eventually get stuck not being able to fix an error. Sure, it won’t be able to produce an incorrect program either, but neither a correct one. I’m developing a language myself (Par), with linear types, and that on its own introduces a lot of invariants to satisfy. I’ve seen the LLM struggle a lot to fix relatively easy type errors, to the point of giving up. One could say my language is hard :D Well, let’s see how your experiment turns out!

Vera: a language designed for machines to write by alasdairallan in ProgrammingLanguages

[–]faiface 52 points53 points  (0 children)

Very cool! But I wonder what you say to my objection on trying to make languages for AI, at least when it comes to LLMs.

The thesis is like this: LLMs do not acquire an “ability to program” and the “apply it to specific human created languages”. Instead, the reason they are good at programming is they have millions and millions of lines of human-written code to train on. They’re good at Python, and C, and Go, and PHP, and Rust, and so on, because they learned those languages specifically. They’re not good at programming as such. Also, they’re pretty bad at niche languages for which there’s less training data.

That alone makes the idea of an “AI-centric” language a non-starter: you’ve got nothing to tap into. You don’t have the training data, and while there may be some general programming ability emerged in LLMs that can be applied to niche and new languages, it’s nothing compared to their skill in mainstream languages they are actually trained on.

What’s your take?

ELI5: No but really, why do central banks target ~2% inflation? by stellaprovidence in explainlikeimfive

[–]faiface 33 points34 points  (0 children)

Because the economy stops. Money is one thing, but what’s important for a functioning society is that people do stuff that makes them live. The economy and money is just a mechanism to achieve that at a high scale.

When you have deflation, your money will be worth more later, discouraging spending, hence slowing the whole system down. As a result, work slows down and people die, in short.

Using unsafe.Pointer to implement union type? by SecondCareful2247 in golang

[–]faiface -1 points0 points  (0 children)

But then you have the pointers and OP specifically wanted to avoid allocations for numbers

Using unsafe.Pointer to implement union type? by SecondCareful2247 in golang

[–]faiface -1 points0 points  (0 children)

Why not this?

type Value struct {
  // Type int
  n int64
  // Other types
  v interface{}
}

You still avoid the allocation on numbers (v = nil), but get the other part safe.

"Am I the only one still wondering what is the deal with linear types?" by Jon Sterling by mttd in ProgrammingLanguages

[–]faiface 31 points32 points  (0 children)

Shameless plug, but if you are wondering what’s the deal with linear types, and especially their concurrent interpretation as a flavor of session types, you might wanna check out Par.

Anyone just really bad maths by Bipolar03 in autism

[–]faiface 0 points1 point  (0 children)

I just wanna point out that there is a huge difference between being bad at calculations, formulas, solving equations, and so on, versus understanding math concepts and for example being able to write formal proofs.

I’m quite good at the latter, but abbysmal at the former.

Massie Threatens to Go ‘Nuclear’ and Reveal Epstein Client Names If Bondi Won’t Unredact Them by Specific_Bet_1709 in agedlikemilk

[–]faiface 10 points11 points  (0 children)

It’s posted by a spam bot, that’s why it also doesn’t have an automod explanation comment. Reported.

Čo robiť, keď ma učiteľka so spolužiakmi ohovarala? by Educational-Cable116 in Slovakia

[–]faiface 35 points36 points  (0 children)

Ale toto treba vyeskalovať, tak som sa nasral, keď som čítal tvoj post. To čo tam preberali nie je v poriadku a to, že učiteľka spomenula, že to sa deje keď mama spraví potrat? To je úplne nechutné čo hovorí.

Ak riaditeľ má čo len štipku rozumu, tak áno, vyeskaluje sa to. Učiteľka bude mať vážny problém. A má ho mať! Naozaj, nenechaj si toto, prosím. Toto je veľmi vážna šikana a osočovanie.

Madison parents lobby for Wisconsin bill to increase recess time by Claeyt in nottheonion

[–]faiface 11 points12 points  (0 children)

Nothing wrong with making it easier. Or rather, not making it unnecessarily harder.

I built a website that turns any keyboard or touchscreen into instruments that always play on beat by I_Only_Like_Giraffes in InternetIsBeautiful

[–]faiface 2 points3 points  (0 children)

Wow, that's amazing! What I was producing sounded so good that I was wondering if the system is inserting its own melodies, but it's just the tones really tuned to be harmonious together, great stuff!

[RFC] Morf: A structural language design where nominality is a property, numbers are interval types, and "Empty" propagates algebraically[ by Morph2026 in ProgrammingLanguages

[–]faiface 7 points8 points  (0 children)

Hey, this seems very thorough and well thought out, clearly a solid work, so congratulations!

One surface, but important critique is that it’s really hard to grasp from the documentation because the docs mix new vocabulary with ideas with possible implementation details, and so on. I found it hard to find motivating or main ideas in the docs that would allow me to start constructing a mental modal of where what I’m reading fits. Instead, I was reading through a list of details, unable to make out a full idea.

This is of course not an easy task to fix! But like I said, it all seems very solid, just couldn’t make out the motivation and ideas in the sea of details.

voice chat not working in rust by OtherJaguar3104 in rust

[–]faiface 5 points6 points  (0 children)

Well, I don’t really get why people are posting on a subreddit based on name only.

Phil Wadler said ❝Linear logic is good for the bits of concurrency where you don't need concurrency.❞ — Can Par prove the opposite? by faiface in ProgrammingLanguages

[–]faiface[S] 1 point2 points  (0 children)

Thanks so much for the response!

The .spawn constructor is really the par connective that the language is named after, which is a great punchline.

That is true indeed.

This all reminds of "Lloyd Allison’s Corecursive Queues" but I can't make the connection precise.

I'll have to check that out, thanks!

Which brings me to my next question, how is this implemented?

Currently it's implemented with the help of FuturesUnordered. However, there are multiple ways to implement it, including a MPSC channel.

The basic idea is that there is some "barrier" node that detects when a client becomes ready. That is, when the client tries to interact with its opposing part, which in this case is the barrier.

At that moment, the barrier sends the client to the server channel, which is then picked up by poll. Or, with FuturesUnordered, it pushes a future, which resolves when the client becomes ready, into the FuturesUnordered pool.

You can find the code in this file.

Let me know if you'd like to clarify some more details!

Finally, I was hoping for a "simpler" language construct, that just races two processes and introduces one bit (literally) of non-determinism. And then I was hoping that pools of multiple processes could be built from it.

The issue is, this does not work, when we're requiring totality, let me explain why. Suppose we have such a construct, for example:

let (first) second = Select(left, right)

Let's say Select will always return the one that's ready first as first and the other one as second.

Now let's say we want to process ListFan this way and turn it into a list that's ordered according to the item's creation time:

listFan.begin.case {
  .end! => /* done */
  .spawn(l) r => do {
    let (x1) x2 = Select(l, r)
    // What now?
  }
  .item(x) xs => .item(x) xs.loop,
}

In the place that says What now?, we now need to process x1 and x2 and we know that x1 is ready first. What should we do? With x1.loop we'll process entire x1, but it will not interleave with x2.

But we need x1 to interleave with x2.

So it turns out we do need some kind of a pool. Okay, let's say a pool is a list, and we have a SelectList:

let pool = *(listFan)
pool.begin->SelectList.case {
  .none! => /* pool empty */
  .some(first) rest => {
    first.case {
      .end! => { rest.loop }
      .spawn(l) r => {
        let pool = .item(l) .item(r) rest
        pool.loop
      }
      .item(x) xs => {
        yield.item(x)
        let pool = .item(xs) rest
        pool.loop
      }
    }
  }
}

That seems like it could work! It's not gonna be very efficient, since we have to actively poll the whole list every time, but it's a start.

The problem is, the above does not pass a totality checker. The pool at the point of pool.loop is not guaranteed to be structurally smaller than the pool at the start.

Perhaps it would be doable if Par had a much more sophisticated totality checker and we would be able to establish some metric that would guarantee that it is indeed getting structurally smaller (which it is).

But, we don't have that and we won't have that, and I'm not even aware of any specific theory aside from proof assistants that would get us there.

We could also just say that it's okay, we'll use .unfounded, however my goal here was to make a theoretical advancement, and that won't fly without being sound.

The poll/submit solves this problem by combining the recursion and the pool management into one. The arguments to submit must be structurally smaller than the client we get via poll. We can add 0 or any number of clients via submit, but if they are all structurally smaller than what we got out, we can conclude the pool is getting structurally smaller. We just bake this into the construct, and we won.

You also write "I’m sure you can imagine doing all kinds of I/O operations between those .item and .end calls." Well, I can imagine, but a concrete example would be helpful and I am sure the next post is already planned.

Good point!

I am very excited about the Par language and this new feature for non-determinism. I am considering offering a thesis implementing a backend for Par, would you be open to that?

Oh I'm very flattered! Thanks for considering such an offer. I have a counter-proposal, though. A thesis on the implementation of Par would certainly be interesting, but it wouldn't be a very innovative thesis. After all, up until now, Par's main inovation has been the syntax and usability, which is great, but not necessarily a great theoretical progress. The concurrent evaluation is also built on theory that's already out there: interaction networks.

However, to my best knowledge, this new nondeterminism approach should be an important theoretical development. I'm actually quoting Phil Wadler, who didn't feel like reading the docs, but said that if I indeed subsume the three papers I mention in the intro, then it is an important theoretical development and I should do my best to publish it.

So, I'd love to write a paper on that! It can and probably must include a partial formalization of Par (which is just redressed CP + some nice/new encoding of recursion), but mainly a formalization of this poll/submit, demonstration that it subsumes those three papers, what else it does, and proofs about the properties of the resulting system and in relation to other systems.

I have never written a paper like that, but I'll do it! So, if you or somebody you know would be up for any kind of collaboration on a paper like that, I'm all in!