Hacker Newsnew | past | comments | ask | show | jobs | submit | jamesbrock's commentslogin

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.


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


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


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

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


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.


> 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.


Haskell uses linked lists everywhere, so any transformation like this likely does nothing for speed.


Haskell uses linked lists as a metaphor for generators (since it's a lazy language), which is a strange decision since linked lists are a bad data structure, so you have to write the program to avoid accidentally ever doing what it says it does.


> linked lists are a bad data structure

Why is that? They're perfectly fine for most purposes, and have the advantage that when you pass one across a function boundary the callee can play with it or modify it or do whatever the hell they want and when the callee returns, the caller's linked list is untouched. That's an incredibly valuable feature for correctness and safety.


They have poor cache performance when you want to iterate over them, and more size overhead, because there's one pointer lookup per item. Also, the common definition of a linked list has the list responsible for allocating each item, meaning it can't be a member of more than one list at once. The actual useful version of this is called instrusive linked lists, which isn't the one taught.

> That's an incredibly valuable feature for correctness and safety.

Are you thinking of something else? That's an effect of call by value, but linked lists actually aren't good at that and you have to copy them to pass them around. You need something like these to make it efficient:

https://en.wikipedia.org/wiki/Finger_tree

https://en.wikipedia.org/wiki/Read-copy-update


> Are you thinking of something else? That's an effect of call by value, but linked lists actually aren't good at that and you have to copy them to pass them around.

Are you thinking of something else? Haskell (and all other ML-family languages, and Lisps) lists are passed around by copying a single pointer to the head element. Different lists can share tail elements, i.e., elements can be members of more than one list.

All this is in contrast to Java-style linked lists, where there is a list object that controls its elements.


> Are you thinking of something else?

I think the point is to contrast them with dynamic arrays --- linked lists, unlike arrays, are persistent data structures, which does make them easier to reason about.

> Also, the common definition of a linked list has the list responsible for allocating each item

I'm not sure how this is relevant in the context of Haskell, given that it's garbage collected.


The given link describes unboxed vectors. This is Haskell-speak for "actual array of actual machine numbers".


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...


quick look at Wikipedia shows Mathematica: "Initial release June 23, 1988;"

Mathematica took at least a year or more to write.. so that goes back perhaps to 1986.. 90s is way off...


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


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


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


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: