←back to thread

jank is C++

(jank-lang.org)
252 points Jeaye | 1 comments | | HN request time: 0.273s | source
Show context
YuriNiyazov ◴[] No.44537353[source]
A long long time ago, at ClojureConj 2014, I asked Rich Hickey whether a cpp-based clojure was possible, and his answer was "well, the primary impediment there is a lack of a garbage collector". There were a lot of conversations going on at the same time, so I didn't get an opportunity to "delve" into it, but:

1. does that objection make sense? 2. How does jank approach that hurdle.

replies(3): >>44537608 #>>44537731 #>>44537844 #
1. bertmuthalaly ◴[] No.44537608[source]
It's the first section in the article -

"I have implemented manual memory management via cpp/new and cpp/delete. This uses jank's GC allocator (currently bdwgc), rather than malloc, so using cpp/delete isn't generally needed. However, if cpp/delete is used then memory collection can be eager and more deterministic.

The implementation has full bdwgc support for destructors as well, so both manual deletion and automatic collection will trigger non-trivial destructors."