#1 2020-11-11 02:46:18

wangming
Member
Registered: 2016-07-17
Posts: 24

The Trim in SysUtils conflicts with the Trim defined in SynCommons

Today I was pitted by the latest version of mORomt. The Trim in SysUtils conflicts with the Trim defined in SynCommons. How to solve it



[dcc32 Error] ServerMethod.pas(518): E2251 Ambiguous overloaded call to 'Trim'
  System.SysUtils.pas(7475): Related method: function Trim(const string): string;
  SynCommons.pas(34038): Related method: function Trim(const string): string;

Offline

#2 2020-11-11 09:35:07

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

Sorry to hear that.

I just deleted this last commit changes. Seems indeed confusing on existing project.
https://synopse.info/fossil/info/5d0ec71507

So for mORMot 1.18 we will keep it as it is.
For mORMot 2, we could:
1. Do the same as with mORMot 1.18 - i.e. a dedicated Trim() version + TrimU().
2. Only support TrimU() in mORMot 2, and rely on the RTL for existing code.
3. Only support TrimU() but leave the Trim() version of mORMot 1.18 if the PUREMORMOT2 conditional is not set.

I am in favor of number 3.
So I have implemented as such in https://github.com/synopse/mORMot2/comm … b7087c04fd
But your feedback is welcome.

Offline

#3 2020-11-12 02:37:12

wangming
Member
Registered: 2016-07-17
Posts: 24

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

I am a delphi developer from China, thank you for providing such a good framework for the delphi field. The Internet in China is developing rapidly, and the mainstream technology stacks are all WEB. Without this framework to provide comprehensive web services, delphi basically I’ve been left behind, and I’ve already switched to other technology stacks. Delphi’s market share in China is almost negligible. Few people use it. They are all using java.net go, etc. I still insist on one of the few, mainly I like to use it, nothing else. Thanks again

Offline

#4 2020-11-12 03:10:43

mdbs99
Member
From: Rio de Janeiro, Brazil
Registered: 2018-01-20
Posts: 139
Website

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

wangming wrote:

...Delphi’s market share in China is almost negligible. Few people use it. They are all using java.net go, etc...

Unfortunately, I believe this occur not only in China, but also around the world.
There are huge companies to promote Java, .NET, and Go. Combine their status with a multimillionaire marketing, you can get most programmers.... Even though such languages, tools, etc could be worse than others considered "dead" and not "fancy" as Object Pascal.

Offline

#5 2020-11-12 07:42:09

pvn0
Member
From: Slovenia
Registered: 2018-02-12
Posts: 211

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

ab wrote:

2. Only support TrimU() in mORMot 2, and rely on the RTL for existing code.
3. Only support TrimU() but leave the Trim() version of mORMot 1.18 if the PUREMORMOT2 conditional is not set.

I like this, only touch RTL functions if you can make them faster, for example SynCommons has MoveFast (instead of RTL System.Move) and I like how it's named.
Perhaps you could do the same for Trim.

mdbs99 wrote:

Unfortunately, I believe this occur not only in China, but also around the world.
There are huge companies to promote Java, .NET, and Go. Combine their status with a multimillionaire marketing, you can get most programmers.... Even though such languages, tools, etc could be worse than others considered "dead" and not "fancy" as Object Pascal.

Delphi has been obsolete for a while, if anyone can name one thing that gives delphi advantage over FPC I would love to hear it. Delphi is a paid product and they only added linux support a few years ago and even then it's based on LLVM compiler chain so minimum effort there (I guess you have to do that when you fire your entire compiler team). I only use Delphi because of a legacy product I have to support and I don't have time right now to rewrite for FPC. I think this is the same for the very small community still using Delphi.

Offline

#6 2020-11-12 10:21:52

mdbs99
Member
From: Rio de Janeiro, Brazil
Registered: 2018-01-20
Posts: 139
Website

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

pvn0 wrote:

Delphi has been obsolete for a while, if anyone can name one thing that gives delphi advantage over FPC I would love to hear it. Delphi is a paid product and they only added linux support a few years ago and even then it's based on LLVM compiler chain so minimum effort there (I guess you have to do that when you fire your entire compiler team). I only use Delphi because of a legacy product I have to support and I don't have time right now to rewrite for FPC. I think this is the same for the very small community still using Delphi.

I totally agree with you about Delphi, but I was talking about Object Pascal in general.
I use Delphi 7 because of a legacy product too. New projects I use FPC/Lazarus.

Offline

#7 2020-11-12 13:19:44

pvn0
Member
From: Slovenia
Registered: 2018-02-12
Posts: 211

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

My bad, didn't see you were talking on general about pascal, I do think FPC has very healthy population, even in @op china but yeah nowhere near java, Go , like you said. And I think part of Java success is the fact that it's always pushed in schools and universities.

Last edited by pvn0 (2020-11-12 13:21:59)

Offline

#8 2020-11-13 01:15:08

wangming
Member
Registered: 2016-07-17
Posts: 24

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

It turns out that this is also the case in other countries in the world. I thought that only in the Chinese market is not good. In fact, delphi is indeed a good programming language, simple and efficient, but with the passage of time, the lack of ecology is getting worse and worse. When you find the resources that you can’t find, you go to the .net ecosystem and then encapsulate calls to delphi to indirectly solve the problem of insufficient resources. In the delphi field, there is a lack of a full set of solution frameworks like spingcloud. Currently, Internet projects are popular. There are almost no solutions for large-scale projects. It can only be said that it is gradually out of touch with the development of the times. At present, pascal teaching is no longer visible in Chinese schools. It will directly lead to no one using it later. No one uses it. Basically, it is game. Over, I don’t know what the official thinks. It’s too expensive to buy, there are no newcomers to use, resources are charged at every turn, and the concept of open source is deeply rooted in the hearts of the people. In such a closed era, it is really not far from game over. Hope someone can give feedback to the official

Offline

#9 2020-11-13 01:17:35

wangming
Member
Registered: 2016-07-17
Posts: 24

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

There is a situation that I forgot to mention. In fact, most of our delphi developers basically use one or more of java.net go. They like it and they use it for work.

Offline

#10 2020-11-13 11:21:08

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

@wangming
What do you call "SpingCloud"?

Offline

#11 2020-11-13 12:32:31

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

ab wrote:

@wangming
What do you call "SpingCloud"?

I think this is Spring - a Java framework

Offline

#12 2020-11-13 12:40:16

mdbs99
Member
From: Rio de Janeiro, Brazil
Registered: 2018-01-20
Posts: 139
Website

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

There is Spring4D but I've never used and I don't think it is relevant, due we already have mORMot.

Offline

#13 2020-11-16 03:37:23

wangming
Member
Registered: 2016-07-17
Posts: 24

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

A framework in spring contains a comprehensive technology stack for microservices business, which is relatively comprehensive. In China, many large-scale projects basically use it. It is a household name in the Chinese technology circle.
URL: https://spring.io/projects/spring-cloud/

Offline

#14 2020-11-16 03:40:37

wangming
Member
Registered: 2016-07-17
Posts: 24

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

@Administrator You can take a look at this framework. What is the difference from mORmot? The positioning of the two frameworks is different.

Offline

#15 2020-11-16 09:10:45

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

SpringCloud is indeed interresting.

Currently, with mORMot 1.18 there are the basic bricks of daemons setup and administration - and they are used in production - but they need to be glued by some proprietary code.

With mORMot 2, we would like to offer something similar. We will integrate the daemons and their hosting, with a centralized administration tool. Including remote real-time logging, and remote database access - which are features not available in SpringCloud.

We will focus on MicroServices definition and hosting.
We will define services from a set of settings files, as part of the source code, to setup the daemon name/ports/persistence features.
Then hosting would be as simple as assigning daemons to hosts. Hosts will be first regular Windows and Debian/Ubuntu Linux instances (since we know them very much) but could later on be some Cloud providers (even if the fully-embedded nature of mORmot MicroServices doesn't make cloud services useful). A nginx front-end (with Let'sEncrypt TLS) would be automatically setup on each Linux host - or as stand-alone frontend to Windows hosts. Hosts will be monitored in real-time (processes, memory, network). Also executable updates will be done remotely.
Security will be offered using asymetric public/private keys, via mormot.core.ecc.pas.
We did not start to work on it yet. But it is something we will implement, since we need it for the future.

Offline

#16 2020-11-16 15:36:02

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

ab wrote:

SpringCloud is indeed interresting.

Currently, with mORMot 1.18 there are the basic bricks of daemons setup and administration - and they are used in production - but they need to be glued by some proprietary code.

With mORMot 2, we would like to offer something similar. We will integrate the daemons and their hosting, with a centralized administration tool. Including remote real-time logging, and remote database access - which are features not available in SpringCloud.

We will focus on MicroServices definition and hosting.
We will define services from a set of settings files, as part of the source code, to setup the daemon name/ports/persistence features.
Then hosting would be as simple as assigning daemons to hosts. Hosts will be first regular Windows and Debian/Ubuntu Linux instances (since we know them very much) but could later on be some Cloud providers (even if the fully-embedded nature of mORmot MicroServices doesn't make cloud services useful). A nginx front-end (with Let'sEncrypt TLS) would be automatically setup on each Linux host - or as stand-alone frontend to Windows hosts. Hosts will be monitored in real-time (processes, memory, network). Also executable updates will be done remotely.
Security will be offered using asymetric public/private keys, via mormot.core.ecc.pas.
We did not start to work on it yet. But it is something we will implement, since we need it for the future.

Sounds very cool!


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#17 2020-11-16 15:43:20

mdbs99
Member
From: Rio de Janeiro, Brazil
Registered: 2018-01-20
Posts: 139
Website

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

edwinsn wrote:

Sounds very cool!

+1

Offline

#18 2020-11-19 07:52:42

wangming
Member
Registered: 2016-07-17
Posts: 24

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

mORmot2 is very ambitious, the project catalog is relatively clear and reasonable, like it, I don’t know when it can be used in the production environment, wait for a try

Offline

#19 2020-11-19 09:10:00

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

It is not usable in production yet.
I hope to have finished the tests and fixed most bugs in the next weeks.

Offline

#20 2020-11-19 15:06:05

wangming
Member
Registered: 2016-07-17
Posts: 24

Re: The Trim in SysUtils conflicts with the Trim defined in SynCommons

Okay, keep going and look forward to the trial,very cool!

Offline

Board footer

Powered by FluxBB