Recent

Author Topic: Golang vs free pascal  (Read 1445 times)

Packs

  • Sr. Member
  • ****
  • Posts: 346
Golang vs free pascal
« on: September 15, 2024, 09:38:48 am »
I am working on golang from 3 years. I have started working on Lazarus

It is solving all problems and it is fast too

Then why golang is having more weightage in market

MarkMLl

  • Hero Member
  • *****
  • Posts: 7904
Re: Golang vs free pascal
« Reply #1 on: September 15, 2024, 09:44:29 am »
Well, if you're the one with the experience, perhaps you could tell us :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

vfclists

  • Hero Member
  • *****
  • Posts: 1146
    • HowTos Considered Harmful?
Re: Golang vs free pascal
« Reply #2 on: September 15, 2024, 09:47:04 am »
I am working on golang from 3 years. I have started working on Lazarus

It is solving all problems and it is fast too

Then why golang is having more weightage in market

Because Borland sold out to Microsoft ages ago and Golang has Google's backing.

It also has garbage collection.

Is your success with Lazarus due to the nature of FreePascal itself or is it due to the libraries and components that come with it?
« Last Edit: September 15, 2024, 03:42:40 pm by vfclists »
Lazarus 3.0/FPC 3.2.2

Laksen

  • Hero Member
  • *****
  • Posts: 781
    • J-Software
Re: Golang vs free pascal
« Reply #3 on: September 15, 2024, 10:39:24 am »
Go is Oberon with curly brackets. How could it not be successful?

VisualLab

  • Hero Member
  • *****
  • Posts: 526
Re: Golang vs free pascal
« Reply #4 on: September 15, 2024, 03:02:52 pm »
Considering the possibilities that Google has (especially financial and the technological impact it has on the masses), this "success" of the Go language is rather modest. Especially when compared to the popularity of Java or C#. Both Sun (Java) and Microsoft (C#) have pumped huge amounts of money into the development and campaigns (not always fair) popularizing their technologies (because these are not just programming languages). Meanwhile, the "tops" at Google (for many years) have been in a strange position: they supposedly support and support the development of their languages (Go, Dart), but only half-heartedly. Moreover, it is quite symptomatic that many projects in this company gradually disappear after some time (and many of them are already in the "technological landfill"). On the other hand, I (for myself) do not see any advantages of Go. If I were to be forced to change the language, I would most likely choose C# (and as a last resort C++). But of course it's good that there are alternatives, after all, for the average person, technological monocultures usually result in high production costs and little diversity of end products (this cost is reduced somewhat by open source, which corporations are quite eager to use).

Warfley

  • Hero Member
  • *****
  • Posts: 1690
Re: Golang vs free pascal
« Reply #5 on: September 15, 2024, 03:11:11 pm »
Go and Pascal are very different languages with different Designs and history. I don't think you can easily compare them. E.g. if you need to do asynchronous and parallel stuff, Pascal is just terrible, in that it only provides the very fundamental building blocks. Asynchronicity is not built into the language at all, you get a TThread class and a critical section implementation and thats it.
Also of course it's all heavy weight system level threads so building a scalable webserver for example requires a lot of additional work.

Go is designed from the ground up as a parallel language, so while in Pascal you have to deal with all that fuzz, race conditions, deadlocks, message queues, etc. and run in one near impossible to debug error after another, in go its so much easier.

Go is also generally a simpler language in that it was designed with a very concise feature set, and has stayed that way so far. Pascal on the other hand has grown over decades and is now a monster with so many features, that you often see people here who are using the language for years, ask basic questions about features they just haven't encountered before.
E.g. how do you implement your data types, Classes, Objects or Advanced Records? All of them have their benefits and drawbacks. Go just has one concept. Or interfaces, do you use COM or CORBA? Go just has one.

So I find it hard to compare the languages directly, like if you want to do a specific thing then you can quite easily say which is better suited than the other, but general comparisons fall flat because these languages are just very different

Especially when compared to the popularity of Java or C#. Both Sun (Java) and Microsoft (C#) have pumped huge amounts of money into the development and campaigns (not always fair) popularizing their technologies (because these are not just programming languages). Meanwhile, the "tops" at Google (for many years) have been in a strange position: they supposedly support and support the development of their languages (Go, Dart), but only half-heartedly.

I mean it's quite simple, the goal of MS and Oracle is to bind as many developers to their systems. MS makes their money of developers with Azure, all the tools they provide for developers neatly integrate into Azure. Meaning they want to have as many developers use their tools as possible, to have the barrier of entry to Azure as small as possible.

Google doesn't care if anyone uses their tools. Google has a "not invented here" aversion, meaning they only use in-house tools. Like they don't use MS Office, they developed Google Docs for it. They don't use git, they have their own internal tooling for this.
Similarly, Go was initially developed to get Google developers of C, the idea was to make a language thats easier to learn and harder to make mistakes in than C. It's by Google for Google. They still make it open to everyone, but they don't really care if 100 or 1 million people use their language. All they care is that they themselves can use it for whatever they wanna do.
« Last Edit: September 15, 2024, 03:16:20 pm by Warfley »

PierceNg

  • Sr. Member
  • ****
  • Posts: 393
    • SamadhiWeb
Re: Golang vs free pascal
« Reply #6 on: September 16, 2024, 07:19:44 am »
Target audience differs. With Pascal, more people write desktop GUIs than network services. With Go, more people write network services than desktop GUIs.

Packs

  • Sr. Member
  • ****
  • Posts: 346
Re: Golang vs free pascal
« Reply #7 on: September 16, 2024, 07:34:34 am »
Yes I agree.

Golang is used for rest api.

I have tried all rest api functionality in Lazarus too.

Speed wise , development wise it is perfect

heejit

  • Full Member
  • ***
  • Posts: 247
Re: Golang vs free pascal
« Reply #8 on: September 16, 2024, 08:03:03 am »
Ecosystem are important

If you want to do something in golang you will find lot of information about it but for Lazaurs/FPC it is not easy to find.

Desktop application Lazarus/FPC  is best supported and cross-platform also.

So both language are good use best fit for the problem in hand.

gidesa

  • Full Member
  • ***
  • Posts: 131
Re: Golang vs free pascal
« Reply #9 on: September 16, 2024, 01:07:51 pm »
Go and Pascal are very different languages with different Designs and history. I don't think you can easily compare them. E.g. if you need to do asynchronous and parallel stuff, Pascal is just terrible, in that it only provides the very fundamental building blocks. Asynchronicity is not built into the language at all, you get a TThread class and a critical section implementation and thats it.
Also of course it's all heavy weight system level threads so building a scalable webserver for example requires a lot of additional work.

Go is designed from the ground up as a parallel language, so while in Pascal you have to deal with all that fuzz, race conditions, deadlocks, message queues, etc. and run in one near impossible to debug error after another, in go its so much easier.

Go is also generally a simpler language in that it was designed with a very concise feature set, and has stayed that way so far. Pascal on the other hand has grown over decades and is now a monster with so many features, that you often see people here who are using the language for years, ask basic questions about features they just haven't encountered before.

Yes, it's matter of simplicity. Some things are easy to do in Go, others in Pascal.
Indeed every language initially is designed  to do a limited set of things. Then often it's charged of many extensions, until it becames bloated.



LV

  • Full Member
  • ***
  • Posts: 140
Re: Golang vs free pascal
« Reply #10 on: September 17, 2024, 10:16:55 am »
Yeah, some programming languages have been "sharpened" to solve specific types of problems. Like, Golang has parallelism built into the language, as does modern Fortran (I think it started in the 90s or 95), Rust, and Julia, for example. I was looking at what Free Pascal can do recently, including this forum post: https://forum.lazarus.freepascal.org/index.php/topic,40888.0.html.

For training, I made a 2D modeling app using multithreading (for Euler equations). My personal experience: 1. Developing the GUI in Lazarus was so much fun! 2. Writing multithreading code (using only the TThread and TEvent classes) was a bit of a challenge. I had to stop for a coffee or two. But it worked out in the end, and I'm happy with the performance of my app.

gidesa

  • Full Member
  • ***
  • Posts: 131
Re: Golang vs free pascal
« Reply #11 on: September 17, 2024, 06:13:24 pm »
My personal experience: 1. Developing the GUI in Lazarus was so much fun! 2. Writing multithreading code (using only the TThread and TEvent classes) was a bit of a challenge. I had to stop for a coffee or two. But it worked out in the end, and I'm happy with the performance of my app.

A subtle note: TThread is in  FPC Classes unit, that you have to explicitly add. So FPC (and Delphi) has no "native" way of parallelism.
Thinking of "native" as all functions/classes contained in System unit, that is always implicitly linked to program. That is, all you have without
additional units (of course there are many external units/libraries that simplify working with parallelism in FPC).
I don't know if in Go the parallelism mechanism is always included, or only with explicit declaration.



MarkMLl

  • Hero Member
  • *****
  • Posts: 7904
Re: Golang vs free pascal
« Reply #12 on: September 17, 2024, 06:39:00 pm »
A subtle note: TThread is in  FPC Classes unit, that you have to explicitly add. So FPC (and Delphi) has no "native" way of parallelism.
Thinking of "native" as all functions/classes contained in System unit, that is always implicitly linked to program. That is, all you have without
additional units (of course there are many external units/libraries that simplify working with parallelism in FPC).
I don't know if in Go the parallelism mechanism is always included, or only with explicit declaration.

I'd suggest that more to the point: as LV says, FORTRAN (in particular) added constructs at the language (not library) level to express parallelisation.

Even for problems which do have well-studied parallel solutions (matrix inversion, FE/TLM modelling etc.) Pascal ** has no way of expressing "farm this work out across multiple CPUs, prepare it for a vector processor or pump it into a systolic array" as available. Yes you /can/ do it using a thread pool or by calls to functions controlling CUDA, but that means getting involved with synchronisation and data isolation explicitly: there's nothing in the language per se to help.

And because the language is not extensible, you can't simply add begin_parallel with a rendezvous at the corresponding end by importing a library.

** With the exception of Vector Pascal which tried to match APL in terms of provided functionality.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

gidesa

  • Full Member
  • ***
  • Posts: 131
Re: Golang vs free pascal
« Reply #13 on: September 17, 2024, 08:17:59 pm »

I'd suggest that more to the point: as LV says, FORTRAN (in particular) added constructs at the language (not library) level to express parallelisation.

Even for problems which do have well-studied parallel solutions (matrix inversion, FE/TLM modelling etc.) Pascal ** has no way of expressing "farm this work out across multiple CPUs, prepare it for a vector processor or pump it into a systolic array" as available. Yes you /can/ do it using a thread pool or by calls to functions controlling CUDA, but that means getting involved with synchronisation and data isolation explicitly: there's nothing in the language per se to help.

And because the language is not extensible, you can't simply add begin_parallel with a rendezvous at the corresponding end by importing a library.

** With the exception of Vector Pascal which tried to match APL in terms of provided functionality.
Yes, the de-facto modern standards, and much less the venerable Pascal ISO standard, have nothing on constructs for parallelism.
So, waiting for constructs ... 

MarkMLl

  • Hero Member
  • *****
  • Posts: 7904
Re: Golang vs free pascal
« Reply #14 on: September 17, 2024, 08:20:06 pm »
Yes, the de-facto modern standards, and much less the venerable Pascal ISO standard, have nothing on constructs for parallelism.
So, waiting for constructs ...

If you expect them in FPC... well, that's Waiting for Godot :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018