Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
herrington_d
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
How AST-grep Rewrote Tree-sitter in Rust and Made It 30% Faster
(astgrep.com)
93 points
by
herrington_d
2mo ago
|
15 comments
2.
▲
by
herrington_d
6mo ago
Isn't the case study.... too contrived and trivial? The largest code change is 800 lines so it can readily fit in a model's context. However, there is no case for more complicated, multi-file changes or architecture stuff.
3.
▲
by
herrington_d
7mo ago
I also have a tree-sitter Rust rewrite. Though I cannot find it more useful for end users... https://github.com/HerringtonDarkholme/tree-sitter
4.
▲
by
herrington_d
1y ago
it does not always work in my experience due to complex type definitions. Also extra tool calls and time are needed to fix linting.
5.
▲
by
herrington_d
1y ago
There are researches backing some sort of "typed language is better for LLM". Like https://arxiv.org/abs/2504.09246 , Type-Constrained Code Generation with Language Models, where LLM's output is constrain
6.
▲
by
herrington_d
1y ago
The logic above can support exactly the opposite conclusion: LLM can do dynamic typed language better since it does not need to solve type errors and save several context tokens. Practically, it was reported that LLM-backed coding agents ju
7.
▲
by
herrington_d
1y ago
Hi, ast-grep author here. thanks for sharing the video! production quality is amazing! I also did some youtube video recently. It is not easy and end product is far from polished. Really appreciate your help introducing the tool to more peo
8.
▲
by
herrington_d
1y ago
One thing AE provides but not coroutines is type safety. More concretely AE can specify what a function can do and cannot do lexically in code. A generator/coroutine cannot. For example, a function annotated with say `query_db(): User
9.
▲
by
herrington_d
1y ago
the blog lacks the review of one critical player effect.ts https://effect.website/docs/error-management/two-error-types...
10.
▲
by
herrington_d
2y ago
Calling other languages like "none of the tooling" in the "why" section sounds like a huge self-roasting since CCL does not have, say, highlighting/LSP/FFI for adoption.
11.
▲
by
herrington_d
2y ago
My point is that type error recovery is the property of the type system. Not the property of structural code editor.
12.
▲
by
herrington_d
2y ago
> Better type information. Because the program is always in a valid state the type checker can always run and give meaningful feedback. Note that programs can be syntactically well-formed but ill-typed. For example `let x = true + 1` has
13.
▲
by
herrington_d
2y ago
This is a pretty fair comment. I wonder how structural editing figures out things like formatting/searching/diffing and copy/paste across different editors.
14.
▲
by
herrington_d
2y ago
Since Skip is maintaining a reactive cache. How is the cached stored? I would speculate it would a distributed in-memory database so the computation service can scale. But I wonder how the system can recover and rebuild the cache if the ca
15.
▲
by
herrington_d
2y ago
The feature dates way back to perhaps 2006, per Jetbrains' PDF archive[1]. Jb also updated their structural search UI/UX in 2018[2]. It is possible that users do not buy in the idea of SSR. Alternatively, it may be caused by the f
16.
▲
by
herrington_d
2y ago
Curiously the claim sounds like learning this programming language is equivalent to reading the whole DDIA book. :P
17.
▲
by
herrington_d
2y ago
Cool! is it possible to support structural search like ast-grep[1]? ast-grep has some interactive mode but it is nothing near Scooter. 1: https://ast-grep.github.io/
18.
▲
by
herrington_d
2y ago
Yes, ast-grep already has its own rule syntax [1]. But still parser performance and binary size are critical factors for a general tool. https://ast-grep.github.io/guide/rule-config.html
19.
▲
by
herrington_d
2y ago
Hi! ast-grep[1] author here. It is a tree-sitter based syntax tool to search tool. I wonder how you transition from tree-sitter to other builtin parsers? Tree-sitter gave a unified interface to all languages. Using language native parsers w
20.
▲
by
herrington_d
2y ago
Thank you for sharing this! While AI excels at providing general advice, it often falls short on delivering contextual insights specific to your code. I’m thrilled to see that ast-grep can be effectively used alongside AI to add more value
21.
▲
by
herrington_d
2y ago
This can also be achieved via ast-grep by the command `sg -p 'database' -r 'db'`. https://ast-grep.github.io/guide/rewrite-code.html
22.
▲
by
herrington_d
2y ago
New guide for ast-grep rewriters! A powerful construct to perform complex code transformation!
23.
▲
by
herrington_d
2y ago
A comprehensive guide explains why using code to search code can be more subtle than it looks.
24.
▲
by
herrington_d
2y ago
ast-grep is a structural code search tool that leverages syntax trees to find patterns in source code. But it was hard to extract a sub-language embedded inside a document. ast-grep now supports a feature to handle language injection, allow
25.
▲
by
herrington_d
2y ago
Glad to see Google employee still has 20% of their time to do side projects! Python UI is especially interesting for ML/LLM folks who can build demos without changing tech stack. I appreciate OP's ideas about how this project is
26.
▲
by
herrington_d
2y ago
Authoring in DSL can improve efficiency and productivity, but in my experience DSL itself brings benefits to a limited extent. It can be easier to read and write, but these benefits require one to understand the business model behind the DS
27.
▲
by
herrington_d
2y ago
ast-grep is based on tree-sitter parsers and most of the time is spent on parsing. There is some optimization to [skip parsing]( https://github.com/ast-grep/ast-grep/blob/9f8ed5fb2abf35d928... ) but generally I
28.
▲
by
herrington_d
2y ago
Hey! ast-grep author here. I believe what you want is probably what https://github.com/ast-grep/ast-grep can help you. More specifically for the "string constant" search/replace, you can see the playgrou
29.
▲
by
herrington_d
2y ago
No AI, No LLM, No BS, just Pure C and WASM (with a little bit of magic)
30.
▲
Extensible Language Support in Zed
(zed.dev)
5 points
by
herrington_d
2y ago
|
3 comments
More ›