Giter Site home page Giter Site logo

hasklog's People

Contributors

cimbul avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

bkrmendy

hasklog's Issues

Flesh out interpreter tests

The tests for the Hasklog.Interpreter module currently only cover unification. Test the actual interpreter.

Fix math rendering in manual

Github doesn't support math in ReStructuredText. Deploy the documentation to somewhere that does, or convert it to Markdown.

Add source code formatter

Investigate Haskell formatters like Stylish, HIndent, and Brittany, and see if I can stand any of them.

Update manual to show Stack

I've been building this with Stack for a while. Update the old instructions in Manual.rst that reference Cabal.

Support wildcard patterns

Currently, _ is treated like any other atom, so if you write a pattern like foo(_, _), it will unify foo(A, A) or foo(B, B), but not foo(A, B). Treat this like a true wildcard pattern.

Fix failing parser test

One of the parser tests has been failing for 8 years now. It's probably time to fix it.

  test/Hasklog/ParserSpec.hs:83:21: 
  1) Hasklog.Parser.term, with invalid input, fails to parse ":- a :- b"
       expected parse error
        but got: CompoundTerm ":-" [CompoundTerm ":-" [Atom "a",Atom "b"]]

Rename "functor" types/functions

"Functor" has different meanings in Prolog and Haskell. Data.functor and Complier.Functor make the code confusing and force us to hide Haskell's builtin Functor in imports. Rename them to something like "PFunctor" or maybe "Phunctor." ๐Ÿ˜„

End-to-end tests

Add some end-to-end tests, either written in Prolog itself or based on a transcript of interpreter sessions. Possibly something similar to this ISO conformance test suite, although since this implementation doesn't support I/O or second-order predicates, it will probably need some lifting on the Haskell side.

Improve REPL

Make the REPL more user-friendly with some of the features you usually find in a shell:

  • history
  • tab completion
  • parenthesis matching

Have a closer look at SWI-Prolog and friends for some further ideas.

Possibilities:

Add compiler tests

There aren't any tests for the Hasklog.Compiler module at the moment.

Type-safe fixity for builtins

The map of builtins uses an (identifier, fixity) pair as the key, but the builtin functions themselves all take a list of terms, and there is no static guarantee that we are passing the right number of terms. That forces us to define a lot of unnecessary fall-through cases. See if we can make this type-safe with a heterogenous map implementation or some kind of dependent type mechanism.

-- | A map from a functor\/arity pair to a function that computes a builtin
-- operation
builtins :: (MonadIO m, Functor m) => Map (Identifier, Int) (Predicate m)
builtins = M.fromList [
(("fail", 0), bfail),
(("true", 0), btrue),
(("not", 1), bnot),
(("consult", 1), bconsult),
(("compile", 1), bcompile),
(("op", 3), boperator)
]

WAM interpreter

Add a simple WAM interpreter so we can verify the compiler output makes sense.

Fix name shadowing

Enable the -Wname-shadowing GHC warning and fix the highlighted issues.

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.