Live data from Hacker News

Libraries are under-used. LLMs make this problem worse

makefizz.buzz

41–50 of 59 posts

Re: Libraries are under-used. LLMs make this problem worse

#41
post #9

”Dunning-Kruger effect leads us to understimate the complexity of the problem solved by the library we're considering.” Invoking the smarter-than-thou effect is not a great starting point. See e.g. https://www.sciencedirect.com/science/article/abs/pii/S01602... If we’re considering a library, it would be prudent of us to take a look at the source code to see what exactly we’re pulling in. In the process, we would lea…

The Dunning-Kruger effect absolutely also leads to people releasing libraries they should not have and which nobody should use.

The DK effect only implies that people who know things underestimate their knowledge superiority and people who don't know things underestimate their knowledge inferiority. The popular interpretation that uniformed people think they're informed is not consistent with the DK research.

I don't think DK has anything to do with people releasing libraries that nobody should use.

Re: Libraries are under-used. LLMs make this problem worse

#42

”Dunning-Kruger effect leads us to understimate the complexity of the problem solved by the library we're considering.” Invoking the smarter-than-thou effect is not a great starting point. See e.g. https://www.sciencedirect.com/science/article/abs/pii/S01602... If we’re considering a library, it would be prudent of us to take a look at the source code to see what exactly we’re pulling in. In the process, we would lea…

I learned to consider that if one brings up Dunning-Kruger...projection/irony may be at play. Anyways...I've had a few reoccurring issues with libraries. Note that the language is framed on a case by case basis...not general rules. 1. The essential implementation is a small amount of code...wrapped in structures just for packaging essential code. The wrapping code can be larger & more complex than the essential code.…

I imagine a good example for 4 would be the Tidyverse. It's very nice, but R with and without Tidyverse packages are very different experiences with different syntaxes, conventions, and even communities.

Though the addition of pipes to the base language is helping fix that.

Re: Libraries are under-used. LLMs make this problem worse

#43
post #25
post #24

Earlier quoted context omitted.

That's part of the idea behind https://llmstxt.org/ - even if you ignore the "/llms.txt" URL there's a bunch of thinking around that to help write explanations of things like libraries that can be used to "teach" a model to use it by injecting that into a prompt. I'm still not clear on what the best patterns for this are myself. I've been experimenting with dumping my entire documentation into the model as a single f…

At this point it seems like just learning the library is easier than trying to cram the documentation into an LLM compatible format.

Doing the work to effectively prepare those docs for an LLM probably does involve "learning the library", but once one person has done that (and published the results) many other people can benefit from it.

I'm a library author myself, so publishing LLM-enhanced versions of the docs to help other people use my library more effectively feels like a sensible use of my time.

Re: Libraries are under-used. LLMs make this problem worse

#44
post #37

I'd much rather learn a library than create it from scratch. The two main issues are licensing concerns and being able to find ones that actually do what you need.

The third issue is avoiding “You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.”

(The quotes comes from a different context, but works quite well here as well.)

Re: Libraries are under-used. LLMs make this problem worse

#45
post #15

Unrelated: I initially expected this articles to be referring to public libraries. I think that would be a challenging connection to prove despite it making intuitive sense. On the article: some use cases eg handling dates, fault tolerant queues have so many edge cases and are so mission critical that relying on a battle tested tool makes a lot of sense. However, in my career I’ve seen a lot of examples of a package…

[deleted]

Re: Libraries are under-used. LLMs make this problem worse

#46
Totally disagree. I avoided python for way too long because of how people were abusing pip/anaconda. Especially with such a complete standard library there's no reason to be dragging in external libraries most of the time (except numpy and maybe pytorch if you're doing ML.)

Re: Libraries are under-used. LLMs make this problem worse

#47
post #26

Earlier quoted context omitted.

This is hilarious .

You're right. I didn't fully read what the OP was saying, which is genius; and my response was more towards the article.

I didn't get this either so let me try to explain as ChatGPT did to me:

Monomorphization means taking a generic function and generating a version specific to the type being used, eg a Rust function

  fn identity(x: T) -> T {
      x
  }  
can be compiled into one version for i32 and one for String, which is more efficient since the compiler knows the types:

  fn identity_i32(x: i32) -> i32 { x }
  fn identity_string(x: String) -> String { x }
Semantic monomorphization could mean extracting the parts of the library that are meaningful to generate problem-specific concrete code: instead of importing pandas to do

  import pandas
  df = [{"a": 1}, {"a": 2}]
  total = sum(d["a"] for d in df)
The LLM might skip the import entirely and generate only:

  data = [{"a": 1}, {"a": 2}]
  total = sum(d["a"] for d in data)
If I understood right, the parent found it funny that a comment suggesting we could never use libraries because we can concretize the specific relevant code, would be responded to with a Claude.MD that essentially said "always use libraries instead of concrete relevant code". I missed it because I didn't stop to look up "monomorphization", so I hope this helps anyone else like me get the joke.

Re: Libraries are under-used. LLMs make this problem worse

#48
post #34

Earlier quoted context omitted.

LOL! I thought the article was going to be about reading books and ChatGPT! And yes, I agree. https://www.npmjs.com/package/boolean >converts lots of things to boolean. >3 million weekly downloads This is insane.

3 million weekly downloads for a package that is “deprecated” and the source repo no longer exists. Truly insane.

Even if it wasn't deprecated this is literally

    ['yes', 'y', '1'].indexOf(input.toLowerCase()) !== -1
People adding a dependency to avoid writing one line of code...

Re: Libraries are under-used. LLMs make this problem worse

#49

Earlier quoted context omitted.

You're right. I didn't fully read what the OP was saying, which is genius; and my response was more towards the article.

I didn't get this either so let me try to explain as ChatGPT did to me: Monomorphization means taking a generic function and generating a version specific to the type being used, eg a Rust function fn identity (x: T) -> T { x } can be compiled into one version for i32 and one for String, which is more efficient since the compiler knows the types: fn identity_i32(x: i32) -> i32 { x } fn identity_string(x: String) -> S…

Nah, I found it hilarious that any LLM would have any clue what would constitute ‘well baked’ in the context, or that any of this was going to end well.

Re: Libraries are under-used. LLMs make this problem worse

#50
post #49

Earlier quoted context omitted.

I didn't get this either so let me try to explain as ChatGPT did to me: Monomorphization means taking a generic function and generating a version specific to the type being used, eg a Rust function fn identity (x: T) -> T { x } can be compiled into one version for i32 and one for String, which is more efficient since the compiler knows the types: fn identity_i32(x: i32) -> i32 { x } fn identity_string(x: String) -> S…

Nah, I found it hilarious that any LLM would have any clue what would constitute ‘well baked’ in the context, or that any of this was going to end well.

And what prevents it from having a clue?
Post reply on HN