Prog8 language and compiler topic

All aspects of programming on the Commander X16.
Snickers11001001
Posts: 140
Joined: Wed Jan 20, 2021 6:43 pm

Prog8 language and compiler topic

Post by Snickers11001001 »



11 hours ago, desertfish said:




Which option would you choose and why?



Make it work how YOU want it to work.   Each of your options has some headaches (for you and for users) but since the major changes in R39 (banking, rom routines that live somewhere else) are probably important for your software, bottom line is you have to decide how much dev time you want to spend targeting an emulator version (and maintaining a parallel code-path for it) to service an emulator/rom version that we know will not be what comes out as the X16 hardware or any future official emulator release.   

Its true that there's a bit of a disconnect right now, with the 'docs' all being r39 but the official downloadable emulator release at r38, but I suspect behind the scenes there are goings on that probably represent a good reason there hasn't been an official r39 release as yet.     If you  target r39 then even if they make some tweaks (whether as part of a release or due to feedback when they ship hardware for beta testing) you can adapt and roll with it.   If you target r38, then you know you're developing toward a dead-end and will have to retool for r39 eventually anyway.   

It seems to me that anyone with the chops to use this particular piece of software (which probably doesn't include me at present although I hope to have the time to play with it later this summer) will be able to make or get their hands on an R39 build during the time (which may be shorter or longer, who knows) before an official r39 release.  

    

 

borgar
Posts: 52
Joined: Wed Mar 31, 2021 9:30 am
Location: Oslo

Prog8 language and compiler topic

Post by borgar »


Right now I'm fine with 1. I'm basically not going to require the new functionality in the near future so the new compiler work with the old emulator for me.

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

Prog8 language and compiler topic

Post by BruceMcF »


The thing about backward compatibility ... it's backward compatibility with a version of the prototype that is not going ahead to production.

I'm not a prog8 user, SO this doesn't count as a user request, but to my mind, either Micheal Steil just has something taking his time right now, and he'll push a new revision when he has time to do the house keeping, or else is occupied with Kernel development, and the next revision will incorporate additional new ROM code. In either case, reverting to the previous revision is making a change that is on a countdown to needing to be changed back.

So I'd ADVISE against it, but that's just advice, it has no standing as a user request.

User avatar
desertfish
Posts: 1073
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Prog8 language and compiler topic

Post by desertfish »


Seems like keeping the V39 (only) looks to be the best way forward, I'm happy with that. And @borgar makes a good point; if you don't actually use the parts that have changed your program still runs fine on v38.  I'll make sure this is clear in the documentation too

User avatar
desertfish
Posts: 1073
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Prog8 language and compiler topic

Post by desertfish »


Prog8 7.0 has just been released.

https://github.com/irmen/prog8/releases/tag/v7.0

Major changes and improvements since the previous release:


  • CommanderX16 target: we now target the upcoming "V39" of the cx16 emulator and roms. Read the info box in the manual for more details https://prog8.readthedocs.io/en/latest/index.html#required-additional-tools


  • the struct language feature has been removed. Rewrite any struct-uses as just the separate variables.


  • improved random number generators.


  • string encoding and string interning bug fixes


  • various compiler crashes fixed


  • %asminclude fixed (scopelabel argument removed as well)


  • repeat loop code gen optimized some more


  • fixed various assembly symbol scoping issues


  • documentation improvements


  • streamlined the grammar definition and improved some parse errors


  • fixed warnings in gradle build scripts, updated some libraries and Kotlin runtime version.


User avatar
desertfish
Posts: 1073
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Prog8 language and compiler topic

Post by desertfish »


after a long wait, Prog8 7.1 (beta version) has just been released.

https://github.com/irmen/prog8/releases/tag/v7.1-beta

Most of the changes this time are internal to improve code quality and testability.

But several important bugfixes and enhancements have also been made.

One thing to mention now is that the ``%target`` directive has been removed, the compilation target is set on the command line options.

A full list of changes will be published on the 7.1 final release. In the meantime, here is the changes list since 7.0 https://github.com/irmen/prog8/compare/v7.0...master

Ju+Te
Posts: 40
Joined: Sat Sep 25, 2021 6:33 am

Prog8 language and compiler topic

Post by Ju+Te »


Wow, this looks like a really good programming environment! Much more structured and high-level than pure assembler language - approximately that what I had dreamed of. And, as a Java developer by heart, I also like how it is made. ?

User avatar
desertfish
Posts: 1073
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Prog8 language and compiler topic

Post by desertfish »


Version 7.1 of the Prog8 compiler has just been released https://github.com/irmen/prog8/releases/tag/version7.1

Documentation is here https://prog8.readthedocs.io

Here's a list of the changes:

- removed %target directive because it was too confusing for what little it did. Just use -target command line option.

- non-asmsub subroutines can no longer be inlined because the way this worked was not reliable

- internal code refactoring to improve testability and reliability

- several error/warning message improvements

- added support for secondary alternative emulator to launch, with '-emu2' option (box16 in case of commanderX16)

- fixes for various issues related to different output path

- %asmbinary path related assembler bug fixed

- float[] array initializer bug fixed

- fixed some assembler bugs in swapping values with swap()

- fixed bug in palette.set_color

- fixed bug in optimizer that sometimes removed subroutines that were referenced, causing assembler crash

- some other miscellaneous bugfixes and improvements.

 

Ju+Te
Posts: 40
Joined: Sat Sep 25, 2021 6:33 am

Prog8 language and compiler topic

Post by Ju+Te »


How to use different source code files? Is it possible to declare some library code parts as public (visible to the outside) while others remain private (only visible from the library's code)?

User avatar
desertfish
Posts: 1073
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Prog8 language and compiler topic

Post by desertfish »


Everything is public in Prog8, there's no concept of private accessibility. You can use scoping to structure your code though (modules, blocks, subroutines).

Post Reply