3 ms·
I'm not convinced that arguing that "think[ing] day-to-day tasks like running a web app are difficult or impossible in Haskell! ... isn't true!" is well-served
by ajarmst 6y ago
I'm not convinced that arguing that "think[ing] day-to-day tasks like running a web app are difficult or impossible in Haskell! ... isn't true!" is well-served by a series that introduces (in the first post!) Persist and Template Haskell and then has
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
PTH.share [PTH.mkPersist PTH.sqlSettings, PTH.mkMigrate "migrateAll"] [PTH.persistLowerCase|
User sql=users
name Text
email Text
age Int
occupation Text
UniqueEmail email
deriving Show Read
|]
as literally the third block of code in the series. That's more of a proof of the opposite, don't you think?
- saithound 6y agoPython web app tutorials routinely introduce MongoDB/pymongo, Flask, at-annotations for routing, and follow that up with 2-5 `from __future__ import` statements. These are pretty much exactly analogous to the steps in the current series. The only difference is that the Haskell standards change less frequently, so more "from __future__" imports (LANGUAGE pragmas) are required. (Note that the latest Haskell is from 2010, while the latest Python is from 31 days ago; see how many future imports you need to get a modern Python web app to work with a ten year old Python release) This is not evidence that day-to-day tasks like running a web app are difficult or impossible in Python.
- momentoftop 6y agoThis code relies on GHC and GHC specific extensions. The mentioned pragmas are not defined by the 2010 standard. The lastest GHC release is from August 8th of this year.
- saithound 6y ago> The mentioned pragmas are not defined by the 2010 standard. That's exactly the point. GHC supports the most recent Haskell version it supports, and implements some extensions to the standard language, which can all be enabled or disabled using compiler directives (LANGUAGE pragmas). These are analogous to Python future import statements, which are compiler directive saying that a particular module should be compiled using syntax or semantics that is not part of the current version of Python the language. Once in a blue moon, the Haskell standard changes, and certain features that you used pragmas for (e.g. PatternGuards, EmptyDataDecls, RelaxedPolyRec) will no longer require them. This depends on the standard, not the latest GHC release. Unlike Python, core Haskell changes slowly and conservatively, so you should not be surprised that the average Haskell code uses pragmas more frequently than Python uses future imports.
- ajarmst 6y agoYou do recall that your initial thesis was "A lot of people think day-to-day tasks like running a web app are difficult or impossible in Haskell! But of course this isn't true!"? Right?
- ajarmst 6y agoSure. But you're begging the question that those are somehow evidence for an argument that Python is easy. I disagree that they would be, especially for a novice, or one who already has a familiar and comfortable workflow in a different language. I think such a user would think "wait, this is what they think is easy entry-level practical programming? Riiiight."