cosmos72 / cl-parametric-types Goto Github PK
View Code? Open in Web Editor NEW(BETA) C++-style templates for Common Lisp
(BETA) C++-style templates for Common Lisp
So this is implemented in pure common lisp without using any c/c++ code and cffi?
Any plans for future updates and getting out of beta?
I am open to suggestions :)
Given a general case like
(template (<t1> <t2>)
(defstruct foo
(bar nil :type <t1>)
(baz nil :type <t2>)))
my idea for partial specialization syntax is something like:
(template (<t>)
;; applies if and only if <t1> and <t2> defined above
;; are BOTH equal to (array <t>) for some <t>
(:specialized-for ((array <t>) (array <t>))
(defstruct foo
(bar nil :type (array <t>))
(baz nil :type (array <t>))))
I also had a look at OPTIMA, but if I introduce general pattern matching, once there are multiple partial specializations for the same general template, I have no idea how to write the algorithm for deciding which one is the most specific (or to decide that none is more specific than the others)
Any thoughts? @guicho271828 ?
there are several past attempts on implementing parametric types on common lisp.
as far as remember, cl-adt, https://github.com/danlentz/dstm-collections/blob/master/attic/adt.lisp . Mine is https://github.com/guicho271828/trivialib.typevar (but I'd say this is a failed attempt because it is based on CLOS/structure mixture and it was hard to debug).
This is a very interesting project, and I'd like to hear more about the design philosophy of this library, among which what I'd like to know is whether this library is designed for speed (after compilation). Well, every CLer would know how ugly C++ template is, so essentially no need to complain about its ugliness in the readme :)
https://github.com/tarballs-are-good/cl-algebraic-data-type
The cl-adt library compiles down to structs, we should be able to write a TEMPLATE form for defdata.
This is half a feature request, half a "I'll do it sometime".
What do you think about this idea? Just off the top of your head I mean :-)
https://github.com/show-matz/CL-STL is an attempt to implement STL in CL. It's based on CLOS (so it is slow) but yesterday the author, @show-matz , gave a talk on it at Shibuya.lisp Lisp Meetup and I had an opportunity to discuss this project.
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.