cosmos72 / cl-parametric-types

(BETA) C++-style templates for Common Lisp
45 stars 7 forks source link

Several questions. #9

Open commander-trashdin opened 5 years ago

commander-trashdin commented 5 years ago
  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?

cosmos72 commented 5 years ago

Exactly, pure lisp. It started as an exercise to demonstrate that c++-style templates can be implemented using macros, including partial specialization and compile-time Turing completeness.

My interest decreased when I realized that macros run too early in the lisp compiler to ask for the type of an expression, and thus type inference cannot be implemented.

So it's basically stalled as a fully functional proof-of-concept

commander-trashdin commented 5 years ago

I suppose you can say that type inference is up to those responsible for sbcl and general language standards. I wonder if there's a way to add something major to them right now.

commander-trashdin commented 3 years ago

Okay, so we have been working on the problem, and here are the results (my lib and what its built on, mine is just a big sketch for now). Unsure if you are still interested in the topic, or in lisp at all, maybe this will help. Or maybe not) https://github.com/commander-trashdin/cl-overload https://github.com/digikar99/adhoc-polymorphic-functions

guicho271828 commented 3 years ago

I am still interested in the topic, but my motivation is shifting toward making a new language that is separate from common lisp.

commander-trashdin commented 3 years ago

I can understand that. I was thinking about that too. However, this is a "lisp curse" in its purest form -- that is, doing something completely new is a .... well, a wormhole. There are already some foundations at least, like Carp or something.

As a said note, to deal with all those problems I started gathering all the suggestions here: https://github.com/commander-trashdin/clng I feel like for a new language or for something along those lines there should be some concentrated interested form at least part of community.

guicho271828 commented 3 years ago

My official job is to do research, so that is not much of a problem. Im making a living for making something new. Thanks for the clng link, some are overlapping with my interest. I am less interested in consolidation e.g. api, libraries or naming convensions. My focus will be on compilers and type systems and machine learning.

commander-trashdin commented 3 years ago

We are trying to deal directly with CL type system and in particular sbcl inferer. That is obviously required to make a proper static dispatch. If you have sbcl-devel subscription, you probably saw related conversation. Currently I'm trying to come up with some sort of metatype protocol because it seems to be the only sane way to deal with complicated lambda lists and functional subtypes. Naturally, any help would be much appreciated. Especially since you have extensible knowledge of sbcl.

All that said, I really don't wanna push you at all, so that's it, I just wanted to share. You do you, man.

guicho271828 commented 3 years ago

Rewriting SBCL, stripping most of CL-specific optimizations and make it understandable was indeed one of my ideas.

commander-trashdin commented 3 years ago

I was thinking (this is not mentioned in clng, since its main purpose is to gather well known ideas for all community, and not my personal ones) about some sort of more lisp specific llvm like language, made with lisps in mind. One that can provide an efficient platform for compiler writers, not just CL compiler btw, Scheme &rest alike. That does sound like a better way of "uniting" various standards.

guicho271828 commented 3 years ago

I also had that idea. So much in common :)