HNHacker News
TopNewBestAskShowJobs

dzsekijo

77 karma · joined May 4, 2011

submissionscomments
dzsekijo··on When Zig Is Safer and Faster Than Rust
Borgo https://news.ycombinator.com/item?id=40211891
dzsekijo··on What Is Vim?
I've set up myself once to learn Helix. First there was Kakoune that sounded exciting with its new modal model, but what had me wanting to really give Helix a go, beyond being exciting, was that it advertised itself "batteries included". It promised to deliver all the cool things programmers' editors do recently.

But then I stopped abruptly when realized Helix misses a key feature of Vim: swap files. I can just start editing and have not have to worry about losing my work, may whichever of computer panic, computer running off charge, environment (desktop env or tmux) crash, etc. occur.

So edit semantics is cool, but fundamentals like recovery should be got right before being a serious contender.

(I did a quick search to see if there is any news on this front, but what I found is all about "recovery hooks for panic", which is far more less than what's needed - it's about an emergency saving of the work if something goes awry with the editor. I need to be protected from loss if something goes awry with the environment too...)

dzsekijo··on The PayPal Mafia is taking over America's government
I don't fully get the story. Was it Calanacis who ditched the Econ reporter? He is the one among the All-iners who voted Harris. See https://audioboom.com/posts/8589911-bonus-episode-with-jason...
dzsekijo··on JSON5 – JSON for Humans
Yeah. But I think the goal was here to sugar the syntax while keeping semantics intact.
dzsekijo··on File over App: A Philosophy for Digital Longevity
In my previous workplace I used to use Workflowy to keep my to-do list in. I had a script that generated OPML from data pulled from Bugzilla / GH Issues / Jira, which then I could paste into Workflowy and from that on, update it interactively in their web UI. The Workflowy data was daily synced to Dropbox (as OPML) which in turn was synced to my local machine, so I had all the data at hand in usable format even offline.

(OK, OPML is not utterly human friendly as such; actually when I needed to access it locally, I parsed it and used it in an interactive programming environment.)

This was a nice hybrid workflow.

dzsekijo··on Class methods are Ruby's useEffect
The post says "Most of our Ruby code reads like English, but that’s not the case when we combine multiple DateTimeFns class methods", and to illustrate this, gives the following agreeably ugly example:

  DateTimeFns.add_minutes(DateTimeFns.add_hours(DateTime.current, 1), 1)
Sure thing, but the syntax can be improved without restorting to refactor into instance methods:

  DateTime.current.then {
   DateTimeFns.add_hours(_1, 1)
  }.then {
    DateTimeFns.add_minutes(_1, 1)
  }
dzsekijo··on If PEP 703 is accepted, Meta can commit three engineer-years to no-GIL CPython
However, these days AI assisted tools can be involved in the task.
dzsekijo··on Rocky strikes back at Red Hat
That's true but you must give the source to your customer and they should be free to redistribute.
dzsekijo··on Rocky strikes back at Red Hat
Well, but then Red Hat's T&C may be a violation of GPL.

Red Hat bases its model on dwelling in the grey zone.

So if Rocky aspires to be a Red Hat clone... they can adopt this bit, too :)

dzsekijo··on Red Hat cutting back RHEL source availability
What stops then someone to buy a RHEL subscription for the purposes of setting up an unofficial RHEL source mirror?
dzsekijo··on Update from Lemmy after the Reddit blackout
'i.reddit' is still available by appending '.i' to the url
dzsekijo··on I wish JSON5 was more popular
I don't see why to stick to being a JavaScript subset. Yes, in the olden days it was practical with JSON that there is no need to write a dedicated parser, just pass the data to eval(). Nowadays you should not pass anything to eval, apart from metaprogramming purposes (in which case the input is fully in control of the code).
dzsekijo··on I wish JSON5 was more popular
What I miss from JSON5 is a dedicated date/time type (TOML eg. does have it!). I understand that this would be a step beyond mere syntax sugaring, but I'd still prefer this trade off.
dzsekijo··on It's not only you, there's an explosion of ChatGPT on HN
The Show HN you want: https://news.ycombinator.com/item?id=35654401

Update: Ah, sorry, "iOS", "Firefox", I missed that. I leave it here still, to honor the pain it took me to dig it up.

dzsekijo··on OpenAI has temporarily stopped selling the Plus plan
Best gimmick ever. This did work out on me to get me subscribed ;)
dzsekijo··on macOS Subsystem for Linux
I use Xhyve to spawn a Linux VM on Mac. For what I need it works well, so I haven't looked for alternatives. How that compares to Qemu?
dzsekijo··on Firefox is losing users fast
Thanks for the Kiwi hint! Exploring it now.
dzsekijo··on Firefox is losing users fast
It's anecdotical, but I did use to have the common nitpicks with Firefox, the slight but annoying incompatibility with that what where the net is evolving these days, and weird performance chokes.

Then in the last few months... I noticed I do not notice these anymore. Using Firefox is pleasant and decent both on desktop and mobile now. They got their shit together, or my browsing habits have changed? Dunno... needs more time to decide.

Anyways, the deal maker for me is that still Firefox is the only browser that allows to export data from it in a tolerable manner. Sync data is accessible via the "About Sync" extension, and the ability to share multiple tabs on Android is golden. (As of Brave: Brave sync is great, but a third-party client or extension to explore its data does not yet exist [at least, it's hard to search for it, because "Brave sync extension" will bring up ways to sync your extensions in Brave, not extensions that interact with Brave sync].)

dzsekijo··on Why Ruby Is More Readable Than Python
What I enjoy about Ruby over Python the most is not intricacies of the OO implementation or delicacies of metaprogramming, but a good support for functional style. In ruby, statements are expression-like, they have a return value. Also, with Ruby it's easy to break down code to consecutive pure blocks.

Condiser the following task: take /proc/kallsyms in Linux, that lists symbols in kernel, in an '<address> <type> <name>' format, like:

  0000000000000000 A fixed_percpu_data
  0000000000000000 A __per_cpu_start
  0000000000001000 A cpu_debug_store
  0000000000002000 A irq_stack_backing_store
  0000000000006000 A cpu_tss_rw
  000000000000b000 A gdt_page
  ...
let's make stats on it -- how much of each type is present? Wanna get the result ordered by number of occurrence.

In Ruby:

  # ruby -rset -e '$<.readlines.to_set.classify { |l| l.split[1] }.transform_values(&:size).sort_by { |_,v| v }.to_h.tap { pp _1 }' /proc/kallsyms 
  {"V"=>1,
   "w"=>2,
   "a"=>14,
   "R"=>98,
   "W"=>154,
   "A"=>328,
   "B"=>655,
   "D"=>2910,
   "b"=>3097,
   "T"=>22289,
   "d"=>34424,
   "r"=>49904,
   "t"=>55346}
Of this method call chain, first and last are impure (as they do I/O), the intermediate ones are pure.

In Python you'll have to grind through it procedurally. (Unless you use reach out to some advanced libs... https://gist.github.com/richardbann/5b363096de6b3de2e8178cce...)

dzsekijo··on IBM Is Destroying Red Hat and Red Hatters Are Leaving
I'm also in RH. Our team is on Google Chat for some years now. Ironically, I preferred IRC as I could run my own instance of Weechat continuosly on a server and logged all conversations, so could extract information from history by grep et al. The hist search UI in gchat is much more cumbersome.
dzsekijo··on Why I still Lisp
This is a confusing example, because in a REPL steps of compilation and evaluation are interleaved.

Indeed, can you write a program for CLISP that works like this:

- takes one command line argument (a file name)

- reads in the given file, interprets it as Common Lisp code, expecting it to deliver a definition for the add2 macro

- then runs

   (let ((a 1)) (dotimes (i 4) (add2 a)))
dzsekijo··on Telegram publishes users' locations online
Do you know of any unlimited free cloud storage service? I know just one, that's being Telegram.
dzsekijo··on Building a high performance JSON parser
Adding this, for sake of completeness (I have no experience with it, just yet another Go JSON project aiming at high performance).

https://github.com/minio/simdjson-go

dzsekijo··on Why is there a “V” in SIGSEGV Segmentation Fault?
I checked Hungarian, it's simply "core készült" ("core has been made"). I guess they did not want to go too far with translating "core" as possible faithful translations would collate with expressions for ejaculation...
dzsekijo··on Why is there a “V” in SIGSEGV Segmentation Fault?
Well some aspects are still not clear. If this thing was originally called "segmentation violation", who, when switched to calling it "segmentation fault"? Why we don't get

    Segmentation violation (core dumped)
when this thing fires?

Actually "violation" sounds much clearer to me. It's telling me that the code I'm running does something that was not part of the contract. With "fault"... well, it's someone's fault... probably someone else's fault... who knows what happened... ¯\_(ツ)_/¯

I wouldn't be surprised if it was found out to sound smoother to managerial ears.

dzsekijo··on Deno Is a Browser for Code
THere is a subtle but significant difference between the approaches of Deno and Go.

Deno directly use standard URIs to import packages. Go imports syntactically appear as schemeless paths, which boils down to the semantics of importing URIs from an implicit private go:// scheme.

And that catches two fishes at once:

1) the go:// namespace is isomorphic to the https:// namespace, so the default resolution strategy is just to pipe through this isomorphism. This is convenient, makes sense right away and avoids the a priori need of a central registry.

2) Whenever it's needed, the resolution can be instructed to do some custom thing instead of casting to https://.

The exemplar instance of 2) is the usage of sibling packages. They wanted to make it possible to have several packages within a single module, whereby the module serves as a compilation unit. So when an import path is a subpath of the module path, then the package is looked up locally, relative from the root of the current module. There is no way you could get away with such a bending of a https:// URI. But go:// being a private scheme gives the freedom to proceed so.

(The go:// scheme is just my own literary device, but this semantics is explained clearly in simple terms at https://golang.org/doc/code.html.)

dzsekijo··on Deno Is a Browser for Code
For example https://deno.land/x/ is effectively nothing but a URL redirect server, where it rewrites URLs to include a git commit-ish reference in the redirected URL. So https://deno.land/x/oak@v4.0.0/mod.ts becomes https://raw.githubusercontent.com/oakserver/oak/v4.0.0/mod.t..., which GitHub serves up a nice versioned module.

Thus http://deno.land/x/ is the de facto central registry. I'm yet to see how it makes a difference whether the logic of resolving a package name to a concrete version of the package is baked into command line tooling or a web service.

dzsekijo··on The Great CoffeeScript to Typescript Migration of 2017
https://saagarjha.com/blog/2020/05/10/why-we-at-famous-compa... :P
dzsekijo··on Weakening Cycles So That Turing Can Halt
> The answer is "yes, there is a decision algorithm"?

Indeed.

> What would that decision algorithm be for this particular function (odd_perfect_number)?

Either of

  () => True
or

  () => False
where '()' represents the empty input.

> And what is its answer?

I'd be a Fields medal candidate if I knew ;)

dzsekijo··on Weakening Cycles So That Turing Can Halt
Sorry to say, this example has nothing to do with the halting problem. Rather, I would say, it's a reformulation of a(n unsolved) mathematical problem to the question whether a certain function halts on a certain input (being "no input", as the function is nullary). Or, if you insist, we can regard it as a trivial instance of the halting problem.

An instance of the halting problem asks, given (a partial recursive) function F, whether there is an decision algorithm A (aka. Boolean valued algorithm) on the universe of inputs U of F that calculates the domain of F (those inputs where F takes a value, ie. halts; ie, A(x) <=> F halts on x, where x in U).

For any finite subset S = {s_1, ..., s_n} of U, there is a trivial decision algorithm on U that calculates S:

  def A_S(x):
     for s in (s_1, ..., s_n):
         if x == s:
             return True
     return False
Therefore if the domain D of F is finite, the answer to the halting problem of F is trivially yes: A_D is a decision algorithm for F. (This has noting to do with the question whether we know D or not!)

If U is finite, then D is finite, so the answer to the halting problem of F is trivially yes.

If F is a thunk (nullary function), then U is finite, ie. the singleton set of "no input", so the answer to the halting problem of F is trivially yes.

odd_perfect_number is a thunk.

Page 1 of 2Next →