HNHacker News
TopNewBestAskShowJobs

cjg

3,858 karma · joined March 31, 2009

submissionscomments
cjg··on The collapse of the IRON stable coin
You can buy a lot if the price is zero.
cjg··on How to track users for analytics in a privacy-first, cookie-less future
"Step 3 - Attribute anonymous page views to the user!" - not GDPR compliant without consent for that.
cjg··on Zero to Production in Rust
Most people are happy to teach themselves the basics through some reading of https://doc.rust-lang.org/book/ then a mixture of pairing, code walkthroughs and short presentations.

We will also run a training course next month just based on the Rust book plus some workshop examples.

cjg··on Zero to Production in Rust
>> you’re slower than a dev team working in a traditional language (java, go, python, …)

If anything my experience is that it's quite productive to work in Rust. For example, compared to Python (which you mention) we catch bugs earlier (with the compiler) rather than later (system test) and so development is faster. Shift left.

It's particularly important for races because they are some of the most difficult bugs to find and fix.

cjg··on Zero to Production in Rust
A couple of reasons: 1. We like the thread-safety properties that Rust offers 2. We don't have any Go experience

Does Go offer similar guarantees for concurrency?

cjg··on Zero to Production in Rust
We initially used it on a small project that had the requirement that the chances of a crash / failure should be very low because it would be used as a remote control process for a wider system. We had good success there and so the company was keen to use it in more places. It's now formally "adopt" on our technology roadmap.

We've actually bootstrapped relatively easily. We have a some developers who have picked it up quite easily, perhaps with some pairing. We run an hour session every week where all the Rust developers get together to share production code and present on Rust topics. The discussion focusing on Rust production code has been particularly helpful.

cjg··on Zero to Production in Rust
We've been using Actix.

We evaluated several frameworks and liked the model that Actix has and also its relative maturity (for example documentation / examples). It has been pretty straightforward to work with - including doing things like custom authentication and REST endpoints that dynamically exist.

For the drama, I guess you are talking about the situation that used to exist where Actix had hundreds of unsafe blocks. That's pretty much resolved now, with perhaps a handful of performance critical unsafe blocks left.

cjg··on Zero to Production in Rust
I have been involved in training several "junior" devs in Rust and I would say that it's more about their ability as a developer rather than them being junior.

Developers who could get by professionally in Python, but were not particularly good, have struggled with Rust.

However, we have several developers who joined us directly from their undergraduate degrees who have picked up Rust extremely easily.

cjg··on Zero to Production in Rust
I'd be interested in hearing what you think is a problem in async Rust.
cjg··on Zero to Production in Rust
In my experience, Rust code is relatively easy to read, even by developers with no Rust experience.

Of course, you can write hard to read code. But that's not typically what comes out of a process of writing production software.

That's not to say that someone with no experience will fully understand the ownership transfer & borrowing that's happening, but that's just stuff you need to do for the compiler. Reading code that already compiles, you can mostly ignore that and focus on the program logic.

cjg··on Zero to Production in Rust
We are using Rust for backend web development and other things.

For us, the safety is the critical reason to choose Rust - particularly the thread-safety. Also the relatively small memory footprint compared to something like Java. Performance hasn't driven our decision at all - the number of requests per second is very low. It's correctness that matters.

We are a bit unusual because customers have locally deployed servers rather than servers managed by us, so bugs are harder to fix.

We haven't hired any developers specifically for their Rust experience, but have instead trained internally and now have a group of about 10 Rust developers working across a couple of projects. I would say that training like this has been relatively straightforward. One of our hires, a recent graduate, had some existing Rust experience with personal projects, and this was particularly beneficial in helping the team to bootstrap.

The ecosystem is surprisingly mature. Async is probably still shaking out somewhat, but that's moved on hugely in the last couple of years, and we haven't had any particular problems.

Overall the experience has been hugely positive.

The biggest barrier to adoption, in my opinion, is that people are scared of learning Rust because it has a reputation as being difficult. I don't think it's any harder to master than some other major languages such as C++ or Java - although perhaps you have to understand more at the beginning: ownership and borrowing are right in your face.

cjg··on Court rules encrypted email provider Tutanota must monitor messages
This is what BitMessage tried to solve, but it looks a bit unloved right now.
cjg··on Google Removed ClearURLs Extension from Chrome Web Store
I had a similar experience searching for "rust hashmap" - expecting to get some links to the standard docs.
cjg··on Why asynchronous Rust doesn't work
Well, you can use https://docs.rs/async-std/1.9.0/async_std/task/fn.spawn_bloc...

But this is partly the reason why libraries might be more inclined to support async rather than blocking calls.

cjg··on Why asynchronous Rust doesn't work
Rust async doesn't quite solve the cancellation problem either.

Sure, you can stop polling the future at any time, but that doesn't mean that you left the system state consistent.

Careful thought is needed on every call to await in an async function. It might be the last thing that async function ever does.

That's probably something that should be true in a well-implemented system anyway. After all, processes could be killed at any point.

cjg··on Why asynchronous Rust doesn't work
It's easy to convert an async function into a blocking one. For example, you could use https://docs.rs/async-std/1.9.0/async_std/task/fn.block_on.h...

So just use the async functions from the library synchronously if you want.

cjg··on Why asynchronous Rust doesn't work
I think that's too strong.

You could have two executors with no problem.

What might cause issues is if code running on one executor needed close interaction with the other - such as running a task on the other executor.

Most of the time this is just avoided by using only one executor. But that's not the only way.

cjg··on Google to stop selling ads based on your specific web browsing
Unfortunately if enough people have been looking at Bose QC-35s then there's no reason why that couldn't be a fact about your cohort.
cjg··on ICANN Refuses to Accredit Pirate Bay Founder Peter Sunde Due to His ‘Background’
The contract is mostly there so that it's clear what each party is trusting the other to do.

Enforcing a contract is often not worthwhile.

cjg··on Google to stop selling ads based on your specific web browsing
The idea is that they group you with N other similar people where N is large enough to anonymise you enough to stop the worst complaints but small enough that advertisers still find it useful.

Some sort of principal component analysis to determine your "cohort".

An advertiser isn't that interested that you are you. They care that you are, for example, 55 with an interest in gardening and have been looking at lawnmower review sites.

cjg··on BBC Micro at 40: How it inspired a generation of coders [video]
Must have been this: https://www.stairwaytohell.com/music/Frak.mp3
cjg··on BBC Micro at 40: How it inspired a generation of coders [video]
That sounds very familiar!

There was essentially no security on those Econet networks. If you had a copy of the executable that could read and write the memory of a remote computer, you were good to go.

I remember I had a print-out of a hex dump of the REMOTE command and used it with exactly that key capture attack. I just typed in the executable then told the teacher I'd forgotten my password and needed it reset. I watched remotely as he logged on to his admin account.

The next day, all the BBC micros in the lab played Captain Pugwash when they started: very beep-heavy given the ability of a BBC to create sound.

Eventually I was caught re-entering the hex dump and my printout was confiscated. I didn't have another copy.

cjg··on The Turing-Completeness Problem
We give up on automated program analysis far too easily - even for "Turing complete" languages.

To be truly Turing complete requires infinite memory. That clearly doesn't hold for any current programming language.

Mathematical proofs are only applicable where their assumptions are valid. So why would we believe that the where memory isn't infinite (everywhere in practice) that Turing's halting analysis is applicable?

Sure, automated program analysis might not be easy, but that doesn't mean we should just give up. Indeed I have a simple algorithm (although relatively inefficient) to solve the halting problem where memory size is fixed and finite: enumerate every state until either a state is repeated or the program halts. This completes in O(2^N) time where N is the size of the memory.

But I'm sure someone clever will come up with a more efficient algorithm than that. I already have several ideas that this margin is too small to contain.

For me the tricky bits are where a loop terminates if and only if Goldbach's conjecture is true (or similar) - but perhaps a compiler could require an "unsafe" block for such code (in the vein of Rust).

cjg··on Building an artificial sun that looks realistic [video]
Sounds like something you could 3D print.
cjg··on The Singularity is Near: How Kurzweil's Predictions Are Faring (2017)
Or work 7 years and then retire. https://www.mrmoneymustache.com/
cjg··on Car seats as contraception
That chart is highly confusing. For example, if a family has three children spaced 2 years apart, they would only contribute to the three children part of the plot for just over half the time that they contribute to something other than no children part of the plot.
cjg··on Sattolo's Algorithm (2017)
Random ordering of elements in a list is often used in maze generation. It's possible that a permutation that had only one cycle might produce a maze with a particular structure.
cjg··on The EmDrive just won't die
They eject something from the system.
cjg··on Instacart shoppers besieged by bots that snatch lucrative orders
Except that eBay uses a particular auction model where by extending the time doesn't matter much.

If you bid the most you would be prepared to pay for something - you don't pay that price - you just pay enough to beat everyone else.

If you bid in a genuine way there's no pipped at the post situation - you just weren't prepared to pay more.

Now there are some secondary psychological effects, like a high price bid so far might increase bidders willingness to pay more, so there may be some advantage to bidding later, but overall there's less of a problem than it initially appears.

Perhaps bidders just need to be more honest with themselves about how much they were really prepared to pay.

cjg··on Doing the Impossible
My favourite in this category is the impossibility of a halting oracle, which relies on the assumption that there is infinite memory. An assumption which is wrong in most practical cases.

There's a trivial implementation of a halting oracle when memory is a fixed size - run until a state is revisited or the program exits.

← PreviousPage 4 of 14Next →