https://github.com/deepchem/diffstruct
Experimenting with differentiation
https://github.com/deepchem/diffstruct
Last synced: about 1 year ago
JSON representation
Experimenting with differentiation
- Host: GitHub
- URL: https://github.com/deepchem/diffstruct
- Owner: deepchem
- Created: 2020-05-29T19:22:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T02:03:32.000Z (about 6 years ago)
- Last Synced: 2025-02-26T02:41:24.417Z (over 1 year ago)
- Language: Haskell
- Size: 3.91 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# diffstruct
This repo holds some simple experiments with differentiation. For now,
I'm using this to hold a few simple haskell intepreter scripts I've
been playing with in hopes of understanding autodifferentiation and language design better.
Simple interpreters are implemented using Haskell. To install GHC (the haskell compiler), I recommend using [ghcup](https://www.haskell.org/ghcup/).
To run the code in this repo, I suggest using
[GHCi](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html)
to interactively run the code. Here's an example of how to load an
interpreter into GHCi:
```
(base) bharath@Bharaths-MBP diffstruct % ghci
GHCi, version 8.8.3: https://www.haskell.org/ghc/ :? for help
Prelude> :load minimal.hs
[1 of 1] Compiling Main ( minimal.hs, interpreted )
Ok, one module loaded.
*Main>
```
minimal.hs
----------
This intepreter follows this [stackoverflow answer](https://stackoverflow.com/questions/16970431/implementing-a-language-interpreter-in-haskell). It implements an intepreter for a simple imperative language.
minimal_monadic.hs
----------
This interpreter follows this [stackoverflow
answer](https://stackoverflow.com/questions/16970431/implementing-a-language-interpreter-in-haskell).
It implements an intepreter for a simple imperative language using a
simple `Interp` monad to do error handling.