The Gren programming language in a docker container!
To learn about the Gren programming language, see What's Gren? below.
Current features include:
- Full Gren in a Docker container
- Beginner-friendly documentation
- Persistent state & volumes
- Ports & networks
- Advanced usage guide
- Install Docker
docker run -it pushfoo/gren gren repl
to get a throwaway REPL- Start learning Gren!
View a full list of currently built versions at hub.docker.com/r/pushfoo/gren.
Tip
On Linux, you may also need to do one of the following:
- Use
sudo
before yourdocker
commands - Follow the post-install steps to enable sudoless
docker
commands
TL;DR: 13r0ck hooked me on Elm's syntax and Gren frees it from frontend
13r0ck has a rare combination of technical, communication, and community engagement skills. He suggested I try Elm as an antidote to the Python flaws which continue to crush my hopes now and then. I only used Elm briefly, but it was enough to upend my views on programming languages in the best ways.
Brief & shameless promotion: Hire 13r0ck if you get the chance!
TL;DR: Anyone who wants consistent Gren environments in a box!
It isn't just beginners who have a hard time with getting the right Node.js and Haskell versions. It can be surprisingly hard, even with knowledge and experience!
These situations can include:
- Systems with permission or dependency issues
- Large-scale web deployments1
TL;DR: Gren is Elm's younger, more adventurous sibling
TL;DR: They're both a Dark Souls of functional programming
Instead of end-of-level bosses, you fight the compiler:
- It's strict: unhandled conditions are compile errors
- It's fair: the errors tell you how to fix your mistakes
- It's rewarding: beating it produces reliable software
TL;DR: Unlike Elm, Gren wants to explore the world outside the browser
TL;DR: Elm wants to stick to being a strong web frontend language
Elm's designers outline three excellent points in their official Roadmap FAQ and statement on general purpose languages:
- Languages tend to be great in certain roles
- Forcing a language into the wrong role turns it into Turing tarpit
- Each language is to some degree a domain-specific language
Then it veers somewhere inconvenient. They explain how Elm will:
- stick to its stated purpose and current strengths
- avoid areas outside those if another language handles them better.
It's a strict policy, but it's also a useful one. It means Elm will continue being an excellent frontend language.
TL;DR: Gren devs love many Elm ideas, so we're freeing them from the browser
Note
Please make a PR if I got something wrong below. I'm fairly new to both Elm and Gren, so the chances are high.
In addition to some syntax and feature differences, some Gren packages implement features which Elm avoids by design.
Task | Exemplary Gren Package | Does Elm Have an Equivalent? |
---|---|---|
On-disk File handling | node.FileSystem | Not really, per Elm's Roadmap FAQ |
TUI (Python's rich, etc) | gren-tui | Please make a PR if you know any! |
Gren also offers replacements for many existing Elm packages. Many are forks or ports with APIs which remain close or identical to their Elm counterparts. Some may even be by the same author, but I haven't had the time to verify which ones yet.
Example Task | Elm Package | Gren Alternative | API Similarity2 |
---|---|---|---|
HTML generation | elm/html | gren-html | Close or identical |
URL Parsing | elm/url | gren-url | Close or identical |
ANSI escape codes | elm-ansi | gren-ansi | Very different |
Full-stack Support | elm-pages3 | prettynice | Differs |
To search for more packages, please see the following:
TL;DR: Docker helps avoid breaking debian with non-distro packages
Imagine you need to deploy to a system running Debian, or worse, its OldStable version:
- Packages tend to only merge security patches
- Feature releases tend to lag years behind the latest
- The Debian documentation explicitly warns you that third party packages are a common way to break Debian!
Using a Docker container container saves you the trouble of managing package sources, extracting archives, and especially the worst of all: hunting down the right versions of each.
With a container, all of it's in already in the box:
- Gren itself
- Node.js to allow prettynice and other web dev tools to run
Footnotes
-
Okay, let's be real: maybe you shouldn't use this in production quite yet, but we all have ambitions! ↩
-
API similarity was eyeballed without using AST comparison tools. Please make a PR if this table needs corrections. ↩
-
It's not a first-class feature. ↩