Visual Studio extension

Started by Cedric, September 25, 2024, 10:37:10 AM

Previous topic - Next topic

Cedric


Hey guys,

so we've been using Eclipse IDE for years now and we've just tried using the new VS extension.  In Eclipse, there was a text file in a "src" folder and a "compiled" folder which contained the compiled program. 

From what I see, in Visual Studio, there's no such thing as a compiled program?  Or is it?  The main issue we have is that we would need to reformat all our program files to removed the use of  /* to comment out some lines of codes that wasn't part of the compiled program.  Also, we would need to rename all of our files to remove the .pvt extension.  But even by doing that, I'm not sure it would be "compiled" or still interpreted as a "text program"? I do see that we can open directly the compiled program in VS, but we lose all our indentation (visual formatting), GIT history and is also not recognizing encoding properly (which may be a setting??) ?

My main question is.... Is there a way we can "compile" text based pvx program ?

Aaron Woodhouse

Hello,

Just to answer your question on VS Code: VS Code does not include the ability to compile without the use of a compiler extension. It was built as a "Code Editor", unlike Visual Studio which has the ability to compile and run your code directly.

Hope this helps!
Aaron Woodhouse
QA
PVX Plus Technologies Ltd.

Mike King

PxPlus contains a built-in option to compile programs from text files using the -cpl command line option.

Check out:
https://manual.pvxplus.com/?PxPlus%20Installation%20and%20Configuration/Launching%20PxPlus/Overview.htm#cpl

Using this, you may be able to integrate the compiler components into VS Code.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Cedric

Thanks MIke... will have a look!

Cedric

I'm curious though... What is pvx really doing in the backend when using "text based program" ?  I honestly thought that it needed to be compiled to run?

So, is there performance downside of using "text based program" instead of compiled?  If I understand the concept, all programs edited with VS extention will not be compiled unless we force a compile from and external script.  Technically, we could use notepad and it would do the same except the syntax/code corrections and visual keywords formatting that VS offers.

Stéphane Devouard

Cedric

If I am not mistaken, Visual Studio Code extension can handle both text-based and tokenized programs
That's why you can configure a common file extension for the text-based ProvideX programs

You can execute an application witht text-based program only
PxPlus converts the source code to tokenized in memory before running your programs
There is an overhead, but with nowadays CPUs, you need to have superpowers to be able to notice it ;)

You could probably develop with text programs only, and when deploying to QA / production / clients, you could mass-convert all your source code to binary format, using either some external OS script invoking pxplus with the -cpl command-line option mentioned by Mike, or a PxPlus program using the *pg.cnv utility

Stéphane Devouard
Portfolio | Work

Cedric

Hey Stéphane,

the biggest reason we can't really use the VS extension right now is because it doesn't recognize the symbols /* to comment blocs of code.  We have that everywhere in our programs since we've been using Eclipse for the last 15 years.  Obviously, having this in our text based program makes it not compatible with native PVX and compiling gives error.  So, the only solution would be to remove all of these before even thinking of converting to VS as a primary IDE.  Perhaps, it could be done via a script.  But even if we do that, in VS, all of these comments are displayed as errors and makes it annoying as hell! ;)

Time is not something we have to spare right now, but perhaps this is something we could have a look later when things slows down!  I guess we'll stick with the outdated Eclipse version for now!

thanks

Stéphane Devouard

Cedric

You could write a script or a PxPlus program that inserts a '!' at the start of every lines between /* and */
That would be a one-time process and it would prevent VSCode from displaying compilation errors on those comment lines

Regards
Stéphane Devouard
Portfolio | Work