HNHacker News
TopNewBestAskShowJobs

archargelod

1,112 karma · joined May 28, 2023

submissionscomments
archargelod··on How many video games include a marriage proposal? At least one
That reminds me about an easter egg[1] in arcade racing game Horizon Chase. If you trace a heart shape (on mobile device/nintendo switch screen) at the start of the race, it plays a short video with a proposal at the end. Game is very fun too.

[1]https://www.youtube.com/watch?v=yoeKgQifaO4

archargelod··on Giving C a superpower: custom header file (safe_c.h)
You can get all of that and more with Nim[0].

Nim is a language that compiles to C. So it is similar in principle to the "safe_c.h". We get power and speed of C, but in a safe and convenient language.

> It's finally, but for C

Nim has `finally` and `defer` statement that runs code at the end of scope, even if you raise.

> memory that automatically cleans itself up

Nim has ARC[1]:

"ARC is fully deterministic - the compiler automatically injects destructors when it deems that some variable is no longer needed. In this sense, it’s similar to C++ with its destructors (RAII)"

> automated reference counting

See above

> a type-safe, auto-growing vector.

Nim has sequences that are dynamically sized, type and bounds safe

> zero-cost, non-owning views

Nim has openarray, that is also "just a pointer and a length", unfortunately it's usage is limited to parameters. But there is also an experimental view types feature[2]

> explicit, type-safe result

Nim has `Option[T]`[3] in standard library

> self-documenting contracts (requires and ensures)

Nim's assert returns message on raise: `assert(foo > 0, "Foo must be positive")`

> safe, bounds-checked operations

Nim has bounds-checking enabled by default (can be disabled)

> The UNLIKELY() macro tells the compiler which branches are cold, adding zero overhead in hot paths.

Nim has likely / unlikely template[4]

------------------------------------------------------------

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

[1] https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc...

[2] https://nim-lang.org/docs/manual_experimental.html#view-type...

[3] https://nim-lang.org/docs/options.htm

[4] https://nim-lang.org/docs/system.html#likely.t%2Cbool

archargelod··on Why is Zig so cool?
I love Zig. Never tried to write it though =).

I just use a it as cross-compiler for my Nim[0] programs.

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

archargelod··on Nim 2.2.6
If someone stumbles upon this comment, don't be quick to discard the Nim language. Please do your own research and make your own opinion on the matter.

I believe this and many of comments by tinfoilhatter under this post are not in good faith and in the most charitable interpretation written by a uninformed person or are severely outdated.

> Thanks for the offer, but there's a reason why Nim hemorrhages users as fast as it gains them, and a big reason for that, IMO, is the toxic community which definitely includes the moderation team.

I have to challenge this, because for the last couple years, there have been almost no incidents or drama. Moderation was almost exclusively dealing with spam messages. I think, on the forum, a couple posts were closed because of heated or offtopic discussions. But in all cases, participants were agreeing with the decision of mods (you can see them leaving a 'like' on mod's message).

> There was quite a bit of drama that caused the hard fork to materialize. Differences in communication styles is definitely describing the drama that unfolded, extremely mildly. I don't work on the fork or use it, but some of the more talented compiler developers who were previously contributing to Nim, left Nim to go work on Nimskull.

I know that some of people that left were also the ones causing problems with moderation and being toxic. I don't want anyone to draw strong conclusions, but Nim community was much healthier and friendly after the fork people and certain moderator leaving the project.

> He is also very difficult to work with and isn't very welcoming to newcomers. The community "leaders" / moderation team is also full of abrasive individuals with fragile egos.

This is just false. You can see Araq answering the noob questions on the forum all the time. He might be not the best person to do that, because his answers on the short side. I believe, noobs often need more context, examples and explanations than he's providing. But it's thought and effort that counts. Some people even hate when you treat them as complete beginner and try to nourture them common CS knowledge.

archargelod··on Nim 2.2.6
> Nim unfortunately has a toxic Dictator at the top

Araq has opinions that he defends, but you can and absolutely should try to sway or change them. I see this all the time on Discord and Forum. And I see people win over just as much as them losing.

I don't have a strong opinion if this is healthy or not, but it's probably why I would be a bad BDFL =). All in all, I don't think dictatorship is a right word here.

archargelod··on What we talk about when we talk about sideloading
There are countries like China, Russia, Iran, and Venezuela where installing an APK is the primary or only way to get most software, including essential bank and government apps.

Outside of the Western market, installing Android apps not from Google Play is a completely normal and regular thing. In countries like India, Brazil, Indonesia, Nigeria, and the Philippines (which represent a massive portion of global Android users) it is a standard part of using a phone.

archargelod··on What we talk about when we talk about sideloading
Did you consider piracy?

I'd guesstimate that close to 50% of Android users know how to install an apk.

archargelod··on What we talk about when we talk about sideloading
Google camera is not exclusive to Pixel.

It was ported[0] by enthusiasts to literary almost every Android phone. I have it on my $100 Xiaomi.

[0] https://xdaforums.com/tags/google-camera/

archargelod··on Wren: A classy little scripting language
Most recent commit on the github[0] was only 11 months ago.

Also, it's not a javascript framework, a stable software doesn't have to update often. Look at Lua, most people still use Lua 5.1 and that was released in 2006.

[0] https://github.com/albertodemichelis/squirrel

archargelod··on Google flags Immich sites as dangerous
He wasn't just involved with GrayJay, he's actually a member of FUTO - the company behind Immich and GrayJay. Now read grandparent comment one more time:

> Wouldn't be surprised if this leads to a lawsuit over monopolistic behavior

His reaction also matters because he's basically the public face for the company on YouTube and has a huge following. You've probably seen a bunch of social media accounts with the "clippy" character as their avatar. That's a movement started by Louis Rossman.

archargelod··on I see a future in jj
The article can be summarized to essentially: I like Rust. jj is written in Rust. Some Rust person loves jj. jj is used at Google.

Who upvotes this?

archargelod··on Syntax highlighting is a waste of an information channel (2020)
- Rainbow parenthesis

Too much noise. And the example is great demonstration for it. It's better than gray parenthesis, but a lot of worse than properly structured and indented sections.

- Context Highlighting

Love it. But once again - too much noise for text colors. Just highlight line numbers of nesting level your cursor is in. Indent-blankline[1] plugin for neovim does this (with use of treesitter), but it highlights the virtual indentation lines.

[1] https://github.com/lukas-reineke/indent-blankline.nvim

- Import highlighting

I think it's impractical, because imports are often grouped together at the start of file, but symbols are all over the place and you'd only see highlight on very short files.

LSP "goto definition" is already a better fit here, a bit more immediate solution is to display namespace/import path in status bar. No idea if there's any plugins for this, but should be easy to hack together in an hour.

- Argument Highlighting

Kinda useful, but also gets less useful for longer functions. IMHO doesn't worth it to add whole extra color to a limited palette or it might turn into in-cohesive mess rather quickly.

- Type Highlighting

Could be taken one step further and highlight atomic types in lighter shade and more complex types (not only lists) in darker shade.

nit: example being Python feels a bit out of place here

- Exception Highlighting

LSP virtual text

archargelod··on Zed is now available on Windows
I just refuse to use any software that baloons it's filesize. Not because I can't afford storage, but because there are always alternatives that have similar features and packed into fraction (usually less than 1%) of filesize. If one of them can do it and other can't, it's a bad product, that I have no intention to support.

We should strive to write better software that is faster, smaller and more resilient.

"Storage is cheap" is a bad mentality. This way of thinking is why software only gets worse with time: let's have a 400mb binary, let's use javascript for everything, who needs optimization - just buy top of the shelf super computer. And it's why terabytes of storage might not be enough soon.

archargelod··on Ask HN: Abandoned/dead projects you think died before their time and why?
RIP the concept of owning your computer and user-written programs
archargelod··on Ask HN: Abandoned/dead projects you think died before their time and why?
> Modula. Modula 2 and 3 were reasonably good languages. Oberon was a flop. DEC was into Modula, but Modula went down with DEC.

If you appreciate Modula's design, take a look at Nim[1].

I remember reading the Wikipedia page for Modula-3[2] and thinking "huh, that's just like Nim" in every other section.

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

[2] https://en.wikipedia.org/wiki/Modula-3

archargelod··on Microsoft only lets you opt out of AI photo scanning 3x a year
You can't create new account on Gitlab without a credit card (outside of EU and USA).
archargelod··on Microsoft only lets you opt out of AI photo scanning 3x a year
Yes.

For private repos there is Forgejo, Gitea and Gitlab.

For open-source: Codeberg

Yes, it'll make projects harder to discover, because you can't assume that "everything is on github" anymore. But it is a small price to pay for dignity.

archargelod··on Tom's Data Onion
Great puzzle. I solved it in Nim[1]. Bit-twiddling layers were a good fit for the language.

The trickiest part was the AES layer. I had to reach for the C FFI to use OpenSSL for decoding. And it took longer than expected to search instructions for key unwrapping.

Full solution[2] runs in under 20ms on two decade old Intel Xeon, which says more about Nim's performance than my coding skills.

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

[2] https://codeberg.org/janAkali/toms-data-onion

archargelod··on ESP32 and Termux
If you have root, it is fairly trivial to run full-on arm64 Linux distro in chroot. That should fix most problems with linux software running in android.

There is also Linux Deploy[1] that automates the process of setting up chroot, ssh and even gui desktop (through framebuffer).

[1] https://github.com/meefik/linuxdeploy

archargelod··on WinBoat: Windows apps on Linux with seamless integration
I think this name would be confusing. For one - it is for linux, not windows.And it is a subsystem running Windows. So, it should be called Windows Subsystem for Linux, or WSL.
archargelod··on Codeberg Reaches 300k Projects
> available for free at $BIGCORP

Is it really free, though? You get free service - MS gets everyone's code for free. Only a fool would believe that they don't use private repos for training.

And even if it was free, do you really believe it is sustainable to just offer unlimited service for free to anyone? They've created an environment where you're punished for using anything but github. This is not good.

archargelod··on Codeberg Reaches 300k Projects
> you need to request access

Codeberg has free Forgejo Actions instance that you can use without a request, but with limited resources[1]:

> own runner is probably more expensive than GitHub

You can rent a VPS for as cheap as $15/year or run it locally.

[1] https://codeberg.org/actions/meta

archargelod··on Codeberg Reaches 300k Projects
That is also a disadvantage, Github has a lot more grifters, people submitting fraudulent and malicious PRs, issues spam. In similar vain as "everybody is on windows" and Linux not being targeted by malware as often.

If a person really cares about your project and wants to improve it and not just boost their own GH stats - creating an account takes no time or they can always send you patches via email.

archargelod··on Codeberg Reaches 300k Projects
Forgejo CI is really easy to setup, though. Just get a cheap VPS or Oracle Free Tier and you don't have to worry about freeloading.
archargelod··on Ask HN: Which programming language do you like more, Rust or Zig?
I like Nim more than both of those:

- syntax that focuses on readability

- automatic memory management without GC overhead (ARC)

- batteries included stdlib

- fast to compile and execute, small binaries

- reduced boilerplate (thanks to templates and macros)

- very easy cross-compilation (thanks to zigcc)

- small but welcoming community, not full of zealots

archargelod··on Yt-dlp: Upcoming new requirements for YouTube downloads
That's because youtube allows almost everything sfw to be hosted on their platform and without any limits.

I can imagine if they've added rate-limiting, e.g. 30GB per IP per week - that would've reduced amount of crap, literal white noise and spam/scam videos uploaded to Youtube in several magnitudes. Another strategy is, if a video doesn't get 1000 views after a week - it's deleted.

archargelod··on The allure of new languages vs. the necessity of problem-solving
I see it as a way to force Rust on people. That's almost like saying "You will have to learn some Rust whether you want it or not" to Linux maintainers.
archargelod··on TIC-80 – Tiny Computer
One of main differences with Pico-8 is that Tic-80 supports many more programming languages.

You can write games in Lua, Moonscript, Javascript, Ruby, Wren, Fennel, Squirrel, Janet and even Python.

Or use anything that compiles to WASM. I've recently created my own bindings and a template for building Tic-80 games in Nim[1]

[1] https://codeberg.org/janakali/tic80-wasm-nim

archargelod··on TIC-80 – Tiny Computer
Yes, you can write code in a separate file and then import it to cartridge with tic-80 console commands[1]

You don't have to do this manually every time, just make a shell script with multiple commands; e.g. this will import code, save and run the cartridge:

    ./tic80 --skip --fs="$PWD" --cmd="load cart.tic & import code main.lua & save & run
The other way is indeed to buy or build yourself a PRO version, it can work with cartridges in plaintext format.

[1] https://github.com/nesbox/TIC-80/wiki/import

archargelod··on Show HN: Downloading a folder from a repo using rust
The rust app just calls a few git commands too[1]

Could've been a shell script[2]

[1] https://github.com/zikani03/git-down/blob/cb2763020edc81e464...

[2] https://textbin.net/ja17q8vga4

← PreviousPage 5 of 11Next →