HNHacker News
TopNewBestAskShowJobs

bvrmn

840 karma · joined September 17, 2016

submissionscomments
bvrmn··on Human-Oriented Markup Language
`::` is quite strange. 1) It only allows to resolve nesting conflicts for a single level. 2) Could be hard to read and could lead to reasoning mistakes. 3) Looks like an attempt to differentiate HUML from YAML somehow.
bvrmn··on GNU Midnight Commander
I have fond memories for mc during my transition from Windows and trying to replace DOS Navigator and Far Manager with something similar. Started to use ranger a long ago though and never came back.
bvrmn··on Stop writing CLI validation. Parse it right the first time
In general case generating CLI options from app models leads to horrible CLI UX. Opposite is also true. Working with "nice" CLI options as direct app models is horrendous.

You need a boundary to convert nice opts into nice types. Like pydantic models could take argparse namespace and convert it to something manageable.

bvrmn··on Stop writing CLI validation. Parse it right the first time
A valid type for server and port should be a single value. Stop parse it separately please.

":3000" -> use port 3000 with a default host.

"some-host" -> use host with a default port.

"some-host:3000" -> you guess it.

It also allows to extend it to other sources/destinations like unix domain sockets and other stuff without cluttering your CLI options.

Also please consider to use DSN or URI to define database configurations. Host, port, dbname, credentials as separate options or environment variables are quite painful to use.

bvrmn··on Left to Right Programming
maps and filters maybe. Other stuff is a wild west.
bvrmn··on Left to Right Programming
Author picked up a quite convenient example to show methods/lambda superiority.

I prefer list/set/dict comprehensions any day. It's more general, doesn't require to know a myriad of different methods (which could not exists for all collections, PHP and JS are especially bad with this) and easily extendable to nested loops.

Yes it could be `[for line in text.splitlines() if line: for word in line.split(): word.upper()]`. But it is what it is. BTW I bet rust variant would be quite elaborate.

bvrmn··on Emailing a one-time code is worse than passwords
QR has trivial format and code is easily extractable.
bvrmn··on Exploring Coroutines in PHP
Let me guess. To somehow patch iteration on associative arrays? And instead of bringing pairs or tuples as first class citizens it extends iterators with `key` and `value`. And now any Iterator implementation should track own sequentially increasing key. Very nice design indeed.
bvrmn··on Zig's New Writer
I consider built-in buffering as a huge win.

* For example python gives you buffered by default streams. It's an amazing DX.

* In case of Zig you as a developer should be explicit about buffer sizes.

* You could opt-out to unbuffered any time.

* Allows for optimization without leaky "composable" io stack.

bvrmn··on Exploring Coroutines in PHP
Defenders of PHP's iterators clearly tasted only carrots.
bvrmn··on Exploring Coroutines in PHP
> Iterating over something requires knowing where you are in the sequence, so of course you would need to implement a method to get the current position of the iteration.

No you don't. Other languages don't require it. There is no issue to get a position outside of iterator and it's more generic approach.

bvrmn··on Exploring Coroutines in PHP
BTW: https://www.php.net/manual/en/iterator.key.php

It's literally in the interface.

bvrmn··on Exploring Coroutines in PHP
What's idiomatic way to get index (0, n-1) with the value? Parent example shows you could not use $key as a generic solution.
bvrmn··on Exploring Coroutines in PHP
PHP generators/iterators is a hot mess. I don't know any other language which forces iterators to output a key for `foreach(... as $key => ...)`.
bvrmn··on Mercury: Ultra-fast language models based on diffusion
Nah. Tests could be run in N processes each with own database configured to skip full fsync. It resolves most of the issues and makes testing much much simpler.
bvrmn··on Why English doesn't use accents
blood
bvrmn··on Async Queue – One of my favorite programming interview questions
I don't understand what's tricky about converting callback-style to promise-style. Even writing a decorator is trivial.
bvrmn··on Zig breaking change – Initial Writergate
Odin's IO is quite messy. I have strong feeling it evolved as an adhoc solution to tackle development requirements without much thought. I'm happy Andy wants to fix high level (and very important) interfaces while being in pre 1.0.
bvrmn··on Use keyword-only arguments in Python dataclasses
But underscore is literally a bunch of functions taking lambdas. Python also has functions and lambdas. [1] shows it could provide the same interface. I don't get what composable primitives JS has.

[1]: https://pydash.readthedocs.io/en/latest/

bvrmn··on Use keyword-only arguments in Python dataclasses
> But in general Python devs seem to prefer "explicit" ad-hoc syntax for each use case instead of composable "primitives".

I hope you don't consider JS having "composable primitives". To backup my point: there is no anything similar to underscore-like libraries for Python. All is covered by stdlib and syntax.

> for(in) / for(of)

Cough, cough.

bvrmn··on Show HN: I made a metabolic coach chatbot for weight loss
For my case it insisted to getting crazy 48kcal/kg of LEA. However I stated specifically I'm not a sportsman and don't strife to be.
bvrmn··on The double standard of webhook security and API security
It's a "wisdom of the crowd" and mantra to follow established crypto standards.
bvrmn··on I have tinnitus. I don't recommend it
Thank you for recommendation. My tinnitus become quite severe now. For past three years it's almost impossible to sleep after waking up in the middle of the night. Overwhelming ringing is hard to ignore.
bvrmn··on Show HN: Goboscript, text-based programming language, compiles to Scratch
Tell me more about scratch's purpose, please. I believe it's to teach programming. GoboScript seems a natural extension of already conventional environment to more "real" textual programming tasks.
bvrmn··on JavaScript's New Superpower: Explicit Resource Management
And I didn't use it because there was no need.

Resource scoping is important feature. Context managers (in python) are literally bread and butter for everyday tasks.

It's awkward not because of Symbol, it introduces new syntax tied to existing implicit scopes. It's kinda fragile based on Go experience. Explicit scoping is a way more predictable.

bvrmn··on JavaScript's New Superpower: Explicit Resource Management
Context managers: exist.

JS: drop but we couldn't occupy a possibly taken name, Symbol for the win!

It's hilariously awkward.

bvrmn··on Show HN: SQL-tString a t-string SQL builder in Python
I'm author of sqlbind[1] and since t-strings announce have been thinking really hard how to incorporate it. Like obvious cases `t"select * from table where id = {id}"` are tempting only at first glance. But simple queries could be written by other means. Dynamic ones where you should drop part of query by some condition is a real problem.

Your solution is impressive. It would be quite hard to support crazy sql extensions, for example for ClickHouse but as a concept it really ingenious.

[1]: https://github.com/baverman/sqlbind

bvrmn··on The current state of TLA⁺ development
For TLA it's even worse. Increasing node counts makes the spec immediately more "correct", at least it feels like that xdd.
bvrmn··on The current state of TLA⁺ development
I agree, latexisms in TLA are on eye brow level of weirdness. Lesser punctuation syntax is always better.
bvrmn··on The current state of TLA⁺ development
I did an eval of Quint about year ago and did not find it compelling. It constantly refers to TLA+ and doesn't bring much benefits except typing. Syntax tries to cover underlying fact that state machine is expressed in terms of logic and math using "understandable" for programmers concept but it's very leaky in the end. IMHO "assign" is quite hard to grok without TLA experience. Documentation is scarce.

The most frustrating part it's hard to use with TLA+ background. I know how to do something in TLA but have no clue with Quint because translation rules aren't direct and obvious.

On the other hand it's a way better than PlusCal!

But I'm heavily biased. Please take this "critique" as a mumble from TLA+ initiated duckling.

← PreviousPage 3 of 23Next →