Is there any c to lisp or vba to lisp converter? How can i make one?

Is there any c to lisp or vba to lisp converter? How can i make one?

SanjoyNath
Advocate Advocate
3,438 Views
4 Replies
Message 1 of 5

Is there any c to lisp or vba to lisp converter? How can i make one?

SanjoyNath
Advocate
Advocate

Dear Experts,

 

 

In the era of NLP , Computer Language conversion is not a very big deal.

Is there any readymade converter for c to Visual Lisp? or Autocads VBA to Autolisp/Visual Lisp converter?

 

If not lets try to make one together.Lets start.

I have used Excel macro to convert many vba codes to c code.

So i think this is also possible.Only syntax for operators in lisp dont follow the other rules.Lets start

I think it is Parse Tree problem, which we can develop.Lisp programs are small programs.

https://en.wikipedia.org/wiki/Syntax_(programming_languages)

Sanjoy Nath
BIM Manager And Digital Lead (Structures Online)
BOOST, AR , VR ,EPM,IFC API,PDF API , CAD API ,Revit API , Advance Steel API
Founder of Geometrifying Trigonometry(C)
0 Likes
Accepted solutions (1)
3,439 Views
4 Replies
Replies (4)
Message 2 of 5

martti.halminen
Collaborator
Collaborator

I see two major stumbling points:

 

1. Library calls

Whenever the source program calls something defined outside itself, all those parts need also be made available to the target program.

 

2. Constructs and data types not available in the target language

Visual Lisp doesn't have arrays, structs and a few other C data types, nor explicit pointers. (Internally most of lisp is implemented with pointers, but automatically converting C-style pointer arithmetic to Lisp operations is non-trivial.)

- C to Common Lisp would be much easier.

 

-- 

 

 

 

0 Likes
Message 3 of 5

SanjoyNath
Advocate
Advocate

Dear Martti,

 

 

I understand your concern,But since we know the limitations of lisp compared to c and since we are trying to get things done in Autocad , and simply want to reuse codes , we can remove pointer dependent c codes to pointerless alternative c code intermediately.There are several such Lex parsers

 

We can convert arrayed data in c to non arrayed data in c in the same way intermediately before converting that to lisp

 

Sanjoy Nath
BIM Manager And Digital Lead (Structures Online)
BOOST, AR , VR ,EPM,IFC API,PDF API , CAD API ,Revit API , Advance Steel API
Founder of Geometrifying Trigonometry(C)
0 Likes
Message 4 of 5

martti.halminen
Collaborator
Collaborator
Accepted solution

Well, if you like doing things that way, it is your problem. I got tired fighting with the limitations of Visual Lisp maintaining a largish application (about 100 000 lines of Visual Lisp), and am converting that to a form where most of the heavy lifting is done in a Common Lisp application, just communicating the simple results to AutoCAD for drawing.

 

In this architecture using external libraries written in C would be simpler: just write the foreign function interface connection definitions in CL, no need to convert the library itself to another language.

http://www.lispworks.com/documentation/lw71/FLI/html/fli.htm

https://franz.com/support/documentation/10.1/doc/contents.htm#foreign-functions

https://common-lisp.net/project/cffi/

 

If you like C++ and ARX, you could also do that by calling your library from a .arx program, and adding the glue code to call that from Visual Lisp.

 

 

0 Likes
Message 5 of 5

diagodose2009
Collaborator
Collaborator

You see on the youtube-funny video,Now,a new solution, more functions 

https://youtu.be/67TZ_LsbrW8?t=119

You do not forget. this solution is 100% pure for AutoLisp,

VanillaLisp or VLisp inside Acad2000+.I search other programmers for CommonLisp or Prolog, but Nothing.

Operation SysTem  WindowsXP+. 

 

0 Likes