HNHacker News
TopNewBestAskShowJobs

byko3y

102 karma · joined August 8, 2019

submissionscomments
byko3y··on Several core problems with Rust
On the other hand, lets face it: most of the time security in IT systems is the least priority. I mean after shipping fast, iterate fast, better performance, compatibility, architecture soundness (whatever it is), convenient tests, docs with UML diagram, well-designed interface — and somewhere in a distant drawer on the bottom you may find a note about security issues. It's often times people talk about importance of security after it destroyed the whole business.

We need more of the security. We probably don't need the Rust though.

byko3y··on Several core problems with Rust
Man, I explained it in the first sentence of the article — it's not bad, it's much worse than it could have been. The main body of the article is not hate — it's plain facts. Everybody working on a significant Rust codebase agrees that Rust compilation takes eternity. Complexity? I know people that like complexity, they would say "that's a great language because of how hard it is to write a program in it!" — complexity would feel like a praise for them. Shared state? "Just don't use it, you are doing it wrong". That's is, where is the hatred?
byko3y··on Several core problems with Rust
There are programming languages/models/runtimes that crash and recover, there are models that gracefully degrade. Rust cannot recover. Neither can C++ in many cases e.g. when you have an exception in a destructor then it's a guaranteed `std::terminate`.

Do note that C did not have such a flaw built into language — C++ authors invented it and Rust inherited this flaw (the authors simply did not feel like it's a flaw). I mean specially designed embedded C code can survive total RAM erasure and still perform some meaningful work (with CPU registers and ROM intact). Or compare it to BEAM that can have processes crash all day long and still continue to work. "Memory safety at all cost" is not a practical requirement — it's theological.

byko3y··on Several core problems with Rust
>ORMs, OOP, Git, JavaScript bloat, Linux vs Windows

ORM and OOP whine is niche, agreed. Linux vs Windows is irrelevant because windows runs linux nowadays — I don't think I've read a single article about it.

Git? Okay, mostly circumvented by solutions that don't carry any implementation from the original Git, but have "git" in the product name.

Javascript bloat? I'm pretty sure that's still a hot topic. I don't remember it being solved, do you? Like if I open website and it greets me with a window suggesting to apply cookie policies for 300 (three hundred) trackers on the website — isn't it worth talking about?

byko3y··on Several core problems with Rust
Yeah, the article was written in Markdown, LLM-s employ markdown formatting too. It's not a typical length of LLM response — it's approx 1.5-2.0 times longer than a typical long LLM response. Not easily noticable to a human being though, indeed.
byko3y··on Several core problems with Rust
Because it follows same structure as the one used by LLM-s. At least there is a reason to think so — before you've tried to actually read the article and realize LLM-s just don't write text like this... yet. Of course, this structure is also the one used by scientific articles, which I read a lot too, so I'm really inclined to follow this style. "Has the form of scientific article but statements are not precise = AI slop" — that's the implication.

Funny fact: one of the reasons Qwen suggested my article is LLM-generated is because it considered link as impossible. I was so gaslit I opened the article and clicked the link. And it worked. Mic drop.

byko3y··on Tell HN: ChatGPT is freaking amazing and I don't get the negativity
Funny question, considering the fact I've posted a link to my recent article onto the main page. I employ LLM-s a lot.

Few days ago I made an experiment — put my article into Qwen and asked to evaluate it for LLM-generated content. To my amazement it told me the article is 70-90% AI-generated. Which is even more weird considering the fact I know I wrote it all top to bottom. I think I spend so much time in LLM conversations I actually started copying LLM style.

I mean if you look into the article https://bykozy.me/blog/rust-is-a-disappointment/ — it's structured exactly like LLM implicit templates (a.k.a. fine tuning training datasets) do: short reiteration of the question, list of key points, key points explained exactly one by one, final summary. However, why would I not write the article this way? Just to make sure a person skimming the article would not pattern-match it to "formatted as LLM output"?

If I wanted to disguise an AI-generated article as a 100% human content — I would do it. But thanks for the suggestion — might be viable to consider doing so, because I just scare too many people away this way.

byko3y··on Tell HN: ChatGPT is freaking amazing and I don't get the negativity
My firefox automatically installed perplexity search engine — it's actually much better in for just searching the web. Or use Grok. If you need to generate content there are lots of better AI-s which do not limit request rate as heavily: gemini, deepseek, qwen. If you need to write and refactor code, Claude is the best one I've met — but it's mediocre at pretty much anything else. I stopped using ChatGPT after summer 2025 incident with response quality plummeting. It was average LLM before that incident, but afterwards there was really no reason to get back to ChatGPT again for me.
byko3y··on Making Python's dream of multithreading come true
I'm the author of the article. You can write questions and suggestions here, on habr.com, or using my mail (byko3y_at_gmail_com).
byko3y··on Implementation plan for speeding up CPython
>"It would be better" if someone designed it from the beginning with current applications in mind. But if anyone actually did that back in 1980, they wouldn't have been successful

Strongly disagree. Although x86 was dominant on desktop PCs with MS DOS, Nintendo Entertainment System used MOS 6502 which is a lighter version of m68000, while Sega Mega Drive used a full blown m68000. Apple II desktop also used MOS 6502, HP used PA-RISC for their HP-UX servers, and Sun replaced their 68000s with SPARC in late 80-s. Alpha achitecture was so successfull there was a Windows NT port for this achitecture. So it wasn't really game over as of 80s, and even in 90s the market was still diverse. It's only by 00s x86 together with Windows NT series achieved total dominance, even in small server segment.

>So I guess the point is that technology adoption proceeds by evolution, and trying to plan 10 or 20 years ahead of time never works

Right conclusion - wrong reasoning. Quality of product is never a main driver of sales. That's why to succeed you need to market it first and then elaborate some way to make it usable. That's where, for example, Motorolla, Alpha, MIPS failed, and that's where ARM won as an umbrella brand for actually 4 incompatible architectures (original ARM, AArch32, AArch64, and Thumb a.k.a. SuperH).

byko3y··on Implementation plan for speeding up CPython
>I recently wrote a C base class (https://jcristharif.com/quickle/#structs-and-enums) for defining dataclass-like-types that's noticeably faster (~5-10x) to init/copy/serialize/compare than other options (dataclasses, pydantic, namedtuples...)

YouTube also encountered the same problem. Their solution sounds kinda like "never use pickle, because it's slow. Use custom serialization".

byko3y··on Implementation plan for speeding up CPython
Frankly speaking, I had this impression too. The reason why JVM and JS uses own bytecode for implementing JIT-compilation is because main means of optimization are inlining and vector scalarization (convert complex object to simple ones). E.g. you have a container that hold integer and does nothing else, thus when JIT-compiling you can skip the whole boxing/unboxing and manipulate a single integer value stored in register. However, you cannot do that in a simple ways if your integer container is a C extension black box — you cannot "inline" the container's functions and reduce its store-loads.

This is why PyPy reimplements standard library in RPython — so you can JIT-optimize it. But it feels like Mark Shannon knows nothing about these efforts — which is kinda strange considering his position of core CPython developer.

>There are other lower hanging fruits, like optimizing core data structures (e.g: the implementation of python dicts)

Unfortunately, you cannot easily implement efficient data containers without rewriting existent python code. The latter one relies heavily on dictionary-based access to pretty much everything, and you cannot easily convert "string hash" access into "record offset" access, because you cannot know a priori what object has what structure and converting hash into offset is basically the same dictionary lookup. For example:

a = A() a.field = varname + 1

What can you optimize here? What "varname" is? What A's structure is? Is "A" a class or a function? Not only you are unable tell the semantic of the code just by looking at the code — you can't even tell the semantic after you've examined the "A" and "varname" on some previous iteration, because somebody might've declared/modified those on outer scope or directly modified "A" or "varname".

Last year in my spare time I've been working on an unpublished library for python multitasking with shared memory structures (probably will make some blog post in few weeks and link it here), and I also encountered the problem of inherently inefficient implementation of python basic types. However, I'm yet to find the solution without breaking compatibility with existing code. For example, if you look at ctypes, they have some very efficient containers, but using them in a regular python code is a pain, and the c-python interface eats most performance benefits of efficient containers.

So what's really needed for optimization of python is some kind of python subset, like RPython but probably more human-friendly, so efficient containers can really become efficient while automatic optimizer can select or create automatically those efficient containers. Just like V8 JS engine does, which stores objects in records with static structure. It happens to works in JS for most cases. Countrary, in Python it does not work for most cases, that's why we have so much struggle optimizing the Python.

byko3y··on My platonic ideal for how engineering hiring should work
>The real truth is: hiring is a crapshoot. For any position and any field. Software engineering is no different

I tried building spaceship and failed. Fiend of mine tried building a spaceship and failed too. However, I know of people who built a spaceship. So is building a spaceship a crapshot?

Reality is: 95% of HRs are incompetent. That's where randomness comes from. Take a random man from street and assign him for HR role after a brief training -- you'll achieve a similar performance to those 95% HRs.

Everybody's talking about hiring the engineer, but so fewer people talk about finding a good HR that would help you to solve a "simple" problem: how to find a good engineer with small experience and small salary that would not leave your company for the next few years and would become after several months just as good as 70-100$/hour engineer hired from top software company, while later most likely still gonna need some time to adapt to your product to become efficient.

byko3y··on Ask HN: How to do cross platform GUI?
>In a sane world we would already have webviews on all platforms and the problem mostly solved for client applications

Isn't WebView kind of work around for web browser being overbloated? I mean they made single instance of browser and interfaces for embedding that single instance, but do you really need that for desktop?

byko3y··on Ask HN: How to do cross platform GUI?
>Price seems to range from ~$2000 to ~$4500 to use it, which feels a bit steep

Yeah, I feel like Embarcadero/Borland took a completely wrong turn with their price policy. Instead of making the tool widespread and make small money from huge amount of places, they decided to go on full vendor-lock where you either get all or nothing, so Borland got nothing eventually and ceased to exist. That also burried my carrier prospects in that area, which is so sad considering how good the Pascal is as a language compared to C/C++.

byko3y··on Ask HN: How to do cross platform GUI?
>I routinely encountered scenarios where accidentally passing values of the wrong type to core standard lib functions produced wildly unexpected behavior that would take hours or even days to debug

Could you provide a concrete example?

Intuitively I do understand ClojureScript is not as seamless as some people say. First of all, Clojure is kind of a database-programming language with fundamental data types built around concurrency, while JavaScript was single-threaded until recently (and web workers used shared-nothing model). Second, Clojure is build around Java specifically, not any other language. Java has some strict type system with immutable complex objects being pretty much native way of doing things, thus Java is great for implementing dynamic types on top of it.

But I feel like not having undeniable proofs of fundamental flaw in ClojureScript. For example, JavaScript fundamentally lacks copy-on-write complex structures. Thus development of copy-on-write libraries is painful e.g. ProseMirror which can become completely broken until page reload which is bad for Single Page Application. However, could it be that ClojureScript... just works?

byko3y··on Ask HN: How to do cross platform GUI?
>Server-side rendering is a business need not a programming need. A company like Spotify may want to change the UI without updating the installation

The topic is about general desktop GUI applications. Some users of desktop applications don't even have internet connection e.g for security considerations. Tell me more about changing application UI without internet connection.

byko3y··on Ask HN: How to do cross platform GUI?
>Compared to Slack it was barebones. You had a list of conversations and a view for the conversations themselves. I'm not saying it's bad; I'd probably prefer it in fact. But it's not the same product as Slack. This comes back to my point about Electron vs. others, maybe the reason Electron apps are slow is because Electron apps typically have more functionality

Old Skype was a P2P networking application, which is a way more complex functionality than Slack's client has (excluding Chromium itself), but it was invisible to a regular user. Server side of Skype had only basic things like authentication, simple messaging, contacts data, and telephony gateways (paid service). It didn't even store message history on server side, which was PitA. Contrary, Slack has a lot of heavy logic on server side thus taking heavy financial losses and unable to become profitable.

>Perhaps, given sufficient memory, you can also run clang in the browser (WASM) so you can compile and link in Chromium too

I wass talking about framework/toolkit, because we are talking about framework/toolkits. You cannot run Chromium in WASM to debug it, and it would take days to compile chromium in clang-WASM.

>Electron, Qt, Swing, JavaFX, Flutter all take the approach of drawing every pixel themselves, not using any "native" widgets rendered by the OS vendor

There are no native widgets on Linux and other posixes, so your statement is true for them. However, for Windows Qt is able to optionally use native drawing routines. Firefox and Chromium use native routines too, but the extent is way more restricted. Also, Qt allows you to use fully platform-specific features, which is very problematic in Electron. The most basic example is date formatting, which almost never works the same way native applications work, you always get small differences here and there.

>Anecdotally all the Electron apps I've used have been beautiful whereas the Qt/GTK ones look stuck in the 90s

Heavily depends on applications you used. I don't think you tried to use any 10-years old electron application, because electron itself is 7 years old. Have you used VirtualBox?

byko3y··on Ask HN: How to do cross platform GUI?
><video> being enough to embed a video into the view versus subclassing a C++ Qt class or whatever song and dance it is in other frameworks

What are you going to do with the video? Coz that's where the problems with electron begin to appear. For example, you want some controls for seeking, displaying time, copying link, full screen, etc. And suddenly you get yourself a slow youtube-like monster. I really wish I could continue to use flash-based youtube, because I had no performance problems with it.

>HTML snippets rendered for free (no need for an external HTML renderer)

Slack doesn't need to render html snippets.

byko3y··on Ask HN: How to do cross platform GUI?
>Chromium is the best UI toolkit ever created. What exactly are the arguments against Electron?

Because it looks ugly (i.e. non-native) on pretty much every platform. Qt has different levels of success at that, having most problems with macOS and Android.

Also, there's Qt Quick, which lies somewhere in the middle between classic Qt and Electron.

>It's slow to render? Wrong, Electron (Chromium) renders faster than Qt. The Skia engine is optimized to an extent that these other toolkits cannot compete with. It even has a Vulkan backend now

The reason why classic single-threaded GUI toolkit are the way they are is because you can perform a custom reactive drawing or just reactive UI update in a blink of the eye, so user won't notice any delay. I know there are some bad examples like java-based IDE bloatware, but there are good examples like... Chromium! However, you cannot develop Chromium with Chromium, but you can develop something similar to Chromium with Qt.

>Memory? It's 70MB

Haven't seen Electron application using less than 200 Mb of memory. For example, launching Skype plus chromium SPA takes 550 Mb of RAM on my system. JavaFX has similar problems.

>Slack is a slow monster, but it's a giant codebase that does things that would be simply impossible in Qt, GTK, Swing and others

Like what? I'm not aware of any special Slack's features that could be hard to implement using classic GUI toolkits.

byko3y··on Ask HN: Why have a knowledge base when anything is easily googleable?
>I created a sort-of wiki page of her in my personal notes app. But then I went to the actual page and found the same information there

Usually when I read wiki written by more than one man and need something more complex than "born xxxx, died xxxx", I feel like the page was written by schizophrenic with OCD i.e. the information is not consistent and writer is obsessed by formal correctness at the expense of clarity. Thus I cannot understand shit unless I'm already well familiar with the topic - but then what's the reason for me to read this article?

byko3y··on Ask HN: Why have a knowledge base when anything is easily googleable?
>Why have a knowledge base when anything is easily googleable?

Because it isn't. It's not even close to "anything". Only superficial things are googlable, and even then google's NN algorithms sometimes manage to mess thing up, providing some useless links instead of a single correct one. That's why I tend to use google for quick search, but then I back it up with my own notes and articles/books/webpage archive. Of course, most of the times I will never use the things I store, but once in a while it saves me days. Knowing that I don't save regular stuff every kid can find in a minute even if the original resource is gone.

byko3y··on Ask HN: Do you use inheritance when programming?
Yeap, same here. The last time when I actually created from scratch classes with inheritance was like 8 years ago. I never made this mistake again and used inheritance only when forced to by creators of some library.
byko3y··on Ask HN: How can I quickly trim my AWS bill?
The answer is simple: don't use AWS. You will never get out of this hole unless you move from AWS, because AWS is not scalable budget-wise.
byko3y··on Ask HN: If you could reinvent the web browser, what would you do differently?
First of all, I just want to empasize there exist kinda three layers: data -> presentation -> decoration. HTML still acting as a presentation, but in SPA it also acts as a decoration together with CSS. Secondly, we need to find what the data is. Because often the data is on the server database, while everything else is transmitting and caching the original data.

>In my current SaaS product, if we were doing SSR instead of client side rendering, our hosting costs would be through the roof right now

It's good you mentioned your product instead of generalizing implicitly. Because SSR in some cases allows you to prerender pages and host them statically, thus significantly reducing server CPU and RAM load, and also making page loading time very fast.

>Plus, using service workers, it can work offline, which is not really possible with SSR

Similar scenario is possible with SSR, allowing for completely offline operation. SSR implementations usually require scripts to be run on the client side, and also allow for defining explicitly server-side-only and client-side-only scripts, including full transition into kind of SPA for specific pages, as well as a full SSR prerendering with dead-static content on both server and client. And gzip can help to reduce the bandwidth required.

byko3y··on Ask HN: If you could reinvent the web browser, what would you do differently?
>I'm not clear what you're describing with "flexbox scrolling"?

"position: absolute" can be used to disrupt the two-way size propogation. Without it you either get shrinked content on y, flexbox wrapping problem on x, scroll appearing on a wrong element in some cases (or cropping for "overflow: hidden"), or you have to set width and height of the block with scroll using css "calc()" — all these solutions are ugly.

>My reasoning is that I want to prevent elements from overlapping and obscuring important information

The most simple example of overlapping elements is a background/border. You can look around this page and find a lot of overlapping graphical elements — it's not the problem, but overlapping text (and other content) is.

"CSS is awesome" example formally has no overlapping DOM elements, no "position" attributes. It's just a block with "border" style and "width" set to some fixed amount. Often this problem happens without border on the block and remains invisible, unless two such blocks are really close together and the text begins to overlap. Still no "position" involved though.

byko3y··on Ask HN: If you could reinvent the web browser, what would you do differently?
>I too am an SPA guy, specifically because I like the clean separation between data and presentation they allow, which HTML simply doesn't

HTML was never intended to separate data and presentation. That's what PHP and other server-side languages (ColdFusion, Perl, etc) were used for, because HTML specifically is a presentation. Moreover, DOM, as HTML representation, is also a presentation. Considering high availability of network bandwidth, I'd say there's no more need to squeeze data into client-server channel, that's where server-side rendering comes into play with thin client just doing presentation thing.

byko3y··on Ask HN: If you could reinvent the web browser, what would you do differently?
I'm pretty sure today's web is going at least two different directions that can't be easily merged together. On one side we have textual and basic graphical data that is supposed to be controlled by user, like resizing, scaling, copying, bookmarking, drag and drop, and so on. On the other side we have interactive applications supposed to work strictly as-designed with complex handling of internal state, like Adobe Flash or HyperCard did. When you merge those completely together you get a frankenstein, when you kinda have the content controllability until you don't, when the content is displayed as designed if you are lucky enough.

I would like to remind you the whole reason for creation of Angular/React/Vue/Polymer/etc — that is because you have this overbloated DOM which is slow despite being implemented in fast low-level compiled languages. The main reason is complexity of calculation of inline elements (text and images with wrapping) and two-way propagation of size (parent to child and child to parent). At the same time the whole idea of CSS as a customizable style description (similar to LaTex/MS Office/OpenOffice styles) is completely forgotten while becoming inseparable from the rest of the content e.g. visibility styles, inability to show the content in different sizes, etc. And now we need workarounds like Webpack and HTTP/2 for putting together separate files that are not so separate by their functions. Because, in fact, a simple textual HTML is separate, its CSS is separate, but dynamic application within this page is a single entity composed of html+styles+js+images — similar to adobe flash swf blob.

I've been writing native GUI apps for like seven years, but now I write web SPA, and the more I write them, the more I feel like today's HTML is not a good platform for true GUI application, because within DOM simple GUI things have to be implemented as complex entities. Yes, we got a flexbox which makes positioning much simplier than float blocks or scripted positioning. However, we also got "display: grid" and "column-width" which also implement flexbox-like behavior, but slightly different. In the end it doesn't matter how many layout mechanism we are going to have — it will never be enough.

Recently we got HTML5 canvas, including WebGL, but we got no good language to write the program for this canvas. Actually, WebGL is the closest to the double-world model of web browser I'm trying to suggest, because WebGL uses a separate high-performance shader language to describe the WebGL-canvas logic which is uncoupled from the main web page's logic. We can also render from a webworker into WebGL canvas, and chromium supports OffscreenCanvas capable of webworker rendering. However, both 2D canvas and WebGL lack one important thing — two-way composability i.e. include html page into canvas. Just like native GUI apps struggle with including native elements into internal browser, canvas struggles with including web browser into 2D or WebGL context.

Actually, Microsoft once solved this problem by implementing support of custom elements in the IE browser, thus bringing a two-way composability. However, due to windows-only nature of the solution it had not achieved wide acceptance. Some cross-platform execution environment is required for success, like JVM or CLR — WebAssembly being the most relevant today, but the composability problem has to be solved. Until then, the developers would still prefer to keep the composability by avoiding HTML5 <canvas> and clinging on the old DOM as long as they can.

And by the way, speaking about cross-platform runtime. JVM, CLR, optimized JS, WebAssembly, and non-native-architecture VM have similar performance, so it's really not the fundamental execution speed that killed Java applets, but a failed GUI model "every pixel is drawn by JVM bytecode". WPF, UWP, JavaFX tried to fix the issue, until "everything is web" came.

Now about a second small idea I have and I've been struggling with for many years of web surfing. Bookmarks, history, and tabs are not separate things. The gap between them is closing but closing very slowly. We are getting web services that live between pages, we are getting frequently visited pages as a kind of bookmarks, we are getting cheap tabs that are loaded only when user switches to them, but nobody is brave enough to erase the separation and create a single visited-tab-bookmark entity. Today's computational resources clearly allow us to save some amount of data about every visit without forcing the user to be a bookmark keeper, especially when the user has no convenient tools for managing current tabs he's working with, and as for me I work with 50-300 tabs daily, so it's really a pain to manage them with this "ten tabs on the screen"-oriented tool modern browsers have. I know tree-like tabs exist, but usually they have their own issues. I'd prefer to open the tabs in a full-screen view, preferably with preview. Some people in the older days would save onto HDD every page they visit — they had a struggle sorting all the crap they've got.

byko3y··on Ask HN: If you could reinvent the web browser, what would you do differently?
>Consider that with chrome (and chromium based browser) we're close to the situation we had back in the days with IE. >So I'd say open standard definition for web API should come first, later each browser will have their own release process to include them inside but at least behavior and aspect are defined upfront and this will avoid lots of issue

Just a sheer complexity of the layers being deposited during the current and the previous century makes it impossible for a single person to understand all the possible interactions. So today's situation with chromium-based browsers differ from IE in that the latter deliberately went against existing standards while creating many non-standard features.

In the last years google set a course for putting more and more features into browser so no other browser can catch up quickly enough. And despite the fact google actually tries to be standard-complaint and to create standards for their new feature, but only a large corporation is able to implement those features e.g. Mozilla.

byko3y··on Ask HN: If you could reinvent the web browser, what would you do differently?
>7. Drop support for CSS `position:`, there's better alternatives now & it does more visual harm than good

Tell me an alternative to flexbox scrolling with "position: absolute; left: 0; top: 0; bottom: 0; right: 0".

I do agree "position: sticky" and "position: fixed" are harmful though.

← PreviousPage 2 of 3Next →