Thread: HyperC

  1. #61
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,065
    Quote Originally Posted by Structure View Post
    This is how i see it.
    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.
    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

  2. #62
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    147
    This means that the responsibility is on you to define HyperC rigorously
    If you program with HyperC and you cause an error how is that my fault ?

    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; 4 Weeks Ago at 02:27 PM.


  3. #63
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    147
    Im still confused about the difference between undefined behavior and a mistake.

    you want HyperC to retain the notion of undefined behaviour.
    There should be some sort of structure and rules i think.
    Last edited by Structure; 4 Weeks Ago at 02:39 PM.


  4. #64
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,065
    Quote Originally Posted by Structure View Post
    If you program with HyperC and you cause an error how is that my fault ?
    It isn't!

    Quote Originally Posted by Structure
    FYI rigorous is an understatement for my coding techniques.
    You forgot to check the return value of fgets when providing an example in the C programming forum recently

    But anyway, I'm talking about rigour of language specification, not code.

    Quote Originally Posted by Structure
    Im still confused about the difference between undefined behavior and a mistake.
    Consider a common programming mistake:
    Code:
    int numbers[10];
    for (int i = 0; i <= 10; ++i)
        numbers[i] = i;
    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.

    Here's another common beginner's question in C:
    Code:
    int x = 0;
    printf("%d\n", x++ + x++);
    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.
    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. #65
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    147

    Cool HyperC tips...

    Importing shaders:
    Code:
    <c static const char* vertex_shader_source = ":$>shaders/vertex.glsl;";
    <c static const char* fragment_shader_source = ":$>shaders/fragment.glsl;";


  6. #66
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    147
    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; 4 Weeks Ago at 05:53 PM.


  7. #67
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,408
    Quote Originally Posted by Structure View Post
    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.
    Perhaps if it was open source then I'd give it a go. As for running a random .exe on one of my Windows computers... ?... yeah, no thanks I guess I could see if it works in Linux using Wine, but why?

  8. #68
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    147
    Perhaps if it was open source then I'd give it a go.
    go away.

    As for running a random .exe
    I understand this issue and people are scared of running .exe i get it.


  9. #69
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,408
    Quote Originally Posted by Structure View Post
    go away.


    I understand this issue and people are scared of running .exe i get it.
    Why not open source it? It's not as if it's going to make you a millionaire... I guess not anyway

  10. #70
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    147
    Why not open source it?
    If people want to use it and maybe if it works out i will open-source a bare bones version.


  11. #71
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,408
    Quote Originally Posted by Structure View Post
    If people want to use it and maybe if it works out i will open-source a bare bones version.
    Ok, I want to use it

  12. #72
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    147
    Ok, I want to use it
    Hyper C Compiler

    Let me know if you have any questions.


  13. #73
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    147

    Lightbulb HyperC tips...

    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; 3 Weeks Ago at 10:25 AM.


  14. #74
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    147
    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; 3 Weeks Ago at 12:38 PM.


  15. #75
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,410
    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.

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