Beta .hcc to .c language compiler.
Hyper C Compiler
"without goto we would be wtf'd"
structure:Just as any language was created for easier to read/write programs such is hyperC. Hyper C evolves the language to the next level and brings several improvements in code writing efficiency. HyperC is designed to streamline as much as possible; abstract lower-level commands with evolved parameter objects; as well as simplify program architecture.
"without goto we would be wtf'd"
C
HyperCCode:for (int i=0;i<=10;i++) { };
CCode:loop 0 to 10 as i { };
HyperCCode:if (variable == value) { } else if (variable == otherValue) { } else { };
CCode:case variable == value { } || variable == otherValue { } else { };
HyperCCode:#include "somefile.txt"
CCode:"somefile.txt";
HyperCCode:printf("%s",stringVar);
Code:ink $stringVar;
Last edited by Structure; 09-07-2019 at 05:42 PM.
"without goto we would be wtf'd"
You still need a great deal more explanation of both the syntax, its semantics, and exactly why for each feature if you want people to actually start using this. You have examples, but while you know exactly what's going on in your examples, you need to explain them to the reader.
Right now, it still looks like an incoherent mess to me, and this is comparing it with C which is already a mess in places.
Oh, and the other thing is that having "Microsoft Windows Operating System" as a requirement means that your project is going to die like Delphi, except that it might not even live like Delphi.
Last edited by laserlight; 09-07-2019 at 06:27 PM.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
There are some very simple things that you need to explain, e.g., whether your C variant still allows omitting of braces for single statement blocks, and whether semi-colons are always required, e.g. this:
Typically wouldn't have that semi-colon at the end in C, but it appears in your HyperC example. Is that significant? Furthermore, it can be rewritten as:Code:if (variable == value) { } else if (variable == otherValue) { } else { };
Whereas if we tried to so the same in HyperC:Code:if (variable == value) foo(); else if (variable == otherValue) bar(); else baz();
Is that still valid?Code:case variable == value foo(); || variable == otherValue bar(); else baz();
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Other design issues: does using $ # and ## really help? Don't they just make things cryptic? How do you account for unsigned int, long, float, long double, wchar_t?
Why is the main function defined with @, and then possibly with @main? What about other functions? This seems like a misplaced feature: the return type and signature of the main function is hardly a stumbling block in the writing of C programs as it tends to be a write-once-forget-about-it thing.
EDIT:
I just realised I missed the example of the display function:
Why is it $@* rather than $*@? Also, does this mean that you're returning to the use of default int since main isn't declared as #@main even in its longer form?Code:$@*display($data[]) {
END EDIT
The with keyword might be good idea, but your example is for a preprocessor directive. Does it apply elsewhere? And if it does, why doesn't it have preprocessor syntax instead? Are you aware that in C, the preprocessor tends to be rather different than normal C syntax and semantics?
Last edited by laserlight; 09-07-2019 at 07:27 PM.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Here's another one:
What's the reason for the # and the $ with ink? It surely cannot be a typecast because the type of (10 + 10) is already int, and surely you don't want to cast the return value of display to char when it should be a string. So do you even need them? Surely the compiler can determine the types and generate the equivalent printf from ink, so you can just write:Code:ink #(10+10); ink $display("Hello");
Code:ink (10+10); ink display("Hello");
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Oh, and why do you require comments to be terminated by a semi-colon? Doesn't that go against your design goal "to streamline as much as possible"?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
HyperC requires every line of code end with a semicolon, as well as the end of brackets for statements.whether your C variant still allows omitting of braces for single statement blocks
Is this still valid?no.Code:case variable == value foo(); || variable == otherValue bar(); else baz();
HyperC is c, you can use any type.How do you account for unsigned int, long, float, long double, wchar_t?
Code:float mynumber; long double;The standard HyperC entry point function is..Why is the main function defined with @, and then possibly with @main?
This is equivalent to..Code:@{ };
Functions in HyperC are as follows...Code:int main(int argc, char *argv[]) { };
This is equivalent to...Code:@myfunction{ };
This allows for a custom entry point function where you might not want to use argc, and argv but your own variables.Code:void myfunction{ }
You can also use the parameter -w to use the winMain as @.
"without goto we would be wtf'd"
Ink is output to the console.
$ is a string, # is an integer, ## is a double.
HyperC
cCode:ink "name:" $name " number:" #number
Code:printf("name: %s number: %i",name,number)
"without goto we would be wtf'd"
also development of the actual code. It's not complete it's still in beta.You still need a great deal more explanation
"without goto we would be wtf'd"
Here is a short video showing how to use ink, and functions.
HyperC was originally called arc.
YouTube
"without goto we would be wtf'd"
That doesn't answer my question pertaining to braces, and introduces another one: why does HyperC require every line of code to end in a semi-colon, including what C does not require? Doesn't this go against the design goals of HyperC?Originally Posted by Structure
That just repeats what's already in your documentation withoit answering my question. I'm saying that your syntax sucks in relation to your stated goals for your language, and this particular syntax that I'm criticising is used in ink. You might have a good reason for it, but right now it's looking like the very boilerplate that you're trying to streamline, so my question is why do you require that # and $ be used with ink when the types can be deduced at compile time.Originally Posted by Structure
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
i disagree.your syntax sucks
So that you can easily see the value type and there is no confusion as to what is happening.why do you require that # and $ be used with ink when the types can be deduced at compile time
This also reduces a step in the compilation process.
Last edited by Structure; 09-09-2019 at 02:17 PM.
"without goto we would be wtf'd"
So rather than have your compiler do a thing that compilers are want to do, you foist that onto the user?
“Salem Was Wrong!” -- Pedant Necromancer
“Four isn't random!” -- Gibbering Mouther