LogoThread Easy
  • Explorar
  • Criar thread
LogoThread Easy

Seu parceiro completo para threads do Twitter

© 2025 Thread Easy All Rights Reserved.

Explorar

Newest first — browse tweet threads

Keep on to blur preview images; turn off to show them clearly

Here is the plaintext:

### ast-grep vs ripgrep (quick guidance)

**Use `ast-grep` when structure matters.** It parses code and matches AST nodes, so results ignore comments/strings, understand syntax, and can **safely rewrite** code.

* Refactors/codemods: rename APIs, change import forms, rewrite call sites or variable kinds.
* Policy checks: enforce patterns across a repo (`scan` with rules + `test`).
* Editor/automation: LSP mode; `--json` output for tooling.

**Use `ripgrep` when text is enough.** It’s the fastest way to grep literals/regex across files.

* Recon: find strings, TODOs, log lines, config values, or non‑code assets.
* Pre-filter: narrow candidate files before a precise pass.

**Rule of thumb**

* Need correctness over speed, or you’ll **apply changes** → start with `ast-grep`.
* Need raw speed or you’re just **hunting text** → start with `rg`.
* Often combine: `rg` to shortlist files, then `ast-grep` to match/modify with precision.

**Snippets**

Find structured code (ignores comments/strings):

```bash
ast-grep run -l TypeScript -p 'import $X from "$P"'
```

Codemod (only real `var` declarations become `let`):

```bash
ast-grep run -l JavaScript -p 'var $A = $B' -r 'let $A = $B' -U
```

Quick textual hunt:

```bash
rg -n 'console\.log\(' -t js
```

Combine speed + precision:

```bash
rg -l -t ts 'useQuery\(' | xargs ast-grep run -l TypeScript -p 'useQuery($A)' -r 'useSuspenseQuery($A)' -U
```
**Mental model**

* Unit of match: `ast-grep` = node; `rg` = line.

* False positives: `ast-grep` low; `rg` depends on your regex.
* Rewrites: `ast-grep` first-class; `rg` requires ad‑hoc sed/awk and risks collateral edits.

Here is the plaintext: ### ast-grep vs ripgrep (quick guidance) **Use `ast-grep` when structure matters.** It parses code and matches AST nodes, so results ignore comments/strings, understand syntax, and can **safely rewrite** code. * Refactors/codemods: rename APIs, change import forms, rewrite call sites or variable kinds. * Policy checks: enforce patterns across a repo (`scan` with rules + `test`). * Editor/automation: LSP mode; `--json` output for tooling. **Use `ripgrep` when text is enough.** It’s the fastest way to grep literals/regex across files. * Recon: find strings, TODOs, log lines, config values, or non‑code assets. * Pre-filter: narrow candidate files before a precise pass. **Rule of thumb** * Need correctness over speed, or you’ll **apply changes** → start with `ast-grep`. * Need raw speed or you’re just **hunting text** → start with `rg`. * Often combine: `rg` to shortlist files, then `ast-grep` to match/modify with precision. **Snippets** Find structured code (ignores comments/strings): ```bash ast-grep run -l TypeScript -p 'import $X from "$P"' ``` Codemod (only real `var` declarations become `let`): ```bash ast-grep run -l JavaScript -p 'var $A = $B' -r 'let $A = $B' -U ``` Quick textual hunt: ```bash rg -n 'console\.log\(' -t js ``` Combine speed + precision: ```bash rg -l -t ts 'useQuery\(' | xargs ast-grep run -l TypeScript -p 'useQuery($A)' -r 'useSuspenseQuery($A)' -U ``` **Mental model** * Unit of match: `ast-grep` = node; `rg` = line. * False positives: `ast-grep` low; `rg` depends on your regex. * Rewrites: `ast-grep` first-class; `rg` requires ad‑hoc sed/awk and risks collateral edits.

Former Quant Investor, now building @lumera (formerly called Pastel Network) | My Open Source Projects: https://t.co/9qbOCDlaqM

avatar for Jeffrey Emanuel
Jeffrey Emanuel
Fri Nov 07 17:16:32
A useful addendum to your AGENTS dot md or CLAUDE dot md file. First ask codex or claude code to install ast-grep for you if you don't have it already. 

It's pretty handy for systematically finding general patterns in code that could be tricky to do using regular string matching that's not syntax-aware.

A useful addendum to your AGENTS dot md or CLAUDE dot md file. First ask codex or claude code to install ast-grep for you if you don't have it already. It's pretty handy for systematically finding general patterns in code that could be tricky to do using regular string matching that's not syntax-aware.

Here is the plaintext: ### ast-grep vs ripgrep (quick guidance) **Use `ast-grep` when structure matters.** It parses code and matches AST nodes, so results ignore comments/strings, understand syntax, and can **safely rewrite** code. * Refactors/codemods: rename APIs, change import forms, rewrite call sites or variable kinds. * Policy checks: enforce patterns across a repo (`scan` with rules + `test`). * Editor/automation: LSP mode; `--json` output for tooling. **Use `ripgrep` when text is enough.** It’s the fastest way to grep literals/regex across files. * Recon: find strings, TODOs, log lines, config values, or non‑code assets. * Pre-filter: narrow candidate files before a precise pass. **Rule of thumb** * Need correctness over speed, or you’ll **apply changes** → start with `ast-grep`. * Need raw speed or you’re just **hunting text** → start with `rg`. * Often combine: `rg` to shortlist files, then `ast-grep` to match/modify with precision. **Snippets** Find structured code (ignores comments/strings): ```bash ast-grep run -l TypeScript -p 'import $X from "$P"' ``` Codemod (only real `var` declarations become `let`): ```bash ast-grep run -l JavaScript -p 'var $A = $B' -r 'let $A = $B' -U ``` Quick textual hunt: ```bash rg -n 'console\.log\(' -t js ``` Combine speed + precision: ```bash rg -l -t ts 'useQuery\(' | xargs ast-grep run -l TypeScript -p 'useQuery($A)' -r 'useSuspenseQuery($A)' -U ``` **Mental model** * Unit of match: `ast-grep` = node; `rg` = line. * False positives: `ast-grep` low; `rg` depends on your regex. * Rewrites: `ast-grep` first-class; `rg` requires ad‑hoc sed/awk and risks collateral edits.

avatar for Jeffrey Emanuel
Jeffrey Emanuel
Fri Nov 07 17:16:05
RT @adamdangelo: Enjoyed my conversation with @amasad and @eriktorenberg!

RT @adamdangelo: Enjoyed my conversation with @amasad and @eriktorenberg!

ceo @replit. civilizationist

avatar for Amjad Masad
Amjad Masad
Fri Nov 07 17:14:21
The entire internet being written by ChatGPT makes it feel like you're following a single person with millions of accounts

It's the same writer with millions of different human skins

Tbh if you went to ChatGPT and just said, "make me a social media feed that I can scroll on that looks like different people", it would pretty much look the same as what you see on a lot of platforms, especially LinkedIn and Reddit (but getting worse on X)

I think in general it diminishes the idea sharing value of social media, where you can scroll and hear generally interesting takes that are not "ChatGPT please write me an engaging social media post about [thing]"

I strongly believe that unfiltered, full-auto AI needs to be left *off of social media.  It's a useful assist, but it shouldn't replace your voice entirely.  Our social lives and connections are the last human thing we have left before becoming completely virtually isolated data annotation batteries

One can of course argue that social media was already creating virtual isolation but it's not going to get better by replacing human creators with automation

Then, there's also something to be said about the potential for social engineering on a massive scale when millions of people are just copy/pasting what ChatGPT tells them and reinforcing the AI's word in public as their own opinions...

The entire internet being written by ChatGPT makes it feel like you're following a single person with millions of accounts It's the same writer with millions of different human skins Tbh if you went to ChatGPT and just said, "make me a social media feed that I can scroll on that looks like different people", it would pretty much look the same as what you see on a lot of platforms, especially LinkedIn and Reddit (but getting worse on X) I think in general it diminishes the idea sharing value of social media, where you can scroll and hear generally interesting takes that are not "ChatGPT please write me an engaging social media post about [thing]" I strongly believe that unfiltered, full-auto AI needs to be left *off of social media. It's a useful assist, but it shouldn't replace your voice entirely. Our social lives and connections are the last human thing we have left before becoming completely virtually isolated data annotation batteries One can of course argue that social media was already creating virtual isolation but it's not going to get better by replacing human creators with automation Then, there's also something to be said about the potential for social engineering on a massive scale when millions of people are just copy/pasting what ChatGPT tells them and reinforcing the AI's word in public as their own opinions...

Second-time founder 1️⃣ https://t.co/sSfo6UUIdl 2️⃣ https://t.co/LQtr2VGskB Manifold learning, neurosymbolic AI, RL paradigms

avatar for Damian Tran
Damian Tran
Fri Nov 07 17:13:49
AI can now learn the structures of mathematics and physics, from Collatz sequences to toric Calabi-Yau manifolds. Amazed by this work of @f_charton's at @axiommathai

AI can now learn the structures of mathematics and physics, from Collatz sequences to toric Calabi-Yau manifolds. Amazed by this work of @f_charton's at @axiommathai

@axiommathai : careers@axiommath.ai

avatar for Carina Hong
Carina Hong
Fri Nov 07 17:11:23
It's the tech equivalent of bemoaning an indie band for "selling out" if they dare produce a hit that lets them play stadiums. Defining your identity around using Linux BECAUSE it's not mainstream is the same sort of hipster pathology.

It's the tech equivalent of bemoaning an indie band for "selling out" if they dare produce a hit that lets them play stadiums. Defining your identity around using Linux BECAUSE it's not mainstream is the same sort of hipster pathology.

Father of three, Creator of Ruby on Rails + Omarchy, Co-owner & CTO of 37signals, Shopify director, NYT best-selling author, and Le Mans 24h class-winner.

avatar for DHH
DHH
Fri Nov 07 17:10:46
  • Previous
  • 1
  • More pages
  • 533
  • 534
  • 535
  • More pages
  • 2111
  • Next