Recent

Author Topic: Google Protocol buffers?  (Read 8990 times)

BlueIcaro

  • Hero Member
  • *****
  • Posts: 834
    • Blog personal
Google Protocol buffers?
« on: June 02, 2015, 08:37:11 am »
Hello, is there any library or some code to use Google Protocol buffers in freepascal/lazarus?.

Thanks in advance

/Blueicaro

Fabio Souza

  • New Member
  • *
  • Posts: 12
Re: Google Protocol buffers?
« Reply #1 on: June 03, 2015, 04:28:36 pm »
There are new components that use Google's api. Take a look at http://svn.freepascal.org/svn/lazarus/trunk/components/googleapis/


BlueIcaro

  • Hero Member
  • *****
  • Posts: 834
    • Blog personal
Re: Google Protocol buffers?
« Reply #2 on: June 03, 2015, 06:48:53 pm »
Thanks for our answer, but the google components that you point in, is for Google REST API, no for google protocol buffer.

/BlueIcaro

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Google Protocol buffers?
« Reply #3 on: June 03, 2015, 06:55:07 pm »
Thanks for our answer, but the google components that you point in, is for Google REST API, no for google protocol buffer.

/BlueIcaro
http://sourceforge.net/projects/protobuf-delphi/
http://fundementals.sourceforge.net/dl.html

two links in pascal not lazarus per see but a start for you.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

z505

  • New Member
  • *
  • Posts: 38
  • think first, code after
Re: Google Protocol buffers?
« Reply #4 on: May 09, 2017, 08:41:05 pm »
http://sourceforge.net/projects/protobuf-delphi/
http://fundementals.sourceforge.net/dl.html

two links in pascal not lazarus per see but a start for you.

Combine google protocol buffers with SimpleIPC, and you have a standard ipc mechanism instead of everyone rolling their own ipc system a million times...

Put simpleipc in a flat DLL with plain pascal/C functions, and google protocol buffer api wrapper, and now you have a standard IPC DLL anyone can put into their application, similar to a sqlite dll for lite sql use, now there can be "liteIPC" with maybe a second larger optional alternative DLL that uses AdvancedIPC and offers more features

This will be my todo project next coming days, then make website for it, like ZeroMQ

Standard apology for being thread necromancer
« Last Edit: May 09, 2017, 08:45:42 pm by z505 »
think first, code after

piola

  • Full Member
  • ***
  • Posts: 157
  • Lazarus 2.2, 64bit on Windows 8.1 x64
Re: Google Protocol buffers?
« Reply #5 on: April 12, 2023, 03:56:56 am »
This will be my todo project next coming days, then make website for it, like ZeroMQ

Could you publish/link the result, please?

rossh_lz

  • New Member
  • *
  • Posts: 36
Re: Google Protocol buffers?
« Reply #6 on: December 22, 2025, 09:50:34 am »
Adding another build for Protocol Buffer on Delphi and FPC

https://github.com/HHS-Software/Protocol-Buffer_Delphi_FPC


Thaddy

  • Hero Member
  • *****
  • Posts: 19158
  • Glad to be alive.
Re: Google Protocol buffers?
« Reply #7 on: December 22, 2025, 05:35:03 pm »
The google libs include an example on how to extract any of googles protocols. Why relying on the components? You can generate the newer API's yourself from that example code.

Don't expect, draw drop, paint screen: be a human: program, not screen draw.
objects are fine constructs. You can even initialize them with constructors.

rossh_lz

  • New Member
  • *
  • Posts: 36
Re: Google Protocol buffers?
« Reply #8 on: December 25, 2025, 08:52:49 pm »
Why you ask?  One word: OOP.   

There is one main component with the read write code, which is the main part of PB.  Then every message has to have its own memory (a record or a class), and needs to uniquely get its data onto and off the wire.  With OOP, we have one generic read write, that any sub class inherits from and uses that generic read / write.    Furthermore, there is a lot of nested messages in nested messages in messages in PB, and often in different mixed up combinations.  This lends itself to classes and inheritance.
Doing this approach, we have two files total, and that is for hundreds of proto messages.  :-)

You don't like classes?  A class is just a record with a handful of functions and some tables of pointers attached, and automated memory allocations.  Not really that terrible.

If instead the messages were all stand alone records, then each message record needs its own read write code.  I started out this way, but it became an unmanageable mess when hundreds of .proto files are involved.

Speaking of messes.   The Google C++ supplied code requires / has hundreds of files compiled into the project, and this is a fine example of coding by committee.   It adds MB's to the project.   This is fine when server A talks to server B, but not for user applications.  No, we will not be using the Google system as an example, thank you.
« Last Edit: December 26, 2025, 04:35:25 am by rossh_lz »

 

TinyPortal © 2005-2018