HN user

hansonkd13

144 karma
Posts2
Comments30
View on HN

All the same arguments were said about cigarettes and yet in 2022 I almost never smell a cigarette burning outside and few young people smoke.

People complained about cigarette taxes wouldn’t be effective but they are.

The stock market didn’t crash either despite the multibillion dollar tobacco companies being affected.

Jetbrains and rust have brilliant refactoring. No idea how it compares to kotlin, but I can confidently move methods to other modules and files, rename anything, navigate to definition with no fear. Auto complete / auto import is also insanely good and is almost to the point where I’m auto completing almost every symbol because the IDE knows what I want precisely.

I can’t recommend jetbrains rust support enough.

if you're head and shoulders above any of your competitors, you're able to get away with things like this.

The hubris of Tesla is still believing this to be the case. I personally cancelled my cybertruck order from lack of interest. better competition exists in 2022 that wasn’t the case years ago.

No but I have been through exchange mandated confiscation of crypto wallets. Be your own bank you say? Keep my own keys you say?

You think the average person from the article would hold their own keys? No the reality is if crypto was adopted en-mass, people would use services to manage their keys and you literally solve zero problems.

That’s literally just another way of saying you are using Bitcoin to break the law.

Also in the US, transferring Bitcoin to say Russia is sanctioned and illegal. Is it technically possible to push the button and the transaction go through? 100%.

Does it mean it that you wont get in trouble for it? Absolutely not. Congress has an entire page about it. 1 year, 5 years down the line as soon as the govt gets a whiff, all your past dubious transactions that you used to evade sanctions are now Public and used as evidence against you at your trial.

GraphQL is a layer in front of SQL.

I can write a Graphql endpoint in python (Using Django-Graphene). I can write python functions that return data to the graphql. I can write ORM queries that write data to grapqhl. I can specify access, permissions and certain queries based on the user.

Graphql is more of a relational FFI than a SQL replacement.

Also the frontend never sends SQL to get data because it is unsafe. This is what a GraphQL framework allows you to do, clean up and filter queries so they are safe and then translate them into efficient lookups in a RDBMS.

OK to give you a clear example.

Say you have a REST interface for Student and Class.

What do you do in rest if you want to get just a class? What do you do if you want to get a class and its students? What do you do if you want to get a Student and also its class?

For every iteration of the way you need to access the data you have to modify and extend your REST endpoint or do separate queries. Every time the frontend devs want new data related to existing data, they have to do another query or ask the backend to include it.

Or lets say Class has 1000 attributes. Does your REST interface return all 1000 every time? Or can the frontend specify which attributes to load? Things like computed attributes and functions that return data related to the object. GraphQL allows this.

In graphql doing these relationships is dead easy. You define a class and how a student is related to it. Then you could even ask a query like “give me the classes of a student. For each class give me all the students in those classes. For each of those students, give me their classes”. Without the backend having to add anything. All the backend has to do is define the relationship and permissions about how to access the data.

Most GraphQL libs provide helpers for avoiding n+1 queries also, so things get optimized in the above case by only making 4 queries to the DB. Obviously thats a contrived example and most nested things wont go so crazy. But it goes to show how a powerful the API can become from defining such a simple relationship.

As a backend dev you just have to work on transforming data, defining the relationships and checking permissions. You let the frontend determine what data they want to access.

Before working with REST almost every page seemed to need a specialized endpoint to be implemented for the frontend to work, but with GraphQL, the frontend can work much more independently without having to ask the backend to provide a specialized view for more data.

Django 4.1 4 years ago

Great to see improving support for async here. I am a big fan, but IMO python async code is just different from other async langauges. I used async extensively in python and compared to other languages it is a pain to use because unless 100% of the the libs you want support it you will get stuck on some sync library. Async in python is not even a 2nd class citizen. Its more like a 3rd class citizen. Its gets better every year but it is minuscule compared to regular sync code, so very few tutorials mention it and nobody teaches it as the default way of doing things.

In order for async to be popular it needs to be the default way of writing python. Right now its an after thought for writing “high performance” python. For example asyncio version of redis got 72,114 downloads this month. The sync version got 26,825,663. Thats not even in the same universe.

Historically, using something like gevent is a more drop-in solution for python if you want lightweight threads, but it comes with its own problems. Gevent gives python what Zig has that automatically turns all sync IO calls to async and your app is now magically using greenthreads.

However I think gevent in the past was the crutch that prevented a lot of lib authors from writing async libs.

Django 4.1 4 years ago

I think my experience in async in other languages has shown how rough async in Python is.

Unless async is the default python, it will always be an after thought and introduce needless complexity when working on large projects that require a lot of external libs.

Django 4.1 4 years ago

Why do they need Async templates? When a template renders it should be pure data and fully on the CPU. It seems Async templates would encourage a bad behavior of doing n+1 queries inside the HTML.

? With Graphql and Phoenix you use a RDBMS to provide data for the queries you write. Its not a replacement.

Its also not even much a paradigm shift in my experience. Queries are simply analogs to GETs and Mutations are analogs to POSTS. Thats about all you need to know to get started. To convert a REST app to a GraphQL app is ridiculously straight forward. What it does much better than REST is nested lookups, being typed, and being able to request more than one piece of data at a time.

I would say -> GraphqL + Phoenix + Postgres

From my perspective I wouldn’t choose CouchDB. For one, its a pretty obscure DB that doesn’t have a lot of support. For example almost all major hosting providers now allow you to launch an app with Postgres hosting out of the box.

Way way way way more tools and articles for building an app with postgres.

Also I would recommend Postgres to take full advantage of Phoenix and Ecto (the ORM). In Elixir GraphQL and Ecto are deeply integrated to avoid n+1 queries when you are writing nested lookups.

In my opinion having used Django, RoR, frameworks in Go and Rust, Elixir has the most robust and powerful ORM out of any language and it would be a shame to miss out on it by using CouchDB.

I prefer GraphQL over REST tremendously. For a large site, in REST we had this process of the Frontend would have to tell the backend what data they wanted, the backend would make the endpoint and then the frontend would consume it.

With Graphql the backend just defined all available data and the frontend picks and chooses what it needs. GrqphQL also prevents weird n+1 requests where you need to request the data of the children from a previous REST result.

GraphqL + Phoenix + Postgres is a game changer IMO

The main value proposition is to sell to the next person for more than you paid. Everything else about banking the unbanked or other vague goals about being better than fiat are to convince the next bag holder.

So the only use for crypto is that regulations haven’t caught up to it? Used to pay illegal immigrants and circumvent sanctions, which is still illegal whether or not crypto makes it possible.

No they are not. That rationale is a coping strategy at best and deliberately misleading at worst.

Tether is NOT a bank. They are not regulated and have no guarantee that depositors will be paid back. They promise a 1-1 backing and instead of people holding them to their promise their supporters desperately try to compare it to moderns banks.

No. Tether is not a bank. It is not doing fractional reserve banking. It is committing fraud. It’s that simple.

Short answer yes! Long answer: Statetrace works at two different levels. The first is to record the raw changes without annotations. Statetrace works 100% with any framework at this level.

The next level is to record with annotations. Currently we don’t have the annotation support for wordpress/drupal but it is something very easy to add.

Time Travel works by generating a SQL statement or a CTE, which transforms the raw audit events into a snapshot of the table at a point in time with extra columns for the annotations. This feature is currently exposed on the enterprise product through the UI (which exposes a SQL explorer for your warehouse), but we are slowly shifting those features into the GQL API of core (give a table name, get a SQL model). Time travel works on the transaction level so you don’t lose any fidelity.

I think it stems from complaining is lazy. Its much more difficult to see why things are they way they are or see the virtue in things even if they have flaws.

Its not that complaining has no place, its just that most complaining is is the lowest common denominator and doesn’t contribute much.

Is Web3 anything? 5 years ago

I’m not sure about patchy. I transferred money about 10 times this year and all the recipients wanted Zelle.

All of your other criticisms are valid, but also exist in a system where you trust your wallet with a third party service. the majority of Americans would use a bank like service that manages their key instead of managing it themselves.

You also ignore the other risks that crypto introduces. Like losing your key, password, your exchange gets seized, your exchange just straight up steals your money, or having a 1 character bug in a smartcontract.

Is Web3 anything? 5 years ago

I think ToR is the worst example you can use. Good in theory? Yes. In practice it is pedophile and drug honeypot with exit nodes run my the government with limited legitimate actual people using it.

Is Web3 anything? 5 years ago

You could use a scheme where two of three signatures allow transactions

So now social engineering hits and someone convinces my ‘bank’ and notary to allow the transaction to a third party. Now my life savings are gone forever.

In my real bank (no quotes) you have regulation. Banks are liable for fraud. Blockchains aren’t.

Now you could have pre assigned addresses that the notary and bank are allowed to transfer to, but now you have to think about edge cases. Every time i update my will I have to hire a blockchain engineer to update my smart contract and then hire another firm to audit it for errors so a bug doesn’t drain my account. Huge headache and much more expensive compared to the status quo.

Or allow transactions by and to a list of whitelisted addresses after a certain date or event (such as a missed canary).

whats triggering the canary? How can I trust that it will be accurate?

Also, my spouse can change or die. If my spouse and I died at the same time and my parent’s should get the money if they are still alive. now what happens? You have to map out hundreds of edge cases, like every permutation of my relatives wallets. Then I have to trust that the blockchain can tell these people are alive.

Current California State law takes all of that into account. It handles the edge cases in a way that code does not. Probate court is expensive but its better than everything going to zero.

Is Web3 anything? 5 years ago

All of 1/2/3 could be or gamed or hacked if not EXTREME measures are taken. As proven repeatedly by the hundreds millions in dollars in smart contract hacks and losses that have happened and continue to happen.

People can’t trust the code to do what they want, because when you read it you might mistake a 0 or a O. You trust someone else or machine to audit the code tell you the code will do what you want.

US court systems take into account the spirit of the law rather than the letter of the law. Its a feature not a bug.

Is Web3 anything? 5 years ago

Same thing exists in the US. Property ownership and property tax is open and publicly accessible

Is Web3 anything? 5 years ago

I’m not satisfied by the standard quo and want something better. But the current state of trustless web3 is not it.

My bank account is great. If I die there are clear procedures for getting my assets to my spouse. Even if I forget my account number or my password, my lifetime of earnings does not simply disappear. This can’t happen in crypto unless I trust a third party, in which case just using a bank in US dollars is much safer as there are actual laws and insurance covering it.

Maybe other countries are different,

I suppose the main advantages would be less dependencies (no Redis server). Less overhead (you aren’t routing though anything)

I haven’t looked at the exact performance characteristics but it would be fun! You would have built in load balancing!

Author here, combining Redis protocol and MsgPack is a much more platform independent way of building a protocol.

The redis protocol and Msppack are both only a a hundred lines or so for a parser. Meaning you can build your own from scratch in a new language if one isn’t supported.

Its also stupid fast.

Compared to protocol buffers which can be extremely complicated to grok on the binary level.

I built a more robust API RPC for Python here based on Redis and MsgPack: https://github.com/hansonkd/tino