kaleidawave / ezno

A fast and correct TypeScript type checker and compiler with additional experiments
https://kaleidawave.github.io/posts/introducing-ezno/
MIT License
2.48k stars 48 forks source link

Getting started section? #13

Closed wraiford closed 4 months ago

wraiford commented 1 year ago

This looks interesting and I'd like to try it out. I've gone through both blog posts, the readme, some code and all of the issues. From my reading of the readme, I infer it to ultimately be a tsc drop-in replacement.

I know you're probably very busy, but could you write/point me to a short "Getting Started" or "Migrating From Tsc" explainer for (incredibly) lazy people like me just to check it out on a barebones minimal TS example project? (preferably using esm!)

aside

It seems interesting to me that you're combining JS+TS+WASM here (and Rust!), especially in light of the now-archived prism lib (looked fabulous!!). I saw that got no love in the issues section which I can definitely relate to, but that lib (and I'm guessing this related compiler+checker) is at the very least related to what I'm looking for.

And all of this stems from my wanting to create a lower level reactive front end from my DLT architecture, and heavier frameworks have a lot of baggage that wouldn't leverage the unique content addressing.

kaleidawave commented 1 year ago

Awesome, thanks for checking it out. Glad to see you are excited by the idea. At the moment it is in the stage of getting things working and adding more features. Only the parser code is public, none of the type checking. So currently there isn't a huge use case to adding to projects, but features are slowly rolling in week by week. I will say that at the moment the README is a bit behind. I do need to update it with the build command I added a few days ago! and I should put more focus into documenting how to use and get started on features. That is a good idea.

That is cool that you found Prism. This project is based on a lot of learnings from that. Have been a bit occupied by the parser and checker the past few months to work on the framework compiler side of Ezno. Hopefully some progress on that in the future.

wraiford commented 1 year ago

I definitely see that it's early days still for this project, but I went ahead and asked for a couple of reasons:

The combination of these factors means I could give you some test trials of slowly increasing complexity in the near term. I am not remotely proficient with compiler internals, though I've worked with ASTs in Elixir a couple years ago and C# Expressions many years before that, and it might do me good to see where yours breaks in its nascency, in addition to giving you the feedback.

In the long term, though who knows where the open source wind blows, it is conceivable I could put your Prism v2/Ezno front end "framework compiler" to good use. I don't want to spam your issues with too many details of me, me, me, but I've come to realize my DLT code will at some point here be very much like an FP compiler working on a distributed computer (though internally it works very similarly to git itself). As such, web components are currently the closest thing to the lowest level browser-based UI pieces that would fit in with the larger scheme of things, and like I said, I like your ideas in Prism leveraging a more opinionated type system. (As a side note just to plant the seed, I would be interested in an abstraction that enabled svg- and canvas- based controls on equal footing with current html5).

So no rush like I said, and I'll keep an eye out for when you open up the compiler side of things with a Getting Started :eyes:

And feel free to ping me if you'd like some testing as I've described. 👍

kaleidawave commented 1 year ago

Hey, now the checker is open source and available via Oxc (check discussions tab for info), you can following the example: https://gist.github.com/kaleidawave/5dcb9ec03deef1161ebf0c9d6e4b88d8 to try it out.

Putting it on a Gist is temporary (so that it can be easily modified), at some point when it works more reliable it will be put in a better place!

kaleidawave commented 4 months ago

Checker is still WIP but

There is now a browser playground: https://kaleidawave.github.io/ezno/playground/

Have a brief getting started description here: https://github.com/kaleidawave/ezno/blob/main/checker/documentation/getting-started.md

Might add a init command soon.

wraiford commented 3 months ago

Checker is still WIP but

There is now a browser playground: https://kaleidawave.github.io/ezno/playground/

Have a brief getting started description here: https://github.com/kaleidawave/ezno/blob/main/checker/documentation/getting-started.md

Might add a init command soon.

Looking very cool! On initial basic testing in the playground, I liked that...

const x: 2 = 2
let x: string = 1;

...produced two errors:

Cannot redeclare variable 'x'
Type 1 is not assignable to type string

It might be taken for granted, but I think this type of validation is a nice nuance and I'm sure there is an interesting mechanism that is able to continue to chug on the line even though there is redeclare problem. I try to do the same thing with validation in general so that you don't have to fix one error at a time and incrementally revalidate.

I'm a bit busy trying to get my version control system to alpha atm (which actually would lead to subsuming git and gitops, i.e. github for anyone interested!), but hopefully once I'm comfortable with dogfooding it myself later this year I'll have some time to check this out more fully. I have two base layer packages (helper-gib and ts-gib) which are relatively small and simple which I used for the initial testing of my version control. I would do the same thing with this, once you think it might be able to handle a small realworld package.

Thanks for getting back to this comment with the update!

kaleidawave commented 3 months ago

Thanks, that means a lot to hear! Great motivation for continuing.

Yes I learnt a lot of interesting things implementing that system. It is important that it collects errors rather than failing on the first one. Lots of interesting logic also when you reuse something that errored!