Recent

Author Topic: A Newbie Post  (Read 4403 times)

MrPink

  • New Member
  • *
  • Posts: 15
A Newbie Post
« on: June 17, 2024, 12:39:09 pm »
Greetings,
Per the subject line, I’m a first-timer here -- though I’ve had longtime exposure to Turbo Pascal. In fact, I have reams of programs generated in an earlier life (1985-2014).

I’ve hopped around to different forum postings enough to learn that I’ll have a learning-curve for the Free Pascal model. So, please be patient with me in that regard. I’m quietly hoping there’s a go-to primer available to highlight the differences.....

Like many, my personal learning mode is seeing operational code and having it click in my brain. So, in my early-going I’ll be pursuing some copycat code examples. Open to suggestions, I also need to purchase a worthy FP textbook to support that learning mode. For the record, I’m a number cruncher; not so much into the text aspect (char strings, etc.).

In true newbie form, I need to dive into (explore) the forum and see what I can learn. In the meantime, I am glad to be here and hope I’ll be able to actually-contribute at some point in the future.
Thanks for having me,
MrPink

440bx

  • Hero Member
  • *****
  • Posts: 4735
Re: A Newbie Post
« Reply #1 on: June 17, 2024, 12:47:18 pm »
welcome to the forum MrPink.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8030
Re: A Newbie Post
« Reply #2 on: June 17, 2024, 12:50:24 pm »
Welcome to the community :-)

Particularly since you've already got Pascal experience, I think the really important thing is to familiarise yourself with the layout of the documentation which, for the "current" version of FPC, you'll find at https://www.freepascal.org/docs.html

You should find a high level of compatibility with TP etc. in appropriate modes.

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

Handoko

  • Hero Member
  • *****
  • Posts: 5376
  • My goal: build my own game engine using Lazarus
Re: A Newbie Post
« Reply #3 on: June 17, 2024, 01:06:35 pm »
Welcome MrPink.

We are now in 2024, computer graphics has improved a lot. Maybe you want to try Lazarus. You can build GUI and graphics programs much easier using Lazarus, and it can be used for generating text-based/console programs too.

If you interested to learn about Lazarus IDE click the link below and scroll down, there you can find many animated screenshots showing the IDE features of Lazarus:
https://wiki.freepascal.org/New_IDE_features_since

And in the link below, you can find plenty of short demos that you can download and try:
https://wiki.freepascal.org/Portal:HowTo_Demos

Also try this link, which cover various of topics:
https://wiki.freepascal.org/Lazarus_Documentation
« Last Edit: June 18, 2024, 09:22:21 pm by Handoko »

MarkMLl

  • Hero Member
  • *****
  • Posts: 8030
Re: A Newbie Post
« Reply #4 on: June 17, 2024, 01:23:43 pm »
We are now in 2024, computer graphics has improved a lot. Maybe you want to try Lazarus. You can build GUI and graphics programs much easier using Lazarus, and it can be used for generating text-based/console programs too.

I'd like to apply a caution to that, for everybody's benefit.

OP has already said "For the record, I’m a number cruncher; not so much into the text aspect (char strings, etc.)." hence it's likely that he's even less into the GUI element.

However the thing worth emphasising is that even though Lazarus is (obviously) a GUI-based program, one can ignore the fact that it can be used to implement graphical programs and use it simply as an Integrated Development Environment (IDE) for text-based programs writing to the console or a file.

In effect, 1990s Codeview on steroids (with a nod to comparable software of that era, i.e. Logitech Multiscope and similar).

FPC does have its own text-based editor etc., but it gets far less TLC from the community than does Lazarus. It's also possible to use other comprehensive editors (akin to Emacs, or MultiEdit back in the day), in fact I believe that Thaddy mentioned Geany recently. However I would suggest that there are massive advantages to using something preconfigured rather than spending ages fighting ones tools: the subcommunity that is happy to discuss the overlap between (e.g.) Emacs and Pascal is vanishingly small.

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

MrPink

  • New Member
  • *
  • Posts: 15
Re: A Newbie Post
« Reply #5 on: June 18, 2024, 08:59:18 pm »
I much appreciate these welcoming posts -- in the grand effort to help me get off to a good start. The short-demo link provided was intriguing, but clicking same threw me into an unrelated forum message to check my original post for added posts (???). So, it was a no-go.

I’m thinking though, that a truly good/fresh start for me should incorporate the latest editor. That sounds like Lazarus, and its GUI attributes. I am accustomed to the old text-based editor that came with my recent FPC download, but my inner best-self says I should bust out of the old -- and embrace the newer landscape. The compelling part of that likely better-direction was the insightful comment that the old “gets far less TLC from the community than does Lazarus.”

Okay then. In classic newbie mode, I think that maybe I’m looking for a comprehensive standard download; if it exists. If appropriate, can you direct me to a combo where I’d get both Lazarus and the FP compiler? Once in hand, I’m generally thinking I would then be “forced to learn” all that I need to.

A leg-up in my case -- would be old-dog familiarity with the code (TP). From there I’d just be (occasionally) pestering you kind folks for additional direction.....
Thanks,
MrPink

MarkMLl

  • Hero Member
  • *****
  • Posts: 8030
Re: A Newbie Post
« Reply #6 on: June 18, 2024, 09:16:40 pm »
I’m thinking though, that a truly good/fresh start for me should incorporate the latest editor. That sounds like Lazarus, and its GUI attributes. I am accustomed to the old text-based editor that came with my recent FPC download, but my inner best-self says I should bust out of the old -- and embrace the newer landscape. The compelling part of that likely better-direction was the insightful comment that the old “gets far less TLC from the community than does Lazarus.”

Comment there: GUI programs aren't particularly good at accommodating "green screen" output, so think about what you actually need to do before deciding on a UI.

Quote
Okay then. In classic newbie mode, I think that maybe I’m looking for a comprehensive standard download; if it exists. If appropriate, can you direct me to a combo where I’d get both Lazarus and the FP compiler? Once in hand, I’m generally thinking I would then be “forced to learn” all that I need to.

Depends on your OS of choice. Not so much because of the tools themselves which you can get from https://www.lazarus-ide.org/index.php?page=downloads (or https://www.freepascal.org/download.html if you only want FPC itself) but because of potential prerequisites.

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

Handoko

  • Hero Member
  • *****
  • Posts: 5376
  • My goal: build my own game engine using Lazarus
Re: A Newbie Post
« Reply #7 on: June 18, 2024, 09:23:54 pm »
The short-demo link provided was intriguing, but clicking same threw me into an unrelated forum message to check my original post for added posts (???). So, it was a no-go.

Sorry, my mistake. This is the correct link:
https://wiki.freepascal.org/Portal:HowTo_Demos

cdbc

  • Hero Member
  • *****
  • Posts: 1656
    • http://www.cdbc.dk
Re: A Newbie Post
« Reply #8 on: June 18, 2024, 09:56:28 pm »
Hi
Quote
If appropriate, can you direct me to a combo where I’d get both Lazarus and the FP compiler?
Yes, there's a tool called 'FpcUpDeluxe' on github https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases That lets you do just that  8)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

dseligo

  • Hero Member
  • *****
  • Posts: 1410
Re: A Newbie Post
« Reply #9 on: June 18, 2024, 10:33:48 pm »
Hi
Quote
If appropriate, can you direct me to a combo where I’d get both Lazarus and the FP compiler?
Yes, there's a tool called 'FpcUpDeluxe' on github https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases That lets you do just that  8)
Regards Benny

Or, (if you are on Windows) you can just press "Download Now" on main Lazarus page (https://www.lazarus-ide.org/). Lazarus installation has Free Pascal compiler already included.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8030
Re: A Newbie Post
« Reply #10 on: June 18, 2024, 10:42:05 pm »
Or, (if you are on Windows) you can just press "Download Now" on main Lazarus page (https://www.lazarus-ide.org/). Lazarus installation has Free Pascal compiler already included.

The thing that concerns me is that if he's not on Windows but is instead a Linux user (in which case I'd hazard either Arch or Debian/Ubuntu) it's necessary to download a couple of prerequisite library packages before FPC/Lazarus- even from fpcupdlx- will run reliably.

Unashamed numbercrunchers are a rare breed, and I'm reminded of a friend of a former associate who (when I last heard) was methodically working through historical scientific calculations to ensure that they were actually correct. I don't know the gritty details, but I've a vague recollection that a whole lot of things that had been computed using Monte Carlo were tainted by a poor (FORTRAN?) random number generator.

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

TRon

  • Hero Member
  • *****
  • Posts: 3623
Re: A Newbie Post
« Reply #11 on: June 19, 2024, 12:43:30 am »
fwiw: there is nothing wrong with keep/still using the old terminal IDE or whatever editor floats your boat in case you do not wish to get distracted by all the graphical violence. I myself prefer it over using the Lazarus IDE (but that is because I get easily distracted by all bells and whistles).
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

Thaddy

  • Hero Member
  • *****
  • Posts: 16183
  • Censorship about opinions does not belong here.
Re: A Newbie Post
« Reply #12 on: June 19, 2024, 06:17:04 am »
but I've a vague recollection that a whole lot of things that had been computed using Monte Carlo were tainted by a poor (FORTRAN?) random number generator.
That is correct. Not only FORTRAN, but also TP and originally C had/have very simple LCG's that - on larger amounts of data can have a very noticable bias. I believe that was one of the reasons the FPC developers chose a Mersenne twister (and now xorshiro++) instead of a Delphi compatible one, because of better properties.
To use such old data collections you need to know how to interpret the prng that is used to interpret them as the collector saw them.
One of the reasons I wrote a Delphi compatible LCG and a FPC mersenne twister that can be used in both Delphi and Lazarus. The mersenne twister is now a life saver because the core developers assume the prng to be "implementation detail" which of course it isn't. Both prng's are in the wiki as well as a gaussian one that is not written by me but is actually more appropiate for monte carlo simulations. E.g. in social sciences gaussian is better because of the central limit theorem.

many people know I absolutely love prng's.
« Last Edit: June 19, 2024, 09:49:32 am by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

egsuh

  • Hero Member
  • *****
  • Posts: 1490
Re: A Newbie Post
« Reply #13 on: June 19, 2024, 06:32:33 am »
Once installed Lazarus, Simply create a new project, drop a button on form, and then write code that sums from 1 to 100 and showing it. All the comments here are really valuable, but first you need some time to get familiar with Lazarus, before thinking anything (based on my first encounter with Delphi from my Turbo Pascal experiences  :D).

You can use Delphi books at first, as Lazarus is simulating Delphi.

https://www.learndelphi.org/wp-content/uploads/2020/03/DelphiProgrammingForBeginners_ENG-CreativeCommons-LearnDelphi.org_.pdf


Thaddy

  • Hero Member
  • *****
  • Posts: 16183
  • Censorship about opinions does not belong here.
Re: A Newbie Post
« Reply #14 on: June 19, 2024, 06:38:47 am »
@MrPink

On the original subject: any book on Delphi will help, even second hand ones.
For number crunchers I'd recommend The Tomes of Delphi, algorithms and data structures.
It is still available as an e-book or in print from kindle.
Firmly founded in theory and with 100% Freepascal compatible code.
This book is less suited for UI design. You may want to have a look at one of the books by Marco Cantu for that.(not one of the books that refer anywhere to fmx)

Have fun,

Thaddy
« Last Edit: June 19, 2024, 10:04:56 am by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018