fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Session material: Differences between VO and X#

Session material: Differences between VO and X# 8 months 3 weeks ago #1

  • wriedmann
  • wriedmann's Avatar Topic Author
  • Away
  • Posts: 1436
  • Karma: 6
Hi,

I have now translated my powerpoint document from the Italian Meeting at Bolzano and put it here:

Differences_VO_XS.pdf

Hopefully this PDF document will help a bit for all programmers coming from VO.

If someones finds errors, please let me know!

Wolfgang

P.S. on the page https://riedmann.it/verschiedenes_xsharp.php there may be other useful documents and samples.
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #2

Hi Wolfgang,

wriedmann wrote: If someones finds errors, please let me know!

Here are maybe some cosmetics, please bear with me, an Italian German English translated by an Afrikaans Englishman. Hopefully we can get an Englishman or English American or English <Country>man to do a final edit.
Final notice: Please all Greeks English stay out of this, no names no pack drill :lol::

The ErrorBlock is not more available

The ErrorBlock is not available anymore

As runtime we specify the libraries/DLLs than come with :

As runtime we specify the libraries/DLLs that come with:

Every data type in an object, even basic data types like „string“, „int“, „logic“

Every data type is an object, even basic data types like "string“, "int“, "logic“

•String != array of char != array of byte
•Attention at the conversions!
•You cannot more easily use memo fields for binary content (compressed or crypted data, etc.)

String != array or char != array of byte
•Attention to the conversions!
•You can more easily use memo fields for binary content (compressed or encrypted data, etc.)

A string in X# è is delimited with the double apostroph: „, but in the VO dialect also the single apostroph can be used. The parentheses [] cannot be used anymore.

A string in X# is delimited with a double apostrophe: ", but in the VO dialect, a single apostrophe can be used. The parentheses [] cannot be used anymore.

A single character delimited with single apostroph is not a string, but a char!

A single character delimited with a single apostrophe is not a string, but a char!

Attention at the dialects: Vulcan does not permits the single apostroph as string delimiters

Attention to the dialects: Vulcan does not permit a single apostrophe as string delimiters

Escaped string: e“Hi guys,\nwelcome to Bolzano, the capital of \“Südtirol\““
Interpolated string i“Hi {cNome}“

Escaped string: e“Hi guys,\nwelcome to Bolzano, the capital of \“Südtirol\““
Interpolated string:
Hi guys,
welcome to Bolzano, the capital of “Südtirol"

The namespaces are helping to organize the own classes, and to avoid conflicts.

Namespaces are helping to organize our own classes, and to avoid conflicts.

The „Using“ statement declares the used namespace, but it is possible to not specify it, but then you need to specify the fully qualified class name.
Separator between class and namespace : the dot „.“

The "Using“ statement declares the used namespace, but it is optional, otherwise you need to specify the fully qualified class name.
Separator between class and namespace : a dot ".“

example because they mix namespaces in assemblies (more different namespaces in one assembly, and namespaces sparsed over multiple assemblies)

example because they mix namespaces in assemblies (different namespaces in one assembly, and namespaces spread over multiple assemblies)

In VO we use the colon to access the methods and assign/access of the classes, and the dot for the members of structures. In X# we need delimiters in more occasions:
•Method/Assign/Access/Property: colon
•Static method: dot
•Separatore di namespace: dot
•Structure: dot Attention: some uses have requested that colon and dot are treated the same, and in some places this should work! (C# uses only the dot, so the Roslyn compiler make no distinction)

In VO we use a colon to access methods and assign/access of classes, a dot for the members of structures. In X# we need delimiters on more occasions:
•Method/Assign/Access/Property: colon
•Static method: dot
•Separators of namespaces: dot
•Structure: dot Attention: some users have requested that colon and dot are treated the same, and in some places this should work! (C# uses only the dot, so the Roslyn compiler make no distinction)

Since the application runs not more under the VO runtime control, we have to adjust to the .NET Framework sight.
Attention: without errorhandling the application could be terminated without error

Since the application does not run under the VO runtime control anymore, we have to adjust to the .NET Framework way.
Attention: without error handling the application could terminate without an error!!!

There is no more the possibility toi set a global error handler. Error handling in .NET is local, no more global like in VO!

There is no possibility anymore to set a global error handler. Error handling in .NET is local, no more GLOBAL like in VO!

Please pay attention to „begin – end sequence“

Please pay attention to "begin – end" sequences

can be defined „as IName“

can be defined "as IName“

Convention: every interface definition name start with an uppercase „I“

Convention: every interface definition name start with an uppercase i "I“

Float in Clipper and VO, and therefore also in Vulcan and X# is a „floating point“ data type, with a floating comma and exponents.
A number „123456789“ internally could be „123456788.9999999999“ .
This can lead to rounding problems since
„123456789 == nVariabile“ could return false.
In the .NET Framework there is a datatype „decimal“ with high precision, where these sort of errors does not occurs anymore. Unique problem: it is slower.

Float in Clipper and VO, and therefore also in Vulcan and X# is a "floating point“ data type, with a floating decimal comma/dot and exponents.
A number "123456789“ internally could be "123456788.9999999999“ .
This can lead to rounding problems since
"123456789 == nVariabile“ could return false.
In the .NET Framework there is a datatype "decimal“ with high precision, where these sort of errors does not occur anymore. Unique problem: it is slower.

Very good notice: in the X# runtime the „decimal“is supported

Very good notice: in the X# runtime the "decimal“is supported

The performance of VO e X# is very different to compare.

The performance of VO vs. X# is very difficult to compare.

•Interal all arrays are typed
•Macros are slower in compilation, but faster in execution because is like written code
•Garbage collector enhanced, stable and fast, in AnyCPU all the memory can be used,

•Internal all arrays are typed
•Macros are slower in compilation, but faster in execution because it is similar to written code
•Garbage collector enhanced, stable and fast, in AnyCPU all memory can be used,

______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #3

  • wriedmann
  • wriedmann's Avatar Topic Author
  • Away
  • Posts: 1436
  • Karma: 6
Hi Johan,

thank you very much for your work!

I will add these corrections as fast as possible and then upload the changed document.

It is very hard to translate! Sometimes it takes more time for me to translate an Italian document to German as rewrite it completely in German... An most of the time the German is very far from being perfect.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #4

Hi Wolfgang,

wriedmann wrote: Hi Johan,
thank you very much for your work!
I will add these corrections as fast as possible and then upload the changed document.
It is very hard to translate! Sometimes it takes more time for me to translate an Italian document to German as rewrite it completely in German... An most of the time the German is very far from being perfect.

You welcome. Just be careful, I might not always be correct. I always tell the story:
At school in the Free State province where I grew up, only 2 languages are spoken, Afrikaans and Afrikaans.

I had this horrible subject called English at school.  I could not understand why I would not pass my grades if I fail it.  Afrikaans I could understand, because it is the language we communicate in...

Needless to say I then went to the University of Stellenbosch in the Western Cape province (close to Cape Town) and with a shock I realized English is actually a language spoken by other people... :lol:

Anyway have fun!

Regards,
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #5

Wolfgang,

Great overview. Thanks for that. I might 'steal' some topics from that for the help file if you don't mind.

One correction, in addition to the comments from Johan:
Prefixes for numbers are actually Suffixes,
so:
10m = Decimal 10
10d = Double 10
10s = Single 10
10b = binary 2

One additional remark:
In the X# runtime you can also store a Decimal value in a USUAL. The usualtype will be DECIMAL (27).

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #6

  • wriedmann
  • wriedmann's Avatar Topic Author
  • Away
  • Posts: 1436
  • Karma: 6
Hi Johan,

thank you very much! I have corrected the document and uploaded it again.

I hope I have corrected all my errors.

For such corrections sometimes we would need Phil as native English speaker.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #7

  • wriedmann
  • wriedmann's Avatar Topic Author
  • Away
  • Posts: 1436
  • Karma: 6
Hi Robert,

of course you can take what you like.

And thank your for your suggestions - I have added them to the document.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #8

Hi Wolfgang,

wriedmann wrote: Hi Johan,
thank you very much! I have corrected the document and uploaded it again.

You are welcome, was a pleasure.

For such corrections sometimes we would need Phil as native English speaker.

I have to second that. By the way where is Uncle Phil, he is very quiet... Started to worry I scared him away. Afraid I will bash his Entity Framework promotions... :lol::lol::lol::lol:
Regard,
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #9

  • wriedmann
  • wriedmann's Avatar Topic Author
  • Away
  • Posts: 1436
  • Karma: 6
Hi Johan,

in the summer even in Wales the weather is good, and so Phil passes his time not at his computer.

I think he will re-show up when the winter comes <g>.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #10

Hi Wolfgang,

wriedmann wrote: in the summer even in Wales the weather is good, and so Phil passes his time not at his computer.
I think he will re-show up when the winter comes <g>.

So you mean he does not hibernate in winter, he X# in winter? :lol:
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #11

Wolfgang,
and the good thing is, we all know

Winter is coming...

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #12

I concur, that's very nice Wolfgang!

Just one further minor correction, there's no problem actually representing 123456789 or any other integer number (or decimal with zero decimal part) with the float/single/real datatypes,

The problem appears when you need to store the decimal part of a number in such a datatype, for example 0.123456789 or 12345.6789 or 12345678.9 indeed cannot be represented correctly in numeric data types other than System.Decimal.
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #13

  • wriedmann
  • wriedmann's Avatar Topic Author
  • Away
  • Posts: 1436
  • Karma: 6
Hi Chris,

thank you very much for your correction! I have added them to the document and uploaded the changed version-

If someone thinks I have not covered something please let me know!

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #14

Hello Wolfgang,

Amazing how much time you spend in producing useful X# info. I forwarded the document + link (as it will be updated from there I suppose) to my employees.

Thanks!

What I found a bit alarming is that you conclude that X# is actually slower. I am aware of the "start gap" present in all .Net programs but I thought that most code would run faster.



Dick

Please Log in or Create an account to join the conversation.

Last edit: by ic2.

Session material: Differences between VO and X# 8 months 3 weeks ago #15

  • wriedmann
  • wriedmann's Avatar Topic Author
  • Away
  • Posts: 1436
  • Karma: 6
Hi Dick,

What I found a bit alarming is that you conclude that X# is actually slower. I am aware of the "start gap" present in all .Net programs but I thought that most code would run faster.


Where do you found this information? In the page where the decimal datatype is discussed?

Microsoft itself states that decimal is slow, but I have newer compared float with decimal myself.

When it comes to large arrays, X# is ways faster than VO.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #16

wriedmann wrote: Hi Dick,

Where do you found this information? In the page where the decimal datatype is discussed?
When it comes to large arrays, X# is ways faster than VO.


On page 14. There it says:

"X# has been developed with performance in mind. But code executed in the .NET runtime
is slower than native code like VO. "

So that seems the opposite of what you write above?

Dick

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #17

  • wriedmann
  • wriedmann's Avatar Topic Author
  • Away
  • Posts: 1436
  • Karma: 6
Hi Dick,

VO is native machine code, so in pure processing it should be faster than code executed in the under the .NET runtime.
But the better memory managment and optimized datatypes should make this gap smaller or even make a X# application faster.
From tests from other people I know that Vulcan was effectively slower than VO.

But I will make some tests to see a difference, and let you know.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #18

I remember Sabo showing that Vo was only 10% slower than C. That's hard to beat for a way "upstream" language based on .net framework ;)
But again, i doubt in reality every day apps the pure crunching power to be of any notifiable impact.

Karl

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #19

  • wriedmann
  • wriedmann's Avatar Topic Author
  • Away
  • Posts: 1436
  • Karma: 6
I have done now a small test, using this code:
nReal1 := 0
nReal2 := 0
for nI := 1 upto nLen
  nReal2 := nReal1 + nReal2
next
for 1.000.000 of iterations.

These are the values for X# with the Vulcan runtime:
Duration for Int:00:00:00.0059964
Duration for Real8:00:00:00.0029983
Duration for Float:00:00:00.0089958
Duration for Decimal:00:00:00.0199881

These are the values for X# with the X# runtime:
Duration for Int:00:00:00.0069954
Duration for Real8:00:00:00.0029983
Duration for Float:00:00:00.0079989
Duration for Decimal:00:00:00.0199892

and these for VO 2.8 (no decimal available):
Duration for Int: 0,000100
Duration for Real8: 0,016100
Duration for Float: 0,062100

So the int is ways faster in VO, but Real8 and float are faster in .NET.
The float works better in the X# runtime, the int better in the Vulcan runtime.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it
Attachments:

Please Log in or Create an account to join the conversation.

Session material: Differences between VO and X# 8 months 3 weeks ago #20

Hi Dick,

ic2 wrote: On page 14. There it says:
"X# has been developed with performance in mind. But code executed in the .NET runtime
is slower than native code like VO. "
So that seems the opposite of what you write above?

You should read it carefully. All .net applications are slower than native applications, due to the JIT compiler.

If you create a .BAT file that executes a .net application say 1000 time, and compare it to executing the same application written in native mode, even a small "Hello World" application:
FUNCTION Start() AS VOID
  Console.WriteLine("Hello World")
RETURN

FOR i := 1 TO 1000
  RUN HelloWorld.NET.exe
NEXT

FOR i := 1 TO 1000
  RUN Application.NATIVE.exe
NEXT
In the above example, the native HelloWorld will be faster than the .net version due to the penalty of the JIT compiler. It needs to compile 1000 times.

However in the below example:
FUNCTION Start() AS VOID
  FOR i := 1 TO 1000
    Console.WriteLine("Hello World")
  NEXT
RETURN
RUN HelloWorld.NET.exe
RUN HelloWorld.NATIVE.exe
In this scenario, it should be a close call internally, since both are now actually "native". My bet is though that the .net version will outperform the native application due to better resource management/optimization.
Hope this clarify the "slower" .net statement.
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2