Re: PHP
From: Christophe Turle (cturle_at_nospam.fr)
Date: 03/24/04
- Next message: David Steuber: "Code Feedback Wanted (Generating more garbage)"
- Previous message: Marc Spitzer: "Re: Postdoc position in program development, analysis and transformation"
- In reply to: André Thieme: "PHP (was: MACROS : now i see the power !)"
- Next in thread: Tim Daly Jr.: "Re: PHP (was: MACROS : now i see the power !)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 24 Mar 2004 11:36:28 +0100
> Do you mean you have tools or know about tools, who translate Lisp
> programs into php?
> This would be very funny, because I have to do a good amount of php at
> work and I don't think I can't convince the project manager to switch
> over to Lisp (cause already several hundred php scripts are working in
> this project and the other programmers don't know about Lisp).
>
> But with your trick I could probably write at least some of the scripts
> in Lisp and let them be translated into php.
The trick is no more than meta-programming. I try to define some application-related knowledge using lisp. Then my lisp functions write some target code. The goal is not to have a conversion program. The goal is to have a program which have knowledge about different language. it is a long term goal and i'm far from having showable results. The only general thing i have is a tool to include meta-code into source files.
here's an example :
; file generated by an idl to C++ compiler
...
// begin-asgard-code (snc-method-definitions-of-corba-object "PC-GraphEH" )
; all the code below is generated automatically from the evaluation of the expression : '(snc-method-definitions-of-corba-object "PC-GraphEH" )'
void CorbaObject::added_ERport (
const char * ERportId
)
ACE_THROW_SPEC ( ( CORBA::SystemException ) )
{
cout << "--> GraphEH::added_ERport(" << " ERportId='" << ERportId << "'" << " )" << endl ;
NodeId lv_ERportId = static_cast< NodeId > ( ERportId ) ;
// begin-user-code (app-code (corba-c++:c++-method (FIND-CORBA-SERVICE (FIND-CORBA-OBJECT "PC-GraphEH") :NAME "added_ERport")))
; we can't generate all code automatically. begin-user-code allows us to insert user code.
; all code here is 'setf' to the expression
; (app-code (corba-c++:c++-method (FIND-CORBA-SERVICE (FIND-CORBA-OBJECT "PC-GraphEH") :NAME "added_ERport")))
; which should be used at this space during the generation process.
mr_msn.add_ERport( lv_ERportId ) ;
// end-user-code
}
...
// end-asgard-code
...
; end-of -file
; file snc-corba.lisp
...
;;; surely i can generate this from the idl file using clorb.
(def-idl-interface
:name "GraphEH"
:operations ( (:name "added_ERport" :args ((:type NodeId :name "ERportId")))
... ))
...
(def-corba-component :abbrev "PC" :name "pathControler")
(def-corba-object :component "PC" :idl-interface "GraphEH" )
...
;end-of-file
This way, all codes in any source file, i can generate automatically is. I just need to (update-files).
(author "Christophe Turle" :nickname "ctu")
- Next message: David Steuber: "Code Feedback Wanted (Generating more garbage)"
- Previous message: Marc Spitzer: "Re: Postdoc position in program development, analysis and transformation"
- In reply to: André Thieme: "PHP (was: MACROS : now i see the power !)"
- Next in thread: Tim Daly Jr.: "Re: PHP (was: MACROS : now i see the power !)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|