Giter VIP home page Giter VIP logo

Comments (3)

ozgurakgun avatar ozgurakgun commented on August 23, 2024

@niklasdewally mentioned tree-sitter as a good candidate for this project.

https://tree-sitter.github.io/tree-sitter/creating-parsers

From what I have seen it looks very good!

We do want the parser to interleave name-resolution, type-checking, category checking etc as well for the best possible error messages. Tree-sitter seems to work well with syntax highlighting, and LSP-like functionality which is great.

from vip.

ChrisJefferson avatar ChrisJefferson commented on August 23, 2024

This may be a bad suggestion, but I wonder if we could do "error-driven development"? In my experience, getting a parse which produces the correct answer for correct inputs isn't too hard, but getting good error messages out is very hard, and also hard to do afterwards, when your parser is already written.

The difficulty (as I understand it) is choosing when to 'commit' to a partial parse, else your parser ends up saying "I tried to parse this whole document, and I failed".

An early version of conjure used to almost always print (I think?) 'unexpected g' whenever it was given invalid input, and this made using Conjure very difficult.

from vip.

ozgurakgun avatar ozgurakgun commented on August 23, 2024

I can talk about the 'unexpected g' fame at lenght if people are interested :)

On the bright side Chris, we now have a good bunch of well-formed and otherwise Essence files. And we can compare the error messages to those of Conjure's existing parser. So I think it'll be a bit easier this time, given a good parsing library.

from vip.

Related Issues (17)

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.