Better HN
topnewbestaskshowjobs
Log inSign up

grumpyprole

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

Submissions

comment 3y ago · link · parent

> I find Odersky's "values" or approach to programming language design much more in line with my own.

Odersky's "values" primarily appear to be whatever will appease the masses, which is why Scala started with curly braces and OOP. So much of his intellectual capital has been spent on trying to combine objects, subtyping and FP, that I can't help but feel it could have been better spent elsewhere. Folks are moving on from OOP. Scala is in danger of building what people once wanted, but don't want any more. IMHO there are better ways of bringing first-class modules to FP (e.g. see the 1ML paper).

comment 3y ago · link · parent

> I thought (from what I've read so far) that "no mutable state" is the definition of "pure FP".

It's much more nuanced than that, certainly no arbitrary and unchecked mutable state is. There are ways though of achieving mutable state whilst maintaining referential transparency.

comment 3y ago · link · parent

It might be "overly complicated" in Scala, but it works very well in Haskell and allows effects to be controlled, checked and reasoned about. In fact, monads were originally proposed to give formal semantics to imperative programming. Scala is really an object-oriented language, first and foremost, so please do not judge functional programming based on how it looks in Scala.

comment 3y ago · link · parent

Pure functional programming is really about tracking and controlling effects by making them first-class, not avoiding them altogether. This has numerous benefits for reasoning, correctness and optimisation. Haskell allows mutable local variables, 'ST' references which can be used to build functions that are observably pure on the outside. The Haskell type checker will guarantee that no mutable state escapes. This is true "state encapsulation". It is completely acceptable for pure FP programming.

comment 3y ago · link · parent

> it was compatible with almost no existing programs

I'm not sure where you got this from. When I used it, I didn't observe any compatibility problems.

> unlike Apple’s contemporary offerings

Apple have a history of breaking third party apps, far more than Microsoft.

comment 3y ago · link · parent

Yes my work ThinkPad won't sleep either, broken from day one. Maybe we'd have better luck on Windows 11.

comment 3y ago · link · parent

NT4 was a rock solid release actually and significantly more stable than anything Apple offered at the time.

comment 3y ago · link · parent

If one is forced into writing code that needs to be fast in a language other than Python, then I'm not sure I understand why Python gets to claim any credit?

comment 3y ago · link · parent

OCaml would have been awesome for scientific computing, had it got enough adoption.

comment 3y ago · link · parent

You do realise that your Apple phone slows down precisely because the battery is less able to deliver high current bursts? This is the reason Apple gave for intentially slowing down phones.

comment 3y ago · link · parent

> Seems quite reasonable to me, we've got a world-leading chip team who have been doing great work responsible for a pretty major cock-up.

You mean had a word beating chip team. I heard that the M1 team pretty much all left.

comment 3y ago · link · parent

Both lambdas and generics did not ship with Java originally. Yes Java moves slowly, but it would move even more slowly if they waited for published studies proving the productivity gains of these features.

comment 3y ago · link · parent

> Sadly there’s very little evidence supporting productivity differences between programming languages, especially in bigger real-world contexts.

Only because it's almost impossible to quantify and is so contextual. However there is a good reason why Java is getting many extra language features from functional programming, e.g. streams, records, "sealed classes", pattern matching. Yes, productivity. Personally I am far more productive in OCaml, Haskell and Rust than Java; and that's after spending many years getting a lot of Java experience. But these are not necessarily good choices for the risk averse, which really comes down to the real reason why you chose Java.

comment 3y ago · link · parent

If that is because of static types then I might agree with you, however once Spring and other reflection-heavy frameworks are added to the mix then I'm not so sure. Java's biggest problem is not the boilerplate, but the culture of over-engineering.

comment 3y ago · link · parent

I really hope my bank runs cobol rather than any of this spring bean junk.

comment 3y ago · link · parent

Elisp is really easy though, far easier than trying to write a VSCode plug-in.

comment 3y ago · link · parent

I've been using Emacs for over 25 years, sadly I missed this survey.

comment 3y ago · link · parent

And also the adverts of sick babies who would not get the funding they needed if the money was spent on implementating proportional representation. A similar lie was used to sell Brexit.

comment 3y ago · link · parent

This is a really good point, but one still doesn't need curly braces and semis. Despite having a lightweight syntax, OCaml isn't indentation sensitive, so doesn't suffer from this. The Ocamlformat tool also works really well.

comment 3y ago · link · parent

One that I use is the unison sync tool

comment 3y ago · link · parent

It works great in Haskell. The problem is that it really needs typed effects, hopefully OCaml will get typed algebraic effects at some point.

comment 3y ago · link · parent

There's nothing "modern" about the C-style curly brace and semi-colon syntax in Reason. In fact, the rise of Python and it's lightweight syntax means that C-style languages are starting to look dated.

comment 3y ago · link · parent

> Autoparallelization, like autovectorization, doesn’t work.

I think concurrency is more of an issue for games and was the example I gave (Haskell's transactional memory for concurrency is a great example of what pure-functional buys you). Nethertheless autoparallism can work, if you again are prepared to accept more constrained declarative languages. Apache Spark is a great example, it offers a constrained functional language with maps and folds, that is autoparallized across a cluster of machines. The research language NESL (nested data parallelism) is even more impressive.

comment 3y ago · link · parent

Most mainstream programming languages are designed as if we are all targeting 70s von Neumann machines. When applying these languages to e.g. highly distributed or concurrent architectures, they are no longer a good fit. It's great to see at least an attempt at innovation rather than just a Java clone, which is all Google and Microsoft have ever offered so far.

comment 3y ago · link · parent

I agree with your points above. Apologies for being grumpy.

comment 3y ago · link · parent

Glad to see it and more important than implementation language I think.

comment 3y ago · link · parent

> What does that have to do with the choice of programming language?

It's more important than the choice of programming language. Not all C++ is fast.

> You can't implement an incremental compiler in Zig?

I never said this. This is a thinly veiled ad hominem.

comment 3y ago · link · parent

Writing the initial compiler in C++ is a rather surprising choice. My time would be too precious for that. OCaml was a good choice from the Rust devs and had a nice influence on the language. Rust has proper algebraic data types and pattern matching.

comment 3y ago · link · parent

> The Zig developers would strongly disagree that a compiler is not a performance-critical application,

Have they written am incremental compiler then? Or just an old-fashioned slow batch one? Compiler architecture matters much more than whether it's runtime has a GC or not.

1
141516
69