Proton BASIC Community

Proton (Positron) => Proton8 threads => Topic started by: atomix on Sep 27, 2021, 06:22 PM

Title: Custom preprocessor.
Post by: atomix on Sep 27, 2021, 06:22 PM
Release v1.0.40 - custom preprocessor:

Features:

1) Eval inline script code (unlimited possibilities of LangMF)
2) Auto convert long name var to short
3) Simple struct types
4) Simple auto counters
5) Insert contents of external files in any formats
6) Version information from file (*.mci) to code
7) ... you can easily add new preprocessor files (*.mf *.js *.vbs *.py *.cmd *.exe) yourself
Title: Re: New feature - add a custom parser.
Post by: top204 on Sep 28, 2021, 08:50 AM
Lovely words to read Atomix, and many thanks.

I've been down that road before Atomix, and I got fooled again into making others money and a good reputation with third party compilers and compiler backends, with nothing beneficial for myself. i.e. No payments and no recognitions.

I'm afraid at this time in my life and what has happened to me in my life, from others using my skills for their benefit, I would need payment in advance and full written permissions with conditions before I would allow the compilers to be used as backend code generators for a third party. I would like to say "Once bitten, twice shy", but in my case it is "Multiple times bitten, and not learned because of mis-guided trust". :-(. Foolish on my part I know, by unfortunately, that is my personality thanks to being brought up by two lovely caring parents who only showed us love and trust, and not the "real" world.

Just a few weeks before my lovely mum passed away, earlier this year, she said to me and my younger sister "I am so sorry for bringing you up with so much trust in others, and not understanding how to be a little devious so you can see it in others", because she knew what has happened to me through my working life, and how I have used my skills and natural curiousity for the benefit of others that I have worked for or been friends with, and not actually for me!! But, we had a lovely upbringing and we took it so much for granted that the "real" adult world was the same as the adults we knew, and once I was older, it was almost impossible to change my, underlying, personality that much.
Title: Re: New feature - add a custom parser.
Post by: John Lawton on Sep 28, 2021, 10:11 AM
There is no \PDS\Custom directory on my machine, so this discussion is beyond me. If a different code parser was to be used, that implies a different high level language, non?
Title: Re: New feature - add a custom parser.
Post by: atomix on Sep 28, 2021, 10:20 AM
I condole with you about your mom.

Regarding the custom preprocessor, I meant that users could add their own preprocessors, for example:

1) add variables from the untitled.mci file
2) add data processing like structures
3) ...
Title: Re: New feature - add a custom parser.
Post by: top204 on Sep 28, 2021, 11:12 AM
As John stated, that would need a new compiler, generating Positron code, so the Positron compilers generate the tight, optimised assember code and efficiently handle the awkward architecture of the Harvard microcontrollers. i.e. PIC, PIC24 and dsPIC33 devices.

That is what a few other compilers have done that used the Proton as the backend, and I received nothing, and a full compiler I created for the Met forensics and Cr#wn#ll (in my own time), with the promise of £10,000 when it was finalised. But that was dropped by Cr#wn#ll because the forensics, rightly, wanted control over what they were going to purchase, but the control freak running Cr#wn@ll did not want ot give anything up, so the deal dropped through, and even though he would have been paid in full for the R&D that I did on the, concept, design, electronics and firmware and software of the unit's Beta, in my out of work time, that were all finalised and working flawlessly.... I never got a single penny in payment, because I had trust, and got nothing in writing. So my months of work in my own time came to nothing, yet again!!!! Looking back, I was so, so, stupid to have been in similar situations with "him" a few times, and do nothig about it! I stupidly stayed there for 16 years. Looking back, I cannot believe I did it, and neither can friends and people I knew when they worked there for a few months. That was the maximum amount of time they could tolerate him, and they had the common sense to leave!

I am actually looking forward to retiring in the future, so I can get back a little money I have paid all my life in tax, and sit back and try to relax as much as my injury allows.
Title: Re: New feature - add a custom parser.
Post by: ricardourio on Sep 28, 2021, 11:44 AM
Hi Les,

    Many years ago I took sales classes and the teacher asked us what the main purpose of our business is.
Some say "to have a good service", others say "to satisfy my customers" and some other good expressions.
Then the teacher yells at us saying that "the objective of our business is to make a profit". The way you reach it is the difference and we don't need to be mercenaries, but we shouldn't be immature.
If your parents teach you such good things, you can be proud of it, because the world needs good people like you, and you need to be with the same kind of people around you.
We just need to improve on the good teachings of our parents and never ignore them.
I'm sorry for your loss my friend.

Regards

Ricardo Urio
Title: Re: New feature - add a custom parser.
Post by: atomix on Sep 28, 2021, 04:24 PM
update post below
Title: Re: New feature - add a custom preprocessor.
Post by: top204 on Sep 28, 2021, 04:56 PM
An excellent, and very interesting, future add on.

I can see a future issue with the code produced.

The hash '#' character will no longer be used in the next generation of compilers because the new assembler program does not support them. I have made the next compiler's parser recognise the # in the BASIC code, but these get converted to an underscore in the assembler code. So MyArray#1 will be MyArray_1 in the asm listing, otherwise, the assembler gives an error.
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Sep 28, 2021, 05:06 PM
As soon as new version is ready with all the fixes, i buy another copy of the complete compiler Positron to support you.
Title: Re: New feature - add a custom preprocessor.
Post by: JonW on Sep 29, 2021, 06:13 PM
Totally agree Atomix.  I too will follow and buy another for the fixes and support.
maybe better to donate via Paypal rather than pay the ebay fees.
USC is a good idea but many just save all the fixes and updates to a yearly release.  £40 for this compiler is FAR too cheap and I  would limit to a few devices for that price or force a code limit.  Over that increase the cost to where it can be maintained with time duly paid for.  USC guarantees income if you want support. 

We pay close on £10k for USC every year.  ADS, EMPRO, Altium, Labcenter, Softplot... its the norm

I would be lost without the compiler on FW projects.  Today I had a customer doing their own code on a RF module we designed and stating the  hardware was an issue.  Fortunately I designed in an unpopulated 18F that connects to SPI, I2C with serial trace port, within 3 hrs I had the hardware running using the compiler.  Pass on the basic files and the FW engineer copies to C and oh it works...  There is nothing like it.  If it was £3k i would buy it as commercially it saves so much time.  Yeah on the odd occasion you get an anomaly but you find this in every compiler and just work around it.

J
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Sep 29, 2021, 07:05 PM
update post below
Title: Re: New feature - add a custom preprocessor.
Post by: CPR on Sep 30, 2021, 09:50 PM
Quote from: atomix on Sep 28, 2021, 05:06 PMP.M. I suggest that everyone buy the new version every year so that you have an income from it.

I disagree. I think it makes more sense to put effort into marketing to broaden the user base rather than penalizing the existing dedicated & very small amount of users. For those that have suggested they'd happily pay thousands for Positron, then go ahead and give through Paypal to Les. It's simple enough.  :)
Title: Re: New feature - add a custom preprocessor.
Post by: John Drew on Oct 01, 2021, 12:10 AM
Regarding donations.
Our forum community has a mix of professionals and hobbyists. Some with big pockets, others with small ones.
To me the question is how much do we each get out of Positron?
Perhaps we should think about the parts we need. Positron is an item on the parts list. In the case of the professionals, how much time has it saved?
A fraction of those costs might provide a guide as to an annual payment to Les.
Personally, I'm a hobbyist and I get a huge amount of fun out of my projects. Far more than going to the movies. My projects keep my mind active and hopefully stave off Alzheimer's disease. I'm 81.
Positron has a better effect than the pills I take and it's a lot cheaper.
I give an annual donation because of the above - worth every penny. But it's what I can afford.
If you can't afford to give don't. You've helped by buying in the first place.
The marketing comment is fair enough but it does cost and I suspect the return may be less than the costs. On my part I have a review on my website. Word of mouth is important too. Small steps!
Best wishes to all,
John
Title: Re: New feature - add a custom preprocessor.
Post by: John Lawton on Oct 01, 2021, 09:30 AM
Hi John,

err, what's the address of your website?

It's a bit chicken and egg about increasing the user base but not asking for an annual upgrade fee. How can marketing be funded otherwise?

The compilers are great tools and in my opinion should command a reasonable annual upgrade fee.  Alternatively I suggest an annual fundraising event, with every user emailed beforehand. That would also be more effective than just hoping for occasional giving.

Just my penny's worth as we say.

John
Title: Re: New feature - add a custom preprocessor.
Post by: John Drew on Oct 01, 2021, 11:19 AM
G'day John,
My website is: vk5dj.com
Click on Software menu item then Proton Development Suite
I know that Les arranged for a website but I'm not sure if it has progressed. I think this would be helpful for sales too, especially if it had a point of sale. An increase in the price of Positron would easily cover the costs.
If Les wants help in setting it up I'm sure there are people among the users here who would help.
John
Australian Amateur Radio Callsign VK5DJ
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 01, 2021, 06:06 PM
update post below
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 03, 2021, 12:27 PM
See first post.
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 04, 2021, 08:10 AM
I have updated the preprocessor.
Title: Re: New feature - add a custom preprocessor.
Post by: top204 on Oct 04, 2021, 09:04 AM
It seems like a fascinating scripting creator. However, how is it initiated with a .bas file to then run the compiler, or how is it initiated to create a seperate .bas file?

In the "Custom/Parsers" directory, there is a single Demo.exe file, but this produces a "Run Time Error 75" error message and does nothing else when double clicked!

Can you please create clear, simple step by step, instructions how to use it, so that we can load a file and run the compiler with the modified script etc... :-)

When creating applications for other people to use, the instructions for its use are extremely important, and can take longer to create than the actual application.
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 04, 2021, 11:40 AM
 run AtomixPreProcessor_setup.exe - he execute the following
Title: Re: New feature - add a custom preprocessor.
Post by: top204 on Oct 04, 2021, 01:34 PM
I know it is a fascinating program, but I cannot condone a compiler application file being replaced Atomix! i.e. The "Preprocessor.exe" file.

When things do not go quite as they should with a program, some users will give the blame to the compiler and not a third party application that has, secretly, replaced a compiler application file, and this is very bad advertising. For this program to be used with the compilers it needs to be run as a Plugin to the IDE and the scripting engine ran first, then the .bas file it creates passed to the compiler as normal. Then a user knows that this is "not" the compiler doing the pre-processing work.

Also, the compilers rely on the preprocessor operating as it is, and failures will be inevitable if it is replaced or renamed etc... At random points in a future date/time, the compiler protection will also kick in and deny access to the compiler programs because of changes in its files. Future installers and updates etc, will make sure the compiler application files are protected, so no replacements can be made by third party applications. Window's is supposed to do this as standard in the "Program Files" and "Program Files (x86)" folders, and so is the installer I used, unless a verified installer database key value is correct that is used by the original installer, so I will investigate further why they have both failed to protect the files.

Sorry, but it is a big "NO" for your current preprocessor scripting app you have kindly created.
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 04, 2021, 03:00 PM
I understand everything, but this is the only way out for me to add the opportunity to the compiler that I need.

Positron Studio has no support for plugins.

In Proton IDE it is difficult to implement because I modify not only the BAS file, but also all the files included in it using the "Include" method, and this is very difficult to implement in the form of a plug-in.

The capabilities that I described (Parse_Types, Parse_LongName, Parse_Version and writing the code in another language), you still do not intend to the compiler, but they really need me.
Title: Re: New feature - add a custom preprocessor.
Post by: CPR on Oct 04, 2021, 06:58 PM
I thought Les was now working with you as an official Beta tester Atomix?
Title: Re: New feature - add a custom preprocessor.
Post by: top204 on Oct 05, 2021, 12:44 PM
I'll see if I can add a call to the scripter from the preprocessor.exe file, if it is present in the folder. However, your scriptor must have a window appear to tell the users what is happening and that the scriptor is a third party application with contact details for yourself. Once the scriptor has done what it needs, the compiler preprocessor will do its job. Or do you want it the other way? Compiler preprocessor does its tasks then calls the scriptor? Either way it will be a .bin file that is passed because that is what the preprocessor uses from the compiler's loader application, with file and line information within it.

Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 05, 2021, 03:06 PM
Quote from: top204 on Oct 05, 2021, 12:44 PMOnce the scriptor has done what it needs, the compiler preprocessor will do its job.

Yes this is what i need.

If the PreProcessor_Custom.exe file is found in the folder, then run it before running the PreProcessor.exe file
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 18, 2021, 06:52 AM
New release with requirements as specified by Les.
See first post.
Title: Re: New feature - add a custom preprocessor.
Post by: top204 on Oct 18, 2021, 10:43 AM
I downloaded the setup on the first post and it is still over-writing the original "Preprocessor.exe" file and creating the newly named preprocessor file.

Please change this.

I had a few programs fail when compiling, before I realised it was doing the same as before. This is the last thing I want the users to see happening for no, apparent, reason!!
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 18, 2021, 05:23 PM
I fixed everything now.

But there is a delay in your preprocessor.exe file, after my script has worked and closed, your program is waiting for 5 seconds and loads the cpu full and only then continues compilation.
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 25, 2021, 06:37 AM
New release. See first post.
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 25, 2021, 04:07 PM
Now everything corrected as Les said.

The file is now installed as preprocessor_custom.exe

By default, it is disabled and does not processes the user code if the parameter §custom -enable is not specified

Now it works without errors by 100%.

All who installed the old Custom_PreProcessor version simply rename the preprocessor_les.exe file back to preprocessor.exe, and it will not be necessary to reinstall anything.
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 27, 2021, 03:20 PM
I hope in version 4.0.1.0 preprocessor_custom.exe will be launched, then I will be immensely happy.

Only there is a problem described in the post #27.
Title: Re: New feature - add a custom preprocessor.
Post by: top204 on Oct 29, 2021, 11:39 AM
In the next corrections update, I will incorporate the preprocessor that call the custon preprocessor if it is found beside it. However, your custom preprocessor "must" have a window come up to state that it is "third party"

I made a mistake in the calling of the program in the beta version I sent you, in that I had the timeout set too long. I have the timeout and a count of the amount of timeouts because some programs take longer to operate on the code listing, and I never wanted a program to be cut short because it is classed as "not responding", which is a commom thing since Windows 7.
Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 29, 2021, 11:44 AM
Thanks.
The program has updated and added the window with information.
Title: Re: New feature - add a custom preprocessor.
Post by: Giuseppe MPO on Oct 30, 2021, 12:34 AM
I tried to install and try the preprocessor but when I compile
it gives me this error.
Thanks

Title: Re: New feature - add a custom preprocessor.
Post by: atomix on Oct 30, 2021, 08:41 AM
It will work only in the new version 4.0.1.0 positron
Title: Re: Custom preprocessor.
Post by: atomix on Nov 01, 2021, 02:15 PM
New release 1.0.24
Title: Re: Feature - add custom preprocessor.
Post by: atomix on Nov 02, 2021, 07:52 PM
New release 1.0.25
Added new commands - §count and §file
Title: Re: Custom preprocessor.
Post by: atomix on Nov 04, 2021, 06:02 PM
New release 1.0.27
Fully rewritten and improved parsing algorithm for types
Title: Re: Custom preprocessor.
Post by: atomix on Nov 09, 2021, 07:46 AM
New release 1.0.29
Title: Re: Custom preprocessor.
Post by: atomix on Nov 26, 2021, 10:40 AM
New release 1.0.30

Added symbol _ combining multiple lines
Title: Re: Custom preprocessor.
Post by: atomix on Nov 28, 2021, 07:26 AM
New release 1.0.31

Small error corrections.
Title: Re: Custom preprocessor.
Post by: atomix on Jan 09, 2022, 06:33 PM
New release 1.0.40

Added auto codepage detection.
Title: Re: Custom preprocessor.
Post by: atomix on Oct 04, 2022, 05:23 PM
The project is on hold for now.