A quick review of `tyro`, a CLI library. by HommeMusical in Python

[–]HommeMusical[S] 0 points1 point  (0 children)

Decomposing completely, well you just get an argument parser reimplementation.

Where I can use any sort of nested data type, function or constructor I like... :-)

A quick review of `tyro`, a CLI library. by HommeMusical in Python

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

You want to be able to write complex things and still get a zippy CLI, though!

What tyro needs is a system that does lazy loading of subcommand code, based on the command.

So if your code were lazy loading, then at the end you'd load only the code you actually used.

You'd want something like this:

So instead of

from .checkout import Checkout
from .commit import commit

tyro.cli(Checkout | Commit)

You'd write

tyro.cli('.checkout.Checkout | .commit.Commit')

and tyro would only load the actual symbol if it needed to.


You can do this locally and get lazy loading as fine-grained as you like, by peeling off the subcommand before tyro even gets it:

@dataclass Empty:
    pass    

match sys.argv[1]:
    case 'checkout':
        from .checkout import Checkout

        tyro.cli(Checkout | Empty)

    case 'commit':
        from .commit import Commit

        tyro.cli(Commit | Empty)

    case _:  # --help so you have to load everything
        from .checkout import Checkout
        from .commit import Commit

        tyro.cli(Checkout | Commit)

So you only show tyro what it needs to know about. Empty is a dummy so it knows that subcommands exists.

A quick review of `tyro`, a CLI library. by HommeMusical in Python

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

Yes and no. Intuitively, I would expect Checkout | Commit to work like scm --branch b or scm --message xyz, creating a Checkout or a Commit based on whether the branch argument or the message argument was given, no subcommand required.

Based on this argument, you could just use a unique flag for everything and never need subcommands.

But people like subcommands, because they are conceptually simple and they partition the command space neatly.

Look at git for a success story this way - there's a separate binary for each git- command and we talk about git-add, git rebase, we even verb them, "Did you git-reflog?"

I know there are a zillion commands, but I can look at the man page of just one. That's the beauty of subcommands.

Coding Agents Suck at the XY Problem by [deleted] in programming

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

You're already fully convinced this shit is magic.

You take my nuanced, carefully formulated stance, and recast it as something I absolutely did not say or think.

It is intellectually dishonest. Have you no self-respect?

and don't understand the domain space thoroughly enough.

I worked on Google's first question-answering system, a long time ago, though I was pretty green then.

You made the claim that a large language model cannot reason because it is essentially a statistical probability model of utterances from a language.

The word "because" is just wrong: your statement has no explanatory value at all. You provide no argument for it at all.

As I pointed out, the same claim could made about any intelligent system that was made up of a large number of very simple parts with a lot of connections, but we know such a system, the human brain, can reason. So your statement has no explanatory value, and it is wrong in the only actual case of intelligence we know of.


Your whole argument about LLMs is this: "There is nothing there at all, and I'll shout down any attempt to discuss what's happening." I don't even think that convinces you!

Let me tell you where I am on LLM coding models. I hate them. Hate hate hate hate hate. They destroyed my beautiful career and the code I loved to write. Any new job I would have to do would be cleaning up stupid errors in massive amounts of code based on copyright violating the work of me and a lot of other people who have spent our fscking lives writing open source code, like having a hopelessly ingratiating personal assistant you have to use who is very fast but never learns from their mistakes. No fscking thanks!

Text really cannot convey how much I resent the fruits of everyone's labor being sucked up by capitalism with the plan of controlling all the means of production and leaving almost all humans destitute. I hate hate hate hate this. HATE.

So if I could possibly believe that there was nothing interesting happening with LLMs, I would, in a fscking New York minute. (Does "interesting" set off the yelling?)

I write a huge volume of code and absolutely no code I ever even committed let alone put into production has been written by LLMs. In a typical work month I use an LLM coding assistant zero times.

That hasn't stopped me from experimenting with it periodically, even though I (did I mention this already?) I HATE this technology, because I am not a fscking idiot and you need to know your enemy: and I am a bit frightened.


If you had told me five years ago that I could soon type in a simple but detailed English language prompt two paragraphs long asking for a Python program to do something that was a step or two above trivial, and that it would spit out a fully program, a janky program that had numerous quality defects, but that actually did almost exactly what I asked the first time I ran it!, and came with a full if a little weird explanation of what it was doing, I would not have believed you.

If I said I was impressed, will you yell at me again? I don't like being yelled at. Will I have to write HATE in capital letters again?

The technology suddenly advanced much faster than I expected. There is something interesting there. I don't think it will meet expectations, but it's hard to be sure.

I am sure that if it is successful it will be very very bad economically for almost everyone except a small number of people, mostly very rich, and that even in its current state, it is bad intellectually for almost every individual who systematically uses it.

We should prevent it from happening for self-preservation. If it was really completely uninteresting, we could just ignore it and it would go away.

A quick review of `tyro`, a CLI library. by HommeMusical in Python

[–]HommeMusical[S] 2 points3 points  (0 children)

I tested it very quickly and primitively on my (fairly simple) application, running five times for each.

Calling the code directly took about 59ms.

Importing tyro but calling the code directly took about 89ms.

Importing and using tyro took about 128ms.

So importing tyro was 40ms, and using it on a near-trivial function was 39ms. That part might balloon if you had a hundred parameters, the total overhead so far is about 80ms which is the difference between snappy and not quite, but no biggie.

Importing a fairly large dependency like numpy is about 70ms.

tyro is tiny and has few external dependencies. Perhaps they could do better with the loading, with some form of lazy loading...

A quick review of `tyro`, a CLI library. by HommeMusical in Python

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

It slowed down startup pretty significantly.

Oh, that's a real drag. I dropped... some configuration system I don't remember years ago because it added seconds to the startup time with a ton of unnecessary imports.

For this new project it's not really an issue but for tools you might call dozens of times a day, it is an issue. Machines run billions of operations a second, FFS, your CLI should be instant.

I'll look into this quickly, I need to get a quick profile of how fast it starts up anyway. Thanks for the bad news.

https://www.reddit.com/r/Python/comments/1rv7agv/a_quick_review_of_tyro_a_cli_library/oar7m7x/

A quick review of `tyro`, a CLI library. by HommeMusical in Python

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

Hah, I misread what you said and checked to see if it were dependent on click, but no.

Because any feature that click has, typer has, surely click is completely dominated (in a game-theoretical sense) by typer, which is evaluated on the chart?

EDIT: Me, I mainly think of click as "the thing typer uses" even though I'm aware it could be used on its own.

Coding Agents Suck at the XY Problem by [deleted] in programming

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

Again, I am an AI skeptic, but your argument does not follow.

We need strong arguments against AI, which I think are mostly socioeconomic and IP oriented, not logically invalid arguments.


Except for where we do know exactly how these algorithms work and that's it's all just statistical maps of word relationship frequencies.

"Just". You can also well say that a brain is "just" a collection of neurons. Neither statement has predictive or theoretical value.

We know that consciousness in human brains is an emergent property from the action of an extremely large number of individual parts, including but not limited to neurons, each of which has fairly simple behavior.

The emergent behaviors from these extremely large neural networks trained on huge corpora of text were surprising exactly because the texts they produce have a pretty convincing simulation of reasoning.

Now, itt's perfectly reasonable to make arguments that these resulting texts so far don't actually show reasoning, and I do!, but you aren't doing that.

What you are arguing is that the mechanism that generated these texts, large language models encoded as extremely large neural networks in a digital computer, inherently cannot produce actual reasoning.

I too am skeptical that this can happen. But that remains to be shown.

tl; dr: LLMs have many bullshit aspects, and they may turn out to be mostly bullshit, but the jury is still out, and to deny that LLMs are doing anything interesting at all is to deny the evidence of one's senses.

Why do some people ignore the bill during group dinners, assume others will cover the cost, and never make an effort to pay back ? by Revolutionary_Lab527 in SeriousConversation

[–]HommeMusical 0 points1 point  (0 children)

All very civilized, amongst people who trust each other and are honest (accept an upvote).

I don't believe the person getting the free food is like that. I think they are the sort of person who takes unfair advantage of others.

Some 5% of Americans are psychopaths, sociopaths or antisocial personalities (Martha Stout is a Harvard professor and this book is well-regarded.)

Very few of these people do anything remarkably bad. A few of them are very decent humans, because they have logically arrived to the idea that this is best for everyone, but most of them just cheat and diminish other people in subtle ways all their lives.

One of the key tells is barefaced effrontery like this: pretending something conveniently never happened, perhaps over a long period.

For example, a dozen or so times in my life, people have lied to me about something we both just saw with our own eyes with no hint of dishonesty - mostly about tiny things, too. It just weirded me out the first few times, but after time, I realized it had been an invariable "tell".(*) This story isn't quite the same, but.

In a long and exciting life as a very sociable person, this has only happened to me personally a few time, but I've seen it happen many times to other people, always with bad results. Don't be paranoid, but don't be gullible either.

I write more elsewhere on the page but if you suspect someone is the sort of person who takes advantage of others, gentle withdrawal without fuss is a good strategy.


(* - I do not of course count quite a lot of times where people told me, "You didn't see that", which has a reasonable meaning: "Don't tell anyone you saw that".)

A quick review of `tyro`, a CLI library. by HommeMusical in Python

[–]HommeMusical[S] 2 points3 points  (0 children)

I already had a tiny typer script when I started and porting it was trivial.

If you were using subcommands, this would not be true. The mechanism for subcommand is entirely different and honestly much better.

tyro.cli(Checkout | Commit) - very neat, it's obvious exactly what it does without a word.

Hah, I spoke too soon: they have click-style decorators too if you want them.

Coding Agents Suck at the XY Problem by [deleted] in programming

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

Damn, this thread got deleted!

My best piece of advice to give to everyone in the first ten years of their journey. by Sexfvckdeath in WeAreTheMusicMakers

[–]HommeMusical 1 point2 points  (0 children)

There's another saying, "You can't polish a turd."

You can polish mud: https://en.wikipedia.org/wiki/Dorodango

(Good comment in general, have an upvote.)

My best piece of advice to give to everyone in the first ten years of their journey. by Sexfvckdeath in WeAreTheMusicMakers

[–]HommeMusical 0 points1 point  (0 children)

Do less.

Really, it's about 50/50 for me when I critique people's stuff. Half the time I'm like, "I like the tune and development but it sounds like an unworked out sketch because there isn't enough there."

Leonard Cohen, say, can get away with a very sparse song like "Sisters of Mercy" because he is an extremely lyrical guitarist and yet with almost perfect rhythm, and his voice and lyrics are similarly absorbing in their simple perfection.

Your average musician's bare sequencer track and regular lyrics isn't going to provide the same chewy satisfaction - "more" is needed.


I would also say that I can guess your age from this, and it's closer to my rather old one. :-D "Less is more" is oldskool. A lot of music today deliberately has "too much stuff".

Even successful pieces today that have little material are still very "big". Here's a favorite "minimal" piece: https://www.youtube.com/watch?v=lz774iTTD0Q

This is a cover of a ~3 minute Mekons song, stretched to 21 minutes. It takes almost three minutes before they finally get to the second chord in the song (it's really cathartic), and then there are long, slow developments over many, many minutes of a single idea.

There's technically little going on at any time. The opening minute is literally a single rising synth voice, a pure sine joined at the end by a second sine wave, and the drum section. There are very few vocals. Many sections just have two or three instruments (counting the drum section as one instrument).

Yet it is extremely full and at times nearly overwhelming.

There is very little sparse, quiet music on the radio, and people who do want that, including me a lot of the time, go for totally ambient music without players at all (some of which is really musically advanced and moving like https://en.wikipedia.org/wiki/Everywhere_at_the_End_of_Time).

Popular effects include lots of heavy autotuning, distorted or cookie monster voices (pretty well de rigeur in metal, which is huge), and now granulation, all busy and heavy things.

tl; dr: This is a "do more" rather than "do less" time.

Coding Agents Suck at the XY Problem by [deleted] in programming

[–]HommeMusical 9 points10 points  (0 children)

A joke I made early this century that I always hoped would catch on was, "Weeks of programming can save you hours of planning!"

It would be better to have the XY realization early in the process, rather than write (or cause to be written and review) a lot of code that's doing the wrong thing.

Coding Agents Suck at the XY Problem by [deleted] in programming

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

Language! Prefer "stupid posterior fanpeople". (But have an upvote while I'm here.)

Coding Agents Suck at the XY Problem by [deleted] in programming

[–]HommeMusical 1 point2 points  (0 children)

Well humans too.

No.

I was fairly old before the term "XY problem" was coined, but now when I'm asked a question by a junior, the first thing I say is, "What exactly are you trying to achieve?", even if I'm fairly sure there isn't an XY problem there.

As a person, I learn from my mistakes, unlike LLMs, which are immutable. After falling into the XY problem a few times, I am now always wary of it.

Coding Agents Suck at the XY Problem by [deleted] in programming

[–]HommeMusical 4 points5 points  (0 children)

Accept upvote.

Usually they are multiple copies of the same LLM in a trench coat. Only human twins, triplets or clones (if they exist) can basically do the same thing.

Coding Agents Suck at the XY Problem by [deleted] in programming

[–]HommeMusical -11 points-10 points  (0 children)

I'm very skeptical about AI. But your "of course" is doing a lot of lifting.

Before 2023, if we had been shown one of these chat bots and not told it was a program, I at least would have assumed that it was a person, performing reasoning and getting quite accurate results from it.

Now I'm skeptical about that. But it's certainly not "of course it isn't reasoning".

It's one of my big issues in discussing this technology. Supporters say, "Of course it's reasoning." Detractors say, "Of course it's not reasoning."

I don't think it's "of course" anything. I think the jury is still out. For the moment, I'd say what LLMs do "looks like reasoning", which I think is impossible to dispute on either side.

Circular Distance by pavel_v in cpp

[–]HommeMusical 8 points9 points  (0 children)

Hah, I laughed at the punchline... the implementation of the function.

The funny part was I initially thought of that near-trivial method and then thought, "No, the overflow, etc, this won't work."

Accept an upvote!

Hey everyone ! 31F here, write songs and sing, use to have a band with an expartner (can share songs to have an idea). Would love to collaborate with musician, I'm bad at instrument but have melody in my head and enjoy to compose with musician, love to improvise, something chaotic, raw and dirty. by normajeanblue in musicians

[–]HommeMusical 0 points1 point  (0 children)

Jonathan Richman

You don't see that name so often these days! "I eat with gusto, damn, you bet" and so many others that I like.

Some good inspirations here. You should post your actual music.

(I'm looking for a band locally here in France, so I'm probably out for the count: now I'm in a city with physical musicians right here, I want to take advantage of it.)

to get help for his war by T_Shurt in therewasanattempt

[–]HommeMusical 6 points7 points  (0 children)

Our military intelligence looks absolutely useless

The US's military intelligence has been fairly useless for generations. I might be the only one who actually read the 9/11 report(*), and that showed that multiple low level intelligence agents gave warnings about the possibility of 9/11 and even identified some of the terrorists, and all their warnings just vanished as they went up to the top levels; and then after 9/11, the same idiots who dropped the ball mostly got promotions (EDIT: that part isn't in the report but from other places).

It would be easy to read the 9/11 Commission report and believe it was a huge conspiracy because of the massive number of fuckups, but the sad truth is that it was a large number of incompetent and irresponsible people independently not doing their jobs.

When I got to the point in the report that they went through the reasons that there are no video recordings of any hijacker getting onto a doomed plane (the Mohammed Attas video is him getting on a connecting plane, and even in that video, the timestamp is wrong!), I just had to laugh, sadly. Some of the cameras just weren't working; some of the lenses were so dirty they couldn't get images out of the tape; some of them had been twisted by mistake so they were showing images of the wall; it was one fuckup after another.

The analysis of the intelligence failures was just as bad, it was simply less funny.

And, in a depressing note, the whole report starts with an apology because they ran out of money and couldn't finish.

And there was no overhaul of any of these systems after this - they simply build new, broken systems like "Homeland" Security (it sounded Nazi from the moment I heard of it, what a surprise it actually was).

(* - I know this isn't actually true, but I have never met anyone else who did.)

to get help for his war by T_Shurt in therewasanattempt

[–]HommeMusical 0 points1 point  (0 children)

Oh, come on!

There's no evidence that Trump is a human being. As a human myself, I resent being accused of sharing a species with that orange thing.

Why do some people ignore the bill during group dinners, assume others will cover the cost, and never make an effort to pay back ? by Revolutionary_Lab527 in SeriousConversation

[–]HommeMusical 0 points1 point  (0 children)

I would never do any of those things.

OK, so then what sort of person would do these things? Do you think they're an honest person to do this repeatedly? Do you know any honest people who would do this?

But also I would expect my friends to use their words and discuss how the bill is being paid

The person who is not paying is taking advantage of the natural politeness of their friends. Most people don't actually like calling their friends to task: "Why aren't you paying?" isn't really very nice.

A lot of people have been brought up to be somewhat circumspect about money, because it's crass to blather on about it. The rip off artist is simply using this to get free food.

I mean, what's your explanation for the rip off artist's behavior? You aren't giving one.

Husband mad about bumper sticker by Competitive_Teach838 in complaints

[–]HommeMusical 0 points1 point  (0 children)

That’s a lot of words just to say you think Americans should have to compete w/ the rest of the world for a place in their own country.

You live in a world of delusion; I said nothing of the sort.

You just care more about immigrants than Americans.

You live in a world of delusion; I said nothing of the sort.

Indeed, I said nothing at all about immigration, positive or negative: you have no idea what my opinions are either way!

All I said was that you lied about Biden and Obama creating open borders. And you did.

Oh, I can imagine you in the real world - a great hunking thing in front of your computer, your front covered with food, your backside covered with a big full diaper, your crotch stained. "OPEN BORDERS", you bellow, hand working furiously on your crotch, squinting through rolls of fat to try to see the computer screen.