Better HN
topnewbestaskshowjobs
Log inSign up

grumpyprole

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

Submissions

comment 7y ago · link · parent

I'm trying to understand the semantics not the implementation. The semantics are clearly not "let x = .. in .." as anyone familiar with expression let-bound variables would expect. I wish I could avoid Python but sadly it is taking over the world. It's even taught at schools now and my kids will be learning it as their first programming language.

comment 7y ago · link · parent

That is really really confusing given that there is lots of prior art for = meaning variable binding and := assignment (Algol, Pascal etc). Using = for assignment was a bad decision and it's coming back to bite.

EDIT: Based the examples given, the Python := operator doesn't appear to behave as a let binding. The scoping suggests it is another form of assignment.

comment 7y ago · link · parent

> Go is actually one of the best in terms of design.

I respectfully disagree. Go's primary goal was to be (superficially) easy to use and familiar. Because of this, it fails to tackle the big issue with doing concurrency in most prior mainstream languages. Go has mutable state deeply baked into the language and makes it difficult to work with immutable data. Go is not necessarily easy to use if ones goal is to build correct concurrent software.

comment 7y ago · link · parent

Yes, but my point is that it's a flaw in the language to allow this. Not all high-level languages share Go's problems. However, even Go would be a huge safety improvement over C++.

comment 7y ago · link · parent

I agree a stale read is bad. And I am surprised that the Go designers have repeated many past mistakes. It is possible to design a concurrent high-level language that does not have such issues, despite the hardware. For example, if all communication is done via channels, then synchronisation can be automatically performed during channel read/write. For shared mutable state, Haskell's software transactional memory and Erlang's Mnesia are both excellent examples of safely dealing with it.

comment 7y ago · link · parent

What do you mean by memory unsafety? A stale read would be bad, but wouldn't lead to arbitrary code execution.

comment 7y ago · link · parent

Maybe. I'm happy to run any formally verified C as my basement, for example the seL4 kernel, or for C to be used as an intermediate language. Especially as there should be less code at the bottom of the stack. But C++ seems worse, it's a far more complex language, designed and built to try and scale C to building applications. This creates a far larger attack surface.

comment 7y ago · link · parent

> "The exploit used a race condition bug between two threads due to missing proper synchronization between them. It gives an attacker a Use-After-Free (UaF) condition that is very dangerous because it can lead to code execution scenarios"

This is why C++ needs to be retired; and why we need to use safer languages. Not even Google can write safe C++. Thankfully Mozilla have already realised this.

comment 7y ago · link · parent

> what happens when you plug an additional screen in?

Absolutely nothing. I have to tyoe xrandr commands to make anything happen. I3 is strictly just a window manager. Unfortunately projects like Gnome solve these problems in a completely monolithic fashion, with no module or component that I use that just solves this problem.

comment 7y ago · link · parent

Using the new ribbon version of office I found out that document properties could only be inspected by clicking on a golden orb and going into a menu called "Publish". Similarly most other less-often used features became impossible to find. I've refused to use office for any substantial document ever since. I can only assume that this research was targeted at new users and not existing users.

comment 7y ago · link · parent

And it was a completely different UI, forcing all the users to relearn most of the functionality. I suspect that such a user-hostile change was done in order to achieve a patentable UI, something that LibreOffice and others would not be able to copy.

comment 7y ago · link · parent

What about the Deepin desktop? I haven't tried it but many magazine sites say it's now the most polished. I'm fairly happy with i3, until I need to plug in additional screens...

comment 7y ago · link · parent

IIRC Safari achieves this by suspending the processes in background tabs, which could be running inefficient JavaScript (polling for new ads etc). There's no cross-platform way to do this, but I think Mozilla absolutely need to try and find a way to address this. Web sites cannot be trusted to write efficient well-behaved JavaScript and so the burden of taming it falls upon the browser. There is probably some throttling going on, but clearly not enough. Running background JavaScript should be an opt-in permission, not the default.

comment 7y ago · link · parent

Both Chrome and Firefox have support for sandboxing on Linux. For the security conscious, there's always the Xen/Linux Qubes distribution, which is considerably more secure than MacOS.

comment 7y ago · link · parent

My employer encountered lots of basic bugs, like file handle exhaustion, which together with the amount of recent activity in GitHub, suggested to me that there is a lot of new code in Bazel. If it's essentially the same as Blaze as you say, then why the new name?

comment 7y ago · link · parent

Syntax is the absolute best thing about Haskell and it's ML relatives, especially coming from C++ and Java as I did. It's succinct and very easy to read, without braces, parens and type annotations scattered everywhere. For example, defining a function is as simple as "let f x = ..x.."

The succinctness of Haskell really matters when dealing with non-trial code or types. Just compare the type signtaure of "SelectMany" in C# to an equivalent in Haskell.

comment 7y ago · link · parent

This is misleading. Bazel is full of brand new code and only parts of it have been in use at Google as part of Blaze.

comment 7y ago · link · parent

Ok here's a talk about making Haskell games that took place last week: https://keera.co.uk/blog/2019/09/16/maintainable-mobile-hask... I don't deny that making games in Haskell is niche, but it's certainly possible. Frag was just an example I remembered (ten years is recent for an old git like me).

comment 7y ago · link · parent

There is certainly prior art for complex games running smoothly in Haskell: https://wiki.haskell.org/Frag

This particular solution used functional reactive programming, essentially a composition of signal/event processing functions/automatons.

comment 7y ago · link · parent

Those weekly Monad blog tutorials probably annoyed the Haskell community more than anyone. Extremely readable and well written papers had already been published by the Haskell community (e.g. Phil Wadler). Read the papers first.

comment 7y ago · link · parent

Ok bad example, but it shouldn't have taken them 15+ years to fix it.

comment 7y ago · link · parent

Perhaps most, but not all. Even something as simple as a date formatter in Java is not thread-safe.

comment 7y ago · link · parent

I was calling out the Java memory model and concurrent programming in Java as being very complex. It's inherent to the language itself and almost impossible to change. I was only calling it "hidden" complexity as most people do not see an issue when writing single threaded programs. Concurrent programming I genuinely believe is easier in Haskell.

comment 7y ago · link · parent

> You think I'm done? Let's get to Lens.

Lens is a library, not part of Haskell the language, it's also not particularly widely used. If you are going to conflate the ecosystem with the language, then we could equally talk about the complexity of dependency injection frameworks, AbstractSingletonProxyFactoryBeans, aspect-oriented bytecode weaving, and enterprise Java beans when discussing how much "easier" Java programming is.

I have programmed both Java and Haskell professionally on multiple codebases. I honestly found more ad-hoc and incidental complexity in the Java world. At least the Haskell libraries generally were consistent in the abstractions used. Java the language, also had a lot of hidden complexity, for example its memory model (required knowledge for concurrent programming).

comment 7y ago · link · parent

I am not American, but if I was, much of the above would also upset me. But you are invoking a straw man, my point was that Apple should pay more tax (especially to Europe), not solve all the worlds problems. I get that you don't care.

comment 7y ago · link · parent

> How would you decide on any other number and justify overpayment to the shareholders?

How do they justify a 245 billion dollar cash pile to the shareholders? To decide on a number, pick one that beats all competitors, then advertise on all boxes and websites that you pay more tax than anyone else.

> Sounds like Europe has tax problems then. Pass some laws.

The worlds richest company has the best lawyers, they will always be able to find loopholes or refuse payment (see prior link). The best way to tackle it is via public rebutal of their self-righteous image.

comment 7y ago · link · parent

Apple already have the largest margins in the industry. They are sitting on a 245 billion dollar cash pile. They have so much cash they literally don't know what to do with it. Meanwhile, infrastructure and public services in both our countries are failing. But I guess voters, like you, "are sick of hearing about it", which explains a lot.

comment 7y ago · link · parent

The richest company in the world with the best lawyers will always find loopholes to exploit. I would argue it's the spirit of the law that counts. One way to tackle it is to rebut any claims of self-righteousness from said corporation.

comment 7y ago · link · parent

This is true, even Haskell supports imperative programming and mutation (very well in fact) but languages do need defaults. Given that even OOP thought-leaders argue "favour immutability", I would argue that FP languages offer a better set of defaults out-of-the-box (e.g. persistent collections, libraries for working with immutable data, concise syntax). Mutation is extremely useful and powerful, but if it's the default idiom used absolutely everywhere, then program composition and reuse will be harder to achieve.
1
333435
69