Kache

joined 2 years ago
[–] [email protected] 3 points 4 weeks ago* (last edited 4 weeks ago)

It's a container with certain behaviors and guarantees making them easy and reliable to manipulate and compose. A practical example is a generic List, that behaves like:

  • List[1, 2, 3], i.e. ("new", "unit", "wrap") to create, containing obj(s)
  • map(func) to transform objs inside, List[A] -> List[B]
  • first(), i.e. ("unwrap", "value") to get back the obj
  • flat_map(func), i.e. ("bind") to un-nest one level when func(a) itself produces another List, e.g. [3, 4].flat_map(get_divisors) == flatten_once([[1, 3], [1, 2, 4]]) == [1, 3, 1, 2, 4]

Consider the code to do these things using for loops -- the "business logic" func() would be embedded and interlaced with flow control.

The same is true of Maybe, a monad to represent something or nothing, i.e. a "list" of at most one, i.e. a way to avoid "null".

Consider how quickly things get messy when there are multiple functions and multiple edge cases like empty lists or "null"s to deal with. In those cases, monads like List and Maybe really help clean things up.

IMO the composability really can't be understated. "Composing" ten for loops via interlacing and if checks and nesting sounds like a nightmare, whereas a few LazyList and Maybe monads will be much cleaner.

Also, the distinction monads make with what's "inside" and what's "outside" make it useful to represent and compartmentalize scope and lifetimes, which makes it useful for monads like IO and Async.

[–] [email protected] 2 points 1 month ago

Python deps can be dynamic, so it can be necessary to download the package and execute code just to find out.

Would be nice to see a resource that lists out the statically defined ones, though. Perhaps that'd pressure the dynamic ones to change -- it's a cause for some of the notorious pain of Python packaging.

[–] [email protected] 2 points 1 month ago* (last edited 1 month ago)

IMO it will "succeed" in the early phase. Pre-seed startups will be able demo and get investors more easily, which I hear is already happening.

However, it's not sustainable, and either somebody figures out a practical transition/rewrite strategy as they try to go to market, or the startup dies while trying to scale up.

We'll see a lower success rate from these companies, in a bit of an I-told-you-so-moment, which reduces over-investment in the practice. Under a new equilibrium, vibe coding remains useful for super early demos, hackathons, and throwaway explorations, and people learn to do the transition/rewrite either earlier or not at all for core systems, depending on the resources founders have available at such an early stage.

[–] [email protected] 3 points 2 months ago* (last edited 2 months ago)

Highly recommend having some scripting/interpreted language in your stack -- in fact you likely already do (consider how shell scripting makes up a significant part of Dockerfiles)

It's an incredibly useful intermediate between freeform-but-non-executable text/docs/wikis and "industrial-grade"-but-inflexible tooling

In other words, a great fit for capturing this partial/incomplete/tribal knowledge space the post is talking about. I personally even go a bit further and actively advocate for converting "onboarding/operational docs" from wikis into scripts that print out the equivalent text that can be committed and incrementally automated.

[–] [email protected] 51 points 2 months ago* (last edited 2 months ago) (10 children)

In my experience, LLMs aren't really that good at summarizing

It's more like they can "rewrite more concisely" which is a bit different

[–] [email protected] 1 points 2 months ago* (last edited 2 months ago) (1 children)

Thinking about that quote, it sounds nonsensical

At the outset, all businesses seek to grow faster than the average/stock market. Five years later, half will do better than average, and half will do worse than average.

Saying that the half that did worse should have instead invested into the market, five years ago, is kind of meaningless.

[–] [email protected] 2 points 2 months ago

Also have the option of selectively/strictly enforcing in CI, to get an experience & protections similar to "compile-time type checking"

[–] [email protected] 2 points 2 months ago

it lacks clear and enforced type restrictions which help with clear code contracts

Not anymore! Gradual typing is supported by the core language and pyright is a fantastic incremental type checker that you can use both in your editor and in CI.

[–] [email protected] 4 points 3 months ago (2 children)

You cannot, and that's why that type declaration models a NonEmpty that a type checker can enforce

[–] [email protected] 3 points 4 months ago

I think it's unfortunately a tragedy of the commons/prisoner's dilemma problem

Simplifying, a single store is not going to be able to improve pay for all the underpaid members of society, but what they can do is run thinner margins while staying in business (pay employees less, spend more on security, etc). Paying only their own employees more also does little to reduce the overall chances of theft.

Perhaps a better global equilibrium exists at higher wage rates, but there are limited options at local levels. For low-end wages, I think the downward pressure exceeds the upward wage pressure of the "free market" b/c the negotiation is between someone making a less profit vs someone failing to make a living -- the negotiating power is not balanced. This is why IMO minimum wage to some degree is important.

[–] [email protected] 1 points 4 months ago* (last edited 4 months ago) (1 children)

Hm, that's kind of interesting

But my first reaction is that optimizations only at the "Python processing level" are going to be pretty limited since it's not going to have metadata/statistics, and it'd depend heavily on the source data layout, e.g. CSV vs parquet

 

Thanks for the app.

I like how Connect is fairly good at embedding previews, e.g. https://lemmit.online/post/2476390

However, Connect is currently unable to embed Lemmy posts of Reddit galleries.

For example: https://lemmit.online/post/1045136
Points to: https://www.reddit.com/gallery/172hfko
(Old Reddit): https://old.reddit.com/r/whatisthisthing/comments/172hfko/what_are_these_swans_i_found_at_a_flea_market/

Also looking forward to open-sourcing & F-Droid release!

view more: next ›