HackerTrans
トップ新着トレンドコメント過去質問紹介求人

ilbert

30 カルマ登録 6 年前
Always getting hands dirty on many projects: https://github.com/ilbertt

投稿

[untitled]

1 ポイント·投稿者 ilbert·一昨日·0 コメント

[untitled]

1 ポイント·投稿者 ilbert·3 日前·0 コメント

Ask HN: Why aren't we collaborating on the prompts we give to our AI agents?

1 ポイント·投稿者 ilbert·3 日前·0 コメント

[untitled]

1 ポイント·投稿者 ilbert·4 日前·0 コメント

Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM

github.com
55 ポイント·投稿者 ilbert·18 日前·42 コメント

Ask HN: Keeping TypeScript CLI options and types in sync

4 ポイント·投稿者 ilbert·2 か月前·0 コメント

A language model that emits raw VM opcodes instead of text

2 ポイント·投稿者 ilbert·3 か月前·2 コメント

Self-hosted WhatsApp router for fleets of OpenClaws

github.com
7 ポイント·投稿者 ilbert·4 か月前·2 コメント

コメント

ilbert
·一昨日·議論
Really cool, same concept as Pocketbase.

Starred!
ilbert
·4 日前·議論
Software like this make me questioning a lot the defensibility of products such as Wispr Flow.

A friend of mine created something similar with just a few prompts, allo working locally, and he's stopped using Wispr Flow
ilbert
·16 日前·議論
That's actually the library that inspired me the most for building bun-sqlgen
ilbert
·17 日前·議論
sql<type>`query` is the reason why I started bun-sqlgen, to not have to write types manually
ilbert
·17 日前·議論
I've updated the READMEs by the way
ilbert
·17 日前·議論
Really cool! I see you don't discover the SQL in the code right?
ilbert
·18 日前·議論
Kysely is really cool, but I don't like that you are not writing SQL directly
ilbert
·18 日前·議論
No real reason, I was working with Bun's SQL module for a project and felt the need for such codegen. I'm thinking of generalizing it to Node.js
ilbert
·18 日前·議論
Yeah, I'm still iterating on the docs
ilbert
·18 日前·議論
I actually took a lot of inspiration from sqlx, which is really nice. The main differences are:

- in JS/TS you don't have compile-time scripts that you can run like with Rust's macros, so you need to run a codegen command before running the type checks (disadvantage)

- I had to create a TS parser that goes and finds the tagged template functions with the sql statements, while sqlx has them "for free" because sql statements are the input to the macro itself (disadvantage)

- I use an in-memory Postgres (PGLite) to describe the queries, instead of requiring a running pg instance (advantage)

- I don't cache the statements and codegen for now like sqlx does, something that can be added later

I think they are similar in that they both substitute the dynamic params with no-ops like $1, $2, etc. before handing the sql statement to the pg's DESCRIBE function
ilbert
·18 日前·議論
I was targeting Bun because I really like its built-in SQL module. I can tweak the TS parser to look for e.g. postgres.js tagged template functions and make it work for that as well. I don't really see any blockers
ilbert
·18 日前·議論
The cli config supports specifying the PGLite extensions (the codegen uses PGLite as an in-memory light postgres), see this example: https://github.com/ilbertt/bun-sqlgen/tree/main/examples/wit....

You'll still probably have to manually override some column types using PG comments like: https://github.com/ilbertt/bun-sqlgen/blob/dee757ebc9c38aec7...

PGLite extensions: https://pglite.dev/extensions/#postgis
ilbert
·18 日前·議論
I think with some tweaks to the TS parser that goes and looks for the sql statements it's doable. How are you solving the problem right now?
ilbert
·18 日前·議論
I write Bun.sql with raw SQL and no ORM, and the one thing I kept missing was types. You write a query, get back `any[]`, and hand-write a row type that silently drifts from the actual columns. Drizzle/Kysely fix this by moving the query into TypeScript, but then you're not really writing SQL anymore.

bun-sqlgen goes the other way. You keep writing raw SQL queries, just give each one a name.

A codegen step reads your migration `.sql` files, stands up a throwaway Postgres via PGlite (so no Docker) or SQLite, prepares every tagged query against it, and writes a `.d.ts` that maps each query name to its real result type. After that, plain `tsc` does the rest: `user.notExistingField` won't compile, and `display_name.length` gets flagged because the column is nullable.

Nullability was the annoying part. Postgres's describe doesn't hand you per-column nullability, so I infer it from the query plan plus the catalog, with manual overrides for the cases that genuinely can't be inferred. SQLite works too.

The runtime stays 100% Bun.sql, the generated file is the only artifact (commit it), and codegen is fast enough to rerun on save.

It's early (v0.1, built it for my own projects) so I'd mostly like to hear where it falls over.
ilbert
·2 か月前·議論
In the last couple of companies I've worked in, I've felt both overwhelmed by PRs to review and disappointed by my teammates that were just rubber-stamping my PRs
ilbert
·2 か月前·議論
That's a good framework and I like that the creator took the same design choices as the FastAPI framework.

Although I think a type-safe language is a better fit for CLIs, to let coding agents iterate faster and have less runtime bugs (help messages not updated, unknown flags, etc.)
ilbert
·2 か月前·議論
I've noticed that the TypeScript ecosystem around CLIs is fragmented, and for that reason (and because I love type-safe code), I've built parsh.

It's extensible by design, and you can test single commands atomically.

I think there's a good opportunity for it to become the Next.js/Vercel of CLIs.

Repo: https://github.com/ilbertt/parsh
ilbert
·2 か月前·議論
Great idea! Are you also considering fine-tuning models as a "side-effect"? Basically, you collect traces of the agent's mistakes from your proxy, and you fine-tune a smaller model that you can offer specifically for that agent as a cheaper alternative?
ilbert
·2 か月前·議論
Really cool! Just as feedback, the 3D worldview seems to have low quality on my browser
ilbert
·3 か月前·議論
It produces an arithmetic program but with wrong operands. The frozen LLM's hidden states for "two" and "2" are nearly orthogonal (cosine sim 0.09) in this context, so the head can't extract the right numbers. "2 plus 3" works fine and draws 5. The model understands the task structure but can't bridge word-form to digit-form without token generation