jakt icon indicating copy to clipboard operation
jakt copied to clipboard

typechecker: Typecheck format-strings and don't allocate them as Strings

Open Hendiadyoin1 opened this issue 2 years ago • 6 comments

This will stop us from writing illegal format-strings, which would otherwise cause segfaults at runtime.

Hendiadyoin1 avatar Aug 10 '22 12:08 Hendiadyoin1

Hmm, I'm trying to remember - I thought we didn't want indexing of strings because we wanted to move to utf8?

sophiajt avatar Aug 10 '22 17:08 sophiajt

Made is use String::byte_at now

Hendiadyoin1 avatar Aug 11 '22 11:08 Hendiadyoin1

Update, now works on println etc and the format string on its own should not allocate anymore

Hendiadyoin1 avatar Aug 11 '22 13:08 Hendiadyoin1

I think I fixed it up with the new layout and made it work with the interpreter, @alimpfard can you check this again?

Hendiadyoin1 avatar Aug 12 '22 12:08 Hendiadyoin1

First commit lgtm, but as I said before, I don't like the entirely separate expression type, it's a hack on top of a hack (specialised typecheck for format) meant to bypass another hack (no overloaded strings or literal "optimisation") - that's too many hacks.

alimpfard avatar Aug 12 '22 12:08 alimpfard

Well then I will drop that part for now...

Hendiadyoin1 avatar Aug 12 '22 12:08 Hendiadyoin1

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

stale[bot] avatar Jan 01 '23 12:01 stale[bot]

This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions!

stale[bot] avatar Jan 09 '23 05:01 stale[bot]