| [[프로그래밍 언어|'''프로그래밍 언어 {{{#!wiki style="font-family: Times New Roman, serif; display: inline;"]] | ||
| {{{#!wiki style="min-height: calc(1.5em + 5px); margin: 0 -10px -5px" {{{#!wiki style="display: inline-table; min-width: 40%; min-height: calc(1.5em + 5px)" {{{#!folding [ 목록 ] {{{#!wiki style="margin: -5px -1px" | <colbgcolor=royalblue><colcolor=#fff> ※ 나무위키에 등재된 프로그래밍 언어 목록 | |
| A | ActionScript · AdaT · AgdaTP · ALGOLT · ApexT · APL · awk · AssemblyT | |||||||
| B | BASIC | |||||||
| C | ||||||||
| D | ||||||||
| E | Elixir · | |||||||
| F | ||||||||
| G | GNU Octave · | |||||||
| H | ||||||||
| J | ||||||||
| K | ||||||||
| L | LeanTP · | |||||||
| M | MATLAB · MaxV · MojoT · Moonlight | |||||||
| N | ||||||||
| O | OberonT · Objective-CT · | |||||||
| P | PascalT · | |||||||
| Q | Q#T · QML | |||||||
| R | ||||||||
| S | SAS · | |||||||
| T | ||||||||
| U | UdonV · | |||||||
| V | Visual Basic · Visual Basic .NET · Visual Basic for Applications · vvvvV | |||||||
| X | XSharp | |||||||
| Z | ZenScript · | |||||||
| ㄴ | 누리 | |||||||
| ㅅ/ㅆ | 숨V · 씨앗 | |||||||
| ㅇ | 약속 · | |||||||
| ㅊ | 창조 | |||||||
| T: 정적 타입 프로그래밍 언어 · P: 증명 보조 언어 · S: LISP 방언 및 S-표현식 기반 언어 · V: 시각적 프로그래밍 언어 | }}}}}}}}}{{{#!wiki style="display: inline-table; min-width: 40%; min-height: calc(1.5em + 5px)" {{{#!folding [ 순위 ] {{{#!wiki style="margin: -5px -1px -10px" | {{{#!wiki style="min-height: calc(1.5em + 5px); margin: 0 -10px -5px" {{{#!wiki style="display: inline-table; min-width: 25%; min-height: calc(1.5em + 5px)" {{{#!folding [ IEEE Spectrum 2025 ] {{{#!wiki style="margin: -5px -1px" | <tablewidth=100%><tablebgcolor=transparent><colbgcolor=#11a500><colcolor=#fff> 스펙트럼 부문 상위 10개 프로그래밍 언어 | <colbgcolor=#ff1100><colcolor=#fff> 직업 부문 상위 10개 프로그래밍 언어 | ||||
| 1 | Python | 1 | Python | |||||
| 2 | Java | 2 | SQL | |||||
| 3 | C++ | 3 | Java | |||||
| 4 | SQL | 4 | JavaScript | |||||
| 5 | C# | 5 | TypeScript | |||||
| 6 | JavaScript | 6 | C# | |||||
| 7 | TypeScript | 7 | C++ | |||||
| 8 | C | 8 | HTML | |||||
| 9 | Shell | 9 | Go | |||||
| 10 | Go | 10 | Shell | }}}}}}}}}{{{#!wiki style="display: inline-table; min-width: 25%; min-height: calc(1.5em + 5px)" {{{#!folding [ Stack Overflow 2025 ] {{{#!wiki style="margin: -5px -1px" | <colbgcolor=#ffa500><colcolor=#fff> 2025년 Stackoverflow 설문조사 상위 25개 프로그래밍 언어 | |||
| 1 | JavaScript | <colbgcolor=#ffa500><colcolor=#fff> 14 | Rust | |||||
| 2 | HTML & CSS | 15 | Kotlin | |||||
| 3 | SQL | 16 | Lua | |||||
| 4 | Python | 17 | 어셈블리어 | |||||
| 5 | Bash/Shell | 18 | Ruby | |||||
| 6 | TypeScript | 19 | Dart | |||||
| 7 | Java | 20 | Swift | |||||
| 8 | C# | 21 | R | |||||
| 9 | C++ | 22 | Groovy | |||||
| 10 | PowerShell | 23 | Visual Basic | |||||
| 11 | C | 24 | VBA | |||||
| 12 | PHP | 25 | MATLAB | |||||
| 13 | Go | }}}}}}}}}{{{#!wiki style="display: inline-table; min-width: 25%; min-height: calc(1.5em + 5px)" {{{#!folding [ TIOBE 2025 ] {{{#!wiki style="margin: -5px -1px" | <colbgcolor=#2777c2><colcolor=#fff> 2025년 10월 TIOBE 검색어 점유율 상위 20개 프로그래밍 언어 | |||||
| 1 | Python | <colbgcolor=#2777c2><colcolor=#fff> 11 | Fortran | |||||
| 2 | C | 12 | Perl | |||||
| 3 | C++ | 13 | R | |||||
| 4 | Java | 14 | PHP | |||||
| 5 | C# | 15 | Assembly language | |||||
| 6 | JavaScript | 16 | Rust | |||||
| 7 | Visual Basic | 17 | MATLAB | |||||
| 8 | Go | 18 | Scratch | |||||
| 9 | Delphi / Object Pascal | 19 | Ada | |||||
| 10 | SQL | 20 | Kotlin | }}}}}}}}}{{{#!wiki style="display: inline-table; min-width: 25%; min-height: calc(1.5em + 5px)" {{{#!folding [ PYPL 2025 ] {{{#!wiki style="margin: -5px -1px -10px" | <colbgcolor=green><colcolor=#fff> 2025년 11월 PYPL 검색어 점유율 상위 20개 프로그래밍 언어 | |||
| 1 | Python | <colbgcolor=green><colcolor=#fff> 11 | Ada | |||||
| 2 | Java | 12 | TypeScript | |||||
| 3 | C++ | 13 | MATLAB | |||||
| 4 | Objective-C | 14 | Kotlin | |||||
| 5 | R | 15 | PowerShell | |||||
| 6 | JavaScript | 16 | Go | |||||
| 7 | C# | 17 | Dart | |||||
| 8 | Swift | 18 | Ruby | |||||
| 9 | PHP | 19 | Lua | |||||
| 10 | Rust | 20 | VBA | }}}}}}}}}}}} | }}}}}}}}}}}} | |||
| 실행 방식 · 분류 · 언어 목록(분류:프로그래밍 언어 문법) · 언어별 예제 · 틀:프로그래밍 언어 문법 · 틀:난해한 프로그래밍 언어 | ||||||||
| 틀:난해한 프로그래밍 언어어와의 병합 토론이 진행 중입니다. | ||||||||
1. 개요
def main : IO Unit :=
IO.println "Hello, World!"
Lean은 마이크로소프트 리서치에서 개발한 프로그래밍 언어이자 증명보조기이다.
mathlib 등 수학 이론 및 증명들을 형식화하는 데 사용되는 것이 대표적이며, lean4 이후로는 일반적인 프로그래밍 용도로도 사용할 수 있다. 처음 Lean 프로젝트가 시작된 곳이 마이크로소프트 리서치이지만,[1] 2023년부터는 비영리단체인 Lean FRO[2]가 개발을 담당하고 있다.
2. 재귀 처리 관련
reference에서도 강조하고 있는 사실이긴 하지만 lean의 structural recursion 구현은 기본적으로 syntactic한 수준에서 구현되어 있다. semantic한 방식은 well-founded recursion 참고. 참고로 집합론에 나오는 그 well-foundedness를 생각하면 편하다. 해당 개념을 잘 구분하지 않으면 간혹 recursion 구현 시 문제를 볼 때가 있다. 가령 함수형 프로그래밍에서 자주 나오는 zip 구현을 생각해 보자.List가 inductive type이기 때문에 naive하게 다음과 같은 구현을 생각해볼 수 있다.def zip (l : List α × List β) :=
match (l.1, l.2) with
| (a :: as, b :: bs) => (a, b) :: zip (as, bs)
| _ => []잘 돌아갈 것 같지만 실제로는 다음과 같이 컴파일에 실패한다.
fail to show termination for
zip
with errors
failed to infer structural recursion:
Not considering parameter α of zip:
it is unchanged in the recursive calls
Not considering parameter β of zip:
it is unchanged in the recursive calls
Cannot use parameter l:
the type List α × List β does not have a `.brecOn` recursor
failed to prove termination, possible solutions:
- Use `have`-expressions to prove the remaining goals
- Use `termination_by` to specify a different well-founded relation
- Use `decreasing_by` to specify your own tactic for discharging this kind of goal
α : Type u_1
β : Type u_2
l : List α × List β
as : List α
bs : List β
⊢ 1 + sizeOf as + sizeOf bs < sizeOf l해당 오류가 복잡해 보이지만 윗 부분의
the type List α × List β does not have a `.brecOn` recursor가 핵심인데, Prod가 recursive type이 아니라는 뜻이고, 때문에 structural recursion이 될 수 없다는 소리다. 때문에 well-founded recursion으로 추론했다가 termination의 증명에도 실패(failed to prove)했다는 소리가 아래 메세지다. 위 예시에서는 기본적으로 discriminant가 변수가 아니라서 그런데, 아래와 같이 direct parameter를 그대로 쓰도록 바꾸면 parameter와 pattern의 관계를 lean이 자동으로 추론할 수 있기에 well-founded recursion의 증명이 성공해서 컴파일이 성공한다. 참고로 편의상 parameter name까지 생략했으나 생략 문법을 쓰지 않아도 결과는 똑같다.def zip : List α × List β → List (α × β)
| (a :: as, b :: bs) => (a, b) :: zip (as, bs)
| _ => []위 방법 외에도 상황에 따라 적절한 경우, simultaneous match를 쓰면 처음부터 structural recursion을 만들 수 있다.
def zip : List α → List β → List (α × β)
| a :: as, b :: bs => (a, b) :: zip as bs
| _, _ => []3. 기타
버전 관리자로 elan이 있는데, Nix를 쓰고 있다면 lean4를 바로 설치해도 된다. 단, 둘을 동시에 설치하면 elan toolchain을 nixpkgs 버전이 덮어버릴 수 있으니 하나만 쓰는 것이 좋다. flake 관리를 잘 할 자신이 있다면 lean4-nix 등의 overlay를 사용해도 무방한 편. 기본적으로 빌드 툴로 lake를 쓰고 있다면lean-toolchain이랑 lakefile.toml 버전을 맞춰줘야 한다.4. 외부 링크
- https://lean-lang.org/
- Lean Documentation Overview
- A Tour of Lean
- Lean4 Playground
- The Lean Language Reference
- Theorem Proving in Lean 4
- Natural Number Game
- 페아노 공리계를 구성하면서 진행되는 대화형 Lean 튜토리얼이다.
- vscode 확장
- Lean community
- Mathematics in Lean
- The Math Is Haunted