Joined July 2017
17 Photos and videos
Pinned Tweet
Modern C is possible. Just quietly dropping this here - my attempt to modernize C with better safety features.๐Ÿ˜Š (It was supposed to be just a game engine util, but I 'accidentally' spent a year modernize C instead... ๐Ÿ˜…) github.com/coding-pelican/daโ€ฆ
2
2
300
Gyeongtae Kim retweeted
Jan 30

100
168
1,883
185,947
Gyeongtae Kim retweeted
the classic - pass by value and pass by reference example. Given we want to swap the values of x and y. swap(int a, int b); ^^ The value of x and y are passed by copying them to parameter variables that live on the stack. The value is swapped between the parameters. As the function returns, the stack for swap() is destroyed and the original x, y value stay unchanged. swap(int *a, int *b); ^^ a and b are pointers that are fed the addresses of x and y. When swapping, the addresses are used to swap the values. As a result, the values saved at the addresses of x and y are swapped. After the function exits, the value of x and y are seen as swapped (thanks to the address level swap...). Assumptions: 32 bit machine - int is a 4 bytes. - pointers are 4 bytes. --- credits: thanks @bengmugenr for catching the error in previous post.
9
59
431
51,984
Rust-style Iterator Chaining in C. โ€‹One of the goals of my library, `dasae-headers`, is to bring modern ergonomics to C without sacrificing performance. โ€‹On the left is Rust. On the right is C. The syntax is nearly identical: `filter`, `map`, `reduce` - all implemented via macros with zero implicit allocation.
1
1
11
2,435
This proves that with careful macro design, C can have expressive, functional-style constructs while staying close to the metal. โ€‹Itโ€™s part of my project `dasae-headers`. โ€‹TestCode: github.com/coding-pelican/daโ€ฆ Source: github.com/coding-pelican/daโ€ฆ
1
2
174
If you want `.collect()`, you can implement it yourself. ๐Ÿ˜‚ โ€‹Since I enforce strict zero implicit allocation, you just need to fold the results into your specific container/allocator.
2
113
Digging up some old C preprocessor "black magic" from my archives. โ€‹Recently saw a student implementing polymorphic OOP in C macros, and it brought back memories. I used to be obsessed with manually architecting high-level concepts - like Classes and Namespaces - without any implicit allocations in pure C.
1
82
I absolutely detested having to write new helper macros for every single class definition, or relying on implicit dynamic allocation. โ€‹My goal was a system that worked universally - whether defined in source files or headers, and regardless of whether the object lived in static memory, the stack, or the heap. โ€‹I initially held a rigid belief that the syntax "must look like C ." โ€‹Once I broke free from that obsession, I gained significantly more freedom in designing the syntax and internal structure. The resulting design ended up being much cleaner.
1
54
It is not that I have abandoned macro magic entirely. I simply stopped writing macro sets that act like giant state machine parsers triggered by a single call. I prioritize transparency now. That said, the experience was critical. Understanding how to manually map high-level constructs to bare metal became a massive advantage later in language design and compiler code emission.
49
๊ฒŒ์ž„ ๊ฐœ๋ฐœํ•  ๋•Œ๋„ ๊ทธ๋ ‡๋‹ค. ์š”์ฆ˜ ๊ฐœ๋ฐœ ๊ด€๋ จํ•ด์„œ ์ž…๋ฒ„๋ฆ‡ ์ฒ˜๋Ÿผ ํ•˜๋Š” ์ด์•ผ๊ธฐ๊ฐ€.. "ํ•˜๊ณ  ์‹ถ์€ ๊ฑด ๋”ฑ 10~20%๋งŒ ๋‹ด์ž" ์ด ๋ง์„ ๋ฐ˜๋Œ€๋กœ ๋’ค์ง‘์œผ๋ฉด ๊ฒฐ๊ตญ, ํ•˜๊ณ ์‹ถ์€ ๊ฑธ ๋” ๋Š˜๋ฆฌ๋ฉด ํ•˜๊ธฐ ์‹ซ์€ ์ผ์˜ ๋น„์ค‘์ด 80~90% ์— ๋งž์ถฐ ํ™• ๋Š˜์–ด๋‚˜๊ธฐ ๋•Œ๋ฌธ์— ์™„์„ฑ์€ ๋” ๋ฉ€์–ด์ง. "๋Œ€์ž‘๋ณ‘" ๋ฐœ๋ณ‘์˜ ์›์ธ์ด ๋˜๊ฒ ๋‹ค.
๋ชจ๋“  ์ผ์€ ๊ทธ๋ ‡๋‹ค. ๋Œ€ํ•™๊ต๋•Œ๋ถ€ํ„ฐ ๋“ค์—ˆ๋˜ ๋ญ๋“  ํ•˜๊ธฐ ์‹ซ์€ ์ผ์ด 90ํ”„๋กœ๋‹ค. ๋ผ๋Š” ๋ง. '๊ทธ๋ฆผ ๊ทธ๋ฆฌ๋Š” ๊ฒƒ'์€ ์žฌ๋ฐŒ์ง€๋งŒ, ๊ทธ ์™ธ์— ์„ธ๊ธˆ์ฒ˜๋ฆฌ, ํ™๋ณด, ์ž๊ธฐ์–ดํ•„, ํฌํŠธํด๋ฆฌ์˜ค์ •๋ฆฌ, ์—…๊ณ„์‚ฌ๋žŒ๋งŒ๋‚˜๊ธฐ, ์ž‘์—…๋…ธํŠธ์“ฐ๊ธฐ, ์ด๋ฉ”์ผ์“ฐ๊ธฐ, ๊ณต๋ชจ์ง€์›, ๋ฏธํŒ…, ์ง€์›์„œ, ํŒŒ์ดํ”„๋ผ์ธ, ์ „์‹œ์ค€๋น„... ๋“ฑ๋“ฑ์€ ์žฌ๋ฏธ์—†์–ด.
48
43
4,367
Gyeongtae Kim retweeted
/users/1 /users/2 ์œ„์™€ ๊ฐ™์ด auto increment๋ฅผ URL์— ๋…ธ์ถœ์‹œํ‚ค๊ฒŒ ๋˜๋ฉด ์ด ๊ฐ’์„ ์ด์šฉํ•ด์„œ ํšŒ์›์ˆ˜๋Š” ๋ช‡๋ช…์ธ์ง€ ์ถ”์ •ํ•˜๊ฑฐ๋‚˜, ํฌ๋กค๋Ÿฌ๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ๋‚œ๋…ํ™” ํ•˜๊ธฐ ์œ„ํ•ด์„œ knuth mutliplcative hash๋ฅผ ์ด์šฉํ•˜๋ฉด ๋˜๊ณ , ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” inthash๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๐Ÿ™ƒ
2
91
182
53,096
Gyeongtae Kim retweeted
2022๋…„์˜ ์„ธ๊ณ„์„  feat ์ถซ
611
531
๊ณผ์ œํ• ๋•Œ ์•Œ์•„๋‘๋ฉด ์™„์ „ ๋„์›€ ๋˜๋Š” ์œ ์šฉํ•œ ์‚ฌ์ดํŠธ ๋ชจ์Œ (1/2)
5
15,168
23,376
Gyeongtae Kim retweeted
BIC ์ง„ํ–‰ ๊ธฐ๊ฐ„ 9์›”3์ผ ๋ถ€ํ„ฐ 4์ผ๊นŒ์ง€ ํŠธ์œ„ํ„ฐ๋ฅผ ํŒ”๋กœ์šฐ ํ•ด์ฃผ์‹œ๊ณ , ๋ณธ ํŠธ์œ—์„ ๋ฆฌํŠธ์œ— ํ•ด์ฃผ์‹  ๋ถ„๊ป˜ ์ถ”์ฒจ์„ ํ†ตํ•ด 5๋งŒ์› 9๋งŒ์› ์ƒ๋‹น์˜ ๊ฒŒ์ž„ ์—๋””์…˜์„ ๋ณด๋‚ด๋“œ๋ฆฝ๋‹ˆ๋‹ค! BIC ๋ถ€์Šค์œ„์น˜๋Š” E19์—์š”. ๋งŽ์ด ๋†€๋Ÿฌ์˜ค์„ธ์š”! (เธ‡ห™โˆ‡ห™)เธง #BIC #๋ถ€์‚ฐ์ธ๋””๊ฒŒ์ž„ํŽ˜์Šคํ‹ฐ๋ฒŒ #์ธ๋””๊ฒŒ์ž„ #๋ถ€์‚ฐ
13
14
Gyeongtae Kim retweeted
๋‚ด๊ฐ€ ๋ณด๋ ค๊ณ  ๋งŒ๋“  ์ธํ”„์ฝ˜ ๋ฐœํ‘œ์ž๋ฃŒ ํƒ€๋ž˜๐Ÿ™‚ ๋ฐœ๊ฒฌ ๋ชปํ•œ ์ž๋ฃŒ๊ฐ€ ์žˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค๐Ÿ’ฆ
2
171
311
Gyeongtae Kim retweeted
์ฟ ํฐ ๋กœ์ง์— "๋์—†์ด ์ถ”๊ฐ€๋˜๋Š” if/else"์—์„œ ๋งค์šฐ ๊ณต๊ฐํ•˜๊ฒŒ ๋œ๋‹ค. (์ปค๋จธ์Šค์— ์žˆ์„ ๋•Œ ๋น„์Šทํ•œ ๊ฒฝ์šฐ๋ฅผ ๋งŽ์ด ๋ณด์•˜๊ธฐ ๋•Œ๋ฌธ์ด์ง€...) ์•„์ด๋””์–ด๋„ ์ข‹์€ ๊ฒƒ ๊ฐ™๋‹ค. ์ด๋Ÿฐ ๊ฑธ ๋ด๋‘๋ฉด ๋‚˜์ค‘์— ๋น„์Šทํ•œ ๋ฌธ์ œ์—์„œ๋„ ํ™œ์šฉํ•ด๋ณผ ์ˆ˜ ์žˆ์ง€์š”. johngrib.github.io/wiki/artiโ€ฆ
2
89
188
Gyeongtae Kim retweeted
์ง€๋‚œ 1ํ•™๊ธฐ ๋™์•ˆ ์ด๋“์šฐ ๊ต์ˆ˜๋‹˜์˜ ๊ฒŒ์ž„๊ทธ๋ž˜ํ”ฝํ”„๋กœ๊ทธ๋ž˜๋ฐ ์ˆ˜์—…์„ ๋“ค์œผ๋ฉฐ ์ •๋ฆฌํ•œ ๊ฒŒ์ž„์ˆ˜ํ•™ ๋…ธํŠธ๋“ค์„ ๊ณต์œ  ๋ชฉ์ ์œผ๋กœ ๋ธ”๋กœ๊ทธ์— ์—…๋กœ๋“œํ–ˆ์Šต๋‹ˆ๋‹ค. ๋ถ€์กฑํ•˜์ง€๋งŒ ๋ˆ„๊ตฐ๊ฐ€์—๊ฒŒ ์กฐ๊ธˆ์ด๋‚˜๋งˆ ๋„์›€์ด ๋œ๋‹ค๋ฉด ๊ธฐ์  ๊ฒƒ ๊ฐ™์•„์š”๐Ÿ˜š jihukim135.github.io/categorโ€ฆ
4
230
406
๋Œ€ํ•œ๋ฏผ๊ตญ ํ‰๊ท  ๋ถ€๋ชจ๋“ค์€ ์ง‘๋‹จ ์ตœ๋ฉด์— ๊ฑธ๋ ค์žˆ๋‹ค ์‚ฌ๊ต์œก->๋ช…๋ฌธ๋Œ€->๋Œ€๊ธฐ์—… ๊ฐ€๋ฉด ๋ˆ๋„๋ฒŒ๊ณ  ํ‰์ƒ ์ž˜์‚ด๊ฒƒ์ด๋ผ๋Š” ์ฐฉ๊ฐ. ์• ์ดˆ์— ์ฟผํ„ฐ๊ฐ€ ๋ฐ”๋Š˜๊ตฌ๋ฉ์ด๊ณ  ๋˜๋„ ์›”๊ธ‰์Ÿ์ด์ž„. ๋‚ด์ƒ๊ฐ์— ๋Œ€ํ•™๊ต๋ž‘ ์‚ฌ๊ต์œก ๊ณต๊ณ ์œก ๋ชจ๋‘ ๊ทธ๋ƒฅ ์งœ๊ณ ์น˜๋Š” ์ˆ˜์ž…์„ฑ์ข‹์€ ์นด๋ฅดํ…”์ž„. ๋ถ€์œ ์ธต์ด ์Šค์นด์ด ๊ฐˆ๋ผ๊ณ  ๋ช‡์‹ญ์–ต ์“ฐ๋Š” ์Šค์นด์ด์บ์Šฌ์€ ํŒํƒ€์ง€์ž„
5
1,150
1,732