Author Topic: new language to study  (Read 1422 times)

0 Members and 1 Guest are viewing this topic.

domenicomaria

  • Swamp Rat
  • Posts: 725
new language to study
« on: September 09, 2022, 02:21:23 AM »
to produce applications in the CAD environment (AutoCAD, BricsCAD, ZWCAD, GStarCAD, SolidWorks...)
in addition to VLisp and OpendDCL (when possible),
what is the language to study to produce something more professional?

I know a little about Ansi C and have written a function library for AutoLisp in the past . . .
(ADS for ACAD 12)
. . . but many years ago. . .
. . .
What is a smart choice today?
An intelligent compromise.
I already know that C ++ is the best, but I also know that it takes a lot of effort!
What do you suggest?
What interests me above all is to write powerful and fast functions to call from Lisp. . .

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8759
  • AKA Daniel
Re: new language to study
« Reply #1 on: September 09, 2022, 04:54:35 AM »
I just bought my daughter a C++20 book, not one single raw pointer or macro, looks like C# book.
Of course, I’m biased and would definitely recommend modern C++.

C# is pretty awesome, but then you’re at the mercy of
Microsoft and the “Framework”.  I went from AutoLisp to C# to C++ … so if you do choose C#, it’s not a big jump to C++.

Somethings absolutely suck in C++, like making a COM server. but it's very rare, and if you know both C++ and C#, you can use both.
I did this in my last project, I would have been screwed if i didn't know how to P/Invoke from C#.

So maybe C#, then if you want more... C++


57gmc

  • Bull Frog
  • Posts: 366
Re: new language to study
« Reply #2 on: September 09, 2022, 01:14:52 PM »
I agree with what Daniel said. I recommend this book on C# 7 to get you started. There are newer books, but AutoCAD still uses C# 6 on the .Net Framework. This book covers both Framework and Core.

BIGAL

  • Swamp Rat
  • Posts: 1423
  • 40 + years of using Autocad
Re: new language to study
« Reply #3 on: September 09, 2022, 07:37:55 PM »
"what is the language to study to produce something more professional?"

What are you planning ? If its rocket science then go down the C path if it's a lot of little routines then why not stay with Lisp. You can compile etc Using Opendcl fills in holes in DCL which is badly in need of an update.

I worked on a commercial package some 237 seperate functions, could have joined a lot into 1 lisp etc. All compiled. It was a few years of development. A package I use is 300+ Mb that is years of programming.

Lisp advantage a new version comes out of CAD no need to recompile code no frustrated end users when your code stops working when they upgrade. Using lisp written around year 1990 of Acad.
A man who never made a mistake never made anything

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8759
  • AKA Daniel
Re: new language to study
« Reply #4 on: September 09, 2022, 08:17:58 PM »
"what is the language to study to produce something more professional?"

What are you planning ? If its rocket science then go down the C path if it's a lot of little routines then why not stay with Lisp. You can compile etc Using Opendcl fills in holes in DCL which is badly in need of an update.

I worked on a commercial package some 237 seperate functions, could have joined a lot into 1 lisp etc. All compiled. It was a few years of development. A package I use is 300+ Mb that is years of programming.

Lisp advantage a new version comes out of CAD no need to recompile code no frustrated end users when your code stops working when they upgrade. Using lisp written around year 1990 of Acad.

Having to recompile is a thing, it’s also a thing if you rely on DOSLib or OpenDCL too, there was a time where the latter almost died, if it weren't for "Master Owen"... it's good to know how to compile at least
Overrule, Custom objects, access more of the API, Custom GUIs, interfacing with other advanced libraries and OS, crushing performance are some valid reasons.

Not knocking lisp, just adding reasons to expand

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: new language to study
« Reply #5 on: September 10, 2022, 11:54:35 AM »
@BIGAL
but how do we compile this lisp?

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: new language to study
« Reply #6 on: September 10, 2022, 12:15:35 PM »
I think that the difference,
even only between C # and vlisp,
is enormous ...

but the strength of vlisp is that
it is a highly specialized and finalized language,
and therefore for this reason
it makes it very easy to write
powerful applications
(but SLOW compared to C) ...
... and there is the problem
of compilation and of protection
(because we write applications
not only for internal use
but also for third parties)
 ... I am interested in C #
ONLY to write functions that
can be called by the Lisp ...

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: new language to study
« Reply #7 on: September 10, 2022, 12:29:48 PM »
and another interesting thing is that
VLisp is spreading, propagating ...

this is the list of some compatible CADs
(we need to investigate how much they are) ...

AutoCAD
BricsCAD
ZWCAD
GStarCAD
SolidWorks
ProgeCAD ..
and more ...
...
and in particular,
BricsCAD has the best (V) LISP ever ...

the owner of BricsCAD is HEXAGON ...
which is investing heavily in BricsCAD ...
which is growing very fast ...

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8759
  • AKA Daniel
Re: new language to study
« Reply #8 on: September 10, 2022, 07:23:50 PM »
I think that the difference,
even only between C # and vlisp,
is enormous ...

but the strength of vlisp is that
it is a highly specialized and finalized language,
and therefore for this reason
it makes it very easy to write
powerful applications
(but SLOW compared to C) ...
... and there is the problem
of compilation and of protection
(because we write applications
not only for internal use
but also for third parties)
 ... I am interested in C #
ONLY to write functions that
can be called by the Lisp ...

C# (.NET) won’t protect your code at all, if that’s something you need, choose another language.
Yeah, you can buy an obfuscation tool, but those have their own costs / issues.

BIGAL

  • Swamp Rat
  • Posts: 1423
  • 40 + years of using Autocad
Re: new language to study
« Reply #9 on: September 11, 2022, 11:47:19 PM »
Compile
Code: [Select]
(defun comp ( )
(if (null vlisp-compile) (c:vlide T))
(setq fname (getfiled "Pick lisp to be compiled" "D:\\alan\\" "lsp" 8))
(setq len (strlen fname))
(setq diff (- len (+ 15 3)))
(setq fnameout (substr fname 15 diff))
(vlisp-compile 'st  fname  (strcat "d:\\alan\\compiled\\" fnameout ".fas"))
)
(comp)

What is speed ? I just did a task for a client it took like 4+ hours to manually modify a dwg, lots of block stuff, it takes around 2 minutes now, do we really need to get to 10 seconds. All in lisp. One part takes like 20 seconds trying harder its getting closer to 3 seconds.
« Last Edit: September 11, 2022, 11:50:47 PM by BIGAL »
A man who never made a mistake never made anything

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: new language to study
« Reply #10 on: September 12, 2022, 01:19:49 AM »
@BIGAL
when I say "compile"
I want mean
"compile to protect" ...
...
... the speed ...
you are right ...
... I am a designer ...
many times I have spent 2 days writing the code in lisp, to then do in minutes what would have taken a week ...

BIGAL

  • Swamp Rat
  • Posts: 1423
  • 40 + years of using Autocad
Re: new language to study
« Reply #11 on: September 12, 2022, 08:26:04 PM »
FAS is protected ? That is why you would do it.

Same with VLX.

I have done like 50 lisps in one go making them all FAS and they have security check inside code, this also being auto added to lisp prior to make a fas.
A man who never made a mistake never made anything

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: new language to study
« Reply #12 on: September 13, 2022, 01:54:22 AM »
FAS is protected ? That is why you would do it.

Same with VLX.

I have done like 50 lisps in one go making them all FAS and they have security check inside code, this also being auto added to lisp prior to make a fas.
this is a central aspect of the question !