메뉴
HN
Hacker News 49일 전

고급 언어처럼 쓰는 Rust: 고통 20%로 80%의 혜택 누리기

IMP
6/10
핵심 요약

저자는 완벽한 프로그래밍 언어를 찾던 중 Rust의 강력한 타입 시스템과 성능에 주목합니다. 그러나 가파른 학습 곡선과 낮은 생산성이라는 단점을 극복하기 위해, Rust를 C#이나 TypeScript 같은 고급 언어처럼 다루는 접근법을 제안합니다. 이를 통해 약간의 성능 저하(10~20%)만 감수하면 Rust가 가진 장점의 80%를 얻으면서도 고질적인 개발자 경험의 어려움을 20% 수준으로 크게 줄일 수 있다고 설명합니다.

번역된 본문

원문 제목: 고급 언어처럼 쓰는 Rust: 고통 20%로 80%의 혜택 누리기

소스: 해커뉴스(hackernews)

수년 동안 완벽한 프로그래밍 언어를 찾아왔지만, 지금까지 내린 결론은 '그런 언어는 없다'는 것입니다. 다음의 조건을 모두 갖춘 프로그래밍 언어는 존재하지 않습니다.

  • 표현력이 풍부한 타입 시스템
  • 우수한 커뮤니티
  • 훌륭한 생태계
  • 뛰어난 성능
  • 좋은 개발자 경험(DevX)

몇몇 언어들은 근접하지만, 모두 어딘가가 부족합니다. 지난 몇 년 동안 내가 주로 선택했던 언어들은 F#, TypeScript, 그리고 C#이었습니다. 이들은 모두 훌륭한 언어지만, 항상 어떤 측면에서는 타협하고 있다는 느낌을 받았습니다.

  • F#: 훌륭한 타입 시스템과 기반을 갖추고 있지만, 문법이 너무 최소한이라 가독성이 떨어집니다. 생태계도 작아 방치된 패키지가 많거나 C#과의 상호 운용을 위해 래퍼(wrapper)를 직접 만들어야 합니다. 또한 학습 데이터가 너무 적고 객체 지향(OO) C#에 가려져 AI가 관용적인 F# 코드를 잘 작성하지 못합니다.
  • TypeScript: 세계에서 가장 큰 생태계를 가지며 어디에나 있지만, 타입은 종종 거짓말(lies)을 하고 생태계는 끊임없이 대규모 변화를 겪고 있습니다.
  • C#: 견고한 객체 지향 언어이지만 상용구 코드(boilerplate)가 가득하고, 아직 네이티브 유니온(unions)과 완전한 패턴 매칭(exhaustive pattern matching)을 지원하지 않습니다 (올해 지원될 수도 있겠지만요).

관련 글: F#이 형편없는 7가지 이유

그래서 저는 해마다 언어들 사이를 오가며, 각 언어를 제가 원하는 방향으로 더욱 밀어붙였습니다.

  • 약간 장황한 F# 작성
  • TypeScript에 Result 타입 추가
  • C#에서 불변 레코드(immutable records)와 Results 사용

모두 제가 원하는 방향에 더 가까워졌지만, 여전히 완벽하진 않았습니다.

Rust는 생산성만 빼면 완벽합니다.

저는 오래전부터 Rust에 대해 알고 있었고, 몇 번 진지하게 고려하기도 했지만 실제로 무언가를 만들어본 적은 없었습니다. 주로 학습 곡선이 얻는 이점만큼 가치가 있다고 생각하지 않았기 때문입니다. 결국 저는 시스템 수준의 프로그래머가 아닌데, 왜 시스템 수준의 언어를 사용해야 할까요?

하지만 최근 몇 주 동안 무언가를 만들며 보낸 '리커스 센터(Recurse Center)'에서 Rust가 꽤 인기 있었습니다. 그리고 누군가 단지 타입 시스템 때문에 Rust를 선택하더라도 좋은 언어라고 말했습니다. 이는 저에게 흥미로웠습니다. 왜냐하면 저도 종종 타입 시스템(이것은 언어를 선택하는 가장 큰 차별화 요소 중 하나입니다) 때문에 언어를 선택한 뒤, 이를 지원할 생태계가 있기를 바라는 경우가 많았기 때문입니다.

그래서 제가 찾던 '빠진 언어'에 대해 조사하고 보고했더니, Rust가 역시 강력한 후보였습니다. 다만, 개발자 경험(DevX)만 제외하면 말이죠.

하지만 저는 이런 생각을 하게 되었습니다. AI가 표준 코드를 작성하는 데 매우 뛰어난 지금, 이 학습 곡선이 훨씬 완만해지지 않았을까요? 다른 언어를 쓸 때와 비슷한 속도로 Rust에서도 개발할 수 있지 않을까요? 그렇다면 우리는 무엇을 얻을 수 있을까요?

Rust의 장단점

Rust의 장단점은 대략 다음과 같이 정리됩니다.

장점:

  • 빠른 속도: 읽을 수 있는 언어 중 거의 C 언어에 근접한 속도를 냅니다.
  • 훌륭한 타입: 진정으로 표현력이 풍부합니다 (참고: 표현력이 풍부한 타입 시스템의 정의).
  • 어디서든 실행: 매우 저수준이기 때문에 대부분의 환경에 연동될 수 있습니다.
  • 크고 성장하는 생태계: 규모 기준 약 10위이며, 2025년 스택 오버플로우 개발자 설문에 따르면 약 15%의 개발자가 사용 중이며 매년 약 30%씩 성장하고 있습니다.
  • 매우 안정적: 시간이 지나도 망가지지 않는 견고한 크레이트(crates)를 만들기 위해 엄청난 노력을 기울입니다 (비동기 런타임 등 언어 자체에 변화가 있었던 적은 있지만요).

단점:

  • 러닝 커브: 소유권(ownership), 대여(borrowing), 라이프타임(lifetimes), 비동기 런타임 및 함정(gotchas).
  • 낮은 개발 속도: 고급 언어들에 비해 생산성이 떨어집니다.

장점은 정말 매력적입니다. 사실 단점을 제거할 수 있다면 Rust는 제가 찾던 바로 그 언어처럼 보입니다.

고급 언어로서의 Rust

그래서 저는 하나의 아이디어를 떠올렸습니다. Rust를 그냥 고급 언어처럼 작성하면 어떨까요? 개발자 경험을 C#, F#, TypeScript 수준으로 끌어올릴 수 있다면, 기본적으로 장점만 모두 취할 수 있지 않을까요?

그래서 연구를 시작하고 Rust 책을 읽으며 작은 프로토타입들을 만들어 보았습니다. 그 결과, 단지 약 20%의 고통만으로 Rust의 이점을 약 80%나 얻을 수 있는 접근법을 고안해 냈습니다. 대부분의 경우 유일한 단점은 성능이 10~20% 정도 저하된다는 것뿐입니다. Rust가 기본적으로 얼마나 빠른지, 다른 언어들과 비교했을 때 어느 수준인지 생각해보면 그 정도의 성능 저하는 그리 나쁘지 않습니다.

원문 보기
원문 보기 (영어)
High-Level Rust: Getting 80% of the Benefits with 20% of the Pain Essay - Published: 2026.02.11 | 5 min read (1,413 words) build | create | rust DISCLOSURE: If you buy through affiliate links, I may earn a small commission. (disclosures) I've been searching for the perfect programming language for years and my conclusion thus far is that it's missing. There is no programming language that has it all: Expressive types Good Community Good ecosystem Good perf Good devx Several get close, but they're all missing something. For the past couple years, my languages of choice have been F#, TypeScript, and C#. They are all solid languages but I always felt like I was settling in some dimension. F# - Has great types and bones but I think the syntax is too minimal to be readable, the ecosystem is tiny with many abandoned packages or you build wrappers to interop with C#, and AIs aren't very good at idiomatic F# because there's so little training data and is overshadowed by OO C#. TypeScript - Is ubiquitious with the biggest ecosystem in the world but the types are lies and the ecosystem is constantly undergoing largescale thrash C# - Is a solid OO language but it's full of boilerplate and has yet to get native unions and exhaustive pattern matching (maybe this year?). Related: 7 Reasons F# Sucks So I found myself bouncing back and forth year after year and bending each language further towards what I wanted: Writing some verbose F# Adding results to TypeScript Using immutable records and Results in C# They all got closer but just weren't quite there. Rust is perfect, except for the productivity I've known about Rust for a long time but have only seriously considered it a few times and never really built anything with it - largely because I didn't think the learning curve was worth the gains. After all I'm not a systems-level programmer, so why use a systems-level language? But it's popular at Recurse Center where I've spent the last several weeks building stuff and someone mentioned that Rust was a good language even if you just chose it for the types. That was interesting to me because I often do choose the language for its types (its one of the biggest differentiators) and then hope that there's an ecosystem to support it. So I went and researched / reported on the missing language and sure enough Rust is a strong contender - except for its devx. But I got to thinking - with AI so good at writing standard code , is this learning curve now much lower? Can we move about as fast with Rust as we would another language? And if we could do that, what would we gain? The Pros and Cons of Rust The pros and cons of Rust basically shake out to: Pros: Fast - Approaching C which is about as fast as you can get in a readable language Great types - truly expressive (see: my definition of expressive types ) Runs ~anywhere - Is so low level it can plug into most things Large and growing ecosystem - ~10th in size w ~15% of devs using it and growing at ~30% per year according to Stack Overflow Dev survey 2025 Super stable - Goes to great lengths to have solid crates that don't break over time (though the lang has had its share of thrash like with async runtimes) Cons: Learning curve - ownership, borrowing, lifetimes, async runtimes and gotchas Lower velocity - vs high level languages So the pros are really really good. In fact, if you could remove the cons Rust looks a lot like the type of language I've been searching for. High Level Rust So I had this idea - what if you could just write Rust as a high-level language? If you can just get that devx to approach that of C#, F#, TS then you get basically all upside. So I started doing research and reading the Rust book and building little prototypes. What I came up with was an approach that gets us ~80% of benefits of Rust for only ~20% of the pain. And in most cases the only drawbacks are a 10-20% hit on perf which isn't that bad when we consider how fast Rust is out of the box and how it compares to other languages we'd build in the same way. The approach is: Type-first domain modeling - Use enums and structs to model your domain. Make invalid states unrepresentable. Functionalish logic - This means immutable by default, pure functions, ImPureIm sandwiches, generous cloning instead of mutations. Rust's type system already pushes you towards this so we're working with the system but if you also allow yourself to take the perf hit on clones you can avoid most painful borrow checker / lifetime / async edge cases. Note: there be dragons in cloning perf since this is not a Garbage Collected language, you likely need to use Arc on non primitives and structs and immutable collection crates to keep clone cost down. Domain Driven Design - Domains encapsulated behind services. Use traits as interfaces to help with DI, testing. Create these services at the app root and use Arc<dyn TRAIT> to allow for shared references. We do lose some perf from this approach but it's in the ballpark of 10-30% depending on how frequently you're doing these clones. If you do have a hot path / perf critical area, you can typically optimize those away by switching them over to mutations. I'll note that this approach adds in some extra mental overhead in terms of remembering to use immutable structures / primitives / Arc everywhere you can to allow for less expensive clones. That's a real cost you don't typically pay in GC languages (other than limit data / clones in frequency / size) and not something Rust's type system is currently helping with (both expensive and cheap clones are just .clone() ). And expensive clones are very bad in Rust because they're all deep clones so some inefficient ones in hot paths can easily tank your perf down below that of other compiled languages like F# / C#. (I see there are some alias proposals to help with this and I'm putting together a package to allow the type system to point these out to prevent myself from repeatedly making this mistake). So this approach works for most general high level computing tasks but is not universally effective. When High Level Rust Makes Sense I think this is a good fit when you care more about logic than performance. But if performance is a concern / you have logic in a hot path then mutations likely makes more sense as it's much faster. Good fit: Web APIs, CRUD services Business logic heavy applications Projects where correctness > raw performance Teams coming from functional languages Not a fit: Hot paths, game engines, OS kernels Complex concurrent systems with shared mutable state When you need every bit of performance When you have time to learn / use "proper" Rust - I'm sure experienced Rustaceans will see this proposal as overly restrictive and ineffective for leveraging the language for what it's capable of Next Rust really feels like an excellent language on paper but it has some scary edge cases that make it hard to onboard onto. I think this approach can help soften those edges and make it an excellent high level language that happens to be able to produce near-metal performance if and when you need it. But we'll see - I just started this journey a few weeks ago and am actively exploring this approach through demo web services, games, and CLIs so maybe my view will change. I'm actively working on LightClone - the package to enforce cheap clones. If you're interested in this / want to see it happen please star it on GitHub and shoot me any feedback you might have. This would let me know it's smth people want, is worth investing in, and help me make it more generally useful! If you liked this post you might also like: The Missing Programming Language - Why There's No S-Tier Language (Yet) How I think about writing quality code fast with AI 5 AI Coding Best Practices from a Google AI Director (That Actually Work) Want more like this? The best way to support my work is to like / comment / share this post on your favorite socials. Subscribe for monthly email roundups of new posts Become