News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Languages

Started by TimoVJL, June 13, 2024, 04:09:30 PM

Previous topic - Next topic

stoo23

Via a link from the above pages, I stumbled on this:
Zig

Made me instantly think of 'NoCforMe'  :wink2:  :smiley:  as it's Not C and has No Macros !!  :biggrin:  :cool:

The article, suggests;
QuoteZig is an effort to create a general-purpose programming language with program-level memory controls that outperforms C, while offering a more powerful and less error-prone syntax.
The goal is nothing less than supplanting C as the baseline language of the programming ecosystem.
Because C is ubiquitous (i.e., the most common component in systems and devices everywhere), success for Zig could mean widespread improvements in performance and stability.
That's something we should all hope for.
Plus, Zig is a good, old-fashioned grass-roots project with a huge ambition and an open-source ethos.
:smiley:

NoCforMe

Quote from: stoo23 on June 13, 2024, 04:39:40 PMVia a link from the above pages, I stumbled on this:
Zig
Huh; they should maybe call it "Ctweaked".

Omigod omigod: how will I ever live without macros????

Well, you have to give it credit for some things, like compactness:
QuoteA Windows build is even smaller, coming out to 4096 bytes:
$ zig build-exe hello.zig -O ReleaseSmall -fstrip -fsingle-threaded -target x86_64-windows
$ wc -c hello.exe
4096 hello.exe
$ file hello.exe
hello.exe: PE32+ executable (console) x86-64, for MS Windows
Assembly language programming should be fun. That's why I do it.

NoCforMe

And this seems to be the design philosophy:
QuoteZen
  • Communicate intent precisely.
  • Edge cases matter.
  • Favor reading code over writing code.
  • Only one obvious way to do things.
  • Runtime crashes are better than bugs.
  • Compile errors are better than runtime crashes.
  • Incremental improvements.
  • Avoid local maximums.
  • Reduce the amount one must remember.
  • Focus on code rather than style.
  • Resource allocation may fail; resource deallocation must succeed.
  • Memory is a resource.
  • Together we serve the users.
Hmmm; not bad.

Assembly language programming should be fun. That's why I do it.

stoo23


NoCforMe

G'DAY MATE!

IMPOHT ME FUNC ChuckSomeDice;

// Tails are odd numbers & true values; heads are even numbers & false values. Unexpected values resolve to Heads.
// Returns values according to this table, where T == tails/true, H == heads/false
//
//    coin1  T    H
//        +-----+-----+
//      T |Tails|Odds |
// coin2  +-----+-----+
//      H |Odds |Heads|
//        +-----+-----+
THE HARD YAKKA FOR comeInSpinner IS (coin1, coin2) <
    I RECKON coin1isTails = YEAH, NAH!;
    I RECKON coin2isTails = YEAH, NAH!;
   
    YA RECKON coin1 IS A <
        YEAH, NAH!      ~ coin1isTails = YEAH, NAH!;
        NAH, YEAH!      ~ coin1isTails = NAH, YEAH!;
        buggeredIfIKnow ~ coin1isTails = (buggeredIfIKnow % 2) == 1;
    >
   
    YA RECKON coin2 IS A <
        YEAH, NAH!      ~ coin2isTails = YEAH, NAH!;
        NAH, YEAH!      ~ coin2isTails = NAH, YEAH!;
        buggeredIfIKnow ~ coin2isTails = (buggeredIfIKnow % 2) == 1;
    >
   
    YA RECKON coin1isTails ? <
        YA RECKON coin2isTails ? < BAIL "Tails"; >
        WHATABOUT ? < BAIL "Odds"; >
    > WHATABOUT ? <
        YA RECKON coin2isTails ? < BAIL "Odds"; >
        WHATABOUT ? < BAIL "Heads"; >
    >
>

THE HARD YAKKA FOR tossACoin IS () <
    BAIL ChuckSomeDice(0, 2) == 1;
>

GIMME comeInSpinner(tossACoin(), tossACoin());

CHEERS C***!
Assembly language programming should be fun. That's why I do it.

stoo23

 :biggrin:  Gotta Love the "Yeah ... Nah" function  :joking:

NoCforMe

It's an enumeration, ackshooly. But yeah, kewl.
Assembly language programming should be fun. That's why I do it.

stoo23

Ahh yeah sorry, I was thinking after I posted that it wasn't actually a Function and ofcourse you Did pick up on that,...  :rolleyes:  :smiley:  :tongue: somewhat distracted as watching Swedish Speedway and Le Mans  :smiley:

There was a very slick language written in Australia, quite some time ago that was great for creating serious Control GUI's and Manufacturing Process control etc but I can't remember what it was called or whether it is even still being used or developed.

jack

in my opinion a successor to C/C++ should be able to produce static and dynamic libraries for use in other programming languages, in other words libraries that are C compatible
have not looked too close to Rust or Go but from what little I seem to remember is that creating libraries for other languages was not easy or close to not possible

NoCforMe

Quote from: jack on June 16, 2024, 08:10:48 AMin my opinion a successor to C/C++ should be able to produce static and dynamic libraries for use in other programming languages, in other words libraries that are C compatible
Well, from the Zig "in-depth overview", they claim
QuoteZig is better at using C libraries than C is at using C libraries.
Assembly language programming should be fun. That's why I do it.

TimoVJL

NoCforMe knows nothing about C-language.
Prove me, that i am wrong in my words.
May the source be with you

zedd151

Quote from: TimoVJL on June 17, 2024, 12:50:05 AMNoCforMe knows nothing about C-language.
Prove me, that i am wrong in my words.

Everyone on this forum knows that C code is compiled into assembly.
Thus, your statement is false. That is one thing that Everyone here knows about C language code.  :azn:  With the exception of total newbies to ANY programming language.

Impossible to know what someone does not know. They may indeed know things that are not readily apparent, or that they are unwilling to share with others here.  :biggrin:
For instance, I know a little bit about VB6 (my first experience with a programming language), or at least I used to know. (My memory fails me after number of years) Who would have thought?
:azn:

jj2007

Quote from: NoCforMe on June 16, 2024, 08:15:44 AMZig is better at using C libraries than C is at using C libraries.

Zig has my sympathy, but this is a nonsense claim. Almost every language can pass some parameters to a C library. No language can do that "faster" or "better".

NoCforMe

Quote from: TimoVJL on June 17, 2024, 12:50:05 AMNoCforMe knows nothing about C-language.
Prove me, that i am wrong in my words.
Well, Timo, I'm not sure I can prove you wrong.
But I do know enough about C to have programmed using it in the past.
Nothing extremely extensive, but I've written working programs (and created library functions for it in assembly language as well).
C++ I don't know; I've seen it, read about it, but never used it.

So where, specifically, do you think I'm ignorant about C? Don't worry, you're not going to hurt my feelings!
Assembly language programming should be fun. That's why I do it.