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

Anthropic's announcement today of their experimental new "Claude Imagine" feature reminded me of a blog post I wrote in the middle of last year, based on a project I built that feels very similar!


Hey! I've received this feedback from a few different people, and I agree with it. The latest version of Blots (0.8.0) changes the behavior of broadcast comparisons. Now, comparisons are applied to each element in the list, producing a new list of booleans. As you pointed out, this better matches the broadcasting behavior of arithmetic operators:

``` [1, 2, 3] * 10 // [10, 20, 30] [10, 20, 30] + 2 // [12, 22, 32] [4, 5, 6] > 3 // [true, true, true] [1, 2] == [2, 2] // [false, true] ```

In addition, I’ve added both `all` and `any` as built-in functions. These can be used to achieve the same result as the previous broadcasting behavior:

``` [4, 5, 6] > 4 into all // false [4, 5, 6] > 4 into any // true

// alternatively: all([4, 5, 6] > 4) // false any([4, 5, 6] > 4) // true ```

Thanks for the feedback!


Good question! Personally, I don't often reach for jq as I've never really taken the time to get comfortable with its syntax. Obviously I can now have an LLM generate me a jq command that'll do what I want, but I'd prefer to be able to at least visually scan the suggested implementation to make sure it actually does the thing I want before I go and run it.

More broadly, a lot of other command line utils for transforming input have such an emphasis on terseness that I sort of bounce off of them. awk and sed and jq are all super powerful tools, but I wanted a tool that had a more balanced trade-off of characters vs. clarity.


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

Search: