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

Don't let the age of emacs fool you into thinking it is somehow less relevant. Simple and good ideas are usually old. Compare the complexity of writing a "plugin" in Visual Studio or Eclipse. Similarly the command-line is here to stay.

There are packages such as "which-key" that can help by providing popup choices.

comment 10y ago · link · parent

I think it is more correct to say that software security is not a priority. Another issue is why the US connect highly sensitive systems into the internet in the first place.

comment 10y ago · link · parent

Abstract over and guard against external messy systems at the boundaries. Static types help with this just as much as enforcing invariants and consistency, at least with a good language.

comment 10y ago · link · parent

I believe the issue is that C++ does not track what are, and are not pure functions, so the ordering optimisation is, in general, unsafe.

comment 10y ago · link · parent

Programming with Monads, e.g. the IO Monad, is pure functional programming. It is a common misconception that it isn't. You have full referential transparency and sound composition, since no effects are actually performed until the computation is run/interpreted.

comment 10y ago · link · parent

Haskell is absolutely capable of mutation, it's just controlled and tracked. IMHO, immutability is simply a saner default for a high-level language. I think languages "win" due to socio-economic reasons, not technical ones.

comment 10y ago · link · parent

No I haven't read any of it. Is it even finished yet? I would still try Graham's book first and see how you go.

comment 10y ago · link · parent

This is the Haskell tutorial book that I have always recommended. It's a manageable size and is a good blend of theory and practice. There's also none more qualified than Graham Hutton.

comment 10y ago · link · parent

Having thought about this further, I think it is probably only correct of me to talk about the "order" of "functionals" as in functions to scalars in mathematics. The term "rank" is better suited here. Category theory supports the popular definition of higher-order function and gives a different meaning to "order". So make-counter is rank-1 but still higher-order. Apologies for the previous post.

comment 10y ago · link · parent

No its disputed, for the reasons I gave. But I've already accepted that many regard make-counter to be a HOF. I was careful and said make-counter is not a second-order HOF, which Strategy is.

Callcc can be implemented as a function, no continuation primitives needed. Haskell has examples in its libraries.

Lastly, regarding semantics, I see no difference between Strategy and a second-order HOF. Yes the scope of Strategy is supposed to much more limited, but I don't see value in this. I concede that others might do.

comment 10y ago · link · parent

Well Java didn't add lambdas to write make-counter, it was map and fold that got them envious. In fact, IIUC mathematically make-counter is first-order, counting the nesting of funtion types. In other words, I don't understand why many describe it as a HOF at all. Map and fold are second order. Callcc, ignoring its Scheme implementation as a macro, would be third order. One could argue that the second order argument to callcc is strategy, with the continuation being the strategy.

comment 10y ago · link · parent

I asked for an example of Strategy that wasn't just a HOF, but I now see you do agree with this. Yes your example is technically a HOF as it returns a function. So I guess your point is that HOF is not specific enough, although one might argue that in general usage it usually does imply function-value arguments.

comment 10y ago · link · parent

I never said a Functor was a HOF, but it's not far wrong. The implementation of the morphism-mapping part of a functor is a higher order function. Show me an example of Strategy that is not essentially a HOF.

comment 10y ago · link · parent

There is a name for "strategy pattern" that existed long before the GoF book: higher-order function. But what's worse, in that it causes confusion, is when names are repurposed, "Functor" is a useful abstraction in programming, but is not related to your usage above.

comment 10y ago · link · parent

The danger of "intuitive" names and analogies is that they often don't capture the generality of the abstraction and can limit ones thinking. The mathematical terms are useful and communicate precisely and unambiguously (e.g. if someone says X is a Functor then I assume the Functor laws are satisfied). Ignoring established terminology creates insular communities and creates confusion (e.g. a C++ Functor versus a mathematical Functor, C void versus type theory void). I agree that better books and learning resources are needed, but changing names is anti-intellectualism, IMHO.

comment 10y ago · link · parent

The mathematical terminology that you dislike has already been well established and well defined after decades of use in many formal publications. It will probably be continued to be used for hundreds of years. In no way is "Enterprise Java Beans" analogous.

comment 10y ago · link · parent

I'm guessing he mean't static type system. This is the formal meaning of "type" in programming language theory. What you describe is a system of runtime tags.

comment 10y ago · link · parent

First of all, a Ruby developer would need to be convinced of the value of static types, in his/her domain. For the maintenence of large complex systems, they are invaluable, for web development perhaps less so. Advanced type systems simply allow one to statically verify more invariants, or in the case of higher-kinded types, allow one to make more sophisticated abstractions and reduce boilerplate. It's important to remember that every statically typed language is capable of being dynamically typed also. I can use string-keyed dictionaries and runtime tagged types in Haskell if I ever need to. What you loose is ease-of-use, which I guess is why Ruby is more popular than Haskell.

comment 10y ago · link · parent

These terms do have fairly precise meanings in the FP community; there are many papers on the subject that define shallow versus deep as I described. For example: http://www.cs.ox.ac.uk/publications/publication7584-abstract...

comment 10y ago · link · parent

I think you mean deeply embedded DSLs (as per my earlier comment)? Shallow DSLs implement semantics directly, having only one interpretation and don't have abstract syntax (the AS in HOAS).

comment 10y ago · link · parent

HOAS is particularly nice as a surface representation for deeply embedded DSLs, especially when combined with GADTs or tagless-final style. But you'll likely want to transform to e.g. DeBruijn indices for optimisations, low-level codegen etc

comment 10y ago · link · parent

A quick Google suggests Scalajs has had developers paid to work on it (EPFL lab and Lightbend): http://scala-lang.org/blog/2016/03/14/announcing-the-scala-c...

The Haskell community has achieved great things even though most contributions are done in people's spare time. That is determination.

comment 10y ago · link · parent

That is down to who has the most funding. Javascript itself has even more "support, completeness and maturity" than Scalajs. But obviously that's not the deciding factor.

comment 10y ago · link · parent

I don't see being strict or lazy as being the main source of the size of the deployed code (especially as Ghcjs inherits an excellent strictness analyser from GHC). Scalajs would have to emulate many JVM characteristics and port many JDK classes. Then you have huge core Scala libraries like collections, which are far larger and more complex than the Haskell equivalents. You will have to back up your argument with numbers to convince me. You also haven't elaborated on your comment about "imperfect semantics".

comment 10y ago · link · parent

Your hunch is correct, I have not really used either, I'm just generally interested. From a distance, they both appeared to be ambitious and somewhat immature. I'm curious about your comment regarding tricky interop and "imperfect semantics" of ghcjs, could you elaborate? Certainly laziness does make FFI harder, but I wouldn't call that a problem with the semantics.

comment 10y ago · link · parent

By what measure is Scala.js more production ready than ghcjs?

comment 10y ago · link · parent

It's great that Google is highlighting the importance of power efficiency as a major part of their justification for killing flash. Now they need to fix Chrome itself: http://www.theverge.com/2016/6/20/11975514/microsoft-chrome-...

comment 10y ago · link · parent

Purescript cannot type a record merge or join. Haskell with type families can, but the syntax would not be very pretty.

comment 10y ago · link · parent

Scheme has little to offer out-of-the-box as a basis for Nix. It has no convenient syntax or suitable implementation for extensible records, which is the core data type of Nix.
1
636465
69