by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 09:33
    Strum355 starred brendanzab/codespan
  • Aug 10 17:18
    pocket7878 starred brendanzab/codespan
  • Aug 10 04:47
    Kixiron edited #274
  • Aug 04 17:58
    SirWindfield starred brendanzab/codespan
  • Aug 02 21:41
    Kixiron synchronize #274
  • Aug 02 21:40
    Kixiron synchronize #274
  • Aug 02 21:39
    Kixiron opened #274
  • Aug 01 18:21
    Kixiron commented #102
  • Aug 01 16:20
  • Aug 01 12:12
    Stupremee commented #273
  • Aug 01 11:59
    Johann150 commented #273
  • Aug 01 11:57
    Johann150 commented #273
  • Aug 01 10:34
    Stupremee edited #273
  • Aug 01 10:31
    Stupremee edited #273
  • Aug 01 10:30
    Stupremee opened #273
  • Aug 01 09:50
    brendanzab commented #102
  • Aug 01 09:44
    Stupremee commented #102
  • Aug 01 05:47
    brendanzab opened #272
  • Jul 31 03:31
    jonnyboyC starred brendanzab/codespan
  • Jul 30 07:48
    chbdetta starred brendanzab/codespan
segeljakt
@segeljakt
image.png
Brendan Zabarauskas
@brendanzab
oh woah
lol
check out the repl example - not sure if that helps or not
not sure what you mean by "how do you read the input?"
segeljakt
@segeljakt
I got a REPL which works locally (linefeed) but I don't think I can use it in the browser
segeljakt
@segeljakt
holy moly, it finally works https://segeljakt.github.io/arc-script/
Ctrl+L to clear
matt rice
@ratmice
I only see white boxes in place of text
None the less pretty cool :D
Brendan Zabarauskas
@brendanzab
maybe an issue with the fonts being used?
matt rice
@ratmice
yeah, that was my guess as awell
segeljakt
@segeljakt
hmm, interesting
segeljakt
@segeljakt
I'm trying to bring support for the online repl into linefeed, I think it's gonna work šŸ¤©
Brendan Zabarauskas
@brendanzab
Screen Shot 2020-05-13 at 9.34.03 pm.png
lol, trying to get the underline rendering on the same line @ratmice
matt rice
@ratmice
yeah that output was kind of a mess, but in my defense it doesn't panic!
matt rice
@ratmice
so is the right thing to do here, just to separate these out into either different tests, or different lines?
that they currently are all on one line is somewhat inconsequential to the tests purpose.
Brendan Zabarauskas
@brendanzab
yeah, possibly! I could try that
more just trying to get the underline in the right place
Brendan Zabarauskas
@brendanzab
I did a bit more work on the underlines last night. got the single underline working - now I need to figure out how to render the messages around it! But yeah, slowly making progressā€¦
Brendan Zabarauskas
@brendanzab
Made a draft PR here: brendanzab/codespan#241
matt rice
@ratmice
nice, so IIUC all that unicode boundary/slice handling, in label_single managed to get moved into a single iter over char_indices()?
Brendan Zabarauskas
@brendanzab
yeah!
but for some reason it's slightly offset
(see the snapshot errors)
matt rice
@ratmice
So in the AnonLabel struct from #229 I did some cursory look to see if it was possible in the case of FileId: Sized to reserve size_of in the struct but couldn't get it working without GATs, so you could avoid that extra move between Label/AnonLabel construction, I'm guessing it'd probably be possible using something like Option<NonZero*> as FileId but seems kind of a burden on users of the public API. Not actually sure that move even really matters.
the problem being you have to declare it with [u8; std::mem::size_of::<FileId: Sized>()] or some such
I guess probably i'm thinking wrong and just using MaybeUninitialized<FileId>
matt rice
@ratmice
Anyhow, getting out of my safe rust comfort zone in trying to avoid that move :)
matt rice
@ratmice
Well, let me know if this is something you believe worth investigating more.
Brendan Zabarauskas
@brendanzab
Yeah - we might need to play around with the API a bit - I guess I'm just finding it hard to visualise a solution.
Like, I was thinking maybe we could investigate other ways to build up a diagnostic. Like maybe we could have some way of building up a tree, like:
Diagnostic::error()
    FileLabel::primary(file_id, range)
    FileLabel::secondary(file_id, range)
    FileLabel::secondary(file_id, range)
FileDiagnostic::error(file_id)
    Label::primary(range)
    Label::secondary(range)
    FileLabel::secondary(file_id, range)
matt rice
@ratmice
Well, trying with MaybeUninit isn't working either because Label<FileId>, and AnonLabel<FileId> which differ only by the file_id: FileId vs file_id:MaybeUninit<FileId> still aren't guaranteed to be the same size, since they could have different field order which changes alignment I guess
Brendan Zabarauskas
@brendanzab
tbh MaybeUninit<FileId> seems rather heavy handed?
I'd rather avoid unsafe in codespan if I can help it :sweat_smile:
matt rice
@ratmice
yeah tend to agree was mostly curious if it couldn't be made to work, and if it did might be a reason to include since it's more efficient or something -- as it is what I have there is no advantage for bringing it in beyond convenience of not having to declare it yourself (which I guess is something).
Brendan Zabarauskas
@brendanzab
ahh righto
Brendan Zabarauskas
@brendanzab
added some more test cases for overlapping stuff
matt rice
@ratmice
Well, I did get a MaybeUninit variation working (essentially by making Label a newtype around AnonLabel) -- then immediately realized godbolt wasn't by default adding optimizations here, so the actual cost of the wrapper struct isn't actually so bad... Anyhow going to stop messing with that, as it didn't seem worth it really
Brendan Zabarauskas
@brendanzab
heh, can be nice to play around to see what happens though!
Brendan Zabarauskas
@brendanzab
Screen Shot 2020-05-17 at 12.30.09 pm.png
making some amount of progress
Brendan Zabarauskas
@brendanzab
Screen Shot 2020-05-17 at 4.14.52 pm.png
matt rice
@ratmice
I Imagine there probably isn't any characters which implement these edge crossing notches bridges
Brendan Zabarauskas
@brendanzab
yeah that would be so neat
need to bug the unicode consortium
matt rice
@ratmice
yeah, if u292b & c were just orthogonal/not rotated they would work too
segeljakt
@segeljakt
@brendanzab have you thought about writing a paper or something about this? many programming languages could benefit from this quality of error messages