Readit News logoReadit News
emptysea commented on Rethinking Syntax: Binding by Adjacency   github.com/manifold-syste... · Posted by u/owlstuffing
evanb · 7 days ago
Mathematica has Infix [0], which expresses the adjacency with a ~ (because Mathematica reserves pure blankspace for multiplication). But it works fine to do eg. `"hello"~StringJoin~" world"`; I was always surprised we could only have the predefined operators in many other languages and we couldn't define our own.

This seems like a great attempt. I would be worried about how much parsing and backtracking might be required to infer the infix precedence in a totally general system (like garden-path sentences[1]) or actually ambiguous parse trees (which is cured by adopting some rule like right precedence and parens, but what rule you pick makes some 'natural language' constructions work over others).

[0] https://reference.wolfram.com/language/ref/Infix.html

[1] https://en.wikipedia.org/wiki/Garden-path_sentence

emptysea · 7 days ago
In Postgres you can define custom operators via `create operator`[0]

    -- infix
    select a <!!!> b;

    -- prefix
    select <||> a;
A lot of custom types end up using this [1].

    select @-@ '[(0,0),(1,0),(1,1)]'::path;
    -- 2

[0] https://www.postgresql.org/docs/current/sql-createoperator.h... [1] https://www.postgresql.org/docs/current/functions-geometry.h...

emptysea commented on Everything as code: How we manage our company in one monorepo   kasava.dev/blog/everythin... · Posted by u/benbeingbin
odie5533 · 3 months ago
What do you use for feature flags?
emptysea · 3 months ago
Not OP, but I think building feature flags yourself really isn’t hard and worth doing. It’s such an important component that I wouldn’t want to depend on a third party
emptysea commented on Java Hello World, LLVM Edition   javaadvent.com/2025/12/ja... · Posted by u/ingve
Octoth0rpe · 3 months ago
I've been playing with a very basic compiler for a language that looks a bit like go -> llvm ir, but I'm finding myself constantly revising my AST implementation as I progressively add more things that it needs to represent. Is anyone aware of any kind of vaguely standardized AST implementation used by more than one project? I've been searching this morning for one and am coming up empty. My thinking is that if I can find some reasonably widely used implementation, then hopefully that implementation has thought out lots of the corner cases that I haven't gotten to yet.
emptysea · 3 months ago
Ruff’s ast is used by Ruff, Ty, and Pyrefly
emptysea commented on Track Errors First   bugsink.com/blog/track-er... · Posted by u/GarethX
bheesink · 9 months ago
We are testing Bugsink for a few (Django) projects now and it works great. Implementation is very easy, in two steps, if you are already using the Sentry SDK (there is no third step, as the documentation states :) We value the privacy of our end users and therefore it is important to us that the data stays within the EU.
emptysea · 9 months ago
Pretty sure you can get EU data residency with sentry

https://docs.sentry.io/organization/data-storage-location/

emptysea commented on Pyrefly vs. Ty: Comparing Python's two new Rust-based type checkers   blog.edward-li.com/tech/c... · Posted by u/edwardjxli
claytonjy · 10 months ago
for decades, big tech contributed relatively little in the way of python ecosystem tooling. There’s Facebooks Pyre, but that’s about it. Nothing for package/dependency management, linting, formatting, so folks like those at Astral have stepped up to fill the gap.

why is type checking the exception? with google and facebook and astral all writing their own mypy replacements, i’m curious why this space is suddenly so busy

emptysea · 10 months ago
Instagram built a linter with the ability to fix errors which is an improvement over flake8 & pylint: https://github.com/Instagram/Fixit

But Ruff is an even greater improvement over that

emptysea commented on Getting AI to write good SQL   cloud.google.com/blog/pro... · Posted by u/richards
flysand7 · 10 months ago
Having written more SQL than any other programming language by now, every time I've tried to use AI to write the query for me, I'd spend way more time getting the output right than if I'd just written it myself.

As a quick aside there's one thing I wish SQL had that would make writing queries so much faster. At work we're using a DSL that has one operator that automatically generates joins from foreign key columns, just like

    credit.CLIENT->NAME
And you got clients table automatically joined into the query. Having to write ten to twenty joins for every query is by far the worst thing, everything else about writing SQL is not that bad.

emptysea · 10 months ago
That's one of the features of EdgeQL:

    select Movie {
      id,
      title,
      actors: {
        name
      }
    };

https://docs.geldata.com/learn/edgeql#select-objects

Although I think good enough language server / IDE could automatically insert the join when you typed `credit.CLIENT->NAME`

emptysea commented on Ty: A fast Python type checker and language server   github.com/astral-sh/ty... · Posted by u/arathore
nickagliano · 10 months ago
Interesting to see astral come out with this right around facebook’s release of “Pyrefly, a faster Python type checker written in Rust”.

Not making any sort of ethical statement, just interesting that rust keeps eating the python and JS tooling worlds.

emptysea · 10 months ago
Also interesting, pyrefly uses Ruff’s parser!

https://github.com/facebook/pyrefly/blob/a8626110da034f8e513...

emptysea commented on Pyrefly - A faster Python type checker written in Rust   pyrefly.org/... · Posted by u/muglug
ndr · a year ago
It's slow as hell. And every version bump comes with a bunch of new warnings/errors by default that is quite disruptive if you want to keep it quiet. But mostly that it is annoyingly slow.
emptysea · a year ago
Might be worth checking out https://github.com/DetachHead/basedpyright

But I’ve had the same issue with too many warnings, mypy is better at understanding Python but even slower.

u/emptysea

KarmaCake day534June 23, 2018View Original