Easily the most impressive new feature of BricsCAD V18.2 is the new Visual LISP IDE, BLADE (BricsCAD LISP Advanced Development Environment). The lack of any LISP IDE has been a BricsCAD stumbling block for a while, dissuading CAD Managers from adopting BricsCAD to replace their stagnant and increasingly expensive AutoCADs.
As I will relate elsewhere, Bricsys has not just caught up with Autodesk here, but has shot so far ahead it’s unlikely to ever be caught. BricsCAD’s BLADE is so superior to AutoCAD’s VLIDE in so many ways there’s really no comparison.
Yet it remains highly compatible. I have personal experience in making large amounts of AutoCAD LISP code (literally hundreds of routines) work in BricsCAD. That experience tells me that the vast majority of code will work just fine (and much faster) in BricsCAD. A tiny proportion of LISP or DCL code may need adjustment before it will work perfectly on both platforms, and that’s one reason an IDE that works within BricsCAD was an important step that Bricsys needed to take.
I had the chance to see this IDE privately in then-unnamed pre-release form when I attended the Bricsys Conference 2017 in Paris. I was surprised and delighted at the functionality demonstrated by its creator, Torsten Moses. I recently had the chance to interview Torsten about his creation.
Steve: I understand it was difficult to create a LISP IDE for BricsCAD because of the way BricsCAD’s LISP works. Can you explain that?
Torsten: BricsCAD LISP uses the OpenLisp core system, from French developer Christian Jullien. This is the only LISP engine still under development; the others I found stopped development in the mid-90s.
OpenLisp is a very modern implementation, not comparable to the old XLisp dialect used by AutoLISP. Even object-oriented features are supported. Therefore the internal representation of LISP expressions is different from the textual representation as seen in a LISP file.
Steve: So the AutoLISP code I write isn’t the code that BricsCAD executes?
Torsten: That’s right. A number of typical AutoLISP constructions were implemented by a kind of emulation, which drives the internal versus textual representation differences even further. That makes it a major challenge to synchronize the internal OpenLisp expression execution with the related textual representation in order to provide any debugging functionality.
Besides the plain technical details, which seemed to be virtually unresolvable, there was the expected heavy effort to implement a full-blown GUI. This was not just a plain editor, but the entire IDE GUI. It would have been a disaster, a major disgrace, if we had provided a VLIDE that was just up to AutoCAD standards. That was great in its time, but it’s 20 years later now. The idea of creating a LISP IDE for BricsCAD seemed so filled with difficulties that we put it off for a long time.
Steve: How did you finally manage to overcome these difficulties?
Torsten: First, it was a pure coincidence. [laughs] By luck, I discovered a hidden detail in OpenLisp – any LISP symbol (and expressions are a kind of anonymous symbols) can hold unlimited, attached custom data, very similar to XData in DWG database objects. I even knew about that for many years, but never worked out the shortcut to ‘misuse’ this for the LISP expression execution to editor and debugger bidirectional connection. Some initial quick tests showed that this approach was very suitable.
By another coincidence, I discovered that WxWidgets (our cross-platform system, not only for GUI) already includes support for the famous Scintilla editor, an OpenSource editor engine, widely used by many editors. WxWidgets even provides two levels of wrappers – a plain, core wrapper, and a high-level wrapper class system. This fits perfectly into the WxWidgets logic.
But still, that is only plain editor support – not a GUI. Then I found a very suitable, extensible editor and GUI implementation, based on that WxWidgets Scintilla system – as Open Source under the WxWidgets license. Hence, we are allowed to use that source code in a commercial application. That editor is called wxStEdit.
I verified that this source was suitable for our LISP IDE, and put in a lot of extra work to extend it. wxStEdit development finished in around 2008, and it still was compiling and working mostly fine. Nevertheless, in the course of extending that GUI, I found and fixed a lot of defects at all related levels (Scintilla, WxWidgets Scintilla wrapper and wxStEdit).
So it was this set of coincidences that suddenly opened both wings of a big gate!
See here for part 2 of this interview.
This interview is also available in one post on the Bricsys blog.