View Full Version : about free pascal
i have encountered the site http://www.freepascal.org/ by chance, and surprised the many platforms it support (long list). i know it is a very old programming language, but i can't see any compiler coded with object pascal or its variations. it seems most if not all compilers are made with c/c++ mixed with some asm. free pascal seems beautiful i have downloaded it, and was able to run some of its opengl examples. its IDE is bad but i have used an editor and it is not hard to run fpc.exe code.pas from the command prompt. i have noticed Lazarus but i want to learn the base first, also lazarus very big.
still don't see any reason why programming languages developers don't make their products with free pascal and instead they go to c/c++ !!!??
Michael Hartlef
06-04-2016, 19:03
I love Pascal and its variations. And FreePascal is a damn good compiler.
Pascal has somehow a bad reputation. Don't know why, it is as powerful as C++ definitely. But the market rules I guess.
ErosOlmi
06-04-2016, 20:26
Pascal (and FreePascal) is one of my preferred programming languages.
To have a great IDE you should use Lazarus IDE at http://www.lazarus-ide.org/
It is a complete IDE and the full FreePascal compiler in one package.
There was a time when I was seriously thinking to stop developing thinBasic using PowerBasic compiler and start using FreePascal.
I also tried to use FreePascal as a backend compiler for developing thinBasic modules. I was able to develop some modules for almost all kind of variables but the kind of string we use in thinBasic (BSTR Ole32 strings) are not so compatible with FreePascal strings. In theory FreePascal WideStrings should be compatible (or equivalent) to BSTR OLE32 strings but in praxtice there are some problems returning strings from function calling. Here some info: http://stackoverflow.com/questions/9349530/why-can-a-widestring-not-be-used-as-a-function-return-value-for-interop
Maybe some day I will retry making some serious tests.
hi primo
I use Geany for most of my recreational programming, it supports numerous languages out of the box, you load a C file and provided you have gcc installed on your path all you do is click on the build button, likewise for free pascal or gfortran, python etc. https://www.geany.org
Michael Hartlef
07-04-2016, 09:54
Pascal (and FreePascal) is one of my preferred programming languages.
To have a great IDE you should use Lazarus IDE at http://www.lazarus-ide.org/
It is a complete IDE and the full FreePascal compiler in one package.
There was a time when I was seriously thinking to stop developing thinBasic using PowerBasic compiler and start using FreePascal.
I also tried to use FreePascal as a backend compiler for developing thinBasic modules. I was able to develop some modules for almost all kind of variables but the kind of string we use in thinBasic (BSTR Ole32 strings) are not so compatible with FreePascal strings. In theory FreePascal WideStrings should be compatible (or equivalent) to BSTR OLE32 strings but in praxtice there are some problems returning strings from function calling. Here some info: http://stackoverflow.com/questions/9349530/why-can-a-widestring-not-be-used-as-a-function-return-value-for-interop
Maybe some day I will retry making some serious tests.
I would like to test it myself. Do you happen to have your "freepascal thinbasic SDK" files flying around and share them?
ErosOlmi
07-04-2016, 14:41
You can keep \thinBasic\SDK\SDK.Zip
There should be a "Delphi" directory.
In any case that SDK uses special thinBasic Core specific functions for strings that convert dynamic BSTR strings into Pascal strings and the other way round.
Anyway, let me know.
This evening I will search other tests and post here.
Michael Hartlef
07-04-2016, 14:49
Sorry Eros, the latest thinbasic distribution only contains C, BASIC and Assembler SDKs.
ErosOlmi
07-04-2016, 15:52
opps, sorry you are right :oops:
I will check this evening.
Michael Hartlef
07-04-2016, 16:03
No problem Eros. Whenever you find time and motivation.
ErosOlmi
07-04-2016, 18:08
I forgot about it but there is a Delphi dedicated forum here:
http://www.thinbasic.com/community/forumdisplay.php?219-Turbo-Delphi-language-SDK-development
It is very close to FreePascal I think.
Thank you jack for suggesting this great editor, i have installed it with the Plugins for Geany, and once i have opened a Pascal file she recognize it automaticaly, and the best she know the name of the necessary compiler and its settings in the set build commands whithout i do anything
Eros, i hope i am not annoying you of this bold question, what is the possibilities of you and/or Michael to create a small and prototype basic language compiler which are made by free pascal not from c/c++. in fact it will be the first time in the history a basic language made from pascal, it can be just an experiment over the long years. certainly i can't make an interpreter or a compiler (i'm over 60 yo). only the experienced developers can . i just feel excited of the mere idea.
Michael Hartlef
08-04-2016, 14:30
Back in the days (around 2007, 2008 I think), I was playing with COCO/R for Pascal. With it I was able to create a simple BASIC language that got translated to pascal and used FreePascal to create an executable. So it is definitely doable. Atm. I am creating a game which I want to commercialize on Steam.
Btw. there were projects before that used a BAS2PAS attemp.
Thanks Michael for the info, i have followed the search for BAS2PAS and have found also BASIC Accelerator Ver. 0.9.7.0 (2016.01.18 ) , it is using QB basic syntax
http://hp.vector.co.jp/authors/VA008683/english/BASICAcc.htm
but unfortunately it needs older lazarus versions 0.9.30.4, 1.0 or 1.0.14
i have installed now the old lazarus 1.0.14 https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Lazarus%201.0.14/
the BASICAcc should be in a path without spaces such as C:\BASICAcc . there are many math and graphics examples in the BASICAcc folder, there are 3D examples inside sample folder such as 3DVIEW , also Chaos and Julia set examples... etc, and it works well . also when we press F8 the pascal equivalent to QB basic is provided in another window and the original basic lines are commented.
EDIT:: it seems to work with the latest lazarus compiler, only install it without spaces in path like this: c:\lazarus, and install BASICAcc like this C:\BASICAcc, and in BASICAcc ide change setup->path to C:\lazarus\fpc\3.0.0\bin\i386-win32
ErosOlmi
08-04-2016, 19:14
Eros, i hope i am not annoying you of this bold question, what is the possibilities of you and/or Michael to create a small and prototype basic language compiler which are made by free pascal not from c/c++. in fact it will be the first time in the history a basic language made from pascal, it can be just an experiment over the long years. certainly i can't make an interpreter or a compiler (i'm over 60 yo). only the experienced developers can . i just feel excited of the mere idea.
You are never annoying!
Well thinBasic is written using PowerBasic compiler, so it is not C/C++ :)
I think that it is possible to implement any interpreter in whatever compiled language
PowerBasic as a back-end compiler is the best for me in terms of easy to learn and power: a huge set of native commands, great flexibility with pointers and (for me) the best string handling.
FreePascal is as good as PowerBasic in many aspects and even more but in 2004 I started using PowerBasic so it was quite complex to switch to using another compiler after almost 250 thousands lines of code of thinBasic sources.
But to develop thinBasic modules, any compiler able to handle BSTR strings can be used.
BSTR strings, called also BASIC strings or OLE32 strings or COM strings (because used in COM components), are very powerful but many compilers does not implement that because they are specific to Windows world and need some special functions present in Microsoft OLE32 library using Sys* functions. More info on BSTR: http://thrysoee.dk/InsideCOM+/ch05b.htm