QB64-Phoenix-Edition / QB64pe

The QB64 Phoenix Edition Repository
https://qb64phoenix.com
Other
131 stars 26 forks source link

Implementing automatic includes #561

Closed RhoSigma-QB64 closed 1 week ago

RhoSigma-QB64 commented 2 weeks ago

Long discussed, finally here :)

Also in this PR:

You may probably ignore reviewing the internal/source related commits, too many changes to the internals, so I just thought to provide the whole thing for bootstrapping.

FellippeHeitor commented 2 weeks ago

Just some trivia: The force include mechanism was already there when I adapted it for $debug; Galleon had put it in place for the old Virtual Keyboard subsystem (remember the Android dream?).

RhoSigma-QB64 commented 2 weeks ago

Just some trivia: The force include mechanism was already there when I adapted it for $debug; Galleon had put it in place for the old Virtual Keyboard subsystem (remember the Android dream?).

Aha, didn't know that.

mkilgore commented 2 weeks ago

Some thoughts on the Http changes:

After seeing this I'm thinking I was wrong about having us encode the URL for the user, I think it would be better to expose your _EncodeUrl$ and _DecodeUrl$ functions as part of the language and leave it up to the user to correctly encode the URL passed to _OpenClient (we would also remove the URL state logic from _EncodeUrl$, it would just encode whatever it is given). The problem is that there's ambiguous cases where only the user would know the correct way to encode the URL (Ex. ?foo=bar&baz). Presumably this same issue is why libcurl doesn't do the encoding automatically either, not sure why that didn't occur to me 🤦

The separate thing is libcurl inclusion. You mentioned in the comments keeping _WhatIsMyIp$ TCP/IP-based to avoid pulling in libcurl, but that won't work if $Unsafe:Http is removed - all networking programs will get libcurl because we don't know how they will use _OpenClient. It's definitely an issue worth considering, I think the only real way to avoid it is to add a new flag to replace the $Unsafe:Http flag (which admittedly is a bit ugly).