Better HN
topnewbestaskshowjobs
Log inSign up

grumpyprole

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

Submissions

comment 8y ago · link · parent

The C#/.NET solution, while very good, has some problems too. By implementing generics so deeply into the runtime, it becomes very difficult to enhance the support in the future, for example adding higher-kinded types (which the F# folks have long been asking for).

I actually quite like the Haskell approach of having a "Specialisation" annotation. I believe Scala has this too.

comment 8y ago · link · parent

Not necessarily, specialisation is only argubly required for unboxed types. Java actually implements "Generics" without any specialisation at all, it boxes all the primitive types (rather controversially).

comment 8y ago · link · parent

What's amazing is how little understanding we seem to have over such critical widely-used code. Java opted for a complex and arguably unproven algorithm, so it was always a risk. We now have functional languages that are able to express provably correct sorting algorithms, so the bar is getting higher.

comment 8y ago · link · parent

Another successful example of language layering is Python, which sits atop many C and Fortran libraries (and must do so for efficiency).

comment 8y ago · link · parent

Not good that Java's sort still has bugs.

comment 8y ago · link · parent

Yes. Currently access to modern hardware features are either via cumbersome APIs (e.g. NUMA, AVX intrinsics), handled via the OS (e.g. paging, scheduling), or handled via the hardware itself (cache memory hierarchy). The problem will get worse as modern CPUs and machines continue to diverge from those originally targetted by C in the 1970s.

comment 8y ago · link · parent

This example looks like it should be turned into a malloc variant, i.e. needs only to be written once. Raw pointer access is also available in other languages of course, albeit it is usually made much more difficult.

comment 8y ago · link · parent

Could I not just call such a function from my alternative language?

comment 8y ago · link · parent

The only support C is giving you for this is that it has sized unboxed types (and raw pointer access). Even then, you'd have to trust the compiler and take measurements to be sure.

comment 8y ago · link · parent

High-locality of reference can be achieved in any language that supports unboxed types, it doesn't require C (even a very high-level language like Haskell has support for this). But this is a long way from having complete control how each memory heirarchy is used.

Likewise most static languages defer to the compiler for CPU-specific performance optimisations and will permit foreign native calls into C or ASM where necessary. So I don't see how this is an argument in C's favour.

comment 8y ago · link · parent

C actually gives one rather limited control over modern hardware with it's memory hierarchies and superscaler CPUs. Programming language research has also moved on a lot since the 70's, which is why we should be considering less dangerous languages (e.g. better type systems and less undefined behaviour). Languages like ATS and Rust also support explicit memory management, whilst being a whole lot safer.

comment 8y ago · link · parent

This is not true in general. There is nothing intrinsic to static types that is incompatible with exploratory coding. If you want to turn all your type errors into runtime crashes, then some statically typed languages will even let you do this (e.g. deferred type errors in Haskell).

comment 8y ago · link · parent

I respect your position, which was shared by the designers of Java and Go, but any language I choose to use is one that seeks to empower me. For example, the purity restriction in Haskell exists to ultimately empower me, not because the language designers have contempt for my abilities.

comment 8y ago · link · parent

This is a social problem, it can be solved without such a blunt instrument. Single letter variable names also make code more readable, but only when used appropriately. Your argument would suggest banning those!

IMHO it is better to concentrate on getting the semantics right and not waste any goodwill on restricting syntax.

comment 8y ago · link · parent

Custom operators make code more readable when used appropriately; and any aspiring general purpose language that refuses to support them is cutting off the nose to spite the face.

comment 8y ago · link · parent

The MacBook Pro 15" does not have a 4K screen. Lenovo on the other hand do sell workstation-class laptops with 4K screens (3840 x 2160). The X1 Carbon is comparable in size to the 13" MacBook Pro and offers a similar 500 nits IPS panel.

comment 8y ago · link · parent

> That's because some Mac laptops do those things and others don't (it's a combo of OS version, graphics card, chipset, model, and so on).

The same is true for Linux, which was my point.

> Having problem with a laptop sleep or getting the 3D acceleration / compositor to play properly etc,

I have absolutely no problems with sleep or 3D acceleration (e.g. Steam works fine), my hardware is very well known (ThinkPad). So I don't agree that these are examples of constant issues.

> Heavy professional video and music editing.

Granted Linux is weak here. But is a MacBookPro really that strong? I would use a Windows 10 ThinkPad P-series Xeon, 64GB RAM and a 4K display.

comment 8y ago · link · parent

> Linux of all varieties still sucks on laptops

Sweeping statements like that are not helpful. The argument is far more nuanced. My wife's MacBookPro sometimes fails to wake from sleep, gets incredibly hot under load and doesn't support my displayport MST monitors, but I wouldn't claim that Mac laptops universally "sucked".

comment 8y ago · link · parent

Pick your distribution wisely. I have no issues with Linux wake-from-sleep or battery life on a ThinkPad, in fact my wife has more issues with her MacBookPro!

comment 8y ago · link · parent

It's anecdotal, but Linux on my ThinkPad gives:

- Rock solid stability, uptimes of months (until I reboot to upgrade the kernel). I've never had a kernel panic in over a decade of use.

- No problems with WiFi, sleep, printing or monitor hotplugging (dual wide-screen, displayport MST).

Linux is tweaked, optimised and hardened by so many people and organisations, it is seriously fast and robust. The various desktop GUIs available have also matured a lot over the last ten years.

For any developer of server-side software (which likely runs on Linux), it simply makes more sense to develop on a Linux desktop.

comment 8y ago · link · parent

Like Erlang, Elixir is still a "dynamic" language with no static types, it would have been great if it had introduced ML semantics to the Erlang/BEAM world, but this would have been tough to retrofit.

comment 8y ago · link · parent

No the concept was to drag the C++ programmers halfway towards the best ideas :)

comment 8y ago · link · parent

They didn't include everything, far from it. For example, lambdas were deliberately left out, despite objections from Guy Steele. Parametric polymorphism (generics) was also well known in academia at the time, since the 70's, but Gosling claimed to have not understood it.

comment 8y ago · link · parent

There are lots of papers referenced in the "Mysteries of DropBox" paper above, but I think the full spec is here: http://www.cis.upenn.edu/~bcpierce/papers/unisonspec.pdf

comment 8y ago · link · parent

Unison is beautiful, as it has a formal specification with proofs of correctness for its bidirectional syncing. Bi-directional syncing is hard to get right and many devs have been subsequently shown to not understand the problem fully, for example DropBox: https://www.cis.upenn.edu/~bcpierce/papers/mysteriesofdropbo...

My instinctive reaction is not to trust any brand new effort without more evidence of its correctness.

comment 8y ago · link · parent

This makes no sense. For example, XFS is a very robust and actively developed filesystem and is now the default on many distros. It also supports xattr.

comment 8y ago · link · parent

They stopped selling the premium "Pixel C" tablet about 6 months ago and that is now obsolete (no Android 9).

comment 8y ago · link · parent

> What laptops allow you to update keyboards?

ThinkPads, for example.

comment 8y ago · link · parent

As I said, you can only export the original media files and none of the organisation/folders/albums/tags. An analogy might be a filesystem where you can copy files out but not the folder structure.
1
404142
69