Using PureBasic to create websites?
Using PureBasic to create websites?
I was just wondering if anyone has written a program in PureBasic that helps with creating websites or blogs. I was thinking of something along the lines of a desktop version of Wordpress that creates static HTML files ready to upload to a hosting service.
Is this something that PureBasic is suitable for, or would I be better off writing something in Perl?
Is this something that PureBasic is suitable for, or would I be better off writing something in Perl?
Re: Using PureBasic to create websites?
You could try SpiderBasic. It compiles to javascript and allows for more than static html. You still need a backend to process the web responses that go outside the sandbox.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: Using PureBasic to create websites?
Javascript is an interpreted language, so it would be a lot slower to build the pages than a compiled PureBasic program. I don't need any dynamic features in the completed pages, I just want a program that will do all the repetitive tasks for me.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Using PureBasic to create websites?
Hello wysardry
I think understand what you mean - create a desktop application that can be used to create websites, like Serif WebPlus, Coffee Cup, Xara etc?
I think you could build a good app to do that with PB, but if only for personal use, the time and effort required is a big consideration.
I think understand what you mean - create a desktop application that can be used to create websites, like Serif WebPlus, Coffee Cup, Xara etc?
I think you could build a good app to do that with PB, but if only for personal use, the time and effort required is a big consideration.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Using PureBasic to create websites?
It is easy to create static pages since they are simple text files.
I do it for the download page of my site where a simple PB program reads my new version number, create the MD5 files of my programs, create the PHP page and upload all through FTP.
I do it for the download page of my site where a simple PB program reads my new version number, create the MD5 files of my programs, create the PHP page and upload all through FTP.
Re: Using PureBasic to create websites?
That's what I've coded once for my homepage ^^ And that's better/more optimized and customized than Wordpress or any existing stuff.wysardry wrote:I was just wondering if anyone has written a program in PureBasic that helps with creating websites or blogs. I was thinking of something along the lines of a desktop version of Wordpress that creates static HTML files ready to upload to a hosting service.
Surely PB is suitable for that, and probably even more than Perl. For now that my stuff has about 1500 lines of code and builds static site with menus/files/screenshots/CSS/some other things processed semi-automatically. Originally it was much simpler, yet made in a few hours.
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
Re: Using PureBasic to create websites?
Yes.wysardry wrote:Is this something that PureBasic is suitable for
Re: Using PureBasic to create websites?
Although what I have in mind is a desktop application, it isn't really very similar to Serif WebPlus, Coffee Cup, Xara etc. They really only allow you to create and edit web pages one at a time and you need to include very similar code for every page.
It would be more like a desktop version of Wordpress, Drupal or Joomla, as (once it is set up) all I want to do is enter some details, such as the title, category and keywords, along with the main page text, and the program would add the rest of the code for navigation etc. and add links to it on any index.html listing pages.
My main concern with creating something like this in PureBasic is whether it could easily cope with storing HTML fragments as strings without symbols such as <, > and " causing problems.
Perl allows you to define any symbol as a string delimiter and even lets you have multi-line strings, but it is an interpreted language, so it would be noticeably slower for larger sites. I'd also need to install web server software if I wanted to enter data using forms.
I don't have any experience of creating desktop GUI applications either, so learning that would take some time. I'm hoping it will be worth it in the long run, as this could potentially make things much easier once the site is larger.
It would be more like a desktop version of Wordpress, Drupal or Joomla, as (once it is set up) all I want to do is enter some details, such as the title, category and keywords, along with the main page text, and the program would add the rest of the code for navigation etc. and add links to it on any index.html listing pages.
My main concern with creating something like this in PureBasic is whether it could easily cope with storing HTML fragments as strings without symbols such as <, > and " causing problems.
Perl allows you to define any symbol as a string delimiter and even lets you have multi-line strings, but it is an interpreted language, so it would be noticeably slower for larger sites. I'd also need to install web server software if I wanted to enter data using forms.
I don't have any experience of creating desktop GUI applications either, so learning that would take some time. I'm hoping it will be worth it in the long run, as this could potentially make things much easier once the site is larger.
Re: Using PureBasic to create websites?
What you describe is the combo of both Purebasic and Spiderbasic. Prototyping is their sweet spot. Get it working quickly and then decide if you need more speed.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: Using PureBasic to create websites?
In PB, there is no problem with <> " ...
Two ways:
- Escape string
~""
- Constants
#DQUOTE$
(off reply: Perl)
Perl is used regularly to migrate large document management systems (DMS), precisely because of its speed and simplicity (yes)
(Even if we say that a Perl code UUencoded, it still looks like Perl
)
Two ways:
- Escape string

- Constants

Code: Select all
Debug #DQUOTE$ + "Hello World" + #DQUOTE$
Debug ~"\"Hello World\""
Perl is not (realy) an interpreted language. The entire code is read and pre-compiled before execution (unlike the first Basic ones that operated line by line). No language is faster than it is for managing large text files (apart from C and Assembler). It's his job for 30 years.... but it is an interpreted language, so it would be noticeably slower for larger sites.
Perl is used regularly to migrate large document management systems (DMS), precisely because of its speed and simplicity (yes)
(Even if we say that a Perl code UUencoded, it still looks like Perl

Re: Using PureBasic to create websites?
skywalk: I'm sorry, you've lost me. Why would I need to use a browser-based language for a program that has a desktop interface?
Marc56us: Can you also escape strings stored in text database files, such as in CSV format?
I haven't had much recent experience with Perl programs, but I used to use Links 2 from Gossamer Threads about 8 years ago. It was used for creating a directory of links and created static HTML pages. If you had a few hundred links it would take several minutes to build all the pages on a local web server.
There is a static website generator program called Hugo (written in Go) that takes less than 1 ms to build each page.
I know that PureBasic isn't likely to be as fast as Go, but I thought it would be much quicker than Perl, as the programs are already compiled. Has anyone done a speed comparison?
Marc56us: Can you also escape strings stored in text database files, such as in CSV format?
I haven't had much recent experience with Perl programs, but I used to use Links 2 from Gossamer Threads about 8 years ago. It was used for creating a directory of links and created static HTML pages. If you had a few hundred links it would take several minutes to build all the pages on a local web server.
There is a static website generator program called Hugo (written in Go) that takes less than 1 ms to build each page.
I know that PureBasic isn't likely to be as fast as Go, but I thought it would be much quicker than Perl, as the programs are already compiled. Has anyone done a speed comparison?
Re: Using PureBasic to create websites?
EditorGadget do the job
Sample: Write text inside with CR/LF/Tab "" <> etc
GetGadgetText(#Edit) = Full text in editor in one time
run again: <> " tab are here
for other usage, use Regex
Sample: Write text inside with CR/LF/Tab "" <> etc
Code: Select all
EnableExplicit
Enumeration
#Win
#Edit
#File
EndEnumeration
Define FileName.s = GetTemporaryDirectory() + "Test.txt"
OpenWindow(#Win, 0, 0, 500, 300, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(#Edit, 10, 10, 480, 280)
; If file exist, load it
If FileSize(FileName) > 0
ReadFile(#File, FileName)
While Not Eof(#File)
AddGadgetItem(#Edit, -1, ReadString(#File))
Wend
CloseFile(#File)
EndIf
While WaitWindowEvent() <> #PB_Event_CloseWindow : Wend
; Save when close
OpenFile(#File, FileName)
WriteString(#File, GetGadgetText(#Edit))
CloseFile(#File)
run again: <> " tab are here
for other usage, use Regex
Re: Using PureBasic to create websites?
Well speed will depend on your skill. For example, those 0-terminated strings may be slow if used somehow like you used strings in Perl or that Go or another newbie languages (yea, today I feel sarcastic about fact that "BASIC" in 2017 generally requires more knowledges and skills than "pro"-languages :3). If your code is bad, it will work long, there is no complex compiler or JIT analysis to fix programmers stupidity.wysardry wrote: I know that PureBasic isn't likely to be as fast as Go, but I thought it would be much quicker than Perl, as the programs are already compiled. Has anyone done a speed comparison?
Anyway, results will surely be much faster/optimized than Perl. Go will also lose in speed/resources consumption, if only that will be an aim too.
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
Re: Using PureBasic to create websites?
Marc56us: Thanks. Storing the data in separate text files will make the whole process a lot easier.
Lunasole: I probably know Perl slightly better than PureBasic, but have never used Go. Although I prefer BASIC syntax, Perl is well known for its text processing capabilities, which is why I'm still slightly undecided.
Lunasole: I probably know Perl slightly better than PureBasic, but have never used Go. Although I prefer BASIC syntax, Perl is well known for its text processing capabilities, which is why I'm still slightly undecided.