Better HN
topnewbestaskshowjobs
Log inSign up

mgsloan2

55 karma · joined Aug 10, 2021 (5y ago) · 27 submissions

Submissions

comment 1mo ago · link · parent

A cross-crate dead code analysis would mean that compilation of a crate now depends on information about its dependents. This would break reuse of compiled crates and cause recompiles when the analysis changes.

Something does seem a little off about this, though. Ideally for this `Debug` case there would be an annotation that says "compile this lazily, don't inline". Maybe there doesn't even need to be a new annotation, just `#[inline] #[cold]`. Which looks pretty weird, but might work already.

comment 1y ago · link · parent

My homedir is just a git repo, similar to https://www.atlassian.com/git/tutorials/dotfiles. The .git folder has a different name so that git commands aren't accidentally applied to it. What I love most about this is keeping my homedir clean - I can see what files are new (untracked) and either delete them or add to .gitignore

comment 1y ago · link · parent

Very fun to peruse! Curious why the olivetti typewriter has such strangely shaped key caps.

While it seems like OLPC didn't really achieve the full vision of the project, I have some anecdata of success - my coworker got an OLPC when young (otherwise without access to computers), learned to code on it, and is now an awesome programmer.

comment 1y ago · link · parent

Collection of data from code completions is off by default and opt-in. It also only collects data when one of several allowlisted opensource licenses are present in the worktree root.

Options to disable crash reports and anonymous usage info are presented prominently when Zed is first opened, and can of course be configured in settings too.

comment 1y ago · link · parent

You could, but it is extremely expensive to train an LLM that is competitive on coding evals. So, I was assuming use of a model someone else trained.

Also, if it is only trained on code, it's likely to miss out on all the world knowledge that comes from the rest of the data.

comment 1y ago · link · parent

Sounds like cool stuff, along the lines of structure editing!

The question is not whether it can work, but whether it works better than an edit tool using textual search/replace blocks. I'm curious what you see as the advantage of this approach? One thing that comes to mind is that having a cursor provides some natural integration with LSP signature help

Yes agentic loop with diagnostic feedback is quite powerful. I'd love to have more controllable structured decode from the big llm providers to skip some sources of needing to loop - something like https://github.com/microsoft/aici

comment 1y ago · link · parent

I agree the current way tools are used seems inefficient. However there are some very good reasons they tend to operate on code instead of syntax trees:

* Way way way more code in the training set.

* Code is almost always a more concise representation.

There has been work in the past training graph neural networks or transformers that get AST edge information. It seems like some sort of breakthrough (and tons of $) would be needed for those approaches to have any chance of surpassing leading LLMs.

Experimentally having agents use ast-grep seems to work pretty well. So, still representing a everything as code, but using a syntax aware search replace tool.

comment 1y ago · link · parent

See for example https://opensource.google/documentation/reference/using/agpl...

> Code licensed under the GNU Affero General Public License (AGPL) MUST NOT be used at Google.

comment 2y ago · link · parent

Doesn't seem like its proven to work, but looks like it can be purchased, called "Profi Nasal Spray".

comment 2y ago · link · parent

Whoah, that interpretation seems pretty wild to me. They put a lot of effort into building a pizza oven and someone else tore it down, and they should feel nothing about this?! If an artist sells their painting they shouldn't care if the new owner paints over a section?

Beyond the sentimental attachment to the pizza oven, I'd be bothered by the sheer inefficiency of it.

comment 3y ago · link · parent

https://mgsloan.com - 11 posts about unorthodox computer ergonomics. 6 posts about Haskell ideas / weird tricks. Haven't posted in a couple years but would like to get back to it. Notable HN discussions:

- https://news.ycombinator.com/item?id=28118381 - Supine Computing (2019)

- https://news.ycombinator.com/item?id=21842663 - Outdoor Computing with a Deck Desk

comment 3y ago · link · parent

Same path for me, I like the v-moda headphones a lot, but the hinge mechanism is way too fragile, and the charge port broke, so the bluetooth pair was my last v-moda headphone. I also switched to beyerdynamic and have been very happy with them. Only downside of this durability is that they are not foldable - would be great to have headphones with a high durability folding mechanism

comment 3y ago · link · parent

I love this concept! When I got tired of replacing headphones in the past I got some beyerdynamic dt770 modded by jfunk.org. They are repairable and durable. Though they are not natively bluetooth, can use a short cable + qudelix 5k to make them wireless. No noise cancelling.

Would be very nice to have durable / repairable noise cancelling headphones. These headphones from fairbuds look great overall, but I'm skeptical of the durability of the hinges.

comment 3y ago · link · parent

> if your type-system is sufficently strong to express this

No fanciness needed, just plain old sum types. It is certainly possible to express those invariants directly in languages with a dependent type systems or refinement types like in liquid haskell - see https://ucsd-progsys.github.io/liquidhaskell-tutorial/Tutori.... It's typically much easier to reason about and use sum types, though.

Of course these examples are trivial and silly, but I see instances of these patterns all the time in big co software, and of course usually the invariants are far more complex but many could be expressed via sum types. I've seen loads of bugs from constructing data that invalidates assumptions made elsewhere that could have been prevented by sum types, as well as lots of confusion among engineers about which states some data can have.

> Field X is only set if field Y is true

Original gnarly C style pattern:

    struct TurboEncabulatorConfig {
        // When true, the turbo-encabulator must reticulate splines, and 'splines'
        // must be non-null. When false, 'splines' must be null.
        bool reticulate_splines;
        struct Splines *splines;
    };
Rust (let's ignore pointer vs value distinction):

    enum TurboEncabulatorConfig {
        NonReticulatingConfig,
        ReticulatingConfig { splines: Splines },
    }
> If field X is non-null then field Y must be null and vice-versa.

Original gnarly C style pattern:

    struct TurboEncabulatorConfig {
        // When non-null, lunar_waneshaft must be null. 
        struct Fan *pentametric_fan;
        // When non-null, pentametric_fan must be null.
        struct Shaft *lunar_waneshaft;
    };
Rust:

    enum TurboEncabulatorConfig {
        PentametricTurboEncabulator { pentametric_fan: Fan },
        LunarTurboEncabulator { lunar_waneshaft: Shaft },
    }

comment 3y ago · link · parent

In my experience with languages that lack concise sum types and pattern matching, you end up with data types that have lots of implicit invariants. If you find yourself writing docs or thinking in your head things like "Field X is only set if field Y is true" or "If field X is non-null then field Y must be null and vice-versa", then these are indications that sum types would model the data better. Then these invariants can be followed by construction, and it becomes clear what's available at data access - great for interface clarity, robustness, dev tools, morale, etc.

Relatedly, storing booleans is a smell, imho typically an enum or sum type is always better in languages that have concise syntax for these. True and False are meaningless without context, and so can easily lead to errors where they are provided to a different context or generally misused due to a misunderstanding about the meaning.

comment 3y ago · link · parent

Yeah, but ref-log is scary to beginners (I suppose rebase is too!). Rebase was a poor example, but even so, it is way easier to copy a snapshot number out of your cli and restore than it is to dig through your reflog for the right sha

ref-log doesn't save you in so many situations. As you point out, you have to commit all the time for it to save you. Even then, git repo corruption is possible and then you are hosed.

For example:

* a hard reset clears your working copy changes

* you pop a stash you didn't mean to, atop your working copy changes. Now your working copy changes are intermixed with the stash and you have to manually decouple them.

* you accidentally stage hunks to your index and its tricky to unstage them because they are adjacent to other hunks

Such a tool also saves you from accidentally saving over your work in the text editor. It generally makes it so that you don't need to be as careful.

So, generally, git commands that affect your working copy are not undo-able and can be very time consuming to undo if you have no proper time machine underneath your repo. I happily have experienced the bliss of having this reassurance, but it is only within a proprietary env.

comment 3y ago · link · parent

Pretty cool!

One idea I really like for avoiding VCS operation anxiety for beginners and experts alike is a filesystem layer that allows revert to any historical state. You just have your bash prompt output the current snapshot number, and then can use that as the revert target if there's a botched rebase or so. Unfortunately I do not know of a nicely packaged way to do this, or how to do it at all with OSS tools (but I bet it is feasible!).

comment 5y ago · link · parent

That is true, this is my parent's hammock. I own a dutchware chameleon hammock - see this post about using it for computing https://mgsloan.com/posts/ergo-update-hammock-under-deck/

comment 5y ago · link · parent

Some have swappable cables! Ergodoxes typically use TRRS audio cables. Keyboardio uses ethernet between the two halves.

There are also some fully wireless split keyboards like the southpaw centromere. I found the thumb keys to be too inward / too few for my taste.

comment 5y ago · link · parent

Hah, yes experimenting in life is good :)

If you want to see more wildness, a couple of my other posts are more unusual:

* https://mgsloan.com/posts/polarizer-glasses/ * https://mgsloan.com/posts/tree-based-computing/

comment 5y ago · link · parent

For a while I had a misting setup during the summer, at my deck desk. I didn't have any trouble with electronics. These days I'm in Colorado which tends to be relatively dry.

One solution to sun is to use shade strategically - https://mgsloan.com/posts/tree-based-computing/#handling-the...

comment 5y ago · link · parent

Interesting! I haven't tried it yet, but perhaps foam wedges would be a cost effective approach? (typically used as yoga props)

For positioning the laptop, suspending it works pretty decently for laptops that have a large range of motion in the hinges - https://mgsloan.com/posts/suspending-laptops/

comment 5y ago · link · parent

I think there's quite a bit of variety in people's alertness in reclined / supine postures. Personally I have trouble sleeping unless conditions are really good for it. This sucks, but I think related to this trait is that it takes quite a while for me to feel sleepy as a result of supine / reclined postures.

comment 5y ago · link · parent

Thank you! I appreciate your tips. Yes, I move around a lot, I practice acrobatics at least a few times a week :) I think the original injury may have something to do with doing back bends improperly years ago, or snowboarding.

I recently went to one session with a PT to diagnose it, since it's returned again this year. It's probably chronically strained quadratus lumborum or some other muscle involved in spinal extension. Avoiding upright sitting as much as possible definitely helps. I've recently moved closer to things so that I can bicycle to most things instead of driving, and I think that's helped too.

The PT thinks the solution is to train my movement patterns to use more core / glute stabilization rather than dumping the responsibility on the back muscles. There are various exercises to help train those patterns and strengthen then muscles involved.

comment 5y ago · link · parent

Glad you enjoy todoist-shortcuts!

Very interesting about hands elevated above chest height. I also thoroughly agree about using a variety of postures. I think for a lot of folks supine / reclined might be too relaxing for work. I find it to work decently for an hour or two before feeling lazy

comment 5y ago · link · parent

Hell yeah! I particularly find it easy to move around with my keyboard strapped to my belt - https://mgsloan.com/posts/tree-based-computing/

comment 5y ago · link · parent

Author of the supine computing post here. I agree thoroughly that variety is best for health overall. In a different post I wrote a section about it: https://mgsloan.com/posts/deskless-ergo-wfh/#variety-is-key . I think it comes up elsewhere, but I should probably emphasize it in every post!