Better HN
topnewbestaskshowjobs
Log inSign up

grumpyprole

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

Submissions

comment 7y ago · link · parent

Sure the entire input list will need to be consumed, but not every element of the output will need to be determined if we are only taking the top 10.

Laziness enables many compositions to work efficiently, whereas with a strict language, you'd have to fuse the operations to get the same efficiency. More examples here: http://augustss.blogspot.com/2011/05/more-points-for-lazy-ev...

comment 7y ago · link · parent

This was probably the theory behind their decisions. While I agree that the lack of expressiveness might discourage some incidental complexity, for example premature or unecessary abstractions, the inherent complexity of a problem will remain. Removing expressive power, in general, will lead to ad-hoc and cumbersome workarounds. For example, look what the Kubenetes codebase had to do to work around the lack of generics: https://medium.com/@arschles/go-experience-report-generics-i...

comment 7y ago · link · parent

Sounds like you perhaps have experience of dynamically-typed languages? Haskell is statically typed, compiled, has a scalable multi-threaded runtime, a very good FFI; and was designed around the notion that large programs should be built by composing small programs.

comment 7y ago · link · parent

It's around 10 dollars, but then I have less than 1 TB. I recently starting backing up my RAW files remotely, so this number is set to increase significantly (!) I am very interested in S3 alternatives. I haven't looked at the Amazon Glacier options either, but I suspect the retrieval times make it awkward to query/verify backups.

comment 7y ago · link · parent

I disagree with the author's explanation as to why all questions are algorithmic. I suspect the real reason is due to the US dominance in tech and the popularity of algorithmics in US academia. Indeed the parts of computer science to do with logic, formal methods, semantics, mathematics of program construction etc are, I am told, often described in the US as "Eurotheory". This is a great shame. A new graduate arrives at Google fully trained in algorithms as mandated, but is unlikely to need to implement any of them during their career. It is far more likely that they will need to glue existing systems together, consume APIs, author APIs etc. "Eurotheory" would much better prepare them for this.

As an example, consider that we could be asking questions on API design: get candidates to work through their semantics/axioms (introductory forms to create objects, methods to transform and eliminate them). Get them to write out high-level testable properties such as the way objects compose, associate, commute etc. Using types to enforce invariants etc

comment 7y ago · link · parent

A huge shame. I backup my optical media to S3, but I also use M-DISC "mineral discs" which hopefully will last much longer. Sadly they were not available back then.

comment 7y ago · link · parent

Yes, but it's still a great pity, as Haskell, a descendent of ML (the "meta-language") is a suberb fit for writing a compiler.

comment 7y ago · link · parent

It depends entirely on whether the big project still has an elegant and complete formal grammar. Hand-rolled parsers are only common in industrial languages because many have grown to be far too complex and ad-hoc, requiring e.g. additional analysis and disambiguation during parsing. It is not a situation to aspire to.

comment 7y ago · link · parent

Sounds like he (edit: or more accurately, the university) has hasn't taught them enough functional programming and Haskell.

comment 7y ago · link · parent

I'm a Haskeller, but it's great to see OCaml improving significantly with every release. It's a win for typed functional programming in general.

comment 7y ago · link · parent

My company proxy kept triggering endless Google captcha games. I switched to DuckDuckGo.

comment 7y ago · link · parent

I'm not sure there is consensus that Mars is much more likely to have had life. As the article states, Venus had liquid water for 3 billion years versus 400 million for Mars.

comment 7y ago · link · parent

Using C# as an example, foreach and IEnumerable are baked into the language as is try/catch and more recently Async/Await. These are all just library functions in Haskell and often more general (e.g. forM in Haskell works for any Monad not just IO). Because they are library functions they can be changed/customized very easily. In C#, how could foreach be made to support a different stream type, exceptions be made checked or Async/Await be made to suspend across stack frames?

For this reason, Haskell is probably closer to a general purpose language than many of the imperative systems programming languages (especially Go).

comment 7y ago · link · parent

> if you see Spring as existing to correct issues with the underlying Java language, then I'm highly skeptical that you've ever had meaningful experience with either one.

Let's please avoid personal attacks if at all possible. Spring started out with the dependency injection framework and "aspect-oriented programming". It was marketed as an alternative to EJB. Web frameworks and other add-ons came later. If you don't see DI and AspectJ as working around Java's weaknesses, then I encourage you to try a more expressive language.

In an expressive language (e.g. Clojure or Haskell), DI and AspectJ could be, for example, replaced by reifying a program as data and using modular interpreters. One interpreter using mock data, another talks to the database, uses transaction boundaries and logs. This sort of solution is unfortunately just not very practical in Java.

comment 7y ago · link · parent

Firefox on mobile has improved enormously since Quantum. It works well enough to ditch Chrome.

comment 7y ago · link · parent

Yes it seems strange to me that a Java developer is willing to learn Spring, a massive ad-hoc framework which exists in part because of Java's weaknesses, rather than functional programming and Clojure (a lifelong skill that will benefit their Java programming).

comment 7y ago · link · parent

> Many static languages have no dynamic types, I think that's worse.

I can't think of a static language that doesn't support a dynamic type, it's just that most require explicit casts or unpacking to use with existing typed interfaces, e.g. "Object" in Java.

> Strongly typed used to mean safe

It still does, it's just that type theory doesn't distinguish between a runtime failure with a nice error message versus a segfault, both are programs that "go wrong".

I would be in favour of "strong dynamic types" instead of "strongly typed".

comment 7y ago · link · parent

From a type-theoretic point of view, Python is unityped: https://existentialtype.wordpress.com/2011/03/19/dynamic-lan...

Python has a lot of merit as an easy to use language, a modern BASIC, but "strongly typed" is marketing that confuses rather than enlightens (to quote Prof. Harper). The term "strongly-tagged" is perhaps more apt, but sadly that ship has sailed.

comment 7y ago · link · parent

Hopefully carefully considered and well-designed technology will prevail. In this industry we are often too eager to endorse the first-mover as the standard.

comment 7y ago · link · parent

It's easy to forgot the benefits of laziness: http://augustss.blogspot.com/2011/05/more-points-for-lazy-ev...

Laziness is a good default for declarative programming. Nix from NixOS is an example of a recent lazy language and benefits greatly from it.

Even in strict languages, lazy behaviour is often added, for example iterators and streams. Mixing effects and mutation with such constructs is also problematic.

comment 7y ago · link · parent

History is littered with purpose built languages and notation for mathematics, logic, music and law etc. A language guides (or limits) one's thoughts, offering a particular set of abstractions. Functional programming is very close to logic and particularly amenable to mathematical reasoning and static analysis - exactly what one needs in order to safely compose large programs from small ones.

comment 7y ago · link · parent

By "major options", I guess you mean popular/mainstream options?

comment 7y ago · link · parent

Haskell is an excellent example of a community-driven language. It's more mature and advanced than most commercial offerings too, offering a superior type system, fast and efficient executables, lightweight fiber concurrency, software transactional memory, higher-kinded parametric polymorphism and many more features.

comment 7y ago · link · parent

Intel certainly does not know how to build a secure CPU.

comment 7y ago · link · parent

> That's true (and will be addressed)

Glad to hear it! It's probably the biggest issue trying to do functional programming on the JVM.

> There is no difficulty supporting that. In fact, the Java language is about to get that without JVM changes.

The technique to implement ADTs in functional languages on the JVM has often been to add an integer tag to every subtype and switch on that, but it's ugly enough for interop that IIRC Scala doesn't do it (and is thus less efficient).

comment 7y ago · link · parent

> What are the restrictions on F# that were posed by them?

It does make it harder to add features to the language that do not map to the current reified "generics" spec, for example higher-kinded polymorphic types.

Of course, the JVM has plenty of issues supporting alternative languages too, for example lack of tail-call optimisations, or switch-on-type, for functional languages.

comment 7y ago · link · parent

I was not comparing Flash to the JavaScript of the era, just pointing out that, as an end user, Flash didn't seem "fast" to me (on Linux, Android and OSX). Performance on a desktop-class CPU is also only one metric. Flash was clearly inefficient, it didn't use multicore, GPUs or hardware decoders. Was your Quake2 demo above using even OpenGL? Java applets could do that since well before 2008. The original Quake2 could do that in 1997.

> Care to guess why it was a flash-based game and not an HTML5 based game?

Anything would have been better, even bare HTML tables with no animations. The user experience of Facebook Flash Scrabble was awful (at least on OSX).

comment 7y ago · link · parent

All good points. But I'm still struggling with the idea of using the word "fast" to describe a technology that brought a 2GHz GPU-accelerated machine to its knees with Scrabble. Perhaps "sucked less than JavaScript"?

comment 7y ago · link · parent

Which bit was fast? My wife's MacBook sounded like a jet engine whenever she would play the Facebook flash-based Scrabble. Eventually the machine died of fan failure and I had to spend an entire afternoon doing brain surgery on it. I wasn't surprised when Jobs subsequently banned it from the iPhone!
1
363738
69