Zig + Nvim ์„ค์ •

last updated: {{ โ€œ1710903265โ€ | date: โ€œ%Y-%m-%d %H:%Mโ€ }} Intro neovim์—์„œ zig ์„ค์ • ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•œ๋‹ค. Install on Alpine ์„ค์น˜ํ•˜๊ธฐ $ doas apk add zig zls neovim $ nvim ~/.local/nvim/init.lua require 'lspconfig'.zls.setup{} ๋‹ค๋ฅธ ์–ด๋–ค ์–ธ์–ด๋ณด๋‹ค๋„ ์„ค์ •์ด ๊ฐ„๋‹จํ•˜๋‹ค. zls๋Š” zig language server lspconfig๋Š” neovim์— ๋‚ด์žฅ๋œ LSP ์„ค์ •์„ ๋งํ•œ๋‹ค. nvim ์„ค์ • ํ›„ zigํŒŒ์ผ์„ ์—ด๊ณ  ์ฝ”๋”ฉํ•˜๋ฉด ๋„์›€๋ง์ด ๋‚˜ํƒ€๋‚œ๋‹ค. tab์œผ๋กœ ์ด๋™ํ•˜๊ณ  Enter๋กœ ์„ ํƒํ•œ๋‹ค. Install zls from Source ์†Œ์Šค๋ฅผ ์ปดํŒŒ์ผํ•˜๋Š” ๋ฐฉ๋ฒ•. ์ตœ์‹  ๋ฒ„์ „์˜ zig(ํ˜„์žฌ 0.12)์ด์–ด์•ผ git ์†Œ์Šค๋กœ ์ปดํŒŒ์ผ ๋œ๋‹ค. zig ์ตœ์‹  ๋ฒ„์ „์€ zig ํ™ˆ์—์„œ ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์žˆ๋‹ค. ๋‹ค์Œ ์ ˆ์ฐจ์— ๋”ฐ๋ผ ๋นŒ๋“œํ•œ๋‹ค. $ git clone https://github.com/zigtools/zls $ cd zls $ zig build -Doptimize=ReleaseSafe $ mkdir ~/bin && cp zig-out/bin/zls ~/bin $ echo 'export PATH=$HOME/bin:$PATH' >> ~/.bash_profile $ source ~/.bash_profile $ zls --version Links Neovim setup for Zig https://terminalprogrammer.com/neovim-setup-for-zig

2024-03-12 ยท 121 words

Zig Programming Language

last updated: {{ โ€œ1712202776โ€ | date: โ€œ%Y-%m-%d %H:%Mโ€ }} Intro a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software. Install Debian/Ubuntu $ sudo apt install zig Alpine Linux $ doas apk add zig ์ตœ์‹  ๋ฆฌ๋ˆ…์Šค ๋ฒ„์ „ ์„ค์น˜ https://ziglang.org/download/ os์™€ ์•„ํ‚คํ…์ณ์— ๋งž๋Š” ํŒŒ์ผ์„ ๋‹ค์šด๋กœ๋“œํ•œ๋‹ค. ์••์ถ•์„ ํ‘ผ ํ›„ PATH๋ฅผ ์„ค์ •ํ•ด์ฃผ๋ฉด ๋ฐ”๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๋‹ค. ํ˜„์žฌ ์‚ฌ์šฉ ๋ฒ„์ „: 0.12 $ tar xJf zig-linux-x86_64-0.12.0-dev.3212+40e64245f.tar.xz $ ln -s zig-linux-x86_64-0.12.0-dev.3212+40e64245f/ zig $ cd zig; ls $ ./zig version $ ./zig help Hello World hello-world.zig const std = @import("std"); pub fn main() !void { std.debug.print("Hello, World!\n", .{}); } run / test $ zig run hello-world.zig $ zig test hello-world.zig build (default=debug, small, fast, safe) $ zig build-exe hello.zig $ ./hello $ zig build-exe --name hello-small -O ReleaseSmall hello.zig $ zig build-exe --name hello-fast -O ReleaseFast hello.zig $ zig build-exe --name hello-safe -O ReleaseSafe hello.zig $ zig build-exe --name hello-debug -O Debug hello.zig $ ls -l $ ./hello-small More Docs zig-nvim - neovim์— zig ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์„ค์ •ํ•˜๊ธฐ zig-cc - Zig๋กœ gcc/clang ์ปดํŒŒ์ผ๋Ÿฌ ๋Œ€์ฒดํ•˜๊ธฐ Links home - https://ziglang.org/ awesome zig - https://www.trackawesomelist.com/catdevnull/awesome-zig/readme/ Study and Docs zig-guide - https://zig.guide/ reference - https://ziglang.org/documentation/0.11.0/ zig-by-example - https://zig-by-example.com/ zig std - https://ziglang.org/documentation/master/std/ exercises - https://exercism.org/tracks/zig/exercises learn x in y minutes - https://learnxinyminutes.com/docs/zig/ Compile and Build zig-cc - https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html Zig Build System Internals - https://mitchellh.com/zig/build-internals

2024-03-12 ยท 214 words

lua

Basic lua intro - lua์†Œ๊ฐœ: ์™œ lua์ธ๊ฐ€ lua install - lua ์„ค์น˜ํ•˜๊ธฐ, hello world lua interactive - ๋ฃจ์•„ ์ธํ„ฐ์—‘ํ‹ฐ๋ธŒ lua quick quide - lua ๊ธฐ๋ณธ ๋ฌธ๋ฒ• ๊ฐ€์ด๋“œ Lua Modules luarocks - lua ํ™•์žฅ ๋ชจ๋“ˆ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ luastatic - lua ์ปดํŒŒ์ผ ๋‹จ๋… ์‹คํ–‰ํŒŒ์ผ ๋งŒ๋“ค๊ธฐ lua-csv - lua csv ๋ชจ๋“ˆ lua-json - lua json ๋ชจ๋“ˆ LuaJit luaJit - LuaJit, Just in Time Compiler luajit lfs-ffi - LuaJit lua file system ๋ชจ๋“ˆ luafun - LuaJit Functions Module (ํ™•์žฅ๋ชจ๋“ˆ) Graphic & Game lua love - lua love 2D ๊ฒŒ์ž„ ๋งŒ๋“ค๊ธฐ gimp-glua - gimp์˜ ์ด๋ฏธ์ง€ ํ”„๋กœ์„ธ์‹ฑ ํ”Œ๋Ÿฌ๊ทธ์ธ IoT nodemcu - Lua base firmware esp32, esp8266 Science & Math gsl shell - Luajit GNU Scientific Library Shell WWW openresty - ์›น๊ฐœ๋ฐœ ์ธํ„ฐํŽ˜์ด์Šค: luajit + nginx luakit - A fast, extensible, and customizable web browser ์‘์šฉ lua pi - Raspberry Pi์—์„œ Lua ๊ฐœ๋ฐœ ๋ฐ ์„ค์น˜ ํ™˜๊ฒฝ ๋งŒ๋“ค๊ธฐ nvim lua - nvim์„ lua๋กœ ์„ค์ • ๋ฐ ๊ด€๋ฆฌํ•˜๊ธฐ alpine lua language server - Lua Language Server Install Links Lua Sample Code https://lua-users.org/wiki/SampleCode Awesome Luahttps://github.com/LewisJEllis/awesome-lua Awesome Restyhttps://github.com/LewisJEllis/awesome-lua

2022-08-27 ยท 166 words

Rust Programming Language

rust install - ๋Ÿฌ์ŠคํŠธ ์„ค์น˜ rust compile size - ์ปดํŒŒ์ผ ์‚ฌ์ด์ฆˆ ์ค„์ด๊ธฐ

2022-08-23 ยท (updated 2022-08-31) ยท 12 words