Hacker Newsnew | past | comments | ask | show | jobs | submit | ekropotin's commentslogin

Dynamic code generation for calling APIs, not sure what is a fancy term for this approach.

Something like https://github.com/huggingface/smolagents

Needs a sandbox, otherwise blindly executing generated code is not acceptable


https://www.anthropic.com/engineering/advanced-tool-use#:~:t...

Anthropic themselves support this style of tool calling with code first party now too.


Yup, that’s I’ve been taking about.

Cloudflare published this article which I guess can be relevant https://blog.cloudflare.com/code-mode/

this assumes generated code is always correct and does exactly what's needed.

Same for MCP - there is always a chance an agent will mess up the tool use.

This kind of LLM’s non-determinism is something you have to live with. And it’s the reason why I personally think the whole agents thing is way over-hyped - who need systems that only work 2 times out of 3, lol.


The fraction is a lot higher than 2/3 and tool calls are how you give it useful determinism.

Even if each agent has 95% reliability, with just 5 agents in the loop the whole thing is just 77% reliable.

I have no idea what you’ve just said, so here is my upvote.

How is situation with latency on these readers?

I’ve just acquired the latest gen Kindle and I’m absolutely blown away by how fast it is.


do you mean latency on a color screen? (my experience with color eInk is that it adds quite a lot of latency)

The current colour kindles and kobos don't use real eink colour. It's just a bw screen with lcd colour overlay (eink kaleido)

The real colour screens are used on the remarkable (eink gallery) and they are indeed slow for full page updates though remarkable seems to have done a lot of smarts for local updates while drawing.


Ah, sorry for confusion. I meant to ask about non-color version of Kobo.

And colour E-Ink devices also have horrible contrast.

Could anyone please explain what IBM is even doing these days? Where revenue is coming from?

it's a public company, read the quarterly reports

> If a human did this we probably would have a word for them.

What do you mean? The programmers work is literally combining the existing patterns into solutions for problems.


The problem with sagas is that they only guarantee eventual consistency, which is not always acceptable.

There is also 2 phase commit, which is not without downsides either.

All in all, I think the author made a wrong point that exact-once-processing is somehow easier to solve than exact-once-delivery, while in fact it’s exactly same problem just shaped differently. IDs here are secondary.


I'd agree with that - two phase commit has a bunch of nasty failure cases as well, so there's no free lunch no matter what you do when you go distributed. So just ... don't, unless you really really have to.

You can't avoid distributed unless your users live inside your database.

That would be amazing if we could watch both Netflix and HBO Max content at the price of one subscription. At least for me, these two platforms covers 95% of my video content needs.

"The price of one subscription" being the price of Netflix plus the price of HBO. Streaming is turning back into cable where everything is trapped in one bill, no matter how expensive and uninteresting some part of that bill is.

Having Discovery's awful content push out quality HBO content was already a major blow.


Well, I guess one more significant price jump would be a sign to finally replace streaming with reading

I imagine major HBO resellers / direct Netflix competitors Amazon and Hulu (Disney) will insist on HBO remaining an extra-cost option, assuming these relationships survive the merger at all.

Yeah but there is 0 chance that the cost would remain similar to what it is now

> Netflix and HBO Max content at the price of one subscription

Yes, the price of one subscription. I think some cable packages in the US are $200 per month?


The cable thing in US is something Im struggling to wrap my mind around. I can’t imagine someone deliberately paying so much money for such a bad content.

The only explanation I can think of is that most of the subscribers are elderly folks who signed up long time ago and didn’t bother to look into current bills.

Also maybe some ardent sport fans?


Internet/TV bills can be negotiated, but it is usually something you have to do annually and most people, rightly so, hate it. The companies make it hard to do, so most people would rather pay an extra $5-10 rather than spending an hour or two on the phone. After 5-10 years, those fee bumps really add up.

The only way to keep Internet/TV costs low is to threaten to cancel or switch every year, and actually be willing to do it. For some that isn't an option because there is only 1 provider, and others I've talked to hate that idea because you have to learn a new channel lineup. It's amazing how much people will pay to not be slightly inconvenienced.


The question is why to keep TV subscription at all? Is there some very unique content which is not available on digital?

Live sports and public television was kind of the last bastion in my mind, but the former is piecemeal being acquired by streaming the platforms and the latter is largely being put on the internet for free.

Your last point is the stronger one. Live events, including sports, are a heavy driver of these subscriptions.

Another is broadband deployment. Choice is low in many parts of the country, and bundled service offerings are frequently priced near the "internet only" offerings to nudge customers into a "might as well" posture.


For me it's sports.

well, you'd get it at price of twice of current subscription

That’s super interesting, as I’m in the exactly same boat as OP.

Did you by chance went through this process yourself? If yes, would you mind describing the process in more detail?


I pretty new to Rust and I’m wondering why global mutables are hard?

At first glance you can just use static variable of a type supporting interior mutability - RefCell, Mutex, etc…


> I pretty new to Rust and I’m wondering why global mutables are hard?

They're not.

  fn main() {
      unsafe {
          COUNTER += 1;
          println!("COUNTER = {}", COUNTER);
      }
  
      unsafe {
          COUNTER += 10;
          println!("COUNTER = {}", COUNTER);
      }
  }
Global mutable variables are as easy in Rust as in any other language. Unlike other languages, Rust also provides better things that you can use instead.

People always complain about unsafe, so I prefer to just show the safe version.

  use std::sync::Mutex;

  static LIST: Mutex<Vec<String>> = Mutex::new(Vec::new());

  fn main() -> Result<(), Box<dyn std::error::Error>> {

      LIST.lock()?.push("hello world".to_string());
      println!("{}", LIST.lock()?[0]);

      Ok(())
  }

This is completely different from the previous example.

It doesn't increment anything for starters. The example would be more convoluted if it did the same thing.

And strings in rust always delivers the WTFs I need o na Friday:

    "hello world".to_string()

    use std::sync::Mutex;
    fn main() -> Result<(), Box<dyn std::error::Error>> {
        static PEDANTRY: Mutex<u64> = Mutex::new(0);
        *PEDANTRY.lock()? += 1;
        println!("{}", PEDANTRY.lock()?);
        Ok(())
    }

Still different. Yours only increments once. Doesn't pass basic QA.

And declaring a static variable inside a function, even if in main, smells.


OP you keep comparing to doesn't even declare the variable. I'm done with you.

OP here, not showing how to declare the variable was an oversight on my part.

  static mut COUNTER: u32 = 0;
(at top-level)

If on 2024 edition, you will additionally need

  #![allow(static_mut_refs)]

Yup, your example was fine, as I said I just wanted to show a safe method too :-)

That is correct. Kinda. Refcell can not work because Rust considers globals to be shared by multiple threads so requires thread safety.

And that’s where a number of people blow a gasket.


A second component is that statics require const initializers, so for most of rust’s history if you wanted a non-trivial global it was either a lot of faffing about or using third party packages (lazy_static, once_cell).

Since 1.80 the vast majority of uses are a LazyLock away.


I don't think it's specifically hard, it's more related to how it probably needed more plumbing in the language that authors thought would add to much baggage and let the community solve it. Like the whole async runtime debates

I read somewhere that Adderall does not improve cognitive function in people without ADHD and in some cases can even decrease it.

Have you ever taken a decent dose of an amphetamine? It isn't going to make you smarter but it will almost certainly boost your energy and ability to get stuff done.

The same is true for every individual person who takes it. At some dose it helps and at other does it doesn't.

And in the gym, it raises your heart rate so that hurts exercise, but without it I can't do any cardio because I get so bored 5 minutes in I have to stop.


>takes amphetamine

>performance enhanced

>welp, guess I have ADHD!

By this metric everyone has ADHD.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: