Parser compatibility and performance

2 views
Skip to first unread message

Kelvin Cookshaw

unread,
Jul 16, 2016, 1:51:13 PM7/16/16
to impli...@googlegroups.com
Compatibility with OpenSCAD is the feature that got me interested in ImplicitCAD, and this may have also hooked some others in. It's ability to quickly process my existing SCAD files is pretty important to me.

I'm finding the parsing of some files to be quite slow, possibly due to the extensive use of 'try' to perform look ahead in expressions. It seems like large expressions throw it for a loop, but I haven't benchmarked expressions of different depths.

Also, I've found quite a few SCAD files I've downloaded do not parse at all, and the parser message is usually not very specific. For example, the parser cannot parse a ternary operator that starts with a comparison, like this: a < b ? 3 : 4

I would like ImplicitCAD to be able to quickly parse the entire set of OpenSCAD-compatible files, and provide helpful error messages when it doesn't support a feature, or when there is a syntax error in the source.

On the other hand, changing the existing parser to recognize all OpenSCAD files might break some files written specifically for ImplicitCAD, which will never be opened in OpenSCAD.

Here's what I would like to propose:
a. Continue to support the existing parser as the default;
b. Write a new parser, faster and 100% compatible with OpenSCAD;
c. Provide a command line argument or a separate executable to choose the newer parser.

Is this plan acceptable or of interest to people here? I would like to do this, but I want to know what everybody else thinks.

Thanks for your time,
Kelvin
Reply all
Reply to author
Forward
0 new messages