Better HN
topnewbestaskshowjobs
Log inSign up

grumpyprole

4,485 karma · joined Jun 30, 2015 (11y ago) · 2,043 submissions

Submissions

comment 5y ago · link · parent

The marketing for this one hasn't reached me yet. Thanks for the recommendation.

EDIT: looks like Amazon HD might force re-sampling of 44.1KHz to 48KHz on Android, which is a shame if true.

comment 5y ago · link · parent

I am thinking of moving to Tidal. The Spotify sound quality is awful for Classical music with their compression/processing unable to deal with complex passages. The Android app also upsamples everything to 48KHz and has occasional random audio glitches. Hopefully Tidal is better.

comment 5y ago · link · parent

> A new format is a really weird way to go about fixing a problem that already has a solution.

Stripping comments before handing off to a JSON parser is not a full solution. For example, if the file has to be augmented with additional data and written out again, the comments would be lost.

comment 5y ago · link · parent

I am not the source of the original statement, but my own interpretation of "powerful" aligns with simplicity and flexibility. Plain text has only slightly more structure than a stream of bytes, meaning it retains a lot of simplicity and flexibility. Yes plain text can be inefficient and is overused (a proprietary unpublished wire-format does not need to use JSON). However, 50 years from now, the only data I feel comfortable knowing I'll be able to read is plain text (and possibly also JPEG and a few other well-specified and simple binary formats). Many binary formats are effectively defined by large complex and transient code bases that target particular tool chains and APIs. A new binary format needs to justify itself, less so plain text.

comment 5y ago · link · parent

Plain text is simple, elegant and has open-standards - it traces its origins back to telegraph codes that we have been using for hundreds of years - and still forms the basis of most of the internet now. So I am inclined to agree with the statement "text is the most powerful, useful, effective communication technology ever, period".

comment 5y ago · link · parent

Yes, deprecation is fine, as long as they are not removed.

comment 5y ago · link · parent

I was responding to "Can Haskell evolve?", I was trying to say "I think it can, but I would prefer it to evolve in a new language". The standard library is riddled with partial functions, like head and tail. We should not take them away and break thousands of projects, research papers, books and blog articles.

comment 5y ago · link · parent

Only if Haskell stops being maintained, which I very much doubt would happen. Therefore no one is forced into the change.

comment 5y ago · link · parent

> You realize 3 would make 1 and 2 harder or less valuable?

Yes that is why I think (1) and (2) need a new language.

> And 3 would have also prevented a gazillion 1s and 2s from being still with us?

I disagree. Most new features have been implemented as extensions that must be enabled with language pragmas. This is not the same thing as large breaking changes in the standard libraries.

comment 5y ago · link · parent

IMHO Haskell is missing three features that would really improve programming in the large:

1) better structural types. For example, polymorphic extensible records and variants. These could even be the basis for all algebraic data types. Current encodings have poor syntax and poor type inference (due to non-injective type families). The need to make all records nominal types really gets in the way when dealing with structured data. Python is the main competitor here; and so we could also just use strings and maps, but we can do better.

2) a better module system. Even Miranda had a better module system than Haskell. OOP has first-class modules.

3) a better commitment to backwards compatibility. There have been controversial and breaking changes to Haskell's standard libraries that have done more harm than good. This has likely damaged industrial adoption of Haskell. For example, my employer, a prominent Haskell sponsor, is stuck on a 7-year old version.

Unfortunately the above problems are difficult to retrofit for and so I think a new language may ultimately be needed.

comment 5y ago · link · parent

I usually recommend "Since We Met" to anyone new to Evans, its a great collection of tunes and a great performance. "I Will Say Goodbye" is a great record too, although my CD copy has lots of tape wow and flutter all over it. I'm not sure if the broken tape machine was used in mastering or whether all recordings have these artefacts.

comment 5y ago · link · parent

The problem with encapsulation in OOP, is that the (mutable) state is not truly encapsulated, it is just hidden. State encapsulation would be a pure function that uses mutation internally. OOP encourages mutable state and in general it is non-trivial to compose such effectful code. The state space of an OOP application can become a combinatorial explosion. This might be what you want if you are modelling something with emergent complexity, e.g. a simulation or game, but doesn't sound good for a line-of-business app.

As an anecdote, I once saw a stack overflow reply from a distinguished OOP engineer advocating for modelling a bank account with an object containing a mutable balance field! That is certainly not modelling the domain (an immutable ledger). OOP might fit some problems well, but the cult of presenting it as the one-true-way (made concrete in 90's Java) is deserving of a backlash IMHO.

comment 5y ago · link · parent

The original ones had some problems that were never fixed (IIRC, the original firmware was outsourced to a company that went under), but the Advantage 2 was a redesign and works great (at least for me).

comment 5y ago · link · parent

The Kinesis Advantage 2 has the keys in a concave well, which means less reach is needed to get them. It's similarly priced and worth a try!

comment 5y ago · link · parent

"Generics" (a.k.a. parametric polymorphism) might be terrible for code clarity in a verbose language with subtyping and little to no type inference, but in many languages they actually improve code clarity:

map : (A -> B) -> [A] -> [B]

It's quite clear from the above type signature what this function does and does not do. It can only use the supplied A's to create B's using the supplied function. It cannot do anything else with the A's and the B's. To me, that is clarity.

comment 5y ago · link · parent

I suspect the issue is partly caused by outsourcing the enforcement to private contractors and setting targets!

comment 5y ago · link · parent

Java can be slow for many complex reasons, not just GC. Oracle are trying to address some of this with major proposals such as stack-allocated value types, sealed classes, vector intrinsics etc, but these are potentially years away and will likely never arrive for Android. However, a lot of Androids slowness is not due to Java but rather just bad/legacy architectural decisions. iOS is simply better engineered than Android and I say this as an Android user.

comment 5y ago · link · parent

While I think that having some publicly funded radio/TV is a really good thing, the idea of the UK TV license and the subsequent enforcement is not. My friends elderly mother does not have or want a TV. She is constantly harassed and threatened by UK license enforcement. Her son has invited them into her home on numerous occasions, hoping that the legal threats and visits would cease, but to this day they have not. I object to having my license fee money spent on such abuse of vulnerable people.

comment 5y ago · link · parent

A nice and fun tutorial. I'd also like to see a text editor example in Rust implemented using a persistent data structure, for better concurrency (e.g. background save) and undo support. Perhaps I should have a go!

comment 5y ago · link · parent

You seem to be lumping all side-effects together as equally bad? I don't think you can expect to push everything out to the edges, for example partiality. I take your point that a lot of imperative programming is done in Haskell (e.g. State monads). However, I think what most Haskellers mean when they talk about pushing effects to the edge, is pushing IO and other less benign effects.

comment 5y ago · link · parent

Monadic composition is used everywhere from simple failure (Maybe or Either) through to genuine side effects such as IO. The presence of monads does not necessarily mean side effects.

Haskell never claimed to "get rid of side effects", the idea is make them explicit in the types and to be able to reason about them.

comment 5y ago · link · parent

> because it's a language with strict evaluation

But that is not the only reason. Haskell does much more aggressive optimisations than Java (and Scala, OCaml, F#). A large part of Haskell's space-usage reasoning issues come from the combination of lazy evaluation and these aggressive optimisations. Java and Scala code can contain plenty of deferred evaluation too, for example iterators, but the compilers simply don't do (and cannot do) such aggressive optimisations. Of course, this also means that much pure functional Scala/Java code can be poorly performing.

comment 5y ago · link · parent

> There's at least a dozen languages you could have chosen, and that others have chosen for any given use case. within some bounds, it makes very little difference.

It's about quality of life and picking the right tool for the job. There are some problems I can solve in Haskell, that I simply could not solve in Java, it would be too hard and too much work. Java is a simple language and therefore it's much easier to reason about the performance and space usage. There are thus many problems where Java would be a better fit.

comment 5y ago · link · parent

That is impossible with almost all non-trivial software. Testing proves only the presence of errors not their absence.

comment 5y ago · link · parent

> But, I've seen this a million times in Java

Perhaps when Java gets record types, sealed classes, pattern matching and other features. But right now, Domain Modelling in Java (and C++) is really painful compared to a higher-level language like Haskell.

comment 5y ago · link · parent

This highlights the risk of building upon and investing in a closed-source and proprietary platform (Flash). Once Adobe discontinued it, it was inevitable that browsers would eventually stop supporting it.

comment 5y ago · link · parent

Postgres would give us actual Boolean logic whenever we used Boolean operators:

https://lucidworks.com/post/why-not-and-or-and-not/

comment 5y ago · link · parent

Yes, I'm claiming the restriction will be too much for many people, assuming we are trying to create a new language here. However, expressing a solution as a catamorphism is a good thing to do and helps reasoning. It's a form of structured programming (recursion is the "goto" of functional programming!).

comment 5y ago · link · parent

> Ah ha, but you see, you can perform transformations on tagless-final terms that are not strict catamorphisms ... so matching two levels deep is possible.

No this is not correct. Oleg provides a solution to double negation by creating a catamorphism that folds to a function. It's still a catamorphism. And folding to a function is not something the average Java programmer is likely to understand easily.

1
272829
69