HNHacker News
TopNewBestAskShowJobs

tiew9Vii

1,644 karma · joined January 6, 2019

submissionscomments
tiew9Vii··on Brython: an implementation of Python 3 running in the browser
I don't think Webassembly will ever replace Javascript in the browser. Javascript has a low barrier of entry and if you are creating React/Angular sites there's little to gain from Webassembly for someone not interested in safer languages.

Saying that I am really interested in Webassembly and think the word web in Webassembly does it a disservice.

I have started to think of Webassembly as a light weight JVM. It's heavy sandboxing makes it really interesting as an evolution to FaaS (Function as a service) such as AWS Lambda. Lucet which Fastly is using for their Compute@Edge reports 35 micro second code start time! I can't wait until Fasly put there Compute@Edge on general release so I can try it. I've been playing with Cloudflare workers and as they us Chrome to run WASM files you have to mess about writing Javascript shims so a bit rough around the edges debugging.

Webassembly should realise the original goals of serverless providing a cross platform runtime with security guarantees and be fast and lightweight.

Most people package an entire OS in Docker containers, with WASM they get a small cross platform artifact. This project already looks like a way to run them in K8s https://github.com/deislabs/krustlet.

It also looks great for cross platform media devices. Have the bulk of your code as a WASM binary and then have very thin platform specific shim the WASM interacts with.

tiew9Vii··on Generating JSON Directly from Postgres
Good reason being JSON is trivial to parse in the browser and webapps exploded in use? It's a valid reason but that doesn't mean something with a strong schema that has a good user experience is bad?

There's nothing fundamentally wrong with XML + Schemas just they are a hassle to deal with being verbose and more effort generating/parsing. XML still has a place it's just forgotten and not cool anymore. Personally I like XML, maybe not for webapps message format but it's properties still hold today.

Protobuf / Thrift etc are probably a evolution of XML+Schemas on the web using a binary format. They are less verbose and Javascript isn't the Javascript of 15 years ago so also easy to work with in the browser.

It seems my original comment is down voted which is fair enough. I've been generally surprised at how much better an experience all round it has been switching to Protobuf instead of using JSON. My code is easier, there's less of it, it's more performant, it's easy to share across the backend/frontend layers, it has a long list of languages it can be used from with zero effort.

I was a bit pessimistic about it but had a API I needed to save bandwidth on for end users so tried switching from JSON as an experiment. I expected it to be a hassle but it turned in to the complete opposite. Any REST service I create going forward JSON won't be my first choice. Protobuf is simpler to work with in the browser (no manual parsing/typing the wrong field) and server side, it's also far more efficient.

For clients they get evolution support, can download prebuilt parsers/deserilisers or create there own from published schema definitions, I see it as win win all round and no drawbacks.

SOAP is probably closer to gRPC?

tiew9Vii··on Generating JSON Directly from Postgres
Rest over HTTP works well. You get easy load balancing, caching etc.

JSON seems to of been the message format of choice due to easy interoperability with the browser. However, with this, you end up writing serialisers on the server, deserialisers on the client. That's the majority of the job, reading what JSON fields you need to send down and for the client reading what JSON fields to read.

Using unstructured JSON has lead to OpenAPI previously Swagger. You put a bunch of metadata in your server API code to generate some loosely typed schema describing your service so clients can generate deserialisers etc. This is still unstructured JSON and seems like a kludge.

I've recently had success using Protobuf as the message format for HTTP API's. I still get easy load balancing, CDN caching, all the benefits of HTTP, which I'd lose if I went gRPC, Protobuf has a smaller size than JSON and add Brotl compression reduces page sizes. The excellent thing about using Protobuf over HTTP is it does what OpenAPI attempts to do without the kludge. You publish your Protobuf schemas, the server generates strongly typed objects to use, the clients with Typescript generate strongly typed objects. There's no more serialising JSON or manually reading JSON. You get typed parsers generated from a schema definition, so you call `encode` or `decode` on them.

Protobuf works across a large number of languages. My server side code has become trivial, my client side code has become trivial. As a side effect, I spend less on network bandwidth, pay less in compute with de/serialisation, and clients see a speed increase due to reduced page load sizes. Protobufs then also reduce the need for OpenAPI. Grpc entirely removes the need for OpenAPI/Contract based testing but going full Grpc on the client-side in the browser has more setup with a special proxy and you loose the load balancing/caching of HTTP.

TLDR; stop using JSON for web API's using something such as Protobuf with a schema. JSON is the equivalent of running your app in debug mode.

tiew9Vii··on Cool URIs don't change (1998)
This is a recommended read on the subject "Designing a URL structure for BBC programmes" https://smethur.st/posts/176135860.

Clean user friendly urls are often at odds with persistent urls because of the information you can't keep in a url for it to be truly persistent.

tiew9Vii··on PyCon US 2021 Recordings are Available
I had a situation I gave a method argument a type hint, I then called that method with a completely different type by mistake. The type checker didn’t pick up the error so I got a runtime exception where I’d expect a type checker to catch the issue.

I don’t have the specific example, it was something I observed not so long ago, said well that’s shit, fixed my code issue and moved on. Not being a huge fan of Python outside of small scripts and only using Python as told to use Python I took little interest in the detail as was a case of just get the job done and move on.

It’s been a while since I read the paper I shared but think that mentions it something similar if I remember correctly.

tiew9Vii··on PyCon US 2021 Recordings are Available
The thing with Python types is that they are “type hints” and not true types, hints is the keyword. There’s also two type checker implementations.

As they are hints it means you can still pass in wrong values in some situations and what types check on one implementation may not type check with the other implementation. So the types are superficial only in Python.

The paper “Python 3 types in the wild” at https://news.ycombinator.com/item?id=26788177 is a good read. I enjoyed reading it and found it useful.

I’m a fan of types as the compiler tells me I made a mistake and blocks me making mistakes. You can use the type system to make certain errors unrepeatable (impossible to make). With that my preference is use a language where types are first class rather than a language trying to retrofit some loose form of type checking on top which is nothing more than linting.

Being a fan of strongly typed languages I was eager to use types in Python when I had to involuntarily use Python. After a few instances of putting in type hints and things type checking when they shouldn’t I mainly don’t bother with them now outside of data classes as they where not catching bugs I wanted so still getting runtime errors.

tiew9Vii··on Confluent S-1
Interestingly they don’t list Apache Pulsar or Splunk as a competitor yet list AWS.

Splunk acquired Streamlio the people bind Pulsar in 2019 so you have to ask with the Confluent IPO what are Splunk doing with Pulsar? It is looking like a missed opportunity at this point.

Pulsar is a direct replacement for Kafka. Pulsar even supports the Kafka wire protocol.

tiew9Vii··on Confluent S-1
Yes it is yet they have massive losses. The money is also likely in the same ballpark of Cloudera / Horntonworks and other companies providing professional services for open source software who have all struggled to make the business model work.
tiew9Vii··on Confluent S-1
They offer commercial support services/contracts for Apache Kafka.

They sell proprietary Apache Kafka add-ons for enterprise such as authentication/authorisation RBAC. The open source Kafka release supports auth/authz but not consistently between the suite of tools. They also have a monitoring UI etc.

They release the commercial add-ons under the Confluent platform distribution.

They heavily push ksqldb which is a sql layer on top of Kafka that competes with https://lenses.io/. Confluent market it as a DB but that’s pushing the creative marketing.

They provide a hosted Kafka service.

The hosted service is likely more attractive to SMEs. It also has competition with the SME market with AWS providing managed Kafka. Confluents service does have extras on top of AWS like tiered storage behind a non open source license but nothing is stopping any one building there own tiered storage. I can see people using Confluent’s cloud but don’t see it being big.

Large corporations will (have) generally hosted/run their own Kafka.

I like Kafka but can’t see how Confluent can be profitable.

Cloudera is an example, they couldn’t make the service business work, I feel Confluent will have the same issues.

Elastic search have issues with AWS eating some of the market. Confluent have the exact same issues.

The Kafka is your nerve center narrative, that is great from Confluents perspective financially but it’s no different than the old enterprise service bus as the nerve center for everything. There’s a reason we don’t see that anymore.

tiew9Vii··on Rescuers question what3words' use in emergencies
I was thinking the exact same thing.

With a geohash someone only needs to provide 7 to 9 characters depending where they are and the accuracy needed.

Also as each additional character in the hash adds accuracy it should be easy for an operator to easily sanity check i.e caller to operator "I am hiking in the lake district...my geohash is ..." the operator only needs the first four characters to confirm if the general location is correct or not.

I guess it's still prone to spelling errors from operators inputting the data from a call.

As others say if you are installing an app to give you a location i.e. a geohash you can use an app to give a lat/lng.

tiew9Vii··on Rethinking the computer ‘desktop’ as a concept
Native is now broken/deteriorating because of the web/online first obsession.

I moved house last year and was on a very poor internet connection, 0.5Mbps up, 1Mbps down at best, often unreliable.

This made using my computer (Mac's) unbearable!

When I turned on the computer and it started up, apps that auto start in the task bar would phone home checking for updates or whatever and block until they timed out / got a response. The computer wasn't usable until all completed due to blocked UI.

Opening an application the same. When opening an app it'd phone home to do what ever it does while blocking everything else until complete so can continue with the startup process. The obsession with analytics in apps made latency in apps much higher as I suspect analytics where being sent from the main thread instead of best effort in a background thread pulling from an event queue.

Then there's the obsession of packaging a SPA webapp in it's own browser to run locally as a perceived native app, aka Electron. Take Teams/Slack both clunky, unresponsive user interfaces and resource hogs for what they are.

tiew9Vii··on How to get rich without being lucky (2019)
Why did you invest in a index fund? Who made you aware of index funds?

My point is when you know about what to do with your money it’s an obvious one which has payed off for you. Did you learn about index funds from family, friends or on your own?

As a grad from a similar time I never even heard or knew what a index fund was at that time. I was always good with money never spending what I didn’t have and a small amount of savings but had very little knowledge on finances in general. My parents never taught me, they where not poor but not well off, similar friends never talked about money.

It’s only later in life through curiosity and reading financial posts on the internet am I discovering how to better use my money. If someone would of sat me down in the early 2000s to educate me as a young adult I’d probably be well on my way to a million now. As a young adult fresh out of school/college unless you come from a family that is financially savvy it’s hard to know what to do with money.

This is probably why wealthy families create wealthy families.

tiew9Vii··on OpenBSD 6.9 Router Benchmarks
Only on a 100Mb network and use OpenBSD with an APU4 so it’s more than fast enough for my connection, speed isn’t a problem.

The big advantage I see with OpenBSD is the simplicity.

Everything about it is simple. Where things are installed and how they are configured is far more consistent than Linux. The inbuilt man pages are fantastic compared to other systems. The fact it comes with nothing installed and you need to turn things on makes it easy to manage as you know exactly what is running, in turn this makes keeping up to date easier. Pf is fantastic and again simple.

From not knowing OpenBSD only using Linux before I had a home network with multiple VLANS, cross vlan routing, nat, dns filtering, dns over tls etc in very little time.

I’ll be honest the reason I switched to OpenBSD was mainly to play with something new. I previously had a home router running dd-wrt which was ok but clunky ui, hard to know what was running, upgrading was downloading random untrusted binaries off the internet for specific builds that work on my router. I decided this isn’t great so my options where play and build a OpenBSD router or try something like the EdgeRouter.

I am glad i went with OpenBSD, it doesn’t hide anything from you, you have absolute control and it’s simple to configure with a few static config files. You really understand what is happening.

On top of that, since setting it up, I’ve never touched it. No reboots, no going changing settings, it just works. It’s been set and forget.

tiew9Vii··on Exploring ZooKeeper-Less Kafka
Kafka from what I have seen is winning in large orgs.

The main reason is Confluent, the marketing and the commercial support contracts that comes with Confluent. Then you have the ecosystem around Kafka is a bit more mature.

Personally I prefer Pulsar for its design but Pulsar has no Confluent equivalent or marketing department. I’ve yet to do a Pulsar deployment but deployed Kafka at several large orgs.

tiew9Vii··on Game developers sharing their salaries on Twitter
I always see the advice never give your asking salary upfront.

Recently I want to move work and willing to take a pay cut just to move so gone in with the honest approach which I am told is bad for maximizing salary. Right now I'm not to fussed about maximizing, it's just moving.

The conversation normally goes:

Company: What is your current salary

Me: $XXX,XXX, that is negotiable as actively looking to move and will take less for the right company. *(I understand it's a high salary to the rest of the market where I am even though I am not in the US so salary is still well below US Junior FAANG)

Then it's been one of two things:

1) Get offered 30-40% less (20% less is my ballpark, 25% for a company that really interests me) 2) Bye

I've been told the job market is booming where I am but in 15 years it's the first time I've struggled to find a job although my skills are in demand overseas. I feel I'm fairly competent, I get told good things by people I work with and my salary has naturally grown through promotion based on my skills/performance yet I'm starting to question is it just me and I'm not that good why I am now struggling to find work despite going in to large orgs as a small dedicated team to do projects they couldn't deliver.

It seems if I take a big paycut to where I was 5-10 years ago, forget 15 years of career and revert back to writing NodeJS/Python apps my luck will be better.

tiew9Vii··on Ask HN: How to return large response over an API?
If you can chunk the response json-seq/xml (sax parser) may be worth looking at.

The server can incrementally stream a chunk and client incrementally consume a chunk keeping flat memory usage.

I think gRpc also supports streaming but don’t know much on it.

JSON is a bad format for large files as generally you need to read the entire file in to memory before you can use it as you observed.

tiew9Vii··on Fines up to $66k or five years prison for Australians returning home from India
I am not sure where you are getting your information from, I assure you it’s far from the correct.

I suggest a visit to https://immi.homeaffairs.gov.au/visas/getting-a-visa/visa-fi... and do some research in to visa options from the source of truth not a tabloid newspaper and read the requirements, processing times and the money involved.

tiew9Vii··on Ask HN: Job Market for Elm Developers
Unfortunately FP jobs seem to be niche and extremely location dependent. Python and Javascript are winning the market, FP had a slight increase in interest but sadly fading, job wise anyway.

I say this as someone who didn’t know much FP 8 years ago, invested a bunch of time learning, picked up a few good jobs using it but now cannot get hired due to no FP specific work in AU and non FP roles seeing 8 years of FP get a bit weary, despite a decade of Java, Python, PHP etc before my FP roles.

ELM is a great Trojan horse into learning FP if you want to learn FP though.

tiew9Vii··on Ask HN: What stack would you use to build a CRUD web app on the JVM today?
You can use types to help with the outside world by making error states explicit encoding them in types. ZIO for example.

I can write programs without code covering all scenarios by stubbing out methods with types, using ADTs etc then it’s a case of implementing a function to run it all.

However, I completely understand where you are coming from.

I had some of the same issues until I worked with a great team who showed me the abstractions, why they are useful and how they work.

If I hadn’t of worked with the team I did I would likely of still been agreeing with you. I think the biggest problem is it’s hard to understand on your own unless you are deep in to the theory. You don’t need to know the theory deeply to use the abstractions but unless someone shows you how to apply them it’s hard to discover.

With that your last comment is exactly right. If you are not utilising Scala type system and other features Kotlin or Java will be better. Java is moving quick these days and Kotlin is closer to a better Java than Scala is.

tiew9Vii··on Ask HN: What stack would you use to build a CRUD web app on the JVM today?
Yes.

Http4s, zio-json, zio-config, scalate templates, doobie for the db.

These are libraries not frameworks but the way it’s designed you don’t need a framework as so easy to slot together.

Think of it as writing a crud app with Express on NodeJS. Or one of the other bare bones HTTP server/routers.

Admittedly it’s an acquired taste but if understand them it’s the most flexible/simple I’ve used across various languages.

You also have Play framework which is a full stack framework, Java like but Scala syntax and closer to Spring Boot than Http4s etc.

tiew9Vii··on Weary of Work
Similar

I wouldn’t say specifically software, it’s more in an intense office environment / thought work under high pressure.

Hard physical work I’d go home at the end of the day 10-12 hours, tired but could switch off mentally and relax. On the days off I was ready to take on the world and make the most of it.

The tough software jobs like I’m currently in have left me mentally drained like a zombie at the end of the day then physically unable to go do some exercise to get out of the pattern with some mild depression.

I found a greater sense of achievement in physical work. Working through a high number of pallets a night stacking shelves leaving in the morning with a shop isle looking pristine. Tipping one ton bags of sand or gravel with a spade and wheelbarrow, digging trenches, moving heavy materials etc etc. It’s easy to see the work you did, it’s clear, it’s simple, there’s no faff. Moving Jira tickets, sat in endless meetings feels like nothing gets done, you are working for the sake of work without doing work, people talk using the same management speak from a book answering questions without answering questions or taking ownership and instead grandstanding.

As much as I love software, right now if labouring payed, I’d switch in a heartbeat.

tiew9Vii··on My experience with sexual harassment in the Scala community
> in the Scala community

The allegations are serious. If the author believes she was drunk and did not consent to unprotected sex and taken advantage of that should be reported to the police and the courts due to the seriousness, it’s rape.

The title is damaging “in the Scala community” it tarnishes a programming language and individuals who use the language due to the act of one person. The language is dieing with dramas among 1-2 specific people out of thousands.

No one in the right mind would condone the allegations or the perpetrator and sounds like at least one incident a matter for the police.

The allegations are against an individual and the ScalaCenter handling, not the community. The blog post lists individual people in the community who supported the author. I do wish the title wasn’t as click bait or more specific to the perpetrators as it is damaging, killing a really interesting industry and technology.

I hope the author finds the peace and justice they deserve from sharing this. The public naming and shaming will have serious repercussions for the accused.

tiew9Vii··on Court rules grocery store’s inaccessible website isn’t an ADA violation
The art of standard serverside generated HTML and progressive enhancement or a page composed of JavaScript apps/widgets for interactive elements seems lost today. In the age of React everything is a SPA first by design from observations.

Having previously worked and taking a great interest in the schematic web last decade, progressive enhancement, accessibility, page size, etc etc the modern web is disappointing when what should be a simple HTML website instead be a blank white screen while it downloads 2mb+ of assets then a SPA bootstrap to show something loading json blobs embedded in the page and leaking information with the insistence of doing everything client side.

tiew9Vii··on Woman earning $750 a week gambles $3.7M
It’s interesting you use the word “casino”.

She wasn’t gambling in a casino. She was gambling in what is essentially a pub that has a large room filled with pokie machines.

This is common across Australia, pubs have dedicated rooms (so called vip rooms) filled with pokie machines as they bring in a lot of money for the owners. Pubs are ripping out dining/general social space and putting in Pokie rooms.

It’s cultural to go have a pint and a bet.

She’s absolutely responsible for stealing but Australia’s obsession with Pokie machines and amount of Pokie machines is also problematic encouraging problem gambling. Pokie machines provide no benefit to anyone except the owners.

Not being Australian born the gambling commercials on tv was also eye opening.

tiew9Vii··on Deliveroo shares drop 30% on UK IPO listing
I thought it’s normal at IPO to have a lockup period of 90-180 days for staff preventing them selling shares.
tiew9Vii··on Kafka without ZooKeeper
This is one of the differences between Kafka (Confluent) and Pulsar.

Confluent make big bold claims "Exactly once delivery" and have aggressive marketing.

Pulsar on the other hand would say we have "effectivley-once". Reading Pulsar docs vs Kafka, Pulsar are very modest about functionality and have no commercial marketing at all.

These days I have noticed Confluent in blog posts do use effectively once but marketing is as aggressive as ever.

Credit where credit is due. Confluent, the marketing and big bold claims is why almost everyone is using Kafka and not Pulsar and may not of even heard of Pulsar. I do find Pulsar architecture more interesting, since Splunk has brought them though it's remained in the background like it always has with no huge push to sell it.

tiew9Vii··on What I learnt shopping for decent computer speakers
I went through the computer speaker setup options at the start of lockdown.

In the end I went with a reasonable well reviewed for price (cheap) front ported passive speakers Jamo S 803. Front ported as they sit close to a wall so front porting is supposed to stop the boomy sound. They are small enough to sit on a desk but slightly bigger than average computer speakers so get a fuller sound.

I then paired it with a SMSL SA300 class D amplifier. The thing is tiny, has bluetooth, aux in and usb dac. I connect using the inbuilt usb dac instead of aux in as noticed with my imac there was a very slight audible hum from computer noise on aux. As it's a class D amp it has low power draw.

For a small office home office (small spare bedroom) I find it a good setup. The stereo imaging is very good, it's like voices are right in front of you, the tiny amp is more than powerful enough for the small room (it's not a home cinema).

The setup worked out cheaper than a reasonable priced pair of active studio monitors. It seems better than most computer designed speakers I've listened to and again cheaper than the better computer designed speakers with usb dac built in.

tiew9Vii··on The Modern Java Platform – 2021 Edition
> Types almost never save the day and they don't add much to the understanding.

There’s a saying in strongly typed languages “make illegal states unrepresentable”.

Java doesn’t let you get all the way there but it’s better than nothing.

When you look at strongly typed languages with a good type system, often when you compile it just works.

Besides hello world, I’ve never written program beyond a few lines that has just worked in a dynamic language.

...I do like clojure and the repl workflow and how everything is data. Haven’t done much besides play with it but have a friend who writes clojure professionally on a large codebase and their feedback is most of the errors they now see wouldn’t exist with a type system.

tiew9Vii··on The Modern Java Platform – 2021 Edition
Type hints are optional.

Type hints are very different to a strongly typed language with a good type system. Haskel as an extreme feels like algebra, you have a type a, you need a type c, you have a function a to b, and a function b to c, you just compose them together and from your a you have a b. Tools like hoogle can tell you the function to use for the given args to get to the final type you want.

Ignoring Haskel even Typescript can let you express things hard to express in Python with ADT’s etc.

Docker has nothing to do with Python but if you want to produce an artifact you can just run anywhere it solves the dependency issue in that the decencies are in the image and you don’t need to run pip install on a deployment server.

tiew9Vii··on The Modern Java Platform – 2021 Edition
That's interesting.

I'm not the biggest Java fan, I can tolerate it. Recently working on a Python project I find I'm massively unproductive compared to something like Java or more specifically Scala as using Spark.

Not having strong types and limited type hinting. I have no idea what things are, is it a int, string, object etc, clicking through in an IDE to see code/docs isn't as great as it's hard for an IDE to inspect the code compared to strongly typed language.

Not having a compiler means I have to have unit tests doing what a compiler would do or finding out I have syntax errors or other errors at runtime. This massively throws of my development flow as can't lean on the compiler to find trivial errors. Rather than doing compile I have to hope I have a test case with high coverage to instrument the code to get a syntax error or I have to start / deploy it to get the error.

There's a great deal of issues with dependency management. Venv, Docker etc help with this but it's a bunch of extra stuff on top I now need to worry about and sometimes still hit errors.

The only time I find I'm relatively productive in Python is writing a short 100-200 line script to do one off tasks / sysadmin / devops type scripts.

The fact if I change an interface, rename a method I need to recompile I find a huge advantage as everything breaks and I worth through the errors one by one and once complete and no more errors I have confidence the refactor is complete and the compiler has verified it.

← PreviousPage 8 of 13Next →