HNHacker News
TopNewBestAskShowJobs

archargelod

1,112 karma · joined May 28, 2023

submissionscomments
archargelod··on Koto Programming Language
If I remember correctly, main reason for forking was that Nim BDFL was writing lazy commit messages and old codebase was hard to navigate around. Some small part of community forked the language and trying to rewrite the compiler. According to readme they're not trying to replace Nim, but to create new language with Nim as base. Not sure how usable it's right now or will it ever be.

I also want to point out that Araq quickly took the criticism and his commits look a lot better now.

Also, core Nim team is currently working on their own rewrite of Nim compiler, called Nimony, that should evolve into Nim 3.

Refs:

fork - https://github.com/nim-works/nimskull

commit 'drama' - https://news.ycombinator.com/item?id=32021299#32023998

nimony - https://github.com/nim-lang/nimony

archargelod··on Playstation Mod Turns the PSOne into a Crustacean
Nintendo joycons beg to differ.
archargelod··on Work on Nim 3 has begun
Relevant links:

Roadmap for 2025 and beyond - https://github.com/nim-lang/RFCs/issues/556

Nimony Architecture - https://github.com/nim-lang/nimony/blob/master/doc/design.md

Planned design - https://github.com/nim-lang/nimony/discussions/529

Nimony progress - https://forum.nim-lang.org/t/12693

archargelod··on Ask HN: What less-popular systems programming language are you using?
> how dead-simple it is to cross-compile for other hardware platforms

The fact that zig can compile C code makes it useful for other languages too. I recently started using `zig cc` to cross-compile Nim for lots of different platforms within the same environment.

It takes no time to setup and, honestly, works like magic.

archargelod··on Ask HN: What less-popular systems programming language are you using?
Anything written by Treeform[1] is a good place to start, their libraries make up a big chunk of Nim ecosystem.

1 - https://github.com/treeform/hobby

archargelod··on What could've prevented the Codeberg incident?
Someone created an issue in their repo and @ mentioned hundreds of people with two word ragebait message. It is just a feature that sometimes very useful that was used for spam. Nothing new, really.

You might've heard about someone accidentally sending email to thousands of people on Github a couple years ago: https://github.com/EpicGames/Signup/pull/24

archargelod··on Chrome does not have any way to stop video auto play?
For youtube there is a "YouTube no Buffer"[0] extension that does precisely this - stops videos from autoplaying and buffering when you open a link.

I have this plugin, Leechblock and ublock filters (blocking any mention of shorts from the site) to make yt less addicting. And it kinda works.

0 - https://addons.mozilla.org/en-US/firefox/addon/youtube-no-bu...

archargelod··on We are destroying software
> Learn Nim! Why not?

As someone who learned Nim as my first "serious" programming language, I do recommend to learn Nim. It is a delight to write and read.

Before I found Nim I looked at C, C++, Python and all of them full of cruft - old bad decisions that they're stuck with and forced to keep in the language. And it makes them a nightmare to learn.

In C there seems to be hundreds of subtly different OS-dependent APIs for every simple thing.

C++ was designed by mad scientist and extended to the point where even c++ developers have no idea what part of the language you should use.

Python is the messiest mess of OOP with non-existent documentation that is actually readable. Just to find how to do anything in Python I need to look at sites like stackoverflow and find outdated solutions for Python 2, deprecated functions and giant third party libraries. Yeah you don't learn Python nowadays, you forced to learn Python + NumPy + Pandas + Python Package Distribution (hell).

I had fun learning Nim, though.

archargelod··on It sure looks like Meta stole a lot of books to build its AI
Selection (and copying) works on Firefox even with uBlock disabled.

With uBlock, though, I have 20+ blocked items. What's the point of having so many scripts that do absolutely nothing visible on the page?

archargelod··on Quadrilateral Cowboy (2016)
Really cool game about heists and hacking on little cyberdeck with custom scripting language resembling batch/bash.

Also available on itch.io: https://blendogames.itch.io/quadrilateralcowboy

And source code is open (GPLv3): https://github.com/blendogames/quadrilateralcowboy

archargelod··on Solving the first 100 Project Euler problems using 100 languages
From one of blog posts [0]:

    Nim

    Nim is the language that impressed me the most in this batch. Everything I thought would be a problem (significant whitespace, choose-your-own-function syntax, intermediate C compliation step) didn't bother me at all. The small sample of the standard library I played with was a little quirky, but Nim seems like excellent bang for your buck.

    Notes:

    - Release binary was only 120 KB (linked against libc)!
    - Thought I'd dislike the syntax, but it was fine
    - Really easy to get started, many things "just worked" (e.g. grabbing a slice of an array)
    - Didn't have to specify too many types, but still ran fast
    - Fast compilation
    - Didn't like the "hints" it spews out during compilation, even for nim r (build and run)
    - Why did all take an anonymous function, but foldl took just an expression (with a and b seemingly picked out of thin air) -- is foldl a macro?
    - Nim might be a good language for hobby projects because it's easy, fast, and produces small binaries
    - I wonder what the debugging experience is like -- if it's decent, I might be writing a lot more Nim in the future!

This exactly my thoughts on Nim and why I use it almost exclusively for all my hobby projects.

0-https://log.schemescape.com/posts/programming-languages/100-...

archargelod··on Cuttle – a MTG like game using a standard 52 card deck
Doesn't seem that hard for me, but maybe because I play a lot of collectible card games and most effects in Cuttle are easily mapped to TCG mechanics.

You could also use mnemonics to remember effects, I've come up with these:

  2 - Two blue (counterspell cost in Magic)
  3 - Three Wishes (wish for a card from stockpile)
  4 - _ (possible connection: 4 is "Death" number in China and Japan)
  5 - Dig for more cards (with your 5-finger hand)
  6 - Six sweeps the tricks (thanks to ChatGPT for this one)
  7 - Lucky Draw
  8 - Pair of Glasses
  9 - Lasso (you bind opponents card for a turn)
  10 - Highest points (no effect, should be easy to remember)
  J - jump (sudden assault)
  Q - Mom steps forward to protect her kids
  K - One king's on scene, you need fourteen. If two kings defend, make it ten. With three kings on the rise, try seven to prize. When all kings alive, you just need five. (thanks to Claude for 1, 2 and 4 kings)
  Ace - Ace clears the space
archargelod··on When Zig Is Safer and Faster Than Rust
He's not unhinged, just a right-wing politically. If you believe it's a crime or that we should all ignore software based on political alignment of their creators, thats telling me more about you, than Nim's BDFL.

> all across the forum on a fairly regular basis.

Two times, more than 2 years ago is not "all across" and neither it's "regular". I am a regular user on the forum, and I haven't seen any rants apart from two you referenced here.

> and just a bit out-of-touch with reality.

*a bit out of touch with american politics

archargelod··on I wrote a Game Boy Advance game in Zig
Natu has an amazing commercial game called Goodboy Galaxy [0]. In addition to the Game Boy Advance version, they've also ported it to Windows and Linux with Xatu [1] (which is also written in Nim).

0 - https://goodboygalaxy.com/

1 - https://git.sr.ht/~exelotl/xatu

archargelod··on Show HN: FixBrowser – a lightweight web browser created from scratch
This is my favourite quote now:

> From the development point if there is something that truly requires multiple developers to implement it is most certainly too complex and should be made simpler or a separate project.

[0] - https://old.reddit.com/r/ProgrammingLanguages/comments/zwp51...

archargelod··on What would it take to add refinement types to Rust?
Nim has Natural and Positive (signed int) types that checked at compile and runtime. You can also define arbitrary range types for any ordinal type, for example enums:

  type
    Month = enum Jan, Feb, Mar, Apr, May, ...
    SpringMonth = range[Mar..May]
  
  var m: SpringMonth = Mar
It will raise under/overflow exception if value falls out of range.
archargelod··on PeerTube mobile app: discover videos while caring for your attention
Just pick one. It's not a permanent choice, you can transfer your account between instances.
archargelod··on PeerTube mobile app: discover videos while caring for your attention
On mastodon you have three timelines/feeds: local, federated and global.

Local is for posts local to your instance. Federated is local + posts from other instances, from people that are followed by somebody on your instance. Global is for any posts from anyone.

For example: if you join art instance your local feed will be very artsy and federated feed will be slightly artsy.

It matters little, because most people use and subscribe to hashtags to discover posts. Federated feed is too random, especially in big instances.

Relevant blogpost:

- https://blog.djnavarro.net/posts/2022-11-03_what-i-know-abou...

archargelod··on PeerTube mobile app: discover videos while caring for your attention
> What are the implications of choosing one server over the other?

Unless you choose a political or spam-friendly server - it doesn't matter.

> Does this affect search and discoverability in between servers?

A little.

> If I really like Baking and really like Fencing as well, should I join the "Mastodon Baking" server, the "Fencing fans" server of a neutral one?

Shouldn't matter.

> Will the people on the Baking server start seeing me as some sort of outsider.

Never seen anything like this, but I can imagine if you choose a server associated with 'A' and leave a comment in a server where people hate 'A', they might have a prejudice against you, so it's better to choose a very neutral, general server.

> Can I restrict/split my posts between Baking, Fencing and general?

Use tags.

> How does the algorithm evaluate these choices?

There's no algorithm, you follow people you like and block people you don't like.

archargelod··on PeerTube mobile app: discover videos while caring for your attention
> that sends a signal to me that the moderation is going to be even more capricious than Reddit

That's actually where mastodon (and other fedi-platforms) different from a mainstream social media, because you have a choice:

- you can choose an instance with very strict moderation to be in an echo chamber with like-minded individuals.

- or if you choose instance with little to no moderation - you'll find yourself on a platform where everyone speaks what's really on their mind, even if it's socially unacceptable.

Choosing instance is hard, because popular ones are blocking a lot of small instances (mostly because of spam). But simply choose a server close to your interests, you can transfer your account between instances later.

archargelod··on Rust's Two Kinds of 'Assert' Make for Better Code
> There's no semantic different between `assert` and `doAssert`.

There is a difference, but I agree that it's very subtle. In english do before a verb adds an emphasis so it's like "assert assert" or "really assert" put in a short easy to type form.

archargelod··on Rust's Two Kinds of 'Assert' Make for Better Code
I don't understand, what's wrong with assert and doAssert?

They are both enabled in release AND debug modes. You would have to explicitly compile code with -d:danger flag to disable any assertions.

> And they didn't even name the safe version clearly!

In this context safe version is clearly named as "release" mode, and unsafe one is even more clear - "danger" mode. "danger" obviously implies it should be used with caution.

archargelod··on Rust's Two Kinds of 'Assert' Make for Better Code
Nim has this too:

  - `assert` is disabled in unsafe `danger` mode or can be disabled with a flag for performance
  - `doAssert` cannot be disabled
While I've never come across an argument for why there are two types of assert, over time I’ve naturally started using them in the same way as the author.
archargelod··on Traits are a local maximum
With function overloading, templates and late static binding.

You just use a `hash` function in your library code and user has to implement a version of it that accepts the Foo type.

To resolve the scope problem, Nim uses templates[1] and a `mixin`[2] statement to bind user-defined hash procedure.

0 - https://github.com/nim-lang/Nim/lib/pure/collections/tables....

1 - https://github.com/nim-lang/Nim/blob/652edb229ae3ca736b19474...

2 - https://nim-lang.org/docs/manual.html#generics-mixin-stateme...

archargelod··on Useful built-in macOS command-line utilities
You can use process substitution[0] to have a command output act as a file:

  qlmanage -p <(man man) >/dev/null 2>&1
0 - https://www.gnu.org/software/bash/manual/html_node/Process-S... (it works in zsh too, but bash manual explains this feature more clearly)
archargelod··on Programming languages that blew my mind (2023)
To clarify what I meant by "pass by reference" here's excerpt from the Lua 5.1 manual:

> Tables, functions, threads, and (full) userdata values are objects: variables do not actually contain these values, only references to them. Assignment, parameter passing, and function returns always manipulate references to such values; these operations do not imply any kind of copy.

I also seen this described as "reference semantics" and "value/copy semantics", maybe that would be a better term?

archargelod··on Programming languages that blew my mind (2023)
I started learning programming with modern dialect of BASIC and when I first tried Lua, I've had my mind blown when I discovered:

  - tables (hashmap)
  - regex
  - pass by reference (caused a lot of confusion and frustrating bugs)
  - metatables
  - goto and labels
  - multiple return values
After Lua I did want to try a language that's fast, something compiled to small native binary. My choice was Nim. And Nim got my mind blown to pieces:

  - static types
  - function declarations I can understand how to use without reading their code
  - functional paradigm
  - batteries included standard library
  - compile-time functions
  - generics
  - templates
  - macros
  - exploring and manipulating AST
  - const, let, var (immutability)
  - pointers and references
  - compiler optimizations
  - move semantics
  - memory management
  - I can compile code to both javascript and C?!
  - C, C++ and JS interop (ffi)
  - I can read and understand source code of standard library procedures?!
  - huh, my computer is fast, like crazy fast!!
  - and probably more, but that's what I can recall now..
archargelod··on Marketing the Odin programming language is weird
> Spaces-only indentation forces you to write with an at least mediocre code editor

I don't understand how is that an issue, unless you write your code in notepad =).

And even if you do use dumb text editor, you can quickly write code with 1-space indentation and reformat it with nph[0].

There's also a neat trick for people who like C-style languages. If you use sufficiently enough parenthesis and semicolons - you don't need indentation at all:

  import os;proc main = (let file = paramstr(1);(for line in file.lines:(echo line; if line == "": return)))
Random thought: it shouldn't be too hard to write a formatting tool that translates braces to indentation and vice versa. But I have yet to see a project like this for Nim.

0 - https://github.com/arnetheduck/nph

archargelod··on Marketing the Odin programming language is weird
> Only huge projects can afford to have multiple Discords, Telegrams, IRCs, Wikis

There's one option available to small projects and actually you already named it yourself:

> relay bots.

Take for example Nim community. It's not huge by any margin, but we have fairly active forum[0], occasionally active Telegram channel and most of activity is on Discord, IRC and Matrix. I've grouped these three because they're almost seamlessly connected with relay bots into one platform. You can join one of several bridged platforms[1] and talk to everyone on Discord, Gitter, Matrix, etc. with quotes, pings and attachments working as you'd expect them to.

It is certainly an extra burden to moderate and manage all of this, but now you can atleast have an IRC archive[2] that's indexable and searchable [3].

On the other hand, having Discord as your *only* place for discussions is plain stupid (read: foolish). Because I know several people, including myself some years ago, that just 'nope out' from using a project when they see that the only place to get support is a Discord channel.

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

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

[2] - https://irclogs.nim-lang.org/30-05-2012.html

[3] - https://duckduckgo.com/?t=ffab&q=site%3Airclogs.nim-lang.org...

archargelod··on Marketing the Odin programming language is weird
IMO, Nim's killer feature is it's syntax. It's even in it's slogan "Efficient, Expressive, Elegant".

HN crowd would not agree with me, but indentation-based syntax is easier to read, less cluttered and more intuitive than multiple nested ()'s or {}'s . And the success of python, despite it's countless flaws is the proof.

← PreviousPage 7 of 11Next →