Sunday, January 12, 2025

Monday 13 January

Was up early. Got cleaned okay. Yet to shower or brush. Didn’t do any writing last night as I was drained of energy after 3 days of intense coding SeTT towards beta. Must have slept 7 hours. Work out at 8:30am. Could head out on a walk later in the afternoon.

Showered and changed into fresh clothes for walking. Will be wearing my Mudman solar. Will write project IS around dinner time. Right now, while I’m fresh, I would like to go back to Antlr coding for a few hours, see if I can generate the simple programming language I promised.

Had a second loo. Will be heading out circa lunch. Worked out and am feeling good. Having fun designing my language:

It should have 5 structures:

<pool> a universal storage soup.
<test> compare values
<set> assign values
<get> retrieve values
<repeat> loop a code block

Sample code in C:

#include <stdio.h>
int main() {
    int n, i;
    float num[100], sum = 0.0, avg;

    printf("Enter the numbers of elements: ");
    scanf("%d", &n);

    while (n > 100 || n < 1) {
        printf("Error! number should in range of (1 to 100).\n");
        printf("Enter the number again: ");
        scanf("%d", &n);
    }

    for (i = 0; i < n; ++i) {
        printf("%d. Enter number: ", i + 1);
        scanf("%f", &num[i]);
        sum += num[i];
    }

    avg = sum / n;
    printf("Average = %.2f", avg);
    return 0;
}

The same functionality in 'Little' -that's what it's called for now:

<get>Console<set>_N</set></get>
<repeat>_D<get>Console _Dnew<set>_D+_Dnew</set></get></repeat>
<get>Console<set>_D/_N</set></get>

The syntax looks like HTML. Each 'tag' can have an ID and CLASS callable from other tags. Variable names are prefixed by underscore by convention. Now to make the parser...

 A tag group is defined as <TName Arg1*>Var1* ...</TName>

* is a list of identifiers or variables while ... is another tag group. Var can be an Arg which is cool. There is o whitespace between < and tagName. Check if is not a tagName and allow the < and > inequators. All vars have underscores.

<pool id=_MyPool>_E</pool>
_MyPool's set of data with _E as the accessing variable

<test>_T2-- < 0<repeat>MyPool</repeat></test>
_T2 is decremented, checked, looping, against _E

<test>_T2-- < 0<test>_T1 > 100</test></test>
_T1 and _T2 must be more than 100 and less than 0

<pool id=_MyPool2><get>MyPool<test>_E > 100</test></get></pool>
 transer _E to _MyPool2 if over 100

<get id=_MyCompare1>_E1 _E2 _E3<set>_A<test>_E1 < _E2  _E3 > _E1</test></set></get>
a checker of 3 variables, callable by _MyCompare1, with the accessing var _A

...

Past lunch time, folks aren't back from hospital, and I have some leads on my new coding project "LTT". Should be able to get it working soon. I could write a JS or Python compiler for the output. Probably Python. Not sure how to bundle the .jar files for distribution on my website, FreeLunch.my.

Thinking the language should be called TL for Tag Language. The extension should be src.tell as TL sounds like "tell".

...

Back home after a long 1 hour walk in the sun and thru the downtown mall. Stepped on bubblegum but it's not serious. Can sense the economic hardship on the streets. Didn't pick up anything. Oakleys kept my eyes protected from the heatwave. Feeling refreshed and ready to code TL.

Had dinner which was tasty. Mom cooked. Took a loo and shower. I ate too much beans yesterday. Feeling unsure of Antlr again. I can't think abstractly enough I reckon. 

...

Took my meds earlier. Coding is going well. Much easier than SeTT was once I broke down the problem. I have a lower IQ for certain things done or shown in a certain way. Talked a bit about karma and heaven and hell, the role of Jesus and cheating others of their lives.

Liews returned fire after we taught truth. They ruined a child and some babies. ‘Lest no flesh be saved’. Facing stiff prevention completing TL. Taking a break until midnight. Brushed.


No comments:

Post a Comment

Thursday 24 April

Was up early. Managed to get cleaned well. A heavy rain is falling. I submitted iS to Amazon KDP. A little late but better late than never. ...