V के लिए एक Lisp, जिसके टेल कॉल वाकई मुफ़्त हैं

एक स्पष्ट CEK मशीन पर बनी छोटी Lisp बोली। टेल स्थिति में कॉल अपना फ़्रेम दोबारा उपयोग करता है, नया जमा करने के बजाय, इसलिए लूप एक लूप है — ऐसा स्टैक नहीं जो मरते तक बढ़ता रहे।

दस्तावेज़ पढ़ें स्रोत कोड

यह अनुभाग अभी आपकी भाषा में अनूदित नहीं है और अंग्रेज़ी में दिखाया जा रहा है। अनुवादों का स्वागत है।

A taste

(define (fib n)
  (if (< n 2)
      n
      (+ (fib (- n 1))
         (fib (- n 2)))))

(fib 20)          ;=> 6765

यह अनुभाग अभी आपकी भाषा में अनूदित नहीं है और अंग्रेज़ी में दिखाया जा रहा है। अनुवादों का स्वागत है।

यह क्या है

Real tail calls

A quarter of a million iterations end with an empty continuation stack. Mutual recursion tail-calls too, which is the part most trampolines skip.

An explicit machine

Evaluation is a data structure you can inspect, not a recursive function you have to trust. Every step is counted, and every limit is a field you can set.

Embeddable by shape

The machine is a library with no global state. print output is collected into a field, so a host can capture it rather than fight it.

यह अनुभाग अभी आपकी भाषा में अनूदित नहीं है और अंग्रेज़ी में दिखाया जा रहा है। अनुवादों का स्वागत है।

Where it stands

Working: the reader, closures, arithmetic, branching, loop, dotimes, letrec, cond, case, and proper tail calls including mutual recursion.

Not yet: let*, rest parameters, callable keywords, modules, and macros. Each one is named in the repository rather than quietly missing.