News for hackers. Stuff that matters.
Re:Real World Haskell by ajarmst on Friday November 06, 2020 @04:09PM (#25011181)
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?
Re:Real World Haskell by saithound on Friday November 06, 2020 @08:14PM (#25012555)
Python 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.

Re:Real World Haskell by ajarmst on Saturday November 07, 2020 @09:42PM (#25022334)
Sure. 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."
Re:Real World Haskell by momentoftop on Saturday November 07, 2020 @07:10AM (#25014629)
This 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.

Re:Real World Haskell by saithound on Saturday November 07, 2020 @11:09AM (#25015847)
> 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.

Re:Real World Haskell by ajarmst on Saturday November 07, 2020 @09:48PM (#25022363)
You 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?