HNHacker News
TopNewBestAskShowJobs

dmytrish

949 karma · joined April 28, 2013

About me: https://github.com/EarlGray

[ my public key: https://keybase.io/dmytrish; my proof: https://keybase.io/dmytrish/sigs/oCCIZQXIgvSoV7t8uYgibLpsvszNB2GHc_60zpe882Y ]

submissionscomments
dmytrish··on Ask HN: What are some interesting examples of Prolog?
Not exactly a big codebase, but it was a revelation for me how natural typecheckers can feel in Prolog: I basically rewrote typing rules with some tweaks: [1]

Also, tests were surprisingly enjoyable in Prolog: [2].

[1] https://github.com/EarlGray/language-incubator/blob/29755c32... [2] https://github.com/EarlGray/language-incubator/blob/29755c32...

dmytrish··on Hello V-Lang
Because nobody wants to deal with another PHP in the unlikely case V takes off.
dmytrish··on Hello V-Lang
Here you go: http://harmful.cat-v.org/software/c++/linus
dmytrish··on Pointers Are Complicated III, or: Pointer-integer casts exposed
Now that I think about exposing cache hierarchy in a programming language, that makes much more sense. One can imagine a programming language with explicit control over CPU caches and their hierarchy. Also, this could make GPU/CUDA programming more explicit, safe and efficient.

Still, this requires the hardware to cooperate with software instead of pretending that random access memory is truly random access. This functionality just isn't there at this point.

Edit: this would require programmable caching hardware to make caching analysis and algorithms introspectable and changeable. For now, fixed caching algorithms implemented in hardware do provide lots of benefits.

dmytrish··on Pointers Are Complicated III, or: Pointer-integer casts exposed
Assembly languages sound like what you describe, and they do not make the burden of memory management go away, just shift it.

You still have to manage a separate storage device somehow (most often via file systems drivers). That's why GCs are so popular: you have a smart "driver" between your code and a RAM storage that makes life so much easier.

dmytrish··on A FOSS proposal for a new type of OS for a new type of computer (2021)
This talk follows a familiar pattern in historiography of computing: the "golden days" of Lisp machines, Smalltalk workstations, Plan 9/Oberon awesomeness, etc. In other words, glorified tales of better days, as told by grey-bearded veterans.

The speaker does not touch at all the details of *why* all of these were superseded by supposedly worse and more complex systems, "What went wrong?"

The systems that are being romanticized in the talk were a coder's delight, a peak of personal productivity, discoverability, malleability. They did have an integrated rich UI, where everything is a programmable action, everything is traceable and introspectable, wrapped by human-usable keyboard/mouse actions and UI presentation.

Still, they handled structuring, versioning and communicating *complex data* badly, something which was solved much better even by Unix/Windows-style filesystems and utilities. Plan 9 was an improvement over Unix in many aspects, but handling data complexity was not one of them.

My suspicion is that what is still very lacking today is well structured and introspectable data, system-wide schemas, rigorously defined ABIs, serialization and IPC mechanisms, transactional guarantees. Mo more raw streams/blobs of bytes everywhere, no more untyped pipes, no more poorly defined structs in C headers that implicitly define ever-changing ABIs, no more file systems without transactional guarantees, no more reimplementation of sorting and filtering in every Unix utility. I hope that the state of the art has advanced far enough to finally have a useful and comprehensive common language for data and interaction (Fuchsia's FIDL + capnproto + a kind of Kaitai Struct on steroids?), including network communication (kind of a global IPFS-like database of schemas?).

So no, moving back to the "good old days" of a magic old programming language is not the answer, in my opinion. There are other pressing issues that have never been solved well before and may be finally solved now.

dmytrish··on Ask HN: What laptop should I get for development?
My experience of 4 years with Linux on Dell XPS 13":

- WiFi stability issues with the Killer WiFi NIC were so severe at some point that I bought an Intel WiFi NIC only to learn that it's not replaceable in 9370 (but it is in 9360). A bit later I bought an external USB WiFi dongle which brought some connection stability while trading off connection speed. I sank some time into understanding and debugging firmware, without good results. A script that pings the router in a loop and reloads the connection when needed makes YouTube usable, but downloading any large files without retries was a major headache for a long time. Now it's less of a headache: maybe the firmware has finally caught up.

- Sleep on Linux can be indeed unstable; sometime I find my laptop out of battery after sleep, apparently because it wakes up on its own from time to time.

- Camera position below the display makes it very awkward for video calls. If I'm not mistaken, this was solved in newer models.

- Keyboard is quite pleasant to use, but its build quality could be better: plastic keys started to peel off after four years. In comparison, a twice as old MacBook Air keyboard still holds together very well despite heavy usage.

- Trackpad has been working well for me on Linux, I'm satisfied and don't have any complaints (I might be a very undemanding keyboard-oriented user though).

- The laptop screen is high quality, but its narrow aspect ratio feels a bit off, I'd appreciate more vertical space.

- My main motivation for Dell XPS was portability. My experience is mixed: it's possible to make Linux power saving work pretty well, but it requires work and can be flaky. Build quality also feels more fragile than MacBook Air. I still feel safer with my old MacBook Air while traveling.

- Absence of USB-A ports is not critical, but is another point of friction.

All in all, it's a solid machine with quality parts that I use daily, but it definitely has its share of hindrances.

dmytrish··on The Politics of “Ukraine” versus “The Ukraine”
In case anybody is interested, there's a very good explanation of some language-related political subtleties in https://blog.duolingo.com/ukraine-language/
dmytrish··on The Politics of “Ukraine” versus “The Ukraine”
There is a very direct analog: the way you say "in Ukraine". In Russian/Ukrainian, both «на Україні» and «в Україні» аre grammatically correct, but the first one has the same connotation as 'the Ukraine', Ukraine being an open territory without borders, which is often the intentional undertone in modern Russian.

Curiously, "na Ukrainie" in Polish usually does not bother us much, this usage does not feel directly linked to possible aggressive contempt, but more to archaic Polish perception of Ukraine from Middle Ages.

dmytrish··on The Politics of “Ukraine” versus “The Ukraine”
(a Ukrainian here)

It's not about Western virtue signaling. I don't feel that this is directly offensive (others might disagree), but it's often intentionally used in this way.

It's more in line with inclusive language: it's about removing small jarring bits that hark back to gruesome history we'd like to leave in the past. Hearing "the Ukraine" is a bit jarring, because it makes me wary of other historical stereotypes that the speaker might have.

dmytrish··on Swedish PM rejects opposition calls to consider joining NATO
Please don't conflate Poland and Ukraine.

Poland is in the EU and is starkly against abortion and LGBT rights due to the current government being quite nationalistic and Catholic.

Ukraine is more secular. It is not a completely safe haven for LGBT, but it's not ideologically against it, just the usual grass-root homophobia that is being educated away; abortion and women rights has never been a stumbling block for Ukrainians.

dmytrish··on China-Russia trade has surged as countries grow closer
"The real reason is Russia united with Europe would enable a true Eurasian competitor to the USA to arise." -- this is plainly ridiculous.

Russia was not able to join the EU at the time due to its oligarchy and systemic corruption, very weak democratic institutions, lack of understanding and enforcement of some basic human rights. It was clearly incompatible with the EU values and has actually severely degraded in that regard since then.

Geopolitics is the last refuge of a scoundrel.

dmytrish··on Very Remote Lisp Debugging Story
For the reference: 100 million miles is slightly more than 1 AU. It means that one-way communication latency is almost 10 minutes, so the round-trip latency is about 20 minutes.
dmytrish··on China declares cryptocurrency deals ‘illegal’
Crypto"currencies" are not the only way to store value when an official currency is failing: people who want their savings preserved can get USD, EUR, gold.

Crypto *is* volatile and wasteful compared to any of those.

dmytrish··on RFC-0082: Runnning unmodified Linux programs on Fuchsia
It's not like Apple products fare much better on the deprecation front, although for different reasons.
dmytrish··on No More Movies
> you live in the states, you're surrounded by it.

When you live in a different country, you are surrounded by cultural norms of your country and disobedience is punished too (usually much more harshly than in the US). Your assumptions about actors' skin colors are as much influenced by the culture of your country as they are influenced by the US culture in the US, as evidenced by the phrase "the opinion is pretty much universal among my family, my friends, my coworkers." Please don't conflate a view from your culture with nebulous "obvious objectivity".

> making them play main roles in historical movies doesn't repair any injustices made to them.

It does not repair injustices of the past, but it helps fix the injustices of today: non-white actors of today should not be kept out of movies just because of a specific historical setting.

Any historical movie is just a modern interpretation of true events. There is no actor that can be a completely authentic reflection of a historical character. A respectful, non-mocking actor play by a person of different race can be a good reminder of that.

dmytrish··on GitHub – nushell/nushell: A new type of shell
There is some movement in this direction: e.g. it's possible to do `ip -j addr` today.
dmytrish··on I quit my job to focus on SerenityOS full time
I really enjoyed the previous, more Macintosh-like Serenity design with the global menu.

I had genuinely freaked out when I rebuilt the system just after Andreas moved it to be more Windows-like: I ran Serenity browser and in the first moment it looked eerily like an old-school Internet Explorer.

dmytrish··on Rust for Windows 0.9
Yes, this is more of a "Rust rof Windows" thing.
dmytrish··on Modern C and What We Can Learn from It [video]
There is also https://github.com/jameysharp/corrode

I have not used it, but I doubt it's possible to translate C into idiomatic Rust mechanically.

dmytrish··on Plan 9 from Bell Labs in Cyberspace
No, they did not.

Plan 9 was designed long before any high availability/CAP theorem/distributed databases lessons were learned: it embodies the Unix mindset of reliably available nodes talking over tcp.

Failover/distributed consensus/orchestration/load balancing/network split tolerance/replication could be built on top of 9P servers, but all of these concepts are pretty alien to Plan 9 itself.

dmytrish··on Wayland in 2021
Do you use ibus input methods only?

In my case, I wanted to keep my configured xkb keyboard layouts + I wanted to be able to use ibus in parallel for CJK.

Ok, there must be a problem with *my* KDE setup: when I try to disable KDE keyboard layouts, KDE does not persist changes to the next session: when I log in next time, KDE keyboard layouts are enabled again and interfere with ibus.

dmytrish··on Wayland in 2021
It's not a Wayland problem, ibus does not work in KDE even on X11.
dmytrish··on Linux Desktop on Apple Silicon/M1 in Practice
"A bare-OS application" sounds almost as cool as "bare-metal".
dmytrish··on Crony Beliefs
"Having a soul" is likely a natural cognitive bias, which is very likely to predate any actual religion or belief system. It is "witnessed" personally during near-death experiences, just like karma is "witnessed" in other altered states of consciousness. These states are relatively rare, but frequent enough to fill a void of not knowing what happens after death in almost all tribes and societies. Then the emotional part kicks in: it's easier to survive a loss of somebody if one believes in that kind of after-death experience.

Of course, religions and this kind of grass-root spiritual beliefs are mutually reinforcing too, but the latter seems to predate (and direct) the former.

dmytrish··on Confession Of A C/C++ Programmer (2017)
"unsafety" is a very overloaded term. In this context, one specific technical meaning is assumed: _memory safety_ [0] (not type safety, not safety from hacking, etc, although they do depend on memory safety).

Programming languages are tools for building abstractions and concrete implementation of abstractions. They are very rarely verified and described mathematically and exhaustively; it is possible to state some properties of some programs, but it is mathematically impossible to state any meaningful property for an arbitrary program [1].

However, it is possible to constrain used abstractions in a way that allows to uphold some properties (to some degree). Memory safety of a language means that a program in that language can change a variable/state if and only if it "touches" it semantically (e.g. via a valid pointer/reference). A memory-safe language creates a reliable "abstraction cage" for (almost) any program written in it that guarantees (but not necessarily mathematically) that unrelated variables cannot be changed. "Glitches in the Matrix" (changing one variable magically changes a random other one) are still possible, but very rare in practice. Examples: Java/Python (which incur significant inefficiency when executing a program), and recently (the safe part of) Rust, which often comes very close to C/C++ in efficiency while retaining memory safety in most of its code.

C/C++ are examples of memory unsafe languages: their memory abstractions are not even close to an "abstraction cage"/"Matrix", they are just thin "guardrails" and guides, not enforceable rules: it is easy to read/corrupt an unrelated variable in a program (sometimes even via a malicious input to a program). This design choice was semi-deliberate: C/C++ solve the task of programming existing computer hardware efficiently and nobody knew how to create a practical, efficient and memory-safe systems programming language even twenty years ago. It is possible for a coder to code "defensively", using empirical best practices and tools for reducing possibility of using program memory incorrectly. C++ has a subset and tooling that comes tantalizingly close to memory safety, but it is still a costly uphill battle and even the best C/C++ coders/organizations fail to avoid memory misuse.

[0]: https://en.wikipedia.org/wiki/Memory_safety [1]: https://en.wikipedia.org/wiki/Rice%27s_theorem

dmytrish··on Show HN: Build your own programming language in C++
One reason could be that most real-world compiler/runtime codebases are in C++ (gcc, llvm/clang, v8, most of Java JITs) and C++ has just enough high-level features to make a large code base somewhat manageable. So, if one wants to work on a industrial-strength compiler at some point, it might be not the most expressive and helpful choice, but it makes sense.
dmytrish··on An ex-Googler’s guide to dev tools
(Googler here)

> Because it benefits Google.

Developing internal tools does not always benefit Google. Sometimes there is just no alternative at the time it's needed, so Google has to develop something that might become a liability later, accumulating technical debt and stagnating compared to a newer open-source shiny thing. Sometimes it's NIH syndrome, or, in other words, wariness to adopt external solutions there's no control over and that do not fit Google very well. However Google does have a healthy internal ecosystem with clear product life cycle and balanced planned/organic change.

> Because that would benefit the competition.

Usually Google benefits from its protocols/tools/projects being used out in the open (TensorFlow, gRPC, Kubernetes, Angular, Android, Chrome), and that includes competitors.

There are plenty more mundane reasons this does not happen:

- Some of the tools are so dependent on the internal ecosystem that it would make little sense to open source them in a standalone way. There are many things at Google that only exist in one single deployment in the world and turning them into a deployable product for another setting would be a huge task without clear purpose. Also, it's hard to opensource operational knowledge and expertise.

Google Cloud is an example (positive or negative, depending on your point of view) of efforts to repackage many internal services in a way that is well-documented, supported and accessible to anybody.

- Open-sourcing is a spectrum: just throwing code over the wall (the worst one), controlling a project and allowing external contributors, cooperating with other big companies on a standard solution, supporting a more hobbyist-oriented project in line with its own needs. Every option has its own set of challenges and coordination problems. It's not always easy to reconcile the internal development model and open source workflow. It's not always easy to keep delicate power balance of working with a project instead of taking it over by engineering weight and influence.

dmytrish··on Cargo-style dependency management for C, C++ and other languages with Meson
C++ is a terrible language for small, one/few-person projects.

It still sucks for bigger projects that cannot reinvent the ecosystem around them and need to rely on third-party libraries. Frameworks try to alleviate the problem and to provide a saner ecosystem sandbox, with varied success.

Once a project becomes large enough to define its own ecosystem (Android, Chrome, Firefox, KDE/Qt, google3, etc), C++ becomes remotely sustainable: the language ecosystem is not a bottleneck anymore, compilers get fixed and extended when needed, libraries are heavily morphed or rewritten, build systems are usually custom anyway. It takes a gigantic snowflake to fit C++ niche, and even then it requires a lot of internal engineering and in-house experience to make developer experience bearable.

Rust is eating the small-scale niche like a fire, it is proving successes in the middle-scale niche. It will be interesting to see growing pains and ecosystem language/adjustments when the new generation that started with Rust grows up and large projects start to get written and maintained in Rust.

dmytrish··on PandaDoc employees arrested in Belarus after founders protest against violence
A look from behind the southern border of Belarus: in 2014, Ukraine had had peaceful protests for more than two months before street violence started and ended. Then Crimea was annexed. Then the separatist war started, where most of weapons on the separatist side were supplied by Russia. Ukraine is a country with the same post-Soviet culture of "whoever owns weapons is suspicious", just like Belarus.

My point is that you don't "end up like Ukraine or Syria" by your own choice, and Belarus's only choice may well be between a "civil" war (i.e. proxy war with Russians) or being bent by Lukashenko to submit. I still hope that Belorusians will make it peacefully (Belarus is smaller and more unified than Ukraine), but I am afraid that it's not up to Belarusians to decide as long as Russia has the influence it has there.

← PreviousPage 4 of 13Next →