The MASM Forum

Miscellaneous => Hardware & Software Corner => Topic started by: TimoVJL on June 13, 2024, 04:09:30 PM

Title: Languages
Post by: TimoVJL on June 13, 2024, 04:09:30 PM
Swift the best choice to succeed C++, Apple says (https://www.infoworld.com/article/3715359/swift-the-best-choice-to-succeed-c-plus-plus-apple-says.html)
Title: Re: Languages
Post by: stoo23 on June 13, 2024, 04:39:40 PM
Via a link from the above pages, I stumbled on this:
Zig (https://ziglang.org/)

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:
Title: Re: Languages
Post by: NoCforMe on June 16, 2024, 05:16:53 AM
Quote from: stoo23 on June 13, 2024, 04:39:40 PMVia a link from the above pages, I stumbled on this:
Zig (https://ziglang.org/)
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
Title: Re: Languages
Post by: NoCforMe on June 16, 2024, 05:55:01 AM
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.

Title: Re: Languages
Post by: stoo23 on June 16, 2024, 06:11:20 AM
Aussie++ (https://aussieplusplus.vercel.app/)  :smiley:  :cool:
Title: Re: Languages
Post by: NoCforMe on June 16, 2024, 06:23:46 AM
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***!
Title: Re: Languages
Post by: stoo23 on June 16, 2024, 06:39:31 AM
 :biggrin:  Gotta Love the "Yeah ... Nah" function  :joking:
Title: Re: Languages
Post by: NoCforMe on June 16, 2024, 06:46:49 AM
It's an enumeration, ackshooly. But yeah, kewl.
Title: Re: Languages
Post by: stoo23 on June 16, 2024, 06:52:17 AM
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.
Title: Re: Languages
Post by: jack on June 16, 2024, 08:10:48 AM
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
Title: Re: Languages
Post by: NoCforMe on June 16, 2024, 08:15:44 AM
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.
Title: Re: Languages
Post by: TimoVJL on June 17, 2024, 12:50:05 AM
NoCforMe knows nothing about C-language.
Prove me, that i am wrong in my words.
Title: Re: Languages
Post by: zedd151 on June 17, 2024, 01:48:31 AM
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?
Title: Re: Languages
Post by: jj2007 on June 17, 2024, 02:24:24 AM
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".
Title: Re: Languages
Post by: NoCforMe on June 17, 2024, 05:39:26 AM
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!
Title: Re: Languages
Post by: daydreamer on June 17, 2024, 05:44:25 AM
Quote from: sudoku on June 17, 2024, 01:48:31 AM
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?
]
Are you sure not at least one of us forgot the fact of c compiles to asm? :)
If you are the only one with an unique other interest ,you feel its futile to share in this forum,but I once tried to make something out of black silk I bought,might be better to share in another forum

You probably can write a message box call in c with Chinese string in it,but using online tool to translate from your native language ,makes it take more time than write that string the languages you have enough skill in

Title: Re: Languages
Post by: NoCforMe on June 17, 2024, 05:53:43 AM
Quote from: sudoku on June 17, 2024, 01:48:31 AMImpossible to know what someone does not know.
Heh; reminds me of one of the golden moments from the Firesign Theater's "Don't Crush That Dwarf; Hand Me the Pliers":
QuotePrincipal Poop, addressing the MoreScience High assembly: How much do I hear?
George Tirebiter in the audience: That's metaphysically absurd, man! How could I know what you hear?
(ca. 1970)
Title: Re: Languages
Post by: NoCforMe on June 17, 2024, 05:57:14 AM
Quote from: daydreamer on June 17, 2024, 05:44:25 AM[Are you sure not at least one of us forgot the fact of c compiles to asm?

Well, ackshooly it compiles to .obj. (Unless it's a C compiler that requires an assembly step: does Pelles C work that way? other compilers?) Otherwise it goes from C source--> object code--> .exe (linker).
Title: Re: Languages
Post by: zedd151 on June 17, 2024, 06:05:57 AM
Quote from: NoCforMe on June 17, 2024, 05:57:14 AMOtherwise it goes from C source--> object code--> .exe (linker).
Of course.  :biggrin:  I missed those technical details.
But it further demonstrates that you do not "knows nothing about C-language".
But anyway...
Title: Re: Languages
Post by: NoCforMe on June 17, 2024, 06:07:50 AM
Let's put it this way: I know enough about C to get into trouble with it.
Title: Re: Languages
Post by: TimoVJL on June 17, 2024, 11:16:10 AM
It just depend compilers, if they use assembly in intermediate code before machine code.
gcc use as in compilation phases
Pelles C and msvc don't use external assembler, but can output asm-code
Tiny C have even internal linker
Title: Re: Languages
Post by: NoCforMe on June 17, 2024, 11:38:39 AM
Quote from: TimoVJL on June 17, 2024, 11:16:10 AMgcc use as in compilation phases
What does this mean? In English, please.
Title: Re: Languages
Post by: TimoVJL on June 17, 2024, 11:47:08 AM
Phases of Compiler with Example: Compilation Process & Steps (https://www.guru99.com/compiler-design-phases-of-compiler.html)
Title: Re: Languages
Post by: NoCforMe on June 17, 2024, 11:57:19 AM
I don't want to read that document. I'd like you to explain the meaning of "gcc use as in compilation phases".
Does not compute.

Title: Re: Languages
Post by: TimoVJL on June 17, 2024, 12:27:31 PM
Quote from: NoCforMe on June 17, 2024, 11:57:19 AMI don't want to read that document. I'd like you to explain the meaning of "gcc use as in compilation phases".
Does not compute.
as / as.exe is GNU assembler
Title: Re: Languages
Post by: NoCforMe on June 17, 2024, 12:40:22 PM
OK, that makes sense.
That should be "gcc uses as", btw.
Title: Re: Languages
Post by: zedd151 on June 17, 2024, 12:51:55 PM
Quote from: NoCforMe on June 17, 2024, 12:40:22 PMThat should be "gcc uses as", btw.
More precisely "gcc uses as, as ass'er."   :joking: