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

You had better stick with Agda or Coq then ;)

comment 8y ago · link · parent

Linux users expect not to be locked-in and controlled. Perhaps if vendors tried different revenue models, such as sponsoring new features or charging for support/bug fixes. Over the last few years I have spent several hundred dollars in donations to free (libre) software. We are not all cheapskates :)

comment 8y ago · link · parent

> Only by social convention. Not enforced by the language's semantics

Many FP languages do not enforce purity (OCaml, F#, Clojure). Even in Haskell, one could use IO and IORefs everywhere, the semantics fully permit writing "Java code" in Haskell. We need a culture and an understanding of what it means to write idiomatic Haskell.

EDIT: responding to your edit:

> The problem here is the inability to do functional programming. The reasons for this are technical, not cultural.

Yes. But it's not just problems with semantics, it's also the syntax, defaults and available libraries. Culture feeds into all of this, especially as the language and ecosystem evolves. I'm arguing that it does matter.

comment 8y ago · link · parent

> Culture matters very little. What really matters is what the language's semantics allows.

I disagree. Java's semantics permit defining pure functions, immutable values and persistent data structures, but the "culture" is biased towards idiomatic Java not FP. The languages syntax, defaults and core libraries can make it difficult to program in an FP style. The syntax, defaults and libraries will not change while the culture persists.

comment 8y ago · link · parent

The problem with "traditionally functional stuff" was that one could only use functional programming for a subset of problems. Monads allow Haskell programmers to use FP to solve problems involving IO, mutation and effects. This is not redefining FP, it is extending it to a wider class of problems.

comment 8y ago · link · parent

Completely agree. Anyone interested in functional programming should learn Haskell for this reason alone. Skip the blog post that falsely claims a "functor is a box" or a "monad is a burrito" and go read the original papers.

comment 8y ago · link · parent

I agree, but a trackball will give you the fast and precise movements you say a trackpoint doesn't give you. You'll also be able to move your hands less compared to using a mouse.

comment 8y ago · link · parent

Have you tried a trackball? I use a Kensington Slimblade with my multi-monitor setup at work and I find it far superior to a mouse.

comment 8y ago · link · parent

It's LPDDR3 (low power). I'm guessing the Intel chipset does not support LPDDR4.

comment 8y ago · link · parent

The X1 Carbon has low power LPDDR RAM which means it can sleep for a lot longer with minimal battery drain. This is a very useful feature for me, as my laptop is almost permanently sleeping.

comment 8y ago · link · parent

They have been making the trackpad bigger. But the Apple MacBook trackpads keep getting bigger also, perhaps because a trackpad can never be big enough? Rather than try to copy Apple, I would rather they keep the design as-is.

comment 8y ago · link · parent

You'll have to take the trackpoint from my cold dead hands... I find it superior to a trackpad, as I don't have to take my hands off the keyboard.

comment 8y ago · link · parent

Read the article again. He says Python is unityped. The word "type" in mathematics and computer science has a meaning which is not the same as your usage of the word.

Well-typed programs should not go wrong. Python programs can crash at runtime due to simple type errors (expected integer but got a string). A crash is a crash, from a theoretical point of view it matters not that the error is prettier than a segmentation fault. Python is not strongly typed, it just has good error messages.

comment 8y ago · link · parent

Python only has one type. To quote from the article by professor Harper:

"And this is precisely what is wrong with dynamically typed languages: rather than affording the freedom to ignore types, they instead impose the bondage of restricting attention to a single type! Every single value has to be a value of that type, you have no choice! Even if in a particular situation we are absolutely certain that a particular value is, say, an integer, we have no choice but to regard it as a value of the “one true type” that is classified, not typed, as an integer."

comment 8y ago · link · parent

Haskell. For programming with immutable values and pure functions, beautiful succinct syntax and strong types. Strong types ensure correctness, but in Haskell, they also help me reason about where and when my effects (such as IO) are happening,

Haskell is now the current inspiration for many object-oriented languages like C# and Java:

http://wadler.blogspot.co.uk/2012/09/brian-goetz-on-future-o...

comment 8y ago · link · parent

> You do know that not every dev is C dev?

C libraries are often transitive dependencies of higher-level language libraries, e.g. for Haskell or Python. Using language-specific package managers often fails to properly handle such transitive dependencies.

> look up OS usage among developers

This doesn't indicate personal preference. My whole team is forced to develop on Windows at work, we would all rather use Linux, as we deploy to Linux and our tools, e.g. Git, work better on Linux. But such are the constraints of working in a corporate environment.

I use a Linux development environment for my personal projects.

comment 8y ago · link · parent

> Its up to the developers to make their programs safe and reliable. No language to date will do that for them.

But languages do make a huge contribution. For example, Rust, Ada and Modula-3 are all much safer by defaults alone compared to C. Most Rust code sits outside unsafe blocks, so the existence of this feature does not prove there is no point to Rust.

comment 8y ago · link · parent

> There is no need to prove that because it's quite obvious that C is fine.

No. It is quite obvious to anyone rational and without a vested interest that C is no longer fit for purpose in this modern age.

> I have no idea why you've developed an irrational hatred of C

Let me guess. He's sick of patching security holes, memory leaks and crashes?

comment 8y ago · link · parent

Can you easily accomplish the following with Windows?

- install a dev environment with all tools and transient dependencies with a single command

- install multiple versions of the same library and easily choose between them

- install the same version of a library but built with different compiler switches

The world of open source operating systems can accomplish all of the above (I use NixOS). And we get access to a repository of thousands of packaged tools. And we get fast Git.

I'm sorry but the general consensus is that Windows falls quite short of being a nice development environment, despite the existence of Visual Studio.

comment 8y ago · link · parent

> How is reverse debugging working out for Haskell then?

The Elm debugger I posted above is a perfect example. Unlike your GDB example, it doesn't only work for a subset of x86 instructions or require monumental effort to implement. It's a high-level domain-specific debugger, that was simple to specify and build. For those of us that want to write high-level code with many layered abstractions, working one-word-at-a-time using GDB is simply not a great way to debug, even if it does now sometimes work backwards. We want to easily build our own debuggers.

comment 8y ago · link · parent

That's quite a bold promise, when in theory any statement could "launch the missiles". Just like software transactional memory, this idea, AFAICT, really needs pure functional programming to work well.

comment 8y ago · link · parent

Functional programming actually opens up more opportunities for debugging, as we are better able to both reason about and transform programs. The caveat is that often we need to build domain-specific debuggers, to effectively debug our high-level domain-specific code. Even in imperative languages like C++ and Java, the standard word-at-a-time debugger gets increasingly less useful as abstractions are piled up. Multiple threads really throw a spanner in the works.

Here's an example functional debugger that can step forwards and backwards in time, as well as modify code at any time:

http://debug.elm-lang.org

comment 8y ago · link · parent

Having package maintainers touch any code, even to backport security fixes, is far from ideal.

In 2006, a big security flaw was introduced into Debian's OpenSSL by the maintainer, because he changed code that he did not fully understand. The flaw wasn't discovered until 2008:

https://www.schneier.com/blog/archives/2008/05/random_number...

comment 8y ago · link · parent

Not to my house it isn't. I made the mistake of fitting a "smart" connected thermostat a few years ago and it's simply not reliable enough. I've also no idea as to how secure it is (or isn't).

comment 8y ago · link · parent

I am assuming "ListT done right" not the deprecated one (which is not even a chain of actions). Here is a definition, to be completely clear:

newtype ListT m a = ListT (m (Maybe (a, ListT m a)))

It is a nice simple example of an effectful streaming type.

> Also, by it's nature ListT can't stream IO

This is only true of the deprecated one, which is also misnamed. The community is rightly re-using the name for the behaviour shown above. See list-t on hackage, or the implementation that comes with Pipes.

comment 8y ago · link · parent

> I don't think it really makes sense to call the way side effects happen in Haskell "lazy".

I didn't actually say this. I was suggesting a lazy chain of IO actions for such problems. For example, ListT a IO, instead of a regular lazy list with hidden side-effects. The Haskell types help make the distinction clear.

> Instead, your program returns a pure structure which describes how side effects should be executed

Yes exactly, the pure structure can still be computed lazily on demand, providing IO actions.

My favourite Hackage streaming library for Haskell is "streaming" and it can work exactly this way.

comment 8y ago · link · parent

In Haskell it is still of course pure functional programming to have a lazy stream of IO actions. The types make it clear when and where the IO is happening, which makes reasoning about effectful streaming much easier.

comment 8y ago · link · parent

It's the wrong choice, since they defined x+null=null and ignoring missing/undefined/error values (which null often represents) is dangerous in many domains. Users could have always filtered nulls manually, which would have made this dangerous behaviour explicit.

comment 8y ago · link · parent

> NULL is the absence of a value. It has no meaning in algebra.

Null is a value in its own right. If null is added to e.g. the type of numbers, then it had better be given meaning (i.e. semantics).

> You cannot do anything mathematically with a NULL value so it always results in a NULL output

Returning null if any input is null seems reasonable, but again this is not true with SQL SUM: SUM [1, null] = 1.

> Where is the inconsistency

You seriously cannot see an inconsistency? Are you trolling?

> It seems you want the database to automatically assume 0 for NULL

Where on earth did you get that idea? You are defending the behaviour of SQL SUM, not me! I've already told you, I don't want coercions.

comment 8y ago · link · parent

The context was the standard declarative SQL query language. I can't define stored procedures in my SQL query to your database, so I have to use something like LINQ to compose larger queries from smaller ones.
1
454647
69