Alternate OpenSCAD parser progress and a request

22 views
Skip to first unread message

Kelvin Cookshaw

unread,
Aug 10, 2016, 11:04:16 AM8/10/16
to impli...@googlegroups.com

Lots of progress on the OpenSCAD- compatible parser front, including scope creep!

Benchmarks show this parser is very fast, relative to the original parser, orders of magnitude faster, in some tests.

The command line arguments can now be used to choose which parser to use, and what level of compatibility with OpenSCAD should be used. More will be added as needed.

The alt parser does not fully support ExtOpenscad features, probably. That hasn't been a focus of efforts, yet.

The interpreter has received several changes that will help with future enhancements. Changes to the for loop support a superset of the previous behavior, and the same with echo statements and named parameters.

The request: I would like to build up a library of files to test against. I'm looking for files that work in implicitcad, especially, because thingiverse.com has only a dozen or so. This will really help to ensure compatibility and performance in the new parser. Please share any helpful links or scad scripts!

Feel free to grab the source, check it out, and offer advice or criticism!

The updated plan and status on the wiki:
https://github.com/Cookshak/ImplicitCAD/wiki/Plan

Cheers,
Kelvin


On Jul 19, 2016 10:36 AM, "Kelvin Cookshaw" <kel...@cookshaw.com> wrote:

I've made some progress in writing a new expression parser for ExtOpenscad.
It seems pretty quick, and I've expanded the suite of tests Julia wrote for the parser. I hope to have it parsing expressions fully within a week or so.

I've added some thoughts to the wiki on my clone of the repo:
https://github.com/Cookshak/ImplicitCAD/wiki/Plan

I haven't checked in the lines that make statement and tests use the new parser, which I realize I should do tonight.

The parser is predictive and does not do backtracking, making it fast for large expressions.

All comments are welcome and appreciated.

Cheers,
Kelvin


On Jul 16, 2016 11:51 AM, "Kelvin Cookshaw" <kel...@cookshaw.com> wrote:
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


Julia Longtin

unread,
Oct 31, 2016, 7:56:33 AM10/31/16
to Kelvin Cookshaw, impli...@googlegroups.com
Kelvin,

I've been browsing through these patches, and I think they're in good
enough shape for me to start bringing in. I think i'm going to start
on that, would you be available to answer any questions, should i have
them?

Julia Longtin
> --
> You received this message because you are subscribed to the Google Groups
> "ImplicitCAD" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to implicitcad...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Julia Longtin

unread,
Nov 3, 2016, 8:03:13 PM11/3/16
to Kelvin Cookshaw, impli...@googlegroups.com
impli...@googlegroups.com , that's it.

worth noting: my branch/releases of ImplicitCAD are licensed under the
AGPLV3+, instead of the GPLv2. Would you mind if I release your
improvements under the AGPLV3+?

Thanks!

Julia Longtin

On 10/31/16, Kelvin Cookshaw <kel...@cookshaw.com> wrote:
> Oh ya, for sure! Email anytime. If you need to chat on IRC or whatever we
> can plan a time in the evenings or weekends.
>
> I wish i had had more time this last month to put into it. Life keeps
> happening.
>
> You asked about an email list. Is there one i should join?
>
> Kelvin
Reply all
Reply to author
Forward
0 new messages