Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
ratmice
@ratmice
so codespan-reporting seems to magically deduce line numbers from the character ranges, I wasn't expecting that and wrote some stuff to track the current line number as it lexes which i'll probably revert here.
Brendan Zabarauskas
@brendanzab
hehe :) :)
ratmice
@ratmice
Anyhow, I wasn't sure if it might be beneficial if there was a way to make it only have to deal with the line at the error site, getting passed in and tracking offsets in things relative to that
so, thats why i bring it up :)
Brendan Zabarauskas
@brendanzab
oh right - interesting - you mean passing in the line of source code, rather than tracking entire files?
ratmice
@ratmice
yeah, passing in the line of the primary label for the diagnostic I believe it would be
Brendan Zabarauskas
@brendanzab
the issue with that is if you want to support errors that cross multiple files
hmm
ratmice
@ratmice
ahh, that is true -- anyhow its really not that important to fail fastest?
Brendan Zabarauskas
@brendanzab
what do you mean by that?
ratmice
@ratmice
I just mean its kind of an optimization on what might not be a hot path
Brendan Zabarauskas
@brendanzab
ahhh yeah
one thing I do worry about is incremental compilation and ranges getting out of sync with the source code, but I haven't thought too deeply about that yet
segeljakt
@segeljakt
Have you found any uses of async/await in compilers?
ratmice
@ratmice
I know matt might has this article on nonblocking lexing based on regex derivatives
ratmice
@ratmice
On ranges getting out of sync I can imagine some skiplist based thing which stores deltas at each level, so you would only have to find the place(s) that changed and update, so you have add up deltas as you iterate, but then you only have to update the node which overlaps a modification
Anyhow thats the first thing that jumps out at me -- not that I like it particularly
Markus Westerlind
@Marwes
Using async/await when compiling gluon to compile modules concurrently/in parallel
Brendan Zabarauskas
@brendanzab
yeah that stuff is super cool
you've done really cool work on that in Gluon!
Markus Westerlind
@Marwes
It isn't all roses and rainbows though, interior mutability is a PITA with async/await since futures generally must be Send
segeljakt
@segeljakt
btw, for dependent types, do you write the algorithms yourself or use a crate?
Olle Fredriksson
@ollef
In my experience people to write most of the algorithms themselves but perhaps use libraries for bits and pieces like name binding. I've never seen any libraries that handle a large part of a type checker, probably because it's not very easy to do in a way that fits more than one type system. I think https://github.com/pigworker/TypesWhoSayNi is an attempt at something like that though, but it seems it's still in a research phase.
Alexander Ivanov
@alehander92
i really wanted to play with a dsl which does it for simple type systems
maybe .. a general enough dsl is not really different from just using haskell/ocaml code to express the same thing tho
i still think there might be good shortcuts, but it probably requires a lot more studying / work
Brendan Zabarauskas
@brendanzab
yeah I think it's a cool idea
bit of a holy grail - lots of people have made attempts - but that's no reason not to try!
Alexander Ivanov
@alehander92
yes, i had many plans about that
but mostly for simple-ish languages from type system point of view ( .. i guess? or at least more like "not many edge cases")
Brendan Zabarauskas
@brendanzab
the main thing for me is performance and error reporting
and can it support stuff like IDE protocols
segeljakt
@segeljakt
to me it's all magic
the leap from types to dependent types
:grinning:
ratmice
@ratmice
is there any minimum supported rust version for pikelet?
ratmice
@ratmice
I ask, because it looks like the logos upcoming branch seems to use things only recently stablized.
Сухарик
@suhr
Travis suggests 1.31.0, but the build fails: https://travis-ci.org/github/pikelet-lang/pikelet
Brendan Zabarauskas
@brendanzab
current dev branch is next
lemme check - I think I'm on 1.40.0 for codespan
Сухарик
@suhr
So the main branch is broken and all the development happens in next.
Brendan Zabarauskas
@brendanzab
main branch should be fine, but yeah, not doing any more work on it
Сухарик
@suhr
Why not set next as the default branch?
Brendan Zabarauskas
@brendanzab
bleh, I guess I could do that :sweat_smile:
segeljakt
@segeljakt
Do you have any crate/strategy/pattern to recommend for code generation?
ratmice
@ratmice
@segeljakt haven't done any codegen in rust yet, the only crate I know of is cranelift, my general goal is to just target the manfacturer CPU model as much as possible, like the ARM machine readable architecture, or the risc-v sail model but that isn't exactly a well trodden path
segeljakt
@segeljakt
Okk, I'm just wondering what might be the best way to implement a code generator over SSA code
independent of the target language
ratmice
@ratmice
cranelift definitely has an target independent IR, (if i'm not misunderstanding) anyhow, I haven't looked at it all that much yet