# HyperC

Show 80 post(s) from this thread on one page
Page 4 of 6 First 123456 Last
• 09-14-2019
Structure
Quote:

what is the type of this string? what is its size?
The string is a char[] null terminated array.

Quote:

should free be called?
I believe that is a preference.

Code:

`  clear value;`
• 09-14-2019
Structure
HyperC tips...
constructing formatted strings:
Code:

```<stdio.h>; <string.h>; @{   with char ;     string1[100]; string2[100];   with float ;     a = 1.0; b = 2.0; c = 3.0;     total = 0;   with;     string1 = "a = %f, b = %f, c = %f", a, b, c;   total = (a+b+c);   string2 = "a+b+c = %f", total;     ink [s]string1 "\n" [s]string2; };```
• 09-14-2019
Structure
example...
Fibonacci Series:
Code:

```<stdio.h>; <string.h>; @{     int current = 0, next = 1, temp;     ink "Enter the number of terms: "; get number;     ink "Fibonacci Series: ";     loop 1 to atoi(number) as i {       ink [i]current;       case i != atoi(number) { ink ", "; };       temp = ( current + next );       current = next; next = temp;     }; };```
• 09-14-2019
Structure
HyperC

If you are wondering about a feature or have an idea on how to improve HyperC post your thoughts.

You can find it here:

Hyper C Compiler
• 09-14-2019
laserlight
Quote:

Originally Posted by Structure
The string is a char[] null terminated array.

That's an incomplete answer. Remember, if you're reading input to be stored in an array, the size of the array must be known in advance, whether it is a fixed size array or a variable length array. So, what's the size of the array? What if a larger array is required to fit all the input? What if the input is too large for the array? Can the size of the array be customised with get?

Quote:

Originally Posted by Structure
I believe that is a preference

It isn't: calling free on an array of char results in undefined behaviour. As you're building on C, this means that you must either define the behaviour, or be explicit about retaining it.

Quote:

Originally Posted by Structure
Code:

`clear value;`

This is a meaningless example. When giving examples, provide context and explain both syntax and semantics. You have this same issue in your documentation, which makes HyperC hard to understand. Ideally, provide both tutorial format documentation to guide potential users, and reference style documentation to properly document syntax and semantics.

By the way, you should take care about reserved words: are you really intending to make get and clear reserved words? They are so commonly used.
• 09-15-2019
Structure
Quote:

Ideally, provide both tutorial format documentation to guide potential users, and reference style documentation to properly document syntax and semantics.
Obviously, I am horrible at documentation.

Quote:

Can the size of the array be customised with get?
It will be by the end of the day. :cool:

Quote:

this means that you must either define the behaviour, or be explicit about retaining it.
tbh, i can do whatever i want. I built it.
• 09-15-2019
laserlight
Quote:

Originally Posted by Structure
Obviously, I am horrible at documentation.

Not saying that I'm volunteering, but one option then is to team up with someone who's better at documentation. This has the added benefit of being able to talk over stuff with someone else and hence improve your programming language.

Quote:

Originally Posted by Structure
tbh, i can do whatever i want. I built it.

Sure, but if nobody else knows how to use the constructs of your programming language because in your arrogance as language designer you keep things to yourself, then they simply aren't going to use your programming language. If you're interested in seeing adoption, then you have to define stuff and communicate it so potential users will understand the expected semantics.
• 09-15-2019
Structure
HyperC Update Version 4.2.3
Quote:

Can the size of the array be customised with get?
It is now required that you set the size of the array.
i.e:
Code:

```<stdio.h>; <string.h>; @{   ink "Enter your name: ";   get name[100];   ink "Hello " [s]name "."; };```
before you would use get name.
now you define the size of the array: name[10];

Quote:

Goals.

Quote:

Possibly...

Quote:

keep things to yourself
As far as the source goes, absolutely.

Quote:

they simply aren't going to use your programming language.
bummer.
• 09-15-2019
Structure
Quote:

if nobody else knows how to use the constructs of your programming language
That's what these posts are for.
• 09-15-2019
laserlight
Quote:

Originally Posted by Structure
That's what these posts are for.

You can stop misquoting me now: I wrote that in reference to your reply to me that "tbh, i can do whatever i want. I built it." when I reminded you that "calling free on an array of char results in undefined behaviour" hence you "must either define the behaviour, or be explicit about retaining it", which is just common sense: if you don't say when undefined behaviour in C is defined in HyperC, who would know?

Furthermore, while it is alright to seek feedback for HyperC on this forum, you should be putting your actual HyperC documentation on its website, not here.
• 09-15-2019
Structure
Quote:

You can stop misquoting me now
oops?

Quote:

if you don't say when undefined behaviour in C is defined in HyperC
tbh, I have no idea what this means.
• 09-15-2019
laserlight
Quote:

Originally Posted by Structure
tbh, I have no idea what this means.

Do you understand what "undefined behaviour" means in C? It's important for HyperC since you want to build HyperC on C. If you were designing HyperC from scratch instead, you might choose to ditch the notion of undefined behaviour, which primarily has value for optimisation at the cost of potential bugs.
• 09-15-2019
Structure
Quote:

Do you understand what "undefined behaviour" means in C?
I do not. I'm self taught and still learning.
• 09-15-2019
laserlight
Quote:

Originally Posted by Structure
I do not.

The Wikipedia article is a good starting point: undefined behaviour

It's essential knowledge for a C programmer because it is such a source of bugs, and even more so if you're designing a language that builds on C, or if you're writing a compiler that uses C as its intermediate language.
• 09-15-2019
Structure
Quote:

It is the responsibility of the programmer to write code that never invokes undefined behavior.
This is how i see it.

Are you saying i should try not to allow undefined behaviour?
Show 80 post(s) from this thread on one page
Page 4 of 6 First 123456 Last