Better HN
topnewbestaskshowjobs
Log inSign up

faresahmed

213 karma · joined Sep 7, 2023 (3y ago) · 32 submissions

bakhit.net

Email alias is "fares".

Submissions

comment 1w ago · link · parent

I must be stupid because I can't really interpret what I'm being shown here. It seems like someone's idea of a hacker screen for hash collisions found online?

comment 2w ago · link · parent

Agreed. I'd not ditch the STL completely, but only use its freestanding subset. Implementations contain some very fast SIMD-accelerated code[1]. +The STL works without exceptions.

[1]: https://github.com/microsoft/STL/blob/main/stl/src/vector_al...

comment 2w ago · link · parent

I beg to differ. It's not that Rust is completely different from Lisp. PL writers get so caught up with their 'killer feature' which in the case of Rust is the borrow checker, that they completely abandon the other 50% which is the environment.

If we stopped treating the compiler as a one-shot program, we could theoretically shorten this edit-build-test loop by 99%.

comment 2w ago · link · parent

Somehow always, someone somewhere rediscovers that cutting down the time between coding and code execution makes our lives easier and to a degree be able to write better programs.

Perhaps the earliest and best attempt was Lisp's computational model. Since then, the idea manifested itself again[1], again[2], and again[3] in different forms.

[1]: Inventing on Principle, Bret Victor: https://www.youtube.com/watch?v=PUv66718DII

[2]: REPL-Driven Development, Stuart Halloway: https://vimeo.com/223309989

[3]: LIVE, Live Programming workshop: https://liveprog.org/

comment 1mo ago · link · parent

Also see: https://en.wikipedia.org/wiki/Reward_hacking

comment 2mo ago · link · parent

I had a similar course, "Concepts of Programming Languages". The accompanying textbook was by Robert Sebest under the same name.

comment 3mo ago · link · parent

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 4mo ago · link · parent

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 8mo ago · link · parent

Take a look at https://contextgeneric.dev, it's as close as one can get to solving this issue without modifying rustc.

10.

C++ Modules Are Here to Stay(faresbakhit.github.io ↗)

78 points · by faresahmed · 10mo ago · 140 comments

comment 11mo ago · link · parent

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 1y ago · link · parent

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.

13.

EĿlipsis, a Language Independent Preprocessor(gustedt.gitlabpages.inria.fr ↗)

4 points · by faresahmed · 1y ago · 1 comment

comment 1y ago · link · parent

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 1y ago · link · parent

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...

comment 1y ago · link · parent

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).

comment 1y ago · link · parent

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

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

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).

20.

Show HN: Vole Machine ISA Simulator(faresbakhit.github.io ↗)

11 points · by faresahmed · 1y ago · 3 comments

comment 1y ago · link · parent

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.

22.

Hackers, Wizards of the Electronic Age (1985)(archive.org ↗)

1 points · by faresahmed · 2y ago · discuss

23.

Forscape – A Language and Editor for Scientific Computation(github.com ↗)

105 points · by faresahmed · 2y ago · 33 comments

comment 2y ago · link · parent

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

comment 2y ago · link · parent

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

comment 2y ago · link · parent

Funnily enough, even the "dark mode toggle" icon in the blog is not aligned correctly with the navbar text.

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

comment 2y ago · link · parent

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`.

comment 2y ago · link · parent

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.

29.

Show HN: Ayin – An open-source photo editing software(github.com ↗)

46 points · by faresahmed · 2y ago · 3 comments

12