Code Monkey home page Code Monkey logo

fsharp-parser's Introduction

fsharp-parser

Twitter

2019-05-20

This is a project that was begun on my live coding stream Codebase Alpha episode 27. That episode is archived to my Youtube channel, along with all of my other videos. My special guest on episode 27 was Mårten Rånge, and he led me through the process of building a parser in F# from first principles.

We felt that building a parser from scratch using the F# programming language and using only a functional style would be interesting and informative, hopefully yielding a better understanding of the functional paradigm through the medium of creating a genuinely useful software artefact. It is my belief that the episode was successful in that regard! I certainly learned a lot and the content certainly stretched my mind and my imagination.

Currently, the code is in the same state as it was at the end of the stream. I do hope to have Mårten on again sometime soon to pick up where we left off, and develop the parser to such an extent, that we can then begin to look at parsing frameworks such as FParsec, and understand them at a deep level. I may make a pass through the code to make some of the code a little more verbose with respect to the naming of parameters. The functional style can be mathematically terse!

Bear in mind that the stated aim of the stream was to end up with software that could parse 1+2 and yield the answer 3. This was achieved (and we went on to parse key-value pairs as well), but time constraints meant that the parser, although it compiles and yields results, remains incomplete as of the time of committing it to this repo. Watch out for updates in the coming months!

2019-05-27

I went over the code, adding comments and making the names used in functions a little less terse. No doubt, the comments will require revision and correction over time, as my understanding grows!

2019-06-03

Episode 33 of Codebase Alpha saw Mårten Rånge return to help me build upon the firm foundations established in Episode 27. Together we built more parser combinators, ending up with a parser that should create expression trees from arithmetic strings such as

  • a+6*(5+b)/(4+1)

i.e full support for variables, operator presidence and parentheses! This episode also covered creating custom operators for our Parser<'T> type, to make using the building blocks easier and more fluent. We ended up with a brief review of the FParsec parser framework.

fsharp-parser's People

Contributors

essenbee avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.