| CARVIEW |
disco: Functional programming language for teaching discrete math.
Disco is a simple functional programming language for use in teaching discrete math. Its syntax is designed to be close to standard mathematical practice.
[Skip to Readme]
Modules
[Index] [Quick Jump]
- Disco
- AST
- Disco.Compile
- Disco.Context
- Disco.Data
- Disco.Desugar
- Disco.Doc
- Effects
- Disco.Enumerate
- Disco.Error
- Disco.Eval
- Disco.Exhaustiveness
- Disco.Extensions
- Interactive
- Interpret
- Disco.Messages
- Disco.Module
- Disco.Names
- Disco.Parser
- Disco.Pretty
- Disco.Property
- Disco.Report
- Disco.Subst
- Syntax
- Disco.Typecheck
- Disco.Types
- Disco.Util
- Disco.Value
Downloads
- disco-0.2.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.1.3.0, 0.1.3.1, 0.1.4, 0.1.5, 0.1.6, 0.2 |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | algebraic-graphs (>=0.5 && <0.8), arithmoi (>=0.10 && <0.14), base (>=4.8 && <4.21), boxes (>=0.1.5 && <0.2), constraints (>=0.13.4 && <0.15), containers (>=0.5 && <0.8), directory, disco, edit-distance (>=0.2 && <0.3), exact-combinatorics (>=0.2 && <0.3), exceptions (>=0.10 && <0.11), fgl (>=5.5 && <5.9), filepath, haskeline (>=0.8 && <0.9), infinite-list (>=0.1 && <0.2), integer-logarithms (>=1.0 && <1.1), lens (>=4.14 && <5.4), megaparsec (>=6.1.1 && <9.7), mtl (>=2.2 && <2.4), oeis2 (>=1.0.9 && <1.1), optparse-applicative (>=0.12 && <0.19), parser-combinators (>=1.0.0 && <1.4), polysemy (>=1.6.0.0 && <1.10), polysemy-plugin (>=0.4 && <0.5), pretty-show (>=1.10 && <1.11), prettyprinter (>=1.7 && <1.8), QuickCheck (>=2.9 && <2.16), random (>=1.2.1.1 && <1.3), reflection (>=2.1.7 && <2.2), simple-enumeration (>=0.2 && <0.3), split (>=0.2 && <0.3), splitmix (>=0.1 && <0.2), text (>=2.0.2 && <2.2), transformers (>=0.4 && <0.7), unbound-generics (>=0.4.4 && <0.5) [details] |
| Tested with | ghc ==9.6.6 || ==9.8.4 || ==9.10.1 |
| License | BSD-3-Clause |
| Copyright | Disco team 2016-2022 (see LICENSE) |
| Author | Disco team |
| Maintainer | byorgey@gmail.com |
| Uploaded | by BrentYorgey at 2025-01-22T11:47:40Z |
| Category | Language |
| Source repo | head: git clone git://github.com/disco-lang/disco.git |
| Distributions | |
| Executables | disco |
| Downloads | 793 total (34 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs uploaded by user [build log] All reported builds failed as of 2025-01-22 [all 1 reports] |
Readme for disco-0.2
[back to package description]Disco is a programming language intended to teach basic functional programming principles in the context of a discrete mathematics course.
Design principles
- Includes those features, and only those features, useful in the context of a discrete math course. This is not intended to be a general-purpose language.
- Syntax is as close to standard mathematical practice as possible, to make it easier for mathematicians to pick up, and to reduce as much as possible the incongruity between the language and the mathematics being explored and modeled.
- Tooling, error messages, etc. are very important---the language needs to be accessible to undergrads with no prior programming experience. (However, this principle is, as of yet, only that---there is no tooling or nice error messages to speak of.)
Feel free to look around, ask questions, etc. You can also contribute---collaborators are most welcome.
Community
Check out the disco IRC channel, #disco-lang on Libera.Chat. If
you're not familiar with IRC, you can connect via this web client.
Documentation
Documentation is hosted on readthedocs.io.
Contributing
If you'd like to contribute to disco development, check out CONTRIBUTING.md.
Building disco
-
The first step is to install the Haskell programming language (the language in which Disco is implemented). If you don't already have Haskell installed, you can follow the directions here.
-
Now, at a command prompt, run
cabal update, which will download the latest information about Haskell packages. -
Now run
cabal install discoat a command prompt.-
Note that this may take a very long time, on the order of an hour or so.
-
The good news is that most of this work only needs to be done once, even if you later install an updated version of disco. Even if installation fails partway through, the work already completed up to that point need not be redone.
-
On OSX, if building fails with an error like
ghc: could not execute: opt, it means you need to install LLVM. The easiest way to do this is to first follow the instructions to install Homebrew (if you don't already have it), and then typebrew install llvmat a terminal prompt.
-
If this fails with an error like
Could not resolve HEAD to a revision, then try running these two commands at a terminal prompt:rm -rf $(brew --repo homebrew/core) brew tap homebrew/coreThen re-run the
brew install llvmcommand. -
After installing
llvm, you may need to close and re-open the terminal before runningcabal install discoagain.
-
-
-
If it works, you should be able to now type
discoat a command prompt, which should display a message like this:Welcome to Disco! A language for programming discrete mathematics. Disco> -
If installation seems like it succeeded but the
discocommand is not recognized, it may be an issue with your path environment variable settings. Try runningdiscousing an explicit path:~/.cabal/bin/discoon Linux, OSX, or WSL2C:\cabal\bin\discoon Windows- If those don't work, poke around and see if you can figure
out where the
cabal/binfolder is on your computer, and rundiscofrom there. - If you wish, you may add the
cabal/binfolder (wherever it is located) to yourPath(Windows) orPATH(Linux/OSX) environment variable, so that you can run disco simply by typingdisco. However, this step is optional.
-
On Windows, if disco crashes with an error about
foldrafter you try to type anything (or if it simply closes the entire window when you type anything), the problem is probably that you need to enable UTF-8 mode.-
Open a command prompt, and type
chcp 65001 -
Now start
discoas before (by typingdiscoorC:\cabal\bin\discoor whatever worked). -
You will have to do this every time you run disco. Alternatively, you can create a file called
disco.cmdcontaining those two commands, for example:chcp 65001 C:\cabal\bin\discoNow you can simply double-click on
disco.cmdto run disco.
-
If you encounter any difficulties, please let me know --- either come talk to me or open a GitHub issue. These instructions will be kept up-to-date with whatever helpful tips or workarounds I learn. So even if you encounter a difficulty but figure out the solution youself, let me know --- that way I can include the problem and solution here so others can benefit!