Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
If you program with HyperC and you cause an error how is that my fault ?This means that the responsibility is on you to define HyperC rigorously
If HyperC is the cause of the error i will fix it.
FYI rigorous is an understatement for my coding techniques.
Last edited by Structure; 09-15-2019 at 02:27 PM.
"without goto we would be wtf'd"
Im still confused about the difference between undefined behavior and a mistake.
There should be some sort of structure and rules i think.you want HyperC to retain the notion of undefined behaviour.
Last edited by Structure; 09-15-2019 at 02:39 PM.
"without goto we would be wtf'd"
It isn't!
You forgot to check the return value of fgets when providing an example in the C programming forum recentlyOriginally Posted by Structure
But anyway, I'm talking about rigour of language specification, not code.
Consider a common programming mistake:Originally Posted by Structure
In C, this results in undefined behaviour: the compiler is free to produce a program that does practically anything on that out of bounds assignment to numbers[10]. In other programming languages, this error might be well defined, e.g., perhaps the wrong assignment would cause an exception to be thrown, and this is guaranteed to happen.Code:int numbers[10]; for (int i = 0; i <= 10; ++i) numbers[i] = i;
Here's another common beginner's question in C:
What's the output? In C, the answer is that the behaviour is undefined, so this is actually a mistake because of how sequence points/sequenced before/after work in C. In languages that don't have the notion of undefined behaviour, they might define it, so this would not be a mistake... or they might explicitly say that such use is an error, and hence require the compiler to reject the code with an error.Code:int x = 0; printf("%d\n", x++ + x++);
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Importing shaders:
Code:<c static const char* vertex_shader_source = ":$>shaders/vertex.glsl;"; <c static const char* fragment_shader_source = ":$>shaders/fragment.glsl;";
"without goto we would be wtf'd"
If anyone wants to actually try the compiler and give me comments that would be fun. I built the compiler for myself but thought it might be usefull to others. tbh i'm not trying to put it out there i'm fine using it myself but if you want try it out and help me build a better c i'm all ears.
Last edited by Structure; 09-16-2019 at 05:53 PM.
"without goto we would be wtf'd"
go away.Perhaps if it was open source then I'd give it a go.
I understand this issue and people are scared of running .exe i get it.As for running a random .exe
"without goto we would be wtf'd"
If people want to use it and maybe if it works out i will open-source a bare bones version.Why not open source it?
"without goto we would be wtf'd"
Hyper C CompilerOk, I want to use it
Let me know if you have any questions.
"without goto we would be wtf'd"
When compiling to .c at the top of the c file you should see a compiled with hyperc version. The current version is v5.
During the v4. process i came across some errors while adding new features.
Those have been fixed. So if you do come across an error make sure it is v5 as it may already be fixed.
Last edited by Structure; 09-18-2019 at 10:25 AM.
"without goto we would be wtf'd"
A simple menu system:
Code:<stdio.h>; <stdlib.h>; <conio.h>; #@drawMenu() { with ink ;and "\n"; "Menu "; "-------------"; "[1] cls"; "[2] dir"; "[esc] exit"; "-------------"; and; "selection: "; with; return getch(); }; @menu() { switch (drawMenu()) { case '1': shell "cls"; break; case '2': shell "dir"; break; case 27: exit(1); break; default: ink "Invalid Selection.\n"; break; }; menu(); }; @{ menu(); };
Last edited by Structure; 09-18-2019 at 12:38 PM.
"without goto we would be wtf'd"
TBH, all this belongs on a blog on your own forum, where people who are actually interested can follow your wandering thoughts.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.