pushfoo / docker-gren

Gren in a docker container.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker-gren

License PRs Welcome

The Gren programming language in a docker container!

To learn about the Gren programming language, see What's Gren? below.

The Basics

What is this?

Current features include:

  • Full Gren in a Docker container
  • Beginner-friendly documentation
    • Persistent state & volumes
    • Ports & networks
  • Advanced usage guide

How do I use it?

  1. Install Docker
  2. docker run -it pushfoo/gren gren repl to get a throwaway REPL
  3. 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:

  1. Use sudo before your docker commands
  2. Follow the post-install steps to enable sudoless docker commands

Why did you make it?

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!

Who is this for?

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

What's Gren?

TL;DR: Gren is Elm's younger, more adventurous sibling

How's it like Elm?

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

How's Gren different from Elm?

TL;DR: Unlike Elm, Gren wants to explore the world outside the browser

Elm Sticks Closer to Home

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:

  1. Languages tend to be great in certain roles
  2. Forcing a language into the wrong role turns it into Turing tarpit
  3. Each language is to some degree a domain-specific language

Then it veers somewhere inconvenient. They explain how Elm will:

It's a strict policy, but it's also a useful one. It means Elm will continue being an excellent frontend language.

Gren Wants to Explore

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:

A Practical Example: Debian OldStable

TL;DR: Docker helps avoid breaking debian with non-distro packages

The Scenario

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!

The Solution

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:

Footnotes

  1. Okay, let's be real: maybe you shouldn't use this in production quite yet, but we all have ambitions!

  2. API similarity was eyeballed without using AST comparison tools. Please make a PR if this table needs corrections.

  3. It's not a first-class feature.

About

Gren in a docker container.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Shell 71.5%Language:Dockerfile 28.5%