16 पॉइंट द्वारा alstjr7375 2022-09-01 | 1 टिप्पणियां | WhatsApp पर शेयर करें
  • Turing Machine और Lambda Calculus को मिलाकर बने Interaction Net नामक एक नए computation model पर आधारित
  • Rust के जटिल borrowing model की जगह Haskell की evaluation style जैसी lazy clone primitive का उपयोग
  • Lazy होने के कारण replication की लागत लगभग मुफ्त है, और Haskell से अलग lambda के अंदर computation को share किया जा सकता है (parallel processing में बड़ा लाभ)
  • SIC(Symmetric Interaction Calculus) आधारित memory model को चुना गया है, जिससे Haskell आदि में Graph Reduction कहलाने वाली विधि में आवश्यक pointer indirection cost का बड़ा हिस्सा हट जाता है (जब Optimal ढूँढा जा सके तो लाभ)
  • यानी सामान्य language runtime की तुलना में इसमें GC नहीं है, और parallel तथा Optimal processing में मजबूत बढ़त है

1 टिप्पणियां

 
alstjr7375 2022-09-01

यह quicksort का implementation है.
लगता है कि Lambda Calculus का काफ़ी सक्रिय रूप से उपयोग किया गया है, इसलिए यह Lisp जैसा दिखता है..?

// QuickSort  
(QSort p s Nil)          = Empty  
(QSort p s (Cons x Nil)) = (Single x)  
(QSort p s (Cons x xs))  =  
  (Split p s (Cons x xs) Nil Nil)  
  
// Splits list in two partitions  
(Split p s Nil min max) =  
  let s   = (>> s 1)  
  let min = (QSort (- p s) s min)  
  let max = (QSort (+ p s) s max)  
  (Concat min max)  
(Split p s (Cons x xs) min max) =  
  (Place p s (< p x) x xs min max)  
  
// Sorts and sums n random numbers  
(Main n) =  
  let list = (Randoms 1 (* 100000 n))  
  (Sum (QSort Pivot Pivot list))