The is keyword seems really nice, I wish TypeScript had it. Your syntax for indexing tuples is cool!
Yeah implementing ADT/union types in TypeScript is doable, but very bulky, when really they shouldn't be that much more complicated than an advanced enum. The ideal syntax is probably a pattern-matching syntax which would look something like:
switch (am) {
case no: { ... }
case frame:(i) { ... }
case loop:(delay, frames) { ... }
case seq:(delay, frames) { ... }
}
But I'm trying to keep the syntax as minimalist as possible rn so idk.
- What is no on line 3?
It's just another case for the ADT, one that takes no arguments. Basically just a default, altho kinda unnecessary since it has the same meaning as frame:(0) as defined.
- Are you going to implement some kind of checker that runs in the editor? Is that thing separate from a syntax highlighter? I have no clue ^_^
I know what youre talking about, that is different from syntax highlighting, but not sure what it's called either. Rn I almost exclusively work in Sublime Text, which doesn't really do that kind of error highlighting since it's just a text editor at heart (maybe there is some plugin/package that does for some languages tho idk).
I think usually you would need to develop for a specific IDE to get error highlighting. Maybe I would think about it in the distant future, but even getting the compiler to spit out decent error messages is kind of a chore. In general I think error handling is the worst part of making a language lol.