4,485 karma · joined Jun 30, 2015 (11y ago) · 2,043 submissions
comment 8y ago · link · parent
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
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
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
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
comment 8y ago · link · parent
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
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
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
> 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
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
comment 8y ago · link · parent
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
comment 8y ago · link · parent