Coder Social home page Coder Social logo

Comments (4)

skanaar avatar skanaar commented on May 25, 2024 1

I found it really hard to make the improvements that I wanted with the old Jison/Yacc grammar.
Rewrote everything in PEG but it had really bad performance (probably not PEG:s fault but then I have sunk a lot of time into that).

So I ended up writing a handmade parser, and it turned out to be so nice to work with that it won in the end.

Glad you like the syntax, and sorry if the lack of grammar is a blocker.

I would love to see what you create using Nearly.

from nomnoml.

taybin avatar taybin commented on May 25, 2024

That makes a lot of sense. I do need to keep in mind my end goal and not get distracted by learning EBNF. Was the performance a matter of how many entities it was parsing? Or was it just slow from the get-go? Just wondering if there's a good number of entities to test with to see what it can handle.

from nomnoml.

skanaar avatar skanaar commented on May 25, 2024

One of the difficulties is that the syntax is not really context free.

In this example the character < is interpreted in three different ways depending on where it is located.
[foo <abstract>] label <- [<state>bar]

Other languages of course solve this, usually in the tokenizer.

The performance problems were related to deeply nested souce code.
[a|[a|[a|[a|]]]]

You should definitely use the test suite - it covers pretty much all of the syntax.

from nomnoml.

taybin avatar taybin commented on May 25, 2024

Thanks for your help. I've ended up diverging from your language a bit. I'll send you a link when it's ready for presentation since nomnoml is a clear parent of it, if you're curious. Closing this for now though since there's no reason to leave it open.

from nomnoml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.