Better HN
topnewbestaskshowjobs
Log inSign up

jamesbrock

18 karma · joined Jun 2, 2014 (12y ago) · 17 submissions

Submissions

comment 1y ago · link · parent

This essay is a treatler manifesto, full of treatler clichés like “customer service simply no longer exists.”

https://knowyourmeme.com/memes/treatler-treatlerite

Note that the author does not ask for universal manners and courtesy, the foundation of a pleasant society. Instead he demands “customer service” in which dignity and respect flow in only one direction.

Does the author really want new shoes, or does he mostly want to feel like a very special boy in the shoe store? It is the latter. I suspect he would choose to burn down the world rather than live in a world in which his superior social position as a Customer is unrecognized. Soon the bond markets will neutralize the status conferred by this man’s credit card and we will see which he, and the millions like him, choose.

comment 2y ago · link · parent

David Remnick’s New Yorker is not really in a position to scold other people about facts.

Here is a fun exercise that David Remnick and other Americans can do to see if they can change their minds when presented with facts: https://benthamopen.com/contents/pdf/TOCPJ/TOCPJ-2-7.pdf

3.

Edifice: React, but Python Instead of JavaScript, Qt Widgets Instead of HTML DOM(github.com ↗)

2 points · by jamesbrock · 2y ago · discuss

comment 2y ago · link · parent

Yeah, “insisting on programming with Python” is exactly the reason why you would want to use Edifice.

comment 3y ago · link · parent

Here is a bonus list of other Python declarative native GUI projects:

https://github.com/pyedifice/pyedifice/discussions/43

6.

Edifice: Declarative Model-View-Update GUI for Python and Qt(pyedifice.github.io ↗)

4 points · by jamesbrock · 3y ago · 1 comment

comment 5y ago · link · parent

I have a Suzuki Palette kei minivan and I love it. It cost $8000 and I've driven it for nine years and it has never broken down. It has tall ceilings and huge windows and it seats four. I can fold down the back seats and haul sofas and refrigerators. It has continuous variable automatic transmission and gets 40 miles/gallon in the city. It has decent acceleration when fully loaded going uphill in a headwind at freeway speeds. It's only sold inside Japan.

8.

How to write PureScript React to replace TypeScript React in 2021(github.com ↗)

2 points · by jamesbrock · 5y ago · discuss

comment 5y ago · link · parent

> What if a programming language would provide us with a structure that would act like an array of structs, but internally it would really behave like a struct of arrays? We could program in the typical object oriented way that is convenient for humans, while still enjoying in great performance due to playing nice with the hardware.

> So far, the only programming language I know of that supports this type of crazy data transformations is JAI,

Haskell supports this type of data transformation.

http://hackage.haskell.org/package/vector-0.12.3.0/docs/Data...

> unboxed vectors of pairs are represented as pairs of unboxed vectors.

10.

Protobuf Decoder Explainer(jamesdbrock.github.io ↗)

1 points · by jamesbrock · 5y ago · discuss

11.

Behold, the Universal Data Structure(mybinder.org ↗)

2 points · by jamesbrock · 6y ago · discuss

comment 6y ago · link · parent

Yes, my understanding is that Theodore Gray invented the "computational notebook" for Mathematica in the 90s. Here is the best writeup of the history of the notebook that I've ever read. https://www.theatlantic.com/science/archive/2018/04/the-scie...

comment 7y ago · link · parent

For pattern matching and search-and-replace in Haskell, some people might prefer monadic parsers to regular expressions. This library has a similar set of capabilities:

https://github.com/jamesdbrock/replace-megaparsec

14.

Jupyter Adaptation of Learn You a Haskell for Great Good(mybinder.org ↗)

4 points · by jamesbrock · 7y ago · discuss

comment 9y ago · link · parent

Mr. Burge has written a nicely thought-out blog post showing an evolution of different ideas about how to write to an array in Haskell.

I don't want people trying to follow the evolution to get the impression that iterating and writing to an array is really hard in Haskell, so here is a complete Haskell program which

1. Initializes a 10x10 mutable array to 0.

2. Iterates in a for-loop from 0 to 9, setting the diagonal to 1.

3. Freezes the mutable array to an immutable array and prints it.

  module Main where
  
  import Foreign.C.Types (CInt)
  import Control.Monad (forM_)
  import Numeric.LinearAlgebra (toLists) -- http://hackage.haskell.org/package/hmatrix-0.18.1.0/docs/Numeric-LinearAlgebra-Data.html
  import Numeric.LinearAlgebra.Devel (runSTMatrix, newMatrix, writeMatrix) -- http://hackage.haskell.org/package/hmatrix-0.18.1.0/docs/Numeric-LinearAlgebra-Devel.html
  
  main = do
      putStrLn $ unlines $ fmap unwords $ fmap (fmap show) $ toLists aImmutable
    where
      aImmutable = runSTMatrix $ do
          a <- newMatrix (0::CInt) 10 10
          forM_ [0..9] $ \i -> writeMatrix a i i 1
          return a
Output:

  1 0 0 0 0 0 0 0 0 0
  0 1 0 0 0 0 0 0 0 0
  0 0 1 0 0 0 0 0 0 0
  0 0 0 1 0 0 0 0 0 0
  0 0 0 0 1 0 0 0 0 0
  0 0 0 0 0 1 0 0 0 0
  0 0 0 0 0 0 1 0 0 0
  0 0 0 0 0 0 0 1 0 0
  0 0 0 0 0 0 0 0 1 0
  0 0 0 0 0 0 0 0 0 1

comment 11y ago · link · parent

Keep! And increase all font sizes to at least 1em. And give this comments page the same treatment, please.

comment 11y ago · link · parent

> What's the future that Haskell brings?

That's a great question, paulsutter. The great computer scientist Peter Landin in 1965 asked a similar question about the future of programming languages. To answer the question, he imagined a wonderful futuristic programming language with lambda calculus at its core. He named that language ISWIM, and described it in a paper entitled The Next 700 Programming Languages.

Haskell is essentially ISWIM with a Hindley-Milner type system added to it.

https://www.cs.cmu.edu/~crary/819-f09/Landin66.pdf

Haskell is science fiction from 1965. The future that Haskell brings is right now, the 21st century future.