Comments (11)
In what form do we want this documentation? BNF grammar, like this SQL BNF grammar description?
from documentation.
I would like to build a plugin for Intellij - but I really need a BNF grammar. Is there any place I can find this information? Even a partial grammar documented would be helpful.
from documentation.
Hi @kingsleyh! The closest thing we have to that is still just the compiler source code for now. It's actually not that dissimilar to a BNF grammar once you learn how to read it, though.
from documentation.
Thanks - I will have a look and see what I can figure out and then try to build a BNF grammar
from documentation.
I'm interested in this issue because I would like to do a direct PureScript to TypeScript transpiler that works in the browser without going to a server. I've had success doing this with Python to TypeScript and used a parser-generator called SPARK. SPARK takes a textual grammar and generates the parser. You are left to build the AST from the concrete syntax tree. A nice thing about this approach is that the grammar becomes a working software artifact with a dependent reference implementation. Here's the example parser for Python: https://github.com/geometryzen/typhon-lang. Anyone interested in taking this route to a PureScript grammar?
from documentation.
@chexxor: Not sure it's the best fit for PureScript, but Gabriel Gonzalez used ABNF for Dhall and he seems to know what he's doing=)
from documentation.
I believe the PS compiler itself doesn't use a BNF notation to generate its parser, so any BNF we maintain here could bit-rot. There was some interest in moving PS's parser to be generated from a BNF notation, so perhaps this issue should wait until that happens?
Or is there some value in having PS's current parser be approximated by a PS compiler-external BNF spec? If so, it's probably best to have someone actually write one and verify its correctness, then we copy it into here.
Regarding flavor of syntax notation, some notations support more complicated grammars than others. So, I think we just use whichever one works. :)
from documentation.
I find myself wanting to refer to such a thing to look at syntax highlighting details. @kingsleyh did you ever start building such a grammar?
from documentation.
@nwolverson He did release the IntelliJ plugin it seems: https://github.com/intellij-purescript/intellij-purescript/
from documentation.
I'm interested in writing a PureScript interpreter in Rust (and then compiler from PS to Rust).
Where can I find the most complete PS grammar description?
In that intellij plugin repo I only see a Purescript.flex file used for generating the lexer..
from documentation.
Hey - I tried to write a bnf for IntelliJ - however IntelliJ uses a specialised ebnf format which doesn’t support some forms of recursion - I could not get it working with good performance - so switched to using a hand rolled parser written in code. But I’ve not had any more time recently so I’ve stopped work on it for now
from documentation.
Related Issues (20)
- ←[31m[error] ←[0mExecutable was not found in path: "git"←[0m HOT 2
- Move record syntax from Syntax.md to Record.md
- Add a migration guide for each major release HOT 2
- Row types are poorly explained HOT 3
- Add section about polymorphic number literals to Differences-From-Haskell.md
- Getting started guide code doesn't compile with Spago 0.20.0 HOT 1
- Module Dependencies should be replaced with function dependencies HOT 1
- [Wrong repo] Add an explanation on kind signatures appearing in documentation HOT 2
- Foldable instance defaults can cause CycleInDeclaration error HOT 1
- ScopeConflict documentation cites `id` HOT 6
- Add more cases to pattern matching HOT 2
- Add DeprecatedFFICommonJSModule
- Function or value name characters are only defined via Unicode categories HOT 2
- Purescript Without Node Example Fails HOT 3
- ado HOT 2
- Getting started guide: `import Data.List` fails HOT 1
- Differences from Haskell: Records example - Could not match type Int with Number HOT 2
- Missing / misleading documentation HOT 2
- Evaluation strategy
- Document VTAs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documentation.