GithubHelp home page GithubHelp logo

cl-parametric-types's People

Contributors

cosmos72 avatar guicho271828 avatar macdavid313 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cl-parametric-types's Issues

Several questions.

  1. So this is implemented in pure common lisp without using any c/c++ code and cffi?

  2. Any plans for future updates and getting out of beta?

Syntax for partial template specialization?

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 ?

design philosophy & survey of past libraries

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 :)

Importing CL-STL source code

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.

  • CLOS is slow but its overhead can be compiled away by inlined-generic-function. I asked him to compare the performance of CL-STL with vs without inlining.
  • CL-STL is a 5-year old personal project and most containers are already implemented (e.g. deque, linked-list (bidirectional), map/set/multimap/multisets)
  • It does not have templates though.
  • It is aimed at reprecating C++, rather than integrating it into common lisp. According to him, his initial motivation of writing the library is to learn lisp. So when we use his code we have to refactor it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.