Hello. Free Pascal.

trekiej · 4009

trekiej

  • Member
  • ***
    • Posts: 190
    • Karma: +5/-0
on: December 13, 2018, 09:16:05 PM
How is it going?
Is Pascal for Aros and Amiga doing good?
How can I say it?
Is it full featured and compatible with Aros and Amiga?



magorium

  • Moderator
  • Legendary Member
  • *****
    • Posts: 566
    • Karma: +55/-0
  • Convicted non contributor
Reply #1 on: December 23, 2018, 06:05:22 AM
hello trekiej,

Quote
Is Pascal for Aros and Amiga doing good?
It is doing ok. As long as you do not rely on platform specifcs your code should be able to compile for both Aros and Amiga (as well as for AmigaOS4 and MorphOS)

Quote
How can I say it?
I have no idea... but in case you have no clue either then perhaps you can try singing ? :-)

Quote
Is it full featured and compatible with Aros and Amiga?
I am not sure what you meant by full featured. The (free Pascal) language itself is full featured and expanding as we speak.

As written above, it is compatible with Aros and Amiga as long as you do not use platform specifics. Meaning that f.e. if you code for Paula or blitter on your classic machine that you can't expect such code to compile for your Icaros Desktop.

Other then that we are currently awaiting the new 3.2 release of the Free Pascal compiler, and which will include many fixes for API call incompatibilities between Amiga, AmigaOS4, AROS and MorphOS. Of course that release will add all newly introduced language and/or compiler changes as well (for those changes see http://wiki.freepascal.org/FPC_New_Features_Trunk).

If you believe something is missing then feel free to complain. We add things that we use ourselves and as we go along. There simply is no point in adding f.i. headers for every library out there if we do not make use of it.


trekiej

  • Member
  • ***
    • Posts: 190
    • Karma: +5/-0
Reply #2 on: December 24, 2018, 02:15:21 AM
Now that I think about it. "it" is pronounced Ih-tuh. I think.   :D

Is there any data that Pascal can not work with?
I have been thinking about making a program that could correct an image.

Thanks again, I hope to use this Pascal book I have that is about data-types.



magorium

  • Moderator
  • Legendary Member
  • *****
    • Posts: 566
    • Karma: +55/-0
  • Convicted non contributor
Reply #3 on: December 24, 2018, 11:34:08 PM
Now that I think about it. "it" is pronounced Ih-tuh. I think.   :D
LOL  ;D

Quote
Is there any data that Pascal can not work with?
Technically not. Or to put into other words: as long as you are able to process the data you can act on that data any which way you please. And yes FPC has all the constructs fior that to be able to do that. If you can program it in c (or any other programing language for that matter) then it can be programmed in Pascal.

Of course, it would be easier if the datatype you are processing is known and even better if there is an Pascal implementation available. Out of the box Free Pascal supoprts standard formats like png, gif, jpeg and plain old ms bitmaps amongst others.

You are also allowed to use the Amiga way of doing things and use datatype library to load your data and process the loaded data manually.

Quote
I have been thinking about making a program that could correct an image.
There are some libraries for Free Pscal available that already have graphic support in such a way that you f.e. can turn a colour bitmap into grey, filter colours, apply graphical effects etc. If you use a standard internal (by free pascal supported) format then it is also very easy to f.e. turn a png file into a jpeg file or vice verse.

Quote
Thanks again, I hope to use this Pascal book I have that is about data-types.
Do note that if your book is older then it probably is written with the old Turbo/Borland Pascal compiler in mind. That can be a bit tricky since there has been much improvements over that. There is a mode TP though (which should be fully compatible with old Turbo/Borland Pascal code).

In case your book is oriented towards Delphi then you should probably have a look at lazarus as well (as that is the Free Pascal equivalent of Delphi... with all its components and such).

But it is alo possible to do without lazarus as long as you are using Free Pascal only extentions (e.g. no LCL components). LCL is mostly geared towards visual component rendering (althoug there are also many non-visual components) and as such are mostly aimed at creating visible GUI's pats such as buttons and labels.

Also another note: i saw you writing about Amiga 1000. Be aware that at this time Free Pascal requires 68020 and i don't believe a stock a1000 has enough memory to get the compiler processing your code natively. Even if it did it would be terribly slow at compiling (disk speed on amiga is really sad), which is why we usually advise to use cross-compiling.when developing for classic Amiga (or use a overpowered configured winUAE box).

In case you need help then feel free to post some details. I can't promise i have time to be able to help out but i can at least give it a try.


trekiej

  • Member
  • ***
    • Posts: 190
    • Karma: +5/-0
Reply #4 on: December 24, 2018, 11:51:52 PM
Excellent reply, I do have other machines to use.
I am on Fedora 29 right now. My other machine is a Win X box that will probably become a Ubuntu 18.04 machine this or next  year.

Win X will be on my laptop.

Then there is my dual core machine that has a Phenom II X550 cpu. It has Ubuntu 15.04 with a lot of my extra files.
The last machine is my Aros machine. I need a Nvidia GPU to bring the OpenGL power back up. I also need another Ethernet card.
I do not see a driver for the built in Gigabit networking.

I really need to tackle the subject of Data Structures. I bet it will help me in my programming goals alot.



magorium

  • Moderator
  • Legendary Member
  • *****
    • Posts: 566
    • Karma: +55/-0
  • Convicted non contributor
Reply #5 on: December 25, 2018, 12:56:42 AM
The specs on the machines you mentioned should  be more then enough, especially if you eventually use a dedicated AROS box in order to compile and/or run your code .

Note that you can run AROS hosted on Linux, which gives a far better development experience since it allows you to use the Linux tools/editors that you are probably more familair with (as well as allows you to cross-compile). I have used a Windows box for a lot of (AROS/Amiga) development and use the host for things like version control, writing documentation, converting files, surfing etc.

Quote
I really need to tackle the subject of Data Structures. I bet it will help me in my programming goals alot.
For sure it can help. Especially if you are processing data that can easily be visualized such as images, html, or alike. That way it is fun as well as you are able to more or less directly show results (which sometimes also helps you better understand your own sanity and/or skills).

In fact, processing data is one of the things that usually let me fall back to using Free Pascal simply because it is so easy to process any kind of data (and at the same time let you understand the structure/storage format of the data) as you can encapsulate the data (and its processing) into records and/or classes.

As an exampe of such processing is the preference files that are used by Amiga/AROS system. The Amiga API has nice library functions for processing such files but i often found myself wanting to know more without firing up my Amiga box. A simple Pascal implementation is all it takes to be able to process such files on any other box (learning more about endianess in the process). Of course it is a bit moot since it is just as easy to fire up your Amiga emulator or hosted AROS, but now i know more about the internal format of the preference file format that is used by Amiga/AROS.

I did similar things for processing DMS, zip, lzx archives, as well as f.e. processing ISO files. Sometimes with a bit of help of already existing implementations and sometimes handling things from scratch. fwiw most already existing implementations often lack features or extensions you never knew existed before so you have to extend those existing implementations (or implement your own based on what is already available).


trekiej

  • Member
  • ***
    • Posts: 190
    • Karma: +5/-0
Reply #6 on: December 25, 2018, 03:47:02 AM
I will install Icaros 2.2.5 hosted to see how well I will like that.
I have a long way to go.
 



magorium

  • Moderator
  • Legendary Member
  • *****
    • Posts: 566
    • Karma: +55/-0
  • Convicted non contributor
Reply #7 on: December 25, 2018, 04:37:46 AM
Quote
I will install Icaros 2.2.5 hosted to see how well I will like that.
Please do, and don't be shy when you run into issues.

Paolo would love the feedback in case you encounter issues. Unfortunately i do not believe i can be of much help there because i haven't got the required hardware around atm to mimic your setup but i do have my experience with AROS hosted.

In case you wish to cross-compile with Free Pascal then be advised that it is not a very easy task to setup your binutils correctly (it requires you to apply some patches that are present in AROS source-tree and compile/configure those binutils manually). The Free Pascal (or Lazarus) configuration can be a bit daunting for those that are not familiar with it.

There should be no problem at all installing the compiler natively for AROS (Icaros Desktop comes with Free Pascal on the DVD version so be sure to install the development package when asked).

In case of issues or you need advise then feel free to mention and/or ask. If i'm able to find the time then i'll try to get you on the right track.

Quote
I have a long way to go.
Much of this conversation seems to be a repeat of what was written on amigacoding forums. That is not a bad thing, but in the discussion overthere (btw were the F*CK did that go, grmbl) i also seem to remember having advised you to use the right tool for the right job. Whether that be Free Pascal, PortablE, C, Hollywood or anything else doesn't realy matter much.

You just have to start, getting your feet wet. Unfortunately that also requires for you to invest some time to get the hang of things and getting yourself familiar with the basics of the programming language. That is an important part that can't be skipped, so be advised to only start learning a new programming language when convenient and you really have the time to do so.

In case the above is something that is holding you back then be advised that programming is nothing more then some simple assignments of values to variables (also declaring those variables if the language requires it) making comparison between variables (their values) and some loops.

Basically it is just that (really!).

From there, you can extend your knowledge to using other available constructs that makes live easier and using existing implementations that can aid your design.

Always try to split up difficult task into small steps that you are still able to grasp, e.g. falling back to things that you already know and/or are familiar with.

At the same time that makes things sometimes difficult as there are multiple designs possible to implement a solution to a problem. The more knowledge you have the more elegant/advanced your solution/implementation becomes ... that is usually the case, might not apply for everyone so your mileage may vary :-)
« Last Edit: December 25, 2018, 04:55:50 AM by magorium »



trekiej

  • Member
  • ***
    • Posts: 190
    • Karma: +5/-0
Reply #8 on: December 25, 2018, 07:54:24 AM
It looks like C, C++, Pascal, and Hollywood are the languages to use for Amiga Land.
Unless I have missed a language or two.
I like PortablE, yet I have not dove into it to learn it.
Free Basic and Pure Basic are two more I would like to add to the list.

This is a Pascal forum so back to Pascal.



Polluks

  • Newbie
  • *
    • Posts: 5
    • Karma: +0/-0
    • Bilskaja International
Reply #9 on: December 26, 2018, 09:27:18 PM
You may try it online
https://home.alb42.de/fpamiga/



trekiej

  • Member
  • ***
    • Posts: 190
    • Karma: +5/-0
Reply #10 on: December 27, 2018, 08:31:07 AM
That is cool.
I ordered two more Pascal programming books.
They could be here next week.