Patrik Svensson · @patriksvensson
1092 followers · 721 posts · Server mstdn.social

I couldn't sleep, so I decided to implement "Go to definition" in Mew's LSP server.

#langdev

Last updated 2 years ago

Patrik Svensson · @patriksvensson
1090 followers · 712 posts · Server mstdn.social

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

Last updated 2 years ago

0x5DA · @0x5DA
24 followers · 384 posts · Server fosstodon.org

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

#langdev #sdw

Last updated 2 years ago

0x5DA · @0x5DA
24 followers · 376 posts · Server fosstodon.org

finally was bothered to pick up `sdw` again. printing and some formatting:

(also *christ* that lexer is slow - what the hell did i do??)

#langdev #sdw

Last updated 2 years ago

0x5DA · @0x5DA
23 followers · 365 posts · Server fosstodon.org

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 ._.

#langdev #sdw

Last updated 2 years ago

0x5DA · @0x5DA
23 followers · 361 posts · Server fosstodon.org

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

#langdev #sdw

Last updated 2 years ago

0x5DA · @0x5DA
24 followers · 347 posts · Server fosstodon.org

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.

#langdev #sdw

Last updated 2 years ago

0x5DA · @0x5DA
24 followers · 346 posts · Server fosstodon.org

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..

#langdev #sdw

Last updated 2 years ago

Patrik Svensson · @patriksvensson
1037 followers · 573 posts · Server mstdn.social

Symbol resolution seems to work correctly as well now.

#langdev

Last updated 2 years ago

Patrik Svensson · @patriksvensson
1037 followers · 573 posts · Server mstdn.social

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

Last updated 2 years ago

0x5DA · @0x5DA
13 followers · 115 posts · Server fosstodon.org

i might've gotten sidetracked and implemented loops, break, continue, variable reassignment & standalone function calls

#sdw #langdev

Last updated 2 years ago

Patrik Svensson · @patriksvensson
1008 followers · 523 posts · Server mstdn.social

I got Mew running in Helix (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

Last updated 2 years ago

musicmatze :rust: :nixos: · @musicmatze
813 followers · 1968 posts · Server social.linux.pizza

Why you not work, parser?

My project is stagnating because I cannot figure out why the parser fails to parse "true" as a `Expr::Bool(true)`.

#langdev

Last updated 2 years ago

Patrik Svensson · @patriksvensson
1008 followers · 523 posts · Server mstdn.social

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

Last updated 2 years ago

musicmatze :rust: :nixos: · @musicmatze
805 followers · 1884 posts · Server social.linux.pizza

After thinking a bit more 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.

#langdev

Last updated 2 years ago

musicmatze :rust: :nixos: · @musicmatze
805 followers · 1871 posts · Server social.linux.pizza

The more I think about that 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.

#langdev

Last updated 2 years ago

musicmatze :rust: :nixos: · @musicmatze
805 followers · 1871 posts · Server social.linux.pizza

Okay here go my thoughts for my language.

These thoughts are unfinished and just a brain dump, I haven't thought them to end (yet).

1/7

#langdev #functionalprogamming

Last updated 2 years ago

musicmatze :rust: :nixos: · @musicmatze
805 followers · 1863 posts · Server social.linux.pizza

I just had some "shower thoughts" for my while walking 10km

I'll post them shortly. But first I have to... Well... Shower! 😂

#langdev

Last updated 2 years ago

Patrik Svensson · @patriksvensson
998 followers · 447 posts · Server mstdn.social

I discovered the 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?

#langdev

Last updated 2 years ago

Patrik Svensson · @patriksvensson
998 followers · 447 posts · Server mstdn.social

@jsbarretto I didn't know about 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.

#langdev

Last updated 2 years ago