I couldn't sleep, so I decided to implement "Go to definition" in Mew's LSP server. #langdev
Haven't done much recreational programming (or programming at all) this summer, but thought I would try to shoehorn in namespace support in Mew this afternoon. Wish me luck! #langdev
now parsing:
- `goto`
- labels
- loops
- returns
only need to implement variable declaration before i've gone through the easy stuff. type bounds will be a lot - and then there's expressions to implement.. yikes
finally was bothered to pick up `sdw` again. printing and some formatting:
(also *christ* that lexer is slow - what the hell did i do??)
function arg parsing. took a little longer than i might've hoped because the grammar changes between stubs & bodied functions. but it works :)
think some sort of printing is in order. rust's `fmt::Debug` prints span info which clutters `stdout` -.-
will take a look at it. it'd be an interesting use for a procedural macro (because i'd rather not have to implement manually) but i also don't want to have to make a `sdw_proc` crate ._.
working on the parser again. pretty chill. slow going because i kept changing the structure, but i got it to a state where i _think_ it'll be serviceable for the future.
i made a little way into function parsing. stubs don't work with parameters, and functions.. do something wacky anyway. it's too late for debugging, though 😅
ah well
idly messing around with a parser structure which respects errors. this _might_ work. i think it might break in more complex cases, though.
we'll see. i'll try flesh the parser out some.
re-re-writing `sdwc`. i don't really know why. just bored.
anyway i wrote a whole design doc for it so i can implement whole compiler stages at a time.
first stop: lexing. this time i actually implemented multiline errors too.
debating whether error recovery is worth it. bootstrapping the compiler with only 1 error at a time would be miserable, and retrofitting recovery later would be worse. but.. lazy..
Took a small break from Mew (my programming language) to work on other stuff, but managed to fix a nasty scope resolution bug today, which has been a headache for a while 🎉 #langdev
i might've gotten sidetracked and implemented loops, break, continue, variable reassignment & standalone function calls
I got Mew running in Helix (https://helix-editor.com) this morning. Helix doesn't support semantic highlighting, so I'm also thinking of creating a Tree-sitter syntax.
Pretty nice, though! #langdev
Why you not work, parser?
My #langdev project is stagnating because I cannot figure out why the parser fails to parse "true" as a `Expr::Bool(true)`.
I'm really proud of the diagnostics in Mew so far. Not Rust quality, but I have some ideas on how to improve it further. #langdev
After thinking a bit more #langdev stuff, my head gets itchy.
If you have only compiler builtins that can tell the compiler what to do, you should be able to strip it all down to a single compiler builtin function.
That function could then be used to define another compiler builtin for defining a type, one for defining a function, etc.
The more I think about that #langdev idea, the more I like it.
Maybe that's a route I will be exploring (as in coding the necessary changes into my lexer and parser) tomorrow at the chaostreff ... But with people around it might even a better idea talking these things through.
Okay here go my #langdev thoughts for my #functionalprogamming language.
These thoughts are unfinished and just a brain dump, I haven't thought them to end (yet).
1/7
#langdev #functionalprogamming
I just had some "shower thoughts" for my #langdev while walking 10km
I'll post them shortly. But first I have to... Well... Shower! 😂
I discovered the #langdev hashtag here on Mastodon earlier today, and it got me thinking. Is there a Discord for language creators? One where you could discuss ideas, help each other, and spitball solutions to problems?
@jsbarretto I didn't know about #langdev bit definutely my cup of tea. I'm currently building a language called Mew, a task orchestration language, which currently compiles to CIL. I will open source it once the compiler architecture becomes a bit more stable.