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