HNHacker News
TopNewBestAskShowJobs

archargelod

1,112 karma · joined May 28, 2023

submissionscomments
archargelod··on The Anvil Text Editor
There's also vis[0]

It is an editor that combines best parts from vim and plan9 sam[1] (multiple cursors, structural regular expressions).

0 - https://github.com/martanne/vis

1 - https://en.wikipedia.org/wiki/Sam_(text_editor)

archargelod··on Show HN: Pumpkin – A Modern Minecraft server written in Rust
There are issues other than not ported bugs. Redstone in bedrock is know to be unreliable.

For example, in Java version if you take a circuit and activate it with a button/lever - it would always behave in the same way. In bedrock same setup could have random result. And "random" is something you don't want in a large sophisticated contraption.

I'd guess it's caused by some race-conditions in bedrock implementation, but alas it wasn't fixed in 7 years.

archargelod··on Embedded Rust in Production?
I don't have any first-hand experience with embedded myself, but I've seen positive comments on different forums about using Nim in production for embedded devices. For example, see a couple pages of comments by girvo [1].

Also there's a video on writing keyboard driver in Nim [2].

[1] - https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...

[2] - https://youtu.be/dcHEhO4J29U

archargelod··on Blocking the "Sign in with Google" Prompt (2023)
> accounts.google.com/gsi/*

This filter might break functionality on some sites, so it's better to use more specified version:

  ||accounts.google.com/gsi/*$xhr,3p
Explanation of the relevant syntax:

  `[no prefix]`: Blocks resources that have this text string anywhere in its URL.
  `||`: Blocks resources that have a specific domain or subdomain.
  `$3p`: Ensures that resources from a domain are only blocked if you're not visiting the domain itself.
  `$xhr`: Prevents such resources from being downloaded through the titular JavaScript APIs.
More Ad-filtering syntax explained: https://github.com/DandelionSprout/adfilt/blob/master/Wiki/S...
archargelod··on A dictionary of single-letter variable names

  b for boolean
  d for distance / date
  e for error / exception
  f,g are often used as generic function name
  g can be global value
  r for radius
  r is a random value
  t for tally
  t is any temporary value
  m for matrix
archargelod··on Turn your old laptop into low-end gaming machine
It would be hard to find an old machine in good condition. Then, if you find one, you need to figure out logistics of getting your games on the thing. Good chances it won't recognise a modern hard drive or usb flash drive.

Full on PC setup also requires a lot more space than a small laptop.

archargelod··on NimCSO: A Nim Package for Compositional Space Optimization
paper: https://arxiv.org/abs/2403.02340

documentation: https://amkrajewski.github.io/nimCSO/nimcso.html

archargelod··on Show HN: Offline audiobook from any format with one CLI command
Can confirm that everything is fixed. Thanks for the update!
archargelod··on Show HN: Offline audiobook from any format with one CLI command
Cool app! I've had some issues with getting it to work, though:

- ebook-convert is not a small dependency, it seems that it only comes bundled with calibre software. And calibre has huge number of python dependencies (>400 packages on OpenSuse) - don't know about you, but I'm not polluting my install with that for a small tool. So, I've grabbed appimage version of calibre, extracted it and added symlink to the bundled ebook-convert. It is still around ~500mb of wasted space, but atleast it's local to a single folder.

Could you replace it with another tool/library, or include only necessary stuff with binary?

- Then I've encountered another problem. I have no piper installed on my system, but readme says:

> You don't need to have piper installed. This program manages piper and the associated models.

It didn't download piper release and proceeded without errors. Then it did download some models. After that it errored out on trying to change directory to non-existent "~/.config/QuickPiperAudiobook/piper" So naturally, I looked in source code, found link to piper tarball and extracted it myself.

A-ha! Now it works. Until..

- Done. Saved audiobook as /home/archargelod/Audiobooks/text.wav

You could try to guess what was the problem, but I'm going tell you right away: it didn't create "Audiobooks" folder and again there were no errors.

Thankfully, that was the last issue and after I created ~/Audiobooks manually, my generated wav was there.

archargelod··on Portals of impossible shape [Eng subs][video]
Web demo: https://optozorax.github.io/portal/
archargelod··on If WordPress is to survive, Matt Mullenweg must be removed
> It's open source. Should every ... user be -required- to contribute?

No, not every user. Only entities that make millions of $$$ directly with that free software. They should be required to contribute!

Either donate directly or contribute hours proportional to your dependency on the project.

archargelod··on I Am Tired of AI
> Now it has changed to asking AI, the exact question and it being a better search engine.

Except that you get mostly the wrong answers. And it's not too bad when it's obviously wrong or you already know the answer. It is bad and really bad when you're noob and trying to ask AI about stuff you don't know yet. How would you be able to discern a hallucination from statistics bias from truth?

It is inherent problem of LLMs and no amount of progress would be able to solve it.

And it's only gonna get worse, with human information rapidly being consumed and regurgitated in 100x more volume. In 10 years there will be no google, there won't be the need to find a written article. Instead, you will generate a new one in couple clicks. And we will treat as truth, because there might as well not be any.

archargelod··on Eliminating Memory Safety Vulnerabilities at the Source
Am I missing something or can I just write such library in a language with RAII or ARC (Nim, Swift) memory management? I don't understand why Rust people believe Rust is the only option.
archargelod··on Ask HN: Platform for 11 year old to create video games?
I could also recommend Fuze4 and SmileBASIC for Nintendo Switch.

They're a lot more advanced, essentially each has it's own scripting language + code editor + a lot of quality assets.

I know the reputation of Basic, but SmileBASIC is using more modern iteration of the language, it's not your BASIC from commodore or dos. I also find their documentation and overall number of available functions exceptional.

Fuze4 has a nice community, they also have a youtube channel with tutorials and competitions.

They all have a special place in my heart, because these 3 apps is how I started my programming hobby, before moving to Lua and, recently, to Nim.

archargelod··on Ask HN: Platform for 11 year old to create video games?
Try Enu

https://getenu.com/

Enu is a 3d live coding playground where you can control objects with code. Similar to LOGO but in 3d. It uses Nim - language very similar to Python and easy to pick up.

Duscussed previously on HN:

17 comments - https://news.ycombinator.com/item?id=36966116

6 comments - https://news.ycombinator.com/item?id=38520901

Nim forum post with announcement of Enu 0.2 and some useful links: https://forum.nim-lang.org/t/10700

archargelod··on Nintendo Files Suit for Infringement of Patent Rights Against Pocketpair, Inc
Aren't patents of video game mechanics protect the technical implementation of a feature and not the feature itself?

I've always been under assumption that one can avoid patent infringing if the underlying implementation is different enough.

For example, one of more famous patents is Sega's yellow arrow on top of the screen, showing player where is the next objective. In your game you can still use that feature of "showing player in which direction the objective is", you just have to be more creative about it, here are some immediate ideas I got:

  - small red hand pops up from side of screen when you're stuck for a minute and points to objective
  - player character himself points with hand to your goal
  - make sun, moon or other celestial body appear on the sky in the direction where the objective is.
Each of these provides the very similar feature without infringing on Sega's patent.
archargelod··on Nothing: Simply Do Nothing
Really cool.

I know almost nothing about web dev, but that looked like a nice quick challenge. So I spent maybe 20 minutes to get it 90% there. It's missing a portion of text below the timer and a toast. 1948 bytes

https://gist.github.com/Archargelod/d121ae5377a0d09b0133b7b0...

archargelod··on One in five genetics papers contains errors thanks to Excel (2016)
I think we should agree that standard notation is too ambigious and switch to reverse polish notation:

  3 2 ^ -     -9
  3 - 2 ^      9
No way to misinterpret that!
archargelod··on Techniques I use to create a great user experience for shell scripts
One of my favorite techniques for shell scripts, not mentioned in the article:

For rarely run scripts, consider checking if required flags are missing and query for user input, for example:

  [[ -z "$filename" ]] && printf "Enter filename to edit: " && read filename
Power users already know to always do `-h / --help` first, but this way even people that are less familiar with command line can use your tool.

if that's a script that's run very rarely or once, entering the fields sequentially could also save time, compared to common `try to remember flags -> error -> check help -> success` flow.

archargelod··on Computer Languages Timeline [pdf] (2022)
I've put 2022 as date, because it's the last time the pdf was updated.
archargelod··on ZX Spectrum Documentary 'The Rubber Keyed Wonder' Gets London Premiere
On Android you can use a lot of programming languages inside Termux[0]. It is a terminal environment with a package manager. I'm mostly using it for writing small automation bash scripts and a little for Nim programming.

What surprised me is the fact that Termux always ships the latest version of Nim. They're practically the first to update the compiler on new version release, even compared to rolling Linux distros, OpenSUSE Tumbleweed and Arch taking second and third place after a week or two.

I also have full blown Neovim IDE configured for Nim. In combination with a custom 7-row keyboard[1] it's even somewhat comfortable to use for a quarter of an hour =).

[0] - https://termux.dev/en/

[1] - https://github.com/Archargelod/jbak2Templates-Skins

archargelod··on Rust for the small things? but what about Python?
Nim [0] IMO has syntax that's better than Python, while having a performance of C. See "Nim for Python Programmers" [1] for detailed comparison.

Small example of Nim code (from relevant article [2]):

  var gc = 0
  var total = 0

  for line in lines("orthocoronavirinae.fasta"):
    if line[0] == '>': # ignore comment lines
      continue
    for letter in line:
      if letter == 'C' or letter == 'G':
        gc += 1
        total += 1
  
  echo(gc / total) 

  [0] - https://nim-lang.org
  [1] - https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
  [2] - https://benjamindlee.com/posts/2021/why-i-use-nim-instead-of-python-for-data-processing/
archargelod··on I use Nim instead of Python for data processing (2021)
Type of a string is `string`, the fact that it's internally a `seq[char]` is just an implementation detail.

> So how could it violate type safety by treating it as such?

By not allowing you to treat a type as a type it's implemented with, Nim could prevent some logical errors. Here's a good example of such logical error from Wikipedia:

> For instance, inches and millimeters may both be stored as integers, but should not be substituted for each other or added.

Or example with strings: Nim has `Path` type that's implemented as `distinct string`. You can't mix and match Path and string, unless you explicitly convert their types:

  import std/paths
  let prefix = Path("/usr")
  let bins = "bin"
  echo prefix / bins # not allowed
  echo prefix / Path(bins) # allowed
This makes it a bit harder to do something bad or stupid by accident.
archargelod··on I use Nim instead of Python for data processing (2021)
> In nim it is also true that strings are just lists of chars, but for some reason the compiler will not allow you to treat it as such!

That's actually a feature - Nim is designed to be a type safe[0] language. Type safety has a number of advantages:

  - Compile-time checks: Type system catches many potential issues and silly bugs early at compile time.
  - API discoverability: IDEs and other tools can provide better autocompletion and type hints because they know exactly what operations are available on a string.
Nim tries to strike a balance between flexibility and type safety. Instead of having strict restrictions, you have explicit control with slightly more verbose code. For example, if you want to treat a string as an array, you can use the `openarray` type (`openarray` is a special type that acts as interface to all array-like types and is supported by most of stdlib):

  var hello = "Hello, World"
  proc foo(s: seq[char]): bool = discard
  proc bar(s: openarray[char]): bool = discard
  
  echo foo(hello) # this doesn't compile because string != seq[char]
  echo bar(hello) # this compiles because openarray[char] is compatible with string / seq[char] / etc..
[0] - https://en.wikipedia.org/wiki/Type_safety
archargelod··on Sony shutting down Concord, refunds after 2 week launch. 8 year dev, 25k sales
Most likely it's just a combination of factors:

- bland character design

- already saturated competitors space (Overwatch and dozen of OW clones)

- very recent controversy of Helldivers game requiring a Sony account

- social justice politics

So it's mostly politics, but I really don't believe Overwatch clone could be successful, unless it tries to do something very unique. Concord had nothing. Their main hook was 'nextgen graphics' and a movie-like trailer. And as we can see, good graphics isn't enough to sell a game.

archargelod··on Greppability is an underrated code metric
Nim comes bundled with a `nimgrep` tool [0], that is essentially grep on steroids. It has `-y` flag for style insensitive matching, so "fooBar", "foo_bar" and even "Foo__Ba_R" can be matched with a simple "foobar" pattern.

The other killer feature of nimgrep is that instead of regex, you can use PEG grammar [1]

  [0] - https://nim-lang.github.io/Nim/nimgrep.html
  [1] - https://nim-lang.org/docs/pegs.html
archargelod··on My first experience with Gleam Language
Check out Nim[0] - it's strongly typed, with good type inference, clean elegant syntax, memory management is automatic (optional gc, default is ARC + small footprint cycle collector), compiles to small single binaries (Hello World is less than 100 kb), has powerful metaprogramming and lsp support.

Nim compiles to C/C++ and then to native code, so performance is on the same level as Rust/C/C++. You can also compile Nim to js/wasm and run the same code in the web.

[0] - https://nim-lang.org

archargelod··on The Arrest of Pavel Durov Is a Reminder That Telegram Is Not Encrypted
Your theory is interesting, but the most popular social network in Russia is Vkontakte, not Telegram. It is indeed controlled by the government and any "illegal" liberal channels are banned on sight.

> If that's true, then there can be only two primary interpretations

There is a third possible explanation:

3. This particular war is full of misinformation and lies from both sides. Telegram can be used as a tool to spread your disinfo, masking it as truth.

I really doubt that russian military uses Telegram to coordinate anything, and if they do - it could be rare cases where soldiers haven't gone through any special training. But I can see how Telegram can be used to share other non-vital data. If it's true, then surely it's not incentive from above, but initiative from below.

You should keep in mind that it's not professional specialists on the battlefield, but mostly people who've been regular citizens just a few years ago.

archargelod··on The Arrest of Pavel Durov Is a Reminder That Telegram Is Not Encrypted
Telegram is also home for many oppositioners of Russian State and Putin, Russian Liberals and LGBT communities. Why would government-controlled platform ever allow it?
archargelod··on The Calendar of Sound of Hermeto Pascoal (2020) [pdf]
I've only discovered him a couple days ago while browsing youtube. I stumbled upon his "musica da lagoa" [0] video, and watching just this video was enough to see his passion for music and talent. The guy is genius.

[0] - https://youtu.be/lZbfNtDCHdM

← PreviousPage 8 of 11Next →