Thread: HyperC

  1. #1
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338

    Thumbs up HyperC

    Beta .hcc to .c language compiler.

    Hyper C Compiler

    "without goto we would be wtf'd"

  2. #2
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338
    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"

  3. #3
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338

    Cool System

    C
    Code:
     for (int i=0;i<=10;i++) { };
    HyperC
    Code:
      loop 0 to 10 as i { };
    C
    Code:
      if (variable == value) {
      } else if (variable == otherValue) {
      } else { };
    HyperC
    Code:
      case variable == value {
      } || variable == otherValue {
      } else { };
    C
    Code:
    #include "somefile.txt"
    HyperC
    Code:
    "somefile.txt";
    C
    Code:
      printf("%s",stringVar);
    HyperC
    Code:
      ink $stringVar;
    Last edited by Structure; 09-07-2019 at 05:42 PM.
    "without goto we would be wtf'd"

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    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.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    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:
    Code:
      if (variable == value) {
      } else if (variable == otherValue) {
      } else { };
    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)
        foo();
      else if (variable == otherValue)
        bar();
      else
        baz();
    Whereas if we tried to so the same in HyperC:
    Code:
      case variable == value
        foo();
      || variable == otherValue
        bar();
      else
        baz();
    Is that still valid?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    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:
    Code:
    $@*display($data[]) {
    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?
    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.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Here's another one:
    Code:
    ink #(10+10);
    ink $display("Hello");
    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");
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    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"?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #9
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338

    Cool

    whether your C variant still allows omitting of braces for single statement blocks
    HyperC requires every line of code end with a semicolon, as well as the end of brackets for statements.

    Is this still valid?
    Code:
    case variable == value
      foo();
    || variable == otherValue
      bar();
    else
      baz();
    no.

    How do you account for unsigned int, long, float, long double, wchar_t?
    HyperC is c, you can use any type.
    Code:
     
    float mynumber;
    long double;
    Why is the main function defined with @, and then possibly with @main?
    The standard HyperC entry point function is..
    Code:
    @{ };
    This is equivalent to..
    Code:
    int main(int argc, char *argv[]) { };
    Functions in HyperC are as follows...
    Code:
    @myfunction{ };
    This is equivalent to...
    Code:
    void myfunction{ }
    This allows for a custom entry point function where you might not want to use argc, and argv but your own variables.
    You can also use the parameter -w to use the winMain as @.
    "without goto we would be wtf'd"

  10. #10
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338

    Post INK

    Ink is output to the console.
    $ is a string, # is an integer, ## is a double.

    HyperC
    Code:
    ink "name:" $name " number:" #number
    c
    Code:
    printf("name: %s number: %i",name,number)
    "without goto we would be wtf'd"

  11. #11
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338
    You still need a great deal more explanation
    also development of the actual code. It's not complete it's still in beta.
    "without goto we would be wtf'd"

  12. #12
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338

    Post HyperC Functions

    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"

  13. #13
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Structure
    HyperC requires every line of code end with a semicolon, as well as the end of brackets for statements.
    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?

    Quote Originally Posted by Structure
    Ink is output to the console.
    $ is a string, # is an integer, ## is a double.
    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.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  14. #14
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338
    your syntax sucks
    i disagree.

    why do you require that # and $ be used with ink when the types can be deduced at compile time
    So that you can easily see the value type and there is no confusion as to what is happening.
    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"

  15. #15
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. HyperC Pre Process File Injection
    By Structure in forum Tech Board
    Replies: 2
    Last Post: 08-06-2019, 06:13 AM
  2. The future of the C language is HyperC
    By Structure in forum Projects and Job Recruitment
    Replies: 6
    Last Post: 05-14-2019, 08:55 AM

Tags for this Thread