Better HN
topnewbestaskshowjobs
Log inSign up

grumpyprole

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

Submissions

comment 5y ago · link · parent

It did confuse me when I first saw it, but yes, it is not really a significant issue.

comment 5y ago · link · parent

Well the Python community is hardly an authoritative figure on static typing :)

comment 5y ago · link · parent

> That would imply that "foo(x: int)" is a string rather than a function

But foo(x : int) is a string! It literally reads "foo applied to x". In the function definition, it appears to be used as a left-hand-side pattern which is "matched". The definition is written as if to say, whenever the term foo(x) is encountered, use this definition here. At least, that was my expectation.

> Haskell doesn't use that notation either

OCaml does and Haskell once had a proposal to add it. Haskell type signatures are normally written separately, but it does support annotating patterns with the right extensions.

comment 5y ago · link · parent

In Rust, a function definition left-hand-side looks like an annotated pattern, e.g.

foo(x : int)

Therefore, one would expect to annotate the return type as,

foo(x : int) : string

Since the pattern is showing foo applied to x. The Rust syntax is actually confusing for both Haskell/ML programmers (where the arrow comes from) and mainstream programmers. It's too small an issue to change now though.

Rust's support for proper "algebraic data types" is very good and gives it an advantage over languages like C++. However there are some small surprises, such as forcing all enum constructors/fields to be public (one must therefore wrap it to make an abstract data type).

Every language has its warts and these are particularly minor ones.

comment 5y ago · link · parent

Rust maybe a little adhoc in places (e.g. the misappropriated Haskell/ML function syntax, enum/struct asymmetry), but overall it is a fantastic effort. It is not an easy task to combine an advanced static type-system with mainstream ergonomics, but they seemed to have pulled it off. The fact that it is also not owned and controlled by a single big tech entity is icing on the cake. I really hope it achieves even greater success.

comment 5y ago · link · parent

App makers complain about Apple's dominance, yet seem to put significantly more effort into iOS apps than Android apps.

comment 5y ago · link · parent

It can be difficult to avoid the culture/practices though. Every dependency you use, is code that you are ultimately responsible for. At a minimum you will need to learn how to use them; and you may need to debug and fix them. This is why it applies to other JVM languages too.

comment 5y ago · link · parent

Google for "Enterprise FizzBuzz". And that one doesn't even use Spring. Yes it's a joke, but quite illustrative of why many dislike the Java culture and its ecosystem.

comment 5y ago · link · parent

So true! I once told my kids about the beautiful car-free bicycle cities, they replied something like "wow, I wish we could live there".

comment 5y ago · link · parent

> Monads are not the same thing as effect types

Monads can be used to implement "effect types" and define the semantics of them. I believe this is how Koka works.

> Talking about Haskell monads just does not seem all that relevant in this context.

I respectfully disagree. Async/Await first appeared in F# as a Monad (Computational Workflow). Monads also do not necessarily have to involve closures at runtime, they can be useful just to define semantics and build type-checkers.

comment 5y ago · link · parent

> I quite like it and don't see any particular problem or traps with it.

While Go's model is certainly a valid point in the design space and keeps things nice and simple, there are of course going to be many trade-offs. For example, low-level control is very much lost. There are no opportunities for custom schedulers, optimising how non-blocking calls are made, or easily dealing with blocking syscalls (or foreign libraries that call them). It would not be the right approach for Rust.

comment 5y ago · link · parent

The problem is more that Rust cannot (currently) abstract over these different function types; and that they are more limited (e.g. no async methods in traits). But the idea of effects tracking is a good thing and we are bound to see more of it in modern statically-typed languages.

comment 5y ago · link · parent

And why restrict oneself to just two colours? Haskell monads also allow one to abstract over the "colour", such that one can write polymorphic code that works for any colour, which I think was the main objection from the original red/blue post.

Microsoft's Koka is an example of a language that further empraces effect types and makes them easier to use: https://koka-lang.github.io/koka/doc/index.html

comment 5y ago · link · parent

Whilst it may appear that concatenation of strings is easier in other (more declarative) languages, in practice, understanding the runtime performance/complexity and memory usage/lifetimes is far from trivial. Sure, a more declarative language might still be preferable, but for those who need better control and more ability to reason about how the program with execute, the Rust approach makes sense.

comment 5y ago · link · parent

> Everything about these laptops feels cheap in comparison to a Mac. They are bigger, thicker, heavier, more plastic, hotter, and less elegant.

This is completely wrong. For example, a Lenovo X1 Carbon is 2.5 pounds, which is lighter than a MacBook Air at 2.8 pounds. It also offers 32GB of ram, does not have a glued-in battery, does not use glass and the keyboard is much less likely to fail. I am tempted by the M1, but from my experience Apple machines are heavier, fragile, less reliable and less user-serviceable. I also don't understand the aversion to plastics. Aluminium makes MacBooks heavy and can attenuate radio signals.

comment 5y ago · link · parent

Yes I agree, the UI is a mess and they have made some bad design decisions. One time I was on train with my network connection dropping constantly and Thunderbird was giving me a model pop-up dialogue each time! It still gives pop-ups for updates. But it's open-source, relatively stable and reliable, and that counts for a lot.

The sad fact is that there is simply no money in building email clients. Email is a legacy technology and arguably no longer fit for purpose. We need a new standard and that's not something that BigTech has delivered yet.

comment 5y ago · link · parent

> all of the email clients on Linux were awful

Thunderbird is pretty good and in my experience, less buggy than Apple Mail, especially when using providers other than iCloud. My wife absolutely hated Apple Mail, primarily because it would forget passwords and stop syncing/sending. So I moved her to Thunderbird and now she's happy.

comment 5y ago · link · parent

This uses subtyping polymorphism not higher-kinded parametric polymorphism. If subtyping worked perfectly in all important cases, "generics" (parametric polymorphism) would not have been retrofitted to Java.

comment 5y ago · link · parent

Designing a serialisation format has a lot similarities with designing a programming language: data types, declarative/ease-of-use versus full control, abstractions, static versus dynamic memory areas, optimising representations etc. There is definitely room for a variety of formats depending on the use cases; and many are unhappy with the current incumbent: https://reasonablypolymorphic.com/blog/protos-are-wrong/

But yes, it's a lot of work and they probably should document what the trade-offs are that they have made.

comment 5y ago · link · parent

Three years of support is very poor and encourages e-waste, I will not be buying a phone with Qualcomm hardware in it.

comment 5y ago · link · parent

An insignificant breaking change is still a breaking change; and over time they build up. This may explain why so many developers have been unhappy with GTK3.

comment 5y ago · link · parent

> and hints at backwards compatibility.

To me it communicates no commitment to backwards compatibility, i.e. no semantic versioning. This might be enforceable if one is Apple, but doesn't sound good for an open-source platform.

comment 5y ago · link · parent

Very strange, I can confirm that your Spotify sample does sound much better than my one. Mine sounds identical on Windows and Android though, two very different platforms, so it may indeed be a UK problem. Thank you very much for the code.

comment 5y ago · link · parent

I've uploaded a small example, a small clip taken from the CD followed by the same clip captured from Spotify: https://drive.google.com/file/d/1F3NvOpqcMfvNSmyyvbgfUlV6XMO...

comment 5y ago · link · parent

This reply might be interesting: https://news.ycombinator.com/item?id=26354999

comment 5y ago · link · parent

Thanks for the recommendations. I'm still very new to streaming and still buy CDs for most of my music. I am currently using UAPP on my phone and plug it straight into an RME ADI-2 DAC, the advantage being I don't have to fire up the PC. The disadvantage of course is storage on the phone.

comment 5y ago · link · parent

I can confirm Qobuz sounds great. I've signed up for a free trial. The integration with UAPP on Android works well and gets around the Android 48Khz limitation. Thanks for the recommendation.

comment 5y ago · link · parent

Thanks for the recommendation. I see that Qobuz also integrates with UAPP on Android (which gets around the 48Khz limit). Since I listen to mainly Jazz and Classical, it sounds like a good fit.

comment 5y ago · link · parent

Sure, one example is the first minute opening of Osmo Vanska's Mahler 5. The big crescendo between 40-45 seconds sounds particularly bad, lots of break-up and distortion. Sounds fantastic on the CD.

comment 5y ago · link · parent

I have it set to "Very High" and have their normalisation turned off. I can provide samples demonstrating distortion and break-up; the waveforms even look completely different visually. It's even audible over non-audiophile headphones. On my HD800S it's unlistenable. I have no idea what they are doing to the sound, but I have found many recordings that sound awful on both Android and Windows.
1
262728
69