Better HN
topnewbestaskshowjobs
Log inSign up

grumpyprole

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

Submissions

comment 4y ago · link · parent

> Given empirical studies, the current working hypothesis should be that if static types do have a positive effect on correctness, it is a small one.

Which use cases, languages and static type systems are you referring to? The context is very important, especially when seeking to draw general conclusions from empirical studies.

As someone who has previously posted extolling the merits of static analysis, I'm very surprised at your position regrding static types. Static types help to constrain a language and enable reasoning, either by additional static analysis or otherwise.

It is precisely the flexibility of dynamic languages that makes them difficult to reason about and difficult to build correct software in. This is why the use of dynamic languages are mostly banned in the defense industry.

Static types clearly help with composition (one of the complaints with Julia), especially at scale. How many academic empirical studies considered multimillion-line code bases? I submit for evidence a lot of expensive type-retrofitting projects such as Facebook Hack, Microsoft Typescript or Python types, which demonstrate that many companies have or had real problems with dynamic languages at any kind of scale.

comment 4y ago · link · parent

> Everything has correctness issues somewhere.

Yes but Julia is (yet another) dynamic language, presumably for "ease of use". A language with static types would have made it easier to build correct software (scientific code in e.g. OCaml and F# can look pretty good). Julia chose a path to maximize adoption at the expense of building a reliable ecosystem. Not all languages choose to make this trade-off.

comment 4y ago · link · parent

Java is also a messy language and the reason for a lot of the mess in Scala. If you want elegance, then you should probably learn something like Haskell.

comment 4y ago · link · parent

Sometimes it isn't desirable to scatter the logic across many classes, or conflate the data and the handling. The Java world has the "visitor pattern" to help deal with that, but its double-dispatch is clunky, complex and verbose. Pattern matching just generalises switch and makes it more useful. Java is genuinely a better language with this change.

comment 4y ago · link · parent

There's more to a compression standard than benchmarks and ratios. Xz does not seem to score well in other, perhaps more important areas: https://www.nongnu.org/lzip/xz_inadequate.html

comment 4y ago · link · parent

The average Emacs user writes occasional lisp to customise its behaviour. I don't know any VS Code user that writes JavaScript to customise it. VS Code obviously does have larger mindshare and that does bring some very polished commercial plugins.

comment 4y ago · link · parent

I tried ZFS-on-linux with Ubuntu 21.10 and it ate my data (ZFS panics when accessing certain files). Sure, Ubuntu does have a habit of using unstable kernels, but I was still disappointed. It should be stable at this point.

comment 4y ago · link · parent

I was asking about IHP specifically. Yes Haskell is just a tool and one could simply build PHP with it.

comment 4y ago · link · parent

One example of security is not munging strings together and shipping it off to the database or some other "eval" with full privileges. A programming language with lightweight static types makes it easier to parse outside data into a typed representation, then transform/evaluate/compile as necessary. This is of course Haskell's bread and butter.

comment 4y ago · link · parent

Security must be big selling point versus these other solutions?

comment 4y ago · link · parent

The .NET RX Observable streams where designed by Erik Meijer the author of this paper. The GOF book came up with the "Observer" pattern, but failed to spot and exploit the duality with iterators. RX and LINQ both take ideas from functional programming.

comment 4y ago · link · parent

Android presents a filesystem when plugged in to a computer, so almost any file sync tool should work.

comment 4y ago · link · parent

Tell him/her to use USB Audio Player Pro, it has its own USB driver that supports bit perfect playback and integrates with streaming services also.

comment 4y ago · link · parent

> The thing is nobody* does that.

I find that hard to believe when so many music stores and labels (especially classical music and jazz) are selling FLAC downloads. It all works fine on Android with great polished and featureful apps like "USB Audio Player Pro".

comment 4y ago · link · parent

VLC and free open source software certainly won't offer "just works". If you are happy to go down this path, then Android will offer more free open source apps for you.

comment 4y ago · link · parent

But how do you "sync" music libraries with the phone storage? Dragging and dropping files is still not a great experience and doesn't scale.

comment 4y ago · link · parent

AAC may not be audibly transparent after its transcoded for Bluetooth. If you are using Apple headphones then this of course shouldn't happen, but for Sony's LDAC, better to start with FLAC.

comment 4y ago · link · parent

How do you even get the files on the iPhone? I see long blog posts discussing the steps needed for this. Not really "just works" is it?

comment 4y ago · link · parent

You must have installed some niche piece of software that the vast majority of iPhone users will never use or hear about. Hopefully the indie dev keeps updating it and Apple never pulls it from the store!

comment 4y ago · link · parent

But the iPhone only "just works" if you completely buy in to Apple's ecosystem. E.g. if you want to buy some FLAC music files from somewhere else, it won't "just work" anymore. Android is still the lesser of two evils in terms of allowing more choice on its platform.

comment 4y ago · link · parent

Yes, anything written for these platforms is not likely to be around in the same form for the long term. It's disposable software.

comment 4y ago · link · parent

> I "fail to understand" something you actually never did or experienced, right?

No, I have worked at a variety of large institutions that have millions of lines of Python. I work with it often. The use of Python is more about it being accessible for non-developers, which is why they also teach it in schools; and the need for a standard. It is the new "Visual Basic". Again, it is not more productive in all situations.

comment 4y ago · link · parent

You might be more productive in Python versus anything else for the scale and complexity of the software you are involved in, but you cannot make sweeping generalisations like this. I also think you fail to understand that in many situations, static type systems actually improve productivity, especially at scale or for non-trivial domains. This is of course why Python is now trying to retrofit them.

There's also the argument that one is most productive in what they know. As someone who has spent far too long with Haskell and OCaml, Python's semantics and libraries often seem surprising and counterintuitive to me.

comment 4y ago · link · parent

> can't fully represent heterogeneous values in a dict, given that you can't do this _at all_ in many statically compiled languages.

This isn't really true. For example, in Java it's Map<K,Object>. For languages without subtyping, existential types are often used. It's quite common to see in infrastructural code, e.g. caching.

comment 4y ago · link · parent

Many languages also demonstrated Python-like succinctness with strong static types and type inference. E.g. OCaml dates back to the 90's and ML dates back to the 70's.

comment 4y ago · link · parent

Apple has had significant hardware missteps too, such as the butterfly keyboard. Presumably some executive ordered "make it thinner" and did not accept any pushback!

comment 4y ago · link · parent

Having used GHC Haskell's software transactional memory features to build a concurrent service with caching, I do think there are significant practical benifits. To program threaded code without needing to worry about global reasoning of fine-grained locking is a godsend. Transactional memory solves the issue of writing composable code that works on shared mutable state. Task libraries do not solve this problem.

Of course retrofitting such a feature into C/C++ in a satisfactory manner might not be possible. But the practical benifits are real.

comment 4y ago · link · parent

Ok, it looks like they've now retrofitted null safety, but why wasn't it designed in from the start? I can't help but feel this was always a Java-clone to avoid litigation, not any kind of innovative project.

Kotlin looks like a good Java++ language (especially for Android); and Typescript would be the most pragmatic choice for web. But again, Dart is going to have to keep up even with modern Java.

Regarding boilerplate, can Dart define a simple data class with equals and hashcode in one or two lines?

comment 4y ago · link · parent

Not the OP, but Dart, although basically a 90's Java clone, is still superficially different enough that it needs to be learnt - so where's the payoff? It doesn't fix most of Java's issues: pervasive mutability, boilerplate, a kingdom of nouns, Tony Hoare's billion dollar mistake etc. There are many better Java++ languages out there; and this includes the roadmap for Java itself (pattern matching, sealed classes, data classes, fibers etc).
1
181920
69