HNHacker News
TopNewBestAskShowJobs

faresahmed

197 karma · joined September 7, 2023

bakhit.net

Email alias is "fares".

submissionscomments
faresahmed··on LLMs are making formal software verification feasible at a much larger scale
Also see: https://en.wikipedia.org/wiki/Reward_hacking
faresahmed··on A Design Space Exploration of Async/Await
I had a similar course, "Concepts of Programming Languages". The accompanying textbook was by Robert Sebest under the same name.
faresahmed··on Assembly Hall of Shame
Sorry for nitpicking but the logical inverse of this statement is the stronger and more appropriate version: If some app does not respond in 10ms or less, it is not interactive.
faresahmed··on Overloaded Overloading
Another comment already explains that this is regular method overriding in Python. Surely, some languages call user-defined operators 'Operator overloading' (e.g. C#) but the mechanism which Python uses (an `object` base class) IS overriding.

As to overloading as in multiple signatures (No types here!) for the same method name, it is not possible in the regular sense in Python since an object is more or less a dictionary of names. However, the dynamicity of the language will happily allow you to simulate it with YOUR own rules for disambiguation if you like. In practice, you'd 1. Don't 2. *args, **kwargs, Branches of is None and isinstance, etc.

faresahmed··on An incoherent Rust
Take a look at https://contextgeneric.dev, it's as close as one can get to solving this issue without modifying rustc.
faresahmed··on Super-Flat ASTs
I think that it's a generic programming problem: pointers are easier because the type of the pointee is easy to get (a deref) and also its location (memory) but with index-based handles into containers you can no longer say that given a handle `H` (type H = u32) I can use it to get a type `T` and not only that, you've also introduced the notion of "where", that even if for each type `T` there exists a unique handle type `H` you don't know into which container instance does that handle belong. What you need is a unique handle type per container instance. So "Handle of Pool<T>" != "Handle of Pool<T>" unless the Pool is bound to the same variable.

As far as I know no language allows expressing that kind of thing.

faresahmed··on How to grow almost anything
Off topic, but Notion is a perfect example of how badly you can abuse web standards. This webpage, which is a document with some markup and links (the very thing the web was made for) takes ~600MB RAM, about 10 seconds load, and lags terribly. Just unusable.
faresahmed··on Self-hosted x86 back end is now default in debug mode
Not to disagree with you, but even C++ is going through great efforts to improve compile-times through C++20 modules and C++23 standard library modules (import std;). Although no compiler fully supports both, you can get an idea of how they can improve compile-times with clang and libc++

    $ # No modules
    $ clang++ -std=c++23 -stdlib=libc++ a.cpp # 4.8s
    $ # With modules
    $ clang++ -std=c++23 -stdlib=libc++ --precompile -o std.pcm /path/to/libc++/v1/std.cppm # 4.6s but this is done once
    $ clang++ -std=c++23 -stdlib=libc++ -fmodule-file=std=std.pcm b.cpp # 1.5s 
a.cpp and b.cpp are equivalent but b.cpp does `import std;` and a.cpp imports every standard C++ header file (same thing as import std, you can find them in libc++' std.cppm).

Notice that this is an extreme example since we're importing the whole standard library and is actually discouraged [^1]. Instead you can get through the day with just these flags: `-stdlib=libc++ -fimplicit-modules -fimplicit-module-maps` and of course -std=c++20 or later, no extra files/commands required! but you are only restricted to doing import <vector>; and such, no import std.

[^1]: non-standard headers like `bits/stdc++.h` which does the same thing (#including the whole standard library) is what is actually discouraged because a. non-standard and b. compile-times, but I can see `import std` solving these two and being encouraged once it's widely available!

faresahmed··on CSS Minecraft
Makes you wonder, how many webpages are dependant on such services. The Web has always been brittle, but it's a little sad seeing a website not able to survive ~50k users on its first day online.

Even the least offenders, GitHub Pages, broke links before [0].

[0]: https://github.blog/news-insights/product-news/new-github-pa...

faresahmed··on Why I no longer have an old-school cert on my HTTPS site
Not so much,

    >>> s="1"+"0"*4300
    >>> json.loads(s)
    ...
    ValueError: Exceeds the limit (4300 digits) for integer string conversion: 
    value has 4301 digits; use sys.set_int_max_str_digits() to increase the limit
This was done to prevent DoS attacks 3 years ago and have been backported to at least CPython 3.9 as it was considered a CVE.

Relevant discussion: https://news.ycombinator.com/item?id=32753235

Your sibling comment suggests using decimal.Decimal which handles parsing >4300 digit numbers (by default).

faresahmed··on Mystical
It has been kind of made into a movie! The Heptapods [0] in Arrival (2016) written script is a circular shape with each subsection of the shape conveying a different meaning ultimately representing a concept or thought. A quote from the movie:

> Like their ship or their bodies, their written language has no forward or backward direction. Linguists call this "nonlinear orthography", which raises the question: Is this how they think?

While the movie explores philosophical questions other than "Arrival" and does a quiet beautiful job at that, actual linguistic experts have helped making it and it has been praised for its accuracy. I suggest you give it a go.

[0]: https://aliens.fandom.com/wiki/Heptapod

faresahmed··on When Compiler Engineers Act as Judges, What Can Possibly Go Wrong?
I'm not quiet sure why a non-technical person would be engaging in a technical matter such as compiling LLVM, they say they are involved with some Arch Linux derivative but again the question persists.
faresahmed··on Show HN: Test your typing speed and accuracy with movie scripts
Same here, the title even says "TypeScript" not "Typescript" but whatever.

I think what's somehow interesting about this is in the footer of the page:

    Autonomously crafted in 15m 4s by Leap.new
Could be some form of advertisement (with a click-baity title too? wouldn't be surprised if that also was AI-generated).
faresahmed··on When will we fix the tools that run the world?
I disagree, many businesses that put their software in maintenance mode (fix/upgrade on breakage) will be losing money in the long run.

Consider a hospital, many statistics can be collected o provide insights and make immediate decisions, faster algorithms and new ones to problems we couldn't solve back then have been discovered, the UI/UX can always be improved for productivity, etc. All of that makes money.

Software customers aren't, and shouldn't be, one-time shoppers; there's always room for improvement and new needs pop up all the time.

faresahmed··on One in five genetics papers contains errors thanks to Excel (2016)
Excel can also send mail through VBA scripts, thus satisfying Zawinski's Law[1].

[1] http://www.catb.org/jargon/html/Z/Zawinskis-Law.html

faresahmed··on Yaak is now open source
Reminds me of Linus' comments[1][2] on pull requests in the kernel's GitHub mirror. The fact that you can't disable pull requests give the impression that it's mandatory to allow anyone to request changes and for you to review them.

[1] https://github.com/torvalds/linux/pull/7

[2] https://github.com/torvalds/linux/pull/17

faresahmed··on Is my vision that bad? No, it's just a bug in Apple's Calculator
Funnily enough, even the "dark mode toggle" icon in the blog is not aligned correctly with the navbar text.

https://imgur.com/a/1xSCMWb

faresahmed··on Working with jumbo/unity builds in C/C++
IMO separation of interface and implementation is one of the "good" things about C/C++ (I used to be confused about it when starting out), it gives you a good overview of a piece of code and how it is supposed to be used. In other languages with no such "feature", you'll have to scroll hundreds of lines of implementation details you don't care about to understand the interface. You say this as a possible solution:

> You can still use header files if you want to, they’re just no longer strictly necessary. You’re free to put struct definitions and function prototypes into a header file if you’d like.

But is it really? not enforcing header files across the codebase means that you'll definitely end up with some inconsistency sooner or later that will be hard to deal with.

> The order that you include the source files in all.c matters. In the above example, bar.c had to be included before foo.c because foo.c used a struct and function that was defined in bar.c.

This is just additional overhead that you don't need while implementing something new.

And in general, this goes against how normally C/C++ codebases are structured, I'm sure I'll be hella confused about a file called `all.c`.

faresahmed··on Show HN: Ayin – An open-source photo editing software
Sorry, I know the post has fell off the Show HN page but for historical purposes I thought junior meant a first-year studnet (How isn't it?!!). I'm actually a freshman, this is my first year in college.
faresahmed··on Wikifunctions
Amazing to see RustPython being used in the wild. I wonder why they are using it. Is it easier to sandbox? smaller memory footprint than CPytohn and PyPy? just because it's cool?