Profile img

Hi, I'm who's behind Fedify, Hollo, BotKit, and this website, Hackers' Pub! My main account is at @hongminhee洪 民憙 (Hong Minhee) :nonbinary:.

Fedify, Hollo, BotKit, 그리고 보고 계신 이 사이트 Hackers' Pub을 만들고 있습니다. 제 메인 계정은: @hongminhee洪 民憙 (Hong Minhee) :nonbinary:.

FedifyHolloBotKit、そしてこのサイト、Hackers' Pubを作っています。私のメインアカウントは「@hongminhee洪 民憙 (Hong Minhee) :nonbinary:」に。

Website
hongminhee.org
GitHub
@dahlia
Hollo
@hongminhee@hollo.social
DEV
@hongminhee
velog
@hongminhee
Qiita
@hongminhee
Zenn
@hongminhee
Matrix
@hongminhee:matrix.org
X
@hongminhee
2
1
2

# Ask Hackers Pub : 이번 주말에 뭐 하시나요?

이번 주말에 뭘 하려고 계획 중인지 편하게 얘기해 보아요.
읽을 책, 가볼 곳, 해볼 것.. 어떤 것이든 좋습니다.
도움 요청이나 피드백 요청도 좋습니다.
물론! 아무것도 하지 않고 쉬는 것도 훌륭합니다.

* 지난 주말에 계획하셨던 일의 회고도 한 번 남겨보면 좋을 것 같아요.

1
0

새로 세팅된 TF가 두 달동안 UT 252개 & coverage 90%. agent 사용은 자유로우나 full agent code를 하진 않음. 그래도 코어 아키텍처가 안깨질것이란 믿음이 있고 전반적인 플젝 이해도와 제어권이 관리 가능한 선이 유지되고 있다는 팀 컨센서스가 있어서인지 iteration 회고 때 만족도가 높다.

그리고 제어 가능한 선에서 사람들이 딱히 시키지 않아도 특정 파트에 대해 full agent coding 을 할 용기(?) 를 내며 알아서 실험들 시도. 팀에서의 core practice 를 unit test 와 review (10-4시 집중근무 시간 뒤 1시간이 매일 팀 리뷰 시간) 를 정착시킨게 긍정적인 결과가 이끌어진듯.

1

오늘 할 것

  • vimrc 모임 열리긴 한다고 공지하기
  • vimrc 장소 후원 모집하기
  • nestjs 프로젝트 진짜진짜 federation 잘 동작하는지 사이클 확인해보기
  • Hackers Public @ Seoul 모집 포스터 만들기
3

Show GN: Optique: TypeScript를 위한 타입 안전한 CLI 파서
------------------------------
안녕하세요! TypeScript로 CLI 도구를 자주 만들다 보니 기존 라이브러리들의 한계가 아쉬워서 새로운 CLI 파서를 만들게 되었습니다. 혹시 관심 있으신 분들께 소개해보고 싶어 글을 올립니다.

CLI 애플리케이션을 개발하면서 늘 불편했던 점이 하나 있었습니다. 기존 CLI 파서 라이브러리들은 대부분 설정 객체나…
------------------------------
https://news.hada.io/topic?id=22670&utm_source=googlechat&utm_medium=bot&utm_campaign=1834

2
2
2
1
0
2
1
5

Open source projects I'm currently maintaining:

  • Fedify, an ActivityPub server framework for TypeScript
  • Hollo, an ActivityPub-enabled single-user microblogging software
  • BotKit, an ActivityPub bot framework for TypeScript
  • LogTape, a modern logging library for TypeScript
  • Upyo, a simple and modern email sending library for TypeScript
  • Optique, a type-safe combinatorial CLI parser for TypeScript
7
2
1
8
2
6
3

GitHub Classroom을 사용해서 온라인 저지 시스템을 구축해본 후기입니다.

https://theeluwin.github.io/article/online-judge-with-github-classroom/

실제로 사용하고 싶었으나, 제 결론은... 안쓰는쪽으로 났습니다. 이유는 결국, 문제 출제하는 UI/UX가 좋지 않다는 것입니다. 제가 고생을 덜 해야만 하니까요(,,,,) 암튼 GitHub Classroom이 문서도 제대로 안되어있기도 하고, 기능이 아직 좀 오락가락 합니다. 없는 기능도 너무 많구요. 제 검토를 참고해주십시오, , ,

2
3

https://github.com/makachanm/questionbasket

셀프호스트 1인용 익명 질문함 서비스의 백엔드까지는 전부 짜긴 했지만 프론트엔드를 맡아줄 사람이 없어서 그냥 백엔드 API만 작동하는 정도로 남겨두었다. 언젠간 완성할수도 있지만... 일단은 이정도 완성시킨걸로 만족하기로 하자. Gemini 없었으면 4달 전에 진행하다 버린 프로젝트를 오늘 완성시킬순 없었을거다.

4
9
5
2
5
4
5
3

오늘의 서커스 내용 세션의 정보를 가져오는데 세션의 앱은 ApplicationGrants를 받아야 하고 세션의 프로필 ID는 ApplicationGrantProfiles으로 프로필별 승인을 받거나 전체 프로필 승인(ApplicationGrantProfiles.profileId == null)을 받야아 가져올 수 있는데 세션의 프로필을 헤더로 오버라이드할 수 있고 오버라이드된 프로필 역시 위 조건을 지키는 경우만 리턴되게 하는 쿼리를 짰어요

const headerProfileId = c.req.header('X-Actor-Profile-Id');
    const session = await db
      .select({
        id: Sessions.id,
        applicationId: Sessions.applicationId,
        accountId: Sessions.accountId,
        scopes: Sessions.scopes,
        languages: Accounts.languages,
        profileId: Profiles.id,
      })
      .from(Sessions)
      .innerJoin(Accounts, eq(Sessions.accountId, Accounts.id))
      .innerJoin(ApplicationGrants, eq(Sessions.applicationId, ApplicationGrants.applicationId))
      .leftJoin(
        ApplicationGrantProfiles,
        eq(ApplicationGrants.id, ApplicationGrantProfiles.applicationGrantId),
      )
      .leftJoin(
        Profiles,
        and(
          eq(Profiles.id, headerProfileId ?? Sessions.profileId),
          eq(Profiles.state, ProfileState.ACTIVE),
          isNotNull(ApplicationGrantProfiles.id),
          or(
            eq(ApplicationGrantProfiles.profileId, Profiles.id),
            isNull(ApplicationGrantProfiles.profileId),
          ),
        ),
      )
      .where(eq(Sessions.token, accessToken))
      .limit(1)
      .then(first);
1

오늘의 서커스 내용 세션의 정보를 가져오는데 세션의 앱은 ApplicationGrants를 받아야 하고 세션의 프로필 ID는 ApplicationGrantProfiles으로 프로필별 승인을 받거나 전체 프로필 승인(ApplicationGrantProfiles.profileId == null)을 받야아 가져올 수 있는데 세션의 프로필을 헤더로 오버라이드할 수 있고 오버라이드된 프로필 역시 위 조건을 지키는 경우만 리턴되게 하는 쿼리를 짰어요

const headerProfileId = c.req.header('X-Actor-Profile-Id');
    const session = await db
      .select({
        id: Sessions.id,
        applicationId: Sessions.applicationId,
        accountId: Sessions.accountId,
        scopes: Sessions.scopes,
        languages: Accounts.languages,
        profileId: Profiles.id,
      })
      .from(Sessions)
      .innerJoin(Accounts, eq(Sessions.accountId, Accounts.id))
      .innerJoin(ApplicationGrants, eq(Sessions.applicationId, ApplicationGrants.applicationId))
      .leftJoin(
        ApplicationGrantProfiles,
        eq(ApplicationGrants.id, ApplicationGrantProfiles.applicationGrantId),
      )
      .leftJoin(
        Profiles,
        and(
          eq(Profiles.id, headerProfileId ?? Sessions.profileId),
          eq(Profiles.state, ProfileState.ACTIVE),
          isNotNull(ApplicationGrantProfiles.id),
          or(
            eq(ApplicationGrantProfiles.profileId, Profiles.id),
            isNull(ApplicationGrantProfiles.profileId),
          ),
        ),
      )
      .where(eq(Sessions.token, accessToken))
      .limit(1)
      .then(first);
3
3
2
5
2

홈서버 곧 도착하면 어떤 서비스를 올려볼지 고민이네요 혹시 추천해 주실만한 서비스 있으신가요? 일단 아래는 생각 중인 목록입니다.

2

튜링에서 한 프로세스를 실행하고, 다음 프로세스를 실행하는 걸 "명시"하지 않는데, 이를 명시적으로 어떤 combinator로 보고, 전역 변수등은 또 람다로 감싸서, 람다 컨텍스트에 있는 변수를 보게 하면, 람다와 다를게 없다.
튜링과 람다가 철학이 다르다기 보다, 마치 튜링에서 암묵적으로 하던 동작들을 모두 명시적으로 바꿔 놓은 게 람다 대수인 건 아닐까?

1
3
7
1

I've recently been working on Optique, a CLI parser combinator for TypeScript. Optique allows you to describe complex CLIs by combining smaller parts. You can also handle the CLI parsing results in a type-safe manner (see code below). The idea came from Haskell's optparse-applicative, but since TypeScript's API style is so different from Haskell's, I referenced Zod and similar libraries for the API design. For a more detailed introduction, please refer to the article I posted on Hackers' Pub!

const parser = or(
  object({
    type: constant("network"),
    host: option(
      "-h", "--host",
      string({ metavar: "HOST" }),
    ),
    port: option(
      "-p", "--port",
      integer({ metavar: "PORT", min: 0, max: 65535 }),
    ),
  }),
  object({
    type: constant("local"),
    file: option(
      "-s", "--socket-file",
      string({ metavar: "FILE" }),
    ),
  }),
)

type Result = InferValue<typeof parser>;

// The above type is inferred as:
type Result = {
    readonly type: "network";
    readonly host: string;
    readonly port: number;
} | {
    readonly type: "local";
    readonly file: string;
}

最近、OptiqueというTypeScript向けのCLIパーサー「コンビネーター」を作っています。Optiqueは、複雑なCLIを小さなパーツの組み合わせで記述できる様にしてくれます。そして、そのCLIのパース結果を型安全に扱う事が出来ます。(下記のコード参照)アイデアはHaskellのoptparse-applicative から得ましたが、TypeScriptはHaskellとAPIのスタイルがかなり異なる為、APIの面ではZod等を参考にしました。詳しい紹介はHackers' Pubに投稿した記事をご覧ください!

const parser = or(
  object({
    type: constant("network"),
    host: option(
      "-h", "--host",
      string({ metavar: "HOST" }),
    ),
    port: option(
      "-p", "--port",
      integer({ metavar: "PORT", min: 0, max: 65535 }),
    ),
  }),
  object({
    type: constant("local"),
    file: option(
      "-s", "--socket-file",
      string({ metavar: "FILE" }),
    ),
  }),
)

type Result = InferValue<typeof parser>;

// Resultの推論された型
type Result = {
    readonly type: "network";
    readonly host: string;
    readonly port: number;
} | {
    readonly type: "local";
    readonly file: string;
}
0

I've recently been working on Optique, a CLI parser combinator for TypeScript. Optique allows you to describe complex CLIs by combining smaller parts. You can also handle the CLI parsing results in a type-safe manner (see code below). The idea came from Haskell's optparse-applicative, but since TypeScript's API style is so different from Haskell's, I referenced Zod and similar libraries for the API design. For a more detailed introduction, please refer to the article I posted on Hackers' Pub!

const parser = or(
  object({
    type: constant("network"),
    host: option(
      "-h", "--host",
      string({ metavar: "HOST" }),
    ),
    port: option(
      "-p", "--port",
      integer({ metavar: "PORT", min: 0, max: 65535 }),
    ),
  }),
  object({
    type: constant("local"),
    file: option(
      "-s", "--socket-file",
      string({ metavar: "FILE" }),
    ),
  }),
)

type Result = InferValue<typeof parser>;

// The above type is inferred as:
type Result = {
    readonly type: "network";
    readonly host: string;
    readonly port: number;
} | {
    readonly type: "local";
    readonly file: string;
}
3
2

mcp에 툴을 계속 쥐어주는게 불만이다. 불안하지도 않나? 아니 pg를 관리하는 mcp를 쓰는것보다 pg를 관리하는데 사용되는 명령어를 물어보고 그걸 내가 확인 후 실행하는게 맞지 않나? deno로 권한 다 뺏고서 mcp를 실행하면 좀 방지가 되려나?

3

러스트의 ICE 관련 이슈는 파보면 확실히 난이도가 높다. 이번에 본건 조기 종료 때문에 에러가 전파되지 않는 것이 문제인 줄 알았는데, Higher-Rank Trait Bound와 concrete 타입 간의 불일치를 처리하지 못해서 equality 검사를 하기 직전에 뻗는 것이였음.

4

박준규 replied to the below article:

Optique: 타입 안전한 CLI 파서 컴비네이터

洪 民憙 (Hong Minhee) @hongminhee@hackers.pub

이 글에서는 Haskell의 `optparse-applicative`와 TypeScript의 Zod에서 영감을 받아 제작된 새로운 CLI 파서 라이브러리인 Optique를 소개합니다. Optique는 파서 컴비네이터를 활용하여 CLI의 구조를 레고 블록처럼 조립할 수 있게 해줍니다. `option()`, `optional()`, `multiple()`, `or()`, `object()`, `constant()`, `command()`, `argument()` 등의 다양한 파서와 컴비네이터를 통해 복잡한 CLI 구조를 유연하게 정의할 수 있습니다. 특히, `or()`와 `object()` 컴비네이터를 사용하여 상호 배타적인 옵션이나 서브커맨드를 쉽게 구현하는 방법을 예제를 통해 설명합니다. Optique는 단순한 CLI 파서 역할에 집중하고 있어 모든 기능을 제공하지는 않지만, 복잡한 CLI 구조를 표현하는 데 유용하며, 소개 문서와 튜토리얼을 통해 더 자세한 내용을 확인할 수 있습니다.

Read more →
13
2
2
3

맥 미니가 자꾸 혼자 슬립 상태로 들어가길래 쓰고 있던 카페인의 문제인가 싶어서 지우고 keepingyouawake를 설치했는데 잘 될지 모르겠네...

사실 홈 서버는 맥 미니가 아니고 딴 거긴 한데 곧 얘를 중심으로 클러스터?를 만들어봐야 할 것 같기도..

2