@hongminhee洪 民憙 (Hong Minhee) 오... 감사합니다. 한번 살펴보겠습니다. 사실 Vercel AI SDK는 첫삽을 이걸로 떠버려서 어쩔수없이 쓰고있는 상태입니다. 급한 불만 끄고 좀더 나은 라이브러리로 갈아타려고 했어요.
bgl gwyng
@bgl@hackers.pub · 99 following · 124 followers
GitHub
- @bglgwyng
@hongminhee洪 民憙 (Hong Minhee) Vercel AI SDK에서 제가 문제점이라고 느낀 디자인을 그대로 갖고 있네요. 사실 저도 아직 충분히 고민해보진 못했고 반대 의견은 매우 환영입니다.
제가 문제라고 느낀 부분은 Message 타입 밑에 Part가 있는 건데요. 그러니까 LLM의 응답이 플랫하게 Message[]이 아니라 Message[].Part[]가 됩니다. Part는 Plain Text거나 Tool Call일 수 있습니다. 그런데 이게 메시지를 DB에 저장하고 Streaming UI를 만들때 불편합니다. 그냥 Part를 없애고 Message만 있으면 좋겠어요.
처음에 저런식의 디자인을 한 동기를 추측해보자면, Message[]를 User/Assitant/User/Assistant/... 이렇게 번갈아 나타나는 형태를 기대하고, 그걸 만족시키려면 Assistant/Assitant 이렇게 연달아 나타나는걸 피해야하니 Part를 도입한게 아닌가 싶습니다. 근데 실제론 저 번갈아 나타나야한다는 조건이 타입으로 강제도 안되고(이건 어려우니 OK) 런타임에서 뭐라고 하지도 않아요. 그리고 실제 사용에서 연달아 나타나는걸 허용하는게 오히려 자연스럽습니다.
그래서 처음에 잠깐 잘못 생각해서 나온 디자인이, 실제론 의도한 제약을 주고있지도 못하고 그냥 쓰임만 불편하게 만들고 있는거 같습니다.
@hongminhee洪 民憙 (Hong Minhee) 오... 감사합니다. 한번 살펴보겠습니다. 사실 Vercel AI SDK는 첫삽을 이걸로 떠버려서 어쩔수없이 쓰고있는 상태입니다. 급한 불만 끄고 좀더 나은 라이브러리로 갈아타려고 했어요.
Vercel AI SDK는 LLM이라는 훌륭한 기술을 주옥같은 인터페이스로 감싸놓았다. 정말 이해가 안가는 추상화 투성이다.
@hongminhee洪 民憙 (Hong Minhee) 안타깝게도 내일은 참석을 못합니다ㅠㅠ 즐거운 시간 보내십셔..
으악 송년회 오늘인줄알고 헛걸음했네
요즘 개발자들 만나면 죄다 AI 얘기밖에 안하는데, 대부분 ‘동물원 가서 코끼리 봤어’ 수준의 이야기라 다 들어주기가 피곤하다. 여기서 들은 얘기 저기서 또 들어야하고.
bgl gwyng shared the below article:
Claude API의 Request Body 분석
자손킴 @jasonkim@hackers.pub
Claude API의 Request는 크게 4가지 분류를 가지고 있다.
- System Messages
- Messages
- Tools
- Model & Config
각각은 다음과 같은 역할을 한다.
System Messages
System Messages는 Claude에게 역할, 성격, 제약사항 등을 지시하는 최상위 설정이다. 배열 형태로 여러 개의 시스템 메시지를 전달할 수 있다.
"system": [
{
"type": "text",
"text": "You are Claude Code, Anthropic's official CLI for Claude.",
"cache_control": {
"type": "ephemeral"
}
},
{
"type": "text",
"text": "You are an interactive CLI tool that helps users with software engineering tasks...",
"cache_control": {
"type": "ephemeral"
}
}
]
System Messages에는 다음과 같은 내용이 포함된다:
- Claude의 페르소나 및 역할 정의
- 보안 및 윤리 가이드라인
- 응답 형식 및 톤 설정
- 프로젝트 정보 등 컨텍스트
cache_control을 통한 캐싱 설정
Messages
Messages는 user와 assistant 역할이 번갈아가며 주고받은 대화를 누적하는 배열이다. assistant 메시지는 반드시 모델의 실제 응답일 필요가 없다. 이를 활요해 API 호출 시 assistant 메시지를 미리 작성해서 전달하면, Claude는 그 내용 이후부터 이어서 응답한다. 이를 Prefill 기법이라 한다.
이 대화 기록을 통해 Claude는 맥락을 유지하며 응답한다.
"messages": [
{
"role": "user",
"content": [...]
},
{
"role": "assistant",
"content": [...]
},
{
"role": "user",
"content": [...]
}
]
User Message
User의 content는 주로 두 가지 type으로 구성된다:
1. text - 사용자의 일반 메시지나 시스템 리마인더
{
"role": "user",
"content": [
{
"type": "text",
"text": "선물을 주고받는 기능을 위한 entity를 설계하라."
}
]
}
2. tool_result - Tool 실행 결과 반환
{
"role": "user",
"content": [
{
"tool_use_id": "toolu_01Qj7gnFLKWBNjg",
"type": "tool_result",
"content": [
{
"type": "text",
"text": "## Entity 구조 탐색 보고서\n\n철저한 탐색을 통해..."
}
]
}
]
}
Assistant Message
Assistant의 content는 주로 세 가지 type으로 구성된다:
1. text - Claude의 응답 메시지
{
"type": "text",
"text": "선물 주고받기 기능을 위한 entity 설계를 시작하겠습니다."
}
2. thinking - Extended Thinking 기능 활성화 시 사고 과정 (signature로 검증)
{
"type": "thinking",
"thinking": "사용자가 선물을 주고받는 기능을 위한 entity 설계를 요청했습니다...",
"signature": "EqskYIChgCKknyFYp5cu1zhVOp7kFTJb..."
}
3. tool_use - Tool 호출 요청
{
"type": "tool_use",
"id": "toolu_01Qj7gn6vLKCNjg",
"name": "Task",
"input": {
"subagent_type": "Explore",
"prompt": "이 NestJS TypeScript 프로젝트에서 entity 구조를 탐색해주세요...",
"description": "Entity 구조 탐색"
}
}
User와 Assistant의 협력
Tool 사용 흐름은 다음과 같이 진행된다:
- Assistant:
tool_use로 Tool 호출 요청 - User:
tool_result로 실행 결과 반환 - Assistant: 결과를 바탕으로
text응답 또는 추가tool_use
이 과정에서 어떤 Tool을 사용할 수 있는지는 tools 배열이 정의한다.
Tools
Tools는 Claude가 사용할 수 있는 도구들을 정의하는 배열이다. 각 Tool은 name, description, input_schema 세 가지 필드로 구성된다.
Tool의 기본 구조
"tools": [
{
"name": "ToolName",
"description": "Tool에 대한 설명...",
"input_schema": {
"type": "object",
"properties": {...},
"required": [...],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
}
]
| 필드 | 설명 |
|---|---|
name |
Tool의 고유 식별자. Claude가 tool_use에서 이 이름으로 호출 |
description |
Tool의 용도, 사용법, 주의사항 등을 상세히 기술. Claude가 어떤 Tool을 선택할지 판단하는 근거 |
input_schema |
JSON Schema 형식으로 입력 파라미터 정의 |
input_schema 구조
input_schema는 JSON Schema draft-07 스펙을 따르며, Tool 호출 시 필요한 파라미터를 정의한다.
"input_schema": {
"type": "object",
"properties": {
"pattern": {
"type": "string",
"description": "The regular expression pattern to search for"
},
"path": {
"type": "string",
"description": "File or directory to search in. Defaults to current working directory."
},
"output_mode": {
"type": "string",
"enum": ["content", "files_with_matches", "count"],
"description": "Output mode: 'content' shows matching lines, 'files_with_matches' shows file paths..."
},
"-i": {
"type": "boolean",
"description": "Case insensitive search"
},
"head_limit": {
"type": "number",
"description": "Limit output to first N lines/entries"
}
},
"required": ["pattern"],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
properties 내 각 파라미터 정의
각 파라미터는 다음 필드들로 정의된다:
| 필드 | 설명 |
|---|---|
type |
데이터 타입 (string, number, boolean, array, object 등) |
description |
파라미터의 용도와 사용법 설명 |
enum |
(선택) 허용되는 값의 목록. 이 중 하나만 선택 가능 |
default |
(선택) 기본값 |
input_schema의 메타 필드
| 필드 | 설명 |
|---|---|
type |
항상 "object" |
properties |
파라미터 정의 객체 |
required |
필수 파라미터 이름 배열. 여기 포함되지 않은 파라미터는 선택적 |
additionalProperties |
false면 정의되지 않은 파라미터 전달 불가 |
$schema |
JSON Schema 버전 명시 |
실제 예시: Grep Tool
{
"name": "Grep",
"description": "A powerful search tool built on ripgrep\n\n Usage:\n - ALWAYS use Grep for search tasks...",
"input_schema": {
"type": "object",
"properties": {
"pattern": {
"type": "string",
"description": "The regular expression pattern to search for in file contents"
},
"path": {
"type": "string",
"description": "File or directory to search in (rg PATH). Defaults to current working directory."
},
"glob": {
"type": "string",
"description": "Glob pattern to filter files (e.g. \"*.js\", \"*.{ts,tsx}\")"
},
"output_mode": {
"type": "string",
"enum": ["content", "files_with_matches", "count"],
"description": "Output mode. Defaults to 'files_with_matches'."
},
"-A": {
"type": "number",
"description": "Number of lines to show after each match"
},
"-B": {
"type": "number",
"description": "Number of lines to show before each match"
},
"-i": {
"type": "boolean",
"description": "Case insensitive search"
},
"multiline": {
"type": "boolean",
"description": "Enable multiline mode. Default: false."
}
},
"required": ["pattern"],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
}
이 Tool을 Claude가 호출할 때의 tool_use:
{
"type": "tool_use",
"id": "toolu_01ABC123",
"name": "Grep",
"input": {
"pattern": "class.*Entity",
"path": "src/modules",
"glob": "*.ts",
"output_mode": "content",
"-i": true
}
}
required에 pattern만 있으므로 나머지는 선택적이다. Claude는 input_schema의 description을 참고하여 적절한 파라미터를 선택한다.
Model & Config
마지막으로 모델 선택과 각종 설정 옵션들이다:
{
"model": "claude-opus-4-5-20251101",
"max_tokens": 32000,
"thinking": {
"budget_tokens": 31999,
"type": "enabled"
},
"stream": true,
"metadata": {
"user_id": "user_2f2ce5dbb94ac27c8da0d0b28dddf815fc82be54e0..."
}
}
| 옵션 | 설명 |
|---|---|
model |
사용할 Claude 모델 (claude-opus-4-5, claude-sonnet-4-5 등) |
max_tokens |
최대 출력 토큰 수 |
thinking |
Extended Thinking 설정 (budget_tokens로 사고 토큰 예산 설정) |
stream |
스트리밍 응답 여부 |
metadata |
사용자 ID 등 메타데이터 |
마치며
지금까지 Claude API Request Body의 4가지 핵심 구성 요소를 살펴보았다:
- System Messages: Claude의 역할과 행동 방식을 정의
- Messages: user-assistant 간 대화 기록을 누적하며, tool_use/tool_result를 통해 Tool과 상호작용
- Tools: JSON Schema 기반으로 사용 가능한 도구의 이름, 설명, 입력 파라미터를 정의
- Model & Config: 모델 선택, 토큰 제한, 스트리밍 등 설정
이 구조를 알면 Claude가 주고받은 메시지를 어떻게 관리하는지, 도구를 어떻게 사용하는지 이해하고 API를 더 효과적으로 활용할 수 있다.
"OOO 주식회사 OOO 대표님 맞으시죠? 산업안전보건교육 받아야 하는 업체에 해당합니다. 직원이나 프리랜서 고용 있으시죠? 어쩌고~" 일단 쎄한 느낌을 받았습니다. 다다다 쏴붙이면서 중간에 질문할 틈을 최대한 막으면서 가는 꼬락서니가 관공서는 아니구나 싶었습니다. 고용이나 프리랜서 없다고 하니, 뚝 끊어 버립니다. 검색해보니, 이런식의 반쯤 사기같은 행태가 존재한다고 하네요. 소규모 법인 대표님들 조심하세요~
@bglbgl gwyng 그래서 하스켈을 쓰고 싶은데... 하스켈 붐은 도대체 언제 올까요ㅠㅠ
@2chanhaeng초무 더이상 앉아서 붐을 기다릴수 없습니다
Zed 에디터 써보는 중인데 Git 연동이 좀 부실하다. 보통은 GitKraken이나 lazygit 등의 도구를 병행해서 쓰니까, 꼭 에디터에서 Git을 빵빵하게 지원해야하냐는 의문은 든다. 다만 Git의 특정 기능들은 에디터 연동이 불가피한데(diff 보기, conflict 해결하기 등), 이런거보면 에디터가 Git의 인터페이스가 되어야하는거 같기도하고 그렇다.
Nushell 반나절동안 썼는데, 지금까지 문제는... 그 리치한 기능을 전혀 안 썼다는것이다. 그래서 단지 zsh와 비교해 익숙하지않음+플러그인부족에서 기인한 불편함만 체험하고 말았다.
언제까지 (a:number, b:number) => a + b, (a:string, b:string) => a + b, <T>(a: T, b: T) => a + b 를 해줘야 하나고
그냥 대충 눈치껏 (a, b) => a + b 하면 'b 는 a 와 더할 수 있어야 하는 타입이고 a 는 무언가와 더할 수 있는 타입이구나' 하고 추론할 수 있는 분석기가 달린 언어가 필요함
@2chanhaeng초무 하스켈 있음다..
사상 최고의 크리스마스 영화: 다이하드 2.
@meWoojin Kim 1이 아니라요?
#연합당근
하드디스크 처분합니다.
모든 제품 베드섹터 없으며 정상동작 확인 했습니다.
전문 업체가 아니다 보니 자체 A/S는 불가 하며 중고입니다.
각 디스크 별 상태 정보도 같이 첨부 드립니다.
택배비 미 포함 가격이며 택배비는 상황에 따라 일정하지 않아서 제가 따로 알려드리겠습니다.
1. 500GB 16MB 7200RPM 삼성 2만원(학생 할인가 1만원)
2. 250GB 8MB 7200RPM WD 1만 5천원(학생 할인가 5천원)
3. 160GB 8MB 7200RPM 씨게이트 무료
씨게이트는 멀쩡한걸 확인했지만 아무래도 씨게이트인지라 무료 입니다.
글풍선에 작성자 프로필 이미지를 이제야 붙였습니다. 붙이고 나니, 필수 요소겠구나 하는 생각이 듭니다. 작성한 글은 자신을 표현하는 일부인데, 내 글인지 표시가 없으면, 내가 누군가에게 표현했다는 느낌이 반감되는 것 같습니다.
yearit.com
primes :: (Integral a) => [a]
primes = 2 : ([3, 5 ..] & filter (not . has_divisor))
where
has_divisor n =
any ((0 ==) . (n `mod`) . fst) $ takeWhile ((n >=) . snd) primes_with_square
primes_with_square :: (Integral a) => [(a, a)]
primes_with_square = [(p, p * p) | p <- primes]
euler project 문제 풀다가..
리액트의 dumb component는 이름과달리 약간은 더 똑똑할 필요가 있는데. dumb component는 업데이트를 반드시 부모를 통해서만 해야한다. 이때 fine-grained reactivity로 성능을 높이려면 (딱히 별 하는 일도 없는) wrapper가 필요하다. 그리고 데이터 페칭과 관련될 경우 또 wrapper를 반드시 만들어 줘야한다.
이걸 어떻게 해결할수 있나? dumb component가 Props로 raw value가 아닌 signal을 받게하는 것이다. 아쉽게도 현재 JS에 표준 Signal 인터페이스가 없기에 jotai atom 등을 써야하는데, 그러면 컴포넌트가 프레임워크에 의존하게 되어 덜 dumb해지는 문제가 있다.
어쩌다 커서, 윈드서프 대신에 오리지널 VS Code + 코파일럿을 쓰고 있는데, AI의 UX 통합이랑 측면에선 이쪽이 더 낫네? 윈드서프는 채팅 UI 벗어나면 잡버그때문에 못쓸 수준이다.
https://github.com/yamadashy/repomix/releases/tag/v1.10.0
Repomix가 소스코드를 압축해서 LLM 친화적인 텍스트를 뽑아주는 CLI도구인데, 이제 그걸 넘어서 Claude Code Skill도 뽑아주는 기능이 추가되었다 .....
유튜브 링크를 넣을 수 있게 했더니, 아래처럼 쓰기도 합니다.
추천 영상, 댓글, 다음 영상 같은 게 안보여서, 조용한 카페같다네요. 제가 의도했던 건 아닌데, 저도 써보니 그런 것 같기도 합니다. 글들에 있는 링크 연속 재생 방법을 찾는 숙제가 생겼습니다. http://yearit.com/note/myplaylist
@bglbgl gwyng 저는 제가 만든 프로젝트들의 체인지로그를 추천합니다… ㅋㅋㅋㅋ
@hongminhee洪 民憙 (Hong Minhee) 다르긴 다르네요ㅋㅋ
사실 이래서 나는 커밋 메시지로부터 어떻게든 체인지로그를 자동으로 생성해 내려는 일체의 시도에 회의적임…
@hongminhee洪 民憙 (Hong Minhee) 반대로 좋은 예시는 어떤게 있을까요? 사실 제가 관심있게 지켜보던 레포는 체인지로그 저런식이어도 대충 알아듣겠더라고요.
bgl gwyng shared the below article:
Stop writing if statements for your CLI flags
洪 民憙 (Hong Minhee) @hongminhee@hackers.pub
If you've built CLI tools, you've written code like this:
if (opts.reporter === "junit" && !opts.outputFile) {
throw new Error("--output-file is required for junit reporter");
}
if (opts.reporter === "html" && !opts.outputFile) {
throw new Error("--output-file is required for html reporter");
}
if (opts.reporter === "console" && opts.outputFile) {
console.warn("--output-file is ignored for console reporter");
}
A few months ago, I wrote Stop writing CLI validation. Parse it right the first time. about parsing individual option values correctly. But it didn't cover the relationships between options.
In the code above, --output-file only makes sense when --reporter is junit or html. When it's console, the option shouldn't exist at all.
We're using TypeScript. We have a powerful type system. And yet, here we are, writing runtime checks that the compiler can't help with. Every time we add a new reporter type, we need to remember to update these checks. Every time we refactor, we hope we didn't miss one.
The state of TypeScript CLI parsers
The old guard—Commander, yargs, minimist—were built before TypeScript became mainstream. They give you bags of strings and leave type safety as an exercise for the reader.
But we've made progress. Modern TypeScript-first libraries like cmd-ts and Clipanion (the library powering Yarn Berry) take types seriously:
// cmd-ts
const app = command({
args: {
reporter: option({ type: string, long: 'reporter' }),
outputFile: option({ type: string, long: 'output-file' }),
},
handler: (args) => {
// args.reporter: string
// args.outputFile: string
},
});
// Clipanion
class TestCommand extends Command {
reporter = Option.String('--reporter');
outputFile = Option.String('--output-file');
}
These libraries infer types for individual options. --port is a number. --verbose is a boolean. That's real progress.
But here's what they can't do: express that --output-file is required when --reporter is junit, and forbidden when --reporter is console. The relationship between options isn't captured in the type system.
So you end up writing validation code anyway:
handler: (args) => {
// Both cmd-ts and Clipanion need this
if (args.reporter === "junit" && !args.outputFile) {
throw new Error("--output-file required for junit");
}
// args.outputFile is still string | undefined
// TypeScript doesn't know it's definitely string when reporter is "junit"
}
Rust's clap and Python's Click have requires and conflicts_with attributes, but those are runtime checks too. They don't change the result type.
If the parser configuration knows about option relationships, why doesn't that knowledge show up in the result type?
Modeling relationships with conditional()
Optique treats option relationships as a first-class concept. Here's the test reporter scenario:
import { conditional, object } from "@optique/core/constructs";
import { option } from "@optique/core/primitives";
import { choice, string } from "@optique/core/valueparser";
import { run } from "@optique/run";
const parser = conditional(
option("--reporter", choice(["console", "junit", "html"])),
{
console: object({}),
junit: object({
outputFile: option("--output-file", string()),
}),
html: object({
outputFile: option("--output-file", string()),
openBrowser: option("--open-browser"),
}),
}
);
const [reporter, config] = run(parser);
The conditional() combinator takes a discriminator option (--reporter) and a map of branches. Each branch defines what other options are valid for that discriminator value.
TypeScript infers the result type automatically:
type Result =
| ["console", {}]
| ["junit", { outputFile: string }]
| ["html", { outputFile: string; openBrowser: boolean }];
When reporter is "junit", outputFile is string—not string | undefined. The relationship is encoded in the type.
Now your business logic gets real type safety:
const [reporter, config] = run(parser);
switch (reporter) {
case "console":
runWithConsoleOutput();
break;
case "junit":
// TypeScript knows config.outputFile is string
writeJUnitReport(config.outputFile);
break;
case "html":
// TypeScript knows config.outputFile and config.openBrowser exist
writeHtmlReport(config.outputFile);
if (config.openBrowser) openInBrowser(config.outputFile);
break;
}
No validation code. No runtime checks. If you add a new reporter type and forget to handle it in the switch, the compiler tells you.
A more complex example: database connections
Test reporters are a nice example, but let's try something with more variation. Database connection strings:
myapp --db=sqlite --file=./data.db
myapp --db=postgres --host=localhost --port=5432 --user=admin
myapp --db=mysql --host=localhost --port=3306 --user=root --ssl
Each database type needs completely different options:
- SQLite just needs a file path
- PostgreSQL needs host, port, user, and optionally password
- MySQL needs host, port, user, and has an SSL flag
Here's how you model this:
import { conditional, object } from "@optique/core/constructs";
import { withDefault, optional } from "@optique/core/modifiers";
import { option } from "@optique/core/primitives";
import { choice, string, integer } from "@optique/core/valueparser";
const dbParser = conditional(
option("--db", choice(["sqlite", "postgres", "mysql"])),
{
sqlite: object({
file: option("--file", string()),
}),
postgres: object({
host: option("--host", string()),
port: withDefault(option("--port", integer()), 5432),
user: option("--user", string()),
password: optional(option("--password", string())),
}),
mysql: object({
host: option("--host", string()),
port: withDefault(option("--port", integer()), 3306),
user: option("--user", string()),
ssl: option("--ssl"),
}),
}
);
The inferred type:
type DbConfig =
| ["sqlite", { file: string }]
| ["postgres", { host: string; port: number; user: string; password?: string }]
| ["mysql", { host: string; port: number; user: string; ssl: boolean }];
Notice the details: PostgreSQL defaults to port 5432, MySQL to 3306. PostgreSQL has an optional password, MySQL has an SSL flag. Each database type has exactly the options it needs—no more, no less.
With this structure, writing dbConfig.ssl when the mode is sqlite isn't a runtime error—it's a compile-time impossibility.
Try expressing this with requires_if attributes. You can't. The relationships are too rich.
The pattern is everywhere
Once you see it, you find this pattern in many CLI tools:
Authentication modes:
const authParser = conditional(
option("--auth", choice(["none", "basic", "token", "oauth"])),
{
none: object({}),
basic: object({
username: option("--username", string()),
password: option("--password", string()),
}),
token: object({
token: option("--token", string()),
}),
oauth: object({
clientId: option("--client-id", string()),
clientSecret: option("--client-secret", string()),
tokenUrl: option("--token-url", url()),
}),
}
);
Deployment targets, output formats, connection protocols—anywhere you have a mode selector that determines what other options are valid.
Why conditional() exists
Optique already has an or() combinator for mutually exclusive alternatives. Why do we need conditional()?
The or() combinator distinguishes branches based on structure—which options are present. It works well for subcommands like git commit vs git push, where the arguments differ completely.
But in the reporter example, the structure is identical: every branch has a --reporter flag. The difference lies in the flag's value, not its presence.
// This won't work as intended
const parser = or(
object({ reporter: option("--reporter", choice(["console"])) }),
object({
reporter: option("--reporter", choice(["junit", "html"])),
outputFile: option("--output-file", string())
}),
);
When you pass --reporter junit, or() tries to pick a branch based on what options are present. Both branches have --reporter, so it can't distinguish them structurally.
conditional() solves this by reading the discriminator's value first, then selecting the appropriate branch. It bridges the gap between structural parsing and value-based decisions.
The structure is the constraint
Instead of parsing options into a loose type and then validating relationships, define a parser whose structure is the constraint.
| Traditional approach | Optique approach |
|---|---|
| Parse → Validate → Use | Parse (with constraints) → Use |
| Types and validation logic maintained separately | Types reflect the constraints |
| Mismatches found at runtime | Mismatches found at compile time |
The parser definition becomes the single source of truth. Add a new reporter type? The parser definition changes, the inferred type changes, and the compiler shows you everywhere that needs updating.
Try it
If this resonates with a CLI you're building:
- Documentation
- Tutorial
conditional()reference- GitHub
Next time you're about to write an if statement checking option relationships, ask: could the parser express this constraint instead?
The structure of your parser is the constraint. You might not need that validation code at all.
한 해를 마무리하는 글을 블로그에 썼습니다: 〈聯合宇宙와 함께 한 2025年〉(한글 專用文은 이쪽). 題目 그대로 聯合宇宙와 함께 했던 저의 한 해를 되돌아 보는 글입니다. 聯合宇宙 德分에 많은 因緣과 이어지게 되어서 感謝하게 생각합니다.
Fediverse Advent Calendar 2025の10日目に参加する記事をブログに投稿しました:「フェディバースと過ごした2025年」。タイトルの通り、フェディバースと共に過ごした私の一年を振り返る内容です。フェディバースのおかげで多くのご縁に恵まれ、感謝しています。これからもよろしくお願いします。
Fediverse Advent Calendar 2025の10日目に参加する記事をブログに投稿しました:「フェディバースと過ごした2025年」。タイトルの通り、フェディバースと共に過ごした私の一年を振り返る内容です。フェディバースのおかげで多くのご縁に恵まれ、感謝しています。これからもよろしくお願いします。
I posted a blog entry to wrap up the year: My 2025 with the fediverse. I'm grateful that the fediverse has allowed me to connect with so many people. I look forward to our continued connection.
Vercel 제품들은 딱 봐도 설계가 너무 구리게 느껴지는데, 그렇다고 깊게 생각해보진 않고 또 쨋든 사람들이 젤 많이 쓰긴하니까, 내 느낌이 잘못된건지 헷갈린다.
Released Optique 0.8.0, a type-safe CLI parser for TypeScript.
This version adds conditional() for branching based on a discriminator option, passThrough() for forwarding unknown options to underlying tools, and a new @optique/logtape package for configuring LogTape via CLI.
https://djot.net/ djot이라고 Markdown 개발자가 Markdown의 문제점을 고쳐서 내놓은 마크업 언어이다. 이러고보니 Deno같군.
@bglbgl gwyng 제가 알기로는 Markdown 만든 사람은 아니고 Pandoc 제작자이자 CommonMark 스펙 공동 저자이신 분이예요!
https://djot.net/ djot이라고 Markdown 개발자가 Markdown의 문제점을 고쳐서 내놓은 마크업 언어이다. 이러고보니 Deno같군.
SolidJS로 앱 만들다가 아이콘셋이 필요해져서 패키지를 뒤져보는데, 마이너 생태계답게 마지막 업데이트가 삼사년 전인 패키지들만 나온다. 아이콘셋에 업데이트가 필요 없긴 하지. 그래도 최근에 업데이트 된 패키지가 걸리적거리는게 없을 것 같달까. 그러다 활발히 업데이트 중인 unplugin-icons를 찾았다. 이것은 SolidJS용 패키지가 아니었다. 아이콘셋도 아니었다. 거의 모든 아이콘셋을 거의 모든 프레임워크에서 사용할 수 있게 해주는 도구다. 이런 문물이 있었다니. 누가 만들었나 함 보자. 제작자는 Anthony Fu... 아아 또 그인가. 오늘도 비 React 웹 생태계엔 Anthony Fu의 은혜가 넘친다.
@hongminhee洪 民憙 (Hong Minhee) 기대하겠습니다!
(최근에 직장을 옮겨 풀타임 근무를 시작함)
새 동료들과 이야기하다 함수형 언어 이야기가 나왔는데, 밈에 불과한 이야기만 나와서(함수형 언어 사용자들의 컬트스러움 등) 좀 아쉬웠다. 답답하거나 짜증난다기 보단, 빨리 그부분을 스킵하고 진짜 재밌는 이야기로 넘어갔으면 하는 생각이 들었다. 다행히 동료들이니 앞으로 이야기할 기회가 아주 많을 것이다.
불변성, 사이드이펙트 없음, 아름다움(?) 추구 등의 이야기가 나왔는데, 물론 다 함수형 언어와 관계있지만 본질적인건 아니다. 내게 함수형 언어는 코드를 조합하는 방법을 연구하고, 조합이 잘되는 코드를 짜는걸 실천하는 것이다. 이를 통해 많은 것을 공짜로 안전하게 얻는 것이 목표이다. 그래서 '함수형'의 칭호를 부여받지 못한 방법론들은(ex: 상속), 그냥 해보니까 조합성에 한계가 있어서, 설계를 구성하는 근본적인 요소로 포함시키기에 부적절하다고 결론이 내려졌을 뿐이다. 그럼... 그냥 좋은 방법들을 엄선해놓은게 함수형인가? 그럴지도? 다함께 좋은거 합시다.
LLM들한테 JSON 출력을 시킬때마다 이스케이핑하느라 얼마나 머리아플까 걱정되고 안쓰럽다.
나는 옷에 별관심 없어가지고 롱패딩 시즌이 은근히 기다려진다
내 글만 볼 수 있는 my 버튼을 추가했습니다.
새로운 반응이 생긴 글들은 알림을 표시합니다.
yearit.com
@lionhairdino 멋져요!
내 글만 볼 수 있는 my 버튼을 추가했습니다.
새로운 반응이 생긴 글들은 알림을 표시합니다.
yearit.com
개인 맵 Private map을 가질 수 있고, 연인, 가족이나, 지도를 공유하면 좋은 동호회(낚시, 캠핑, 라이딩...) 분들이 공유할 수 있는 맵으로 쓸 수도 있습니다.
맵에 아무나 읽을 수 있는 권한을 주고, 블로그나, 회사 페이지 등에도 임베드할 수 있습니다.
아직은 UI가 심히 엔지니어 손 맛인데, 계속 고민하고 있습니다.
국산 leksah 가 나오는 건가요!
@bglbgl gwyng
@lionhairdino 그냥 넋두리이니 너무 신경쓰지마십시오ㅋㅋ
코드에디터 만들고싶다..
It looks like a new minor release of #Hollo (v0.7.0) will be out soon, the first in several months.
Hackers Public @ Seoul 송년회 ---- 2025년의 마지막을 해커들과 함께해요.
Hackers' Public @ Seoul 송년 네트워킹 밋업은 발표보다 대화, 형식보다 연결을 중심으로 진행됩니다. 라이트닝 토크도 지원받습니다. 만들었던 것·배운 것·고민했던 이야기를 자유롭게 얘기해보도록 해요.
많은 관심 부탁드립니다~
- 🗓 12/21(일) 14:30~18:30
- 🎤 라이트닝 토크 5분 자유 참여
- 📌 1차 모집: 11.26~12.5 (회원 대상)
- 신청하기 👉 https://event-us.kr/hackerspubseoul/event/117468
bgl gwyng shared the below article:
도커로 구축한 랩에서 혼자 실습하며 배우는 네트워크 프로토콜 입문 #4
자손킴 @jasonkim@hackers.pub
이 글은 네트워크 계층과 애플리케이션을 연결하는 L4 전송 계층의 핵심 개념을 소개합니다. 포트 번호를 통해 애플리케이션을 식별하고, UDP와 TCP 프로토콜의 특징과 패킷 형식을 설명합니다. UDP는 실시간성을, TCP는 신뢰성을 중시하며, TCP는 3-way handshake로 연결을 설정하고, 흐름 제어, 혼잡 제어, 재전송 제어를 통해 데이터 전송을 관리합니다. 특히 TCP 커넥션의 상태 전이 과정과 4-way handshake를 통한 연결 종료 과정을 상세히 다룹니다. 이 글을 통해 독자는 L4 전송 계층의 작동 방식과 TCP의 신뢰성 있는 데이터 전송 메커니즘에 대한 깊이 있는 이해를 얻을 수 있습니다.
Read more →요즘 AI 수학자/과학자를 만들겠다는 스타트업들이 생기고있는데, 멤버들도 빅테크 출신에 쟁쟁하고 투자도 크게 받는 등 절대 장난같은건 아니다. 그치만 의문이 드는건 피할수가 없는데... 만약에 AI 사업가를 만드는 스타트업을 세워서 VC를 찾아가면, '...그냥 직접 비즈니스를 하시죠?'라고 할게 당연하지 않나. AI 수학자/과학자를 만드는 스타트업도 비슷한 느낌이다. 그냥 연구 결과 낸다음 빅테크 인수될 계획이라고 하면 할말은 없다만.
요즘 새로운 프로젝트를 진행중이다.
많은 언어들의 많은 패키지 매니저들이, 패키지에 대한 테스트를 돌릴 방법은 제공하면서(npm test 등) 막상 그 패키지 레포를 클론떴을때 그 패키지를 사용하는 아무 예제나 실행시켜볼 쉽고 통일된 방법은 잘 제공 안하는 거 같다. 가령 examples/*의 코드들을 실행시킬 방법은 npm 패키지들마다 제각각이다. 왓더??
















