Zig(프로그래밍 언어)

Zig (programming language)
지그
Zig logo 2020.svg
패러다임멀티패러다임:필수,동시,
설계자앤드류 켈리
처음 등장한2016년 2월 8일, 6년 전(2016-02-08)[1]
프리뷰 릴리즈
2022년 2월 15일 0.9.1[2], 5개월 (2022년 2월 15일)
타이핑 분야정적, 강력, 추정, 구조, 범용
플랫폼x86-64, ARM, MIPS, IA-32, Web Assembly, RISC-V
OS크로스 플랫폼
면허증.MIT 라이선스
파일 이름 확장자.zig, .zir
웹 사이트ziglang.org
영향을 받다
C, C++, LLVM IR, Go, Rust, JavaScript

Zig는 Andrew [3][4]Kelley가 설계한 필수 범용 정적 유형 컴파일 시스템 프로그래밍 언어입니다.이 언어는 "강성, 최적성 및 유지보수성"[5][6]을 위해 설계되었으며 컴파일 시간 생성, 반사평가, 교차 컴파일 및 수동 메모리 [7]관리를 지원합니다.이 언어의 주요 목표는 C [8][9]언어를 개선하는 동시에 [10][11]Rust 등에서 영감을 얻는 것입니다.Zig는 낮은 수준의 프로그래밍을 위한 많은 기능을 가지고 있습니다. 특히 패킹된 구조(필드 사이에 패딩이 없는 구조), 임의 폭[12] 정수 및 다중 포인터 유형입니다.[13]

스테이지 1 컴파일러는 백엔드로 [15][16]LLVM 13을[14] 사용하여 Zig 및 C++로 작성되어 네이티브 [17]타깃의 대부분을 지원합니다.컴파일러는 MIT [18]라이선스의 오픈 소스입니다.Zig 컴파일러는 Clang과 마찬가지로 "zig cc" 및 "zig c++"[19] 명령어를 사용하여 C와 C++를 컴파일할 수 있는 기능을 제공하며, 많은 다른 플랫폼에 libc와 libcxx포함한 많은 헤더를 제공하여 [20][21]Zig의 cc와 c++ 서브 명령어를 즉시 크로스 컴파일러로 동작시킬 수 있습니다.

Zig 개발은 Andrew Kelley가 사장으로 있는 비영리법인 Zig Software Foundation(ZSF)에서 자금을 조달하고 있으며, 기부금을 받아 여러 명의 정규직 [22][23][24]직원을 고용하고 있습니다.

안녕 세계

컨스턴트 표준 = @import("표준");  술집 fn 주된() !무효 {     컨스턴트 설치하다 = 표준.이오.getStdOut().작가.();     해라 설치하다.인쇄물("안녕하세요, {}!\n", .{"세계"}); } 

범용 링크 리스트

술집 fn 주된() 무효 {     변화하다 노드 = 링크 리스트(i32).노드 {         .프리브 = 무효,         .다음 분. = 무효,         .데이터. = 1234,     };      변화하다 목록. = 링크 리스트(i32) {         .첫번째 = &노드,         .지난 = &노드,         . = 1,     }; }  fn 링크 리스트(컴포넌트 T: 유형) 유형 {     돌아가다 구조 {         술집 컨스턴트 노드 = 구조 {             프리브: ?*노드,             다음 분.: ?*노드,             데이터.: T,         };          첫번째: ?*노드,         지난:  ?*노드,         :   이용하다,     }; } 

「 」를 참조해 주세요.

레퍼런스

  1. ^ Kelley, Andrew. "Introduction to the Zig Programming Language". andrewkelley.me. Retrieved 8 November 2020.
  2. ^ "Release 0.9.1".
  3. ^ "Zig has all the elegant simplicity of C, minus all the ways to shoot yourself in the foot". JAXenter. 2017-10-31. Retrieved 2020-02-11.
  4. ^ "Tired of C? New programming language Zig aims to be more pragmatic and readable". 2017-10-19. Retrieved 2020-04-22.
  5. ^ Yegulalp, Serdar (2016-08-29). "New challenger joins Rust to topple C language". InfoWorld. Retrieved 2020-02-11.
  6. ^ "Zig language and C". Sina Corp. 2020-07-12. Retrieved 2020-08-12.
  7. ^ "The Zig Programming Language". ziglang.org. Retrieved 2020-02-11.
  8. ^ "Mozilla's Observatory, the Zig programming language, and uSens' VR/AR SDK—SD Times news digest: Aug. 29, 2016". SD Times. 2016-08-29. Retrieved 2020-02-11.
  9. ^ "The Zig Programming Language". ziglang.org. Retrieved 2020-02-11.
  10. ^ Company, Sudo Null. "Sudo Null - IT News for you". SudoNull. Retrieved 2020-02-11.
  11. ^ Kelley, Andrew. "Unsafe Zig is Safer Than Unsafe Rust". andrewkelley.me. Retrieved 2020-02-11.
  12. ^ Tim Anderson 24 Apr 2020 at 09:50. "Keen to go _ExtInt? LLVM Clang compiler adds support for custom width integers". www.theregister.co.uk. Retrieved 2020-04-24.
  13. ^ "Documentation - The Zig Programming Language". ziglang.org. Retrieved 2020-04-24.
  14. ^ "SD Times news digest: C++20 concepts in Visual Studio 2010 version 16.3, Bootstrap to drop IE support, and Zig 0.60 released". SD Times. 2020-04-14. Retrieved 2020-04-19.
  15. ^ "A Reply to _The Road to Zig 1.0_". www.gingerbill.org. 2019-05-13. Retrieved 2020-02-11.
  16. ^ ziglang/zig, Zig Programming Language, 2020-02-11, retrieved 2020-02-11
  17. ^ "The Zig Programming Language". ziglang.org. Retrieved 2020-02-11.
  18. ^ "ziglang/zig". GitHub. Retrieved 2020-02-11.
  19. ^ "0.6.0 Release Notes · The Zig Programming Language". ziglang.org. Retrieved 2020-04-19.
  20. ^ "'zig cc': a Powerful Drop-In Replacement for GCC/Clang - Andrew Kelley". andrewkelley.me. Retrieved 2021-05-28.
  21. ^ "Zig Makes Go Cross Compilation Just Work". DEV Community. Retrieved 2021-05-28.
  22. ^ "Jakub Konka on Twitter". Twitter. Retrieved 2021-05-28.{{cite web}}: CS1 maint :url-status (링크)
  23. ^ "Announcing the Zig Software Foundation ⚡ Zig Programming Language". ziglang.org. Retrieved 2021-05-28.
  24. ^ "Sponsor ZSF ⚡ Zig Programming Language". ziglang.org. Retrieved 2021-05-28.

외부 링크