Giter Site home page Giter Site logo

Delphi Port about internettools HOT 17 OPEN

benibela avatar benibela commented on June 12, 2024
Delphi Port

from internettools.

Comments (17)

benibela avatar benibela commented on June 12, 2024

I plan to do that some time, but I do not have a recent Delphi version and at the moment I'm too busy (moving, starting my PHD, need to add xml schema and XQuery 3 ...).

And which Delphi version? I used to port all my projects to Delphi 4, but I use some new fpc features (like += instead of inc) which it does not have, so it will be quite annoying for such a big project.

I also thought about a kickstarter project, but it is probably not popular enough for that.

from internettools.

dodenko avatar dodenko commented on June 12, 2024

It can be Delphi 7 and I can convert it to XE4 :)

I can do it already however I need to know some of the equivalents FPC -> Delphi

Like Delphi doesn't have CompareByte, SwapEndian etc.

The only big thing to port is the bbutils.pas the rest will be easy.

from internettools.

benibela avatar benibela commented on June 12, 2024

It can be Delphi 7 and I can convert it to XE4 :)

I think it would be easier to port it to a newer version

Although I only have Linux, do not know if the newer versions run in WINE

Does Delphi have exit(value) as shortcut for result := value; exit; ?

Like Delphi doesn't have CompareByte, SwapEndian etc.

CompareByte compares the bytes of the pchars, i.e.

for i := 0 to l - 1 do begin
   if p1^ <> p2^ then 
      if p1^ < p2^ then exit(-1);` 
      else exit(1);
   inc(p1); inc(p2);
end;
result := 0;

SwapEndian is only used for my own UTF16LE <-> UTF16BE conversion, which is probably not needed for Delphi, because Delphi has its own string conversion functions.

The only big thing to port is the bbutils.pas the rest will be easy.

I though bbutils would be the easier part, because it just has many independent little functions

from internettools.

dodenko avatar dodenko commented on June 12, 2024

Yes XE4 has exit(true/false) or exit('not done); etc

No need for WINE .. VirtualBox + Delphi + Windowless

from internettools.

dodenko avatar dodenko commented on June 12, 2024

Can you convert the bbutils? I will convert the rest.. Also XE4 works on wine..

Make a another folder for Delphi here on github :)

from internettools.

benibela avatar benibela commented on June 12, 2024

Can you convert the bbutils?

Later.

Currently I'm writing a little arbitrary precision math library, because xs:decimal and xs:integer are supposed to be able to have an infinite value range and they do not have that yet in my implementation. (decimal maps to extended (especially bad because fpc has a lot of bugs in its floattostr function), and integer to a 65-bit integer)

Make a another folder for Delphi here on github :)

I usually prefer defines in the source.

from internettools.

dodenko avatar dodenko commented on June 12, 2024

How is the port coming along?

from internettools.

benibela avatar benibela commented on June 12, 2024

Oh, I did not start yet.

I was moving to another city for my PHD, had trouble finding an apartment and was almost homeless without internet access for the last 2 months..
And I stored all my stuff with my mother for that time, and she was supposed to bring it now, but she did bring my Delphi CD.(I explicitely asked for it, but she did not find it :( )

But the arbitrary precision math library is finished.

from internettools.

dodenko avatar dodenko commented on June 12, 2024

I hope you port it ! It is a fantastic library ! GOLDEN !

from internettools.

benibela avatar benibela commented on June 12, 2024

I have changed the bbutils to compile and run with Delphi 4.

Porting the other stuff might be more complicated (advanced records and overloaded operators definitely do not work with Delphi 4)

from internettools.

lovethisgame avatar lovethisgame commented on June 12, 2024

cannot compile under delphi berlin.
How can i port it to delphi berlin?
Sometimes I got the error "[dcc32 Error] bbutils.pas(726): [dcc32 Error] bbutils.pas(2437): E2251 Ambiguous overloaded call to 'StrLComp'".
Thank you.

from internettools.

benibela avatar benibela commented on June 12, 2024

A while ago I tried it on Delphi 4 again. Check out eff65eb

from internettools.

SergeyPyankov avatar SergeyPyankov commented on June 12, 2024

I wrote an article in Russian that describes how to use InternetTools in Delphi without porting.

from internettools.

Bi0T1N avatar Bi0T1N commented on June 12, 2024

For successful compiling of internettools in Delphi, in a first step all += need to be replaced by inc() as Delphi does not support += at all. Using exit() with a parameter is supported since Delphi 2009.
Due to the new free Delphi Community Edition it would make most sense to port it to this version first (it's even the newest). Maybe it's enough/easier to port the parsers/interpreters only.

from internettools.

benibela avatar benibela commented on June 12, 2024

It might have become even less Delphi compatible now that I use more newer fpc features. Or old ones, object has turned out to be much nicer than record or class.

Due to the new free Delphi Community Edition it would make most sense to port it to this version first (it's even the newest)

Let's see if there still is a Community Edition in a few years.

Maybe it's enough/easier to port the parsers/interpreters only.

The interpreter depends on everything else. It is the final piece that puts it all together. The parsers are so old now, they probably are more in need of a rewrite than a port

@SergeyPyankov : Cool, I never thought of using interfaces that way.

from internettools.

ange007 avatar ange007 commented on June 12, 2024

Are there any plans for the automatic generation of DLL from the article in Russian - when updating the library?

For Delphi, there is still no normal library for parsing :(

from internettools.

benibela avatar benibela commented on June 12, 2024

Are there any plans for the automatic generation of DLL from the article in Russian - when updating the library?

Not really

There are some issues:

  • A COM interface is very Windows centric. A DLL with a pure procedural wrapper would be better, since it could be used on any platform and with any language.

  • Creating a new COM interface wrapper is pointless. Almost all my data structures already implement an interface (to get automated reference counting). That probably could be exported directly to Delphi by adding a GUID to the interface declaration, although some functions need types that are not exportable that way. (however, I would like to stop using interfaces internally, because they are unnecessarly slow)

  • I do not use Delphi anymore, so I cannot test it

Delph is not really popular anymore, so I am also thinking about converting everything to Kotlin or Rust

from internettools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.