So this means that you want HyperC to retain the notion of undefined behaviour. This means that the responsibility is on you to define HyperC rigorously, because whatever you miss out in this regard is undefined behaviour.
Printable View
If you program with HyperC and you cause an error how is that my fault ?Quote:
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.
Im still confused about the difference between undefined behavior and a mistake.
There should be some sort of structure and rules i think.Quote:
you want HyperC to retain the notion of undefined behaviour.
It isn't!
You forgot to check the return value of fgets when providing an example in the C programming forum recently :pQuote:
Originally Posted by Structure
But anyway, I'm talking about rigour of language specification, not code.
Consider a common programming mistake:Quote:
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++);
Importing shaders:
Code:<c static const char* vertex_shader_source = ":$>shaders/vertex.glsl;";
<c static const char* fragment_shader_source = ":$>shaders/fragment.glsl;";
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.
go away.Quote:
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.Quote:
As for running a random .exe
If people want to use it and maybe if it works out i will open-source a bare bones version.Quote:
Why not open source it?
Hyper C CompilerQuote:
Ok, I want to use it
Let me know if you have any questions.
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.
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();
};
TBH, all this belongs on a blog on your own forum, where people who are actually interested can follow your wandering thoughts.