Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
quelsolaar
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
61.
▲
by
quelsolaar
3y ago
That is if you know about this issue. Very few people do. At some point C23 may become a default version of C in some compilers and someone who has been building code without specifying what version of C they use, will silently get a bug. T
62.
▲
by
quelsolaar
3y ago
You are right it is bad to use typeless variables, and its also bad to use auto in C23 to infer type. So this code should never be written, but its still bad to break existing code.
63.
▲
by
quelsolaar
3y ago
You cant make a compiler diagnostic, because it was valid before and after C23, the code just means different things. In fact just using auto without a type was bad practice in earlier versions, now it can be considered a feature, so its le
64.
▲
by
quelsolaar
3y ago
Yes the use of auto is rare, and should not be used in the first place. Still i don't like silently breaking old code. You cant just do a search and replace. This is valid: auto float f; so a search and replace would break that code.
65.
▲
by
quelsolaar
3y ago
You are right. void pointers can convert to any pointer type in C. That's why you don't need to cast malloc in C.
66.
▲
by
quelsolaar
3y ago
Because it changes the meaning of existing code. That's a big no-no.
67.
▲
by
quelsolaar
3y ago
A few things to note and out this. Yes feel free to enable -Werror, but warnings are implementation specific, so there is no way to write portable C code that is warning free. A compiler can issue a warning for anything, like you using a co
68.
▲
by
quelsolaar
3y ago
And its broken! Consider: auto i = 0.0; i is a double in C23 but an int in earlier version. Please don't use C23.
69.
▲
by
quelsolaar
3y ago
I have no problem putting ifdefs around my platform specific code.
70.
▲
by
quelsolaar
3y ago
No, Bercause MakeMake cant know what defines are made by the compiler on the system. MakeMake may not even run on the same system as the resulting makefile will be used on. This means that all source code files has to be compilable on all p
71.
▲
by
quelsolaar
3y ago
It builds a Android APK with one line of comand line on a fresh install linux to begin with (Thanks to Felix) thats pretty cool. Id say the main use case is to move dependencies from a project file to the actiual C files that have the depen
72.
▲
by
quelsolaar
3y ago
Because Cmake requires a configuration file for each project. With makemake i can with a single command line build a new project without any configuration needed. Its one less thing to maintain.
73.
▲
by
quelsolaar
3y ago
Here is the fundamental problem it solves for me: my code in 99% pure C code without dependencies. Then i have a few wrappers for platform specific stuff. I have many many projects that use the same wrappers. Make files store both what file
74.
▲
by
quelsolaar
3y ago
Yes. I had an early implementation that did look for any function declarations, but using extern made it more robust, and enforces the use of extern, something i think helps with clarity.
75.
▲
MakeMake: Generate make files from C source code
(github.com)
140 points
by
quelsolaar
3y ago
|
69 comments
76.
▲
Why do people consider Code quality == Maintainability?
(twitter.com)
2 points
by
quelsolaar
3y ago
|
2 comments
77.
▲
by
quelsolaar
3y ago
A good start would be the book Real-Time Rendering: https://www.realtimerendering.com/
78.
▲
by
quelsolaar
3y ago
As a graphics programmer i think its good to have a well rounded idea about how graphics works. Here are some things I would expect a good graphics programmer to know, beyond just programming and an API: -Rotation view and projection matric
79.
▲
by
quelsolaar
3y ago
C is a perfectly good alternative to C++ for Graphics programming. OpenGL and Vulcan are C APIs and DirectX has a C wrapper. Some games like Call of duty are written in C, but C++ is more common.
80.
▲
by
quelsolaar
3y ago
Being a graphics programmer is a pretty well defined category of programmers. A lot of the things you mentioned aren't graphics programming like Rig, Texture or Model, and a graphics programmer is expected to be able to run the gamut o
81.
▲
by
quelsolaar
3y ago
Great plan. Ill choose to pay my taxes to Hayek in Monopoly money.
82.
▲
by
quelsolaar
3y ago
TSMC is dominant in technology AND volume. It chip shortage would be massive. Redesigning everything that has a TSMC chip in it to use something else would be a massive undertaking. What do you think the stock market would say if Apple anno
83.
▲
by
quelsolaar
3y ago
Sure we could all use more positive visions for the future, but... The most immediate need we have to Taiwan is TSMC. Without them Nvidia, AMD and Apple are effectively dead, along with any car company, and a good deal of the products and s
84.
▲
A Proposal for C2Y [pdf]
(open-std.org)
4 points
by
quelsolaar
3y ago
|
0 comments
85.
▲
by
quelsolaar
3y ago
No, Pro Poker player loose all the time, but they are far better than your average players becasu they make better bets, because they understand the game and the odds better. Good programers are wrong all the time, (I know i am) but they ma
86.
▲
by
quelsolaar
3y ago
Sure, Right now I'm working on a Constructyive Solid Geometry algorithm, it requires me to cast a lot of rays, so i know this will be slow. I can up-front say that the Raycaster needs to have fast data structure and that its worth givi
87.
▲
by
quelsolaar
3y ago
Generally these are good, but in practice #1 doesn't hold. When you start out you need to have a _theory_ about what will be you bottleneck. A lot of times you cant implement XYZ, and then measure what was slow and fix that. X, Y, and
88.
▲
by
quelsolaar
3y ago
When desktop applications running in electron, just doesnt have enough web abstraction to keep up with mores law, a hero comes along, to ensure there can always be one more level of java script between you and a responsive UI.
89.
▲
by
quelsolaar
3y ago
Your friendly wg14 member here. It is a low-level language, but it is not a portable assembler. If you think you what you will write will have a one-to-one relationship to assembler you will run in to trouble. If you want a deeper dive in t
90.
▲
by
quelsolaar
3y ago
You can declare flexible array member strings with literals like this: #define DECLARE_STRING(variable_name, string) struct{size_t allocated; size_t used; char string[sizeof(c_string)];} variable_name ## internal = {.allocated = sizeof(c_st
More ›