Better HN
topnewbestaskshowjobs
Log inSign up

devit

4,235 karma · joined Sep 10, 2015 (11y ago) · 1,525 submissions

Submissions

comment 6y ago · link · parent

LLVM undef does not mean "undefined behavior", it means that it's OK to transform any use of it into the use of an arbitrary value (potentially different, unless the freeze instruction is used).

To get undefined behavior, you need to do something like use the unreachable instruction, or call a noreturn function that does in fact return. You may also have "poison values", which trigger undefined behavior on certain uses.

comment 6y ago · link · parent

I mean taxes on all carbon emissions should be raised (if airlines already pay them, otherwise airlines should pay them - also "taxes" can be replaced with a cap-and-trade scheme).

comment 6y ago · link · parent

Often plane tickets are cheaper than any other means of transportation, even if you ignore travel time and convenience.

If such a carbon reduction is desirable, then taxes on air travel need to be raised.

comment 6y ago · link · parent

Posits as defined in that article don't distinguish between +inf and -inf, so min/max operations cannot even be properly defined (since min(-+inf, 0) = {-inf, 0}).

comment 6y ago · link · parent

My goal for random experiences would be to experience new, unfamiliar and interesting things.

Obviously restaurants, bars and shops are quite uninteresting, with very rare exceptions (regardless of Yelp rating).

comment 6y ago · link · parent

You don't need "friends" (which often are not really friends anyway), just have at least one scene where you find yourself at ease and go to public places or gatherings about it.

For instance, one could go to programming meetups, or conscious dance events, or gay sex clubs, etc.

comment 6y ago · link · parent

My concern is that if you randomize uniformly based on geography or event, you'll get a very uneven distribution of place types.

E.g. if you go to a random public place, you are very likely to go to a uninteresting bar or restaurant or shop and very unlikely to find yourself in a very unique place.

And I'm not sure how you could automatically randomize in a a way that doesn't have this issue.

comment 6y ago · link · parent

This only applies to addressing modes with side effects, which e.g. x86 doesn't have.

comment 6y ago · link · parent

Seems really weird.

How is an OS supposed to support that? Seamlessly transition processes to run in qemu-x86 on the ARM core? Compile some processes as ARM binaries and pin them to the core? Require some sort of data-layout-preserving dual-architecture compilation for all binaries?

Seems much more reasonable to add a low-power in-order x86-64 core instead.

comment 6y ago · link · parent

The articles talks about editors, but VS Code is mainly an IDE.

Its predecessors were in order Emacs + single-language IDEs + proprietary IDEs, then Eclipse and finally IntelliJ IDEA CE.

Emacs lost because it failed to update to reasonable modern conventions and because it used a niche programming language.

Eclipse lost because they released a bunch of different bundles instead of a single install (apparently because the contributing companies saw Eclipse as a common base for their proprietary IDEs), it was slow for the time, and had a bunch of unnecessary UI complexity (e.g. it had an unnecessary perspective system that would change the IDE layout depending on language, meaning that you couldn't just customize the IDE and have it apply for all languages, but had to customize each perspective).

IntelliJ IDEA lost because only the core was open source and major parts were proprietary, resulting in reduced 3rd party confidence.

VS Code is winning because they have a major company backing it that mostly doesn't seek to make proprietary IDEs with it except for minor proprietary aspects, uses the most popular language for extensions, avoids unnecessary UI complexity and is also fast and technically good.

comment 6y ago · link · parent

Have you tried the approach of booting Linux and then creating a normal fullscreen qemu/KVM-based VM initialized with the memory state of the DOS OS, with a configuration so that the transition works correctly?

That would make the whole system fully robust and safe, and also support running XMS/EMS managers, DOS extenders, Windows and other bootloaders from the DOS VM.

I'm not sure however whether you would need to modify qemu to make it work and how hard that would be (also I guess that would have less hacky fun factor).

comment 6y ago · link · parent

Obviously you need a PartialOrd (and Ord, PartialEq and Eq) implementation for all fundamental data structures, since otherwise they are unusable (can't sort to canonicalize ordering, sort+uniq, use as btree keys, etc.).

Lexicographic order is the most common choice for vector; the other reasonable choice is length-then-lexicographic.

comment 6y ago · link · parent

New types could be introduced, a..b and other range syntax could resolve to them in next edition and cargo fix could add ".into()" to convert when needed.

comment 6y ago · link · parent

It's generally so that the person using the formal language can feel validated because they know it (and sometimes to signal they know it).

comment 6y ago · link · parent

Trademarks and copyrights are automatic, you don't need to do anything to have them (although registering them makes it cheaper to prove you have them).

Obviously "anyone should be able to pick up the torch" has the issue that the "anyone" may well be a malicious person who is seeking to defraud the users for monetary gain.

comment 6y ago · link · parent

I mean the fact that you in Java, etc. any function you call may throw an exception, which automatically propagates upwards from the code that calls the function, which results in part of the code in your function being executed and part not being executed, without any obvious signs of that (like having an early return or a "?" in the function).

If the exception is not a RuntimeException and not declared in the throws clause, then the compiler will error out, but in other cases the code will compile.

In Rust, you need to use the "?" operator when you call an exception-throwing function to propagate the exception, and if you don't you will get a Result, and a warning if you don't use it (i.e. not using "?" in Rust is like using Try in Scala).

If Rust code has no "?" or "return", then no exceptions will be thrown and the code will fully execute, except for aborts and panics which are guaranteed to make all visible memory inaccessible, so you will never see a partial modification of an object due to an unexpected exception being thrown.

comment 6y ago · link · parent

Implicit exception propagation (like C++, Java, JavaScript, etc. do) is a very bad design because when a statement can throw an exception, you need to design your code to rollback any changes before it, so it's essential that you know at a glance which statements can throw exceptions (in Rust, the ones with a "?").

As for implementation using unwinding vs a sum type, they are semantically equivalent, but using a sum type like Rust does allows you to use exceptions even when the error case is common without the steep performance degradation that happens with unwinding, at the expense of a very slight slowdown in the no-errors case.

Rust also supports unwinding/aborting exceptions as "panics". These are implicit because all accessible mutable memory is destroyed by a panic, since you must not keep references across catch_panics, so there is no need to rollback (except for unsafe code, in which case you need to assume that all function calls can panic).

comment 6y ago · link · parent

You can do that in hardware in most cases. Embed a unique serial number and only enable a feature if the driver passes a cryptographically signed message stating that the serial number has paid for the feature (and then sell the message data on your website).

comment 6y ago · link · parent

A lot of people would probably deny camera permissions to Instagram (and upload by sharing from gallery if they upload content), and their reputation would take a significant hit (currently they aren't known to covertly gather any personal data beyond generic OS-provided statistics).

Also Instagram isn't really essential to communicate and learn about events in the way the main Facebook service is, so stopping to use it is highly feasible.

comment 6y ago · link · parent

E-mail? (PGP encrypted and signed if needed)

WebRTC-based software? (e.g. Jitsi Meet, https://meet.jit.si)

comment 6y ago · link · parent

Most of these are offline software programs that you can continue to use indefinitely, or physical buildings that are very expensive to run.

comment 6y ago · link · parent

How does it compare to VSCodium?

Given that it starts with the huge handicaps of being proprietary and commercial, requiring a proprietary OS with very limited hardware support, and having far less extensions than VSCodium, it seems very unlikely it can compete.

comment 6y ago · link · parent

It's required to have static type checking, which is essential. Also, way more time/memory efficient.

comment 6y ago · link · parent

Rust offers data-race freedom and in general correct concurrency (e.g. it's impossible to access mutex-protected data if you don't hold the mutex), correct handling of objects and invariant preservation due to shared xor mutable (e.g. can't pass an array to a constructor that stores it in a field, and then modify the array in unrelated code that kept a reference, breaking the class invariants), better exception safety since exception propagation is explicit, a macro system, deterministic finalization, no GC latency, reduced memory utilization, better code generation, better cross-platform support, ability to produce lighter C ABI dynamic libraries.

Rust doesn't really have fundamental drawbacks other than the fact that there are more ways to store and refer to data (e.g. owned, borrowed, boxed, reference-counted, etc.) and thus you need additional code where you want to support more than one of them.

Of course there are ecosystem differences and learning curves.

comment 6y ago · link · parent

I don't think Haskell was ever successful other than as an inspiration for parts of other programming languages like Rust.

They chose an unfamiliar syntax for no reason (and one that makes it hard to learn abstractions, e.g. the practice to not distinguish between a -> (b -> c) and (a x b) -> c), and non-strictness/space-leaks makes it unusable for anything serious; plus, it doesn't support dependent types, so it's not even good as a "theoretically perfect" language.

The only thing that can kill Rust is a better Rust, which means either a Rust with dependent types, or a Rust that is somehow much easier to learn while not sacrificing power and zero-cost abstraction (I believe the latter is likely impossible, but maybe I'm wrong).

There is also the possibility of limited success for Rust, i.e. the fact that it will kill C/C++ (which is inevitable), but fail to kill JavaScript and Java/Go/C#.

comment 6y ago · link · parent

Rust has a system equivalent to checked exceptions.

However Rust, unlike Java, has a great macro system and can thus easily generate higher level exceptions wrapping the lower level ones.

comment 6y ago · link · parent

If the game store takes a lower cut, then either games will cost less, or they will be better because at least some of the game developers will choose to use the extra money to pay more employees to work on the game.

Also, if there are more stores it's less likely that entire categories of games will be unavailable to you (or available but worse due to reduced budgets) due to all game stores having rules banning them, and in general game stores are less likely to be able to enact policies that serve them at your expense.

comment 6y ago · link · parent

Why is that a problem?

You can just install all game stores on Windows and there is no downside to doing so, and no real difference between installing the Epic store and purchasing a game there and buying the game on the game publisher's website.

Also currently Steam has a dominant position and 30% cut, and if the Epic store succeeds it will result in a more competitive situation with at least two game stores probably taking a 5-15% cut, which is a drastic improvement for everyone except for Valve, which makes Steam.

Same thing on mobile if Epic succeeds in the antitrust lawsuit with Google/Apple stores instead of Steam.

comment 6y ago · link · parent

They don't have to run infrastructure, they just have to update iOS to remove the signature check on binaries and support installing IPAs from Safari downloads, so that there is no need for their app store anymore.

comment 6y ago · link · parent

> on boat journeys even though 10% of the passengers would typically die on the way

Source? Seems highly implausible (in general).

1
212223
51