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 Idris: A language for type-driven development
Exactly, you can ship software in unityped languages. Still, how do you express even such a simple thing as a generic list type in simply typed lambda calculus?

It's just that dependent types enable you to express any invariants statically, without actually running the code.

> You can construct a NEL (NonEmptyList) in any language. That's trivial.

That's true, with the caveat of: this invariant only exists in your head and hopefully docs. When it's encoded in a type, your compiler gets awareness of this invariant as well. Then it's able to do things that were impossible before, it can catch bugs that you would not (e.g. due the sheer amount of source code).

Even though there are other approaches to software verification, types are the only one that got mainstream adoption so far.

dmytrish··on Kernel-WASM: Sandboxed kernel mode WebAssembly runtime for Linux
You're confusing PNaCL (based on LLVM bitcode) with NaCL.
dmytrish··on Kernel-WASM: Sandboxed kernel mode WebAssembly runtime for Linux
I don't quite understand what Javascript has to do with the topic of the discussion.

WebAssembly is to Web what JavaScript is to Java.

dmytrish··on A look at Unison: a revolutionary programming language
My experience with Unison so far has been limited to learning the basics and doing a few exercises on Exercism.io (big kudos to whoever added the Unison track there, it's a really great way to get your hand dirty with a new language!).

Coming from Haskell/other functional programming languages background, I have found many things familiar. Unison can be an improvement and an opportunity to do better this time.

What I still find lacking:

- developer experience and tooling: there's no language server (is it even possible for Unison?) or an easy development environment. I found myself confined to the usual vim+tmux+"repl" combo. A VSCode plugin that I tried was pretty basic, even though it showed the structure of code base and libraries nicely. Even Haskell is more pleasant with haskell-language-server these days.

- discoverability of library functions: skimming through modules, reading docs, trying to figure out what to use. Type-aware search (like Hoogle) is a great idea, but it does not replace the ergonomics of having context-specific completions. Having dot-namespaces relevant to a specific object (in OOP/Go/Rust style) makes this so much easier for me.

dmytrish··on A look at Unison: a revolutionary programming language
1. A Unison codebase is a persistent shared data structure, which should be easy to integrate deeply with something like git or borrow ideas from it. Conceptually, it's just like a git repository.

2. It's possible to add an additional compilation step to generate (potentially obfuscated) machine code for a Unison AST. The same point applies to Javascript/Python or JVM bytecode.

3. Data migrations are an open question, yes. Still, Unison is a pure functional programming language and might do this much better than an imperative OOP language. Especially if you model your data as a shared persistent data structure too (like Clojure).

4. This is true, all the textual tools go out of the window without some kind of a translation layer. There are possible workaround like exposing a codebase as a FUSE filesystem. On the other hand, the codebase-as-AST makes it trivial to do code transforms, global refactors, etc, in a Lisp-style macro way, with its pros and cons.

5. I agree that debugging and execution observability is a must. The idea here seems to be "let's have a Haskell-like language that does not need much debugging in the first place". I am a bit skeptical of this approach in general, but it does make a lot of debugging go away.

Thanks for sharing your experience, many of the points are valid for Unison.

dmytrish··on A look at Unison: a revolutionary programming language
It's trivial to find every possible call site of a function in a Unison codebase.

I agree that patching other people's code is not always possible, or easy. On the other hand, you can patch your own library using indirections to the new version.

dmytrish··on A look at Unison: a revolutionary programming language
While this is definitely true in general, Unison can unlock many context-specific guarantees even for data: the types are strict and expressive and it seems to have referential transparency.
dmytrish··on Should we care about people who need never exist?
We only have a single data point in the entire observable universe so far.

It's not enough to talk about any meaningful statistics.

dmytrish··on Amsterdam looks incredibly realistic in the new Call of Duty
> Dutch people (their talking volume is what many of us consider yelling, but that's just normal).

It's funny, I thought it was Americans who are so loud compared to the Dutch.

dmytrish··on Ladybird: A new cross-platform browser project
What's ambitious about supporting WebAssembly? It's very well-specified and minimalistic compared to almost anything in the web space.
dmytrish··on Zig, the Small Language
That makes unused variables "used", which defeats the point of the check.
dmytrish··on As Britain awaits a new prime minister, its cost-of-living crisis mounts
Do I understand correctly that what you propose is making this derailed "super"power richer and more connected to the countries it's been trying to subvert for fifteen years?
dmytrish··on ARM Pointer Authentication [2017]
Please add [2017]
dmytrish··on Heavily Armed Russian Navy Ships Sailing Between Britain and Ireland
Well, would you be pleased to see a couple of Russian warships enter ports of Cork or Galway to start establishing an airbase to attack Britain without asking locals?

Would you like Belfast to be razed by rockets and shelling like Mariupol?

Just a friendly reminder that the Republic of Ireland is not in NATO, with its own fleet and army comparable to Moldova's.

dmytrish··on German digital signage ban prompts confusion
In theory, yes, it's possible to store renewable energy for later consumption, but this is not the case right now and rollout of any storage technology might take years without certainty that it will work well. In the current situation, it's either blackouts, or gas/coal, or nuclear when there's no sun and wind.

On the other hand, I can understand why the current situation is like this: Germany boldly betted big time on renewables getting cheap enough, they made it work with backfill options available at the time. I just wish energy storage was tackled sooner as well.

dmytrish··on SurrealDB – Document-graph database, for the realtime web
From the operations point of view: Rust code is usually fast, safe, free from data races, easy on RAM, possible to optimize very well, compiles to native binaries (easy to deploy). Unlike C, it's easy to test and provides good abstractions, so the code generally will be less buggy.

From the point of view of a developer: when it comes to extending the database, writing an extension in Rust might be a pleasant and welcome experience. Rust interfaces with C/Python/Javascript easily and compiles to WASM, so the code written in it can be easily reused on the front end.

What's not to like?

dmytrish··on Ask HN: What Is the Lisp “Enlightment”?
I'd say that Common Lisp is still the ultimate weapon of a solipsistic developer, with unprecedented raw power for reinventing the world from scratch without collaborating with others. For a cohort of people, this feeling can be very liberating and enlightening.

In my opinion, most modern dynamically-typed languages are actually better than Common Lisp in almost all regards that matter for social, collective programming:

- they are usually much more functional and declarative: more immutability, more value-oriented approach (Erlang, Clojure), less unpredictable mutation, more useful abstractions built into the language. They provide modern data structures in standard libraries in a useful and uniform way.

- they provide a builtin class/object/prototype common language for their ecosystems (CLOS in Common Lisp and Moose in Perl 5 are examples of too flexible opt-in OOP systems that fragment ecosystems instead of unifying them); this also gives decent namespaces, which are crucial for cooperation between teams.

- they usually have a good async story (iterators/generators/coroutines, promises/futures, async/await), again, built into the language and enabling async ecosystems on top of them.

- they have good(-ish) story about package management. Lispers seem to like to write everything from scratch.

- they have good story about testing infrastructure. Lispers are usually too proud of keeping the world in their heads and of their REPL-driven bug-fixing dopamine cycle to actually think about having computer test their code. The ability to change a running program from the inside is actually a detriment to abstract thinking about what code is meant to do and describing that in more declarative invariants like type systems and tests.

- tooling has finally caught up: with LSP and treesitter, programmers do not have to bear the pain of S-expressions to have structural editing anymore. A sufficiently educated programmer recognizes syntax trees as a valid data structure in any language. If really needed, modern languages do provide abstractions to manipulate their AST (`import ast, dis` in Python, `erl_syntax` in Erlang, `ast` in Go, declarative and procedural macros in Rust, Template Haskell, etc).

The only thing which I think Common Lisp still does better is conditions/restarts, which seems a better way of error handling than just catching exceptions.

dmytrish··on SLJS: A true JavaScript runtime written in rust that compiles to WASM
The author here.

It's roughly ES5, with many parts and standard methods still missing.

It's a small toy implementation of a JS runtime in Rust from scratch, not ready for any practical use.

dmytrish··on SLJS: A true JavaScript runtime written in rust that compiles to WASM
It's not a browser JavaScript runtime. It's an isolated WASM sandbox without any other interface than the provided REPL.
dmytrish··on I've started using Firefox and can never go back to Chrome
Tree Style Tabs solved the tab grouping problem for me. I like to put it on the right and I'm looking for a way to have the tab bar hidden.

Tab search exists: https://support.mozilla.org/en-US/kb/search-open-tabs-firefo..., also you type % into the address bar to start searching over tabs. Not sure if this covers your needs, though.

dmytrish··on Ask HN: Should I learn Rust or Go?
Disclaimer: I have no TypeScript experience. I'd say poking at both languages is useful. The choice of ecosystem can come later, according to the taste and tasks.

Rust:

- makes you a better coder indeed, Rust is pretty clear and organized about its abstractions. Sum types, honest traits, no nil values, disciplined approach to errors and generics, the right amount of niceties and syntax sugar. The idea of borrow checking (and when to avoid it) is a valuable insight into programming in itself. Straightforward RAII instead of wanton `defer`s everywhere.

- fearless concurrency (no global mutable variables, Arc, Send + Sync, ownership of objects by threads) with reliability heads and shoulders higher than everything else.

- first-class support for WebAssembly (wasm-bindgen, js-sys, wasm-pack, etc). Interfaces with other languages well (PyO3, Node bindings, C/C++ via bindgen/cbindgen).

- fine-grained, low-level control over memory allocations and layouts.

- requires quite a bit of effort and dedication to use it effectively. The standard library is extensive in volume (not functionality), takes time to learn, has its own conventions and context-dependent, non-straightforward idioms.

Golang:

- a language to get things done, with very decent and extensive ecosystem.

- a perfect choice for backend servers, microservices, everything working over the network.

- teaches about perils of freely mixing shared memory with concurrency. Goroutines are so easy to spawn, until they are not. Channels seem like a good idea, until dive into a real code base with mutexes and shared memory. Still, both goroutines and channels are solid, practical tools that work well.

- writing new code is objectively faster and easier with GC.

- compared to TypeScript, still teaches to manage memory layouts and has structs as values.

- doing pretty basic things like iterators, sum types, custom data structures, even tuples of values can be painful, but this is changing with the newly introduced generics.

- I still try to come to terms with the wild abuse of programming language theory terms in Go, where an "interface" is not just a trait, but also a set of types and behaves almost like a supertype.

dmytrish··on Ask HN: Can you both take climate change seriously and against nuclear energy?
It's unlikely that this Pandora box can be closed now. As long as any geopolitical rivalry exists, it takes one crazy dictator to make this into the prisoners dilemma scenario.

The knowledge of physics cannot be unlearned easily, unless you imagine our future as a Dune-like world with strict prohibition on physics knowledge and experiments.

dmytrish··on The Helios microkernel
I am amazed how Andreas manages to do very solid work while also turning (at least some pieces of) it into impressive one-hour shows with clear outcomes.

Is he rehearsing his coding videos? Does he pick moments that went well? Is he a superhuman coder?

dmytrish··on Vetting the Cargo
If an intruder can rename files in your $PATH, the defense is already broken (e.g. they could do the same with any of .bashrc, .profile, anything in .local/bin and many, many other places). If a program can run seemingly innocent programs like less or sed, it already can run arbitrary commands.

Security story of developing on Linux is basically non-existent unless you do everything on a remote machine or at least in a container (and, oh irony: direct access from your user to the Docker daemon basically means having root for that user).

dmytrish··on Ask HN: What are some mentally healthy apps to have?
Calendar, maps, clock/timer, dictionary.

As for learning: Coursera was good years ago, Stepik might be a good site/app too. I haven't tried edX on mobile.

Duolingo to learn languages. Your Youtube feed can be curated to something almost sensible.

dmytrish··on Ask HN: Why XMPP failed and SMTP didn't?
Chats have always been super-useful for a more technical crowd, IRC is still alive somehow.
dmytrish··on VoCore – Coin-Sized Linux Computer
I think they meant Raspberry Pi Pico, which is definitely not a microcomputer with Linux, but it has plenty of I/O pins.
dmytrish··on Jonesforth – A sometimes minimal Forth compiler and tutorial (2007)
It was a lot of fun for me to reimplement this in MIPS assembler on CI20 [0]

JonesForth could be more clear about the high-level logic of its interpreter part. I tried to make this part as clean as possible, hopefully did not miss anything.

Maybe I will make a RISCV version in my copious free time in the future.

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

dmytrish··on Finland will seek NATO membership immediately
It's possible to respect and share the principles the US is built on and disagree with details and ugly tendencies of the implementation. The West is not just the US.

As for Russia and its empire-serving culture, there's nothing to like and share at all.

dmytrish··on Ask HN: What are some interesting examples of Prolog?
That's the largest piece of Prolog code I've ever written, so criticism is warranted and I'm glad to learn how to improve it. I still wanted to share it to show how typing rules translated almost directly to Prolog clauses.

I agree that this piece of code was written in a more academic mindset, with large dose of TAPL-specific jargon and abbreviations which can easily throw anybody off if not known beforehand. I do not have good examples of industrial-grade Prolog code bases, if that's what was asked.

← PreviousPage 3 of 13Next →