Freepascal inclusive LCL for MorphOS
  • Order of the Butterfly
    Order of the Butterfly
    asrael22
    Posts: 404 from 2014/6/11
    From: Germany
    Quote:

    amigadave wrote:
    Quote:

    asrael22 wrote:
    Getting there:
    Cubic_Pascal_Highlighting.png



    I'm going to be busy working with Hollywood, probably all of this year, so I don't think I will attempt to add Pascal to my programming languages studies, but I did purchase CubicIDE a few years ago, so if/when I do decide I want to learn Pascal, I would like to use your pascal highlighter, if you would allow it to be downloaded by other programmers.


    Certainly.
    I'd still like to work a bit on the toolbars. There is only one button for compiling the source. And FreePascal is pretty intelligent, so when you give it the main source file to compile it will automatically compile all dependent units.
    But there is no button to run the compiled program.

    And then, some of this config is in the CubicIDE registry, not certain how to extract that and make it available separately, as a real plugin.

    [ Edited by asrael22 03.03.2018 - 06:44 ]
  • »03.03.18 - 06:43
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Chain-Q
    Posts: 347 from 2003/10/12
    From: 1 AU, EU, DE/HU
    @asrael22:

    As linked from the MorphOS FPC wiki page, there was a Pascal syntax highlight addon for GoldEd, which was later extended to CubicIDE.

    It's still available from here.

    Not sure how complete or useful is it though in practice, I only used it briefly, very long ago. Maybe there's still something to add from it to your work.
    [.PegasosII/G4.:.Efika.:.Amiga2000/060.]
    [.Free Pascal Compiler MorphOS Port.]
    [.Hosting AmigaSpirit.hu.]
  • »03.03.18 - 11:19
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    asrael22
    Posts: 404 from 2014/6/11
    From: Germany
    Yeah, thanks. I believe I've tried it.
    Let me check again.
    In any case, I don't know why a custom compiled parser would be necessary. That only adds dependencies.
  • »03.03.18 - 19:37
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    asrael22
    Posts: 404 from 2014/6/11
    From: Germany
    Quote:

    asrael22 wrote:
    Yeah, thanks. I believe I've tried it.
    Let me check again.
    In any case, I don't know why a custom compiled parser would be necessary. That only adds dependencies.


    Yeah, it is not fully compatible with the latest version of CubicIDE.
    I see requesters for version mismatch and other quirks.
    It does parse a few more things than the standard parser would be able to parse, i.e. the assignment ":=" and other things.
    But I can live without it.
  • »03.03.18 - 19:56
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    asrael22
    Posts: 404 from 2014/6/11
    From: Germany
    Extended the ARexx wrapper for "Compile", "Compile&Run" and only "Run" commands.
    This can now be executed from Cubic IDE toolbar.

    Now I have little excuse anymore to not start doing something in FreePascal.

    CubicIDE_pascal_2.png
  • »04.03.18 - 18:23
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 138 from 2015/3/31
    @asrael:

    nice, do you mind to share your config or so. I would like to try as well, On classic I still search for a good editor with highlighting and compilation possibility for FPC.

    do you have any plans in FPC? something special you need support with?

    Have fun! :-D
  • »05.03.18 - 20:05
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    asrael22
    Posts: 404 from 2014/6/11
    From: Germany
    Yep, I'll do that.
    Want to try it on my classic first and then I'll put together a package.

    I'd like to program a number of things. From some utility programs for my house automation to some classic games.
    Now I just need the motivation and time.
  • »06.03.18 - 06:26
    Profile
  • MorphOS Developer
    Nadir
    Posts: 157 from 2003/3/17
    Very cool stuff and the concept looks flexible enough to maybe even be useful for real projects (although that will be a challenge).

    Any chance to keep the design flexible enough so that code generators for other languages than Pascal can be added later on, either by you or someone else? Or would you be opposed to this? ;-)
  • »07.03.18 - 22:47
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 789 from 2007/10/23
    From: Gelsenkirchen,...
    Quote:

    ALB42 schrieb:
    The source for MoGit is now on Github https://github.com/alb42/MoGit

    I used already MoGit to add the files ;-). Also the MorphOS git client works nicely. My first real world use of it.

    Well, I could not compile the source because the icon unit is missing
    Code:
    > make
    FreePascal:bin/powerpc-morphos/fpc -FUunits/powerpc-morphos -Fuunits/powerpc-morphos -Tmorphos -Ppowerpc src/MUIClass.Area.pas
    Free Pascal Compiler version 3.1.1 [2016/03/06] for powerpc
    Copyright (c) 1993-2015 by Florian Klaempfl and others
    Target OS: MorphOS
    Compiling src/MUIClass.Area.pas
    MUIClass.Area.pas(7,50) Fatal: Can't find unit icon used by MUIClass.Area
    Fatal: Compilation aborted
    Error: Work:Developing/pp/bin/powerpc-morphos/ppcppc returned an error exitcode
    make: *** [units/powerpc-morphos/MUIClass.Area.o] Error 1

    Code:
    > fpc amunits/src/coreunits/icon.pas
    Free Pascal Compiler version 3.1.1 [2016/03/06] for powerpc
    Copyright (c) 1993-2015 by Florian Klaempfl and others
    Target OS: MorphOS
    Compiling amunits/src/coreunits/icon.pas
    Compiling amunits/src/coreunits/exec.pas
    exec.pas(1178,66) Error: Identifier not found "_ExecBase"
    exec.pas(1178,76) Error: 32 Bit-Integer or pointer variable expected
    exec.pas(1179,62) Error: Identifier not found "_ExecBase"
    exec.pas(1179,72) Error: 32 Bit-Integer or pointer variable expected
    [...]
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »07.03.18 - 23:35
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 138 from 2015/3/31
    @Nadir:

    of course you (or anybody else ;-) ) can do everything you want with the Source, it's on github and unter CC0 (or unlicence as GitHub calls that, I like to call it "Do what the fuck you want Licence")

    https://github.com/alb42/MUIClass (The IDE is in ide/ folder)
    But (there is always a but isn't it) I don't believe an other Code Generator is possible because the Magic here is not in the IDE, the IDE is stupid, it doesn't know much about MUI objects and it's fields/methods. The "Magic" is in the MUIClass implementation which capsulate every MUI BOOPSI object into a real Pascal class, in principle you could write the same in C++ as well I guess.

    The idea is that you can use them like any other class/object.

    So instead of:
    Code:
    get(ListviewObj, MUIA_ListView_List, @ListObj);
    get(ListObj, MUIA_List_Active, @Idx);
    set(ListObj, MUIA_List_Active, NewIdx);


    you can write
    Code:
    Idx := ListViewObj.List.Active;
    ListViewObj.List.Active := NIdx;


    or for Methods:
    Code:
    DoMethod(ListObj, [MUIM_List_InsertSingle ,NewText, MUIV_List_Insert_Bottom]);

    you write
    Code:
    ListObj.InsertSingle(NewText, MUIV_List_Insert_Bottom);


    And so on and so on.
    The IDE uses RTTI to inspect which properties to show them in the property list so it does not know how the parameter in MUI (MUIA_xxx) looks like it doesn't even know the property names/types before it inspects the class, and you could give a completely new class to it without changing code.
    In the IDE there is for every new Type just a single line added (RegisterMUIClass) but before the wrapper must be written of course.
    So if you want to use that for a different language you have to write such wrapper first, of course it would be possible for C++ or so, but as long nobody did until now I guess it's not strongly demanded ;)

    @pollux:
    ehhmm look to the date of your fpc compiler ;-)
    it's 2 years old! did you think I sit on my hands for two years ;-) I implemented the icon.library wrapper already long time before.
    For MUIClass and the programs using it (MoGit/IDE) the latest 3.1.1 snapshot is needed. Download it here:

    http://build.alb42.de/fpcreleases/

    for you of course only the fpc powerpc-morphos would be interesting:

    http://build.alb42.de/fpcreleases/fpc-release.powerpc-morphos.lha

    The IDE and so on is also compiled every night:
    http://build.alb42.de/MUIClass/
    and there is also the Docomentation for the MUIClasses

    Have fun ;-)
  • »08.03.18 - 07:14
    Profile Visit Website
  • MorphOS Developer
    Nadir
    Posts: 157 from 2003/3/17
    Quote:

    ALB42 wrote:

    And so on and so on.
    The IDE uses RTTI to inspect which properties to show them in the property list so it does not know how the parameter in MUI (MUIA_xxx) looks like it doesn't even know the property names/types before it inspects the class, and you could give a completely new class to it without changing code.
    In the IDE there is for every new Type just a single line added (RegisterMUIClass) but before the wrapper must be written of course.
    So if you want to use that for a different language you have to write such wrapper first, of course it would be possible for C++ or so, but as long nobody did until now I guess it's not strongly demanded ;)




    OK, I see. Anyway, interesting concept. I look forward to follow your future progress and I will give this a try myself sometime.

    By the way, are the MUIClasses statically linked to the binary with FPC on MorphOS? Or do you have something like like a shared library interface?
  • »08.03.18 - 13:23
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 138 from 2015/3/31
    MorphOS Installer for the upcoming FreePascal 3.2 is working:

    https://blog.alb42.de/2019/12/15/installer-morphos/

    (FreePascal is still not released, so still beta version, just for testing, I hope FPC 3.2 will be released this year)


    [ Edited by ALB42 15.12.2019 - 19:48 ]
  • »15.12.19 - 19:47
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    amigadave
    Posts: 2795 from 2006/3/21
    From: Northern Calif...
    Quote:

    ALB42 wrote:
    MorphOS Installer for the upcoming FreePascal 3.2 is working:

    https://blog.alb42.de/2019/12/15/installer-morphos/

    (FreePascal is still not released, so still beta version, just for testing, I hope FPC 3.2 will be released this year)



    I love your passion for this project. It is really admirable that you work on this even on your vacations, but I hope you also enjoy the rest of your life, and not only live to code FreePascal for MorphOS. ;-)
    MorphOS - The best Next Gen Amiga choice.
  • »15.12.19 - 21:14
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Templario
    Posts: 539 from 2012/4/28
    I like your project with FreePascal because It remember me when I learned Turbo Pascal, but some instructions not work for example ClrScr; ReadKey, but the IDE recognizes both not for example the instruction Write, which instructions works and which not?
  • »17.12.19 - 12:32
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 789 from 2007/10/23
    From: Gelsenkirchen,...
    Quote:

    Templario schrieb:
    I like your project with FreePascal because It remember me when I learned Turbo Pascal, but some instructions not work for example ClrScr; ReadKey, but the IDE recognizes both not for example the instruction Write, which instructions works and which not?



    You have to include the unit.
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »18.12.19 - 11:30
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 138 from 2015/3/31
    polluks is not far off..

    But the CRT usint is currently not available for Amiga systems, because it's very close bound to MS-DOS Console. I tried to implement but especially ReadKey is a problem (I tried by finding the console window, activating the key IDCMP messages and wait for key, which works fine on Amiga but on MorphOS or on Amiga with KingCon no messages arrive)

    But I seldom write console programs and if then Readln/writeln was always enough for me..

    if you are used to TurboVision you can checkout FreeVision packages or pure amiga Intuition or MUI with my personal favorite MUIClass.

    Maybe you want to look here: http://fpcamigawiki.alb42.de/index.php?title=Tutorial:Start
  • »18.12.19 - 17:54
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Templario
    Posts: 539 from 2012/4/28
    Quote:

    polluks escribió:
    Quote:

    Templario schrieb:
    I like your project with FreePascal because It remember me when I learned Turbo Pascal, but some instructions not work for example ClrScr; ReadKey, but the IDE recognizes both not for example the instruction Write, which instructions works and which not?



    You have to include the unit.


    I don't undersant how include the unit, I make the example linked and the result is that can't find the unit Crt.
  • »19.12.19 - 10:45
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 789 from 2007/10/23
    From: Gelsenkirchen,...
    Quote:

    ALB42 schrieb:
    polluks is not far off..

    But the CRT usint is currently not available for Amiga systems, because it's very close bound to MS-DOS Console. I tried to implement but especially ReadKey is a problem (I tried by finding the console window, activating the key IDCMP messages and wait for key, which works fine on Amiga but on MorphOS or on Amiga with KingCon no messages arrive)

    Indeed? At least RAW: does no buffering or try WaitForChar().
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »20.12.19 - 18:15
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 138 from 2015/3/31
    Key <> Char, especially on Cursorkeys or F-Keys or Shift/Alt/Ctrl Keys
  • »22.12.19 - 17:27
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 789 from 2007/10/23
    From: Gelsenkirchen,...
    Quote:

    ALB42 schrieb:
    Key <> Char, especially on Cursorkeys or F-Keys or Shift/Alt/Ctrl Keys


    I see, extended and function keys will require some mapping
    https://www.freepascal.org/docs-html/rtl/crt/readkey.html
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »23.12.19 - 09:41
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 138 from 2015/3/31
    No it does not work because these keys does not stop waitforchar and you can’t read them via read().
    As far as I know that’s only possible via events or hook up input device
  • »23.12.19 - 11:27
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 3020 from 2003/3/5
    From: Canada
    Quote:

    ALB42 wrote:
    No it does not work because these keys does not stop waitforchar and you can’t read them via read().
    As far as I know that’s only possible via events or hook up input device


    I think you're doing something wrong - unless I totally misunderstood this thread. You can read practically all keys in a shell. You just have to switch it to raw mode.
  • »23.12.19 - 12:43
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 138 from 2015/3/31
    jacadcaps: how? do you have some example code/pseudo code?
    (I don't want open a new window/console, it have the be the one the program is started in)
  • »23.12.19 - 13:49
    Profile Visit Website