Better HN
topnewbestaskshowjobs
Log inSign up

grumpyprole

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

Submissions

comment 10y ago · link · parent

IMHO, Nix needs a static type checker far more than it needs parenthesis or syntactic abstraction. The syntax of Nix is a non-issue.

comment 10y ago · link · parent

Can you explain "more effective"? The 2016 Thinkpad X1 Carbon is significantly lighter than any MBP and still allows a user to replace the battery using a screwdriver - they are consumables after all.

comment 10y ago · link · parent

It's obviously all subjective. Personally, compared to Lenovo, I find MacBookPro keyboards to be "junk". I also don't want a glossy glass-covered screen, a glued-in battery or a heavy dent-prone radio-attenuating metal case. Each to his/her own.

comment 10y ago · link · parent

You will never see this configuration from Apple. It is not a market they are at all interested in.

comment 10y ago · link · parent

Unfortunately Windows has much better hardware support (e.g. Skylake laptops, multi monitors via displayport MST).

comment 10y ago · link · parent

I'm not sure anyone would be impressed by Python via command line and nano/pico, beginner or otherwise. An interactive notebook with graphics/animations would be the best introduction. Something like this: http://haskellformac.com

comment 10y ago · link · parent

C is the right choice for some performance critical domains, but productivity will be a long way from what a Haskell developer can achieve, especially when concurrency is thrown into the mix. IMHO, I think you are overselling C.

comment 10y ago · link · parent

It very much depends on how far you want to take your functional programming. If you want to make heavy use of purity, monads, type classes, tail recursion etc, you will be much better off in Haskell.

comment 10y ago · link · parent

As soon as you run more than one thread, you'll have to worry about memory barriers, cache coherency, processor affinity etc. Even with one thread, modern IO and system calls are highly asynchronous. Not the sort of machine that e.g. C or C++ was originally envisioned for.

comment 10y ago · link · parent

A better example would be any modern SMP x86 machine. These use a quickpath bus to connect distributed memory and cpu, basically a cluster. Intel goes to great pain to give the illusion of a von Neumann machine, but it's a leaky abstraction.

comment 10y ago · link · parent

Ah yes Clojure, Citigroup had a team of 70+ fulltime Clojure developers in Credit last I heard. The examples I'm giving are all strategic commitments to FP by senior management. The Google situation sounds more likely to be viewed as a "problem" by them as (last I heard), Clojure was not on their white list.

comment 10y ago · link · parent

Not in all banks. Standard Chartered and Barclays have probably the largest Haskell codebases in existence. Many others are investing in Scala (e.g. Morgan Stanley). It's probably more of an alien concept to the likes of Google and Amazon.

comment 10y ago · link · parent

I can't help but feel that there is too much focus on data structures and algorithms. My kids have Amazon Fire Kid tablets and Amazon's software is, to put it mildly, unreliable. I'm sure the data structures and algorithms are probably fine, they're mostly shipped with the plethora of open source that most software is now built from anyway.

comment 10y ago · link · parent

Yes, nice example. Structural typing is a good fit for typing list/map centric code common in dynamic languages. It's probably Nominal typing that the dynamic proponents have rejected.

comment 10y ago · link · parent

Like PureScript, Elms record system is very simple, it is extensible, but for example it cannot type a SQL join. It is possible to type a SQL join in Haskell using type level sets/maps and type families.

comment 10y ago · link · parent

Yes it does partly, but it's mostly nominal. The records are extensible but they cannot type a SQL join (record union) and there are no structural variants. Ur/Web is probably a better example, but I'm not sure it's active.

comment 10y ago · link · parent

How would you type a projection or join operation with nominal typing? You could define and name a set of additional result types, but this is very cumbersome, the type system can and should compute the result type for us.

comment 10y ago · link · parent

What I want to see is a functional language that embraces structural typing and extensable records/variants, instead of nominal typing. This would be an excellent fit for a world full of SQL databases and JSON documents. It would also be a considerable implementation challenge!

comment 10y ago · link · parent

This is an impressive effort, but one major problem is that the Python runtime lacks efficient support for tail calls. I see that there is an annotation for self-recursion, but this is only a special case. Scala has a similar problem with the JVM. Still, it does permit a nice functional syntax above perhaps lower-level imperative code.

comment 10y ago · link · parent

I've just now watched the talk [1], thank you for the link, but I feel his conclusion actually backs up my position: "Pure, strict functional programming is a very short path from a program to a correctness proof". Admittedly, the tooling in this area has yet to arrive. But for a bespoke contracts language, I wouldn't be put off by that.

comment 10y ago · link · parent

That looks like a great talk, I hope it will be recorded.

comment 10y ago · link · parent

The confusion here is that you repeatedly seem to misunderstand my point, perhaps that is my fault as I do not have the time to write very carefully (e.g. I've used "Turing Machine" as a cheap shot at imperative programming). You even stated it yourself earlier "because our programs are most certainly not TM-equivalent". If you agree that most programs do not require Turing equivalence, then you must surely understand my main point, which is why provide powerful expressive languages that, for example, do allow Turing complete computations. Does a contract language, or even a systems language need to really support Turing completeness? You seem to argue that it doesn't matter. I think it does.

comment 10y ago · link · parent

I can assure you I understand what a Turing machine is. I brought them up because the less powerful abstract machines you mentioned are not sufficient to (fully) express Ethereum or most other mainstream imperative languages. You seem to argue that imperative programming is just as mathematically rigorous as FP, because one can have abstract state machines in mind, yet strongly object when I compare Ethereum to a Turing Machine. You also appear to suggest that formal verification has no problem dealing with computations that require Turing equivalence (by dismissing my point as 'false') and then state that Turing Machines have no place in formal verification. If I sound mixed up it's because I'm trying to make sense of your position.

> Everything is "Turing equivalent"

This doesn't make any sense. As you say, there are less powerful automatons. A programming language does not need to support universal computation, for example Unix RegEx.

I cannot disagree that imperative programming is more popular, but again that is no proof that we are better of using them is we want to easily build correct software.

comment 10y ago · link · parent

> When are Turing machines ever involved?

Most software is written in imperative Turing equivalent languages, so Turing Machines are involved all the time. The fact that most verification software is not capable of dealing with them, demonstrates a language issue. Which is the point I have been trying to make.

> It isn't. Logic was applied to programs long before FP was in vogue.

I'm advocating modelling contracts with Logic, instead of Turing Machines as used by Ethereum. I didn't mean to create a tribal boundary by using the term FP.

comment 10y ago · link · parent

It's worth pointing out that most of the formal methods you have linked to involve contracts or specifications as separate stratified layers written in various logics. No Turing Machines involved. This is essentially functional programming as far as I'm concerned. The advantage of the dependant-type approaches like Coq and Agda, is that the language of proof and implementation is now one of the same, but I was not necessarily advocating their use as you seem to have assumed. Even without dependent types, a total functional program can serve as both an executable specification and a logic with which one can derive proofs from (e.g. via an SMT solver). This is what I meant when I said functional programming is more amenable to formal methods. So any tool that uses dataflow analysis to convert imperative programs into functional ones, or requires me to write functional programs to describe what the imperative program should be doing, doesn't provide a counter argument in my mind. Finally, in my very first comment, I provided a link to a startup who are planning on using FP and SMT solvers for formal verification of blockchain contracts, so watch this space...

comment 10y ago · link · parent

I mentioned Lexifi, a contract language, which is based on OCaml and is not imperative. I restricted my argument to Europe as we appear to be less commercially influenced (e.g. MIT teach freshmen Python, Oxford teach Haskell). Predicting the future is always subjective. I offered only my opinion.

comment 10y ago · link · parent

I see parallels here with UI code that is very imperative in nature, but FRP and similar approaches are showing great promise in creating abstractions for reasoning.

comment 10y ago · link · parent

Of course most of the money has been funding tools for imperative languages as that is the status quo. But this does not prove that there is little overlap with FP. Research FP languages like Coq have enabled INRIA to build a fully verified C compiler (Compcert), can your tools accomplish this? As far as Europe is concerned, FP does appear to be the future of formal verification.

comment 10y ago · link · parent

I agree. I covered this only briefly under 'formal methods'. My point was that such formal semantics and proofs are far more easily obtained starting from a functional language.
1
646566
69