Better HN
topnewbestaskshowjobs
Log inSign up

grumpyprole

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

Submissions

comment 8y ago · link · parent

> (+) is not SUM.

As I said, people expect a mathematical summation to be defined in terms of addition. Otherwise one has non-compositional semantics and broken equational reasoning. Perhaps you care not for these properties, but many people do.

> All languages treat these basic operators as fluid logic that depends on surrounding context and data types.... Likewise (+) means concat if you're dealing with 2 strings

Syntax overloading is not relevant here. String concat is just sharing syntax, it is a different function. The issue is that the treatment of null is not consistent. It's possible to add null and still have all algebraic laws hold, so null itself is not the problem.

> within that function context making NULL = 0 is a reasonable coercion

IMHO no coercion is reasonable, especially one that is unexpected. They should have called your "SUM" something else and provided one defined in terms of (+).

> What is the parameterization issue exactly? Instead of a view, you use a stored procedure

Stored procedures are not SQL, they are a feature of various imperative languages with SQL as a subset. Typically I am not allowed to define a stored procedure when I query your database.The context was deficiencies in the standard SQL query language.

comment 8y ago · link · parent

> The + operator is not the same as the SUM() function, so it's not surprising that they wouldn't work the same

No, it's very surprising that they are different. In mathematics and most programming languages, summation is defined in terms of the (+) operator.

> Nullability is required to represent empty values

I have no problem with (optional) nullability.

> I'm not sure what you mean by abstraction

There is no way to abstract queries over tables, joins, etc. Views allow me to re-use a particular concrete query, but I cannot parameterize a query.

comment 8y ago · link · parent

> SQL is fine, most of the quirky way of stating things is because it's declarative

No, it's quirky because of its semantics.

To quote Erik Meijer "SQL is rife with noncompositional features. For example, the semantics of NULL is a big mess: why does adding the number 13 to a NULL value, 13+NULL, return NULL, but summing the same two values, SUM(13, NULL), returns 13?"

SQL also has no means of abstraction, i.e. defining parameterizable queries. This is one reason that LINQ exists.

comment 8y ago · link · parent

That's exactly how Python got into industry.

comment 8y ago · link · parent

Perhaps because it's just another boring Java-clone language controlled by a large corporation, with no redeeming features?

comment 8y ago · link · parent

Awesome project. Thanks for the link!

comment 8y ago · link · parent

Perhaps if it were taught to CompSci students elsewhere in the US, they'd be more advocacy?

comment 8y ago · link · parent

Obviously I wanted the convenience of streaming an MP3 to the amp versus using a CD player.

I disagree that all solutions to this problem need the same complexity inherent in the Sonos and that the user experience could not be improved.

comment 8y ago · link · parent

IMHO, 80's and 90's Japanese hardware gave me a much better experience than anything from a software company. For example, everytime I go to use my Sonos box, it wants to update the app, the firmware, or both. The constant software updates fix bugs and security holes, but they also bring unwanted features, frequently interface changes and attempts to upsell more of the same.

I still have a Rotel poweramp from 1985 in my front room which the Sonos is plugged into, working flawlessly. There's no chance my Sonos box will still be working past 2050.

comment 8y ago · link · parent

Personally I prefer Samsung's OS to stock Google. Most bad behaviour and bloat comes from third party Android apps and Samsung includes better tools to detect battery drain and deny apps background processing. They also provide other features not found on Google phones, such as Knox Secure Folder (and Google were late to the party with split-screen and a file manager).

comment 8y ago · link · parent

The BenQ monitor used in the article appears to be just "100% sRGB‎" and not wide-gamut.

comment 8y ago · link · parent

Compile times are often mitigated by just using the runHaskell interpreter, or turning off optimisations.

What sort of tools does Go have that Haskell doesn't? From what I can see, most Go projects just use Makefiles and text editors. The package manager is described as "experimental".

In Haskell land we have many good choices, with my favourite (for deterministic reproducible builds), being nix and cabal new-build. I've also seen Haskell Shake replace C++ Makefiles at work for a huge speedup.

Haskell has good API search (Hoogle), docgen (Haddock), lint (HLint) and graphical profiling tools (Threadscope). Refactoring tools like HaRe and others, are also starting to appear.

comment 8y ago · link · parent

> If you're at leisure to wait for decent libraries and tools to become available, then good for you!

As I said, it depends on the area you are working in. Haskell does have some good libraries.

> Haskell advocates do have a maddening habit of assuming that anyone who criticises any aspect of the language must be a complete novice

Please don't take it personally, I was attempting to explain those features that you mentioned to others who might read our posts (perhaps wishful thinking).

I try to promote Haskell whenever I can because it has been enormously successful in everything I have applied it to and needs all the help it can get. It doesn't have a billion dollar company behind it, just a small community of mostly volunteers.

comment 8y ago · link · parent

> There isn't really any evidence that Haskell is more productive than Go.

Go appears to be a network services language. Although Haskell has equally good for-loops and channels, it does not have an incremental garbage collector or fast build times. So Go has its place.

For general purpose programming, Go is lacking so many features and provides such verbose syntax for what little it does have (worse than modern Java, e.g Lambdas and conditionals), that one can certainly say it is starting from a disadvantaged point with regard to productivity.

It sounds like you've had some bad experiences with some of Haskells libraries and tooling. The ecosystem is certainly still rapidly evolving and good documentation and libraries may not exist in all areas. With regard to complex abstractions, the Haskell community usually likes to formalise and reuse them. Learning an abstraction usually results in a big payoff.

EDIT:

> Do monad transformers make me more productive?

Monad transformers are specific to pure functional programming, but yes they aid productivity. For example, I can build an effectful streaming type with resource management and other desired features by stacking existing transformers. In Go I would be solving such problems with for loops.

> Do functional dependencies make me more productive?

Functional dependences are specific to Haskell type classes, but yes they can aid productivity. For example, you want to express arithmetic ops on matrices and scalars and have the compiler figure out the correct dispatch and return type depending on the type of the values. In Go I can't overload operators or do multiple dispatch.

comment 8y ago · link · parent

I think his point was more that it is purity rather than laziness that has been the big contribution from Haskell, despite the original research goals. A good language should allow for both strictness and laziness, as Haskell already does.

comment 8y ago · link · parent

The attraction of Haskell is to build correct software in a mathematically principled way. With practice, it is also remarkably productive, certainly more so than Go when used as a general purpose language. Haskell is simply much more expressive and capable of abstracting over many more things (perhaps this is why you say it is hard to read). The Haskell ecosystem is also constantly evolving and solving more and more real world problems, often problems that have not been solved in other languages. Modern Haskell effectful streaming libraries actually make reasoning about stream processing much easier than in say Java, where the presence of effects (exceptions etc) destroys reasoning.

> Go is now my favorite language.

Is this really true? Or is it just the tool you are now most familiar with? It's certainly a much more riskier proposition to try and feed the kids writing Haskell.

Quoting Rob Pike on Google's own Go programmers: "They're typically fairly young, fresh out of school, probably learned Java ... They're not capable of understanding a brilliant language ... So the language that we give them has to be easy for them to understand and easy to adopt."

The Go toolset can obviously get the job done, but I don't understand why it would be anyone's favourite language, it doesn't even sound like it's Rob Pike's favourite language.

comment 8y ago · link · parent

I agree, but Monads also simplify non-blocking concurrent programming, allowing users to think sequentially, see F# Async and Haskell IO. C# had to add Async/Await support in the compiler and I would argue it is not as pleasant as the F# version using Monads.

comment 8y ago · link · parent

It's been called the "Lisp Curse", but I don't think it's unique to Lisp. Any highly expressive and productive language is vulnerable to such social problems.

comment 8y ago · link · parent

oneOf looks like it could be used to encode sum types together with a custom string tag, but that's not the first class treatment that records get.

comment 8y ago · link · parent

It's such a shame that many of these standards ignore or are ignorant of the elementary and fundamental sum type. Instead I am left needing to employ some ad-hoc encoding using string tags or similar.

comment 8y ago · link · parent

SQL Turing completeness is generally regarded as a (relatively recent) mistake. MapReduce is only regarded as Turing complete as it is typically programmed using Turing complete languages. In both cases, the validity of many optimisations would be destroyed by any non-terminating behaviour. You could have a situation where a query's termination depends on the optimisations used. IMHO, this is highly undesirable.

Perhaps a better example is the humble Regex. If we have a true regular language, we can optimise it via a DFA to have O(N) runtime. The weak computational model is enabling this optimisation.

comment 8y ago · link · parent

Practitioners are usually concerned about what is true in practice. Weaker computational models have found great success in databases and parallel programming (e.g. Googles MapReduce) because they are easier, in practice, to reason about and optimise.

comment 8y ago · link · parent

Strongly agree. With more constraints in the language, one gains greater power to reason. This is what the Ethereum creators are learning the hard way. I also think folks would be surprised with how much can be accomplished without Turing completeness. For example, merge sort can be implemented as a simple functional unfold, or "primitive corecursion" in a total language.

comment 8y ago · link · parent

> In essence, you can make reproducible builds in docker by controlling the build environment and then specifying particular versions when installing dependencies.

Nix would be an excellent way to achieve this.

comment 8y ago · link · parent

Absolutely! From my point-of-view, Nix is complementary to Docker. Nix is a deterministic replacement for the apt-get commands used in the parent post.

comment 8y ago · link · parent

Those docker commands will install whatever binaries happen to be in the repository at the time they were run. Nix offers deterministic reproducible builds. A non-deterministic build is much harder to reason about.

comment 8y ago · link · parent

Surely the "clean" way to return multiple values from a function is to support returning a tuple. The methods positional parameters already essentially constitute a tuple argument.

Such structural grouping of values however went against OOP dogma at the time, which dictated that every type must have a name. Even after generics were introduced into Java, Sun refused to add even a pair class to the JDK (IMHO the bug report was amusing reading). Perhaps they were also similarly opposed to C#'s features?

comment 8y ago · link · parent

I can assure you that, with practice, Haskell can be a very practical language. Having IO in the types lets one reason about where the effects are happening, which is especially important when trying to solve real world problems with functional techniques (i.e. transforming unreliable streams of data).

comment 8y ago · link · parent

I think it is well known and proven that people upgrade every two years when the contract expires. My claim is only that the built-in battery contributes to this, you are free to disagree, but it is difficult to prove either way. Your ifixit links certainly do not prove battery replacement is easy. Specialist tools are involved, this is how iFixit makes its money.
1
464748
69