Hello, dear ASDF developers,
I'm currently trying to port some old lisp code (Common Music) to ASDF3[1]. Common Music's source is written in Scheme, the Common Lisp version is generated from the Scheme code. Unfortunately CM's current asdf file is littered with executable code (not only compiling inoking the Scheme->Lisp compiler but also calling (non-portable) shell scripts etc. This is unfortunate since many asdf operations will trigger this code. Hence my attempt to rewrite the asdf and transfer the scheme->lisp part into a second asdf system. Unfortunately I can't find any documentation on how to implement such a code transformation. I can create a new component class scheme-file but what methods do I need to implement? Where can I call the function that actually compiles a scheme file to lisp (Common Music's scheme->lisp compiler works on files).
TIA Ralf Mattes
Footnotes: [1] my main goal is to make Common Music distributable by quicklisp.
Dear Ralf,
congratulations for maintaining Common Music! How does it compare to OpenMusic, these days?
Is this where the code is? I see nothing related to ASDF there: http://sourceforge.net/p/commonmusic/code/HEAD/tree/trunk/
Regarding ASDF, I propose that you emulate the way cffi-grovel does it.
(defclass cm-scheme-file (cl-source-file) ((type :initform "scm"))) (defclass cm-scheme-to-lisp-op (non-propagating-operation)) (defmethod output-files ((o cm-scheme-to-lisp-op) (c cm-scheme-file)) ...) (defmethod perform ((o cm-scheme-to-lisp-op) (c cm-scheme-file)) ...) (defmethod component-depends-on ((o compile-op) (c cm-scheme-file)) `((cm-scheme-to-lisp-op ,c) ,@(call-next-method))) (defmethod input-files ((o compile-op) (c cm-scheme-file)) ...)
If your scheme to cl transformation itself depends on other files, then instead of non-propagating-operation, make it something appropriate, i.e. a selfward-operation on prepare-cm-scheme-to-lisp-op or something.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org drug, n: A substance that, injected into a rat, produces a scientific paper.
On Thu, Aug 14, 2014 at 12:41 PM, Ralf Mattes rm@mh-freiburg.de wrote:
Hello, dear ASDF developers,
I'm currently trying to port some old lisp code (Common Music) to ASDF3[1]. Common Music's source is written in Scheme, the Common Lisp version is generated from the Scheme code. Unfortunately CM's current asdf file is littered with executable code (not only compiling inoking the Scheme->Lisp compiler but also calling (non-portable) shell scripts etc. This is unfortunate since many asdf operations will trigger this code. Hence my attempt to rewrite the asdf and transfer the scheme->lisp part into a second asdf system. Unfortunately I can't find any documentation on how to implement such a code transformation. I can create a new component class scheme-file but what methods do I need to implement? Where can I call the function that actually compiles a scheme file to lisp (Common Music's scheme->lisp compiler works on files).
TIA Ralf Mattes
Footnotes: [1] my main goal is to make Common Music distributable by quicklisp.
Asdf-devel mailing list Asdf-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
On Thu, 14 Aug 2014 13:41:05 -0400, Faré wrote
Dear Ralf,
Hello,
congratulations for maintaining Common Music! How does it compare to OpenMusic, these days?
Oh no, I'm not maintaining the current Common Music (v3). I'mk trying to keep Common Music v2 in an operational shape (CMv3/Grace moved to an embedded Scheme (s7) and away from Object Oriented Programming). There are still quite some folks out there using CMv2, and the book "Notes from the Metalevel" by Rick Taube uses version 2 as well.
Is this where the code is? I see nothing related to ASDF there: http://sourceforge.net/p/commonmusic/code/HEAD/tree/trunk/
You'd need to look at branches/cm2 ...
Regarding ASDF, I propose that you emulate the way cffi-grovel does it.
(defclass cm-scheme-file (cl-source-file) ((type :initform "scm"))) (defclass cm-scheme-to-lisp-op (non-propagating-operation))
(defmethod output-files ((o cm-scheme-to-lisp-op) (c cm-scheme-file)) ...) (defmethod perform ((o cm-scheme-to-lisp-op) (c cm-scheme-file)) ...) (defmethod component-depends-on ((o compile-op) (c cm-scheme-file)) `((cm-scheme-to-lisp-op ,c) ,@(call-next-method))) (defmethod input-files ((o compile-op) (c cm-scheme-file)) ...)
If your scheme to cl transformation itself depends on other files, then instead of non-propagating-operation, make it something appropriate, i.e. a selfward-operation on prepare-cm-scheme-to-lisp-op or something.
Thank you, this, together with Robert Brown's hints, is very helpful.
Cheers, RalfD
Hi, Ralf --
I think that the advice you have gotten from Fare and Robert Brown agrees with my experience (with another application that involves a translation from some alternate input form to common lisp source).
I have been working on an article for ILC that would describe how to extend the ASDF protocol. This is a process that was never very well documented, and one which has changed with the extensive changes (rationalizations) to ASDF.
Alas, I wasn't able to make ILC this year, which deflated my motivation for a few months. I hope to get back to it this winter.
Please post to the list about any challenges you encounter, or any ways the advice you have received so far was inadequate.
With luck, we'll get something good to make this easier for everyone!
Best, R
The protobuf Lisp package contains an ASDF file that converts protocol buffer source files into Common Lisp and compiles them. Perhaps the ASDF will give you some ideas for how to handle the Scheme to Lisp translation.
https://github.com/brown/protobuf/blob/master/protobuf.asd
Bob
On Thu, Aug 14, 2014 at 12:41 PM, Ralf Mattes rm@mh-freiburg.de wrote:
Hello, dear ASDF developers,
I'm currently trying to port some old lisp code (Common Music) to ASDF3[1]. Common Music's source is written in Scheme, the Common Lisp version is generated from the Scheme code. Unfortunately CM's current asdf file is littered with executable code (not only compiling inoking the Scheme->Lisp compiler but also calling (non-portable) shell scripts etc. This is unfortunate since many asdf operations will trigger this code. Hence my attempt to rewrite the asdf and transfer the scheme->lisp part into a second asdf system. Unfortunately I can't find any documentation on how to implement such a code transformation. I can create a new component class scheme-file but what methods do I need to implement? Where can I call the function that actually compiles a scheme file to lisp (Common Music's scheme->lisp compiler works on files).
TIA Ralf Mattes
Footnotes: [1] my main goal is to make Common Music distributable by quicklisp.
Asdf-devel mailing list Asdf-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel