Functional data structures in C++
bartoszmilewski / okasaki Goto Github PK
View Code? Open in Web Editor NEWFunctional data structures in C++
License: The Unlicense
Functional data structures in C++
License: The Unlicense
Hy,
The list implementation is simple/nice but it imposes a limit on number of stored elements because of "additional effect" of recursive destruction. A garbage collector would be very nice indeed, without it I don't know if using a "production persistent List" is really possible.
I thought I'd leave this comment here:
I've been playing around with implementing an opt-in garbage collector as a library for C++.
I think this would be a pretty interesting tool for implementing more efficient functional data structures. Basically, there would be a opaque pointer type that would be produced by an allocation routine. Then root objects would be registered with the garbage collector. Each garbage-collectable type would have a reflection method that allowed the garbage collector to walk the object tree.
This way, things like bump-pointer allocation (allocations are only one addition operation!) and GC compaction could be implemented.
There's really no way to have garbage collection for all of C++. And we wouldn't want that. But, sometimes there's a much higher performance cost to certain abstractions in C++ than there would be with a garbage collector. I think this would quite a few useful use cases in a distributed task parallelism library I've been working on based around futures, IVars and LVars. I think there a lot of other embedded DSL use cases. While this isn't traditionally the domain of C++, I don't see why it shouldn't be...
Any thoughts?
Cheers,
Ben
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.