213 karma · joined Sep 7, 2023 (3y ago) · 32 submissions
Email alias is "fares".
comment 2w ago · link · parent
[1]: https://github.com/microsoft/STL/blob/main/stl/src/vector_al...
comment 2w ago · link · parent
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
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 4mo ago · link · parent
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
10.
C++ Modules Are Here to Stay(faresbakhit.github.io ↗)
78 points · by faresahmed · 10mo ago · 140 comments
comment 11mo ago · link · parent
As far as I know no language allows expressing that kind of thing.
13.
EĿlipsis, a Language Independent Preprocessor(gustedt.gitlabpages.inria.fr ↗)
4 points · by faresahmed · 1y ago · 1 comment
comment 1y ago · link · parent
$ # 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
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
>>> 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
> 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.
comment 1y ago · link · parent
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
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
comment 2y ago · link · parent
> 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`.
29.
Show HN: Ayin – An open-source photo editing software(github.com ↗)
46 points · by faresahmed · 2y ago · 3 comments