Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
camel-cdr
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
51 ms
·
781.
▲
by
camel-cdr
4y ago
My point was that this isn't possible, because the addressable memory, whiles possible humongous, is always finite, because the sizeof pointers is constant. So at some point `malloc` must return the same address, even if you had theore
782.
▲
by
camel-cdr
4y ago
> Even with fseek there are only so many atoms in the universe and you'd eventually run into limited memory I should've explained that I'm not talking about a physical implementation, but about the theoretical bounds of th
783.
▲
by
camel-cdr
4y ago
My argument is that `fseek` (not `lseek`) is the only way for standard C to access a infinite tape, because it allows relative seeking in a file. `fseek(file, 1, SEEK_CUR)` to advance and `fseek(file, -1, SEEK_CUR)` to go back.
784.
▲
by
camel-cdr
4y ago
This is only tangential to the article: C isn't Turing complete without `fseek` (as far as I can tell). Turing completes requires you to be able to read/write from an infinite tape (essentially infinite memory). This isn't po
785.
▲
by
camel-cdr
4y ago
What is there to benchmark between C++, C, Rust, or any other low level compiled language though? With any one of them you can essentially achieve the same assembly code generation, if you try hard enough. In the end it either boils down to
786.
▲
by
camel-cdr
4y ago
nullptr since we have type detection now, and NULL mustn't be a pointer. auto, because otherwise everybody would create their own hacky auto using the new typeof.
787.
▲
by
camel-cdr
4y ago
#embed coming to c distributions near you in 2023 [0] [0] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3017.htm
788.
▲
by
camel-cdr
4y ago
> they evaluate to the file/line they appear at in the macro source, not at the line the macro is invoked. What are you talking about? Maybe I'm missing your point, but: #define A __LINE__ A A Expands to: 2 3
789.
▲
by
camel-cdr
4y ago
Since some people missed this, every entry is a clickable link.
790.
▲
by
camel-cdr
4y ago
Sorry, I misread your comment as clickbait instead of clickable. ~~I can see how others are somewhat clickbait, but this is literally single instruction/continuation multiple data. It uses a single step in the continuation mechanism t
791.
▲
The Preprocessor Iceberg Meme
(jadlevesque.github.io)
273 points
by
camel-cdr
4y ago
|
135 comments
792.
▲
by
camel-cdr
4y ago
> \sigma _{I}^{2}=a^{2}s^{2}+\left( 1-a\right)^{2}S^{2}+2a\left( 1-a\right)\sigma. I'd write the above expression as the following: \sigma_I^2 = a^2 s^2 + (1-a)^2 S^2 + 2a(1-a) \sigma The only thing you need to know to understand i
793.
▲
by
camel-cdr
4y ago
I'm always amazed how people could bootstrap something as feature rich and versatile as LaTeX from plain TeX. I'd really like to get to know plain TeX a bit better, but I've got no idea where to start.
794.
▲
by
camel-cdr
5y ago
Whenever I see such libraries, the first thing I check out is their PRNG implementation, and this one must be the worst I've seen so far. (The rest of the library is probably quite good, I'm just talking about the PRNG part) The l
795.
▲
by
camel-cdr
5y ago
George Marsaglia suggested a very simple multiply with carry PRNG you can use in your head to generate better quality random numbers. [1] 1. Select an initial random number between 1 and 58. (This is accomplished by mentally collecting entr
796.
▲
by
camel-cdr
5y ago
I think the problem might be that the blogs aren't added yet. I also couldn't find some quite popular blogs, but I submitted them, so hopefully this will change in the future.
797.
▲
by
camel-cdr
5y ago
I encourage all of you to submit the blogs you are following. Only one of the ten blogs I'm following was supported. Even quite well known once like oldnewthings or lemir's blog.
798.
▲
Sampling in Floating Point (proper random float distributions)
(pharr.org)
2 points
by
camel-cdr
5y ago
|
0 comments
799.
▲
by
camel-cdr
5y ago
Ah, that makes sense.
800.
▲
by
camel-cdr
5y ago
Out of curiosity, why should each application implement line wrapping for terminals. That seems like a feature the terminal should implement, and from what I've read there is no standard way of getting the terminal size anyway.
801.
▲
by
camel-cdr
5y ago
I use the vim easy align plugin for that. You could replicate it with "ga2 ", so go align 2nd space seperated. There are a few alignment modes for the last character (instead of the space), e.g. "|" for markdown and &quo
802.
▲
by
camel-cdr
5y ago
> I don't se why they chose function over scoped so please enlighten me I don't like it either, but it allows for a simpler syntax, consider e.g. "f = fopen(...); if (f) { defer fclose(); }". You'd need special s
803.
▲
by
camel-cdr
5y ago
Because there are multiple defer proposals and this one is made to be compatible with the lambda proposals. N2589 for example proposes a simpler defer statement that just defers an expression, so e.g. "defer fclose(f);"
804.
▲
by
camel-cdr
5y ago
Because there are multiple defer proposals and this one is made to be compatible with the lambda proposals. N2589 for example proposes a simpler defer statement that just defers an expression, so e.g. "defer fclose(f);"
805.
▲
by
camel-cdr
5y ago
For anybody interested in how this works I've written a bit of a tutorial, where I try to explain the code base: https://github.com/camel-cdr/bfcpp/blob/main/TUTORIAL.md Also, if you want to play ar
806.
▲
Show HN: Optimizing brainfuck interpreter using only the C preprocessor
(github.com)
3 points
by
camel-cdr
5y ago
|
4 comments
807.
▲
A guided (literate) implementation of a random number library
(github.com)
3 points
by
camel-cdr
6y ago
|
1 comments
808.
▲
by
camel-cdr
6y ago
A guided (literate) implementation of a random number library. This is my COVID project and a conglomeration of everything I learned about random number generation in the past half a year. The purpose of this library is to implement state o