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

On the X1 Carbon, you will have to remove some screws, but Lenovo provide a guide to the process: https://support.lenovo.com/gb/en/solutions/pd103715

I believe the latest X1 Carbon weighs significantly less than a MacBook Pro.

comment 8y ago · link · parent

None of your ifixit links disprove my claim that "People are upgrading to new iPhones because their glued-in battery is end-of-life".

> The public is misinformed about many things.

No, this is different. There is a conflict of interest here, it is not in Apples interest to promote battery replacement.

> For example, up until now, you were among those people.

Please try to debate with politeness and good manners.

comment 8y ago · link · parent

People have only recently found out that Apple have been slowing down the iPhones in software to lessen the load on older batteries. I also disagree that changing the battery is "easy", I suspect some people may not even realise it is an option.

comment 8y ago · link · parent

My Thinkpad Carbon X1 has a user-replaceable battery and is practically the same weight and size as a MacBook Air. So it is certainly not a compromise I agree with. The "disposable" label was a bit harsh, but there are other compromises in the MacBook Pro, for example the SSD, which is more prone to failure than other components, is soldered on to the logic board.

comment 8y ago · link · parent

Upgrading isn't just about saving money. It's also a more environmentally responsible thing to do. People are "upgrading" to new iPhones just because their glued-in battery is end-of-life.

comment 8y ago · link · parent

The typical life of a Li-Ion battery is about 2/3 years or less if cycled often enough. This is at least one component that should be user replaceable. Most of us cannot justify or even afford buying a new machine every 2/3 years.

comment 8y ago · link · parent

Another counterexample to the "Apple make the best hardware" meme that is so often repeated. I find the whole concept of a disposable 1000+ dollar machine with a glued-in battery rather abhorrent.

comment 8y ago · link · parent

Have you tried specifying a smaller maximum heap size? The biggest memory issue IMHO, is that Java and the JVM do not specialise any "generic" code and so there can be a lot of unnecessary boxing going on.

comment 8y ago · link · parent

GHC Haskell is an advanced optimising compiler, which can get very near the speed of C and C++. However, to write fast programs, one must use the right data structures and algorithms. Often this means array-based strings and streaming IO, unfortunately many Haskell textbooks don't tend to cover this.

comment 8y ago · link · parent

Surely a more intuitive syntax would be:

X ++ {'fo'+'o': 'bar'} ++ y

Where '++' here means dictionary union, the choice of symbol is not relevant.

comment 8y ago · link · parent

Programming languages do influence how a problem is solved and this often affects architecture. This is especially true with respect to concurrency. However my main problem with C++ is security, not want architectures it inspires.

comment 8y ago · link · parent

> You can not stop the users from shooting themselves in the foot, but that is not the goal here.

It should be the goal. Even experts make mistakes. This is why static type systems exist. The logical thing to do is to strengthen the type system to prevent more classes of errors.

comment 8y ago · link · parent

You cannot make C++ secure and safe with a library.

comment 8y ago · link · parent

Best practice has changed, but C++ does not enforce it. Did Samsung follow best practices with Tizen?

Languages like Rust and Haskell are an attempt to put such best practice into the language tooling.

comment 8y ago · link · parent

I have programmed C and C++ professionally on and off for over two decades, but I don't think that is relevant here. C++ shares many of the same security and safety problems as C, that is why they are often lumped together.

comment 8y ago · link · parent

Assuming your analogy has merit, I doubt very much this is true. Computer modelling, for example, has improved significantly over the years.

However, it is true that many high profile failures in aerospace have been due to software errors, so I would say that software tooling is certainly one area that they could also benefit from.

comment 8y ago · link · parent

It's not news to anyone that C/C++ puts the burden of security and safety onto the programmer. And it's getting harder all the time, see for example Spectre mitigation. C was designed alongside Unix in the 70's, a very different era. It is time for a next generation OS, but it needs to be built using next generation tooling.

comment 8y ago · link · parent

It's all written in C++, so from a security and reliability perspective, I'm sketical it's going to offer much improvement over Linux. I don't see any evidence yet of "new technology". I'm happy to be proven wrong.

comment 8y ago · link · parent

A rope data structure is very almost persistent. So perhaps I am splitting hairs! It could of course be made fully persistent if mutating operations are avoided. This would allow sharing them between threads.

comment 8y ago · link · parent

A more interesting approach would be to use persistent data structures. While possibly slower for some operations, undo is more efficient and there are really interesting opportunities for concurrency. See:

https://github.com/arximboldi/ewig/blob/master/README.md

comment 8y ago · link · parent

Types in any modern statically-typed language should go well beyond simple "machine types" and also capture semantics. If one is representing everything with Strings and Doubles, then the type system is not being fully exploited.

Refinement types can statically capture range checks and other similar assertions. There is a project to add them to Haskell (Liquid Haskell) which is already quite useable.

Of course, static types are machine checked prior to running the program. None of your Python "types" exist until runtime, by which point it is too late. The program crashing due to an assertion failed error is logically still a crash.

We will have to agree to disagree on the roll of static types when building large systems. I have also spent over a decade working on very large codebases. The more "dynamic" a system was (late binding, reflection, string-based lookup, variants), the harder it was to statically reason about the code and avoid introducing errors. In a fast-paced business where hundreds of people are changing the same codebase daily, I do not understand how one could stay sane without static types. Python was never designed with such use-cases in mind.

comment 8y ago · link · parent

I am regularly surprised by the contrary. Our lifts at work once displayed a popup from the "Desktop cleanup wizard".

comment 8y ago · link · parent

I use Haskell professionally in the area of quantitative finance in a large team with a multi-million line codebase. Everything is built upon domain specific libraries, sometimes many layers deep. And these libraries are constantly changing to keep pace with the business. Strong types tell us early when things are broken. Others are attempting to use Python for similar projects, but it isn't fun (we have some of their alumni).

Haskell's effect typing also helps us. For example, for reproducible calculations, it is critical that no data is pulled-in via a backdoor (i.e. a side effect). Even reading and using the current system datetime is something we want to prevent. This can be expressed in the types using Haskell.

comment 8y ago · link · parent

There's "Real World OCaml" (new) and "Real World Haskell" (a bit out of date). But my favourite introductory text, which is not free, is Graham Hutton's "Programming in Haskell".

comment 8y ago · link · parent

C# does not in any way represent the best that static typing has to offer. Try F#, Haskell or OCaml seriously before discounting static typing. These functional languages offer much better safety (e.g. no nulls, no casts, case exhaustiveness) and are as succinct as Python. They also generalise a lot of features that are ad-hoc in C# and Python (e.g. async-await is a library in F# and Haskell). For me, using Haskell is also like "designing a system in paper, friction free". In fact, I tend to write down the types and type check them, before I attempt to fill in any implementation.

Truth be told, I am not a Python fan. I am seeing it take over in my industry, because it's superficially 'easy' and it's popular. The lack of static typing only later becomes a big problem when large codebases start to appear with many contributors.

comment 8y ago · link · parent

> People don't use parser generator tools because you wind up doing more work than needed to integrate it with the rest of your compiler.

I don't think you can make such a sweeping generalisation. Both JavaCC and Antlr have saved me a lot of time when doing DSLs in the past and both are well documented and easy to use. It would have been much more work for me to write the parsers by hand in Java. Both could also generate my own hand-rolled AST easily and so I do not see why integration would be a problem for most projects. I agree that generators do not scale to large compilers or projects with special needs, but that is not most projects.

comment 8y ago · link · parent

GHC Haskell does nearly all its optimisation using trees and a high-level functional IR, so I think you are understating trees.

comment 8y ago · link · parent

Modern compilers seem to work with trees more often than graphs. Trees would certainly be easier to work with in any language.

That said, functional languages can and do work with graphs when needed, but yes it is much more awkward than trees.

comment 8y ago · link · parent

I think I'd have been confused as to why using a parser generator was also not similarly regarded as being too easy :)

Interestingly, most mature industrial languages (e.g. Java, GCC, clang) use hand-coded recursive descent parsers. And of course such parsers can be implemented very easily from first principles using parser combinators in FP.

I've used both JavaCC and Antlr in the past for small DSLs, both are very good tools, when working with Java.

1
474849
69