Z++ for Windows and Linux

106 views
Skip to first unread message

Zorro

unread,
Jan 24, 2023, 6:09:13 PMJan 24
to
Z++ is platform-independent "superset" of C++ for distributed computing.
z++visual, IDE for developing Z++ applications, runs on Windows and Linux.

z++visual makes creating sophisticated GUI, simple, via drag-and-drop.
Applications built on either Linux or Windows, will run on both.

Z++ applications can communicate with one another. Autonomous agents can
travel among Linux and Windows nodes.

z++visual is free for personal/educational use.

Go to: https://www.zhmicro.com/new_user.php

Chris M. Thomasson

unread,
Jan 24, 2023, 6:12:37 PMJan 24
to
I suppose I should read the book first, just to be prudent:

https://www.zhmicro.com/z++_book.html

;^)

Chris M. Thomasson

unread,
Jan 24, 2023, 6:14:39 PMJan 24
to
The following is going to piss a lot of people off:
________________
// Samples.zpp
#include<iostream.h>
using namespace ioSpace;
//////////////////////////////////////////////////////////////////////
// ---------------------------------------------------------------- //
//////////////////////////////////////////////////////////////////////
entry void main(void)
output << "Hello World!\n";
________________


void main


God damn it!

Öö Tiib

unread,
Jan 24, 2023, 7:42:07 PMJan 24
to
On Wednesday, 25 January 2023 at 01:14:39 UTC+2, Chris M. Thomasson wrote:
>
> void main
>
>
> God damn it!

Can't even return if a program completed successfully or failed?
Instead some kind of agents start to roam around autonomously
and moan "Braiins!" Maybe that is what the "z" comes from.

Zorro

unread,
Jan 31, 2023, 2:00:15 PMJan 31
to
Answer:
This program does not compile. You get error: Error 50001 (Linker): No entry points found.
So, what are you trying to run?

A function in Z++ must end with: "end;". In fact all constructs have their ending tag. For instance
if ... elsif ...else...endif;

Second, you can execute both, Debug and Release builds within z++visual. For you program, I checked they run great.
If you want to execute a Z++ program outside of z++visual, it must be in Release build. Otherwise you will get a message
telling you that your program contains debug info, and terminates.

To run a Z++ program from a console, you have two options. Either go the Release directory of your project (via cd), then type

zvp Sample.zxe

Z++ executable will have extension ".zxe" , find it in Release folder and do as above.

Or, do: zvp full-path/Sample.zxe

I really do not understand the call: "void main". Sorry for your trouble. However, the product works as documented.

Regards.

Zorro

unread,
Jan 31, 2023, 2:07:56 PMJan 31
to
Answer.
Your insult is without any basis. I have answered those who indicated they had trouble.
What do you mean: Can't even return if a program completed successfully or failed?

What did you do?

Insults and other tactics will not stop people who no better to give themselves a chance.

Scott Lurndal

unread,
Jan 31, 2023, 2:27:26 PMJan 31
to
Zorro <zor...@gmail.com> writes:
>On Tuesday, January 24, 2023 at 6:42:07 PM UTC-6, =C3=96=C3=B6 Tiib wrote:
>> On Wednesday, 25 January 2023 at 01:14:39 UTC+2, Chris M. Thomasson wrote=
>:=20
>> >=20
>> > void main=20
>> >=20
>> >=20
>> > God damn it!
>> Can't even return if a program completed successfully or failed?=20
>> Instead some kind of agents start to roam around autonomously=20
>> and moan "Braiins!" Maybe that is what the "z" comes from.
>
>Answer.
>Your insult is without any basis. I have answered those who indicated they =
>had trouble.
>What do you mean: Can't even return if a program completed successfully or =
>failed?=20
>
>What did you do?
>
>Insults and other tactics will not stop people who no better to give themse=
>lves a chance.
>

I'm reluctant to interfere with the rant fest, but I believe Tiib was
commenting on the apparent inability of Z++ to return a completion
status to the program (e.g. shell) which executed the Z++ application;
which can then be subsequently used to determine the success of the
application (or a myriad of other uses) in a shell script or parent
process.

In C, that would be the final return statement in the function 'main'
which is specified to return a signed integer value.

Keith Thompson

unread,
Jan 31, 2023, 5:22:52 PMJan 31
to
I don't see any good reason why that should annoy anyone. C++ requires
main to return int (and C almost requires the same thing; the details
are off-topic here). There's no reason that a *different language*
should have the same rule (unless it's intended to be a strict superset
of C++, but I don't think it is). It's likely (I haven't checked) that
Z++ has some other mechanism for returning a status to the calling
environment; perhaps it can call std::exit().

--
Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */

Chris M. Thomasson

unread,
Jan 31, 2023, 5:29:42 PMJan 31
to
True. I just pointed out that a C programmer is going to possibly get
annoyed at the sheer sight of void main.

Zorro

unread,
Jan 31, 2023, 6:25:25 PMJan 31
to
Thank you. ,Z++ is a "Superset", not an extension of C++, as it it to C. The list of
corrections to C++ is too long, here is a few simple ones:

The switch statement has an optional initial body where you can check something and return without
executing any of the cases. You can also declare objects that can be used in all "cases". The case
statements can be written as: "case 1..10:" instead of listing them all, or if not contiguous you can us commas,
as in: "case 1, 3, 12:". Since strings are built-in types, they can be used as case labels.

Z++ has a simple construct called pattern for specifying conditions for instantiating a template. e.g
template<type some-type : name-of-pattern>. At instantiation, the pattern is checked and if not followed
you will get an error.

The exception mechanism provides two forms of resumption: resume and repeat, with obvious semantics.
The debugger catches all exceptions defined in your program, that were raised but not caught, just as it
catches all memory leaks.

I will finish with this: Z++ classes and tasks (threaded classes) can have "invariant" which C++ can never
have with its heavy-weight exception mechanism which cannot even have a resumption. The reason is that
its compiler cannot catch exceptions thrown "by the compiler". It can only catch those thrown by user code.

Having said all of that, Z++ is for building platform-independent, "distributed" software. It is NOT to replace
C++ for making system software such as an IDE, just as C++ is NOT for writing operating systems. That is the
job of C.



Scott Lurndal

unread,
Jan 31, 2023, 7:30:21 PMJan 31
to
Having written two commercial operating systems in C++ and two bare-metal hypervisors
in C++, I would dispute that assertion most vociferously.

Using carefully chosen subsets of the C++ language is perfectly acceptable and
generates code that compares favorably with C and allows the encapsulation
of data and methods in class structures.

Keith Thompson

unread,
Jan 31, 2023, 7:32:44 PMJan 31
to
Zorro <zor...@gmail.com> writes:
[...]
> Thank you. ,Z++ is a "Superset", not an extension of C++, as it it to C.

What exactly do you mean by "Superset"?

If Z++ is truly a superset of C++, then every valid C++ program is a
valid Z++ program with the same semantics. If that's *nearly* the case,
as C++ is nearly a superset of C, then using the word with scare quotes
might be appropriate. If not, then you might consider using a different word.

Paavo Helde

unread,
Feb 1, 2023, 1:52:21 AMFeb 1
to
01.02.2023 01:25 Zorro kirjutas:

> Thank you. ,Z++ is a "Superset", not an extension of C++, as it it to C. The list of
> corrections to C++ is too long, here is a few simple ones:
[...]> The case
> statements can be written as: "case 1..10:" instead of listing them all, or if not contiguous you can us commas,
> as in: "case 1, 3, 12:". Since strings are built-in types, they can be used as case labels.

This would make sense if there was an implicit 'break' at the end of
each 'case' (no fall-through), is that so?


Zorro

unread,
Feb 1, 2023, 11:01:34 AMFeb 1
to
Correct, each case body is a block in which you can declare objects visible within that block, and there is no
break at end of block (it is implicit).

Zorro

unread,
Feb 1, 2023, 11:36:54 AMFeb 1
to
OK, initially C++ was called C with classes, around 1989 templates and exceptions were added.
For many years C++ was compiled to C, and the C compiler would finish the job. Thus, C++ is a
direct extension of C, even though now C++ compiler does the whole work. So now you only need
to indicate "extern "C"" for linkage purposes.

Consider definition of a class in Z++.

class some-name
//body
end;

There are no braces, but the class is defined same way as in C++, and it is multiple-inheritance.
However, private/protected (data) members can be specified as "visible". Then, they can be directly
accessed, but not modified.

A Z++ class can have any number of "invariant statements", and public methods can have "constraints"
as to what values or conditions must be satisfied so the method will be invoked (or exception will be raised).

Thus, the entire C++ class is within Z++ class, but there is a lot more, with minor difference in syntax, basically
no braces are used. This is not a direct extension of C++. Maybe we could say "semantically superset",
but that would be vague.

Mut...@dastardlyhq.com

unread,
Feb 1, 2023, 12:10:25 PMFeb 1
to
Using pascal style keywords instead of brackets is hardly a minor difference.

>no braces are used. This is not a direct extension of C++. Maybe we could say
>"semantically superset",
>but that would be vague.

One of the reasons Objective-C was unpopular was the mashing up of 2 different
syntax styles into one language. You should take note.

Paavo Helde

unread,
Feb 1, 2023, 12:23:58 PMFeb 1
to
Ok, good!

About the built-in string type: is the encoding fixed? If it is variable
length like UTF-8, then do indexing and lengths happen in bytes or
unicode characters?

Is there a separate character data type?

Are they immutable like in Python? If immutable, are the contents
reference-counted? In a thread-safe way?

Is small string optimisation used?

Are zero bytes allowed in the middle of the string?

I'm curious because I have implemented a built-in string type for a
scripting language where all these questions came up.

Zorro

unread,
Feb 1, 2023, 12:28:27 PMFeb 1
to
Every C++ class/struct will have to include a so-called virtual table. This is nothing more than the C "interrupt jump table",
which is a struct of pointers to functions to jump to. It did not come with C++ or other extensions of C like
Objective C. Every call to a method will also include a pointer "this" in C++ nomenclature. If instances to objects are passed
by value as argument, the copy constructor, as well as destructor, will be called on it. And other things I cannot think of now.

I agree, and even like the idea of writing certain parts of an operating system with C++. But not the whole thing. There are
things that even C cannot do, for which it has "inline" so assembler instructions can be inserted. Of course, C++ can do the
same.

Yes, "carefully chosen subset of C++" is a great idea, and has been done in the implementation of Z++.

Scott Lurndal

unread,
Feb 1, 2023, 1:05:37 PMFeb 1
to
Zorro <zor...@gmail.com> writes:
>On Tuesday, January 31, 2023 at 6:30:21 PM UTC-6, Scott Lurndal wrote:
>> Zorro <zor...@gmail.com> writes:
>> >On Tuesday, January 31, 2023 at 4:29:42 PM UTC-6, Chris M. Thomasson wrote:
>> >> On 1/31/2023 2:22 PM, Keith Thompson wrote:
>> >> > "Chris M. Thomasson" <chris.m.t...@gmail.com> writes:
>>
>> >Having said all of that, Z++ is for building platform-independent, "distributed" software. It is NOT to replace
>> >C++ for making system software such as an IDE, just as C++ is NOT for writing operating systems. That is the
>> >job of C.
>> Having written two commercial operating systems in C++ and two bare-metal hypervisors
>> in C++, I would dispute that assertion most vociferously.
>>
>> Using carefully chosen subsets of the C++ language is perfectly acceptable and
>> generates code that compares favorably with C and allows the encapsulation
>> of data and methods in class structures.
>
>Every C++ class/struct will have to include a so-called virtual table.

No, that is not the case. The virtual table is only present when
function overloads exist and in certain multiple inheritance
scenarios.

In those case, the overhead is no different that using the
traditional mechanisms of indirect calls through a
vector of function pointers (e.g. for Virtual File System
dispatch tables, or Scheduler dispatch tables, etc).

> This is nothing more than the C "interrupt jump table",

Actually, it is more, since the compiler handles it automatically
rather than the programmer having to create, initialize and
maintain the jump vectors.



>I agree, and even like the idea of writing certain parts of an operating
>system with C++. But not the whole thing.

The hypervisor:

SLOC Directory SLOC-by-Language (Sorted)
21708 dsm cpp=21708
17714 domain cpp=17714
12276 transport cpp=12276
8689 vserver cpp=8689
8162 debugger cpp=8162
6540 core cpp=6078,asm=462
6456 io cpp=6456
6074 xen cpp=6074
4820 mgmt cpp=4820
4390 mm cpp=4390
1829 include ansic=1286,cpp=543
1636 util cpp=1636
1608 bios cpp=1608
1234 interp cpp=1234
976 boot asm=976
518 tools ansic=403,sh=59,python=56
469 build ansic=248,cpp=221
222 platform cpp=222
0 doc (none)
0 top_dir (none)


Totals grouped by language (dominant language first):
cpp: 101831 (96.69%)
ansic: 1937 (1.84%)
asm: 1438 (1.37%)
sh: 59 (0.06%)
python: 56 (0.05%)

Zorro

unread,
Feb 1, 2023, 1:07:20 PMFeb 1
to
We are not mashing up anything. Z++ syntax for constructs is like Eiffel or Ada. Z++ compiler will
not accept C or C++ programs, because it it not a plain extension of C++. There is only one syntax
and that is of Z++. However, over-all beyond constructs that need a closing tag, the rest is C++ syntax.

C++ won popularity (I am glad it did) because ATT sent B. Strousroup and G. Booch to all major shops
to introduce and advertise it. In the 90's ATT paid for an entire "Computer Journal" and filled it with rather
childish articles touting C++. A lot of money was spent on C++. Again, I like C++ as it is, so I am glad
it won.

Now, the reason for Z++ syntax, among many other things, is that it can catch and tell you what the error
is, and where it occurred. For instance, C++ compiler loses its view when a closing brace "}" is missed in
a nested statement, say "if within a loop", or even worse when nesting is too deep. That does not happen
in Z++. It can tell you what is missing, and where.

I reviewed all major languages, and weighed their syntax before deciding on the syntax for Z++. My intent
is not to advertise Z++ as "platform-independent" C++. Actually C++ is hardly about 60% of Z++. The main
Idea behind Z++ is distributed computing, which requires: component-orientation and platform-independence.

James Kuyper

unread,
Feb 1, 2023, 1:25:05 PMFeb 1
to
On 2/1/23 11:36, Zorro wrote:
...
> OK, initially C++ was called C with classes, around 1989 templates and exceptions were added.
> For many years C++ was compiled to C, and the C compiler would finish the job. Thus, C++ is a
> direct extension of C, even though now C++ compiler does the whole work. So now you only need
> to indicate "extern "C"" for linkage purposes.

The C standard specifies the requirements for a conforming extension to
C: "A conforming implementation may have extensions (including
additional library functions), provided they do not alter the behavior
of any strictly conforming program." (4p6)

That's a very strict requirement, and it has been a very long time since
any version of C++ even came close to qualifying as an extension to C.
See Annex C.5 and C.6 of the C++ standard for a 10 page list of ways in
which C++ gives code that is permitted in both languages a significantly
different meaning than it would have as C code.

The C++ standard has similar language in 4.1p8, except that it uses
"well-formed" rather than "strictly conforming". There are significant
conceptual differences between "strictly conforming", as that term is
defined by the C standard, and "well-formed" as it is defined by the C++
standard, but they serve similar purposes in the two standards, and are
both very strict requirements. I sincerely doubt, from what you've said,
that Z++ even comes close to qualifying.

Zorro

unread,
Feb 1, 2023, 1:57:46 PMFeb 1
to
I think there is a big misunderstanding, sorry. Look, a program will consist of a lot of
statement such as:

new for creating dynamic objects
a++ or ++a for incrementing (and decrementing)
a << 4 or a <<= 4 and many other operators
pointer arithmetic
invoking methods, like p->method(...)
etc.

The syntax and semantics are identical to C++. But that is the bulk of a program. The main
difference is in the definitions, which are mostly extended. For instance:

enum something {....};

is exactly as in C++, but the values are private. Yes, C++ later added "enum class", but the work on
Z++ started in 1991 while I was still in academia. In addition, in Z++ you can extend enumeration:

enum another_thing : something {...};

Now, another_thing will include "something", and then add to it the new values.

Z++ does not have to deal with conforming to C++ standard, because it is not claiming to be
a direct extension of C++. It is a different language which uses the same syntax and semantics
for much of the statements that constitute a program. I hope this clarifies things somewhat.

Zorro

unread,
Feb 1, 2023, 5:03:29 PMFeb 1
to
As a built-in type it is an abstraction that can be extended in the future, only if needed. For now they are C-string
meaning single-byte ASCII characters. But of course one can create classes for whatever string kind
like unicode, UTF-8 etc, which then will not be built-in, and cannot be used as case labels. So, the answer to
your questions is no. Sorry.

Tim Rentsch

unread,
Feb 2, 2023, 10:10:08 AMFeb 2
to
sc...@slp53.sl.home (Scott Lurndal) writes:

> Zorro <zor...@gmail.com> writes:
>
>> On Tuesday, January 31, 2023 at 6:30:21 PM UTC-6, Scott Lurndal wrote:
>>
>>> Zorro <zor...@gmail.com> writes:
>>>
>>>> On Tuesday, January 31, 2023 at 4:29:42 PM UTC-6, Chris Thomasson wrote:
>>>>
>>>>> On 1/31/2023 2:22 PM, Keith Thompson wrote:
>>>>>
>>>>>> "Chris M. Thomasson" <chris.m.t...@gmail.com> writes:
>>>>
>>>> Having said all of that, Z++ is for building platform-independent,
>>>> "distributed" software. It is NOT to replace
>>>> C++ for making system software such as an IDE, just as C++ is NOT for
>>>> writing operating systems. That is the
>>>> job of C.
>>>
>>> Having written two commercial operating systems in C++ and two
>>> bare-metal hypervisors in C++, I would dispute that assertion most
>>> vociferously.
>>>
>>> Using carefully chosen subsets of the C++ language is perfectly
>>> acceptable and generates code that compares favorably with C and
>>> allows the encapsulation of data and methods in class structures.
>>
>> Every C++ class/struct will have to include a so-called virtual
>> table.
>
> No, that is not the case. The virtual table is only present when
> function overloads exist and in certain multiple inheritance
> scenarios. [...]

This claim isn't right. Any class (or struct) that has at least
one virtual function will have a virtual function table. The
existence of a virtual function table does not depend on whether
the class/struct has overloaded functions or whether inheritance
is present.

Note that these comments apply to class/struct definitions, not
to instances thereof. Each instance of a class or struct that
has virtual functions will have a pointer to the appropriate
virtual function table (with the understanding that such pointers
may be shared when inheritance is present, and may have more
complicated relationships when multiple inheritance is used).

Mut...@dastardlyhq.com

unread,
Feb 2, 2023, 11:11:22 AMFeb 2
to
On Thu, 02 Feb 2023 07:09:50 -0800
Tim Rentsch <tr.1...@z991.linuxsc.com> wrote:
>sc...@slp53.sl.home (Scott Lurndal) writes:
>>> Every C++ class/struct will have to include a so-called virtual
>>> table.
>>
>> No, that is not the case. The virtual table is only present when
>> function overloads exist and in certain multiple inheritance
>> scenarios. [...]
>
>This claim isn't right. Any class (or struct) that has at least
>one virtual function will have a virtual function table. The

Has at least one != every.

Zorro

unread,
Feb 2, 2023, 4:39:40 PMFeb 2
to
You are right. I should have been more specific. The conversation was not so much about
how C++ deals with classes, but its use for writing an operating system. Sorry about that.

Tim Rentsch

unread,
Feb 2, 2023, 8:43:14 PMFeb 2
to
That's true, but it has no bearing on what I said.
Reply all
Reply to author
Forward
0 new messages