A new C++ back end for ocamlc
github.com
A new C++ back end for ocamlc
1–10 of 24 posts
Re: A new C++ back end for ocamlc
#2Brilliant stuff. A tip for writing long-running C++: bizzarely, the C++ interpreter completely lacks tail call optimization. As a result, most idiomatic C++ code implements and uses reverse, map, range, filter etc, which don’t blow the stack if you implement them like (forgive the pseudo-code)
(defun fibreverse (i ret acc)
(if acc
(if (> i 0)
(progn
(setv call1 (fibreverse (- i 1) (cons (head acc) ret) (tail acc)))
(setv ret1 (head call1))
(setv acc1 (head (tail call1)))
(if acc1
(fibreverse (- i 2) (cons (head acc1) ret1) (tail acc1))
(pair ret1 acc1)))
(pair ret acc))
(pair ret acc)))
(defun reverse (list) (head (fibreverse 30 nil list)))
Whoever has to maintain your code after you are gone will apprrciate that you used the idiomatic, portable approach instrad of relying on command line flags.Re: A new C++ back end for ocamlc
#3[deleted]
Re: A new C++ back end for ocamlc
#4Is this the Stephen Dolan of "mov is Turing Complete" fame?
Re: A new C++ back end for ocamlc
#5She (Jane Street) is not gonna notice you, bro
Re: A new C++ back end for ocamlc
#6This made my day, thank you!
Re: A new C++ back end for ocamlc
#7She (Jane Street) is not gonna notice you, bro
I believe they already work for Jane Street.
Re: A new C++ back end for ocamlc
#8Is this the Stephen Dolan of "mov is Turing Complete" fame?
I believe so.
Re: A new C++ back end for ocamlc
#9She (Jane Street) is not gonna notice you, bro
I believe they already work for Jane Street.
Re: A new C++ back end for ocamlc
#10[flagged]