0Pricing
Zig Academy · Ders

Derleme Zamanı ve Çalışma Zamanı Karşılaştırması

Zig'in çalıştırmadan önce neleri değerlendirebildiği.

Derleme Zamanı ve Çalışma Zamanı Karşılaştırması, CoddyKit'te ücretsiz bir Zig Academy dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Zig Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Zig Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Two Times in One Program

Zig code lives in two worlds: things that happen while you compile, and things that happen while the program runs. Learning the split unlocks Zig's power. ⏱️

Run-Time Is the Familiar One

Run-time is everything that happens when your built binary executes: user input, file reads, and values you cannot know in advance.

Compile-Time Happens Earlier

Compile-time is work the Zig compiler does before a binary even exists. Some expressions get fully evaluated right there.

Constants Often Fold Away

A simple expression with known values can be computed during compilation. Zig folds it into a single constant in the final binary.

const minutes = 60 * 24;

comptime_int Has No Fixed Width

A bare integer literal starts life as a comptime_int. It has arbitrary precision until you pin it to a sized type like i32.

const big = 1_000_000_000_000;

The comptime Keyword

Put comptime in front of an expression to demand it be evaluated during compilation. If it cannot be, you get an error.

comptime {
    const x = 2 + 3;
}

Run-Time Values Stay at Run-Time

A value read from input is only known when the program runs. You cannot ask the compiler to evaluate it at compile-time.

comptime Can Run Real Logic

Compile-time is not just math. Zig can run loops and call functions at compile-time, as long as every input is known then.

const total = comptime sum(10);

Why Move Work to Compile-Time

Computing things during compilation means zero run-time cost. The answer is baked into the binary, so the program never recomputes it.

One Language for Both

The same Zig syntax serves both phases. There is no separate macro language: compile-time code is just ordinary Zig run early.

Errors Caught Before Run-Time

Because Zig evaluates known code early, many mistakes surface as compile errors. You fix them before the program ever runs.

Quick Check

You write a constant equal to 7 times 24. When is that multiplication performed?

Recap

Zig splits work into compile-time and run-time. Known values can be computed early for free, while unknown ones wait for execution. 🎯

Sıkça Sorulan Sorular

“Derleme Zamanı ve Çalışma Zamanı Karşılaştırması” dersi ücretsiz mi?

Evet — “Derleme Zamanı ve Çalışma Zamanı Karşılaştırması” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Zig Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Zig Academy kursu toplamda 4 dersten oluşur.

“Derleme Zamanı ve Çalışma Zamanı Karşılaştırması” dersinde ne öğreneceğim?

Zig'in çalıştırmadan önce neleri değerlendirebildiği. Zig Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Zig Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Zig Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.

“Derleme Zamanı ve Çalışma Zamanı Karşılaştırması” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Zig Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Zig Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Derleme Zamanı ve Çalışma Zamanı Karşılaştırması
  2. comptime Parametreleri ve Değerleri
  3. Türler comptime Değerleridir
  4. inline for ve Açılmış Döngüler
← Zig Academy Sayfasına Dön