Support for Ascii compilation ends after the next LTS cycle

Developed or developing a new product in PureBasic? Tell the world about it.
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: Support for Ascii compilation ends after the next LTS cy

Post by Foz »

SpiderBasic just compiles to Javascript, so everything is done at browser level.

I think the file(s) output are UTF-8, but what the browser does with it is another question entirely.
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Support for Ascii compilation ends after the next LTS cy

Post by the.weavster »

Foz wrote:SpiderBasic just compiles to Javascript, so everything is done at browser level.

I think the file(s) output are UTF-8, but what the browser does with it is another question entirely.
But I think the default encoding of an XMLHttpRequest object is UTF8 unless a header is included with the request to state otherwise, isn't it? As with PB it's the communication with external sources where you have to pay attention to encodings.
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Support for Ascii compilation ends after the next LTS cy

Post by Little John »

I just recalled idle's ModXString contribution, which can be very useful especially in the light of this announcement.
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 543
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: Support for Ascii compilation ends after the next LTS cy

Post by bbanelli »

I don't recall this being asked, but what will happen with, for example, Cipher functions, that explicitly need to be compiled in ASCII mode now.

http://www.purebasic.com/documentation/ ... er.pb.html
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
Mindphazer
Enthusiast
Enthusiast
Posts: 340
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: Support for Ascii compilation ends after the next LTS cy

Post by Mindphazer »

marroh wrote: Odd logic, i need the feature to build ASCII exe, this is fact for me. Pointless to to discuss it, that you and other should accept.
Odd logic again
If you don't want anyone to discuss about the message you posted, then why did you post it ?? :mrgreen:
MacBook Pro 14" M1 Pro - 16 Gb - MacOS 14 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Support for Ascii compilation ends after the next LTS cy

Post by c4s »

bbanelli wrote:I don't recall this being asked, but what will happen with, for example, Cipher functions, that explicitly need to be compiled in ASCII mode now.
It has been asked on the previous page. ;) According to the PureBasic team only the examples need to be updated.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Support for Ascii compilation ends after the next LTS cy

Post by Little John »

c4s wrote:It has been asked on the previous page. ;)
First general forum rule:
Avoid reading threads. Better just write to them.
Particularly don't read the thread to which you are writing. :mrgreen:
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 543
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: Support for Ascii compilation ends after the next LTS cy

Post by bbanelli »

c4s wrote:
bbanelli wrote:I don't recall this being asked, but what will happen with, for example, Cipher functions, that explicitly need to be compiled in ASCII mode now.
It has been asked on the previous page. ;) According to the PureBasic team only the examples need to be updated.
Well, NOW I can see it. :)

Thanks and sorry for unnecessary question. ;)
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
es_91
Enthusiast
Enthusiast
Posts: 242
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: Support for Ascii compilation ends after the next LTS cy

Post by es_91 »

Shield wrote:I mentioned that it might make sense to add a special ASCII compatibility library,
basically a simplified version of the string library that allows us to apply basic operations
on "ASCII memory".
+ 280569792841
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Re: Support for Ascii compilation ends after the next LTS cy

Post by Rescator »

es_91 wrote:
Shield wrote:I mentioned that it might make sense to add a special ASCII compatibility library,
basically a simplified version of the string library that allows us to apply basic operations
on "ASCII memory".
+ 280569792841
Which is silly since that would require a ASCII compatibility library with a matching function for all string related PB functions.

And there is no such thing as ASCII memory.
ASCII are bytes with values from 0-127, although when mosty say ASCII they mean Latin-1/ISO 8859-1 (or variants) which uses the full 0-255 range.

AFAIK there are no plans to get rid of .a or .Ascii
And if needed the PeekS and PokeS functions will be tweaked/improved and I think Fred (or Freak) stated that one or two functions would be added to make it very easy to convert a Ascii string to native and from native to Ascii.

The way you would do Ascii string comparisons is that you would fetch the ascii data use the function to turn it to a native string and then compare that.
Unless you do really weird things there is no need to change anything else.
Though if you currently use .b or .a in your loops if comparing individual you should change that to be .c instead to make life a little easier down the road.

Maybe Fred/Freak/Somebody else will make a few mini-tutorials with tips'n'tricks and post those on the blog so people can tweak/fix their code over the next few months.

As to those heralding the virtues of UTF8, I agree, but sadly Windows uses 16bit "characters" and not 8bit as UTF8 does, also just because the characters are 16 and 8 does not mean they are consistently that, since they are unicode they may be extended a d thus a character may span multiple "characters".

One of the cool things with UTF8 is that it's (real-)Ascii compatible (i.e. the first 0-127 range is identical, though 128-255 is not) and that it's endian neutral.
I use UTF8 for transmitting text for storing/reading etc.
I let PureBasic convert UTF8 strings to a native string and then I do character/string stuff using native strings.
And PB programmers should start to migrate their code to do the same.
User avatar
charvista
Addict
Addict
Posts: 902
Joined: Tue Sep 23, 2008 11:38 pm
Location: Belgium

Re: Support for Ascii compilation ends after the next LTS cy

Post by charvista »

freak wrote:we decided to remove the ability to compile in ascii mode
No problem. All of my programs have the option "Create unicode executable" checked. Working smoothly.
At the rare points where Ascii is needed, I am using the flag #PB_Ascii.
- Windows 11 Home 64-bit
- PureBasic 6.04 LTS (x64)
- 64 Gb RAM
User avatar
FihmpenRouk
User
User
Posts: 27
Joined: Mon May 08, 2006 2:27 pm

Re: Support for Ascii compilation ends after the next LTS cy

Post by FihmpenRouk »

Great news that I havn't seen until now (not here much).

Ascii is an old, old fart and it's time for it to finally conform to modern techs.

Actually I don't understand why there should be a delay in dumping ascii just because some peps haven't used the since-ages-possibility to use unicode.

*If* I absolutely have to have the support for ascii, I can always use an older version of PureBasic.

Development should never be stopped by slow adapters. They can use the older versions.

Keep up the good work, developers!

When will internet upgrade to skip support for whiners and reactionaries (back pullers in my language)? :D

It's not my intention to offend any of you guys, but if you're here I guess it's because you're interested in technology. Life is limited. Let the development of technology run as fast as it can by not having to much overhead, so we can experience as much as possible in our short lifetimes - that's my point.

(for You who find bugs - pinpoint them so the programmers can find them fast instead of wasting time to cry about bugs - win win in all directions - just saying)
PureBasic occasionally since 2000 - when hacks are to be done. :smile:
User avatar
TI-994A
Addict
Addict
Posts: 2512
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Support for Ascii compilation ends after the next LTS cy

Post by TI-994A »

FihmpenRouk wrote:Development should never be stopped by slow adapters...

When will internet upgrade to skip support for whiners...
Hello there. IMHO, technology should be for everyone, be they whiners or boasters. :wink:

For those who might feel hampered by the slow pace or progress of any one technology, there's no shortage of cutting-edge technologies to adopt.

No need to whine. :lol:

Just saying.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
Thorium
Addict
Addict
Posts: 1271
Joined: Sat Aug 15, 2009 6:59 pm

Re: Support for Ascii compilation ends after the next LTS cy

Post by Thorium »

5.40 LTS is out. So i guess this is the last LTS to include ASCII.
I allready transitioned to unicode. Since this announcement i made all my new project unicode projects.
However for file formats and network protocols i am not using PB's UCS-2 or UTF-16 (whatever it may be). I am using UTF-8, which PB supports by using the UTF-8 flag on reading and writing commands.

The only inconvenience is that UTF is a variable length format, which makes some tasks a bit more complicated. To make file formats and especially network protocols secure, we need to take length in characters and length in bytes into consideration. Very important to check if buffers are big enough, etc.

Other than that i realy like it.
Would be even better if PB would use UTF-16 internaly instead of UCS-2.
User avatar
mhs
Enthusiast
Enthusiast
Posts: 101
Joined: Thu Jul 02, 2015 4:53 pm
Location: Germany
Contact:

Re: Support for Ascii compilation ends after the next LTS cy

Post by mhs »

Thorium wrote:Would be even better if PB would use UTF-16 internaly instead of UCS-2.
Windows uses UTF-16 internal for API calls, so I thought PB uses also UTF-16? Am I wrong?
Post Reply