jkotlinski / durexforth

Modern C64 Forth
Other
230 stars 28 forks source link

Multi-line EVALUATE #556

Closed jkotlinski closed 1 year ago

jkotlinski commented 1 year ago

Closes #545.

jkotlinski commented 1 year ago

I think one thing to consider is: instead of adding INCLUDE-STRING, one could just as well replace EVALUATE.

That would save some code space. I cannot think of any negative consequences, besides EVALUATE being non-standard.

jkotlinski commented 1 year ago

What do you think @ekipan ?

ekipan commented 1 year ago

I don't have any experience implementing this stuff and only tentatively understand much of the code, to say nothing of considering all the other implementors of the Forth standard, so I'm hesitant to offer opinions. I guess the short of it is that I'm happy v can compile my code.

But since you asked, here they are, weakly-held and also contradictory: (1) Anton has a point that it should probably have a different name but (2) honestly I don't see much point in an EVALUATE that doesn't support \-comments but (3) the whole REFILL SOURCE-ID scheme seems like extra complexity to support files that might be larger than RAM so is necessary but (4) the standard EVALUATE is simpler and (5) it could be argued \ should probably understand what a newline is but (6) my attempt did indeed prove a bit hacky and also (7) I see the appeal in having consistency between INCLUDED and EVALUATE but but but etc.

I don't think I'm qualified here. Thanks for fixing v!

jkotlinski commented 1 year ago

Right, there is a lot of tradeoffs and I changed my mind so many times.

What made me convinced about having a custom REFILL behavior for reading from RAM buffers line-by-line, is that Mitch wrote that it is the proper way to do it.

About if multiline EVALUATE is the right way forward for Forth as a language, I guess that remains to see. Personally I think it would make a lot of sense, to have it as an optional extension in FILE wordset.

tis 9 maj 2023 kl. 07:38 skrev ekipan @.***>:

I don't have any experience implementing this stuff and only tentatively understand much of the code, to say nothing of considering all the other implementors of the Forth standard, so I'm hesitant to offer opinions. I guess the short of it is that I'm happy v can compile my code.

But since you asked, here they are, weakly-held and also contradictory: (1) Anton has a point that it should probably have a different name but (2) honestly I don't see much point in an EVALUATE that doesn't support -comments but (3) the whole REFILL SOURCE-ID scheme seems like extra complexity to support files that might be larger than RAM so is necessary but (4) the standard EVALUATE is simpler and (5) it could be argued \ should probably understand what a newline is but (6) my attempt did indeed prove a bit hacky and also (7) I see the appeal in having consistency between INCLUDED and EVALUATE but but but etc.

I don't think I'm qualified here. Thanks for fixing v!

— Reply to this email directly, view it on GitHub https://github.com/jkotlinski/durexforth/pull/556#issuecomment-1539108118, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAY34O3XVFSTSFKI4ODIRG3XFHJ4HANCNFSM6AAAAAAXXQE7BM . You are receiving this because you authored the thread.Message ID: @.***>