faresahmed

Joined 3 years ago

Karma
197
Submissions
28
Member since
Sep 7
bakhit.net

Email alias is "fares".

View on Hacker News

Recent submissions

Comment · 9 days ago
Comment · 1 month ago
I had a similar course, "Concepts of Programming Languages". The accompanying textbook was by Robert Sebest under the same name.
Comment · 2 months ago
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.
Comment · 3 months ago
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.

Comment · 7 months ago
Take a look at https://contextgeneric.dev, it's as close as one can get to solving this issue without modifying rustc.
Comment · 10 months ago
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.

Comment · 1 year ago
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.
Comment · 1 year ago
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!

Comment · 1 year ago
Comment · 1 year ago
Comment · 1 year ago
Comment · 1 year ago
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.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton