HNHacker News
TopNewBestAskShowJobs

sixthDot

211 karma · joined July 2, 2023

submissionscomments
sixthDot··on NotepadNext – a cross-platform reimplementation of Notepad++
Have you ever heard of https://cudatext.github.io/. It's certainly faster than Kate.
sixthDot··on Comments Are Code (2018)
the side bar is dated in at least two ways.
sixthDot··on Former terrorist lived in Berlin for 20 years, posted pictures on Facebook
while the article states it was a fingerprint "direct hit"
sixthDot··on C++20 Idioms for Parameter Packs
Fortunately D has `static foreach`, is what I thought yesterday after reading the article.

One aspect I note is that finally the point is not having variadics or not (assuming an expression can represent a type then you can use tuples instead, which is what styx-lang does). The point is that one must have a way to *use* them.

The "consume" idiom, while working, is not great as it lead to template instances explosion. Not great but not so terrible as finally `static foreach` can only work with a kind of monomorphization too.

sixthDot··on DMD Compiler as a Library: A Call to Arms
The backend/frontend separation sounds right but the "sub" split of the frontend sounds odd.

You dont care if in the AST some functions are doing too much. In my opinion the most important is the ability to _drive the compilation_, for example stop after lexical, stop after semantics. Then if too much code got compiled into the *.a that's unfortunate but not dramatic.

BTW there's is also the split between the driver and the frontend, but I think this is done.

sixthDot··on XL: An Extensible Programming Language
From what I can read the author got really unlucky with some kind of radical API changes. Maybe at that time the LLVM team was a bit less serious with deprecations ?

I use LLVM since v9, nowadays I'm stuck on v15 (that's not because of LLVM btw).

Between the two versions there's been a radical change too, i.e "opaque pointers", but the transition was rather smooth as we were provided, for a long time, the two versions of the functions affected by the change. Maybe the LLVM team got more serious since the author experienced the said difficulties ?

Other thing I note is that the author uses the CPP API. I use the C one which exposes only a high-level subset of the CPP one. This encourages a saner use of LLVM, a more concrete separation between the front-end and the mid-end, although sometimes there are limitations.

A simple example of what encourages the C API, especially since opaque ptrs are added, is not to rely on LLVM to retrieve the IR type of an IR value. That should always be done using the AST, eg with an `.ir` field in your nodes.

Another one I remark, after a brief overview of LLVM-CRAP, is that the author had to change the internal data structure used, depending on the LLVM version [0]. Using the C API that would never had happened. The C API essentially allows to create block refs, instructions refs, value refs, type refs, contexts. Then you choose the containers you want to use to hold them. No need to switch to another stdcpp one, even if internally LLVM does so.

[0]: https://github.com/c3d/xl/blob/master/src/llvm-crap.cpp#L265

sixthDot··on The Fil-C Manifesto: Garbage In, Memory Safety Out
Commits messages are the shit.
sixthDot··on What happens when a school bans smartphones? A complete transformation
Big public schools could use jammers, but afaik those equipements are not legal.
sixthDot··on OpenD, a D language fork that is open to your contributions
The names you know in this list https://en.wikipedia.org/wiki/List_of_software_forks
sixthDot··on OpenD, a D language fork that is open to your contributions
the 3rd, LDC, uses LLVM as backend. Both all share the same frontend. https://dlang.org/download.html

open-D is not a 4th implementation it's a fork.

sixthDot··on RR – Railroad Diagram Generator
Docs look fancier. Well not always [1].

[1]: https://www.freepascal.org/docs-html/ref/ref38x.png

sixthDot··on Ask HN: What are your New Year's resolutions?
just like 2023, 1920x1080
sixthDot··on Tell HN: Merry Christmas
> what the actual colors were

worst ?

sixthDot··on Improved `__attribute__((cleanup))` through `defer`
The specs look good but "again" this is a problem that's been solved by other languages since years, I think particularily to D "scope guards" (https://dlang.org/spec/statement.html#scope-guard-statement).
sixthDot··on Lazarus IDE 3.0
But linking is slow, plus also only possible using ld.bfd. This causes problems here as I default to gold... For now; each time you start using or close lazarus you have to remind to change ld target.

Otherwise compilation is indeed fast because it uses a system of cache (just like delphi *.dcu system) plus it has modules. On top of that we can add... context-free grammar that's fast to parse, no _insane_ preprocessing (but still some, $ifdef and co).

sixthDot··on Uniform Handling of Failure in Switch
That reminds me a problem I thought I had in STYX...

For a few months I had the feeling that a good switch-expression requires the bottom type... It turns out that the `assert(0)` idiom, used in a lambda, is sufficient:

    var u32 a = switch b do { 
        1    => 2, 
        /* ... */
        else => function(): u32 => {assert(0, "crash");}() 
    }; 
The `else` case (similar to C `default`) simply crashes the program but the type system is happy because the lambda return type is compatible.
sixthDot··on Inactive Google accounts to be deleted from Friday
> Google said the change was because of security reasons, highlighting that forgotten and unused accounts are more likely to be compromised.

Some might think "unlikely", however this really happens. Old account are hacked and the videos, previously free, posted with that account dont play anymore unless you pay a few cents.

sixthDot··on Think You're Messaging an OnlyFans Star? You're Talking to These Guys
> says one of the founders of MGMT LUX, who spoke to VICE anonymously.

I did not like Vice because of that kind of things. That "fresh" aspect on first glance but you realize later that those guys are not real journalists.

sixthDot··on It's time for a new old language (2017) [pdf]
The only limit I've ever reached with BNF is that you cannot express permutations of given set of rules, you really have to write every possibility literally.
sixthDot··on Children working as riders for food delivery apps – BBC investigation
> The BBC seems to be up in arms about substitution

They are not. They inform the reader that this system exists. Then little cherry on the cake, this system eventually leads to child labor. Plus chocolate toping, eventually someone died.

sixthDot··on Modern Pascal is still in the race (2022)
> But these days folks are mostly used to the C style syntax. And I'm not even arguing that it is a better language than C or others. But the whole industry has gone overall into believing that anything newly 'invented' is good and anything that's been around a while is passé

Problem of the Pascal syntax is that it prevents adoption of certain constructs, which are just not nice. A few examples

- lambda expression: `begin` ... `end`, say goodbye to nice one liners;

- binary assign: FPC has `+=` `-=` but obviously not `mod=`, `and=`, etc;

On top of that there are other things like

- shortened boolean evaluation (e.g `if someInt` => `if someInt != 0` is not possible because `and` is a two headed creature

- locals are still not default initialized

I use to like Pascal (actually Delphi then ObjFPC) much but nowaday I think the only good parts are in certain semantics, e.g no fallback in the `case`...`of` construct, manual memory management BUT ref counted arrays.

I would tend more to like a C like syntax with certain semantics coming from the Pascal world.

sixthDot··on YAML config file? Pain? Try Lua
LUA definition of an identifier seems not strong enough for a configuration file:

> Names (also called identifiers) in Lua can be any string of letters, digits, and underscores, not beginning with a digit. This coincides with the definition of names in most languages. (The definition of letter depends on the current locale: any character considered alphabetic by the current locale can be used in an identifier.)

config file being essentially KV pairs, thay means that certain property names are not valid or won't be valid if loaded by someone living in "country-with-strange-locale-istan".

sixthDot··on Tell HN: Modern Is Not Better
More generally that relates to "innovation VS progress". Systematically linking the two concepts is a bias.
sixthDot··on Arena allocator tips and tricks
This globally good, two remarks however:

> you don’t need to write destructors

I think this is not accurate. Destructors are not deallocators, they are supposed to set the object field in an invalid state. Now truth is that both are often called together, e.g `delete`.

> Typically arena lifetime is the whole program, so you don’t need to worry about freeing it

A technic I use is to increment a counter on `arena.alloc` and decrement it on `arena.dealloc`, and then free the memory (if it's on the heap) accordingly.

sixthDot··on NFTs Are – Finally – Worthless
no shit sherlock
sixthDot··on Fixing for loops in Go 1.22
D too https://issues.dlang.org/show_bug.cgi?id=2043.

That's actually expected when capturing by reference.

sixthDot··on TensorFlow 2.10 dropping support for native Windows (only WSL going forward)
https://www.tensorflow.org/install/pip#windows-native
sixthDot··on Talk: Ghostty and Some Useful Zig Patterns
I read C API... Can it be used like vte, e.g to embedd a terminal in a software ?
sixthDot··on Prefer Positive Booleans
Problem is that to avoid the not-exp, you transfer the cognitive load on the identifier.

I think a good variable name is more important, if that avoids the not-exp nice, but that's secondary.

sixthDot··on Rockstar is selling cracked game copies on Steam
Modified or not, legally R.S. Games owns it anyway.
← PreviousPage 5 of 6Next →