HNHacker News
TopNewBestAskShowJobs

byko3y

84 karma · joined August 8, 2019

submissionscomments
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.

byko3y··on Ask HN: It the trend toward RISC permanent?
That's a misleading information, because ARM binaries are actually smaller than similar x86 binaries. Here's a tcpdump example:

https://unix.stackexchange.com/questions/254418/difference-b...

MIPS 32 bits -> 502.4K

ARM 32 bits -> 718K

Intel 32 bits (i386) -> 983K

Intel 64 bits (x86_64) -> 1.1M

byko3y··on Ask HN: Given that I am a Software Engineer, how could I help humanity the most?
Rescue services were a good example indeed. Software developers are needed for people processing large amount of information, while local communities can do well with simple solutions.
byko3y··on The Death of Social Reciprocity in the Era of Digital Distraction
You could check a pretty well-known economist Khazin e.g. worldcrisis.ru.
byko3y··on The Death of Social Reciprocity in the Era of Digital Distraction
They are not something private and hidden, it's more like a diamonds lying in the road dust because people are just too busy to stop and take a close look at something, unless it jumps right into them in a form of a colorful advertisement picturing a women with big tits offering you to try something. Basically those are random people, random articles/books/lectures I encountered and considered helpfull.

I don't have much to share with english-speaking folks, most amazing "sources" I got acquainted with speak russian. I really enjoyed George Carlin, he provides some helpfull insights for starters.

byko3y··on Ask HN: Given that I am a Software Engineer, how could I help humanity the most?
As a former radio amateur I can tell you the emergency services use radio extensively for communication and no IT skills are required there. The simpler solution is more reliable. That's one of the reasons coding skills are not required where I live - those are complex and can be hard to maintain. Already mentioned below, btw:

>You may leave them in a worse situation as now they have less control, less understanding and if they need to change things and you or someone very similar to you (which is a rare combination) is no longer available, they're basically stuck.

byko3y··on The Death of Social Reciprocity in the Era of Digital Distraction
Could it be the information bombardment made you impenetrable to the real information? For example, since I found really important information and sources I value, no bullshit sources distract my attention. I don't watch TV, I don't visit popular news websites (including HN, made an exception today), I'm not captured by any social net service.

I feel like I'm still half-blind and thus see no clear way out of the prison, just like you. I'm a really honest man and the fight for the real world requires an advanced pretentiousness skill which I lack.

byko3y··on Ask HN: Given that I am a Software Engineer, how could I help humanity the most?
>The most needed things in the society of Today isn't material, or something that you can automate with software -- it is time. It is a resource that is very scarce as everybody is busy with their wifes, sisters, brothers, making money, building shit etc.

And the most demanded things in the society are the ones helping to waste your time, so you can have the feeling your time is precious and you have no time to just sit doing nothing. In the end you would not be so "busy" with your job if you really needed that time.

byko3y··on Ask HN: Given that I am a Software Engineer, how could I help humanity the most?
>By marrying your software engineering skills with another skill you possess you'll be able to create change quicker, and impact more people than someone without software engineering skills.

You'd better provide some example, because for now I don't really see how the software engineering skills would help. Anybody can gain some basic IT knowledge and use it, but the extensive coding skills I have seem to be surprisingly unwanted locally, although much more demanded abroad.

byko3y··on Ask HN: Given that I am a Software Engineer, how could I help humanity the most?
>Many software jobs are just bullshit. They pay super well, but the sense is nowhere there

I'm glad someone has the same sense of meaning in software development. However I'm dissapointed at the same time. In the end it's all about selling some crap to people. I'm talking about advertisment, shops, datamining of preferences, handling of orders, etc - nothing that really helped anybody. Countrary, the main goal of this process is to make you more unsatisfied and miserable, and give you a false expectation that a newly purchased crap will help you to overcome your misery.

>I found that technology people (like Silicon Valley or investors) have technology fixation, e.g. they believe (like in god) that technology will solve all problems

It's not about believing, it's about making investors believe so the investors will bring money into another unprofitable bauble.

byko3y··on Ask HN: Given that I am a Software Engineer, how could I help humanity the most?
>Start by improving yourself. Are you the best you can be?

There's a thing called "motivation". You could learn to eat glass chunks and become the best glass eater. But why the hell would you do that?

Being a software developer too, I feel useless for my local community which simply doesn't need those skills. Pretty much all I can do is to earn some money and help others to play an interesting and popular game of survival (no matter whether you need some food or just another car to survive).

For this reason I started learning chemistry and medicine, but the latter one is more about convincing people than having actual knowledge, and the former appears to be just as useless as coding.

So one of the best solutions people find in my region is to run the hell away from here to where you can help yourself, instead of sitting here and realize your helplessness. So might it also be your advise? To move to the place where you can be the best and find the environment where you will be usefull.

← PreviousPage 2 of 2